diff --git a/.gitattributes b/.gitattributes
index 95872b467d96c217c309afc34c61b9fa0c661469..4c8680b2ab683ed90eb2850baf05d55ad55608cd 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -296,532 +296,6 @@ CEP/Calibration/pystationresponse/test/tStationBeamNCP.in.MS/table.info -text
 CEP/Calibration/pystationresponse/test/tStationBeamNCP.in.MS/table.lock -text
 CEP/Calibration/pystationresponse/test/tStationBeamNCP.py -text
 CEP/Calibration/pystationresponse/test/tStationBeamNCP.sh -text
-CEP/DP3/AOFlagger/CHANGELOG -text
-CEP/DP3/AOFlagger/CMakeLists.txt -text
-CEP/DP3/AOFlagger/README -text
-CEP/DP3/AOFlagger/detectrfi.kdevelop -text
-CEP/DP3/AOFlagger/detectrfi.kdevelop.filelist -text
-CEP/DP3/AOFlagger/doc/site/CHANGELOG -text
-CEP/DP3/AOFlagger/doc/site/faq.html -text
-CEP/DP3/AOFlagger/doc/site/gui-tutorial.html -text
-CEP/DP3/AOFlagger/doc/site/img/rfi-example-A0.png -text
-CEP/DP3/AOFlagger/doc/site/img/rfi-example-A1.png -text
-CEP/DP3/AOFlagger/doc/site/img/rfi-example-A10.png -text
-CEP/DP3/AOFlagger/doc/site/img/rfi-example-A11.png -text
-CEP/DP3/AOFlagger/doc/site/img/rfi-example-A12.png -text
-CEP/DP3/AOFlagger/doc/site/img/rfi-example-A13.png -text
-CEP/DP3/AOFlagger/doc/site/img/rfi-example-A14.png -text
-CEP/DP3/AOFlagger/doc/site/img/rfi-example-A15.png -text
-CEP/DP3/AOFlagger/doc/site/img/rfi-example-A16.png -text
-CEP/DP3/AOFlagger/doc/site/img/rfi-example-A2.png -text
-CEP/DP3/AOFlagger/doc/site/img/rfi-example-A3.png -text
-CEP/DP3/AOFlagger/doc/site/img/rfi-example-A4.png -text
-CEP/DP3/AOFlagger/doc/site/img/rfi-example-A5.png -text
-CEP/DP3/AOFlagger/doc/site/img/rfi-example-A6.png -text
-CEP/DP3/AOFlagger/doc/site/img/rfi-example-A7.png -text
-CEP/DP3/AOFlagger/doc/site/img/rfi-example-A8.png -text
-CEP/DP3/AOFlagger/doc/site/img/rfi-example-A9.png -text
-CEP/DP3/AOFlagger/doc/site/img/rfigui-editstrategywindow.png -text
-CEP/DP3/AOFlagger/doc/site/img/rfigui-goto.png -text
-CEP/DP3/AOFlagger/doc/site/img/rfigui-gotowindow.png -text
-CEP/DP3/AOFlagger/doc/site/img/rfigui-mainwindow-loaded.png -text
-CEP/DP3/AOFlagger/doc/site/img/rfigui-mainwindow.png -text
-CEP/DP3/AOFlagger/doc/site/img/rfigui-openms.png -text
-CEP/DP3/AOFlagger/doc/site/img/rfigui-openoptions.png -text
-CEP/DP3/AOFlagger/doc/site/img/rfigui-plotmenu.png -text
-CEP/DP3/AOFlagger/doc/site/index.html -text
-CEP/DP3/AOFlagger/doc/site/reading-mode.html -text
-CEP/DP3/AOFlagger/doc/site/strategy-example-a.html -text
-CEP/DP3/AOFlagger/doc/site/style.css -text
-CEP/DP3/AOFlagger/include/AOFlagger/CMakeLists.txt -text
-CEP/DP3/AOFlagger/include/AOFlagger/baseexception.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/blaswrap.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/cleaner.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/configuration.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/f2c.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/addstrategyactionmenu.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/antennamap/antenna.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/antennamap/antennamap.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/antennamap/antennamapwidget.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/antennamap/clock.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/antennamap/spectrumanalyzer.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/antennamap/spectrumanalyzerchannel.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/antennamapwindow.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/application.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/complexplaneplotwindow.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/editstrategywindow.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/gotowindow.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/highlightwindow.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/histogramwindow.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/imagecomparisonwidget.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/imageplanewindow.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/imagepropertieswindow.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/imagewidget.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/msoptionwindow.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/mswindow.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/noisestatoptionwindow.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/numinputdialog.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/plot/colorscale.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/plot/dimension.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/plot/horizontalplotscale.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/plot/plot2d.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/plot/plot2dpointset.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/plot/plotable.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/plot/plotmanager.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/plot/plotpropertieswindow.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/plot/plotwidget.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/plot/system.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/plot/tickset.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/plot/verticalplotscale.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/plotframe.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/plotwindow.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/progresswindow.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/quality/antennaeplotpage.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/quality/aoqplotwindow.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/quality/baselineplotpage.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/quality/blengthplotpage.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/quality/datawindow.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/quality/frequencyplotpage.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/quality/grayscaleplotpage.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/quality/histogrampage.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/quality/openoptionswindow.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/quality/summarypage.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/quality/timefrequencyplotpage.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/quality/timeplotpage.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/quality/twodimensionalplotpage.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/rawoptionwindow.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/absthresholdframe.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/baselineselectionframe.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/changeresolutionframe.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/cutareaframe.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/directionprofileframe.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/foreachbaselineframe.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/foreachcomplexcomponentframe.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/foreachmsframe.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/foreachpolarisationframe.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/frequencyconvolutionframe.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/fringestoppingframe.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/highpassfilterframe.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/iterationframe.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/plotframe.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/resamplingframe.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/setflaggingframe.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/setimageframe.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/slidingwindowfitframe.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/spatialcompositionframe.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/statisticalflaggingframe.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/sumthresholdframe.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/svdframe.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/timeconvolutionframe.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/timeselectionframe.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/uvprojectframe.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/gui/tfstatoptionwindow.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/imaging/defaultmodels.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/imaging/fourproductcorrelatortester.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/imaging/model.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/imaging/observatorium.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/imaging/uvimager.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/imaging/zenithimager.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/msio/antennainfo.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/msio/arraycolumniterator.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/msio/baselinematrixloader.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/msio/baselinereader.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/msio/colormap.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/msio/date.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/msio/directbaselinereader.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/msio/fitsfile.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/msio/image2d.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/msio/indirectbaselinereader.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/msio/mask2d.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/msio/measurementset.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/msio/memorybaselinereader.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/msio/msrowdata.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/msio/msrowdataext.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/msio/parmtable.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/msio/pngfile.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/msio/rawdescfile.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/msio/rawreader.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/msio/rspreader.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/msio/samplerow.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/msio/scalarcolumniterator.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/msio/segmentedimage.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/msio/sortedtimestepaccessor.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/msio/spatialmatrixmetadata.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/msio/spatialtimeloader.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/msio/stokesimager.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/msio/system.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/msio/timefrequencydata.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/msio/timefrequencyimager.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/msio/timefrequencymetadata.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/msio/timestepaccessor.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/msio/types.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/msio/xyswappedmask2d.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/quality/baselinestatisticsmap.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/quality/defaultstatistics.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/quality/histogramcollection.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/quality/histogramtablesformatter.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/quality/loghistogram.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/quality/qualitytablesformatter.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/quality/rayleighfitter.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/quality/statisticalvalue.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/quality/statisticscollection.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/quality/statisticsderivator.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/ref/concatenatescript.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/ref/copyallscript.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/ref/flagallscript.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/ref/listnodes.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/ref/listsets.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/ref/reffile.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/ref/reffileentry.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/ref/reffileexception.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/ref/refmovescript.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/remote/client.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/remote/clusteredobservation.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/remote/format.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/remote/nodecommandmap.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/remote/observationtimerange.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/remote/processcommander.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/remote/remoteprocess.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/remote/server.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/remote/serverconnection.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/absthresholdaction.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/action.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/adapter.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/addstatisticsaction.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/baselineselectionaction.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/changeresolutionaction.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/collectnoisestatisticsaction.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/combineflagresultsaction.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/cutareaaction.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/directionalcleanaction.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/directionprofileaction.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/eigenvalueverticalaction.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/foreachbaselineaction.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/foreachcomplexcomponentaction.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/foreachmsaction.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/foreachpolarisationaction.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/foreachsimulatedbaselineaction.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/fouriertransformaction.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/frequencyconvolutionaction.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/frequencyselectionaction.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/fringestopaction.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/highpassfilteraction.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/imageraction.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/iterationaction.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/normalizevarianceaction.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/plotaction.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/quickcalibrateaction.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/rawappenderaction.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/resamplingaction.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/setflaggingaction.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/setimageaction.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/slidingwindowfitaction.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/slidingwindowfitparameters.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/spatialcompositionaction.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/statisticalflagaction.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/strategyaction.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/sumthresholdaction.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/svdaction.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/timeconvolutionaction.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/timeselectionaction.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/uvprojectaction.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/writedataaction.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/writeflagsaction.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/baselineselector.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/baselinetimeplaneimager.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/cnoisestatistics.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/convolutions.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/eigenvalue.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/fringestoppingfitter.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/fringetestcreater.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/highpassfilter.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/imagetile.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/interpolatenansalgorithm.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/localfitmethod.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/medianwindow.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/methoditerator.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/mitigationtester.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/morphology.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/noisestatistics.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/noisestatisticscollector.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/polarizationstatistics.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/polfitmethod.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/rfistatistics.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/sinusfitter.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/siroperator.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/statisticalflagger.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/surfacefitmethod.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/svdmitigater.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/thresholdconfig.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/thresholdmitigater.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/thresholdtools.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/tiledimage.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/timefrequencystatistics.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/types.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/uvprojection.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/vertevd.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/control/actionblock.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/control/actioncontainer.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/control/actionfactory.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/control/artifactset.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/control/defaultstrategyset.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/control/strategyiterator.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/control/strategyreader.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/control/strategywriter.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/control/types.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/imagesets/fitsimageset.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/imagesets/harishreader.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/imagesets/imageset.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/imagesets/msimageset.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/imagesets/noisestatimageset.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/imagesets/parmimageset.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/imagesets/rawdescimageset.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/imagesets/rawimageset.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/imagesets/rspimageset.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/imagesets/singleimageset.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/imagesets/spatialmsimageset.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/imagesets/spatialtimeimageset.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/imagesets/timefrequencystatimageset.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/plots/antennaflagcountplot.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/plots/frequencyflagcountplot.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/plots/frequencypowerplot.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/plots/iterationsplot.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/plots/rfiplots.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/strategy/plots/timeflagcountplot.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/test/experiments/defaultstrategyspeedtest.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/test/experiments/experimentstestgroup.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/test/experiments/filterresultstest.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/test/experiments/highpassfilterexperiment.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/test/experiments/rankoperatorrocexperiment.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/test/experiments/scaleinvariantdilationexperiment.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/test/msio/msiotestgroup.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/test/quality/qualitytablesformattertest.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/test/quality/qualitytestgroup.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/test/quality/statisticscollectiontest.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/test/quality/statisticsderivatortest.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/test/strategy/algorithms/algorithmstestgroup.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/test/strategy/algorithms/convolutionstest.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/test/strategy/algorithms/dilationtest.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/test/strategy/algorithms/eigenvaluetest.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/test/strategy/algorithms/highpassfiltertest.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/test/strategy/algorithms/noisestatisticscollectortest.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/test/strategy/algorithms/noisestatisticstest.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/test/strategy/algorithms/siroperatortest.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/test/strategy/algorithms/statisticalflaggertest.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/test/strategy/algorithms/sumthresholdtest.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/test/strategy/algorithms/thresholdtoolstest.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/test/testingtools/asserter.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/test/testingtools/equalsasserter.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/test/testingtools/imageasserter.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/test/testingtools/lessthanasserter.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/test/testingtools/maskasserter.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/test/testingtools/testgroup.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/test/testingtools/testitem.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/test/testingtools/unittest.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/test/util/numberparsertest.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/test/util/utiltestgroup.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/types.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/util/aologger.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/util/autoarray.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/util/compress.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/util/ffttools.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/util/integerdomain.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/util/lane.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/util/multiplot.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/util/numberparser.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/util/parameter.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/util/plot.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/util/progresslistener.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/util/rng.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/util/roctree.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/util/serializable.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/util/statwriter.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/util/stopwatch.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/util/types.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/util/xmlwriter.h -text
-CEP/DP3/AOFlagger/include/AOFlagger/vectortypes.h -text
-CEP/DP3/AOFlagger/package.dox -text
-CEP/DP3/AOFlagger/scripts/CMakeLists-AOFlagger-without-lofarstman.txt -text
-CEP/DP3/AOFlagger/scripts/CMakeLists-CEP.txt -text
-CEP/DP3/AOFlagger/scripts/CMakeLists-Common-src-without-lofarstman.txt -text
-CEP/DP3/AOFlagger/scripts/CMakeLists-Common-without-lofarstman.txt -text
-CEP/DP3/AOFlagger/scripts/CMakeLists-DP3.txt -text
-CEP/DP3/AOFlagger/scripts/CMakeLists-LCS.txt -text
-CEP/DP3/AOFlagger/scripts/CMakeLists-RTCP.txt -text
-CEP/DP3/AOFlagger/scripts/CMakeLists-root-without-lofarstman.txt -text
-CEP/DP3/AOFlagger/scripts/CMakeLists-root.txt -text
-CEP/DP3/AOFlagger/scripts/distributed/async.sh -text
-CEP/DP3/AOFlagger/scripts/distributed/baseline-slopes.sh -text
-CEP/DP3/AOFlagger/scripts/distributed/collect-baseline.sh -text
-CEP/DP3/AOFlagger/scripts/distributed/collect-eor.sh -text
-CEP/DP3/AOFlagger/scripts/distributed/collect.sh -text
-CEP/DP3/AOFlagger/scripts/distributed/dist-eor.sh -text
-CEP/DP3/AOFlagger/scripts/distributed/killall.sh -text
-CEP/DP3/AOFlagger/scripts/distributed/list-nodes.sh -text
-CEP/DP3/AOFlagger/scripts/distributed/list.sh -text
-CEP/DP3/AOFlagger/scripts/distributed/nodes.txt -text
-CEP/DP3/AOFlagger/scripts/distributed/process.sh -text
-CEP/DP3/AOFlagger/scripts/distributed/progress.sh -text
-CEP/DP3/AOFlagger/scripts/distributed/sets.txt -text
-CEP/DP3/AOFlagger/scripts/distributed/single-eor.sh -text
-CEP/DP3/AOFlagger/scripts/distributed/single.sh -text
-CEP/DP3/AOFlagger/scripts/distributed/statistics.rfis -text
-CEP/DP3/AOFlagger/scripts/package-without-lofarstman.sh -text
-CEP/DP3/AOFlagger/scripts/package.sh -text
-CEP/DP3/AOFlagger/src/CMakeLists.txt -text
-CEP/DP3/AOFlagger/src/aofrequencyfilter-old.cpp -text
-CEP/DP3/AOFlagger/src/aofrequencyfilter.cpp -text
-CEP/DP3/AOFlagger/src/aoqplot.cpp -text
-CEP/DP3/AOFlagger/src/aoquality.cpp -text
-CEP/DP3/AOFlagger/src/aorefscript.cpp -text
-CEP/DP3/AOFlagger/src/aoremoteclient.cpp -text
-CEP/DP3/AOFlagger/src/aostats.cpp -text
-CEP/DP3/AOFlagger/src/badstations.cpp -text
-CEP/DP3/AOFlagger/src/cleaner.cpp -text
-CEP/DP3/AOFlagger/src/colormapper.cpp -text
-CEP/DP3/AOFlagger/src/createuv.cpp -text
-CEP/DP3/AOFlagger/src/flag.cpp -text
-CEP/DP3/AOFlagger/src/flagtest.cpp -text
-CEP/DP3/AOFlagger/src/gui/antennamap/antenna.cpp -text
-CEP/DP3/AOFlagger/src/gui/antennamap/antennamap.cpp -text
-CEP/DP3/AOFlagger/src/gui/application.cpp -text
-CEP/DP3/AOFlagger/src/gui/complexplaneplotwindow.cpp -text
-CEP/DP3/AOFlagger/src/gui/editstrategywindow.cpp -text
-CEP/DP3/AOFlagger/src/gui/gotowindow.cpp -text
-CEP/DP3/AOFlagger/src/gui/highlightwindow.cpp -text
-CEP/DP3/AOFlagger/src/gui/imagecomparisonwidget.cpp -text
-CEP/DP3/AOFlagger/src/gui/imageplanewindow.cpp -text
-CEP/DP3/AOFlagger/src/gui/imagepropertieswindow.cpp -text
-CEP/DP3/AOFlagger/src/gui/imagewidget.cpp -text
-CEP/DP3/AOFlagger/src/gui/msoptionwindow.cpp -text
-CEP/DP3/AOFlagger/src/gui/mswindow.cpp -text
-CEP/DP3/AOFlagger/src/gui/noisestatoptionwindow.cpp -text
-CEP/DP3/AOFlagger/src/gui/plot/colorscale.cpp -text
-CEP/DP3/AOFlagger/src/gui/plot/horizontalplotscale.cpp -text
-CEP/DP3/AOFlagger/src/gui/plot/plot2d.cpp -text
-CEP/DP3/AOFlagger/src/gui/plot/plotpropertieswindow.cpp -text
-CEP/DP3/AOFlagger/src/gui/plot/plotwidget.cpp -text
-CEP/DP3/AOFlagger/src/gui/plot/verticalplotscale.cpp -text
-CEP/DP3/AOFlagger/src/gui/plotframe.cpp -text
-CEP/DP3/AOFlagger/src/gui/progresswindow.cpp -text
-CEP/DP3/AOFlagger/src/gui/quality/aoqplotwindow.cpp -text
-CEP/DP3/AOFlagger/src/gui/quality/baselineplotpage.cpp -text
-CEP/DP3/AOFlagger/src/gui/quality/datawindow.cpp -text
-CEP/DP3/AOFlagger/src/gui/quality/grayscaleplotpage.cpp -text
-CEP/DP3/AOFlagger/src/gui/quality/histogrampage.cpp -text
-CEP/DP3/AOFlagger/src/gui/quality/timefrequencyplotpage.cpp -text
-CEP/DP3/AOFlagger/src/gui/quality/twodimensionalplotpage.cpp -text
-CEP/DP3/AOFlagger/src/gui/rawoptionwindow.cpp -text
-CEP/DP3/AOFlagger/src/gui/tfstatoptionwindow.cpp -text
-CEP/DP3/AOFlagger/src/imaging/fourproductcorrelatortester.cpp -text
-CEP/DP3/AOFlagger/src/imaging/model.cpp -text
-CEP/DP3/AOFlagger/src/imaging/uvimager.cpp -text
-CEP/DP3/AOFlagger/src/imaging/zenithimager.cpp -text
-CEP/DP3/AOFlagger/src/imgzenith.cpp -text
-CEP/DP3/AOFlagger/src/ms2uv.cpp -text
-CEP/DP3/AOFlagger/src/msinfo.cpp -text
-CEP/DP3/AOFlagger/src/msio/baselinematrixloader.cpp -text
-CEP/DP3/AOFlagger/src/msio/baselinereader.cpp -text
-CEP/DP3/AOFlagger/src/msio/colormap.cpp -text
-CEP/DP3/AOFlagger/src/msio/directbaselinereader.cpp -text
-CEP/DP3/AOFlagger/src/msio/fitsfile.cpp -text
-CEP/DP3/AOFlagger/src/msio/image2d.cpp -text
-CEP/DP3/AOFlagger/src/msio/indirectbaselinereader.cpp -text
-CEP/DP3/AOFlagger/src/msio/mask2d.cpp -text
-CEP/DP3/AOFlagger/src/msio/measurementset.cpp -text
-CEP/DP3/AOFlagger/src/msio/memorybaselinereader.cpp -text
-CEP/DP3/AOFlagger/src/msio/pngfile.cpp -text
-CEP/DP3/AOFlagger/src/msio/rspreader.cpp -text
-CEP/DP3/AOFlagger/src/msio/samplerow.cpp -text
-CEP/DP3/AOFlagger/src/msio/segmentedimage.cpp -text
-CEP/DP3/AOFlagger/src/msio/sortedtimestepaccessor.cpp -text
-CEP/DP3/AOFlagger/src/msio/spatialtimeloader.cpp -text
-CEP/DP3/AOFlagger/src/msio/stokesimager.cpp -text
-CEP/DP3/AOFlagger/src/msio/timefrequencydata.cpp -text
-CEP/DP3/AOFlagger/src/msio/timefrequencyimager.cpp -text
-CEP/DP3/AOFlagger/src/msio/timestepaccessor.cpp -text
-CEP/DP3/AOFlagger/src/ns2bbs.cpp -text
-CEP/DP3/AOFlagger/src/quality/histogramcollection.cpp -text
-CEP/DP3/AOFlagger/src/quality/histogramtablesformatter.cpp -text
-CEP/DP3/AOFlagger/src/quality/qualitytablesformatter.cpp -text
-CEP/DP3/AOFlagger/src/quality/rayleighfitter.cpp -text
-CEP/DP3/AOFlagger/src/rawreader.cpp -text
-CEP/DP3/AOFlagger/src/remote/client.cpp -text
-CEP/DP3/AOFlagger/src/remote/clusteredobservation.cpp -text
-CEP/DP3/AOFlagger/src/remote/processcommander.cpp -text
-CEP/DP3/AOFlagger/src/remote/server.cpp -text
-CEP/DP3/AOFlagger/src/remote/serverconnection.cpp -text
-CEP/DP3/AOFlagger/src/rficonsole.cpp -text
-CEP/DP3/AOFlagger/src/rfigui.cpp -text
-CEP/DP3/AOFlagger/src/rfihistory.cpp -text
-CEP/DP3/AOFlagger/src/rfistatcollect.cpp -text
-CEP/DP3/AOFlagger/src/rfistrategy.cpp -text
-CEP/DP3/AOFlagger/src/strategy/actions/baselineselectionaction.cpp -text
-CEP/DP3/AOFlagger/src/strategy/actions/changeresolutionaction.cpp -text
-CEP/DP3/AOFlagger/src/strategy/actions/foreachbaselineaction.cpp -text
-CEP/DP3/AOFlagger/src/strategy/actions/foreachmsaction.cpp -text
-CEP/DP3/AOFlagger/src/strategy/actions/frequencyselectionaction.cpp -text
-CEP/DP3/AOFlagger/src/strategy/actions/fringestopaction.cpp -text
-CEP/DP3/AOFlagger/src/strategy/actions/highpassfilteraction.cpp -text
-CEP/DP3/AOFlagger/src/strategy/actions/imageraction.cpp -text
-CEP/DP3/AOFlagger/src/strategy/actions/normalizevarianceaction.cpp -text
-CEP/DP3/AOFlagger/src/strategy/actions/plotaction.cpp -text
-CEP/DP3/AOFlagger/src/strategy/actions/slidingwindowfitaction.cpp -text
-CEP/DP3/AOFlagger/src/strategy/actions/spatialcompositionaction.cpp -text
-CEP/DP3/AOFlagger/src/strategy/actions/statisticalflagaction.cpp -text
-CEP/DP3/AOFlagger/src/strategy/actions/strategyaction.cpp -text
-CEP/DP3/AOFlagger/src/strategy/actions/svdaction.cpp -text
-CEP/DP3/AOFlagger/src/strategy/actions/timeconvolutionaction.cpp -text
-CEP/DP3/AOFlagger/src/strategy/actions/timeselectionaction.cpp -text
-CEP/DP3/AOFlagger/src/strategy/actions/writeflagsaction.cpp -text
-CEP/DP3/AOFlagger/src/strategy/algorithms/baselineselector.cpp -text
-CEP/DP3/AOFlagger/src/strategy/algorithms/baselinetimeplaneimager.cpp -text
-CEP/DP3/AOFlagger/src/strategy/algorithms/eigenvalue.cpp -text
-CEP/DP3/AOFlagger/src/strategy/algorithms/fringestoppingfitter.cpp -text
-CEP/DP3/AOFlagger/src/strategy/algorithms/fringetestcreater.cpp -text
-CEP/DP3/AOFlagger/src/strategy/algorithms/highpassfilter.cpp -text
-CEP/DP3/AOFlagger/src/strategy/algorithms/imagetile.cpp -text
-CEP/DP3/AOFlagger/src/strategy/algorithms/localfitmethod.cpp -text
-CEP/DP3/AOFlagger/src/strategy/algorithms/methoditerator.cpp -text
-CEP/DP3/AOFlagger/src/strategy/algorithms/mitigationtester.cpp -text
-CEP/DP3/AOFlagger/src/strategy/algorithms/morphology.cpp -text
-CEP/DP3/AOFlagger/src/strategy/algorithms/polfitmethod.cpp -text
-CEP/DP3/AOFlagger/src/strategy/algorithms/rfistatistics.cpp -text
-CEP/DP3/AOFlagger/src/strategy/algorithms/sinusfitter.cpp -text
-CEP/DP3/AOFlagger/src/strategy/algorithms/statisticalflagger.cpp -text
-CEP/DP3/AOFlagger/src/strategy/algorithms/sumthreshold.cpp -text
-CEP/DP3/AOFlagger/src/strategy/algorithms/svdmitigater.cpp -text
-CEP/DP3/AOFlagger/src/strategy/algorithms/thresholdconfig.cpp -text
-CEP/DP3/AOFlagger/src/strategy/algorithms/thresholdmitigater.cpp -text
-CEP/DP3/AOFlagger/src/strategy/algorithms/thresholdtools.cpp -text
-CEP/DP3/AOFlagger/src/strategy/algorithms/tiledimage.cpp -text
-CEP/DP3/AOFlagger/src/strategy/algorithms/timefrequencystatistics.cpp -text
-CEP/DP3/AOFlagger/src/strategy/control/actionblock.cpp -text
-CEP/DP3/AOFlagger/src/strategy/control/actionfactory.cpp -text
-CEP/DP3/AOFlagger/src/strategy/control/strategyreader.cpp -text
-CEP/DP3/AOFlagger/src/strategy/control/strategywriter.cpp -text
-CEP/DP3/AOFlagger/src/strategy/imagesets/imageset.cpp -text
-CEP/DP3/AOFlagger/src/strategy/imagesets/msimageset.cpp -text
-CEP/DP3/AOFlagger/src/strategy/imagesets/parmimageset.cpp -text
-CEP/DP3/AOFlagger/src/strategy/plots/antennaflagcountplot.cpp -text
-CEP/DP3/AOFlagger/src/strategy/plots/frequencyflagcountplot.cpp -text
-CEP/DP3/AOFlagger/src/strategy/plots/frequencypowerplot.cpp -text
-CEP/DP3/AOFlagger/src/strategy/plots/iterationsplot.cpp -text
-CEP/DP3/AOFlagger/src/strategy/plots/rfiplots.cpp -text
-CEP/DP3/AOFlagger/src/strategy/plots/timeflagcountplot.cpp -text
-CEP/DP3/AOFlagger/src/test.cpp -text
-CEP/DP3/AOFlagger/src/util/aologger.cpp -text
-CEP/DP3/AOFlagger/src/util/compress.cpp -text
-CEP/DP3/AOFlagger/src/util/ffttools.cpp -text
-CEP/DP3/AOFlagger/src/util/integerdomain.cpp -text
-CEP/DP3/AOFlagger/src/util/multiplot.cpp -text
-CEP/DP3/AOFlagger/src/util/plot.cpp -text
-CEP/DP3/AOFlagger/src/util/rng.cpp -text
-CEP/DP3/AOFlagger/src/util/roctree.cpp -text
-CEP/DP3/AOFlagger/src/util/statwriter.cpp -text
-CEP/DP3/AOFlagger/src/util/stopwatch.cpp -text
-CEP/DP3/AOFlagger/test/CMakeLists.txt -text
-CEP/DP3/AOFlagger/test/aotest.cpp -text
 CEP/DP3/DPPP/etc/CMakeLists.txt -text
 CEP/DP3/DPPP/etc/DPPP.log_prop -text
 CEP/DP3/DPPP/include/DPPP/Apply.h -text
@@ -834,15 +308,18 @@ CEP/DP3/DPPP/include/DPPP/CursorUtilCasa.h -text
 CEP/DP3/DPPP/include/DPPP/DemixInfo.h -text
 CEP/DP3/DPPP/include/DPPP/DemixWorker.h -text
 CEP/DP3/DPPP/include/DPPP/DemixerNew.h -text
+CEP/DP3/DPPP/include/DPPP/DummyStep.h -text
 CEP/DP3/DPPP/include/DPPP/EstimateMixed.h -text
 CEP/DP3/DPPP/include/DPPP/EstimateNew.h -text
 CEP/DP3/DPPP/include/DPPP/GainCal.h -text
 CEP/DP3/DPPP/include/DPPP/GaussianSource.h -text
 CEP/DP3/DPPP/include/DPPP/H5Parm.h -text
+CEP/DP3/DPPP/include/DPPP/H5ParmPredict.h -text
 CEP/DP3/DPPP/include/DPPP/ModelComponent.h -text
 CEP/DP3/DPPP/include/DPPP/ModelComponentVisitor.h -text
 CEP/DP3/DPPP/include/DPPP/MultiMSReader.h -text
 CEP/DP3/DPPP/include/DPPP/Patch.h -text
+CEP/DP3/DPPP/include/DPPP/PhaseFitter.h -text
 CEP/DP3/DPPP/include/DPPP/PointSource.h -text
 CEP/DP3/DPPP/include/DPPP/Position.h -text
 CEP/DP3/DPPP/include/DPPP/Predict.h -text
@@ -856,7 +333,6 @@ CEP/DP3/DPPP/include/DPPP/Stokes.h -text
 CEP/DP3/DPPP/include/DPPP/SubtractMixed.h -text
 CEP/DP3/DPPP/include/DPPP/SubtractNew.h -text
 CEP/DP3/DPPP/include/DPPP/UVWCalculator.h -text
-CEP/DP3/DPPP/include/DPPP/phasefitter.h -text
 CEP/DP3/DPPP/package.dox -text
 CEP/DP3/DPPP/share/HBAdefault -text
 CEP/DP3/DPPP/share/LBAdefault -text
@@ -866,28 +342,31 @@ CEP/DP3/DPPP/src/ApplyCal.cc -text svneol=unset#text/plain
 CEP/DP3/DPPP/src/DemixInfo.cc -text
 CEP/DP3/DPPP/src/DemixWorker.cc -text
 CEP/DP3/DPPP/src/DemixerNew.cc -text
+CEP/DP3/DPPP/src/DummyStep.cc -text
 CEP/DP3/DPPP/src/EstimateMixed.cc -text
 CEP/DP3/DPPP/src/EstimateNew.cc -text
 CEP/DP3/DPPP/src/GainCal.cc -text
 CEP/DP3/DPPP/src/GaussianSource.cc -text
 CEP/DP3/DPPP/src/H5Parm.cc -text
+CEP/DP3/DPPP/src/H5ParmPredict.cc -text
 CEP/DP3/DPPP/src/ModelComponent.cc -text
 CEP/DP3/DPPP/src/ModelComponentVisitor.cc -text
 CEP/DP3/DPPP/src/MultiMSReader.cc -text
 CEP/DP3/DPPP/src/Patch.cc -text
+CEP/DP3/DPPP/src/PhaseFitter.cc -text
 CEP/DP3/DPPP/src/PointSource.cc -text
 CEP/DP3/DPPP/src/Position.cc -text
 CEP/DP3/DPPP/src/Predict.cc -text
 CEP/DP3/DPPP/src/ScaleData.cc -text
 CEP/DP3/DPPP/src/Simulate.cc -text
 CEP/DP3/DPPP/src/Simulator.cc -text
+CEP/DP3/DPPP/src/SolTab.cc -text
 CEP/DP3/DPPP/src/SourceDBUtil.cc -text
 CEP/DP3/DPPP/src/StefCal.cc -text
 CEP/DP3/DPPP/src/Stokes.cc -text
 CEP/DP3/DPPP/src/SubtractMixed.cc -text
 CEP/DP3/DPPP/src/SubtractNew.cc -text
 CEP/DP3/DPPP/src/__init__.py -text
-CEP/DP3/DPPP/src/phasefitter.cc -text
 CEP/DP3/DPPP/src/taqlflagger -text
 CEP/DP3/DPPP/test/findenv.run_tmpl -text
 CEP/DP3/DPPP/test/tApplyBeam.run -text
@@ -910,6 +389,7 @@ CEP/DP3/DPPP/test/tGainCal.sh -text
 CEP/DP3/DPPP/test/tGainCal.tab.tgz -text
 CEP/DP3/DPPP/test/tGainCal_ref -text
 CEP/DP3/DPPP/test/tH5Parm.cc -text
+CEP/DP3/DPPP/test/tH5Parm.sh -text
 CEP/DP3/DPPP/test/tNDPPP-generic.in_MS.tgz -text svneol=unset#application/x-gzip
 CEP/DP3/DPPP/test/tNDPPP.in_MS.tgz -text svneol=unset#application/x-compressed-tar
 CEP/DP3/DPPP/test/tPredict.run -text
@@ -937,20 +417,30 @@ CEP/DP3/DPPP_DDECal/include/DPPP_DDECal/CMakeLists.txt -text
 CEP/DP3/DPPP_DDECal/include/DPPP_DDECal/Constraint.h -text
 CEP/DP3/DPPP_DDECal/include/DPPP_DDECal/DDECal.h -text
 CEP/DP3/DPPP_DDECal/include/DPPP_DDECal/KLFitter.h -text
+CEP/DP3/DPPP_DDECal/include/DPPP_DDECal/Matrix2x2.h -text
+CEP/DP3/DPPP_DDECal/include/DPPP_DDECal/MultiDirSolver.h -text
+CEP/DP3/DPPP_DDECal/include/DPPP_DDECal/PieceWisePhaseFitter.h -text
 CEP/DP3/DPPP_DDECal/include/DPPP_DDECal/PiercePoint.h -text
 CEP/DP3/DPPP_DDECal/include/DPPP_DDECal/Register.h -text
 CEP/DP3/DPPP_DDECal/include/DPPP_DDECal/ScreenConstraint.h -text
-CEP/DP3/DPPP_DDECal/include/DPPP_DDECal/multidirsolver.h -text
+CEP/DP3/DPPP_DDECal/include/DPPP_DDECal/TECConstraint.h -text
 CEP/DP3/DPPP_DDECal/include/DPPP_DDECal/screenfitter.h -text
 CEP/DP3/DPPP_DDECal/src/CMakeLists.txt -text
 CEP/DP3/DPPP_DDECal/src/Constraint.cc -text
 CEP/DP3/DPPP_DDECal/src/DDECal.cc -text
 CEP/DP3/DPPP_DDECal/src/KLFitter.cc -text
+CEP/DP3/DPPP_DDECal/src/MultiDirSolver.cc -text
 CEP/DP3/DPPP_DDECal/src/PiercePoint.cc -text
 CEP/DP3/DPPP_DDECal/src/Register.cc -text
 CEP/DP3/DPPP_DDECal/src/ScreenConstraint.cc -text
-CEP/DP3/DPPP_DDECal/src/multidirsolver.cc -text
+CEP/DP3/DPPP_DDECal/src/TECConstraint.cc -text
 CEP/DP3/DPPP_DDECal/src/screenfitter.cc -text
+CEP/DP3/DPPP_DDECal/test/CMakeLists.txt -text
+CEP/DP3/DPPP_DDECal/test/findenv.run_tmpl -text
+CEP/DP3/DPPP_DDECal/test/tDDECal.in_MS.tgz -text svneol=unset#application/x-gzip
+CEP/DP3/DPPP_DDECal/test/tDDECal.run -text
+CEP/DP3/DPPP_DDECal/test/tDDECal.sh -text
+CEP/DP3/DPPP_DDECal/test/tDDECal_ref -text
 CEP/DP3/PythonDPPP/CMakeLists.txt -text
 CEP/DP3/PythonDPPP/include/PythonDPPP/CMakeLists.txt -text
 CEP/DP3/PythonDPPP/include/PythonDPPP/DPStepBase.h -text
@@ -1765,6 +1255,7 @@ CMake/variants/variants.cbt010 -text
 CMake/variants/variants.dop282 -text
 CMake/variants/variants.dop320 -text
 CMake/variants/variants.dragproc -text
+CMake/variants/variants.fs5 -text
 CMake/variants/variants.head01 -text
 CMake/variants/variants.lcs157 -text
 CMake/variants/variants.lexar -text
@@ -2582,6 +2073,7 @@ MAC/APL/APLCommon/src/StartDaemon_Protocol.prot -text svneol=native#application/
 MAC/APL/APLCommon/src/run_timeout.sh -text svneol=unset#text/sh-applic
 MAC/APL/APLCommon/src/swlevel -text
 MAC/APL/APLCommon/src/swlevel.conf -text
+MAC/APL/APLCommon/src/warp -text
 MAC/APL/APLCommon/test/ControllerProtMenu.cc -text
 MAC/APL/APLCommon/test/ControllerProtMenu.h -text
 MAC/APL/APLCommon/test/tAntennaField.cc -text
@@ -2875,6 +2367,7 @@ MAC/Deployment/data/Coordinates/ETRF_FILES/DE605/de605-antenna-positions-etrs.cs
 MAC/Deployment/data/Coordinates/ETRF_FILES/DE609/de609-antenna-positions-etrs.csv -text
 MAC/Deployment/data/Coordinates/ETRF_FILES/FI609/FI609-antenna-positions-etrs.csv -text
 MAC/Deployment/data/Coordinates/ETRF_FILES/FR606/fr606-antenna-positions-etrs.csv -text
+MAC/Deployment/data/Coordinates/ETRF_FILES/IE613/ie613-antenna-positions-etrs.csv -text
 MAC/Deployment/data/Coordinates/ETRF_FILES/PL610/pl610-antenna-positions-etrs.csv -text
 MAC/Deployment/data/Coordinates/ETRF_FILES/PL611/pl611-antenna-positions-etrs.csv -text
 MAC/Deployment/data/Coordinates/ETRF_FILES/PL612/pl612-antenna-positions-etrs.csv -text
@@ -2981,6 +2474,8 @@ MAC/Deployment/data/Coordinates/vectors-and-matrices/FI609/FI609-hba-solution.li
 MAC/Deployment/data/Coordinates/vectors-and-matrices/FI609/FI609-lba-solution.lisp -text
 MAC/Deployment/data/Coordinates/vectors-and-matrices/FR606/fr606-hba-solution.lisp -text
 MAC/Deployment/data/Coordinates/vectors-and-matrices/FR606/fr606-lba-solution.lisp -text
+MAC/Deployment/data/Coordinates/vectors-and-matrices/IE613/ie613-hba-solution.lisp -text
+MAC/Deployment/data/Coordinates/vectors-and-matrices/IE613/ie613-lba-solution.lisp -text
 MAC/Deployment/data/Coordinates/vectors-and-matrices/PL610/pl610-hba-solution.lisp -text
 MAC/Deployment/data/Coordinates/vectors-and-matrices/PL610/pl610-lba-solution.lisp -text
 MAC/Deployment/data/Coordinates/vectors-and-matrices/PL611/pl611-hba-solution.lisp -text
@@ -3131,6 +2626,7 @@ MAC/Deployment/data/PVSS/License/HwCode.cs001c -text
 MAC/Deployment/data/PVSS/License/HwCode.cs010c -text
 MAC/Deployment/data/PVSS/License/HwCode.cs016c -text
 MAC/Deployment/data/PVSS/License/HwCode.mcu001 -text
+MAC/Deployment/data/PVSS/License/IE613C-NewLCU_option.txt -text
 MAC/Deployment/data/PVSS/License/License[!!-~]administration.xlsx -text
 MAC/Deployment/data/PVSS/License/MCU001OLD_option.txt -text
 MAC/Deployment/data/PVSS/License/MCU001_option.old.txt -text
@@ -3248,6 +2744,7 @@ MAC/Deployment/data/PVSS/License/shield.DE609C.txt -text
 MAC/Deployment/data/PVSS/License/shield.FR606C-NewLCU.txt -text
 MAC/Deployment/data/PVSS/License/shield.FR606C.txt -text
 MAC/Deployment/data/PVSS/License/shield.FR606C_lcu101.txt -text
+MAC/Deployment/data/PVSS/License/shield.IE613C-NewLCU.txt -text
 MAC/Deployment/data/PVSS/License/shield.MCU001OLD.txt -text
 MAC/Deployment/data/PVSS/License/shield.MCU099.txt -text
 MAC/Deployment/data/PVSS/License/shield.MCU199.txt -text
@@ -3363,6 +2860,7 @@ MAC/Deployment/data/StaticMetaData/AntennaFields/DE605-AntennaField.conf -text
 MAC/Deployment/data/StaticMetaData/AntennaFields/DE609-AntennaField.conf -text
 MAC/Deployment/data/StaticMetaData/AntennaFields/FI609-AntennaField.conf -text
 MAC/Deployment/data/StaticMetaData/AntennaFields/FR606-AntennaField.conf -text
+MAC/Deployment/data/StaticMetaData/AntennaFields/IE613-AntennaField.conf -text
 MAC/Deployment/data/StaticMetaData/AntennaFields/PL610-AntennaField.conf -text
 MAC/Deployment/data/StaticMetaData/AntennaFields/PL611-AntennaField.conf -text
 MAC/Deployment/data/StaticMetaData/AntennaFields/PL612-AntennaField.conf -text
@@ -3418,6 +2916,7 @@ MAC/Deployment/data/StaticMetaData/CableDelays/DE605-CableDelays.conf -text
 MAC/Deployment/data/StaticMetaData/CableDelays/DE609-CableDelays.conf -text
 MAC/Deployment/data/StaticMetaData/CableDelays/FI609-CableDelays.conf -text
 MAC/Deployment/data/StaticMetaData/CableDelays/FR606-CableDelays.conf -text
+MAC/Deployment/data/StaticMetaData/CableDelays/IE613-CableDelays.conf -text
 MAC/Deployment/data/StaticMetaData/CableDelays/PL610-CableDelays.conf -text
 MAC/Deployment/data/StaticMetaData/CableDelays/PL611-CableDelays.conf -text
 MAC/Deployment/data/StaticMetaData/CableDelays/PL612-CableDelays.conf -text
@@ -3494,6 +2993,7 @@ MAC/Deployment/data/StaticMetaData/iHBADeltas/DE605-iHBADeltas.conf -text
 MAC/Deployment/data/StaticMetaData/iHBADeltas/DE609-iHBADeltas.conf -text
 MAC/Deployment/data/StaticMetaData/iHBADeltas/FI609-iHBADeltas.conf -text
 MAC/Deployment/data/StaticMetaData/iHBADeltas/FR606-iHBADeltas.conf -text
+MAC/Deployment/data/StaticMetaData/iHBADeltas/IE613-iHBADeltas.conf -text
 MAC/Deployment/data/StaticMetaData/iHBADeltas/PL610-iHBADeltas.conf -text
 MAC/Deployment/data/StaticMetaData/iHBADeltas/PL611-iHBADeltas.conf -text
 MAC/Deployment/data/StaticMetaData/iHBADeltas/PL612-iHBADeltas.conf -text
@@ -3631,7 +3131,11 @@ MAC/Navigator2/config/progs_wincc.maincu -text
 MAC/Navigator2/config/progs_wincc.navigator -text
 MAC/Navigator2/config/progs_wincc.snmp -text
 MAC/Navigator2/config/progs_wincc.standalone.station -text
+MAC/Navigator2/data/ACC-old.mib -text
+MAC/Navigator2/data/ACC.mib -text
+MAC/Navigator2/data/ACX-MIB_1.10.mib -text
 MAC/Navigator2/data/PVSS[!!-~]performance[!!-~]results.xls -text
+MAC/Navigator2/data/pow.mib -text
 MAC/Navigator2/dplist/maincu_system.dpl -text
 MAC/Navigator2/dplist/station_system.dpl -text
 MAC/Navigator2/panels/Alerts/lofar_alarms.pnl -text
@@ -3658,6 +3162,7 @@ MAC/Navigator2/panels/Hardware/RemoteOverview.pnl -text
 MAC/Navigator2/panels/Hardware/Station.pnl -text
 MAC/Navigator2/panels/Hardware/Station_Cabinet.pnl -text
 MAC/Navigator2/panels/Hardware/Station_Cabinet_detailed.pnl -text
+MAC/Navigator2/panels/Hardware/Station_List.pnl -text
 MAC/Navigator2/panels/Hardware/Station_PowerUnits.pnl -text
 MAC/Navigator2/panels/Hardware/Station_RCU.pnl -text
 MAC/Navigator2/panels/Hardware/Station_RSPBoard.pnl -text
@@ -3675,6 +3180,7 @@ MAC/Navigator2/panels/Observations/Observation_overview.pnl -text
 MAC/Navigator2/panels/Observations/Observations.pnl -text
 MAC/Navigator2/panels/Observations/Pipeline_overview.pnl -text
 MAC/Navigator2/panels/Observations/Pipelines.pnl -text
+MAC/Navigator2/panels/Popups/Popup_SetState.pnl -text
 MAC/Navigator2/panels/Processes/BeamControl.pnl -text
 MAC/Navigator2/panels/Processes/BeamServer.pnl -text
 MAC/Navigator2/panels/Processes/CEPHardwareMonitor.pnl -text
@@ -3741,11 +3247,12 @@ MAC/Navigator2/panels/Test/testclick.pnl -text
 MAC/Navigator2/panels/Test/testdpnames.pnl -text
 MAC/Navigator2/panels/Test/testdptypename.pnl -text
 MAC/Navigator2/panels/Test/testhtml.pnl -text
+MAC/Navigator2/panels/TrendPanel.pnl -text
 MAC/Navigator2/panels/emptyPanel.pnl -text
 MAC/Navigator2/panels/main.pnl -text
 MAC/Navigator2/panels/navigator.pnl -text
 MAC/Navigator2/panels/nopanel.pnl -text
-MAC/Navigator2/panels/objects/Alerts/alarms.pnl -text
+MAC/Navigator2/panels/objects/Alerts/AESRow.pnl -text
 MAC/Navigator2/panels/objects/Alerts/alarmsWinCCOA.pnl -text
 MAC/Navigator2/panels/objects/Alerts/alarmsWinCCOA_3.10.pnl -text
 MAC/Navigator2/panels/objects/FRENKM_STATION.pnl -text
@@ -3863,8 +3370,10 @@ MAC/Navigator2/panels/objects/Reports/SystemHD.pnl -text
 MAC/Navigator2/panels/objects/Reports/SystemOverview.pnl -text
 MAC/Navigator2/panels/objects/Reports/SystemOverviewNonRedundant.pnl -text
 MAC/Navigator2/panels/objects/Reports/SystemRam.pnl -text
+MAC/Navigator2/panels/objects/STD_PANELS/AESRow.pnl -text
 MAC/Navigator2/panels/objects/Test/Action.pnl -text
 MAC/Navigator2/panels/objects/Test/Event.pnl -text
+MAC/Navigator2/panels/objects/aesRow_Navigator.pnl -text
 MAC/Navigator2/panels/objects/baseLine.pnl -text
 MAC/Navigator2/panels/objects/compass.pnl -text
 MAC/Navigator2/panels/objects/connectionBroken.pnl -text
@@ -3886,6 +3395,8 @@ MAC/Navigator2/panels/objects/swlevel.pnl -text
 MAC/Navigator2/panels/objects/systemMainLine.pnl -text
 MAC/Navigator2/panels/vision/WebClient_start.pnl -text
 MAC/Navigator2/panels/vision/aes/AES_properties.pnl -text
+MAC/Navigator2/panels/vision/aes/AEScreen.pnl -text
+MAC/Navigator2/panels/vision/aes/saved_AESRow.pnl -text
 MAC/Navigator2/pictures/16_empty.gif -text svneol=unset#image/gif
 MAC/Navigator2/pictures/16_hand_right.gif -text svneol=unset#image/gif
 MAC/Navigator2/pictures/253.bmp -text svneol=unset#image/bmp
@@ -3931,7 +3442,6 @@ MAC/Navigator2/scripts/emptyDatabase.ctl -text
 MAC/Navigator2/scripts/gcf_cwd.ctl -text
 MAC/Navigator2/scripts/libs/CEP_Processes.ctl -text
 MAC/Navigator2/scripts/libs/FRENKM.ctl -text
-MAC/Navigator2/scripts/libs/GCFAlarm.ctl -text
 MAC/Navigator2/scripts/libs/GCFCWD.ctl -text
 MAC/Navigator2/scripts/libs/GCFCommon_prod.ctl -text
 MAC/Navigator2/scripts/libs/GCFCommon_test.ctl -text
@@ -4189,7 +3699,6 @@ MAC/Tools/Power/turn_on_lcu.py -text
 MAC/Tools/Rubidium/filter.py -text
 MAC/Tools/Rubidium/rlp.py -text
 MAC/Tools/Rubidium/rr.py -text
-MAC/Tools/Rubidium/rubidium_logger.py -text
 MAC/Tools/Rubidium/rubidium_logger_centos7.py -text
 MAC/Tools/Rubidium/tci.c -text
 MAC/Tools/ethereal-0.9.8.tar.gz -text svneol=unset#unset
@@ -4269,6 +3778,9 @@ RTCP/Cobalt/CoInterface/test/tLTAFeedback.sh eol=lf
 RTCP/Cobalt/CoInterface/test/tParset.parset_obs228591 -text
 RTCP/Cobalt/CoInterface/test/tParset.parset_obs99275 -text
 RTCP/Cobalt/CoInterface/test/tParset.sh eol=lf
+RTCP/Cobalt/CoInterface/test/tRSP.in_16bit -text
+RTCP/Cobalt/CoInterface/test/tRSP.in_8bit -text
+RTCP/Cobalt/CoInterface/test/tRSP.sh eol=lf
 RTCP/Cobalt/CoInterface/test/tRingCoordinates.py eol=lf
 RTCP/Cobalt/CoInterface/test/tRingCoordinates.sh eol=lf
 RTCP/Cobalt/CoInterface/test/tSelfDestructTimer.cc -text
@@ -4334,7 +3846,9 @@ RTCP/Cobalt/GPUProc/doc/cobalt-commissioning-report/is-station-bandpass-correcti
 RTCP/Cobalt/GPUProc/doc/cobalt-commissioning-report/resids-postfit-Cobalt-points-fitted.png -text svneol=unset#image/png
 RTCP/Cobalt/GPUProc/doc/cobalt-commissioning-report/resids-prefit-Cobalt-points-added.png -text svneol=unset#image/png
 RTCP/Cobalt/GPUProc/doc/cobalt-data-flow/CPU[!!-~]Processing[!!-~]Pipeline.pdf -text svneol=unset#application/pdf
+RTCP/Cobalt/GPUProc/doc/cobalt-data-flow/Component[!!-~]Model.pdf -text svneol=unset#application/pdf
 RTCP/Cobalt/GPUProc/doc/cobalt-data-flow/OutputProc.pdf -text svneol=unset#application/pdf
+RTCP/Cobalt/GPUProc/doc/cobalt-data-flow/Signal[!!-~]Processing[!!-~]Pipeline.pdf -text svneol=unset#application/pdf
 RTCP/Cobalt/GPUProc/doc/cobalt-data-flow/Station[!!-~]Input[!!-~]Pipeline.pdf -text svneol=unset#application/pdf
 RTCP/Cobalt/GPUProc/doc/cobalt-data-flow/cobalt-data-flow.eap -text
 RTCP/Cobalt/GPUProc/doc/cobalt-memo-beamformer-math/B1919+21_L192676_SAP0_BEAM0_PSR_B1919+21.pfd-core-IS.png -text svneol=unset#image/png
@@ -4464,9 +3978,6 @@ RTCP/Cobalt/InputProc/test/tMPIUtil2.sh eol=lf
 RTCP/Cobalt/InputProc/test/tPacketReader.in_16bit -text
 RTCP/Cobalt/InputProc/test/tPacketReader.in_8bit -text
 RTCP/Cobalt/InputProc/test/tPacketReader.sh eol=lf
-RTCP/Cobalt/InputProc/test/tRSP.in_16bit -text
-RTCP/Cobalt/InputProc/test/tRSP.in_8bit -text
-RTCP/Cobalt/InputProc/test/tRSP.sh eol=lf
 RTCP/Cobalt/InputProc/test/t_generateRSP.sh eol=lf
 RTCP/Cobalt/OpenCL_FFT/src/AccelerateError.pdf -text
 RTCP/Cobalt/OpenCL_FFT/src/CMakeLists.txt -text
@@ -4489,10 +4000,19 @@ RTCP/Cobalt/OpenCL_FFT/src/param.txt -text
 RTCP/Cobalt/OpenCL_FFT/src/procs.h -text
 RTCP/Cobalt/OutputProc/etc/sudoers.d/setcap_cobalt -text
 RTCP/Cobalt/OutputProc/scripts/bf-output-loss.sh eol=lf
+RTCP/Cobalt/OutputProc/src/odirect.c -text
 RTCP/Cobalt/OutputProc/test/tMSWriterCorrelated_.run.in eol=lf
 RTCP/Cobalt/OutputProc/test/tMeasurementSetFormat.parset-j2000 -text
 RTCP/Cobalt/OutputProc/test/tMeasurementSetFormat.parset-sun -text
 RTCP/Cobalt/OutputProc/test/tTBB_StaticMapping.in_1/TBBConnections.dat -text
+RTCP/Cobalt/OutputProc/test/tTBB_Writer-spectral.in_1/sb_20170711_094130_1310_sb99-100dupl.dat -text
+RTCP/Cobalt/OutputProc/test/tTBB_Writer-spectral.in_1/tTBB_Writer-spectral-refout.raw -text
+RTCP/Cobalt/OutputProc/test/tTBB_Writer-spectral.run eol=lf
+RTCP/Cobalt/OutputProc/test/tTBB_Writer-spectral.sh eol=lf
+RTCP/Cobalt/OutputProc/test/tTBB_Writer-transient.in_1/rw_20110719_110541_1110.dat -text
+RTCP/Cobalt/OutputProc/test/tTBB_Writer-transient.in_1/tTBB_Writer-transient-refout.raw -text
+RTCP/Cobalt/OutputProc/test/tTBB_Writer-transient.run eol=lf
+RTCP/Cobalt/OutputProc/test/tTBB_Writer-transient.sh eol=lf
 RTCP/Cobalt/clAmdFft/appmlEnv.sh -text
 RTCP/Cobalt/clAmdFft/bin32/clAmdFft.Client -text
 RTCP/Cobalt/clAmdFft/bin32/clAmdFft.Client-1.8.291 -text
@@ -4545,6 +4065,11 @@ SAS/DataManagement/DataManagementCommon/config.py -text
 SAS/DataManagement/DataManagementCommon/datamanagementbuslistener.py -text
 SAS/DataManagement/DataManagementCommon/getPathForTask -text
 SAS/DataManagement/DataManagementCommon/path.py -text
+SAS/DataManagement/ResourceTool/CMakeLists.txt -text
+SAS/DataManagement/ResourceTool/resourcetool -text
+SAS/DataManagement/ResourceTool/test/CMakeLists.txt -text
+SAS/DataManagement/ResourceTool/test/tresourcetool.run eol=lf
+SAS/DataManagement/ResourceTool/test/tresourcetool.sh eol=lf
 SAS/DataManagement/StorageQueryService/CMakeLists.txt -text
 SAS/DataManagement/StorageQueryService/__init__.py -text
 SAS/DataManagement/StorageQueryService/cache.py -text
@@ -4552,13 +4077,10 @@ SAS/DataManagement/StorageQueryService/config.py -text
 SAS/DataManagement/StorageQueryService/diskusage.py -text
 SAS/DataManagement/StorageQueryService/rpc.py -text
 SAS/DataManagement/StorageQueryService/service.py -text
-SAS/DataManagement/StorageQueryService/simpleresourceupdater -text
 SAS/DataManagement/StorageQueryService/storagequery -text
 SAS/DataManagement/StorageQueryService/storagequeryservice -text
 SAS/DataManagement/StorageQueryService/storagequeryservice.ini -text
 SAS/DataManagement/StorageQueryService/test/CMakeLists.txt -text
-SAS/DataManagement/StorageQueryService/test/test_simpleresourceupdater.run eol=lf
-SAS/DataManagement/StorageQueryService/test/test_simpleresourceupdater.sh eol=lf
 SAS/DataManagement/StorageQueryService/test/test_storagequery_service_and_rpc.py -text
 SAS/DataManagement/StorageQueryService/test/test_storagequery_service_and_rpc.run -text
 SAS/DataManagement/StorageQueryService/test/test_storagequery_service_and_rpc.sh -text
@@ -4928,6 +4450,7 @@ SAS/ResourceAssignment/ResourceAssignmentDatabase/radbpglistener -text
 SAS/ResourceAssignment/ResourceAssignmentDatabase/radbpglistener.ini -text
 SAS/ResourceAssignment/ResourceAssignmentDatabase/radbpglistener.py -text
 SAS/ResourceAssignment/ResourceAssignmentDatabase/tests/CMakeLists.txt -text
+SAS/ResourceAssignment/ResourceAssignmentDatabase/tests/radb_performance_test.py -text
 SAS/ResourceAssignment/ResourceAssignmentDatabase/tests/t_radb.py -text
 SAS/ResourceAssignment/ResourceAssignmentDatabase/tests/t_radb.run -text
 SAS/ResourceAssignment/ResourceAssignmentDatabase/tests/t_radb.sh -text
@@ -5550,6 +5073,9 @@ SubSystems/Online_Cobalt/test/Correlator/tCorrelate_3sec_2st_5sb.output/SB4.cflo
 SubSystems/Online_Cobalt/test/Correlator/tCorrelate_3sec_2st_5sb.parset -text
 SubSystems/Online_Cobalt/test/Correlator/tCorrelate_3sec_2st_5sb.run eol=lf
 SubSystems/Online_Cobalt/test/Correlator/tCorrelate_3sec_2st_5sb.sh eol=lf
+SubSystems/Online_Cobalt/test/RSPRaw/tRSPRaw-check-output.sh eol=lf
+SubSystems/Online_Cobalt/test/RSPRaw/tRSPRaw.run eol=lf
+SubSystems/Online_Cobalt/test/RSPRaw/tRSPRaw.sh eol=lf
 SubSystems/Online_Cobalt/test/tProductionParsets.in_parsets/CorrProc_173014.param -text
 SubSystems/Online_Cobalt/test/tProductionParsets.in_parsets/CorrProc_196344-CygAf009-225SAPS.cleaned.param -text
 SubSystems/Online_Cobalt/test/tProductionParsets.run eol=lf
diff --git a/.gitignore b/.gitignore
index 1b49be898dcab6ea5c79243fe30e3feea59a2b22..f6264ccc4218d857cd97ca100fda232729600c7a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,9 +4,6 @@ CEP/Calibration/BBSControl/lofarconf
 CEP/Calibration/BBSKernel/Makefile.common
 CEP/Calibration/BBSKernel/autoconf_share
 CEP/Calibration/BBSKernel/lofarconf
-CEP/DP3/AOFlagger/Doxyfile
-CEP/DP3/AOFlagger/detectrfi.kdevelop.pcs
-CEP/DP3/AOFlagger/detectrfi.kdevses
 CEP/DP3/DPPP/Makefile.common
 CEP/DP3/DPPP/autoconf_share
 CEP/DP3/DPPP/lofarconf
diff --git a/CEP/Calibration/BBSControl/scripts/parmdbplot.py b/CEP/Calibration/BBSControl/scripts/parmdbplot.py
index e6343ceb60c5eebfbd4fb41570b73e92b5e62b65..545d796e1426914f413d73c2bb812b4e7021a7f1 100755
--- a/CEP/Calibration/BBSControl/scripts/parmdbplot.py
+++ b/CEP/Calibration/BBSControl/scripts/parmdbplot.py
@@ -26,7 +26,7 @@
 # $Id$
 
 import sys, copy, math, numpy, signal
-from matplotlib.backends.backend_qt4agg import FigureCanvasQT as FigureCanvas
+from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
 from matplotlib.backends.backend_qt4agg import NavigationToolbar2QT as NavigationToolbar
 from matplotlib.figure import Figure
 from matplotlib.font_manager import FontProperties
diff --git a/CEP/Calibration/BBSKernel/include/BBSKernel/EstimateUtil.h b/CEP/Calibration/BBSKernel/include/BBSKernel/EstimateUtil.h
index f1b1e0bf33a0d28266c35ecc3eae2117125e139b..f0fd346fc8ae758b37ad1e79654faa51df833071 100644
--- a/CEP/Calibration/BBSKernel/include/BBSKernel/EstimateUtil.h
+++ b/CEP/Calibration/BBSKernel/include/BBSKernel/EstimateUtil.h
@@ -244,7 +244,6 @@ void equate(const Location &start, const Location &end,
     typename T_CELL_PROCESSOR::StatisticsType &statistics,
     T_ITER cells)
 {
-    typedef typename T_CELL_PROCESSOR::CellType CellType;
     typedef typename T_CELL_PROCESSOR::StatisticsType StatisticsType;
 
     typedef vector<pair<size_t, size_t> >::const_iterator IteratorType;
diff --git a/CEP/Calibration/BBSKernel/include/BBSKernel/Expr/RefCounting.h b/CEP/Calibration/BBSKernel/include/BBSKernel/Expr/RefCounting.h
index e10179006a15ca7ee0d5dc326b77f42d47ae7fa9..63092da535cbbb997a0c1bcf9150f5648e90ed72 100644
--- a/CEP/Calibration/BBSKernel/include/BBSKernel/Expr/RefCounting.h
+++ b/CEP/Calibration/BBSKernel/include/BBSKernel/Expr/RefCounting.h
@@ -98,7 +98,7 @@ inline RefCountable::RefCountable(const RefCountable&)
 
 inline RefCountable::~RefCountable()
 {
-    ASSERT(itsRefCount == 0);
+    //ASSERT(itsRefCount == 0);
 }
 
 inline void RefCountable::upRefCount() const
diff --git a/CEP/Calibration/BBSKernel/src/Estimate.cc b/CEP/Calibration/BBSKernel/src/Estimate.cc
index 3daa8c57f6c10d012cca95c105ad5a40166045aa..492290d0f708fbefd6b5ccc31969e144b8bc1677 100644
--- a/CEP/Calibration/BBSKernel/src/Estimate.cc
+++ b/CEP/Calibration/BBSKernel/src/Estimate.cc
@@ -1310,7 +1310,7 @@ namespace
         itsTimers[timer].stop();
     }
 
-    void Statistics::reset()
+    /*void Statistics::reset()
     {
         fill(itsCounters, itsCounters + N_Counter, 0);
 
@@ -1318,7 +1318,7 @@ namespace
         {
             itsTimers[i].reset();
         }
-    }
+    }*/
 
     string Statistics::counters() const
     {
diff --git a/CEP/DP3/AOFlagger/CHANGELOG b/CEP/DP3/AOFlagger/CHANGELOG
deleted file mode 100644
index 9aa755cb94133a4c873cbd52b9e67f1accf1f511..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/CHANGELOG
+++ /dev/null
@@ -1,39 +0,0 @@
-Version 1.2.0
-2011-02-28  André Offringa <of...nga@astro.rug.nl>
-
-  * Dependency on GSL removed
-  * Added RMS plot option
-  * Added option to rficonsole to specify data column used for flagging
-  * Added opening of solution tables
-  * Added some checks and error messages when making common strategy errors
-  * RFI console will now output the total percentages per polarization
-  * Added support for skipping mses that have already been flagged
-  * The edit strategy window works more intuitively now
-  * Goto window will select current baseline when opening
-  * RFI Console now writes an entry in the HISTORY table of the Measurement Set
-  * Logging has been formatted and start time was added.
-  * Added "Set and show image plane" button in plot menu
-  * Added feature to continue with already resorted MS in indirect baseline reader
-  * The AdapterAction has been replaced by the ForEachComplexComponentAction
-  * Strategy XML file is now formatted to make it human readable
-  * Allow indirect reading of an MS
-  * The indirect reading mode can be used in the GUI
-  * Allow reading of raw RCP files
-  * Changing the default threshold for baseline selection suggestor to 8 sigma
-  * Fixed several GUI issues that made the GUI crash when having multiple windows open
-  * Fixed error when opening reference tables, e.g. concattenated tables.
-  * Fixed two race conditions found by Helgrind
-  * Fixed bug in reported coordinates when zooming
-  * Fixed NaN issues while imaging certain sets
-  * Fixed bug that prevented column selection to actually have effect
-  * Allow lower memory machines
-  * Default strategy is about 20% faster and equally accurate
-  * Changed directory structure of source code
-  * Fixed various rare segmentation faults
-  * A lot of bug fixes and feature enhancements related to filtering
-  * A lot of doc fixes
-  * Fixed some bugs that caused NDPPP not to work
-  * Some Mac fixes by Ger van Diepen
-
-Version 1.1.0
-2010-10-22  André Offringa <of...nga@astro.rug.nl>
diff --git a/CEP/DP3/AOFlagger/CMakeLists.txt b/CEP/DP3/AOFlagger/CMakeLists.txt
deleted file mode 100644
index 7a1ea970a3e01a2bf5e9e82cfe62707d111746df..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/CMakeLists.txt
+++ /dev/null
@@ -1,24 +0,0 @@
-# $Id$
-
-lofar_package(AOFlagger 1.0 DEPENDS LofarStMan Common LMWCommon)
-
-find_package(PkgConfig)
-pkg_check_modules(GTKMM gtkmm-2.4>=2.18)
-pkg_check_modules(SIGCXX sigc++-2.0)
-
-include(LofarFindPackage)
-lofar_find_package(GSL)
-lofar_find_package(LibXml2 REQUIRED)
-lofar_find_package(PNG REQUIRED)
-lofar_find_package(Casacore REQUIRED COMPONENTS ms tables)
-lofar_find_package(Boost REQUIRED COMPONENTS date_time thread filesystem system)
-lofar_find_package(FFTW3 REQUIRED)
-lofar_find_package(CFITSIO REQUIRED)
-if(CMAKE_SYSTEM_NAME MATCHES "Linux")
-  find_library(RT_LIBRARY rt)
-  list(APPEND LOFAR_EXTRA_LIBRARIES ${RT_LIBRARY})
-endif(CMAKE_SYSTEM_NAME MATCHES "Linux")
-
-add_subdirectory(include/AOFlagger)
-add_subdirectory(src)
-add_subdirectory(test)
diff --git a/CEP/DP3/AOFlagger/README b/CEP/DP3/AOFlagger/README
deleted file mode 100644
index e6c30104d560be7d6e7d7125dfc1afa9d3336ff5..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/README
+++ /dev/null
@@ -1,10 +0,0 @@
-For the latest version and information about installing, go to http://www.astro.rug.nl/rfi-software/ .
-
-You can compile the software by executing from the LOFAR directory:
-
-mkdir build/gnu_opt -p
-cd build/gnu_opt
-cmake ../.. -DCASACORE_ROOT_DIR=/home/anoko/casacore -DLOG4CPLUS_LIBRARY=/home/anoko/lib/liblog4cplus.a -DLOG4CPLUS_INCLUDE_DIR=/home/anoko/include/
-make
-
-Change the casacore and log4cplus directories to the directories where you have installed them.
diff --git a/CEP/DP3/AOFlagger/detectrfi.kdevelop b/CEP/DP3/AOFlagger/detectrfi.kdevelop
deleted file mode 100644
index 37a02e9dc13b368c3e51026fcc279cf96c0ad3ed..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/detectrfi.kdevelop
+++ /dev/null
@@ -1,205 +0,0 @@
-<?xml version = '1.0'?>
-<kdevelop>
-  <general>
-    <author/>
-    <email/>
-    <version>$VERSION$</version>
-    <projectmanagement>KDevCustomProject</projectmanagement>
-    <primarylanguage>C++</primarylanguage>
-    <ignoreparts/>
-    <projectdirectory>.</projectdirectory>
-    <absoluteprojectpath>false</absoluteprojectpath>
-    <secondaryLanguages>
-      <language>C</language>
-    </secondaryLanguages>
-    <projectname>detectrfi</projectname>
-    <description/>
-    <defaultencoding/>
-    <versioncontrol/>
-  </general>
-  <kdevcustomproject>
-    <filelistdirectory>/</filelistdirectory>
-    <run>
-      <mainprogram>CEP/DP3/AOFlagger/src/rfigui</mainprogram>
-      <directoryradio>executable</directoryradio>
-      <customdirectory>/</customdirectory>
-      <programargs/>
-      <terminal>true</terminal>
-      <autocompile>true</autocompile>
-      <envvars/>
-      <globaldebugarguments/>
-      <globalcwd>/home/anoko/projects/LOFAR/build/gnu_opt</globalcwd>
-      <useglobalprogram>false</useglobalprogram>
-      <autoinstall>false</autoinstall>
-      <autokdesu>false</autokdesu>
-    </run>
-    <build>
-      <buildtool>make</buildtool>
-      <builddir>/data/users/offringa/LOFAR/build/gnu_opt/</builddir>
-    </build>
-    <make>
-      <abortonerror>false</abortonerror>
-      <numberofjobs>3</numberofjobs>
-      <dontact>false</dontact>
-      <makebin>/usr/bin/make </makebin>
-      <selectedenvironment>default</selectedenvironment>
-      <environments>
-        <default/>
-      </environments>
-      <prio>0</prio>
-      <defaulttarget>rfigui</defaulttarget>
-      <makeoptions>-s</makeoptions>
-    </make>
-    <blacklist/>
-    <filetypes>
-      <filetype>*.h</filetype>
-      <filetype>*.H</filetype>
-      <filetype>*.hh</filetype>
-      <filetype>*.hxx</filetype>
-      <filetype>*.hpp</filetype>
-      <filetype>*.c</filetype>
-      <filetype>*.C</filetype>
-      <filetype>*.cc</filetype>
-      <filetype>*.cpp</filetype>
-      <filetype>*.c++</filetype>
-      <filetype>*.cxx</filetype>
-      <filetype>Makefile</filetype>
-      <filetype>CMakeLists.txt</filetype>
-    </filetypes>
-    <other>
-      <prio>0</prio>
-      <otherbin/>
-      <defaulttarget/>
-      <otheroptions/>
-      <selectedenvironment>default</selectedenvironment>
-      <environments>
-        <default/>
-      </environments>
-    </other>
-  </kdevcustomproject>
-  <kdevfilecreate>
-    <filetypes/>
-    <useglobaltypes>
-      <type ext="ui" />
-      <type ext="cpp" />
-      <type ext="h" />
-    </useglobaltypes>
-  </kdevfilecreate>
-  <kdevdoctreeview>
-    <projectdoc>
-      <userdocDir>html/</userdocDir>
-      <apidocDir>html/</apidocDir>
-    </projectdoc>
-    <ignoreqt_xml/>
-    <ignoredoxygen/>
-    <ignorekdocs/>
-    <ignoretocs/>
-    <ignoredevhelp/>
-  </kdevdoctreeview>
-  <cppsupportpart>
-    <filetemplates>
-      <interfacesuffix>.h</interfacesuffix>
-      <implementationsuffix>.cpp</implementationsuffix>
-    </filetemplates>
-  </cppsupportpart>
-  <kdevcppsupport>
-    <codecompletion>
-      <includeGlobalFunctions>true</includeGlobalFunctions>
-      <includeTypes>true</includeTypes>
-      <includeEnums>true</includeEnums>
-      <includeTypedefs>false</includeTypedefs>
-      <automaticCodeCompletion>true</automaticCodeCompletion>
-      <automaticArgumentsHint>true</automaticArgumentsHint>
-      <automaticHeaderCompletion>true</automaticHeaderCompletion>
-      <codeCompletionDelay>250</codeCompletionDelay>
-      <argumentsHintDelay>400</argumentsHintDelay>
-      <headerCompletionDelay>250</headerCompletionDelay>
-      <showOnlyAccessibleItems>false</showOnlyAccessibleItems>
-      <completionBoxItemOrder>0</completionBoxItemOrder>
-      <howEvaluationContextMenu>true</howEvaluationContextMenu>
-      <showCommentWithArgumentHint>true</showCommentWithArgumentHint>
-      <statusBarTypeEvaluation>false</statusBarTypeEvaluation>
-      <namespaceAliases>std=_GLIBCXX_STD;__gnu_cxx=std</namespaceAliases>
-      <processPrimaryTypes>true</processPrimaryTypes>
-      <processFunctionArguments>false</processFunctionArguments>
-      <preProcessAllHeaders>false</preProcessAllHeaders>
-      <parseMissingHeadersExperimental>false</parseMissingHeadersExperimental>
-      <resolveIncludePathsUsingMakeExperimental>false</resolveIncludePathsUsingMakeExperimental>
-      <alwaysParseInBackground>true</alwaysParseInBackground>
-      <usePermanentCaching>true</usePermanentCaching>
-      <alwaysIncludeNamespaces>false</alwaysIncludeNamespaces>
-      <includePaths>.;</includePaths>
-    </codecompletion>
-    <references/>
-    <qt>
-      <used>false</used>
-      <version>3</version>
-      <includestyle>3</includestyle>
-      <root>/usr/share/qt3</root>
-      <designerintegration>EmbeddedKDevDesigner</designerintegration>
-      <qmake>/usr/bin/qmake-qt3</qmake>
-      <designer/>
-      <designerpluginpaths/>
-    </qt>
-    <creategettersetter>
-      <prefixGet/>
-      <prefixSet>set</prefixSet>
-      <prefixVariable>m_,_</prefixVariable>
-      <parameterName>theValue</parameterName>
-      <inlineGet>true</inlineGet>
-      <inlineSet>true</inlineSet>
-    </creategettersetter>
-    <splitheadersource>
-      <enabled>false</enabled>
-      <synchronize>true</synchronize>
-      <orientation>Vertical</orientation>
-    </splitheadersource>
-  </kdevcppsupport>
-  <kdevfileview>
-    <groups>
-      <group pattern="CMakeLists.txt;*.cmake;" name="CMake" />
-      <group pattern="*.h;*.hxx;*.hpp" name="Header" />
-      <group pattern="*.c" name="C Sources" />
-      <group pattern="*.cpp;*.C;*.cxx;*.cc" name="C++ Sources" />
-      <group pattern="*.ui" name="Qt Designer files" />
-      <hidenonprojectfiles>true</hidenonprojectfiles>
-      <hidenonlocation>false</hidenonlocation>
-    </groups>
-    <tree>
-      <hidepatterns>*.o,*.lo,CVS,*~,cmake*</hidepatterns>
-      <hidenonprojectfiles>true</hidenonprojectfiles>
-    </tree>
-  </kdevfileview>
-  <substmap>
-    <APPNAME>detectrfi</APPNAME>
-    <APPNAMELC>detectrfi</APPNAMELC>
-    <APPNAMESC>Detectrfi</APPNAMESC>
-    <APPNAMEUC>DETECTRFI</APPNAMEUC>
-    <AUTHOR>Andre Offringa</AUTHOR>
-    <EMAIL>offringa@astro.rug.nl</EMAIL>
-    <LICENSE>GPL</LICENSE>
-    <LICENSEFILE>COPYING</LICENSEFILE>
-    <VERSION>-</VERSION>
-    <YEAR>2010</YEAR>
-    <dest>/data/projects/detectrfi</dest>
-  </substmap>
-  <kdevdebugger>
-    <general>
-      <gdbpath/>
-      <dbgshell/>
-      <configGdbScript/>
-      <runShellScript/>
-      <runGdbScript/>
-      <breakonloadinglibs>true</breakonloadinglibs>
-      <separatetty>false</separatetty>
-      <floatingtoolbar>false</floatingtoolbar>
-      <raiseGDBOnStart>false</raiseGDBOnStart>
-      <programargs/>
-    </general>
-    <display>
-      <staticmembers>false</staticmembers>
-      <demanglenames>true</demanglenames>
-      <outputradix>10</outputradix>
-    </display>
-  </kdevdebugger>
-</kdevelop>
diff --git a/CEP/DP3/AOFlagger/detectrfi.kdevelop.filelist b/CEP/DP3/AOFlagger/detectrfi.kdevelop.filelist
deleted file mode 100644
index 2f6adc9f1b9adef1f2b7bb358071524aa730c134..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/detectrfi.kdevelop.filelist
+++ /dev/null
@@ -1,166 +0,0 @@
-CMakeLists.txt
-Makefile
-src
-src/CMakeLists.txt
-src/gui/application.cpp
-src/gui/application.h
-src/gui/complexplaneplotwindow.cpp
-src/gui/complexplaneplotwindow.h
-src/gui/editstrategywindow.cpp
-src/gui/editstrategywindow.h
-src/gui/gotowindow.cpp
-src/gui/gotowindow.h
-src/gui/highlightwindow.cpp
-src/gui/highlightwindow.h
-src/gui/imageplanewindow.cpp
-src/gui/imageplanewindow.h
-src/gui/imagewidget.cpp
-src/gui/imagewidget.h
-src/gui/msoptionwindow.cpp
-src/gui/msoptionwindow.h
-src/gui/mswindow.cpp
-src/gui/mswindow.h
-src/gui/newstrategyactionframe.cpp
-src/gui/newstrategyactionframe.h
-src/gui/plot/plot2d.cpp
-src/gui/plot/plot2d.h
-src/gui/plot/plotwidget.cpp
-src/gui/plot/plotwidget.h
-src/gui/plotframe.cpp
-src/gui/plotframe.h
-src/gui/progresswindow.cpp
-src/gui/progresswindow.h
-src/gui/timefrequencywidget.cpp
-src/gui/timefrequencywidget.h
-src/gui/zoomwindow.cpp
-src/gui/zoomwindow.h
-src/imaging/model.cpp
-src/imaging/model.h
-src/imaging/uvimager.cpp
-src/imaging/uvimager.h
-src/lofar/LofarColumn.cc
-src/lofar/LofarStMan.cc
-src/lofar/Register.cc
-src/msio/colormap.cpp
-src/msio/colormap.h
-src/msio/fitsfile.cpp
-src/msio/fitsfile.h
-src/msio/image2d.cpp
-src/msio/image2d.h
-src/msio/mask2d.cpp
-src/msio/mask2d.h
-src/msio/measurementset.cpp
-src/msio/measurementset.h
-src/msio/pngfile.cpp
-src/msio/pngfile.h
-src/msio/samplerow.cpp
-src/msio/samplerow.h
-src/msio/segmentedimage.cpp
-src/msio/segmentedimage.h
-src/msio/stokesimager.cpp
-src/msio/stokesimager.h
-src/msio/table.cpp
-src/msio/table.h
-src/msio/timefrequencydata.cpp
-src/msio/timefrequencydata.h
-src/msio/timefrequencyimager.cpp
-src/msio/timefrequencyimager.h
-src/rfi/antennaflagcountplot.cpp
-src/rfi/antennaflagcountplot.h
-src/rfi/frequencyflagcountplot.cpp
-src/rfi/frequencyflagcountplot.h
-src/rfi/fringestoppingfitter.cpp
-src/rfi/fringestoppingfitter.h
-src/rfi/fringetestcreater.cpp
-src/rfi/fringetestcreater.h
-src/rfi/imagetile.cpp
-src/rfi/imagetile.h
-src/rfi/localfitmethod.cpp
-src/rfi/localfitmethod.h
-src/rfi/methoditerator.cpp
-src/rfi/methoditerator.h
-src/rfi/mitigationtester.cpp
-src/rfi/mitigationtester.h
-src/rfi/morphology.cpp
-src/rfi/morphology.h
-src/rfi/rfiplots.cpp
-src/rfi/rfiplots.h
-src/rfi/rfistatistics.cpp
-src/rfi/rfistatistics.h
-src/rfi/sinusfitter.cpp
-src/rfi/sinusfitter.h
-src/rfi/statisticalflagger.cpp
-src/rfi/statisticalflagger.h
-src/rfi/strategy/actionfactory.cpp
-src/rfi/strategy/actionfactory.h
-src/rfi/strategy/changeresolutionaction.cpp
-src/rfi/strategy/changeresolutionaction.h
-src/rfi/strategy/fitsimageset.cpp
-src/rfi/strategy/fitsimageset.h
-src/rfi/strategy/foreachbaselineaction.cpp
-src/rfi/strategy/foreachbaselineaction.h
-src/rfi/strategy/foreachmsaction.cpp
-src/rfi/strategy/foreachmsaction.h
-src/rfi/strategy/frequencyselectionaction.cpp
-src/rfi/strategy/frequencyselectionaction.h
-src/rfi/strategy/fringestopaction.cpp
-src/rfi/strategy/fringestopaction.h
-src/rfi/strategy/imageraction.cpp
-src/rfi/strategy/imageraction.h
-src/rfi/strategy/imageset.cpp
-src/rfi/strategy/imageset.h
-src/rfi/strategy/loadflagsaction.cpp
-src/rfi/strategy/loadflagsaction.h
-src/rfi/strategy/loadimageaction.cpp
-src/rfi/strategy/loadimageaction.h
-src/rfi/strategy/msimageset.cpp
-src/rfi/strategy/msimageset.h
-src/rfi/strategy/plotantennaflagcountaction.cpp
-src/rfi/strategy/plotantennaflagcountaction.h
-src/rfi/strategy/plotfrequencyflagcountaction.cpp
-src/rfi/strategy/plotfrequencyflagcountaction.h
-src/rfi/strategy/plottimeflagcountaction.cpp
-src/rfi/strategy/plottimeflagcountaction.h
-src/rfi/strategy/slidingwindowfitaction.cpp
-src/rfi/strategy/slidingwindowfitaction.h
-src/rfi/strategy/statisticalflagaction.cpp
-src/rfi/strategy/statisticalflagaction.h
-src/rfi/strategy/strategy.cpp
-src/rfi/strategy/strategy.h
-src/rfi/strategy/svdaction.cpp
-src/rfi/strategy/svdaction.h
-src/rfi/strategy/timeselectionaction.cpp
-src/rfi/strategy/timeselectionaction.h
-src/rfi/strategy/writeflagsaction.cpp
-src/rfi/strategy/writeflagsaction.h
-src/rfi/strategy/xmlreader.cpp
-src/rfi/strategy/xmlreader.h
-src/rfi/strategy/xmlwriter.cpp
-src/rfi/strategy/xmlwriter.h
-src/rfi/svdmitigater.cpp
-src/rfi/svdmitigater.h
-src/rfi/thresholdconfig.cpp
-src/rfi/thresholdconfig.h
-src/rfi/thresholdmitigater.cpp
-src/rfi/thresholdmitigater.h
-src/rfi/thresholdtools.cpp
-src/rfi/thresholdtools.h
-src/rfi/tiledimage.cpp
-src/rfi/tiledimage.h
-src/rfi/timeflagcountplot.cpp
-src/rfi/timeflagcountplot.h
-src/rfigui.cpp
-src/util/ffttools.cpp
-src/util/ffttools.h
-src/util/integerdomain.cpp
-src/util/integerdomain.h
-src/util/multiplot.cpp
-src/util/multiplot.h
-src/util/plot.cpp
-src/util/plot.h
-src/util/rng.cpp
-src/util/rng.h
-src/util/statwriter.cpp
-src/util/statwriter.h
-src/util/stopwatch.cpp
-src/util/stopwatch.h
diff --git a/CEP/DP3/AOFlagger/doc/site/CHANGELOG b/CEP/DP3/AOFlagger/doc/site/CHANGELOG
deleted file mode 100644
index df0041a1b060b5225f0615114c248da9df7c1fc5..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/doc/site/CHANGELOG
+++ /dev/null
@@ -1,146 +0,0 @@
-Version 2.1.0
-2012-08-12  André Offringa <of...nga@astro.rug.nl>
-  * This release adds support for .sdfits files that are used in Parkes data reduction and has various little enhancements. Strategy file format has not changed.
-  * New feature: Parkes' sdfits files can now be opened (with help from J. Delhaize) and the AOFlagger seems to be able to flag such observations well
-  * New feature: Save flags action can store flags to sdfits files
-  * New feature: New spectrum plot options in Rfigui (plot mean or sum of time steps)
-  * New feature: binary 'badstations', will use quality statistics to determine bad stations. Meant to be a fast tool for LOFAR data.
-  * New feature: allow reading non-standard columns in the gui (requested by R. van Weeren)
-  * New feature: new action 'Normalize variance', observations can be normalized by using the quality statistics.
-  * Bug fix: Sinc convolution in time direction can now be accomplished with FFT
-  * Bug fix: Added many improvements to the aoqplot quality plotting tool, i.e., better error msgs, more plots, bandpass/time correction, less crashes.
-  * Bug fix: No longer silently ignoring write errors during reordering -- before this, when writing failed, flag results were wrong without warning.
-  * Enhancement: more options for aoquality tool.
-  * Bug fix: The uvfits reader did not work any more on WSRT files because of architectural changes in the AOFlagger. Fixed.
-  * Bug fix: AOFlagger can now flag data without time stamps (wich allows me to flag data from my personal hobby telescope).
-  * Bug fix: Open button now has key accelerator.
-  * Bug fix: AOFlagger did not compile on gcc 4.7 (reported by J. Swinbank).
-  * Bug fix: Toolbar in the Rfigui will now always show both text and icons
-  * Bug fix: Interface changed to allow NDPPP to read the raw data, NDPPP's problems fixed that concerned quality collecting.
-  * Performance enhancement: Improved speed of horizontal sumthreshold algorithm with SSE instructions, leading to about 10\% improved speed on overal strategy.
-  * Bug fix: fixed bug in previously mentioned new SumThreshold algorithm causing crashes (reported by J. Swinbank), also adding test case to validate result.
-  * Performance enhancement: Improved performance of reading meta data of measurement sets.
-  * Experimental additions: the frequency filters are now optimized and can be applied on huge (LOFAR) observations.
-
-Version 2.0.1
-2012-03-16	André Offringa <of...nga@astro.rug.nl>
-  * This release is a quick fix for a bug that caused a strategy read failure on machines with non-standard locales
-  * Bug fix: fixing bug causing strategy reader to malfunction with different locales (reported by Arpad Miskolczi)
-  * Bug fix: show an error box when a strategy fails to load instead of crashing
-  * Bug fix: complex plane plot was still using gnuplot -- now uses the internal plotter.
-  * Bug fix: fixed a bug that sometimes caused a crash after having resized the time-frequency diagram.
-  * Bug fix: building without gtkmm was not possible, patched by Marcel Loose.
-
-Version 2.0.0
-2012-03-08	André Offringa <of...nga@astro.rug.nl>
-  * Main points of this release: no longer depence on pdfviewer & gnuplot for drawing plots and new tools for quality analysis. Strategy file format did not change, thus .rfis files from 1.5.0 can be opened without a problem in 2.0.0.
-  * New tool: aoqplot, for very quick but superficial analysis of observations (see LOFAR Cookbook for info).
-  * New tool: aoquality, for collecting statistics (also see Cookbook).
-  * New feature: An internal plot renderer was added, which is used for all plots in the plot menu. The plots are therefore much faster and better integrated within rfigui, and no longer require gnuplot and a pdf viewer.
-  * New feature: ticks and text for logarithmic colour scales are visualized in a more esthetically pleasing way.
-  * New feature: Text along x,y,z axes of time-frequency plot can be manually set.
-  * New feature: log-log distribution plot in rfigui, with various analysis possible (slope calculation, rayleigh fitter).
-  * New feature: rfigui will now immediately ask which baseline to load, instead of loading the first baseline (requested by Raymond Oonk).
-  * New feature: you can now specify a MS on the commandline with the rfigui: "rfigui <ms>"
-  * Bug fix: Baseline name disappeared in bottom status bar when moving mouse over time-frequency plot. Baseline name is now reported when mouse is moved outside time-frequency plot (requested by Raymond Oonk).
-  * Bug fix: very large sets were not displayed correctly in the rfigui due to cairo limitations.
-  * Bug fix: clicking on statistics button sometimes crashed the gui.
-  * Bug fix: Times along x-axis in rfigui were not correct when splitting the data (reported by Raymond Oonk).
-  * Performance of dilation algorithm improved (is not used in default strategy).
-  * Slight performance improvement of SSE SumThreshold method.
-  * New library interface: the statistics collector is used by NDPPP to accumulate statistics during averaging (NDPPP and AOFlagger remain independ though).
-
-Version 1.5.0
-2011-10-20	André Offringa <of...nga@astro.rug.nl>
-  * The main points of this release: Better performance, improved visualization and raw file support.
-  * The computational performance has been significantly improved (2x faster) using various optimizations, including rewriting algorithms to use the SSE instruction set.
-  * New feature: The time-frequency plots are customizable in various ways (View->Plot properties), and have been polished somewhat.
-  * New feature: Export visualizations as vector graphics (SVG, PDF) or bitmap (PNG).
-  * New feature: FITS export of image plane.
-  * New feature: Logarithmic colour scale (both in TF diagram and Image plane window).
-  * New feature: Tool tips in some windows.
-  * New feature: Raw files produced for the Transient Key Science project can now be read and written by the tools (format description from P. Zarka).
-  * The performance of the indirect reader has been improved (flags are also reordered during write).
-  * Added a different interpolation algorithm
-  * Menus in the gui have been restructured.
-  * New testset simulating sinusoidal RFI.
-  * Bugfix: Cairo behaved differently on some platforms, and did not show everything.
-  * Change resolution action can now optionally take flags into account.
-  * Fixed some issues with UV projection and simulation runs.
-  * RFI console now returns a status upon finishing, useful for automated pipelines (suggested by C. Coughlan).
-  * Heavy refactoring of visualization code.
-  * Better test coverage.
-
-Version 1.4.0
-2011-07-22	André Offringa <of...nga@astro.rug.nl>
-  * New action: absolute threshold. Useful for experimenting (not to be used otherwise).
-  * Speed increase of about 10% due to using a novel linear performing algorithm for the dilation. Algorithm provided by J. van de Gronde (article coming up).
-  * Several enhancements to fringe filters (see Offringa et al, 2011, in prep.).
-  * Enhanced performance of statistic collecting strategies.
-  * Added / enhanced possibility to experiment with spatial filters, thanks to a lot of input from U.-L. Pen.
-  * Esthetic changes to the gui by regrouping the menus.
-  * msinfo reports somewhat more useful info now.
-  * colormapper can now average fits images together and has some other useful features.
-  * Bugfix: Converging of sets with lots of RFI did not work correctly. Reported by R. van Weeren and D. Rafferty. Won't work for old strategies(!).
-  * Bugfix: Winsorized variance calculation is now more accurate with large amounts of RFI.
-  * Bugfix: Since the new actions screen was getting too large, the edit strategy now shows a menu of possible actions. Reported by A. Miskolczi.
-  * Bugfix: Removed unused parameters of the time selection action. Reported by P. Serra.
-  * Bugfix: Parameter -c removed from rfistrategy, as it did not work. Reported by F. De Gasperin.
-  * Several new unit tests to validate flagger steps.
-  * Some small fixes everywhere around.
-
-Version 1.3.0
-2011-04-26	André Offringa <of...nga@astro.rug.nl>
-
-  * Several esthetic changes to the gui, including rounded values on the axes, a z-axis scale and fixed z-scale
-  * Feature to create a graphical map of the antennas in a set
-  * Various improvements to collection of statistics, such as time-frequency noise plots
-  * Dynamic noise spectra generated by the CollectNoiseAction can be opened and re-flagged in RFI gui.
-  * Added several unit tests to test correctness of the more complicated algorithms
-  * New action that acts like it resamples the data in a specific way, for testing it side effects.
-  * Fringe fitting can be performed on any source now
-  * Bugfix: Fix of 1d convolution out-of-bounds error, reported by R. van Nieuwpoort
-  * Bugfix: fitting of curve when no data is present
-  * Bugfix: Fix of somewhat confusing side effect of the dilation operation when the Equal polarisation setting was removed. Reported by A. Biggs.
-  * Bugfix: Fix for bug reported by P. Serra, flagging on Stokes Q in a 2 polarization (XX,YY) set did not work
-  * Many other small bugfixes
-
-Version 1.2.0
-2011-02-28  André Offringa <of...nga@astro.rug.nl>
-
-  * Dependency on GSL removed
-  * Added RMS plot option
-  * Added option to rficonsole to specify data column used for flagging
-  * Added opening of solution tables
-  * Added some checks and error messages when making common strategy errors
-  * RFI console will now output the total percentages per polarization
-  * Added support for skipping mses that have already been flagged
-  * The edit strategy window works more intuitively now
-  * Goto window will select current baseline when opening
-  * RFI Console now writes an entry in the HISTORY table of the Measurement Set
-  * Logging has been formatted and start time was added.
-  * Added "Set and show image plane" button in plot menu
-  * Added feature to continue with already resorted MS in indirect baseline reader
-  * The AdapterAction has been replaced by the ForEachComplexComponentAction
-  * Strategy XML file is now formatted to make it human readable
-  * Allow indirect reading of an MS
-  * The indirect reading mode can be used in the GUI
-  * Allow reading of raw RCP files
-  * Changing the default threshold for baseline selection suggestor to 8 sigma
-  * Fixed several GUI issues that made the GUI crash when having multiple windows open
-  * Fixed error when opening reference tables, e.g. concattenated tables.
-  * Fixed two race conditions found by Helgrind
-  * Fixed bug in reported coordinates when zooming
-  * Fixed NaN issues while imaging certain sets
-  * Fixed bug that prevented column selection to actually have effect
-  * Allow lower memory machines
-  * Default strategy is about 20% faster and equally accurate
-  * Changed directory structure of source code
-  * Fixed various rare segmentation faults
-  * A lot of bug fixes and feature enhancements related to filtering
-  * A lot of doc fixes
-  * Fixed some bugs that caused NDPPP not to work
-  * Some Mac fixes by Ger van Diepen
-
-Version 1.1.0
-2010-10-22  André Offringa <of...nga@astro.rug.nl>
diff --git a/CEP/DP3/AOFlagger/doc/site/faq.html b/CEP/DP3/AOFlagger/doc/site/faq.html
deleted file mode 100644
index 11f5560dd601c224b45b1a0b50ae1c5787ac7a6b..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/doc/site/faq.html
+++ /dev/null
@@ -1,117 +0,0 @@
-<html>
-<head><title>Offringa's RFI software FAQ</title>
-<link rel="stylesheet" type="text/css" href="style.css" />
-</head>
-<body>
-<a href="http://www.astro.rug.nl/~offringa/">Offringa</a>-&gt;<a href="index.html">RFI software</a>-&gt;FAQ
-<h2>Frequently asked questions</h2>
-<p>Contents:</p>
-<ul>
-<li>Where should I start with reading documentation about the tools?</li>
-<li>Does rficonsole work on WSRT / VLA / GMRT / ... data?</li>
-<li>I get bad results, how to solve?</li>
-<li>I suspect a presence of RFI in my final reduced data</li>
-<li>How does rficonsole handle multiple bands in the same observation?</li>
-<li>How does rficonsole handle multiple fields in the same observation?</li>
-<li>RFI console uses too much memory!</li>
-<li>RFI console does not seem to use CPU / does not progress</li>
-<li>Crashes with a 'FLAG is readonly' message</li>
-<li>Plotting does not work in the GUI</li>
-<li>How do I use this new, faster reading mode?</li>
-<li>Where is the newest version of the RFI tools?</li>
-<li>How can I transfer old strategies to newer versions of the tool?</li>
-<li>Does rficonsole store e.g. the statistics in a log?</li>
-<li>How does RFI console recognise RFI?</li>
-<li>I still have questions / contact info</li>
-</ul>
-<h3>Where should I start with reading documentation about the tools?</h3>
-<p>If you are reducing LOFAR data, you should at least read the
-<a href="http://www.astron.nl/radio-observatory/lofar/lofar-imaging-cookbook">LOFAR imaging cookbook</a>.
-The NDPPP chapter contains also information about the "quality" tools that are included in the AOFlagger
-package. A first tutorial on the GUI can be found here:
-<a href="gui-tutorial.html">RFI gui tutorial</a>, and an example to
-optimize the default strategy here:
-<a href="strategy-example-a.html">Strategy optimization example</a>.
-More documentation might follow on this website, and of course scanning
-through this FAQ might solve some of your questions. See the "How does RFI console recognise RFI" faq item for some links to scientific papers about the flagger.</p>
-<h3>Does rficonsole work on WSRT / VLA / GMRT / ... data?</h3>
-<p>Yes, it does. As far as I know, it has already been tested and shown good results on LOFAR, WSRT, VLA and GMRT data. The only requirement is that the data is stored in the Aips++ / casa Measurement Set format (in my personal opinion, this is one of the best formats around for radio observations). If you have results for other telescopes, I'd love to hear about it.</p>
-<p>Note though, that the settings have been optimized for LOFAR, and some of the settings might need to be changed to get good results. See the "I get bad results, how te solve?" question for more info.</p>
-<h3>I get bad results, how to solve?</h3>
-<p>Strong sources and different telescope properties can cause the default settings to fail in certain cases. The gui can help you a lot when trying to solve problems. Be sure to read the <a href="strategy-example-a.html">strategy optimization example</a>. If you think rficonsole/rfigui is doing a bad job, I would suggest to experiment with the GUI to optimize the following settings:</p>
-<ul>
-<li>Horizontal resolution decrease factor before the sliding window fit action<br/>
-LOFAR has a high time resolution (currently 1 sec by default). If your telescope / observation has a longer integration time or a very strong source far from the phase centre, this should be set to 1 instead of 3).</li>
-<li>Kernel width (=kernel time size) of the sliding window fitting action<br/>
-Once again, this depends on integration time and source field.</li>
-<li>Kernel height (=kernel frequency size) of the sliding window fitting action<br/>
-This depends on the channel resolution and frequency behaviour. Should be fine in most cases, but if your band pass is very steep (such as with WSRT), you might need to make it smaller. Another (actually better) solution is to correct for the band pass before running rficonsole.</li>
-<li>Change the sensitivity of the SumThreshold action.</li>
-<li>Enlarge the number of iterations (slower, but more stable)</li>
-</ul>
-<p>I have never seen an observation in which optimizing the settings did not work in the end, so don't give up. Make sure the phase centre does not change during the observation (see the question on multiple fields). You can always mail me and hand over a small part of your observation to let me take a look at the problem.</p>
-<h3>I suspect a presence of RFI in my final reduced data</h3>
-<p>That is well possible, even after using rficonsole. RFI console will only flag RFI that is (1) detectable and (2) not both broadband and continuous. Especially broadband <em>in situ</em> RFI (RFI generated by hardware near the telescope) can not be removed by flagging and might cause calibration failures and/or sidelobes while imaging. Other techniques should be used in such cases.</p>
-<h3>How does rficonsole handle multiple bands in the same observation?</h3>
-<p>It will treat them as separate baselines, which will be fine. If there is some problem, the best way is to split them into separate measurement sets. LOFAR never stores multiple bands in one measurement set by default, but WSRT does.</p>
-<h3>How does rficonsole handle multiple fields in the same observation?</h3>
-<p>I have not tested this, but it will probably treat the entire observation as a whole, and look at the concatenated baselines (i.e., time sort the data and assume the data should look the same). Therefore, if you sweep between a strong calibrator source and another field, <em>rficonsole might flag your calibrator completely!</em> Therefore, always split the measurement set when the phase centre changes. LOFAR will never store multiple sources in one measurement set, so for LOFAR this is not an issue.</p>
-<h3>RFI console uses too much memory!</h3>
-<p>Here are some hints on memory usage of rficonsole:</p>
-<ul>
-<li>First of all, the memory reported by <tt>top</tt> and similar <em>is not the actual memory usage</em>. It includes a so called "memory map", which is not actually used memory, but is hard disk space that is addressable as if it was memory. In most cases, this is the largest chunk reported by <tt>top</tt>. Therefore, as long as you don't get memory crashes or a lot of swapping, you should not worry about this huge number reported by <tt>top</tt>.</li>
-<li>The <tt>casacore</tt> library uses internally a caching mechanism that should speed up reading of the data. I am not sure how the data is cached, but I noticed that the cache will slowly grow until all physical available memory is occupied. This looks like a memory leak, but memory usage should stop growing as soon as swapping is about to occur.</li>
-<li>The minimal required memory is currently depending on three things: (1) the <a href="reading-mode.html">reading mode</a> (direct or indirect) ; (2) the number of threads being used (defaults to 4) ; and (3) the size of a single baseline. The system will approximately use <code>&lt;THREAD COUNT&gt; x 4 x &lt;BASELINE SIZE&gt;</code> bytes of memory in direct mode and <code>&lt;THREAD COUNT&gt; x 2.5 x &lt;BASELINE SIZE&gt;</code> bytes in indirect mode. The size of a single baseline can be calculated like <code>8 (bytes/complex float) x 4 (polarizations) x 256 (channels) x 6000 (time steps)</code> (thus 50 MB per baseline in this case, 0.5 GB in total, a rather typical LOFAR example). Hence, if the system really runs out of memory / starts swapping, <em>decrease the number of threads</em> as explained in the command line help of rficonsole and make sure to use the <em><a href="reading-mode.html">indirect reader</a></em>.</li>
-<li>The software has been carefully tested for memory leaks, and there should not be any serious ones in it. A typical desktop machine should be able to run the software without problems.</li>
-<li>Don't run multiple rficonsole's on the same machine. Run them sequential, not in parallel.</li>
-</ul>
-<h3>RFI console does not seem to use CPU / does not progress</h3>
-<p>This probably means that reading the data takes a lot of time and the computing threads are awaiting new data. Reasons for slow IO can be:</p>
-<ul>
-<li>You are trying to run multiple rficonsole's on the same machine. Run them sequential, not in parallel.</li>
-<li>The machine is low on memory, causing the cache to be too small or swapping. See the question about memory usage to improve memory.</li>
-<li>Too many users on the storage node (/hard disk users).</li>
-</ul>
-<p>Generally, the <a href="reading-mode.html">indirect reading mode</a> is much faster than the direct reading mode.</p>
-<h3>Crashes with a 'FLAG is readonly' message</h3>
-<p>The full message is:</p>
-<p><code>terminate called after throwing an instance of 'casa::TableInvOper'<br/>what():  Invalid Table operation: FLAG is readonly (use the ROxxxColumn class)</br>Abort</code></p>
-<p>This means you are trying to flag raw LOFAR data in which the LofarStMan storage manager is used for the flag column. This storage manager is read only, and rficonsole can not update these flags. The <a href="http://www.mpa-garching.mpg.de/~fdg/LOFAR_cookbook/">LOFAR imaging cookbook</a> will tell you on changes, but the current way to solve this on the LOFAR cluster is:</p>
-<p><code>makeFLAGwritable &lt;MyObservation.MS&gt;</code></p>
-<p>This will take a few seconds to rewrite the flag column, after which you can run rficonsole.</p>
-<h3>Plotting does not work in the GUI</h3>
-<p>[update 2012-03: the GUI now uses an internal plotter, and this answer is probably no longer relevant]. Plotting requires several programs:</p>
-<ul>
-<li><a href="http://www.gnuplot.info/">Gnuplot</a>, version 4.2 or higher</li>
-<li>ps2pdf, which is part of the <a href="http://ghostscript.com/">Ghostscript</a> software</li>
-<li>A pdf viewer. RFI gui will try to execute the command "./kpdf". Therefore, you will need a symlink in your working directory to this pdf viewer, and the symlink should be called "kpdf". </li>
-</ul>
-<p>If plotting is not working, check the terminal; RFI gui will output errors there.</p>
-<h3>How do I use this new, faster reading mode?</h3>
-<p>The mode is called the indirect reading mode, and is described on the following page: <a href="reading-mode.html">reading mode</a>.
-<h3>What is the newest version of the RFI tools?</h3>
-<p>The latest version is the one installed on the LOFAR cluster. This version is build daily from the Astron Subversion repository and should be the preferred version at all times, if you have access to it. If not, you can use the packaged version from <a href="http://www.astro.rug.nl/rfi-software">http://www.astro.rug.nl/rfi-software</a>. If the version there is older than two months, mail me so that I package the latest version -- it is in heavy development and many bugs and fixes are made within a month.</p>
-<h3>How can I transfer old strategies to newer versions of the tool?</h3>
-<p>Newer versions can not always read strategies which are created by older tools. Sometimes,
-the changes are small and can be easily solved, but sometimes it is better to recreate the
-strategies. You can try changing the version of the strategy file with a text editor and
-load it with rficonsole (<tt>rficonsole -strategy old_strategy.rfis</tt>). It will probably
-reply with an exception about which action is causing the incompatibility. By comparing that
-part of the strategy with a newer strategy, you might be able to solve the problem.
-</p>
-<h3>Does rficonsole store e.g. the statistics in a log?</h3>
-<p>Since October 2010, RFI console uses the LOFAR logger, which in turn uses LogCplus. Standard logging configuration can be set up in a configuration file. The parameters <code>-nolog</code> and <code>-v</code> can be used to alter logging strategy. The standard unix program <code>tee</code> can be used to save the output to file while at the same time monitoring the standard output.</p>
-<h3>How does RFI console recognise RFI?</h3>
-<p>It estimates the astronomical signal and searches for statistical abnormalities that look like lines in the time/frequency plots.
-After initial detection, it applies a morphological algorithm to find likely contaminated samples.
-It has several tricks to enhance the speed. The following refereed papers describe parts of the detection technique in detail:</p>
-<ul>
-  <li><a href="http://adsabs.harvard.edu/doi/10.1111/j.1365-2966.2010.16471.x">Post-correlation radio frequency interference classification methods</a>, <span class="journal">MNRAS</span>, Vol. 405, 1, June 2010, pp. 155-167</li>
-  <li><a href="http://adsabs.harvard.edu/abs/2010arXiv1007.2089O">A LOFAR RFI detection pipeline  and its first results</a>, <span class="journal">PoS, RFI2010</span>, March 2010.</li>
-	<li><a href="http://adsabs.harvard.edu/abs/2012A%26A...539A..95O">A morphological algorithm for improving radio-frequency interference detection</a>, <span class="journal">A&amp;A</span>, Vol. 539, A95, March 2012.</li>
-</ul>
-<h3>I still have questions / contact info</h3>
-<p>I love to have feedback in order to update this FAQ and get a grib on common problems. You can reach me on my e-mail address, <code>&lt;my-last-name&gt;@astro.rug.nl</code>, and my last name is offringa.</p>
-</body>
-</html>
-
diff --git a/CEP/DP3/AOFlagger/doc/site/gui-tutorial.html b/CEP/DP3/AOFlagger/doc/site/gui-tutorial.html
deleted file mode 100644
index 78b6b888f97c27862681f049cf020e05a1fd5ba8..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/doc/site/gui-tutorial.html
+++ /dev/null
@@ -1,356 +0,0 @@
-<html>
-<head><title>Offringa's RFI software</title>
-<link rel="stylesheet" type="text/css" href="style.css" />
-</head>
-<body>
-<p><a href="http://www.astro.rug.nl/~offringa/">Offringa</a>-&gt;<a href="index.html">RFI software</a>-&gt;RFI gui tutorial</p>
-<h2>RFI GUI tutorial</h2>
-<h3>Introduction</h3>
-<p>The GUI of the AOTools is aimed at analysing data of a single baseline
-at a time. Especially for problems related to RFI, this should be a very
-handy tool. The tool can do quite advanced data manipulation, but many
-of the advanced tricks are undocumented and/or somewhat hidden in the
-tool. The tool (including its documentation) is very much a work in progress.</p>
-<p>This tutorial was written for the SVN version of 2011-01-21.</p>
-<h3>Starting the tool</h3>
-<p>Once you have installed the GUI, you should be able to start the GUI with
-"rfigui". If you are running the GUI remotely on a different machine, make
-sure you have your x server forwarded (either with ssh -X or ssh -Y depending
-on Mac/Linux). On the LOFAR CEP cluster, you have to import the LofIm
-environment with "use LofIm".</p>
-<img align="right" src="img/rfigui-mainwindow.png" />
-<h3>Opening a measurement set</h3>
-<p>After starting the GUI, the main window will appear (displayed on the
-right), from which most actions will be performed. To start working,
-open a measurement set. RFI gui has been written around the AIPS++/CASA 
-measurement set format (directories with extension .MS), and works best
-with those formats. There is some limited
-support for opening UV FITS files (extension .uvfits) and raw RTCP output
-files (extension .raw).</p>
-<img align="left" src="img/rfigui-openms.png" />
-<p>To open a measurement set, select "Open directory" from the
-"File" menu. For opening a uv fits or raw file, select "Open file" instead.
-In general, RFI gui will never write changes to the measurement set;
-all options in the menu will be executed in memory, with the exception
-of custom made strategies.<br clear="left" /></p>
-<img align="right" src="img/rfigui-openoptions.png" />
-<p>After selecting your measurement set (abbrev. MS),
-a pop-up window will appear (displayed on the right) with
-settings for opening the set. In most cases, you'll want to keep the default
-settings.</p>
-<p>The settings are:</p>
-<ul>
-<li>Column: the column to read from the MS. "Residual" will subtract the
-model data from the original data ("DATA" column).</li>
-<li>Polarisation: which polarisations to read. By default, will read four
-polarisations. In RFI gui, the gui will always refer to the polarisations
-as if they are orthogonal, thus as if XX, XY, YX and YY are in the set.
-However, if the MS contains circular polarisations, the
-XX polarisation will actually be LL, XY will be LR, etc. When data contains
-four polarisation, the GUI will often visualize the Stokes I values by
-calculating (XX + YY) (or (LL + RR) in the case of circular polarisation).
-For flagging, it often matters little in which coordinate system the
-polarisations are represented, as long as all information is being used.</li>
-<li>Indirect read options: Enables reordering of the measurement set,
-as described on the <a href="reading-mode.html">Reading mode page</a>.
-Normally you don't want this, because it takes a long time to reorder the
-entire set. Once reordered, it is much faster to read a single baseline.
-Therefore, if you intent to look at many (/all) baselines in the
-set, this is more efficient.</li>
-<li>Read UVW: Enables reading of the UVW values. Some custom strategy
-actions need these. Since these values are not reordered, reading them might
-take a little bit of time in indirect reading mode. When processing sets
-with >1000 baselines, this might be as much as several seconds per baseline.
-</li>
-<li>Partitioning: Can split baselines into several pieces. Only works in
-direct reading mode. Used to speed up reading so that smaller pieces at
-a time can be inspected more quickly. Bit of an artifact of previous
-issues, and not recommended to be used.</li>
-</ul>
-<p>After you press the "Open" button, the set will be opened and the
-first baseline in the set will be read. This might take some time.</p>
-<br clear="all" /></p>
-<h3>Selecting a baseline</h3>
-<p>The first baseline in a MS set is often an autocorrelation. These have often
-been flagged entirely by the observatory, and you might therefore see a
-large purple window appear after opening a MS. </p>
-<p>There are two options for going to a different baselines:</p>
-<ol>
-<li><img align="left" src="img/rfigui-goto.png" /><img align="right" src="img/rfigui-gotowindow.png" />
-Select "Go to..." from the "Go" menu. A window appears to select a baseline.
-The image on the right shows how the "Go to" window might look like when
-working with WSRT data.
-By default, your current baseline will be
-selected (versions < 2011-01-21 won't do this). Select your desired baseline
-and press "Load" to load the baseline. Once again, that might take time.<br clear="left" />
-</li>
-<li>By pressing the toolbar "Next" and "Previous" you can iterate quickly over
-baselines in the MS. The order in which will be iterated depends on the order
-they are stored in the MS (to be more exactly; the order in which the first
-time step has been stored in the set). Directly after loading a new set,
-the status bar in the bottom will show the baseline (if you have not moved
-with the mouse over the time frequency canvas).</li><br clear="all" />
-</ol>
-<h3>The main window</h3>
-<img align="right" src="img/rfigui-mainwindow-loaded.png" />
-<p>Once the loading of the data is finished, you should see your baseline
-in the main window, along with the axes: frequency will be displayed
-vertically, time horizontally. To the right is the window displayed with a
-WSRT measurement open.</p>
-<p>If your set has already been flagged, you should see the flags marked
-in fuchsia.
-As you can see on the right, the WSRT set has been flagged already.
-The "original flags" and "alternative flag" buttons turn respectively
-the fuchsia and the yellow flag markings on and off. When a new baseline is
-loaded, the yellow and fuchsia flags are the same, however, once you start
-executing strategies, the yellow ("alternative") flags will show the flags
-produced by the flagger.<br clear="right" /></p>
-<img align="right" src="img/rfigui-plotmenu.png" />
-<p>The "plot" menu houses a lot of plotting operations, such as plotting
-the distribution, the bandpass and time vs. amplitude. These options require
-gnuplot, a pdf viewer and Ghostscript. If they don't work, check the
-<a href="faq.html">FAQ page</a> on that issue. All options always operate
-on the currently visible data. The plotting operations will also take
-in account flags, and not use them to draw the graph if appropriate, if
-marking of the flags is enabled (if both original and alternate flags are
-displayed, they will be combined).</p>
-<p>The plot menu also houses a quick imager, that will be described later.</p>
-<h3>Flagging & strategies</h3>
-<p>The purpose of the RFI gui is to quickly experiment with different
-parameters and flagging algorithms. In this section, a quick overview to test
-and alter the flagger will be given.</p>
-<p>Assuming that a baseline has been loaded as described above,
-a first try at flagging can be performed by selecting
-"Execute strategy" from the "Actions" menu. A pop-up will appear and
-show the progress. Note that, unlike the "RFI console" program,
-execution of the default flagger will be performed in memory only: the MS
-will not be changed (although, needless to say, it is generally a good practice
-to have a backup of data which is being worked on). Flagging a single baseline
-with the default strategy should be quick; less than a second with a few
-hundred time steps and channels, or in the order of tens of seconds when e.g.
-flagging thousands of time steps x 256 channels (which is common in
-LOFAR observations).</p>
-<p>Once the strategy is finished, the "Alternative flags" button controls
-the visibility of the flags produced by the strategy. You might want to turn
-the "Original flags" button off, as these will be drawn on top of the
-alternative flags, and might occlude them.</p>
-<p>A flagging algorithm is composed of a collection
-of actions which together form what is called a "strategy", which is
-comparable to a script in a programming language.
-Actions can have parameters
-that tune the flagger. For example; one action tries to subtract the celestial
-signal and passband by smoothing the data. This action has parameters to
-alter the way and the strength of the smoothing action.</p>
-<img src="img/rfigui-editstrategywindow.png" alt="Edit strategy window" align="right" />
-<p>The default strategy is optimized to be quick and accurate, and has
-been toroughly tested on LOFAR and WSRT data as well as using
-simulations. However, certain observations might
-still produce less satisfying results, for example when a telescope
-with a steeper passband is used and the fitter is too constrained, or when
-a celestial source produces strong fringes due to antenna sidelobes,
-and are being considered as RFI. Below I will describe some things which
-you can try to optimize the strategy for your situation.</p>
-<p>To see and edit the strategy, go to the Actions menu in the main window
-and select "Edit strategy". A window similar to the picture on the right
-will appear. The largest space will be taken by the various actions,
-displayed hierarchically. In the root is "Strategy", which represents the
-starting point of execution. Below the strategy window are three rows of
-buttons. The first rows are used for editting the strategy, the second row
-handles file actions (save and open of a strategy) and the third row loads
-a new or default strategies. By clicking on an action, the parameters of the
-action appear (i.e., if the action has any). The hierarchical displayment
-allows grouping; e.g., the "For each polarisation" action iterates over all
-polarisations and execute its children once for each polarisation. Then,
-it combines the results of all runs and changes the three copies accordingly.
-</p>
-<p>Internally, the strategy will keep three copies of the data in memory.
-These are referred to as "Original", "Revised" and "Contaminated". Most
-actions are applied on the "Contaminated" data, while the "Revised" is being
-used for storing the background fit. Finally, the "Original" image is kept
-to be able to restore any changes, e.g. after an iteration. Currently,
-it is not well documented what actions exactly do, which hopefully will
-become more clear in the future. </p>
-<h3>Adding an action</h3>
-<p>To add a new action:</p>
-<ul>
-<li>Select the node which is going to be its parent. This parent should be
-a "container" node, that is, be able to have children nodes. If this is
-not the case, the "Add" button will be greyed out.</li>
-<li>Press the Add button. A long menu appears on the right with all the actions
-available.</li>
-<li>Select the right action.</li>
-<li>The new action will be selected. You might want to change its position
-inside the parent by pressing the Up and Down buttons.</li>
-</ul>
-<h3>The default strategy</h3>
-<p>The image of the edit window on the right shows the current default strategy (which is subject
-to change...). The strategy is explained in the article
-<a href="http://arxiv.org/abs/1007.2089">A LOFAR RFI detection pipeline and
-its first results (Offringa et al., 2010)</a>, which I refer to for a general
-understanding. The "Default" button resets the strategy. The "1", "2" and "3"
-buttons load the Default strategy encapsulated in a "For each baseline"
-action, including a "Write flags" action. This corresponds with the "quick",
-"default" and "best" strategies creatable by the "rfistrategy" binary, which
-are equal at present (we found that the best and quick strategies were almost
-equal qua performance, while the accuracy was considerably better, hence
-took that as default for all). If you load one of the 1,2,3 strategies and
-execute it, you would flag (and write those flags to..!) your whole set.</p>
-<p>
-Here is a summary of the individual actions:</p>
-<ul>
-<li><em>Set no flags</em>: removes the flags in the Contaminated data.</li>
-<li><em>For each polarisation</em> iterates over selected polarisations
-and executes all children for the selected polarisations. The result of the
-children will be combined and returned, if possible.</li>
-<li><em>On amplitude:</em> is a "For each complex component" action. Executes
-all children by iterating over certain complex derivations and will
-combine the results if possible. Possibilities are execution on
-amplitude, phase, real and imaginary values. In the default pipeline, only the
-amplitude value is used. Note that if subtasks alter the amplitude values,
-this task cannot change this back into real and imaginary values.
-Nevertheless, it is often useful to see what the background fit has done,
-which can be seen by selecting the "Restore from amplitude" checkbox (do not
-forget to "Apply" the changes). The "background" toolbar button on the
-mainwindow will then show you the fitted background after the strategy
-has been executed. Very useful for analysis.</li>
-<li><em>Iterate 2 times:</em> is an iteration action. Executes its children
-a number of times. Will also change the threshold sensitivity
-exponentially, which can be controlled by its parameters. When accuracy
-is not good enough, it might help to increase the number of iterations. While
-it takes more time, the output should be more stable.</li>
-<li><em>SumThreshold:</em> performs the SumThreshold algorithm to flag samples.
-The result is stored in the Contaminated data. The method has been introduced
-and tested in the article
-<a href="http://onlinelibrary.wiley.com/doi/10.1111/j.1365-2966.2010.16471.x/full">Post-correlation radio frequency interference classification methods
-(Offringa et al., 2010)</a>, and has since proven to be very accurate. 
-It has an important parameter: its base sensitivity. If you see too few
-flags, increase its sensitivity (by lowering the number), if you see too many
-flags, lower its sensitivity (by increasing the number).</li>
-<li><em>Combine flag results:</em> runs its children one by one and "ors"
-together all flags (in this case, the frequency and time selection are
-executed one after one other and then combined.
-The difference with just running the selections after each other without
-combining the flags, is that they will both be presented the flags
-that are produced by the SumThreshold, and the Time selection will not
-be presented the flags of the Frequency selection.</li>
-<li><em>Time selection:</em> selects times which have an acceptable RMS,
-compared to its neighbours and flags the other.</li>
-<li><em>Frequency selection:</em> equal to time selection, but then in
-frequency.</li>
-<li><em>Set contaminated=original</em>: will revert any changes being done
-to the contaminated data (but not change its flags). In the default
-strategy, this is used to iteratively get a better fit to the data. First,
-a very rough threshold is done, then a first fit while ignoring flagged data,
-then a better threshold and a better fit, etc.</li>
-<li><em>Change resolution</em>: downscales the images, then executes its
-children and then upscales the result. Scaling is done by nearest
-neighbour interpolation; not so accurate, but very fast. The reason for it
-being in the default pipeline, is to increase performance. The sliding window
-fit operation is one of the slowest operations. By performing it on a
-low resolution, the speed is significantly increased. If your measurement
-set has strong, fast fringes, it might be helpful to set the resolution change
-factors to "1" (i.e., no change). The kernel in the sliding window fit
-action is currently set in number of samples, which implies that the total
-size of the kernel is multiplied by the scale factor.</li>
-<li><em>Sliding window fit</em>: smoothes the "Contaminated data", stores
-the result in the "Revised data" and the difference in "Contaminated data".
-Keep in mind that the "Change resolution" action also effect the size of the
-kernels (see above). You can analyse the fitted background in the GUI by
-making sure that the "On amplitude" action saves the background (select
-its "Restore amplitudes" checkbox). </li>
-<li><em>Apply flags to all polarisations:</em> if a sample is flagged
-in one polarisation, will flag all polarisations.</li>
-<li><em>Statistical flagging:</em> somewhat of a bad name for what its
-purpose became, this action flags samples that are close to large areas of
-flags. It's described in <a href="http://arxiv.org/abs/1007.2089">A LOFAR
-RFI pipeline and its first results</a>, where it is called a
-"density dillution".</li>
-<li><em>Select baselines</em>: assembles statistics on baselines. Needs a
-second action to output the baselines, which by default is added by
-RFI console.</li>
-<li><em>Or flags with original</em>: If flags exist in the MS, this action will
-keep those flags. If you want to "start over" and remove existing flags,
-remove this action. Note that if the set contains flags and this action
-exists, the yellow output flags will be a combination of the fuchsia input
-flags and the flagging result.</li>
-</ul>
-<p>Be sure to read <a href="strategy-example-a.html">the strategy
-optimization example</a>. There is also an item in the
-<a href="faq.html">FAQ</a> on what can be tried
-to solve certain issues. Do not forget to press the "Apply" button after
-changing parameters. If you forget this, the changes are not saved,
-and RFI gui will not warn you about it.</p>
-<h3>Executing a strategy in RFI console</h3>
-<p>It is possible to export a strategy from the GUI and execute it in RFI
-console, in order to quickly flag multiple sets with the same strategy. This
-is also handy when you want to flag the data on a different (faster :))
-machine, or when you do not want to use the GUI for the actual flagging.</p>
-<p>In order to do so, create a strategy that satisfactory flags a single
-baseline. Then, click the "FOB" button, which will add a "for each baseline"
-at the root of the strategy. You might want to change some of its parameters.
-Then, add a "Write flags" action as the last action of the For Each Baseline
-action, so that the results are actually written. Now, your strategy is
-ready to be executed on the entire set. You can "Save" the strategy and use it
-in RFI console (but you can also run it in RFI gui).</p>
-<p>Vice versa, you can also load a Strategy created by the RFI strategy
-program, possibly to understand how the default strategies operate -- but be
-aware that those strategies write their changes.</p>
-<h3>Imaging capabilities</h3>
-<p>Imaging of the currently selected
-data can be done with "Set and show image plan" in the Plot menu. A window
-appears where you can switch between the UV plane and the imaging plane. This
-action is actually a short cut for four actions: (1) pressing
-"Show image plane"; (2) pressing "Clear" in the image plane;
-(3) pressing "Add to image plane" in the Plot menu of the main window; and (4)
-pressing "Apply weights" in the image window. The first action is trivial,
-the others will be described below.</p>
-<ul>
-<li>The clear button in the image plane window sets the current image to
-zero and sets the currently associated weights to zero.</li>
-<li>The apply weights button in the image plane window divides each pixel
-in the currently constructed uv plane
-by the number of a sample was gridded on that pixel (updating both the
-UV plane and the image plane). Until you have pressed this button, the image
-plane is not always shown. Once you have pressed this button, you should
-not add new data to the uv plane, as you would weight this new data
-different then the previously added data. </li>
-<li>The "Add to image plane" menu item on the main window will grid and add
-the currently visible data to the uv plane, and update the weights
-accordingly. By adding several baselines, you would add more and more data to
-the UV plane, hence improve the image.
-If you would add all baselines in your MS one by one, you would
-have manually imaged your observation much like a normal imager would
-do. You can actually create a strategy that does that (a "For each baseline"
-action with an "Image" action).</li>
-</ul>
-<p>The image window has a lot of buttons with undocumented abbreviations on
-them. They are:</p>
-<ul>
-<li>x1/4, x1/2, x1, x2, ... x128: these buttons Clear the current data and 
-weights and change scaling of (new) data in the UV plane. It is not so much
-meant as having accurate units, therefore you have to experiment which
-scaling will give you a good sampling of the uv plane (the uv tracks should
-be visible and preferably not be too small). With WSRT LFFE data (150 MHz), the
-longest baseline of 2,7 km is quite nicely shown with a scaling of 4x.
-Remember that zooming in on the UV plane means zooming out on the image plane.
-</li>
-<li>R: redraw the current image in the imager</li>
-<li>MS: the MS button ("Memory store") stores the image currently being
-shown in memory</li>
-<li>MR: draw the image that has been stored in memory. By clicking "R"
-and "MR" after each other, you can compare the stored image with the current
-image quickly.</li>
-<li>Mx: multiply the current image with the image in memory</li>
-<li>M-: Show memory minus current</li>
-<li>sqrt: Display the square root of the visible data. The negative values
-(displayed in red) will be calculated as -sqrt(-data), hence remain negative.
-</li>
-<li>S: (toggle button) keep the scale constant. Will not change the color scale
-when new data is shown, hence can make comparing easier.</li>
-<li>H/V: horizontal/vertical graph, experimental options.</li>
-<li>AT: angular transformation, experimental option.</li>
-</ul>
-</p>
-</body>
-</html>
-
diff --git a/CEP/DP3/AOFlagger/doc/site/img/rfi-example-A0.png b/CEP/DP3/AOFlagger/doc/site/img/rfi-example-A0.png
deleted file mode 100644
index e58168f66b8d54e466aaaac5e8bc1337c1e183ec..0000000000000000000000000000000000000000
Binary files a/CEP/DP3/AOFlagger/doc/site/img/rfi-example-A0.png and /dev/null differ
diff --git a/CEP/DP3/AOFlagger/doc/site/img/rfi-example-A1.png b/CEP/DP3/AOFlagger/doc/site/img/rfi-example-A1.png
deleted file mode 100644
index 4f8793d0882b7f43e814cba07d99a2f55f5c236d..0000000000000000000000000000000000000000
Binary files a/CEP/DP3/AOFlagger/doc/site/img/rfi-example-A1.png and /dev/null differ
diff --git a/CEP/DP3/AOFlagger/doc/site/img/rfi-example-A10.png b/CEP/DP3/AOFlagger/doc/site/img/rfi-example-A10.png
deleted file mode 100644
index 446af0b4b662e514e7d6778d3d7642dc3812f34d..0000000000000000000000000000000000000000
Binary files a/CEP/DP3/AOFlagger/doc/site/img/rfi-example-A10.png and /dev/null differ
diff --git a/CEP/DP3/AOFlagger/doc/site/img/rfi-example-A11.png b/CEP/DP3/AOFlagger/doc/site/img/rfi-example-A11.png
deleted file mode 100644
index b434a66c243e02b67ac6ed812cbd06356c11e9e3..0000000000000000000000000000000000000000
Binary files a/CEP/DP3/AOFlagger/doc/site/img/rfi-example-A11.png and /dev/null differ
diff --git a/CEP/DP3/AOFlagger/doc/site/img/rfi-example-A12.png b/CEP/DP3/AOFlagger/doc/site/img/rfi-example-A12.png
deleted file mode 100644
index c76d15ec6eb6bcd319a0792391debe5ce80e00b5..0000000000000000000000000000000000000000
Binary files a/CEP/DP3/AOFlagger/doc/site/img/rfi-example-A12.png and /dev/null differ
diff --git a/CEP/DP3/AOFlagger/doc/site/img/rfi-example-A13.png b/CEP/DP3/AOFlagger/doc/site/img/rfi-example-A13.png
deleted file mode 100644
index 65cf5496bb9041616cb94983baa2644e53a627a8..0000000000000000000000000000000000000000
Binary files a/CEP/DP3/AOFlagger/doc/site/img/rfi-example-A13.png and /dev/null differ
diff --git a/CEP/DP3/AOFlagger/doc/site/img/rfi-example-A14.png b/CEP/DP3/AOFlagger/doc/site/img/rfi-example-A14.png
deleted file mode 100644
index 0c559aaf2e8819e1d008b91e541ac0b80a7ff417..0000000000000000000000000000000000000000
Binary files a/CEP/DP3/AOFlagger/doc/site/img/rfi-example-A14.png and /dev/null differ
diff --git a/CEP/DP3/AOFlagger/doc/site/img/rfi-example-A15.png b/CEP/DP3/AOFlagger/doc/site/img/rfi-example-A15.png
deleted file mode 100644
index e08e4ff4b91af41fa7d8084f27791e92c4e59db9..0000000000000000000000000000000000000000
Binary files a/CEP/DP3/AOFlagger/doc/site/img/rfi-example-A15.png and /dev/null differ
diff --git a/CEP/DP3/AOFlagger/doc/site/img/rfi-example-A16.png b/CEP/DP3/AOFlagger/doc/site/img/rfi-example-A16.png
deleted file mode 100644
index e987bc66fb6da3ccf6b6f90d53d0066361b80580..0000000000000000000000000000000000000000
Binary files a/CEP/DP3/AOFlagger/doc/site/img/rfi-example-A16.png and /dev/null differ
diff --git a/CEP/DP3/AOFlagger/doc/site/img/rfi-example-A2.png b/CEP/DP3/AOFlagger/doc/site/img/rfi-example-A2.png
deleted file mode 100644
index 21ee04615b75a6f22ed1f874cb3ff05bdc5561c8..0000000000000000000000000000000000000000
Binary files a/CEP/DP3/AOFlagger/doc/site/img/rfi-example-A2.png and /dev/null differ
diff --git a/CEP/DP3/AOFlagger/doc/site/img/rfi-example-A3.png b/CEP/DP3/AOFlagger/doc/site/img/rfi-example-A3.png
deleted file mode 100644
index ee116342d7695b9e3c501f826d620f5d108d0570..0000000000000000000000000000000000000000
Binary files a/CEP/DP3/AOFlagger/doc/site/img/rfi-example-A3.png and /dev/null differ
diff --git a/CEP/DP3/AOFlagger/doc/site/img/rfi-example-A4.png b/CEP/DP3/AOFlagger/doc/site/img/rfi-example-A4.png
deleted file mode 100644
index 1d584c2a0fc78de4afbd4c431ed0dcf1784a59e5..0000000000000000000000000000000000000000
Binary files a/CEP/DP3/AOFlagger/doc/site/img/rfi-example-A4.png and /dev/null differ
diff --git a/CEP/DP3/AOFlagger/doc/site/img/rfi-example-A5.png b/CEP/DP3/AOFlagger/doc/site/img/rfi-example-A5.png
deleted file mode 100644
index 45d49d7927b4dc3f84d0b699a38b93055c4a3c06..0000000000000000000000000000000000000000
Binary files a/CEP/DP3/AOFlagger/doc/site/img/rfi-example-A5.png and /dev/null differ
diff --git a/CEP/DP3/AOFlagger/doc/site/img/rfi-example-A6.png b/CEP/DP3/AOFlagger/doc/site/img/rfi-example-A6.png
deleted file mode 100644
index 0cdc88471c6a6e2c93b8d857061c05820b8e5ed0..0000000000000000000000000000000000000000
Binary files a/CEP/DP3/AOFlagger/doc/site/img/rfi-example-A6.png and /dev/null differ
diff --git a/CEP/DP3/AOFlagger/doc/site/img/rfi-example-A7.png b/CEP/DP3/AOFlagger/doc/site/img/rfi-example-A7.png
deleted file mode 100644
index 8a7d58ed6eb16777eb326256fb40f806f9009633..0000000000000000000000000000000000000000
Binary files a/CEP/DP3/AOFlagger/doc/site/img/rfi-example-A7.png and /dev/null differ
diff --git a/CEP/DP3/AOFlagger/doc/site/img/rfi-example-A8.png b/CEP/DP3/AOFlagger/doc/site/img/rfi-example-A8.png
deleted file mode 100644
index 3ba68a1130de61b99e816793de9012a0c23a3986..0000000000000000000000000000000000000000
Binary files a/CEP/DP3/AOFlagger/doc/site/img/rfi-example-A8.png and /dev/null differ
diff --git a/CEP/DP3/AOFlagger/doc/site/img/rfi-example-A9.png b/CEP/DP3/AOFlagger/doc/site/img/rfi-example-A9.png
deleted file mode 100644
index 11be208ce200ab959d73f88b2c3bca9905cb2573..0000000000000000000000000000000000000000
Binary files a/CEP/DP3/AOFlagger/doc/site/img/rfi-example-A9.png and /dev/null differ
diff --git a/CEP/DP3/AOFlagger/doc/site/img/rfigui-editstrategywindow.png b/CEP/DP3/AOFlagger/doc/site/img/rfigui-editstrategywindow.png
deleted file mode 100644
index 2b94dfc17804e59f26a036b9f10a9be99d91670a..0000000000000000000000000000000000000000
Binary files a/CEP/DP3/AOFlagger/doc/site/img/rfigui-editstrategywindow.png and /dev/null differ
diff --git a/CEP/DP3/AOFlagger/doc/site/img/rfigui-goto.png b/CEP/DP3/AOFlagger/doc/site/img/rfigui-goto.png
deleted file mode 100644
index 70b3a68137e95d1acfcccb17812f57ac7dcf6273..0000000000000000000000000000000000000000
Binary files a/CEP/DP3/AOFlagger/doc/site/img/rfigui-goto.png and /dev/null differ
diff --git a/CEP/DP3/AOFlagger/doc/site/img/rfigui-gotowindow.png b/CEP/DP3/AOFlagger/doc/site/img/rfigui-gotowindow.png
deleted file mode 100644
index 6cbe5a8150cdbd0adcf7ef749b83a733515229d9..0000000000000000000000000000000000000000
Binary files a/CEP/DP3/AOFlagger/doc/site/img/rfigui-gotowindow.png and /dev/null differ
diff --git a/CEP/DP3/AOFlagger/doc/site/img/rfigui-mainwindow-loaded.png b/CEP/DP3/AOFlagger/doc/site/img/rfigui-mainwindow-loaded.png
deleted file mode 100644
index faf2e564a673e458f3934c408ddf2d2cdeb3bec4..0000000000000000000000000000000000000000
Binary files a/CEP/DP3/AOFlagger/doc/site/img/rfigui-mainwindow-loaded.png and /dev/null differ
diff --git a/CEP/DP3/AOFlagger/doc/site/img/rfigui-mainwindow.png b/CEP/DP3/AOFlagger/doc/site/img/rfigui-mainwindow.png
deleted file mode 100644
index 5422e7de4911404b96943815c0c618c36fc541d2..0000000000000000000000000000000000000000
Binary files a/CEP/DP3/AOFlagger/doc/site/img/rfigui-mainwindow.png and /dev/null differ
diff --git a/CEP/DP3/AOFlagger/doc/site/img/rfigui-openms.png b/CEP/DP3/AOFlagger/doc/site/img/rfigui-openms.png
deleted file mode 100644
index c33436b0c958a264b09c1b356eb91c44014cf886..0000000000000000000000000000000000000000
Binary files a/CEP/DP3/AOFlagger/doc/site/img/rfigui-openms.png and /dev/null differ
diff --git a/CEP/DP3/AOFlagger/doc/site/img/rfigui-openoptions.png b/CEP/DP3/AOFlagger/doc/site/img/rfigui-openoptions.png
deleted file mode 100644
index 12b3f76eb6d7012b2e755de084fe5c0c43b31ed3..0000000000000000000000000000000000000000
Binary files a/CEP/DP3/AOFlagger/doc/site/img/rfigui-openoptions.png and /dev/null differ
diff --git a/CEP/DP3/AOFlagger/doc/site/img/rfigui-plotmenu.png b/CEP/DP3/AOFlagger/doc/site/img/rfigui-plotmenu.png
deleted file mode 100644
index 831b35c6e16b9306ec0962aee223eb080eafc65b..0000000000000000000000000000000000000000
Binary files a/CEP/DP3/AOFlagger/doc/site/img/rfigui-plotmenu.png and /dev/null differ
diff --git a/CEP/DP3/AOFlagger/doc/site/index.html b/CEP/DP3/AOFlagger/doc/site/index.html
deleted file mode 100644
index 8ff51fc95c64ec7836bff1d876e1800f2cb39b0e..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/doc/site/index.html
+++ /dev/null
@@ -1,151 +0,0 @@
-<html>
-<head><title>Offringa's RFI software</title>
-<link rel="stylesheet" type="text/css" href="style.css" />
-</head>
-<body>
-<a href="http://www.astro.rug.nl/~offringa/">Offringa</a>-&gt;RFI software
-<h2>RFI software</h2>
-<p>This page describes the software to detect and mitigate radio frequency interference (RFI) in a radio measurement set. The main algorithms are described in the articles
-"<a href="http://adsabs.harvard.edu/doi/10.1111/j.1365-2966.2010.16471.x">Post-correlation radio frequency interference classification methods'</a>" (Offringa et al. 2010, MNRAS, Volume 405, Issue 1, pp. 155-167) and "<a href="http://www.aanda.org/index.php?option=com_article&access=doi&doi=10.1051/0004-6361/201118497&Itemid=129">A morphological algorithm for improving radio-frequency interference detection</a>" (Offringa et al. 2012, A&amp;A, Volume 539, Issue A95). Please acknowledge these papers in publications in which the software is used. The first one introduces the SumThreshold method and tests signal estimation methods, the latter introduces the Scale-invariant rank operator.</p>
-<p>I've made a "<a href="faq.html">Frequently Asked Questions</a>" page for the software, a short <a href="gui-tutorial.html">RFI GUI tutorial</a> and an <a href="strategy-example-a.html">example of how one can optimize the strategy</a>.</p>
-<p>Last release: version 2.1.0, 12 August 2012.</p>
-<p>Contents:</p>
-<ul>
-<li><a href="#introduction">Introduction</a></li>
-<li><a href="#download">Download</a></li>
-<li><a href="#installation">Installation</a></li>
-<li><a href="#usage">Usage instructions</a></li>
-<li><a href="#problems">Problems and solutions</a></li>
-<li><a href="#contact">Contact information</a></li>
-<li><a href="#acknowledgments">Acknowledgments</a></li>
-</ul>
-<a id="introduction"><h4>Introduction</h4></a>
-<p>The RFI software presented here can automatically flag data and can be used to analyze the data in a measurement. The purpose of flagging is to mark samples that are affected by interfering sources such as radio stations, airplanes, electrical fences or other transmitting interferers.</p>
-<p>The tools in the package are meant for offline use. The software package contains a graphical interface ("<tt>rfigui</tt>") that can be used to visualize a measurement set and analyze mitigation techniques. It also contains a console flagger ("<tt>rficonsole</tt>") that can execute a script of mitigation functions without the overhead of a graphical environment. All tools were written in C++.</p>
-<p>The software has been tested extensively on many radio telescopes, especially on but not limited to low radio frequencies (150 MHz or lower) produced by the <a href="http://www.astron.nl/radio-observatory/astronomers/wsrt-astronomers">WSRT</a> and <a href="http://www.lofar.org">LOFAR</a> telescopes. It also works on single dish radio telescopes. I believe that it is both the <em>fastest</em> and <em>most accurate</em> flagger available, which is supported by the scientific articles. </p>
-<p>The software is published under the GNU General Public License version 3.</p>
-<a id="download"><h4>Download</h4></a>
-<p>The latest version of the software can be downloaded here:</p>
-<ul><li>Download: <a href="AOFlagger-2.1.0.tar.bz2">AOFlagger-2.1.0.tar.bz2</a> (12 August 2012, <a href="CHANGELOG">changelog</a>)</li></ul>
-<ul><li>Download: <a href="AOFlagger-2.0.1.tar.bz2">AOFlagger-2.0.1.tar.bz2</a> (16 March 2012, <a href="CHANGELOG">changelog</a>)</li></ul>
-<ul><li>Download: <a href="AOFlagger-2.0.0.tar.bz2">AOFlagger-2.0.0.tar.bz2</a> (9 March 2012, <a href="CHANGELOG">changelog</a>)</li></ul>
-<ul><li>Download: <a href="AOFlagger-1.5.0.tar.bz2">AOFlagger-1.5.0.tar.bz2</a> (20 October 2011, <a href="CHANGELOG">changelog</a>)</li></ul>
-<ul><li>Download: <a href="AOFlagger-1.4.0.tar.bz2">AOFlagger-1.4.0.tar.bz2</a> (22 Juli 2011, <a href="CHANGELOG">changelog</a>)</li></ul>
-<ul><li>Download: <a href="AOFlagger-1.3.0.tar.bz2">AOFlagger-1.3.0.tar.bz2</a> (26 April 2011)</li></ul>
-<ul><li>Download: <a href="AOFlagger-1.2.0.tar.bz2">AOFlagger-1.2.0.tar.bz2</a> (28 Februari 2011)</li></ul>
-<ul><li>Download: <a href="AOFlagger-1.1.0.tar.bz2">AOFlagger-1.1.0.tar.bz2</a> (22 October 2010)</li></ul>
-<p>See the compilation instruction below.</p>
-<a id="installation"><h4>Installation</h4></a>
-<p>The packages contain a part of the LOFAR software tree that contain the AOFlagger tools. Most astronomical workstations will have most of the required libraries.</p>
-<h5>Requirements</h5>
-<p>Below is a list of libraries that are required.</p>
-<ul>
-<li><a href="http://casacore.googlecode.com/">Casacore</a>, for opening measurement sets.</li>
-<li><a href="http://www.fftw.org/">FFTW</a>, used to perform Fourier transformations.</a></li>
-<li><a href="http://www.boost.org/">Boost</a>, used for threading, date and time calculations and some other general functionalities.</li>
-<li><a href="http://xmlsoft.org/">libxml</a>, used for saving scripts / configurations.</li>
-<li><a href="http://www.netlib.org/clapack/">CLAPACK</a>, for linear algebra, such as singular value decomposition.</li>
-<li><a href="http://heasarc.nasa.gov/fitsio/">CFITSIO</a>, for reading and writing FITS files.</li>
-<li><a href="http://log4cplus.sourceforge.net/">Log4cplus</a>, for making log files. I was notified by Arpad Miskolczi that AOFlagger is not yet compatible with Log4cplus version 1.1.0, so use version 1.0.4 or earlier. </li>
-<li>(the <a href="http://www.gnu.org/software/gsl/">GNU Science Library</a> is not required for versions between 1.2 and 1.5)</li>
-<li>gtkmm (only for <tt>rfigui</tt> and other graphical programs)</li>
-</ul>
-<p>All the libraries are available as free and open software. The gtkmm libraries and headers are required for the gui but not for the console binary. If they are not present, cmake will warn about it, but will compile the console programs nevertheless.</p>
-<p>I disencourage you to compile gtkmm yourself; it has many dependencies. Rather use your package manager (or ask your system administrator). Debian ships this library as "gtkmm-dev".</p>
-<p>Some other libraries have to be available on the system (but are generally available). The complete list: </p>
-<ul>
-<li>png library</li>
-<li>pthread library</li>
-<li>dl, dynamic linking library</li>
-<li>f2c, fortran-to-c library</li>
-<li>cmake</li>
-</ul>
-<h5>Instructions for compilation</h5>
-<p>The following steps explain the standard compilation procedure. It is probably recommendable that you start on a system where you have full administration rights, so you can easily find out what exact requirements are required.</p>
-<ol>
-<li>If you have not done so, install the required libraries. Most of the requirements can be fetched from Debian(like) repositories, with the exception of <a href="http://casacore.googlecode.com/">Casacore</a>.</li>
-<li>Download and extract the software.</li>
-<li>Enter the directory <tt>./LOFAR</tt> and create and enter a sub-directory called "build/gnu_opt": <tt>mkdir -p build/gnu_opt</tt>; <tt>cd build/gnu_opt</tt>
-<li>Configure the package with cmake. If you installed all the libraries in their default location, you can issue the following command: <tt>cmake ../..</tt><br/>
-CMake will tell you when some of the files can not be found. If you need to specify the location of libraries, e.g. for casacore and log4cpp, you can issue something like:
-<tt>cmake ../.. -DCASACORE_ROOT_DIR=/home/offringa/casacore-install -DLOG4CPLUS_LIBRARY=/home/offringa/lib/liblog4cplus.a -DLOG4CPLUS_INCLUDE_DIR=/home/offringa/include/</tt></li>
-<li>If CMake succeeds, you can start the compilation: <tt>make</tt> (or <tt>make -j 8</tt> for 8 threaded compilation).</li>
-</ol></ol>
-<p>After the last step, the executables will be in the ./LOFAR/build/gnu_opt/CEP/DP3/AOFlagger/src directory, ready for action!</p>
-<h5>Compilation issues</h5>
-<ul>
-<li>In case of errors about global-init.h, disable the logger: add <tt>-DUSE_LOG4CPLUS=OFF -DUSE_LOG4CXX=OFF</tt> to your CMake command.</li>
-<li>Mac's will complain about errors related to malloc. Add <tt>-DUSE_SHMEM=OFF</tt> to your CMake command to fix this.</li>
-</ul>
-<a id="usage"><h4>Usage instructions</h4></a>
-<h5>rficonsole</h5>
-<p>The <tt>rficonsole</tt> program is the simplest way of executing a strategy. To flag RFI in a measurement set, type the following command:</p>
-<pre>./rficonsole &lt;path&#8209;to&#8209;ms&gt; [&lt;another&#8209;path&#8209;to&#8209;ms&gt; ...]</pre>
-<p>This will run the default flagging strategy, which has the best balance between flagging quality and speed. The specified filename should normally be a .MS directory containing an AIPS++/Casa measurement set. You can type <tt>./rficonsole</tt> without parameters to get information about its command. Currently, the following page is returned:</p>
-<pre>./rficonsole
-Usage: ./rficonsole [-v] [-j &lt;threadcount&gt;] [-strategy &lt;file.rfis&gt;] [-indirect-read] [-nolog] [-skip-flagged] &lt;ms1&gt; [&lt;ms2&gt; [..]]
-  -v will produce verbose output
-  -j overrides the number of threads specified in the strategy
-  -strategy specifies a possible customized strategy
-  -indirect-read will reorder the measurement set before starting, which is normally faster
-  -nolog will not use the LOFAR logger to output logging messages
-  -skip-flagged will skip an ms if it has already been processed by RFI console according
-   to its HISTORY table.
-  -uvw reads uvw values (some strategies require them)
-  -column &lt;NAME&gt; specify column to flag
-Execute 'rfistrategy' without parameters for help on creating RFIS strategies.
-</pre>
-<h5>rfistrategy</h5>
-<p>To customize the flagging process, you can run the rficonsole with an alternate strategy with the <tt>-strategy</tt> flag. You can create an <tt>.rfis</tt>-strategy file with the gui or with the rfistrategy command. rfistrategy is a console program. Run the rfistrategy command without parameters to get help:</p>
-<pre>./rfistrategy
-RFI strategy file writer
-This program will write an RFI strategy to a file, to run it with the
-rficonsole or the rfigui.
-
-Author: Andr&eacute; Offringa (e-mail)
-
-Usage: ./rfistrategy &lt;profile&gt; &lt;filename&gt;
-
-Profiles:
-        fast    Fastest strategy that provides a moderate
-                result in quality. Will flag the measurement set using
-                Stokes-I values, and by using a relatively small
-                sliding window.
-        average Best trade-off between speed and quality. Will
-                flag the measurement set using stokes I values using
-                an average sliding window size.
-        best    Highest quality detection. Will flag each
-                polarization individually, using a relatively large
-                sliding window.
-&lt;filename&gt; is the filename to which the strategy is written. This
-file should have the extension ".rfis".
-
-All profiles implement the SumThreshold method. The details of this
-method are described in the article named "Post-correlation radio
-frequency interference classification methods", submitted to MNRAS.</pre>
-<p>The .rfis files are XML files and can be changed by hand or with a script in e.g. a full (offline) processing pipeline.</p>
-<h5>rfigui</h5>
-<p>The rfigui is a complex analyzation and experimentation tool which I use to create and test alternate flagging strategies, quickly visualize data sets and their flags, make graphs and perform all kind of mutations on the data set. Most features are self-explanatory and can be found in the main menu. Some features are still under heavy development and might not work (correctly). Some of its features are:</p>
-<ul>
-<li>Opening AIPS++ measurement sets and UV-FITS files.</li>
-<li>Draw time-frequency graphs of Stokes I, single polarizations, phase or complex components of single baselines.</li>
-<li>Execute, visualize and compare flagging strategies with or without changing a data set.</li>
-<li>Create alternate flagging strategies by combining blocks of operations in a script tree. It works quite intuitively, e.g., by clicking on a block, one can change its parameters.</li>
-<li>Create several plots; amplitude vs. time, frequency spectra, complex plane, time vs. flag count, frequency vs. flag count, antenna vs. flag count, etc.</li>
-</ul>
-<a id="problems"><h4>Problems and solutions</h4></a>
-<ul>
-<li>If you have problems running the executables, and you get an error about loading libraries, a solution might be to explicitly define where the libraries are, i.e., type in:
-<pre>export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:&lt;path&#8209;to&#8209;source&#8209;root&gt;/libs/lib/</pre></li>
-<li>If you have any further problems, don't hesitate to contact me! I will be glad to help out. See the section "contact information".</li>
-</ul>
-<a id="contact"><h4>Contact information</h4></a>
-<p>In case of questions, suggestions or feedback, please mail me. My e-mail address is <tt>&lt;mylastname&gt;@astro.rug.nl</tt>, and my last name is offringa.</p>
-<a id="acknowledgments"><h4>Acknowledgments</h4></a>
-<p>Thanks to all who provided data to me for testing, in special Ger de Bruyn
-and Gianni Bernardi. Also thanks to Andy Biggs and Ger van Diepen for several fixes and hints.
-The RFI tools heavily use Casacore, thus their authors have been instrumental
-in creating the flagger.</p>
-</body>
-</html>
-
diff --git a/CEP/DP3/AOFlagger/doc/site/reading-mode.html b/CEP/DP3/AOFlagger/doc/site/reading-mode.html
deleted file mode 100644
index e68d3d222248acb5e440d4543d597785820967ac..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/doc/site/reading-mode.html
+++ /dev/null
@@ -1,29 +0,0 @@
-<html>
-<head><title>Offringa's RFI software</title>
-<link rel="stylesheet" type="text/css" href="style.css" />
-</head>
-<body>
-<a href="http://www.astro.rug.nl/~offringa/">Offringa</a>-&gt;<a href="index.html">RFI software</a>-&gt;Reading mode
-<h2>Reading mode</h2>
-<p>The AOFlagger used to read baselines by scanning a file for the data relevant for the currently required baseline. The mode is called the <em>direct baseline reader</em>. Since AOFlagger used to be limited by IO seeking and not by cpu performance, a new approach was implemented in which a measurement set is written to a temporary location in a different order: the <em>indirect baseline reader</em>. The increase in speed on large sets is on the order of several factors, typically around 3 or 4 times.</p>
-<p>Because this approach uses a very large amount of disk space, it is not the default. In most cases however, people will run it on the lce nodes and there should be enough disk space on them to use this approach. One can then run rficonsole using the indirect baseline reader with the "-indirect-read" parameter, and the measurement set will be rewritten. The syntax will be similar to:</p>
-<p><code>offringa@lce032:/data/scratch/offringa/temp$ rficonsole -indirect-read -j 8 SB4.MS</code></p>
-<p>Please note that the current working directory will be used as a temporary storage location! Thus by running rficonsole like above, temporary files will be created in /data/scratch/offringa/temp that will take up the amount of space equal to the size of the sub-band (i.e. measurement set). So, for LOFAR, do not run this in your home directory but always on the local hd's of the nodes.</p>
-<p>The output of rficonsole near the beginning will now be:</p>
-<p><code>[..]<br/>
-Initializing ms cache data...<br/>
-Unique time stamps: 379<br/>
-Bands: 1<br/>
-Number of parts: 1<br/>
-0% : +-+-+-Strategy...<br/>
-0% : +-+-+-+-strategy...<br/>
-0% : +-+-+-+-+-For each baseline...<br/>
-Estimate of memory each thread will use: 11 MB.<br/>
-0% : +-+-+-+-+-+-Initializing...<br/>
-Requesting 9 x 105 x 1109 x 4 x 256 bytes of data<br/>
-RW<br/></code></p>
-<p>...and will keep reporting R's and W's as long as it is rewriting the set. Each R and W means 1 GB of data has been respectively read or written. Rewriting 40 GB MS's takes in the order of 10 to 20 minutes.</p>
-<p>In the case the AOFlagger might crash, please be sure to remove the temporary files (and send me a bug report if it is a bug ;-) ).</p>
-</body>
-</html>
-
diff --git a/CEP/DP3/AOFlagger/doc/site/strategy-example-a.html b/CEP/DP3/AOFlagger/doc/site/strategy-example-a.html
deleted file mode 100644
index d5975ebbcb52d9604c700704c064893e77333381..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/doc/site/strategy-example-a.html
+++ /dev/null
@@ -1,275 +0,0 @@
-<html>
-<head><title>Offringa's RFI software</title>
-<link rel="stylesheet" type="text/css" href="style.css" />
-</head>
-<body>
-<p><a href="http://www.astro.rug.nl/~offringa/">Offringa</a>-&gt;<a href="index.html">RFI software</a>-&gt;Strategy example A</p>
-<h2>A strategy example: daylight WSRT observation with strong solar fringes</h2>
-<p>Author: Andr&eacute; Offringa, 2011-01-28</p>
-<p>
-In this example I will try to demonstrate tweaking of some of the parameters
-of the default strategy when by itself it does not work
-well enough. I will try to flag an WSRT observation
-of B1834 with 10 second integration and 512 channels of 5 kHz each.
-Below is baseline RT0 x RT1, a 144m baseline.</p>
-<img src="img/rfi-example-A0.png" />
-<p>Notice the very strong fringes. I will use this baseline
-to experiment on, since it is a good case of RFI, plus the
-fringes go from very fast (at the start) to rather slow, so
-if the flagger can handle this baseline correctly, others should not
-be a problem either.</p>
-<p>The strong fringes are due to the sun (the whitish
-area before 18:50 after which it evidently sets), and Cas A and Cyg A.
-Since the default strategy is LOFAR optimised,
-the default flagger does a very bad job by flagging 33% of the data:</p>
-<img src="img/rfi-example-A1.png">
-<p>While obviously the sun can be seen as an interfering source, I don't want
-to flag it, but rather try to subtract it at a later time.
-For this, I will assume you are familair with the RFI GUI
-(see the <a href="gui-tutorial.html">GUI tutorial</a>).</p>
-<p>Since I want to restart flagging, the first thing I do is remove the
-"Or flags with original" action, since otherwise my strategy output will
-include the flags of the previous run. If you rerun the strategy, nothing
-will be changed yet.</p>
-<p>Now, I would like to see what happened to the background fit, to get a
-feeling of why it did not work correctly. To see this, I enable the
-"Restore from amplitude" button in the "On amplitude" action. This option
-only affect how the GUI interprets the results: rerunning the strategy again
-will not change anything. However, the Revised background image is now loaded
-in the GUI. You can see this by clicking the "Background" toolbar button:
-</p>
-<img src="img/rfi-example-A2.png" />
-<p>Similarly, the "Difference" button will now show the difference between the
-original and the fitted background:</p>
-<img src="img/rfi-example-A3.png" />
-<p>One word of caution; when you will now rerun the strategy, it will start
-with the already fitted background, i.e., the input of the algorithm is
-the differential image, not the original image. Therefore, you'll have to
-"reset" your baseline after each run, by reloading it. Alternatively, you
-can add a "Set contaminated = original" action as the first action in the
-strategy, which will make sure the contaminated (=diff) image is reset
-automatically.</p>
-<p>You can already see that the background fit did actually remove a lot
-of the fringes. There are two visible problems
-at this point with the flagging: the
-fringes have not been removed completely and the pass-band is too steep.
-Remember that you are looking at Stokes I, and that an individual
-(cross) polarization might be the actual cause for a certain flag.
-</p><p>A common problem is that not enough iterations have been performed,
-causing the threshold to drop quickly in each iteration. This might cause
-instabilities. To make sure this is not a problem, I enlarge the number
-of iterations to "5" and the sensitivity start number of the 
-Iterate block to "8". The sensitivity of 8 will make sure that the first
-iteration is performed very conservately, and the extra iterations make
-sure that we are not leaving out data that has incorrectly been flagged in a
-previous run. In all, this will take more time to flag, but at least makes
-sure that problems are not due to stability issues. The result is a
-slightly smoother background and some improvement in fitting the pass-band, but
-the fringes are still flagged:</p>
-<img src="img/rfi-example-A4.png" />
-<p>The SumThreshold can be described as an algorithm that tries to find
-horizontal
-and vertical lines in the image. The fast fringes cause vertical artefacts
-in the differential image, hence the SumThreshold method will flag them.
-Several approaches can be taken now:</p>
-<ul>
-<li>The kernel of the background fit can be made smaller.</li>
-<li>The sensitivity for broadband-like RFI can be lowered.</li>
-<li>The total sensitivity of the SumThreshold method can be lowered.</li>
-</ul>
-<p>I will show the result of each. Obviously, the best solution can sometimes
-be a combination of these options.</p>
-<h3>Changing the kernel size of the background fit</h3>
-<p>The "kernel size" is a constraint on the
-smoothness of the fit. This can be controlled independently for both the time
-direction and frequency (resp. horizontal/vertical) direction.</p>
-<p>Two actions play a role in the size of kernel width of the background.
-The first one is the "Change resolution size" and the second one is the
-"Sliding window fit" action. The "change resolution" action is an action
-to increase the speed of the flagger. It increases the effect of the sliding
-window fit action without much loss of precision. The default strategy
-currently has the following parameters:</p>
-<ul>
-<li>Change resolution / Time decrease factor: 3</li>
-<li>Change resolution / Freq decrease factor: 3</li>
-<li>Sliding window fit / Time window size: 10</li>
-<li>Sliding window fit / Freq window size: 15</li>
-<li>Sliding window fit / Time kernel size: 2.5</li>
-<li>Sliding window fit / Freq kernel size: 5.0</li>
-</ul>
-<p>In our image, the time direction varies more rapidly than the
-frequency direction. Therefore, I lower the kernel size in time direction,
-by changing "Change resolution / Time decrease factor" to "1".</p>
-<p>The result is already a major improvement: (showing the differential image, 12.4% flagged)
-</p>
-<img src="img/rfi-example-A5.png" />
-<p>The steep pass-band also still causes a problem in the bottom left of
-the image. However, even when I decrease the
-"Change resolution / Freq decrease factor" to "1", the flags in the bottom
-have not been corrected. The sensible thing to do now would be to
-divide the image by the (approximate) band-pass, as this is normally well
-known. However, for the sake of the exercise, I continue tweaking.
-Even when I decrease the kernel size to "1", the problems do not
-disappear. I could now disable fitting in frequency direction completely
-by setting the frequency window size (on contrast to kernel size) to "1",
-but this would make it much harder to find RFI, as frequencies
-will no longer be compared. </p>
-<p>The root cause of this problem is the "Frequency selection" action. This
-action flags outlying frequencies based on their RMS, disallowing the
-sliding window fit to use that information. It is meant to allow
-faster convergence of the algorithm, but since we already slowed down
-the sensitivity convergence, we can safely remove it. This is the result
-of removing the Frequency selection action, and leaving the 
-"Change resolution / Freq decrease factor" to "3" and leaving the vertical
-sliding window fit parameters to their original value: (9.5% of the data is
-flagged)</p>
-<img src="img/rfi-example-A6.png" />
-<p>The issue with the pass-band has disappeared. This is in most cases
-an acceptable result, but not perfect.</p>
-<h3>Looking for lines in frequency direction</h3>
-<p>Another approach is to modify the threshold settings, to avoid flagging
-high values in frequency direction. In a normal situations, broadband RFI
-such as lightning or electrical fences can produce these. However,
-besides the "fringe"
-problem that is faced here, there might be other reasons not to flag in 
-frequency direction, for example because one is searching for transients.
-This would make us slightly more vulnerable to leaked broad-band RFI, a
-trade off that should be considered.</p>
-<p>We go back to our default strategy with 5 iterations.
-Two actions influence broadband flagging, that is, flagging of vertical
-lines in the image. The first action is the SumThreshold, which does the
-"per pixel" (yet combinatorial) tresholding. The SumThreshold has an option
-named "In frequency direction". By deselecting this option in both SumThreshold
-methods (note there are two SumThreshold actions which need to be changed
-both!), the result drastically improves: (13% was flagged)</p>
-<img src="img/rfi-example-A7.png" />
-<p>Intuitively, this improvement is not so strange; even by eye,
-broad-band RFI is almost
-impossible to distinguish in this set, unless it is very strong.</p>
-<p>At this
-point, we have to be careful. Note that this observation lasted twelve hours,
-and since we have a 10 second integration, this image represents over 4000
-samples. Looking at the full image on a screen is not a good way of
-differentiating broadband RFI from false positives due to fringes. For example,
-when we zoom in (press "Zoom" in the "View" menu) on the first
-two hours of the observation, we see this: (flags have been turned off)</p>
-<img src="img/rfi-example-A8.png" />
-<p>This contains broad-band RFI, which was impossible to see in the full image.
-For those that are curious about its origin: that often remains a mystery
-to me.
-Sometimes, lightning causes such effects, but a starting car or even a camera
-near the antenna might similarly cause these effects -- but the latter are
-unlikely considering their length. The signal is not
-dispersed,
-so it is unlikely to be a celestial transient. Meteors often only reflect
-terrestrial RFI, which is not broadband. The sun
-might cause such artefacts, though these lines are also present at the
-end of the observation when
-the sun is down. In short; we want to flag these lines, because they will
-decrease the SNR. Fortunately, even without frequency direction
-SumThresholding, these lines are all flagged:</p>
-<img src="img/rfi-example-A9.png" />
-<p>The broad-band RFI has been flagged by the two
-"Time selection" actions. These actions flag time steps that have an RMS
-which differs significantly from its neighbours. If I would remove both
-Time selection actions, this is the result:</p>
-<img src="img/rfi-example-A10.png" />
-<p>My conclusion would be that the Time selection action was actually doing
-a good thing. It lowers the ratio of flags from about 13% to
-12.3%, but a large part of this 0.7% is actual unwanted interference.
-The conclusion on the frequency direction flagging would be that the 
-RMS check should remain, but that SumThresholding in frequency direction
-is doing not much good in this set.</p>
-<h3>Sensitivity</h3>
-<p>Once again I go back to my original strategy with 5 iterations. A last
-parameter which is often good for solving issues, is the sensitivity of the
-SumThreshold action. I can fix my original very bad result at once by
-changing the base threshold of both SumThreshold actions to "2" instead
-of its default "1". The result is a good result with 8.5% flags:</p>
-<img src="img/rfi-example-A11.png" />
-<p>Note that this both solves most of the flagging problems of sun's fringes
-and also solves the bandpass problem. However, also note that the frequency
-changing interfering source has a bit more gaps, especially near 17.30 hours
-at 138.3 MHz.
-While this flagging would be good enough for further reduction, I would prefer
-the previous changes and put the sensitivity somewhere in the middle
-(by tweaking the end result).</p>
-<h3>Summary of modifications</h3>
-<p>I have tried to isolate the effect of each important parameter in this
-example. Taking all these changes together will enhance the result further.
-The summary of changes and conclusions was:</p>
-<ul>
-<li>To make sure that stability issues are not caused by too few iteration,
-I changed the Iteration action to iterate 5 times starting at threshold
-factor 8, instead of iterating 2 times starting at threshold factor 4
-(see notes below about performance).</li>
-<li>Smoothing in time direction was too strong. A good fit in time direction
-was achieved by setting the "Change resolution size" to "1".</li>
-<li>The bandpass problem could be fixed by removing the "Frequency selection"
-action (but removing the bandpass prior to flagging would be better!).</li>
-<li>Turning the SumThresholding in the frequency direction off improved
-the strategy. Moreover, (even after zooming in) I could not detect
-false negatives introduced by this action.</li>
-<li>Turning the Time selection off did not significantly lower the false
-positives, while some true RFI was left. The time selection action was kept.</li>
-<li>Decreasing the sensitivity by increasing the base threshold made the system
-more robused, but also introduced a few false negatives. Therefore, I would
-suggest a slightly decreased sensitivity, to make sure the strategy never
-starts "eating" whole parts of the data (after all,
-this is only one baseline, other
-baselines might be different). I set the base threshold from its default of
-1.0 to a slightly less sensitive 1.2. This decreased the number of flags from 9.6% to 8.4%.</li>
-</ul>
-<p>This is the end result:</p>
-<img src="img/rfi-example-A12.png" />
-<p>The fitted background looks like this:</p>
-<img src="img/rfi-example-A13.png" />
-<p>Which is a very fair representation of the signal, as can also be seen
-from the difference:</p>
-<img src="img/rfi-example-A14.png" />
-<p>This image contains almost no artifacts from the signal, except for
-a noise increase when the sun is up and during fringes.</p>
-<p>A remaining question is how well it works on other baselines. When checking
-the other baselines, the parameters work very well on all of them. Consider
-RT0 x RT6, which shows other signs of RFI:</p>
-<img src="img/rfi-example-A15.png" />
-<p>The 10.1% flags produced by the optimized strategy:</p>
-<img src="img/rfi-example-A16.png" />
-<h3>Execution on all baselines</h3>
-<p>This strategy is ready for execution on all 91 WSRT baselines. This
-can be done by (A) pressing the "FOB" button in the strategy window to
-encapsulate the strategy in a "For each baseline" action, (B) add a "Write
-flags" task as last action inside the "For each baseline" action to actually
-write the flags, (C) export the strategy by pressing "Save" and entering a
-name and (D) running rficonsole with the saved strategy.</p>
-<h3>Performance considerations</h3>
-<p>Finally, I would like to note that I increased the number of iterations to
-"5" because I wanted to be sure that the background fit would be stable. In
-practice, this is not necessary once all parameters are fixed. If you want
-to make sure your strategy is also as fast as possible, the number of
-iterations can be lowered. In this example, changing the number of iterations
-back to "2" and the start sensitivity to "4" does not significantly change
-the flags, but is 2x faster.</p>
-<p>The "change resolution" action also has a lot of effect on the performance.
-Once all parameter optimizations were applied, changing the resolution change
-action back did not severely change the accuracy, so if performance would
-be an issue, I would revert the change resolution optimization.</p>
-<p>Wall-clock time performance on my desktop machine of flagging a 
-single baseline:</p>
-<ul>
-<li>5 iterations: 50 seconds, 8.4% flagged</li>
-<li>5 iterations, decreased resolution:
-42 seconds, 8.5% flagged</li> 
-<li>2 iterations: 26 seconds, 8.4% flagged</li>
-<li>2 iterations, decreased resolution:
-22 seconds, 8.3% flagged</li>
-</ul>
-<p>In all cases, no visible change in accuracy is visible. Note that when
-flagging multiple baselines, strategies can be executed multithreaded, so
-by using a multi core machine, the total time can be considerably lowered.
-Flagging this set on an 8 core machine toke in the order of a few minutes.</p>
-<h3>Acknowledgement</h3>
-<p>I would like to thank Ger de Bruyn for providing the data
-that has been used in this example.</p>
-</body>
-</html>
diff --git a/CEP/DP3/AOFlagger/doc/site/style.css b/CEP/DP3/AOFlagger/doc/site/style.css
deleted file mode 100644
index a719646b65ffff4ebbf4d3df5356296ea736cfb1..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/doc/site/style.css
+++ /dev/null
@@ -1,29 +0,0 @@
-/** Copyright Andre Offringa, 2012 */
-
-h1 {color:#004040;}
-h1.author {font-size: 12pt; }
-h2 {color:#008080;}
-h3 {color:#0080C0;}
-h4 {color:#0080C0;}
-h5 {color:#008080;}
-a {text-decoration: none;}
-a {color:#0000FF;}
-a.article {color:#0000FF;}
-a:hover { background-color:#C0E0FF; }
-table { border-collapse:collapse; }
-table,th, td { border: 1px solid #0080C0; padding:3px 7px 2px 7px; }
-tr.uneven { background-color:#C0E0FF; }
-tr.even { background-color: white; }
-th { background-color:#00C0FF; color: white; }
-hr { border: 1px solid #0080C0; }
-span.journal { font-style: italic; color:#800000; }
-span.article { color:#0040C0; }
-li { padding-bottom: 10px; }
-h4:before { content: "\00a0\00a0\00a0\00a0\00a0\00a0"; 
-     border-top: solid 2px #0080C0;  
-     position:relative;
-     top:12px; margin-right: 4px;}
-h5:after { content: "\00a0\00a0\00a0\00a0\00a0\00a0"; 
-     border-top: solid 2px #008080;  
-     position:relative;
-     top:12px; margin-left: 4px;}
\ No newline at end of file
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/CMakeLists.txt b/CEP/DP3/AOFlagger/include/AOFlagger/CMakeLists.txt
deleted file mode 100644
index d1486bd9275cebeecc780483cbab631d3f4d9797..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/CMakeLists.txt
+++ /dev/null
@@ -1,182 +0,0 @@
-# $Id$
-
-# Create symbolic link to include directory.
-execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
-  ${CMAKE_CURRENT_SOURCE_DIR}
-  ${CMAKE_BINARY_DIR}/include/${PACKAGE_NAME})
-
-install(FILES
-  baseexception.h
-  blaswrap.h
-  cleaner.h
-  configuration.h
-  f2c.h
-  types.h
-  vectortypes.h
-  DESTINATION include/${PACKAGE_NAME})
-
-install(FILES
-  gui/application.h
-  gui/complexplaneplotwindow.h
-  gui/editstrategywindow.h
-  gui/gotowindow.h
-  gui/highlightwindow.h
-  gui/imagewidget.h
-  gui/imageplanewindow.h
-  gui/imagepropertieswindow.h
-  gui/msoptionwindow.h
-  gui/mswindow.h
-  gui/plotframe.h
-  gui/progresswindow.h
-  gui/rawoptionwindow.h
-  DESTINATION include/${PACKAGE_NAME}/gui)
-
-install(FILES
-  gui/plot/dimension.h
-  gui/plot/horizontalplotscale.h
-  gui/plot/plot2d.h
-  gui/plot/plot2dpointset.h
-  gui/plot/plotable.h
-  gui/plot/plotwidget.h
-  gui/plot/system.h
-  gui/plot/tickset.h
-  gui/plot/verticalplotscale.h
-  DESTINATION include/${PACKAGE_NAME}/gui/plot)
-
-install(FILES
-  gui/strategyframes/baselineselectionframe.h
-  gui/strategyframes/changeresolutionframe.h
-  gui/strategyframes/cutareaframe.h
-  gui/strategyframes/foreachbaselineframe.h
-  gui/strategyframes/foreachmsframe.h
-  gui/strategyframes/foreachpolarisationframe.h
-  gui/strategyframes/fringestoppingframe.h
-  gui/strategyframes/iterationframe.h
-  gui/strategyframes/plotframe.h
-  gui/strategyframes/setflaggingframe.h
-  gui/strategyframes/setimageframe.h
-  gui/strategyframes/slidingwindowfitframe.h
-  gui/strategyframes/spatialcompositionframe.h
-  gui/strategyframes/statisticalflaggingframe.h
-  gui/strategyframes/svdframe.h
-  gui/strategyframes/timeconvolutionframe.h
-  gui/strategyframes/timeselectionframe.h
-  gui/strategyframes/uvprojectframe.h
-  DESTINATION include/${PACKAGE_NAME}/gui/strategyframes)
-
-install(FILES
-  imaging/fourproductcorrelatortester.h
-  imaging/model.h
-  imaging/observatorium.h
-  imaging/uvimager.h
-  DESTINATION include/${PACKAGE_NAME}/imaging)
-
-install(FILES
-  msio/antennainfo.h
-  msio/arraycolumniterator.h
-  msio/baselinereader.h
-  msio/baselinematrixloader.h
-  msio/colormap.h
-  msio/date.h
-  msio/directbaselinereader.h
-  msio/fitsfile.h
-  msio/image2d.h
-  msio/indirectbaselinereader.h
-  msio/mask2d.h
-  msio/measurementset.h
-  msio/pngfile.h
-  msio/rspreader.h
-  msio/samplerow.h
-  msio/scalarcolumniterator.h
-  msio/segmentedimage.h
-  msio/spatialmatrixmetadata.h
-  msio/stokesimager.h
-  msio/timefrequencydata.h
-  msio/timefrequencyimager.h
-  msio/timefrequencymetadata.h
-  msio/types.h
-  DESTINATION include/${PACKAGE_NAME}/msio)
-
-install(FILES
-  strategy/actions/action.h
-  strategy/actions/adapter.h
-  strategy/actions/changeresolutionaction.h
-  strategy/actions/combineflagresultsaction.h
-  strategy/actions/directionalcleanaction.h
-  strategy/actions/foreachbaselineaction.h
-  strategy/actions/foreachcomplexcomponentaction.h
-  strategy/actions/foreachmsaction.h
-  strategy/actions/foreachpolarisationaction.h
-  strategy/actions/fouriertransformaction.h
-  strategy/actions/frequencyconvolutionaction.h
-  strategy/actions/frequencyselectionaction.h
-  strategy/actions/fringestopaction.h
-  strategy/actions/imageraction.h
-  strategy/actions/iterationaction.h
-  strategy/actions/plotaction.h
-  strategy/actions/setflaggingaction.h
-  strategy/actions/setimageaction.h
-  strategy/actions/slidingwindowfitaction.h
-  strategy/actions/slidingwindowfitparameters.h
-  strategy/actions/statisticalflagaction.h
-  strategy/actions/strategyaction.h
-  strategy/actions/svdaction.h
-  strategy/actions/timeselectionaction.h
-  strategy/actions/uvprojectaction.h
-  strategy/actions/writedataaction.h
-  strategy/actions/writeflagsaction.h
-  DESTINATION include/${PACKAGE_NAME}/strategy/actions)
-
-install(FILES
-  strategy/algorithms/fringestoppingfitter.h
-  strategy/algorithms/fringetestcreater.h
-  strategy/algorithms/localfitmethod.h
-  strategy/algorithms/medianwindow.h
-  strategy/algorithms/methoditerator.h
-  strategy/algorithms/mitigationtester.h
-  strategy/algorithms/morphology.h
-  strategy/algorithms/rfistatistics.h
-  strategy/algorithms/sinusfitter.h
-  strategy/algorithms/statisticalflagger.h
-  strategy/algorithms/surfacefitmethod.h
-  strategy/algorithms/svdmitigater.h
-  strategy/algorithms/thresholdconfig.h
-  strategy/algorithms/thresholdmitigater.h
-  strategy/algorithms/thresholdtools.h
-  strategy/algorithms/timefrequencystatistics.h
-  strategy/algorithms/types.h
-  strategy/algorithms/uvprojection.h
-  DESTINATION include/${PACKAGE_NAME}/strategy/algorithms)
-
-install(FILES
-  strategy/plots/antennaflagcountplot.h
-  strategy/plots/frequencyflagcountplot.h
-  strategy/plots/frequencypowerplot.h
-  strategy/plots/rfiplots.h
-  strategy/plots/timeflagcountplot.h
-  DESTINATION include/${PACKAGE_NAME}/strategy/plots)
-
-install(FILES
-  strategy/control/actionblock.h
-  strategy/control/actioncontainer.h
-  strategy/control/actionfactory.h
-  strategy/control/artifactset.h
-  strategy/control/strategyiterator.h
-  strategy/control/strategyreader.h
-  strategy/control/strategywriter.h
-  strategy/control/types.h
-  DESTINATION include/${PACKAGE_NAME}/strategy/control)
-
-install(FILES
-  strategy/imagesets/fitsimageset.h
-  strategy/imagesets/imageset.h
-  strategy/imagesets/msimageset.h
-  strategy/imagesets/rspimageset.h
-  DESTINATION include/${PACKAGE_NAME}/strategy/imagesets)
-
-install(FILES
-	ref/copyallscript.h
-	ref/reffile.h
-	ref/reffileentry.h
-	ref/reffileexception.h
-  DESTINATION include/${PACKAGE_NAME}/ref)
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/baseexception.h b/CEP/DP3/AOFlagger/include/AOFlagger/baseexception.h
deleted file mode 100644
index 24cb29e8a56c193b39476dfc2be3a617ac872959..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/baseexception.h
+++ /dev/null
@@ -1,100 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2007 by Andre Offringa   *
- *   offringa@gmail.com   *
- *                                                                         *
- *   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.             *
- ***************************************************************************/
-/** @file
- * This is the header file for some of the exception classes and for the base exception class BaseException.
- * @author André Offringa <offringa@gmail.com>
- */
-#ifndef BASEEXCEPTION_H
-#define BASEEXCEPTION_H
-
-#include <exception>
-#include <string>
-
-/**
- * The base exception class that all exceptions should inherit from.
- */
-class BaseException : public std::exception {
-	public:
-		/**
-		 * Constructor that initialises the exception as if an unspecified error occured.
-		 */
-		BaseException() throw() : _description("Unspecified error") { }
-		
-		/**
-		 * Constructor that initialises the exception with a specified description.
-		 * @param description The description that should describe the cause of the exception.
-		 */
-		BaseException(const std::string &description) throw() : _description(description) { }
-		
-		/**
-		 * Destructor.
-		 */
-		virtual ~BaseException() throw() { }
-		
-		/**
-		 * Implementation of the std::exception::what() method that returns a description of the exception.
-		 * @return A description of the exception.
-		 */
-		virtual const char *what() const throw() { return _description.c_str(); }
-	private:
-		const std::string _description;
-};
-
-/**
- * Exception that is throwed in case of Input/Output exceptions.
- */
-class IOException : public BaseException {
-	public:
-		/**
-		 * Constructor that initialises the IOException without a description.
-		 */
-		IOException() throw() : BaseException() { }
-		
-		/**
-		 * Constructor that initialises the IOException with a description
-		 * @param description The description of the Input/Output exception
-		 */
-		IOException(const std::string &description) throw() : BaseException(description) { }
-};
-
-/**
- * Exception that is throwed in case of an incorrect configuration
- */
-class ConfigurationException : public BaseException {
-	public:
-		/**
-		 * Constructor that initialises the ConfigurationException with a description
-		 * @param description The description of the configuration error
-		 */
-		ConfigurationException(const std::string &description) throw() : BaseException(description) { }
-};
-
-/**
- * Exception that is throwed in case of an incorrect usage of a function
- */
-class BadUsageException : public BaseException {
-	public:
-		/**
-		 * Constructor that initialises the BadUsageException with a description
-		 * @param description The description of the incorrect usage
-		 */
-		BadUsageException(const std::string &description) throw() : BaseException(description) { }
-};
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/blaswrap.h b/CEP/DP3/AOFlagger/include/AOFlagger/blaswrap.h
deleted file mode 100644
index 333a17a0c3fd42eb2fb9aedd1bb990dc314e5772..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/blaswrap.h
+++ /dev/null
@@ -1,160 +0,0 @@
-/* CLAPACK 3.0 BLAS wrapper macros
- * Feb 5, 2000
- */
-
-#ifndef __BLASWRAP_H
-#define __BLASWRAP_H
-
-#ifndef NO_BLAS_WRAP
- 
-/* BLAS1 routines */
-#define srotg_ f2c_srotg
-#define drotg_ f2c_drotg
-#define srotmg_ f2c_srotmg
-#define drotmg_ f2c_drotmg
-#define srot_ f2c_srot
-#define drot_ f2c_drot
-#define srotm_ f2c_srotm
-#define drotm_ f2c_drotm
-#define csrot_ f2c_csrot
-#define zdrot_ f2c_zdrot
-#define sswap_ f2c_sswap
-#define dswap_ f2c_dswap
-#define cswap_ f2c_cswap
-#define zswap_ f2c_zswap
-#define sscal_ f2c_sscal
-#define dscal_ f2c_dscal
-#define cscal_ f2c_cscal
-#define zscal_ f2c_zscal
-#define csscal_ f2c_csscal
-#define zdscal_ f2c_zdscal
-#define scopy_ f2c_scopy
-#define dcopy_ f2c_dcopy
-#define ccopy_ f2c_ccopy
-#define zcopy_ f2c_zcopy
-#define saxpy_ f2c_saxpy
-#define daxpy_ f2c_daxpy
-#define caxpy_ f2c_caxpy
-#define zaxpy_ f2c_zaxpy
-#define sdot_ f2c_sdot
-#define ddot_ f2c_ddot
-#define cdotu_ f2c_cdotu
-#define zdotu_ f2c_zdotu
-#define cdotc_ f2c_cdotc
-#define zdotc_ f2c_zdotc
-#define snrm2_ f2c_snrm2
-#define dnrm2_ f2c_dnrm2
-#define scnrm2_ f2c_scnrm2
-#define dznrm2_ f2c_dznrm2
-#define sasum_ f2c_sasum
-#define dasum_ f2c_dasum
-#define scasum_ f2c_scasum
-#define dzasum_ f2c_dzasum
-#define isamax_ f2c_isamax
-#define idamax_ f2c_idamax
-#define icamax_ f2c_icamax
-#define izamax_ f2c_izamax
- 
-/* BLAS2 routines */
-#define sgemv_ f2c_sgemv
-#define dgemv_ f2c_dgemv
-#define cgemv_ f2c_cgemv
-#define zgemv_ f2c_zgemv
-#define sgbmv_ f2c_sgbmv
-#define dgbmv_ f2c_dgbmv
-#define cgbmv_ f2c_cgbmv
-#define zgbmv_ f2c_zgbmv
-#define chemv_ f2c_chemv
-#define zhemv_ f2c_zhemv
-#define chbmv_ f2c_chbmv
-#define zhbmv_ f2c_zhbmv
-#define chpmv_ f2c_chpmv
-#define zhpmv_ f2c_zhpmv
-#define ssymv_ f2c_ssymv
-#define dsymv_ f2c_dsymv
-#define ssbmv_ f2c_ssbmv
-#define dsbmv_ f2c_dsbmv
-#define sspmv_ f2c_sspmv
-#define dspmv_ f2c_dspmv
-#define strmv_ f2c_strmv
-#define dtrmv_ f2c_dtrmv
-#define ctrmv_ f2c_ctrmv
-#define ztrmv_ f2c_ztrmv
-#define stbmv_ f2c_stbmv
-#define dtbmv_ f2c_dtbmv
-#define ctbmv_ f2c_ctbmv
-#define ztbmv_ f2c_ztbmv
-#define stpmv_ f2c_stpmv
-#define dtpmv_ f2c_dtpmv
-#define ctpmv_ f2c_ctpmv
-#define ztpmv_ f2c_ztpmv
-#define strsv_ f2c_strsv
-#define dtrsv_ f2c_dtrsv
-#define ctrsv_ f2c_ctrsv
-#define ztrsv_ f2c_ztrsv
-#define stbsv_ f2c_stbsv
-#define dtbsv_ f2c_dtbsv
-#define ctbsv_ f2c_ctbsv
-#define ztbsv_ f2c_ztbsv
-#define stpsv_ f2c_stpsv
-#define dtpsv_ f2c_dtpsv
-#define ctpsv_ f2c_ctpsv
-#define ztpsv_ f2c_ztpsv
-#define sger_ f2c_sger
-#define dger_ f2c_dger
-#define cgeru_ f2c_cgeru
-#define zgeru_ f2c_zgeru
-#define cgerc_ f2c_cgerc
-#define zgerc_ f2c_zgerc
-#define cher_ f2c_cher
-#define zher_ f2c_zher
-#define chpr_ f2c_chpr
-#define zhpr_ f2c_zhpr
-#define cher2_ f2c_cher2
-#define zher2_ f2c_zher2
-#define chpr2_ f2c_chpr2
-#define zhpr2_ f2c_zhpr2
-#define ssyr_ f2c_ssyr
-#define dsyr_ f2c_dsyr
-#define sspr_ f2c_sspr
-#define dspr_ f2c_dspr
-#define ssyr2_ f2c_ssyr2
-#define dsyr2_ f2c_dsyr2
-#define sspr2_ f2c_sspr2
-#define dspr2_ f2c_dspr2
- 
-/* BLAS3 routines */
-#define sgemm_ f2c_sgemm
-#define dgemm_ f2c_dgemm
-#define cgemm_ f2c_cgemm
-#define zgemm_ f2c_zgemm
-#define ssymm_ f2c_ssymm
-#define dsymm_ f2c_dsymm
-#define csymm_ f2c_csymm
-#define zsymm_ f2c_zsymm
-#define chemm_ f2c_chemm
-#define zhemm_ f2c_zhemm
-#define ssyrk_ f2c_ssyrk
-#define dsyrk_ f2c_dsyrk
-#define csyrk_ f2c_csyrk
-#define zsyrk_ f2c_zsyrk
-#define cherk_ f2c_cherk
-#define zherk_ f2c_zherk
-#define ssyr2k_ f2c_ssyr2k
-#define dsyr2k_ f2c_dsyr2k
-#define csyr2k_ f2c_csyr2k
-#define zsyr2k_ f2c_zsyr2k
-#define cher2k_ f2c_cher2k
-#define zher2k_ f2c_zher2k
-#define strmm_ f2c_strmm
-#define dtrmm_ f2c_dtrmm
-#define ctrmm_ f2c_ctrmm
-#define ztrmm_ f2c_ztrmm
-#define strsm_ f2c_strsm
-#define dtrsm_ f2c_dtrsm
-#define ctrsm_ f2c_ctrsm
-#define ztrsm_ f2c_ztrsm
-
-#endif /* NO_BLAS_WRAP */
-
-#endif /* __BLASWRAP_H */
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/cleaner.h b/CEP/DP3/AOFlagger/include/AOFlagger/cleaner.h
deleted file mode 100644
index 19d8fe59bc56e14d1b954536e55b700100363a23..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/cleaner.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef CLEANER_H
-#define CLEANER_H
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class Cleaner{
-	public:
-		Cleaner();
-		~Cleaner();
-		void Init(const class Image2D &real, const Image2D &imaginary, const Image2D &weights, long double gain);
-		const Image2D &RealResidual() const throw() { return *_residualReal; }
-		const Image2D &ImaginaryResidual() const throw() { return *_residualImaginary; }
-		const Image2D &RealDeconvolved() const throw() { return *_deconvolvedReal; }
-		const Image2D &ImaginaryDeconvolved() const throw() { return *_deconvolvedImaginary; }
-		const Image2D &RealPSF() const throw() { return *_psfReal; }
-		const Image2D &ImaginaryPSF() const throw() { return *_psfImaginary; }
-		const Image2D &RealConvolvedResidual() const throw() { return *_convolvedReal; }
-		const Image2D &ImaginaryConvolvedResidual() const throw() { return *_convolvedImaginary; }
-		void Iteration();
-	private:
-		static void FindPeak(const Image2D &real, const Image2D &imaginary, unsigned &x, unsigned &y);
-		void Subtract(Image2D &original, const Image2D &rightHand, unsigned x, unsigned y, long double gain);
-		long double MaxAllowedGain(const Image2D &image, const Image2D &subtract, unsigned x, unsigned y);
-
-		const Image2D *_real, *_imaginary, *_weightsReal, *_weightsImaginary;
-		Image2D *_residualReal, *_residualImaginary, *_psfReal, *_psfImaginary;
-		Image2D *_deconvolvedReal, *_deconvolvedImaginary;
-		Image2D *_convolvedReal, *_convolvedImaginary; 
-		long double _gain, _psfPeak;
-		long double _psfSum;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/configuration.h b/CEP/DP3/AOFlagger/include/AOFlagger/configuration.h
deleted file mode 100644
index 4cacca65b681920a263dd0a7f98efb67357c26cf..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/configuration.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef CONFIGURATION_H
-#define CONFIGURATION_H
-
-#define HAS_LOFARSTMAN
-
-#endif // CONFIGURATION_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/f2c.h b/CEP/DP3/AOFlagger/include/AOFlagger/f2c.h
deleted file mode 100644
index 3f3096d47b7d51e6de99f6a6ddb921688cfc908a..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/f2c.h
+++ /dev/null
@@ -1,223 +0,0 @@
-/* f2c.h  --  Standard Fortran to C header file */
-
-/**  barf  [ba:rf]  2.  "He suggested using FORTRAN, and everybody barfed."
-
-	- From The Shogakukan DICTIONARY OF NEW ENGLISH (Second edition) */
-
-#ifndef F2C_INCLUDE
-#define F2C_INCLUDE
-
-typedef long int integer;
-typedef unsigned long int uinteger;
-typedef char *address;
-typedef short int shortint;
-typedef float real;
-typedef double doublereal;
-typedef struct { real r, i; } complex;
-typedef struct { doublereal r, i; } doublecomplex;
-typedef long int logical;
-typedef short int shortlogical;
-typedef char logical1;
-typedef char integer1;
-#ifdef INTEGER_STAR_8	/* Adjust for integer*8. */
-typedef long long longint;		/* system-dependent */
-typedef unsigned long long ulongint;	/* system-dependent */
-#define qbit_clear(a,b)	((a) & ~((ulongint)1 << (b)))
-#define qbit_set(a,b)	((a) |  ((ulongint)1 << (b)))
-#endif
-
-#define TRUE_ (1)
-#define FALSE_ (0)
-
-/* Extern is for use with -E */
-#ifndef Extern
-#define Extern extern
-#endif
-
-/* I/O stuff */
-
-#ifdef f2c_i2
-/* for -i2 */
-typedef short flag;
-typedef short ftnlen;
-typedef short ftnint;
-#else
-typedef long int flag;
-typedef long int ftnlen;
-typedef long int ftnint;
-#endif
-
-/*external read, write*/
-typedef struct
-{	flag cierr;
-	ftnint ciunit;
-	flag ciend;
-	char *cifmt;
-	ftnint cirec;
-} cilist;
-
-/*internal read, write*/
-typedef struct
-{	flag icierr;
-	char *iciunit;
-	flag iciend;
-	char *icifmt;
-	ftnint icirlen;
-	ftnint icirnum;
-} icilist;
-
-/*open*/
-typedef struct
-{	flag oerr;
-	ftnint ounit;
-	char *ofnm;
-	ftnlen ofnmlen;
-	char *osta;
-	char *oacc;
-	char *ofm;
-	ftnint orl;
-	char *oblnk;
-} olist;
-
-/*close*/
-typedef struct
-{	flag cerr;
-	ftnint cunit;
-	char *csta;
-} cllist;
-
-/*rewind, backspace, endfile*/
-typedef struct
-{	flag aerr;
-	ftnint aunit;
-} alist;
-
-/* inquire */
-typedef struct
-{	flag inerr;
-	ftnint inunit;
-	char *infile;
-	ftnlen infilen;
-	ftnint	*inex;	/*parameters in standard's order*/
-	ftnint	*inopen;
-	ftnint	*innum;
-	ftnint	*innamed;
-	char	*inname;
-	ftnlen	innamlen;
-	char	*inacc;
-	ftnlen	inacclen;
-	char	*inseq;
-	ftnlen	inseqlen;
-	char 	*indir;
-	ftnlen	indirlen;
-	char	*infmt;
-	ftnlen	infmtlen;
-	char	*inform;
-	ftnint	informlen;
-	char	*inunf;
-	ftnlen	inunflen;
-	ftnint	*inrecl;
-	ftnint	*innrec;
-	char	*inblank;
-	ftnlen	inblanklen;
-} inlist;
-
-#define VOID void
-
-union Multitype {	/* for multiple entry points */
-	integer1 g;
-	shortint h;
-	integer i;
-	/* longint j; */
-	real r;
-	doublereal d;
-	complex c;
-	doublecomplex z;
-	};
-
-typedef union Multitype Multitype;
-
-/*typedef long int Long;*/	/* No longer used; formerly in Namelist */
-
-struct Vardesc {	/* for Namelist */
-	char *name;
-	char *addr;
-	ftnlen *dims;
-	int  type;
-	};
-typedef struct Vardesc Vardesc;
-
-struct Namelist {
-	char *name;
-	Vardesc **vars;
-	int nvars;
-	};
-typedef struct Namelist Namelist;
-
-//#define abs(x) ((x) >= 0 ? (x) : -(x))
-//#define dabs(x) (doublereal)abs(x)
-//#define min(a,b) ((a) <= (b) ? (a) : (b))
-//#define max(a,b) ((a) >= (b) ? (a) : (b))
-//#define dmin(a,b) (doublereal)min(a,b)
-//#define dmax(a,b) (doublereal)max(a,b)
-//#define bit_test(a,b)	((a) >> (b) & 1)
-//#define bit_clear(a,b)	((a) & ~((uinteger)1 << (b)))
-//#define bit_set(a,b)	((a) |  ((uinteger)1 << (b)))
-
-/* procedure parameter types for -A and -C++ */
-
-#define F2C_proc_par_types 1
-#ifdef __cplusplus
-typedef int /* Unknown procedure type */ (*U_fp)(...);
-typedef shortint (*J_fp)(...);
-typedef integer (*I_fp)(...);
-typedef real (*R_fp)(...);
-typedef doublereal (*D_fp)(...), (*E_fp)(...);
-typedef /* Complex */ VOID (*C_fp)(...);
-typedef /* Double Complex */ VOID (*Z_fp)(...);
-typedef logical (*L_fp)(...);
-typedef shortlogical (*K_fp)(...);
-typedef /* Character */ VOID (*H_fp)(...);
-typedef /* Subroutine */ int (*S_fp)(...);
-#else
-typedef int /* Unknown procedure type */ (*U_fp)();
-typedef shortint (*J_fp)();
-typedef integer (*I_fp)();
-typedef real (*R_fp)();
-typedef doublereal (*D_fp)(), (*E_fp)();
-typedef /* Complex */ VOID (*C_fp)();
-typedef /* Double Complex */ VOID (*Z_fp)();
-typedef logical (*L_fp)();
-typedef shortlogical (*K_fp)();
-typedef /* Character */ VOID (*H_fp)();
-typedef /* Subroutine */ int (*S_fp)();
-#endif
-/* E_fp is for real functions when -R is not specified */
-typedef VOID C_f;	/* complex function */
-typedef VOID H_f;	/* character function */
-typedef VOID Z_f;	/* double complex function */
-typedef doublereal E_f;	/* real function with -R not specified */
-
-/* undef any lower-case symbols that your C compiler predefines, e.g.: */
-
-#ifndef Skip_f2c_Undefs
-#undef cray
-#undef gcos
-#undef mc68010
-#undef mc68020
-#undef mips
-#undef pdp11
-#undef sgi
-#undef sparc
-#undef sun
-#undef sun2
-#undef sun3
-#undef sun4
-#undef u370
-#undef u3b
-#undef u3b2
-#undef u3b5
-#undef unix
-#undef vax
-#endif
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/addstrategyactionmenu.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/addstrategyactionmenu.h
deleted file mode 100644
index 45d3a8f342e22a2575f0ba835c7b89fe50ed8043..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/addstrategyactionmenu.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef ADDSTRATEGYACTIONMENU_H
-#define ADDSTRATEGYACTIONMENU_H
-
-#include <gtkmm/menu.h>
-
-#include <AOFlagger/strategy/control/actionfactory.h>
-
-#include <AOFlagger/gui/editstrategywindow.h>
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class AddStrategyActionMenu : public Gtk::Menu {
-	public:
-		AddStrategyActionMenu(class EditStrategyWindow &editStrategyWindow) :
-		_editStrategyWindow(editStrategyWindow)
-		{
-			std::vector<std::string> actions = rfiStrategy::ActionFactory::GetActionList();
-
-			for(std::vector<std::string>::const_iterator i=actions.begin();i!=actions.end();++i)
-			{
-				Gtk::MenuItem *item = new Gtk::MenuItem(*i);
-				append(*item);
-				item->signal_activate().connect(sigc::bind<const std::string>(sigc::mem_fun(*this, &AddStrategyActionMenu::onActionSelected), *i));
-				item->show();
-
-				_items.push_back(item);
-			}
-		}
-		
-		~AddStrategyActionMenu()
-		{
-			for(std::vector<Gtk::MenuItem *>::const_iterator i=_items.begin();i!=_items.end();++i)
-				delete *i;
-		}
-		
-	private:
-		void onActionSelected(const std::string str)
-		{
-			_editStrategyWindow.AddAction(rfiStrategy::ActionFactory::CreateAction(str));
-		}
-
-		class EditStrategyWindow &_editStrategyWindow;
-		std::vector<Gtk::MenuItem *> _items;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/antennamap/antenna.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/antennamap/antenna.h
deleted file mode 100644
index 6af82fd534752c774b98eabc3322177697262ebc..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/antennamap/antenna.h
+++ /dev/null
@@ -1,108 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef ANTENNAMAP_ANTENNA_H
-#define ANTENNAMAP_ANTENNA_H
-
-#include <cmath>
-
-#include <gtkmm/drawingarea.h>
-
-#include <AOFlagger/msio/antennainfo.h>
-
-namespace antennaMap
-{
-	class AntennaMap;
-	
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class Antenna {
-	public:
-		Antenna(AntennaMap &map, AntennaInfo antennaInfo)
-		: _map(map), _info(antennaInfo), _value(0.0), _runningMaxValue(1.0), _lastFrameTime(0.0)
-		{
-		}
-		~Antenna()
-		{
-		}
-		bool Draw(Cairo::RefPtr<Cairo::Context> cairo, double offsetX, double offsetY, int layer, double timeInFrameSeconds);
-		
-		double GetXInUCS() const
-		{
-			return _info.position.y;
-		}
-		double GetYInUCS() const
-		{
-			return _info.position.z;
-		}
-		double Value() const
-		{
-			return _value;
-		}
-		void SetValue(double newValue, double timeInFrameSeconds)
-		{
-			runTo(timeInFrameSeconds);
-			if(newValue > 1.0)
-				newValue = 1.0;
-			_value = newValue;
-			if(newValue > _runningMaxValue)
-				_runningMaxValue = newValue;
-		}
-		static double GetMaxWidthInPixels()
-		{
-			return GetMaxCircleRadius()*2.0;
-		}
-		static double GetMaxHeightInPixels()
-		{
-			return GetMaxCircleRadius()*2.0;
-		}
-		static double GetMaxCircleRadius()
-		{
-			return 60.0;
-		}
-	private:
-		void runTo(double timeInFrameSeconds)
-		{
-			if(timeInFrameSeconds < _lastFrameTime)
-			{
-				_runningMaxValue = 0.0;
-			} else {
-				double decrease = (timeInFrameSeconds - _lastFrameTime) / 10.0;
-				if(_runningMaxValue > decrease)
-					_runningMaxValue -= decrease;
-				else
-					_runningMaxValue = 0.0;
-				if(_runningMaxValue < _value)
-					_runningMaxValue = _value;
-			}
-			_lastFrameTime = timeInFrameSeconds;
-		}
-		
-		AntennaMap &_map;
-		const AntennaInfo _info;
-		double _value;
-		double _runningMaxValue;
-		double _lastFrameTime;
-};
-
-}
-
-#endif
-
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/antennamap/antennamap.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/antennamap/antennamap.h
deleted file mode 100644
index baff7b0870adb3ca16721d946e5a7d717967b173..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/antennamap/antennamap.h
+++ /dev/null
@@ -1,138 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef ANTENNAMAP_ANTENNAMAP_H
-#define ANTENNAMAP_ANTENNAMAP_H
-
-#include <fstream>
-#include <iostream>
-
-#include <gtkmm/drawingarea.h>
-
-#include <AOFlagger/msio/image2d.h>
-#include <AOFlagger/msio/measurementset.h>
-
-#include <AOFlagger/gui/antennamap/antenna.h>
-
-namespace antennaMap
-{
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class AntennaMap {
-	public:
-		AntennaMap(MeasurementSet &set);
-		~AntennaMap();
-		void Draw(Cairo::RefPtr<Cairo::Context> cairo, int width, int height, double timeInFrameSeconds);
-		
-		double UCSToPixelX(double ucsX) const
-		{
-			return ucsX * _xUCSToPixelsFactor + _xUCSToPixelsOffset;
-		}
-		double UCSToPixelY(double ucsY) const
-		{
-			return ucsY * _yUCSToPixelsFactor + _yUCSToPixelsOffset;
-		}
-		void SetValues(Image2DCPtr correlationMatrix, double timeInFrameSeconds)
-		{
-			unsigned count = correlationMatrix->Height();
-			double values[count];
-			for(unsigned i=0;i<count;++i)
-				values[i] = 0.0;
-			
-			for(unsigned x=0;x<count;++x)
-			{
-				for(unsigned y=x+1;y<count;++y)
-				{
-					values[x] += correlationMatrix->Value(x, y);
-					values[y] += correlationMatrix->Value(x, y);
-				}
-			}
-			
-			num_t
-				max = fabsn(values[0]),
-				min = max;
-			for(unsigned i=0;i<count;++i)
-			{
-				const num_t aValue = fabsn(values[i]);
-				values[i] = aValue;
-				if(aValue > max)
-					max = aValue;
-				if(aValue < min)
-					min = aValue;
-			}
-				
-			if(min > sqrtn(max))
-				min = sqrtn(max);
-			double normalizationFactor = (max==min) ? 0.0 : (1.0/(max - min));
-			double lastFactorWeight = pow(0.5, timeInFrameSeconds - _lastFactorChangeTime);
-			normalizationFactor = normalizationFactor * (1.0 - lastFactorWeight) +
-				_lastFactor * lastFactorWeight;
-			double normalizationOffset = -min * normalizationFactor;
-			_lastFactor = normalizationFactor;
-			_lastFactorChangeTime = timeInFrameSeconds;
-				
-			for(unsigned i=0;i<count;++i)
-			{
-				values[i] = values[i] * normalizationFactor + normalizationOffset;
-				_antennas[i]->SetValue(values[i], timeInFrameSeconds);
-			}
-		}
-		void OpenStatFile(const std::string &statFilename);
-		void ReadStatFile(int timeSteps, double timeInFrameSeconds);
-		bool HasStatFile() const { return _statFile != 0; }
-		
-		void OpenAntennaFile(const std::string &antennaFile, double timeInFrameSeconds);
-		
-		void OpenSpectrumFile(const std::string &spectrumFile, double timeInFrameSeconds);
-	private:
-		void initMetrics();
-		void setValues(Image2DPtr correlationMatrix, Image2DCPtr weightMatrix, double timeInFrameSeconds)
-		{
-			for(unsigned y=0;y<correlationMatrix->Height();++y)
-			{
-				for(unsigned x=0;x<correlationMatrix->Width();++x)
-				{
-					if(weightMatrix->Value(x, y) != 0.0)
-						correlationMatrix->SetValue(x, y, correlationMatrix->Value(x, y) / weightMatrix->Value(x, y));
-					else
-						correlationMatrix->SetValue(x, y, 0.0);
-				}
-			}
-			SetValues(correlationMatrix, timeInFrameSeconds);
-		}
-		
-		int
-			_widthInPixels, _heightInPixels;
-		double
-			_xUCSToPixelsFactor, _yUCSToPixelsFactor,
-			_xUCSToPixelsOffset, _yUCSToPixelsOffset;
-
-		std::vector<Antenna*> _antennas;
-		class Clock *_clock;
-		class SpectrumAnalyzer *_analyzer;
-		std::ifstream *_statFile;
-		double _lastFactor;
-		double _lastFactorChangeTime;
-};
-
-}
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/antennamap/antennamapwidget.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/antennamap/antennamapwidget.h
deleted file mode 100644
index 5a4615d0dbba9cdc883cb5a3a09f96330f72b03a..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/antennamap/antennamapwidget.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef ANTENNAMAP_ANTENNAMAPWIDGET_H
-#define ANTENNAMAP_ANTENNAMAPWIDGET_H
-
-#include <gtkmm/drawingarea.h>
-
-#include <AOFlagger/util/stopwatch.h>
-
-#include <AOFlagger/gui/antennamap/antennamap.h>
-
-namespace antennaMap
-{
-	
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class AntennaMapWidget : public Gtk::DrawingArea {
-	public:
-		AntennaMapWidget() : _map(0), _watch(true)
-		{
-			signal_expose_event().connect(sigc::mem_fun(*this, &AntennaMapWidget::onExposeEvent) );
-		}
-		
-		~AntennaMapWidget()
-		{
-			if(_map != 0)
-				delete _map;
-		}
-		
-		void SetMeasurementSet(MeasurementSet &set)
-		{
-			if(_map != 0)
-				delete _map;
-			_map = new AntennaMap(set);
-			_watch.Reset();
-			_watch.Start();
-		}
-		
-		void SetValuesFromAntennaFile(const std::string &antennaFile)
-		{
-			_map->OpenAntennaFile(antennaFile, _watch.Seconds());
-		}
-		
-		void SetValuesFromSpectrumFile(const std::string &spectrumFile)
-		{
-			_map->OpenSpectrumFile(spectrumFile, _watch.Seconds());
-		}
-		
-		void SetMovieTimeStepsPerFrame(const double stepsPerFrame)
-		{
-			_movieTimeStepsPerFrame = stepsPerFrame;
-		}
-
-		void Update()
-		{
-			redraw();
-		}
-		
-		AntennaMap &Map()
-		{
-			return *_map;
-		}
-	private:
-		bool onExposeEvent(GdkEventExpose *)
-		{
-			redraw();
-			return true;
-		}
-
-		void redraw()
-		{
-			if(_map != 0)
-			{
-				Cairo::RefPtr<Cairo::Context> cr = get_window()->create_cairo_context();
-				Gtk::Allocation allocation = get_allocation();
-				int width = allocation.get_width();
-				int height = allocation.get_height();
-				if(_map->HasStatFile())
-					_map->ReadStatFile(_movieTimeStepsPerFrame, _watch.Seconds());
-				_map->Draw(cr, width, height, _watch.Seconds());
-			}
-		}
-		
-		AntennaMap *_map;
-		Stopwatch _watch;
-		double _movieTimeStepsPerFrame;
-};
-
-}
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/antennamap/clock.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/antennamap/clock.h
deleted file mode 100644
index 19086621a85096e46bdb01006d53cbcb770856ed..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/antennamap/clock.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef ANTENNAMAP_CLOCK_H
-#define ANTENNAMAP_CLOCK_H
-
-#include <gtkmm/drawingarea.h>
-
-#include <cmath>
-
-namespace antennaMap
-{
-	
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class Clock {
-	public:
-		Clock() : _time(0.0)
-		{
-		}
-		
-		~Clock()
-		{
-		}
-		
-		void SetTime(double time)
-		{
-			_time = time;
-		}
-		
-		unsigned Width() const
-		{
-			return 60;
-		}
-		
-		void Draw(Cairo::RefPtr<Cairo::Context> cairo, double offsetX, double offsetY)
-		{
-			cairo->set_line_width(2.0);
-			
-			double
-				radius = 30.0,
-				centerX = offsetX + radius + 10.0,
-				centerY = offsetY + radius + 10.0;
-			
-			// The outer circle
-			cairo->arc(centerX, centerY, radius, 0.0, 2.0*M_PI);
-			cairo->set_source_rgba(0.7, 0.7, 1.0, 1.0);
-			cairo->fill_preserve();
-			cairo->set_source_rgba(0.0, 0.0, 0.0, 1.0);
-			cairo->stroke();
-			
-			// The minute hand
-			double minute = fmod(_time, 60.0*60.0) / (60.0*60.0);
-			double minuteAngle = minute * M_PI * 2.0;
-			cairo->move_to(centerX, centerY);
-			cairo->line_to(centerX + sin(minuteAngle) * radius * 0.8, centerY - cos(minuteAngle) * radius * 0.8);
-			
-			// The hour hand
-			double hour = fmod(_time, 60.0*60.0*12.0) / (60.0*60.0*12.0);
-			double hourAngle = hour * M_PI * 2.0;
-			cairo->move_to(centerX, centerY);
-			cairo->line_to(centerX + sin(hourAngle) * radius * 0.5, centerY - cos(hourAngle) * radius * 0.5);
-			
-			cairo->stroke();
-		}
-		
-	private:
-		double _time;
-};
-
-}
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/antennamap/spectrumanalyzer.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/antennamap/spectrumanalyzer.h
deleted file mode 100644
index e2db554aef703d523d55d5eabe1360e93283442d..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/antennamap/spectrumanalyzer.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef ANTENNAMAP_SPECTRUMANALYZER_H
-#define ANTENNAMAP_SPECTRUMANALYZER_H
-
-#include <gtkmm/drawingarea.h>
-
-#include <cmath>
-
-#include <AOFlagger/gui/antennamap/spectrumanalyzerchannel.h>
-
-namespace antennaMap
-{
-	
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class SpectrumAnalyzer {
-	public:
-		SpectrumAnalyzer(unsigned channelCount)
-		{
-			for(unsigned i=0;i<channelCount;++i)
-				_channels.push_back(new SpectrumAnalyzerChannel());
-		}
-		
-		~SpectrumAnalyzer()
-		{
-			for(std::vector<SpectrumAnalyzerChannel*>::iterator i=_channels.begin();i!=_channels.end();++i)
-				delete *i;
-		}
-		
-		void SetValue(unsigned index, double value, double timeInFrameSeconds)
-		{
-			_channels[index]->SetValue(value, timeInFrameSeconds);
-		}
-		
-		void Draw(Cairo::RefPtr<Cairo::Context> cairo, double offsetX, double offsetY, double width, double height, double timeInFrameSeconds)
-		{
-			double analyzerWidth = width * 0.9;
-			double channelMargin = analyzerWidth / (_channels.size()) * 0.2;
-			
-			double avgValue = 0.0;
-			for(unsigned i=0;i<_channels.size();++i)
-			{
-				const double
-					channelStart = offsetX + analyzerWidth * i / _channels.size(),
-					channelWidth = analyzerWidth / _channels.size();
-				_channels[i]->Draw(cairo, channelStart + channelMargin, offsetY, channelWidth - 2.0 * channelMargin,  height, timeInFrameSeconds);
-				avgValue += _channels[i]->Value();
-			}
-			
-			_mainChannel.SetValue(avgValue / _channels.size(), timeInFrameSeconds);
-			_mainChannel.Draw(cairo, offsetX + analyzerWidth + channelMargin, offsetY, width - 2.0 * channelMargin, height, timeInFrameSeconds);
-		}
-		
-	private:
-		std::vector<SpectrumAnalyzerChannel*> _channels;
-		SpectrumAnalyzerChannel _mainChannel;
-};
-
-}
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/antennamap/spectrumanalyzerchannel.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/antennamap/spectrumanalyzerchannel.h
deleted file mode 100644
index c42bf39f9e50ed3d5ee0e7b107f299c4ebfd530a..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/antennamap/spectrumanalyzerchannel.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef ANTENNAMAP_SPECTRUMANALYZERCHANNEL_H
-#define ANTENNAMAP_SPECTRUMANALYZER_H
-
-#include <gtkmm/drawingarea.h>
-
-namespace antennaMap
-{
-	
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class SpectrumAnalyzerChannel {
-	public:
-		SpectrumAnalyzerChannel() : _value(0.0), _runningMaxValue(1.0)
-		{
-		}
-		
-		~SpectrumAnalyzerChannel()
-		{
-		}
-		
-		double Value() const
-		{
-			return _value;
-		}
-		
-		void SetValue(double value, double timeInFrameSeconds)
-		{
-			runTo(timeInFrameSeconds);
-			if(value > 1.0)
-				value = 1.0;
-			_value = value;
-			if(value > _runningMaxValue)
-				_runningMaxValue = value;
-		}
-		
-		void Draw(Cairo::RefPtr<Cairo::Context> cairo, double offsetX, double offsetY, double width, double height, double timeInFrameSeconds)
-		{
-			runTo(timeInFrameSeconds);
-			
-			cairo->set_line_width(1.0);
-			
-			// The outer circle
-			cairo->rectangle(offsetX, offsetY + height * (1.0 - _value), width, height * _value);
-			cairo->set_source_rgba(0.0, 0.0, 1.0, 1.0);
-			cairo->fill_preserve();
-			cairo->set_source_rgba(0.0, 0.0, 0.0, 1.0);
-			cairo->stroke();
-		}
-		
-	private:
-		double _value, _runningMaxValue;
-		double _lastFrameTime;
-		
-		void runTo(double timeInFrameSeconds)
-		{
-			if(timeInFrameSeconds < _lastFrameTime)
-			{
-				_runningMaxValue = 0.0;
-			} else {
-				double decrease = (timeInFrameSeconds - _lastFrameTime) / 10.0;
-				if(_runningMaxValue > decrease)
-					_runningMaxValue -= decrease;
-				else
-					_runningMaxValue = 0.0;
-				if(_runningMaxValue < _value)
-					_runningMaxValue = _value;
-			}
-			_lastFrameTime = timeInFrameSeconds;
-		}
-};
-
-}
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/antennamapwindow.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/antennamapwindow.h
deleted file mode 100644
index e46919b9b9b471ba6a6c23292bd80ef8b381aa36..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/antennamapwindow.h
+++ /dev/null
@@ -1,159 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef ANTENNAMAPWINDOW_H
-#define ANTENNAMAPWINDOW_H
-
-#include <gtkmm/box.h>
-#include <gtkmm/filechooserdialog.h>
-#include <gtkmm/stock.h>
-#include <gtkmm/window.h>
-#include <gtkmm/menu.h>
-#include <gtkmm/menubar.h>
-
-#include <AOFlagger/gui/antennamap/antennamapwidget.h>
-
-#include <AOFlagger/gui/numinputdialog.h>
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class AntennaMapWindow : public Gtk::Window {
-	public:
-		AntennaMapWindow() : _antennaMapWidget(), _set(0)
-		{
-			set_default_size(500, 400);
-
-			add(_vBox);
-			
-			Gtk::Menu::MenuList& menulist = _menuFile.items();
-			
-			menulist.push_back( Gtk::Menu_Helpers::MenuElem("Open _antennas in ms", sigc::mem_fun(*this, &AntennaMapWindow::onOpenAntennasInMS) ) );
-			menulist.push_back( Gtk::Menu_Helpers::MenuElem("Open _antenna file", sigc::mem_fun(*this, &AntennaMapWindow::onOpenAntennaFile) ) );
-			menulist.push_back( Gtk::Menu_Helpers::MenuElem("Open antenna _time file", sigc::mem_fun(*this, &AntennaMapWindow::onOpenAntennaTimeFile) ) );
-			menulist.push_back( Gtk::Menu_Helpers::MenuElem("Open _spectrum file", sigc::mem_fun(*this, &AntennaMapWindow::onOpenSpectrumFile) ) );
-			
-			_vBox.pack_start(_menuBar, Gtk::PACK_SHRINK);
-			_menuBar.items().push_back(Gtk::Menu_Helpers::MenuElem("_File", _menuFile));
-			
-			_vBox.pack_end(_antennaMapWidget);
-
-			_vBox.show_all();
-
-		  Glib::signal_timeout().connect(sigc::mem_fun(*this, &AntennaMapWindow::onTimeout), 1000/25);
-		}
-		
-		~AntennaMapWindow()
-		{
-			if(_set != 0)
-				delete _set;
-		}
-		
-		void SetMeasurementSet(class MeasurementSet &set)
-		{
-			_antennaMapWidget.SetMeasurementSet(set);
-		}
-		
-	private:
-		antennaMap::AntennaMapWidget _antennaMapWidget;
-		Gtk::MenuBar _menuBar;
-		Gtk::VBox _vBox;
-		MeasurementSet *_set;
-
-		Gtk::Menu _menuFile;
-		
-		bool chooseFile(std::string &file, const std::string &windowTitle, bool folder=false)
-		{
-			Gtk::FileChooserDialog *dialog;
-			if(folder)
-				dialog = new Gtk::FileChooserDialog(windowTitle, Gtk::FILE_CHOOSER_ACTION_SELECT_FOLDER);
-			else
-				dialog = new Gtk::FileChooserDialog(windowTitle);
-			dialog->set_transient_for(*this);
-
-			//Add response buttons the the dialog:
-			dialog->add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
-			dialog->add_button("Open", Gtk::RESPONSE_OK);
-
-			int result = dialog->run();
-
-			if(result == Gtk::RESPONSE_OK)
-			{
-				file = dialog->get_filename();
-				delete dialog;
-				return true;
-			} else {
-				delete dialog;
-				return false;
-			}
-		}
-		
-		void onOpenAntennasInMS()
-		{
-			std::string file;
-			if(chooseFile(file, "Select antenna measurement set", true))
-			{
-				if(_set != 0)
-					delete _set;
-				_set = new MeasurementSet(file);
-				_antennaMapWidget.SetMeasurementSet(*_set);
-			}
-			_antennaMapWidget.Update();
-		}
-		
-		void onOpenAntennaFile()
-		{
-			std::string file;
-			if(chooseFile(file, "Select an antenna time file"))
-			{
-				_antennaMapWidget.SetValuesFromAntennaFile(file);
-			}
-		}
-		
-		void onOpenAntennaTimeFile()
-		{
-			std::string file;
-			if(chooseFile(file, "Select an antenna time file"))
-			{
-				NumInputDialog numInputDialog("Movie speed", "Time steps per frame:", 60);
-				int result = numInputDialog.run();
-				if(result == Gtk::RESPONSE_OK)
-				{
-					_antennaMapWidget.SetMovieTimeStepsPerFrame(numInputDialog.Value());
-					_antennaMapWidget.Map().OpenStatFile(file);
-				}
-			}
-		}
-		
-		void onOpenSpectrumFile()
-		{
-			std::string file;
-			if(chooseFile(file, "Select a spectrum file"))
-			{
-				_antennaMapWidget.SetValuesFromSpectrumFile(file);
-			}
-		}
-		
-		bool onTimeout()
-		{
-			_antennaMapWidget.Update();
-			return true;
-		}
-};
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/application.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/application.h
deleted file mode 100644
index 3fdf8e1051d2010766b5283f3cf051be7b02ffc7..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/application.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef APPLICATION_H
-#define APPLICATION_H
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class Application{
-	public:
-		Application();
-		~Application();
-		void Run(int argc, char *argv[]);
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/complexplaneplotwindow.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/complexplaneplotwindow.h
deleted file mode 100644
index eebd19329e3f8cfd76e709c360c006c90db8db22..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/complexplaneplotwindow.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef COMPLEXPLANEPLOTWINDOW_H
-#define COMPLEXPLANEPLOTWINDOW_H
-
-#include <vector>
-
-#include <gtkmm/box.h>
-#include <gtkmm/button.h>
-#include <gtkmm/buttonbox.h>
-#include <gtkmm/checkbutton.h>
-#include <gtkmm/frame.h>
-#include <gtkmm/label.h>
-#include <gtkmm/radiobutton.h>
-#include <gtkmm/scale.h>
-#include <gtkmm/window.h>
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class ComplexPlanePlotWindow : public Gtk::Window {
-	public:
-		ComplexPlanePlotWindow(class MSWindow &_msWindow, class PlotManager &plotManager);
-		~ComplexPlanePlotWindow();
-	private:
-		size_t XStart() const throw() { return (size_t) _xPositionScale.get_value(); }
-		size_t XLength() const throw() { return (size_t) _lengthScale.get_value(); }
-
-		size_t YStart() const throw() { return (size_t) _yPositionScale.get_value(); }
-		size_t YLength() const throw() { return (size_t) _ySumLengthScale.get_value(); }
-
-		void onPlotPressed();
-		void onTimeStartChanged() {
-			if(XStart() + XLength() > _xMax)
-				_lengthScale.set_value(_xMax - XStart());
-			else
-				setDetailsLabel();
-		}
-		void onTimeDurationChanged() {
-			if(XStart() + XLength() > _xMax)
-				_xPositionScale.set_value(_xMax - XLength());
-			else
-				setDetailsLabel();
-		}
-		void onFreqChanged() {
-			if(YStart() + YLength() > _yMax)
-				_ySumLengthScale.set_value(_yMax - YStart());
-			else
-				setDetailsLabel();
-		}
-		void onFreqSizeChanged() {
-			if(YStart() + YLength() > _yMax)
-				_yPositionScale.set_value(_yMax - YLength());
-			else
-				setDetailsLabel();
-		}
-		void setDetailsLabel();
-
-		class MSWindow &_msWindow;
-		class PlotManager &_plotManager;
-		Gtk::Frame _detailsFrame;
-		Gtk::VBox _mainBox, _detailsBox;
-		Gtk::Label
-			_detailsLabel,
-			_xPositionLabel, _yPositionLabel,
-			_lengthLabel, _ySumLengthLabel;
-		Gtk::HScale
-			_xPositionScale, _yPositionScale, 
-			_lengthScale, _ySumLengthScale;
-		Gtk::RadioButton _realVersusImaginaryButton, _timeVersusRealButton;
-		Gtk::CheckButton _allValuesButton, _unmaskedValuesButton, _maskedValuesButton, _fittedValuesButton, _individualSampleFitButton, _fringeFitButton, _dynamicFringeFitButton;
-
-		Gtk::Button _plotButton;
-		Gtk::HButtonBox _buttonBox;
-		std::vector<double> _observationTimes;
-		size_t _xMax, _yMax;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/editstrategywindow.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/editstrategywindow.h
deleted file mode 100644
index 1dfa4d362257ce228b14dd4bfd8e60b0c56837e0..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/editstrategywindow.h
+++ /dev/null
@@ -1,116 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef EDITSTRATEGYWINDOW_H
-#define EDITSTRATEGYWINDOW_H
-
-#include <gtkmm/box.h>
-#include <gtkmm/button.h>
-#include <gtkmm/buttonbox.h>
-#include <gtkmm/frame.h>
-#include <gtkmm/menutoolbutton.h>
-#include <gtkmm/paned.h>
-#include <gtkmm/scrolledwindow.h>
-#include <gtkmm/treemodel.h>
-#include <gtkmm/treeview.h>
-#include <gtkmm/treestore.h>
-#include <gtkmm/window.h>
-
-#include <AOFlagger/strategy/control/types.h>
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class EditStrategyWindow : public Gtk::Window
-{
-	public:
-		EditStrategyWindow(class MSWindow &msWindow);
-		~EditStrategyWindow();
-
-		void AddAction(rfiStrategy::Action *newAction);
-		void UpdateAction(rfiStrategy::Action *action);
-	private:
-		rfiStrategy::Action *GetSelectedAction();
-		size_t GetSelectedActionChildIndex();
-		void initEditButtons();
-		void initLoadDefaultsButtons();
-		void fillStore();
-		void fillStore(Gtk::TreeModel::Row &row, rfiStrategy::Action &action, size_t childIndex);
-
-		void onRemoveActionClicked();
-		void onMoveUpClicked();
-		void onMoveDownClicked();
-		void onAddFOBaseline();
-		void onAddFOMS();
-		void onSelectionChanged();
-
-		void onSaveClicked();
-		void onOpenClicked();
-
-		void onLoadEmptyClicked();
-		void onLoadDefaultClicked();
-		void onLoadOldClicked();
-		void onLoad1ButtonClicked();
-		void onLoad2ButtonClicked();
-		void onLoad3ButtonClicked();
-
-		void clearRightFrame();
-		void selectAction(rfiStrategy::Action *action);
-		void showRight(Gtk::Frame *newFrame)
-		{
-			clearRightFrame();
-			_rightFrame = newFrame; 
-			_paned.add2(*_rightFrame);
-			_rightFrame->show();
-		}
-		Gtk::TreeModel::Row findActionRow(rfiStrategy::Action *action);
-		void addContainerBetween(rfiStrategy::ActionContainer &root, rfiStrategy::ActionContainer *newContainer);
-
-		class ModelColumns : public Gtk::TreeModelColumnRecord
-		{
-		public:
-		
-			ModelColumns()
-				{ add(action); add(description); add(childIndex); }
-		
-			Gtk::TreeModelColumn<rfiStrategy::Action *> action;
-			Gtk::TreeModelColumn<Glib::ustring> description;
-			Gtk::TreeModelColumn<size_t> childIndex;
-		};
-		
-		class MSWindow &_msWindow;
-
-		Gtk::HPaned _paned;
-		Gtk::VBox _strategyBox;
-		rfiStrategy::Strategy *_strategy;
-		Gtk::HButtonBox _strategyEditButtonBox, _strategyFileButtonBox, _strategyLoadDefaultsButtonBox;
-		Gtk::MenuToolButton _addActionButton;
-		Gtk::Button _removeActionButton, _moveUpButton, _moveDownButton;
-		Gtk::Button _addFOBButton, _addFOMSButton;
-		Gtk::Button _loadEmptyButton, _loadDefaultButton, _load1Button, _load2Button, _load3Button, _saveButton, _openButton;
-		ModelColumns _columns;
-		Gtk::ScrolledWindow _viewScrollWindow;
-		Gtk::TreeView _view;
-		Glib::RefPtr<Gtk::TreeStore> _store;
-		Gtk::Menu *_addMenu;
-
-		Gtk::Frame *_rightFrame;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/gotowindow.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/gotowindow.h
deleted file mode 100644
index 127ac1d00d90a9413a4341b56c7250b4d89a8d4b..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/gotowindow.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef GOTOWINDOW_H
-#define GOTOWINDOW_H
-
-#include <string>
-
-#include <gtkmm/box.h>
-#include <gtkmm/button.h>
-#include <gtkmm/buttonbox.h>
-#include <gtkmm/frame.h>
-#include <gtkmm/liststore.h>
-#include <gtkmm/scrolledwindow.h>
-#include <gtkmm/treeview.h>
-#include <gtkmm/window.h>
-
-#include <AOFlagger/strategy/control/types.h>
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class GoToWindow : public Gtk::Window {
-	public:
-		GoToWindow(class MSWindow &msWindow);
-		~GoToWindow();
-	private:
-		void onLoadClicked();
-
-		Gtk::HButtonBox _buttonBox;
-		Gtk::VBox _vBox;
-		Gtk::HBox _hBox;
-		Gtk::Frame _antenna1Frame, _antenna2Frame, _bandFrame;
-		Gtk::TreeView _antenna1View, _antenna2View, _bandView;
-		Gtk::ScrolledWindow _antenna1Scroll, _antenna2Scroll, _bandScroll;
-		Gtk::Button _loadButton;
-
-		class AntennaModelColumns : public Gtk::TreeModelColumnRecord
-		{
-		public:
-			AntennaModelColumns()
-				{ add(antennaIndex); add(antennaName); }
-		
-			Gtk::TreeModelColumn<size_t> antennaIndex;
-			Gtk::TreeModelColumn<Glib::ustring> antennaName;
-		};
-
-		class BandModelColumns : public Gtk::TreeModelColumnRecord
-		{
-		public:
-			BandModelColumns()
-				{ add(bandIndex); add(bandDescription); }
-		
-			Gtk::TreeModelColumn<size_t> bandIndex;
-			Gtk::TreeModelColumn<Glib::ustring> bandDescription;
-		};
-
-		AntennaModelColumns _antennaModelColumns;
-		BandModelColumns _bandModelColumns;
-
-		Glib::RefPtr<Gtk::ListStore> _antennaeStore, _bandStore;
-
-		MSWindow &_msWindow;
-		rfiStrategy::MSImageSet *_imageSet;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/highlightwindow.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/highlightwindow.h
deleted file mode 100644
index 560e45965d048c5eba059f035c872bf9c0b5f0dd..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/highlightwindow.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef HIGHLIGHTWINDOW_H
-#define HIGHLIGHTWINDOW_H
-
-#include <gtkmm/window.h>
-#include <gtkmm/scale.h>
-#include <gtkmm/box.h>
-#include <gtkmm/checkbutton.h>
-
-#include <AOFlagger/msio/types.h>
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class HighlightWindow : public Gtk::Window {
-	public:
-		HighlightWindow(class MSWindow &msWindow);
-		~HighlightWindow();
-	private:
-		void onValueChange();
-		void onHighlightingToggled();
-
-		class MSWindow &_msWindow;
-		Gtk::VScale _highlightThresholdHighScale;
-		Gtk::VScale _highlightThresholdLowScale;
-		Gtk::HScale _connectedCountScale;
-		Gtk::VBox _mainBox;
-		Gtk::HBox _highlightThresholdBox;
-		Gtk::CheckButton _highlightButton;
-
-		num_t _max;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/histogramwindow.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/histogramwindow.h
deleted file mode 100644
index 77ffbf3d0e168a31e5827db94e281b374f9ebfc3..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/histogramwindow.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef GUI___HISTOGRAMWINDOW_H
-#define GUI___HISTOGRAMWINDOW_H
-
-#include <AOFlagger/gui/quality/histogrampage.h>
-
-#include <gtkmm/window.h>
-
-#include <AOFlagger/quality/histogramcollection.h>
-
-class HistogramWindow : public Gtk::Window
-{
-	public:
-		HistogramWindow(HistogramCollection &histograms)
-		{
-			_histogramPage.SetStatistics(histograms);
-			add(_histogramPage);
-			_histogramPage.show();
-		}
-		void SetStatistics(HistogramCollection &histograms)
-		{
-			_histogramPage.SetStatistics(histograms);
-		}
-	private:
-		HistogramPage _histogramPage;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/imagecomparisonwidget.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/imagecomparisonwidget.h
deleted file mode 100644
index 2d05235c1fe64c36c5116bead8ebb447e4dca007..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/imagecomparisonwidget.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef IMAGECOMPARISONWIDGET_H
-#define IMAGECOMPARISONWIDGET_H
-
-#include <gtkmm/drawingarea.h>
-
-#include <vector>
-
-#include "../msio/image2d.h"
-#include "../msio/timefrequencydata.h"
-#include "../msio/timefrequencymetadata.h"
-#include "../msio/segmentedimage.h"
-
-#include "imagewidget.h"
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class ImageComparisonWidget : public ImageWidget {
-	public:
-		enum TFImage { TFOriginalImage, TFRevisedImage, TFContaminatedImage };
-		ImageComparisonWidget();
-		~ImageComparisonWidget();
-		void SetNewData(const class TimeFrequencyData &image, TimeFrequencyMetaDataCPtr metaData);
-
-		TimeFrequencyData GetActiveData() const
-		{
-			TimeFrequencyData data(getActiveDataWithOriginalFlags());
-			data.SetNoMask();
-			if(ShowOriginalMask())
-			{
-			  if(ShowAlternativeMask())
-				{
-					data.SetMask(_original);
-					data.JoinMask(_contaminated);
-				} else
-					data.SetMask(_original);
-			} else {
-			      if(ShowAlternativeMask())
-					data.SetMask(_contaminated);
-			}
-			if(StartHorizontal() != 0.0 || EndHorizontal() != 1.0 || StartVertical() != 0.0 || EndVertical() != 1.0)
-			   data.Trim(round(StartHorizontal() * data.ImageWidth()), round(StartVertical() * data.ImageHeight()),
-									 round(EndHorizontal() * data.ImageWidth()), round(EndVertical() * data.ImageHeight())); 
-			return data;
-		}
-
-		TimeFrequencyData &OriginalData() { return _original; }
-		const TimeFrequencyData &OriginalData() const { return _original; }
-
-		TimeFrequencyData &RevisedData() { return _revised; }
-		const TimeFrequencyData &RevisedData() const { return _revised; }
-
-		void SetRevisedData(const TimeFrequencyData &data)
-		{
-			_revised = data;
-		  updateVisualizedImage();
-		}
-		const TimeFrequencyData &ContaminatedData() const { return _contaminated; }
-		TimeFrequencyData &ContaminatedData() { return _contaminated; }
-		void SetContaminatedData(const TimeFrequencyData &data)
-		{
-			_contaminated = data;
-			SetAlternativeMask(data.GetSingleMask());
-		  updateVisualizedImage();
-		} 
-		void SetVisualizedImage(TFImage visualizedImage)
-		{
-		  _visualizedImage = visualizedImage;
-		  updateVisualizedImage();
-		}
-		void ClearBackground();
-	private:
-		void updateVisualizedImage();
-		const TimeFrequencyData getActiveDataWithOriginalFlags() const
-		{
-			switch(_visualizedImage)
-			{
-				case TFOriginalImage:
-				default:
-					return _original;
-				case TFRevisedImage:
-					return _revised;
-				case TFContaminatedImage:
-					return _contaminated;
-			}
-		}
-		enum TFImage _visualizedImage;
-		TimeFrequencyData _original, _revised, _contaminated;
-		TimeFrequencyMetaDataCPtr _metaData;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/imageplanewindow.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/imageplanewindow.h
deleted file mode 100644
index 63faef9f43664712f98576eceb2a6ed778a04743..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/imageplanewindow.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef IMAGEPLANEWINDOW_H
-#define IMAGEPLANEWINDOW_H
-
-#include <gtkmm/window.h>
-#include <gtkmm/box.h>
-#include <gtkmm/button.h>
-#include <gtkmm/buttonbox.h>
-#include <gtkmm/menu.h>
-#include <gtkmm/radiobutton.h>
-
-#include "../msio/timefrequencydata.h"
-#include "../msio/timefrequencymetadata.h"
-
-#include "../imaging/uvimager.h"
-
-#include "imagewidget.h"
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class ImagePlaneWindow : public Gtk::Window {
-	public:
-		ImagePlaneWindow();
-		~ImagePlaneWindow();
-
-		void AddData(const TimeFrequencyData &data, TimeFrequencyMetaDataCPtr metaData);
-		void AddData(const TimeFrequencyData &data, class SpatialMatrixMetaData *spatialMetaData);
-		UVImager *GetImager() throw() { return &_imager; }
-		void Update();
-	private:
-		UVImager _imager;
-		ImageWidget _imageWidget;
-		Gtk::VBox _box;
-		Gtk::HBox _topBox;
-		Gtk::Button _clearButton;
-		Gtk::Button _applyWeightsButton;
-		Gtk::Button _refreshCurrentButton, _memoryStoreButton, _memoryRecallButton, _memoryMultiplyButton, _memorySubtractButton, _sqrtButton;
-		Gtk::Button _plotHorizontalButton, _plotVerticalButton, _angularTransformButton, _saveFitsButton, _propertiesButton;
-		Gtk::RadioButton _uvPlaneButton, _imagePlaneButton;
-		Gtk::Menu _zoomMenu;
-		Gtk::Button _zoomMenuButton;
-		Gtk::RadioMenuItem::Group _zoomGroup;
-		Gtk::RadioMenuItem
-			_zoomXd4Button, _zoomXd2Button, _zoomX1Button, _zoomX2Button, _zoomX4Button, _zoomX8Button,
-			_zoomX16Button, _zoomX32Button, _zoomX64Button, _zoomX128Button;
-		long double _zoom;
-		TimeFrequencyMetaDataCPtr _lastMetaData;	
-
-		bool _displayingUV;
-		Image2DCPtr _memory;
-		class ImagePropertiesWindow *_propertiesWindow;
-		
-		void onClearClicked();
-		void onApplyWeightsClicked();
-		void onUVPlaneButtonClicked();
-		void onImagePlaneButtonClicked();
-		void onZoomMenuButtonClicked();
-		void onZoomButtonClicked();
-		void onRefreshCurrentClicked();
-		void onMemoryStoreClicked();
-		void onMemoryRecallClicked();
-		void onMemoryMultiplyClicked();
-		void onMemorySubtractClicked();
-		void onSqrtClicked();
-		void onPlotHorizontally();
-		void onPlotVertically();
-		void onAngularTransformButton();
-		void onSaveFitsButton();
-		void onPropertiesButton();
-		void onButtonReleased(size_t x, size_t y);
-
-		void printStats();
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/imagepropertieswindow.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/imagepropertieswindow.h
deleted file mode 100644
index a0cb43b064849173071380619c1948500ff75455..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/imagepropertieswindow.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef IMAGEPROPERTIESWINDOW_H
-#define IMAGEPROPERTIESWINDOW_H
-
-#include <string>
-
-#include <gtkmm/box.h>
-#include <gtkmm/button.h>
-#include <gtkmm/buttonbox.h>
-#include <gtkmm/checkbutton.h>
-#include <gtkmm/entry.h>
-#include <gtkmm/label.h>
-#include <gtkmm/frame.h>
-#include <gtkmm/radiobutton.h>
-#include <gtkmm/scale.h>
-#include <gtkmm/window.h>
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class ImagePropertiesWindow : public Gtk::Window {
-	public:
-		ImagePropertiesWindow(class ImageWidget &imageWidget, const std::string &title);
-		~ImagePropertiesWindow() { }
-	private:
-		void onApplyClicked();
-		void onCloseClicked();
-		void onExportClicked();
-		
-		void onScaleChanged()
-		{
-			_scaleMinEntry.set_sensitive(_specifiedScaleButton.get_active());
-			_scaleMaxEntry.set_sensitive(_specifiedScaleButton.get_active());
-		}
-		
-		void initColorMapButtons();
-		void initScaleWidgets();
-		void initOptionsWidgets();
-		void initZoomWidgets();
-		void initAxisWidgets();
-		
-		void updateMinMaxEntries();
-
-		class ImageWidget &_imageWidget;
-
-		Gtk::HButtonBox _bottomButtonBox;
-		Gtk::VBox _topVBox;
-		Gtk::HBox _framesHBox;
-		
-		Gtk::Button _applyButton, _exportButton, _closeButton;
-		Gtk::Image _saveImage;
-		Gtk::Frame _colorMapFrame;
-		Gtk::VBox _colorMapBox;
-		Gtk::RadioButton _grayScaleButton, _invGrayScaleButton, _hotColdScaleButton, _redBlueScaleButton, _blackRedScaleButton, _redBlueYellowScaleButton;
-		
-		Gtk::Frame _scaleFrame;
-		Gtk::VBox _scaleBox;
-		Gtk::RadioButton _minMaxScaleButton, _winsorizedScaleButton, _specifiedScaleButton;
-		Gtk::Label _scaleMinLabel, _scaleMaxLabel;
-		Gtk::Entry _scaleMinEntry, _scaleMaxEntry;
-		
-		Gtk::Frame _optionsFrame;
-		Gtk::VBox _optionsBox;
-		Gtk::RadioButton _normalOptionsButton, _logScaleButton, _zeroSymmetricButton;
-		
-		Gtk::Frame _zoomFrame;
-		Gtk::HBox _zoomHBox;
-		Gtk::VBox _zoomVSubBox;
-		Gtk::HScale _hStartScale, _hStopScale;
-		Gtk::VScale _vStartScale, _vStopScale;
-		
-		Gtk::Frame _axesFrame;
-		Gtk::HBox _axesHBox;
-		Gtk::VBox _axesGeneralBox;
-		Gtk::VBox _axesVisibilityBox;
-		Gtk::CheckButton _showXYAxes, _showColorScale;
-		Gtk::HBox _xAxisBox, _yAxisBox, _zAxisBox;
-		Gtk::CheckButton _showXAxisDescriptionButton, _showYAxisDescriptionButton, _showZAxisDescriptionButton;
-		Gtk::CheckButton _manualXAxisDescription, _manualYAxisDescription, _manualZAxisDescription;
-		Gtk::Entry _xAxisDescriptionEntry, _yAxisDescriptionEntry, _zAxisDescriptionEntry;
-};
-
-#endif // IMAGEPROPERTIESWINDOW_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/imagewidget.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/imagewidget.h
deleted file mode 100644
index b53afd52b008cf4731fc63de9e64f852af92adfa..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/imagewidget.h
+++ /dev/null
@@ -1,235 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef IMAGEWIDGET_H
-#define IMAGEWIDGET_H
-
-#include <gtkmm/drawingarea.h>
-
-#include <cairomm/surface.h>
-
-#include <vector>
-
-#include "../msio/image2d.h"
-#include "../msio/timefrequencydata.h"
-#include "../msio/timefrequencymetadata.h"
-#include "../msio/segmentedimage.h"
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class ImageWidget : public Gtk::DrawingArea {
-	public:
-		enum TFMap { BWMap, InvertedMap, HotColdMap, RedBlueMap, RedYellowBlueMap, BlackRedMap };
-		enum Range { MinMax, Winsorized, Specified };
-		enum ScaleOption { NormalScale, LogScale, ZeroSymmetricScale };
-		
-		ImageWidget();
-		~ImageWidget();
-
-		bool ShowOriginalMask() const { return _showOriginalMask; }
-		void SetShowOriginalMask(bool newValue) { _showOriginalMask = newValue; }
-
-		bool ShowAlternativeMask() const { return _showAlternativeMask; }
-		void SetShowAlternativeMask(bool newValue) { _showAlternativeMask = newValue; }
-
-		TFMap GetColorMap() const { return _colorMap; }
-		void SetColorMap(TFMap colorMap) { _colorMap = colorMap; }
-		
-		void SetRange(enum Range range)
-		{
-			_range = range;
-		}
-		enum Range Range() const
-		{
-			return _range;
-		}
-		void SetScaleOption(ScaleOption option)
-		{
-			_scaleOption = option;
-		}
-		enum ScaleOption ScaleOption() const { return _scaleOption; }
-		
-		void Update(); 
-
-		Image2DCPtr Image() const { return _image; }
-		void SetImage(Image2DCPtr image) { _image = image; }
-
-		Mask2DCPtr OriginalMask() const { return _originalMask; }
-		void SetOriginalMask(Mask2DCPtr mask) { _originalMask = mask; }
-
-		Mask2DCPtr AlternativeMask() const { return _alternativeMask; }
-		void SetAlternativeMask(Mask2DCPtr mask) { _alternativeMask = mask; }
-
-		Mask2DCPtr GetActiveMask() const;
-
-		void SetHighlighting(bool newValue) { _highlighting = newValue; }
-		class ThresholdConfig &HighlightConfig() { return *_highlightConfig; }
-		bool HasImage() const { return _image != 0; }
-		void SetHorizontalDomain(double start, double end)
-		{
-			_startHorizontal = start;
-			_endHorizontal = end;
-		}
-		void SetVerticalDomain(double start, double end)
-		{
-			_startVertical = start;
-			_endVertical = end;
-		}
-		void ResetDomains();
-		double StartHorizontal() const { return _startHorizontal; }
-		double EndHorizontal() const { return _endHorizontal; }
-		double StartVertical() const { return _startVertical; }
-		double EndVertical() const { return _endVertical; }
-		void SetSegmentedImage(SegmentedImageCPtr segmentedImage) { _segmentedImage = segmentedImage; }
-		TimeFrequencyMetaDataCPtr GetMetaData();
-		void SetMetaData(TimeFrequencyMetaDataCPtr metaData) { _metaData = metaData; }
-
-		sigc::signal<void, size_t, size_t> &OnMouseMovedEvent() { return _onMouseMoved; }
-		sigc::signal<void> &OnMouseLeaveEvent() { return _onMouseLeft; }
-		sigc::signal<void, size_t, size_t> &OnButtonReleasedEvent() { return _onButtonReleased; }
-		
-		num_t Max() const { return _max; }
-		num_t Min() const { return _min; }
-		
-		void SetMax(num_t max) { _max = max; }
-		void SetMin(num_t min) { _min = min; }
-		
-		void SavePdf(const std::string &filename);
-		void SaveSvg(const std::string &filename);
-		void SavePng(const std::string &filename);
-		
-		bool ShowXYAxes() const { return _showXYAxes; }
-		void SetShowXYAxes(bool showXYAxes)
-		{
-			_showXYAxes = showXYAxes;
-		}
-		
-		bool ShowColorScale() const { return _showColorScale; }
-		void SetShowColorScale(bool showColorScale)
-		{
-			_showColorScale = showColorScale;
-		}
-		
-		bool ShowXAxisDescription() const { return _showXAxisDescription; }
-		void SetShowXAxisDescription(bool showXAxisDescription)
-		{
-			_showXAxisDescription = showXAxisDescription;
-		}
-		
-		bool ShowYAxisDescription() const { return _showYAxisDescription; }
-		void SetShowYAxisDescription(bool showYAxisDescription)
-		{
-			_showYAxisDescription = showYAxisDescription;
-		}
-		
-		bool ShowZAxisDescription() const { return _showZAxisDescription; }
-		void SetShowZAxisDescription(bool showZAxisDescription)
-		{
-			_showZAxisDescription = showZAxisDescription;
-		}
-		
-		void Clear();
-		
-		void SetCairoFilter(Cairo::Filter filter)
-		{
-			_cairoFilter = filter;
-		}
-		
-		void SetXAxisDescription(const std::string &description)
-		{
-			_xAxisDescription = description;
-		}
-		void SetYAxisDescription(const std::string &description)
-		{
-			_yAxisDescription = description;
-		}
-		void SetZAxisDescription(const std::string &description)
-		{
-			_zAxisDescription = description;
-		}
-		
-		bool ManualXAxisDescription() const { return _manualXAxisDescription; }
-		void SetManualXAxisDescription(bool manualDesc)
-		{
-			_manualXAxisDescription = manualDesc;
-		}
-		bool ManualYAxisDescription() const { return _manualYAxisDescription; }
-		void SetManualYAxisDescription(bool manualDesc)
-		{
-			_manualYAxisDescription = manualDesc;
-		}
-		bool ManualZAxisDescription() const { return _manualZAxisDescription; }
-		void SetManualZAxisDescription(bool manualDesc)
-		{
-			_manualZAxisDescription = manualDesc;
-		}
-
-	private:
-		void findMinMax(Image2DCPtr image, Mask2DCPtr mask, num_t &min, num_t &max);
-		void update(Cairo::RefPtr<Cairo::Context> cairo, unsigned width, unsigned height);
-		void redrawWithoutChanges(Cairo::RefPtr<Cairo::Context> cairo, unsigned width, unsigned height);
-		void downsampleImageBuffer(unsigned newWidth, unsigned newHeight);
-		bool toUnits(double mouseX, double mouseY, int &posX, int &posY);
-		bool onExposeEvent(GdkEventExpose* ev);
-		bool onMotion(GdkEventMotion *event);
-		bool onLeave(GdkEventCrossing *event);
-		bool onButtonReleased(GdkEventButton *event);
-		class ColorMap *createColorMap();
-
-		bool _isInitialized;
-		unsigned _initializedWidth, _initializedHeight;
-		Cairo::RefPtr<Cairo::ImageSurface> _imageSurface;
-
-		bool _showOriginalMask, _showAlternativeMask;
-		enum TFMap _colorMap;
-		TimeFrequencyMetaDataCPtr _metaData;
-		Image2DCPtr _image;
-		Mask2DCPtr _originalMask, _alternativeMask;
-		bool _highlighting;
-		class ThresholdConfig *_highlightConfig;
-		double _leftBorderSize, _rightBorderSize, _topBorderSize, _bottomBorderSize;
-
-		double _startHorizontal, _endHorizontal;
-		double _startVertical, _endVertical;
-		SegmentedImageCPtr _segmentedImage;
-		class HorizontalPlotScale *_horiScale;
-		class VerticalPlotScale *_vertScale;
-		class ColorScale *_colorScale;
-		enum ScaleOption _scaleOption;
-		bool _showXYAxes;
-		bool _showColorScale;
-		bool _showXAxisDescription;
-		bool _showYAxisDescription;
-		bool _showZAxisDescription;
-		num_t _max, _min;
-		enum Range _range;
-		Cairo::Filter _cairoFilter;
-		std::string _xAxisDescription, _yAxisDescription, _zAxisDescription;
-		bool _manualXAxisDescription;
-		bool _manualYAxisDescription;
-		bool _manualZAxisDescription;
-		bool _mouseIsIn;
-
-		sigc::signal<void, size_t, size_t> _onMouseMoved;
-		sigc::signal<void> _onMouseLeft;
-		sigc::signal<void, size_t, size_t> _onButtonReleased;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/msoptionwindow.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/msoptionwindow.h
deleted file mode 100644
index 933941c841df830b1e8b6cc56a695c627462999f..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/msoptionwindow.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef MSOPTIONWINDOW_H
-#define MSOPTIONWINDOW_H
-
-#include <string>
-
-#include <gtkmm/window.h>
-#include <gtkmm/box.h>
-#include <gtkmm/button.h>
-#include <gtkmm/entry.h>
-#include <gtkmm/radiobutton.h>
-#include <gtkmm/buttonbox.h>
-#include <gtkmm/frame.h>
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class MSOptionWindow : public Gtk::Window {
-	public:
-		MSOptionWindow(class MSWindow &msWindow, const std::string &filename);
-		~MSOptionWindow();
-		void onOpen();
-	private:
-		void initDataTypeButtons();
-		void initPolarisationButtons();
-		void initPartitioningButtons();
-
-		class MSWindow &_msWindow;
-		const std::string _filename;
-
-		Gtk::HButtonBox _bottomButtonBox;
-		Gtk::VBox _leftVBox;
-		Gtk::HBox _topHBox;
-		Gtk::Button _openButton;
-		Gtk::Frame _dataKindFrame, _polarisationFrame, _partitioningFrame;
-		Gtk::VBox _dataKindBox, _polarisationBox, _partitioningBox;
-		Gtk::HBox _otherColumnBox;
-		Gtk::RadioButton _observedDataButton, _correctedDataButton, _modelDataButton, _residualDataButton, _otherColumnButton;
-		Gtk::Entry _otherColumnEntry;
-		Gtk::RadioButton _allDipolePolarisationButton, _autoDipolePolarisationButton, _stokesIPolarisationButton;
-		Gtk::RadioButton _noPartitioningButton, _max2500ScansButton, _max10000ScansButton, _max25000ScansButton,
-			_max100000ScansButton;
-		Gtk::RadioButton _directReadButton, _indirectReadButton, _memoryReadButton;
-		Gtk::CheckButton _readUVWButton;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/mswindow.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/mswindow.h
deleted file mode 100644
index f85c2ee4cb4bd496a220d261abe44ccdda553fd5..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/mswindow.h
+++ /dev/null
@@ -1,283 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef MSWINDOW_H
-#define MSWINDOW_H
-
-#include <set>
-
-#include <boost/thread/mutex.hpp>
-
-#include <gtkmm/actiongroup.h>
-#include <gtkmm/box.h>
-#include <gtkmm/drawingarea.h>
-#include <gtkmm/paned.h>
-#include <gtkmm/radioaction.h>
-#include <gtkmm/statusbar.h>
-#include <gtkmm/toggleaction.h>
-#include <gtkmm/window.h>
-
-#include <AOFlagger/msio/timefrequencydata.h>
-#include <AOFlagger/msio/timefrequencymetadata.h>
-
-#include <AOFlagger/strategy/control/types.h>
-
-#include <AOFlagger/gui/plot/plotwidget.h>
-#include <AOFlagger/gui/plot/plotmanager.h>
-
-#include <AOFlagger/gui/plotwindow.h>
-
-#include <AOFlagger/gui/plotframe.h>
-#include <AOFlagger/gui/imagecomparisonwidget.h>
-
-#include <AOFlagger/imaging/defaultmodels.h>
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class MSWindow : public Gtk::Window {
-	public:
-		MSWindow();
-		~MSWindow();
-
-		void SetImageSet(rfiStrategy::ImageSet *newImageSet);
-		void SetImageSetIndex(rfiStrategy::ImageSetIndex *newImageSetIndex);
-		rfiStrategy::ImageSet &GetImageSet() const { return *_imageSet; }
-		rfiStrategy::ImageSetIndex &GetImageSetIndex() const { return *_imageSetIndex; }
-		void SetRevisedData(const TimeFrequencyData &data)
-		{
-			_timeFrequencyWidget.SetRevisedData(data);
-		}
-		void Update()
-		{
-			_timeFrequencyWidget.Update();
-		}
- 		bool HasImageSet() const { return _imageSet != 0; }
-		bool HasImage() const { return _timeFrequencyWidget.HasImage(); }
-		Mask2DCPtr Mask() const { return GetOriginalData().GetSingleMask(); }
-		Mask2DCPtr AltMask() const { return GetContaminatedData().GetSingleMask(); }
-		
-		TimeFrequencyData GetActiveData() const
-		{
-			return _timeFrequencyWidget.GetActiveData();
-		}
-		const TimeFrequencyData &GetOriginalData() const
-		{
-			return _timeFrequencyWidget.OriginalData();
-		}
-		const TimeFrequencyData &GetContaminatedData() const
-		{
-			return _timeFrequencyWidget.ContaminatedData();
-		}
-
-		class ImageComparisonWidget &GetTimeFrequencyWidget()
-		{
-			return _timeFrequencyWidget;
-		}
-		
-		class ThresholdConfig &HighlightConfig()
-		{
-			return _timeFrequencyWidget.HighlightConfig();
-		}
-		void SetHighlighting(bool newValue)
-		{
-			_timeFrequencyWidget.SetHighlighting(newValue);
-		}
-		TimeFrequencyMetaDataCPtr TimeFrequencyMetaData()
-		{
-			return _timeFrequencyWidget.GetMetaData();
-		}
-		rfiStrategy::Strategy &Strategy() const { return *_strategy; }
-		void SetStrategy(rfiStrategy::Strategy *newStrategy) { _strategy = newStrategy; }
-
-		void onExecuteStrategyFinished();
-		void OpenPath(const std::string &path);
-	private:
-		void createToolbar();
-		void loadCurrentTFData();
-
-		void onLoadPrevious();
-		void onLoadNext();
-		void onLoadLargeStepPrevious();
-		void onLoadLargeStepNext();
-		void onToggleFlags();
-		void onToggleImage();
-		void onCompress();
-		void onQuit() { hide(); }
-		void onActionFileOpen();
-		void onActionDirectoryOpen();
-		void onActionDirectoryOpenForSpatial();
-		void onActionDirectoryOpenForST();
-		void onShowImagePlane();
-		void onSetAndShowImagePlane();
-		void onAddToImagePlane();
-		void onClearAltFlagsPressed();
-		void onDifferenceToOriginalPressed();
-		void onBackgroundToOriginalPressed();
-		void onHightlightPressed();
-		void showPhasePart(enum TimeFrequencyData::PhaseRepresentation phaseRepresentation);
-		void onShowRealPressed() { showPhasePart(TimeFrequencyData::RealPart); }
-		void onShowImaginaryPressed() { showPhasePart(TimeFrequencyData::ImaginaryPart); }
-		void onShowPhasePressed() { showPhasePart(TimeFrequencyData::PhasePart); }
-		void showPolarisation(enum PolarisationType polarisation);
-		void onShowStokesIPressed() { showPolarisation(StokesIPolarisation); }
-		void onShowStokesQPressed() { showPolarisation(StokesQPolarisation); }
-		void onShowStokesUPressed() { showPolarisation(StokesUPolarisation); }
-		void onShowStokesVPressed() { showPolarisation(StokesVPolarisation); }
-		void onShowAutoDipolePressed() { showPolarisation(AutoDipolePolarisation); }
-		void onShowCrossDipolePressed() { showPolarisation(CrossDipolePolarisation); }
-		void onShowXXPressed() { showPolarisation(XXPolarisation); }
-		void onShowXYPressed() { showPolarisation(XYPolarisation); }
-		void onShowYXPressed() { showPolarisation(YXPolarisation); }
-		void onShowYYPressed() { showPolarisation(YYPolarisation); }
-		void onImagePropertiesPressed();
-		void onOpenTestSetNoise() { openTestSet(2); }
-		void onOpenTestSetA() { openTestSet(3); }
-		void onOpenTestSetB() { openTestSet(4); }
-		void onOpenTestSetC() { openTestSet(5); }
-		void onOpenTestSetD() { openTestSet(18); }
-		void onOpenTestSetE() { openTestSet(14); }
-		void onOpenTestSetF() { openTestSet(16); }
-		void onOpenTestSetG() { openTestSet(17); }
-		void onOpenTestSetH() { openTestSet(7); }
-		void onOpenTestSetNoise3Model() { openTestSet(19); }
-		void onOpenTestSetNoise5Model() { openTestSet(20); }
-		void onOpenTestSet3Model() { openTestSet(21); }
-		void onOpenTestSet5Model() { openTestSet(22); }
-		void onOpenTestSetBStrong() { openTestSet(24); }
-		void onOpenTestSetBWeak() { openTestSet(23); }
-		void onOpenTestSetBAligned() { openTestSet(25); }
-		void onOpenTestSetGaussianBroadband() { openTestSet(26); }
-		void onOpenTestSetSinusoidalBroadband() { openTestSet(27); }
-		void onOpenTestSetSlewedGaussianBroadband() { openTestSet(28); }
-		void onOpenTestSetBurstBroadband() { openTestSet(29); }
-		void onOpenTestSetRFIDistributionLow() { openTestSet(32); }
-		void onOpenTestSetRFIDistributionMid() { openTestSet(31); }
-		void onOpenTestSetRFIDistributionHigh() { openTestSet(30); }
-		void onGaussianTestSets() { _gaussianTestSets = 1; }
-		void onRayleighTestSets() { _gaussianTestSets = 0; }
-		void onZeroTestSets() { _gaussianTestSets = 2; }
-		void onAddStaticFringe();
-		void onAdd1SigmaFringe();
-		void onSetToOne();
-		void onSetToI();
-		void onSetToOnePlusI();
-		void onShowStats();
-		void onPlotDistPressed();
-		void onPlotLogLogDistPressed();
-		void onPlotComplexPlanePressed();
-		void onPlotMeanSpectrumPressed() { plotMeanSpectrumPressed<false>(); }
-		void onPlotSumSpectrumPressed() { plotMeanSpectrumPressed<true>(); }
-		template<bool Weigh> void plotMeanSpectrumPressed();
-		void onPlotPowerSpectrumPressed();
-		void onPlotPowerSpectrumComparisonPressed();
-		void onPlotPowerRMSPressed();
-		void onPlotPowerSNRPressed();
-		void onPlotPowerTimePressed();
-		void onPlotPowerTimeComparisonPressed();
-		void onPlotTimeScatterPressed();
-		void onPlotTimeScatterComparisonPressed();
-		void onPlotSingularValuesPressed();
-		void onPlotSNRToFitVariance();
-		void onPlotQuality25Pressed();
-		void onPlotQualityAllPressed();
-		void onEditStrategyPressed();
-		void onExecuteStrategyPressed();
-		void onGoToPressed();
-		void onTFWidgetMouseMoved(size_t x, size_t y);
-		void onTFWidgetButtonReleased(size_t x, size_t y);
-		void onMultiplyData();
-		void onSegment();
-		void onCluster();
-		void onClassify();
-		void onRemoveSmallSegments();
-		void onTimeGraphButtonPressed();
-		void onFrequencyGraphButtonPressed();
-		void onUnrollPhaseButtonPressed();
-		void onVertEVD();
-		void onApplyTimeProfile();
-		void onApplyVertProfile();
-		void onRestoreTimeProfile() { onUseTimeProfile(true); }
-		void onRestoreVertProfile() { onUseVertProfile(true); }
-		void onReapplyTimeProfile() { onUseTimeProfile(false); }
-		void onReapplyVertProfile() { onUseVertProfile(false); }
-		void onUseTimeProfile(bool inverse);
-		void onUseVertProfile(bool inverse);
-		void onStoreData();
-		void onRecallData();
-		void onSubtractDataFromMem();
-		void onTimeMergeUnsetValues();
-		
-		void showError(const std::string &description);
-		void setSetNameInStatusBar();
-		
-		DefaultModels::SetLocation getSetLocation(bool empty = false);
-		void loadDefaultModel(DefaultModels::Distortion distortion, bool withNoise, bool empty = false);
-		void onSimulateCorrelation() { loadDefaultModel(DefaultModels::ConstantDistortion, false); }
-		void onSimulateSourceSetA() { loadDefaultModel(DefaultModels::ConstantDistortion, true); }
-		void onSimulateSourceSetB() { loadDefaultModel(DefaultModels::VariableDistortion, true); }
-		void onSimulateSourceSetC() { loadDefaultModel(DefaultModels::FaintDistortion, true); }
-		void onSimulateSourceSetD() { loadDefaultModel(DefaultModels::MislocatedDistortion, true); }
-		void onSimulateOffAxisSource() { loadDefaultModel(DefaultModels::ConstantDistortion, false, true); }
-		void onSimulateOnAxisSource() { loadDefaultModel(DefaultModels::OnAxisSource, false, true); }
-		
-		void onShowAntennaMapWindow();
-		void openTestSet(unsigned index);
-		
-		Gtk::VBox _mainVBox;
-		Gtk::VPaned _panedArea;
-		ImageComparisonWidget _timeFrequencyWidget;
-		Glib::RefPtr<Gtk::ActionGroup> _actionGroup;
-		Gtk::Statusbar _statusbar;
-		PlotFrame _plotFrame;
-		std::string _imageSetName, _imageSetIndexDescription;
-
-		Glib::RefPtr<Gtk::ToggleAction>
-			_originalFlagsButton, _altFlagsButton,
-			_originalImageButton, _backgroundImageButton, _diffImageButton,
-			_timeGraphButton, _simFixBandwidthButton;
-		Glib::RefPtr<Gtk::RadioAction>
-			_gaussianTestSetsButton, _rayleighTestSetsButton, _zeroTestSetsButton,
-			_ncpSetButton, _b1834SetButton, _emptySetButton,
-			_sim16ChannelsButton, _sim64ChannelsButton, _sim256ChannelsButton;
-		class ImagePlaneWindow *_imagePlaneWindow;
-		class HistogramWindow *_histogramWindow;
-		Gtk::Window
-			*_optionWindow, *_editStrategyWindow,
-			*_gotoWindow,
-			*_progressWindow, *_highlightWindow,
-			*_plotComplexPlaneWindow, *_imagePropertiesWindow,
-			*_antennaMapWindow;
-
-		class RFIStatistics *_statistics;
-		
-		rfiStrategy::ImageSet *_imageSet;
-		rfiStrategy::ImageSetIndex *_imageSetIndex;
-		rfiStrategy::Strategy *_strategy;
-		int _gaussianTestSets;
-		boost::mutex _ioMutex;
-		SegmentedImagePtr _segmentedImage;
-		class SpatialMatrixMetaData *_spatialMetaData;
-		std::vector<double> _horProfile, _vertProfile;
-		TimeFrequencyData _storedData;
-		PlotManager _plotManager;
-		PlotWindow _plotWindow;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/noisestatoptionwindow.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/noisestatoptionwindow.h
deleted file mode 100644
index 6c60f1ac1fc792bb9fefb8eacb47e44186f8f330..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/noisestatoptionwindow.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef NOISESTATOPTIONWINDOW_H
-#define NOISESTATOPTIONWINDOW_H
-
-#include <string>
-
-#include <gtkmm/box.h>
-#include <gtkmm/button.h>
-#include <gtkmm/buttonbox.h>
-#include <gtkmm/label.h>
-#include <gtkmm/frame.h>
-#include <gtkmm/radiobutton.h>
-#include <gtkmm/scale.h>
-#include <gtkmm/window.h>
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class NoiseStatOptionWindow : public Gtk::Window {
-	public:
-		NoiseStatOptionWindow(class MSWindow &msWindow, const std::string &filename);
-		~NoiseStatOptionWindow() { }
-		void onOpen();
-	private:
-		void initModeButtons();
-
-		class MSWindow &_msWindow;
-		const std::string _filename;
-
-		Gtk::HButtonBox _bottomButtonBox;
-		Gtk::VBox _topVBox;
-		Gtk::Button _openButton;
-		Gtk::Frame _modeFrame;
-		Gtk::VBox _modeBox;
-		Gtk::RadioButton _meanButton, _stdDevButton, _varianceButton, _varianceOfVarianceButton;
-};
-
-#endif // TFSTATOPTIONWINDOW_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/numinputdialog.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/numinputdialog.h
deleted file mode 100644
index e58839cd004a0860fa89636697bce71e385bbe89..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/numinputdialog.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef NUMINPUTDIALOG_H
-#define NUMINPUTDIALOG_H
-
-#include <cstdlib>
-#include <sstream>
-
-#include <gtkmm/box.h>
-#include <gtkmm/dialog.h>
-#include <gtkmm/entry.h>
-#include <gtkmm/label.h>
-#include <gtkmm/stock.h>
-
-class NumInputDialog : public Gtk::Dialog
-{
-	public:
-		NumInputDialog(const Glib::ustring& title, const Glib::ustring& valueCaption, double defaultValue)
-			: Dialog(title, true), _label(valueCaption)
-		{
-			_hBox.pack_start(_label);
-			
-			std::ostringstream s;
-			s << defaultValue;
-			_entry.set_text(s.str());
-			_entry.set_activates_default(true);
-			_hBox.pack_end(_entry);
-			
-			get_vbox()->pack_start(_hBox);
-			_hBox.show_all();
-			
-			add_button(Gtk::Stock::OK, Gtk::RESPONSE_OK);
-			add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
-			set_default_response(Gtk::RESPONSE_OK);
-		}
-		
-		double Value() const
-		{
-			return atof(_entry.get_text().c_str());
-		}
-	private:
-		Gtk::Label _label;
-		Gtk::Entry _entry;
-		Gtk::HBox _hBox;
-};
-
-#endif // NUMINPUTDIALOG_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/plot/colorscale.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/plot/colorscale.h
deleted file mode 100644
index 3a5f4db30d184d011afb48e864e3a721880fa5d4..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/plot/colorscale.h
+++ /dev/null
@@ -1,112 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef PLOT_COLORSCALE_H
-#define PLOT_COLORSCALE_H
-
-#include <string>
-#include <map>
-
-#include <gtkmm/drawingarea.h>
-
-#include <AOFlagger/gui/plot/verticalplotscale.h>
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class ColorScale {
-	public:
-		ColorScale();
-		
-		virtual ~ColorScale()
-		{
-		}
-		void SetPlotDimensions(double plotWidth, double plotHeight, double topMargin)
-		{
-			_plotWidth = plotWidth;
-			_plotHeight = plotHeight;
-			_topMargin = topMargin;
-			_width = 0.0;
-		}
-		double GetWidth(Cairo::RefPtr<Cairo::Context> cairo)
-		{
-			if(_width == 0.0)
-				initWidth(cairo);
-			return _width;
-		}
-		void Draw(Cairo::RefPtr<Cairo::Context> cairo);
-		void InitializeNumericTicks(double min, double max)
-		{
-			_width = 0.0;
-			_min = min;
-			_max = max;
-			_isLogaritmic = false;
-			_verticalPlotScale.InitializeNumericTicks(min, max);
-		}
-		void InitializeLogarithmicTicks(double min, double max)
-		{
-			_width = 0.0;
-			_min = min;
-			_max = max;
-			_isLogaritmic = true;
-			_verticalPlotScale.InitializeLogarithmicTicks(min, max);
-		}
-		void SetColorValue(double value, double red, double green, double blue)
-		{
-			ColorValue cValue;
-			cValue.red = red;
-			cValue.green = green;
-			cValue.blue = blue;
-			_colorValues.insert(std::pair<double, ColorValue>(value, cValue));
-		}
-		void SetDescriptionFontSize(double fontSize)
-		{
-			_verticalPlotScale.SetDescriptionFontSize(fontSize);
-		}
-		void SetTickValuesFontSize(double fontSize)
-		{
-			_verticalPlotScale.SetTickValuesFontSize(fontSize);
-		}
-		void SetDrawWithDescription(bool drawWithDescription)
-		{
-			_verticalPlotScale.SetDrawWithDescription(drawWithDescription);
-		}
-		void SetUnitsCaption(const std::string &caption)
-		{
-			_verticalPlotScale.SetUnitsCaption(caption);
-		}
-	private:
-		static const double BAR_WIDTH;
-		
-		struct ColorValue
-		{
-			double red, green, blue;
-		};
-		
-		void initWidth(Cairo::RefPtr<Cairo::Context> cairo);
-		
-		double _plotWidth, _plotHeight, _topMargin;
-		double _scaleWidth, _width;
-		double _min, _max;
-		class VerticalPlotScale _verticalPlotScale;
-		std::map<double, ColorValue> _colorValues;
-		bool _isLogaritmic;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/plot/dimension.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/plot/dimension.h
deleted file mode 100644
index a7c506fe95d08967833c050fe56bcceff513291f..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/plot/dimension.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef DIMENSION_H
-#define DIMENSION_H
-
-#include "plot2dpointset.h"
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class Dimension {
-	public:
-		Dimension() : _pointSets(0) { }
-		~Dimension() { }
-
-		void AdjustRanges(Plot2DPointSet &pointSet)
-		{
-			if(_pointSets == 0)
-			{
-				_xRangeMin = pointSet.XRangeMin();
-				_xRangeMax = pointSet.XRangeMax();
-				_yRangeMin = pointSet.YRangeMin();
-				_yRangeMax = pointSet.YRangeMax();
-				_yRangePositiveMin = pointSet.YRangePositiveMin();
-				_yRangePositiveMax = pointSet.YRangePositiveMax();
-			} else {
-				if(_xRangeMin > pointSet.XRangeMin())
-					_xRangeMin = pointSet.XRangeMin();
-				if(_xRangeMax < pointSet.XRangeMax())
-					_xRangeMax = pointSet.XRangeMax();
-				
-				if(_yRangeMin > pointSet.YRangeMin())
-					_yRangeMin = pointSet.YRangeMin();
-				if(_yRangePositiveMin > pointSet.YRangePositiveMin() && std::isfinite(pointSet.YRangePositiveMin())) 
-					_yRangePositiveMin = pointSet.YRangePositiveMin();
-				
-				if(_yRangeMax < pointSet.YRangeMax())
-					_yRangeMax = pointSet.YRangeMax();
-				if(_yRangePositiveMax < pointSet.YRangePositiveMax() && std::isfinite(pointSet.YRangePositiveMax())) 
-					_yRangePositiveMin = pointSet.YRangePositiveMax();
-			}
-			++_pointSets;
-		}
-
-		double XRangeMin() const { return _xRangeMin; }
-		double XRangeMax() const { return _xRangeMax; }
-		double YRangeMin() const { return _yRangeMin; }
-		double YRangeMax() const { return _yRangeMax; }
-		double YRangePositiveMin() const { return _yRangePositiveMin; }
-		double YRangePositiveMax() const { return _yRangePositiveMax; }
-	private:
-		size_t _pointSets;
-		double _xRangeMin, _xRangeMax;
-		double _yRangeMin, _yRangeMax;
-		double _yRangePositiveMin, _yRangePositiveMax;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/plot/horizontalplotscale.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/plot/horizontalplotscale.h
deleted file mode 100644
index 438b75d2f4704d0af12af092d9bd91464620b199..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/plot/horizontalplotscale.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef HORIZONTALPLOTSCALE_H
-#define HORIZONTALPLOTSCALE_H
-
-#include <string>
-#include <vector>
-
-#include <gtkmm/drawingarea.h>
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class HorizontalPlotScale {
-	public:
-		HorizontalPlotScale();
-		virtual ~HorizontalPlotScale();
-		void SetPlotDimensions(double plotWidth, double plotHeight, double topMargin, double verticalScaleWidth)
-		{
-			_plotWidth = plotWidth;
-			_plotHeight = plotHeight;
-			_topMargin = topMargin;
-			_verticalScaleWidth = verticalScaleWidth;
-			_metricsAreInitialized = false;
-		}
-		double GetHeight(Cairo::RefPtr<Cairo::Context> cairo);
-		double GetRightMargin(Cairo::RefPtr<Cairo::Context> cairo);
-		void Draw(Cairo::RefPtr<Cairo::Context> cairo);
-		void InitializeNumericTicks(double min, double max);
-		void InitializeTimeTicks(double timeMin, double timeMax);
-		void InitializeTextTicks(const std::vector<std::string> &labels);
-		void SetDrawWithDescription(bool drawWithDescription)
-		{
-			_drawWithDescription = drawWithDescription;
-			_metricsAreInitialized = false;
-		}
-		void SetUnitsCaption(const std::string &caption)
-		{
-			_unitsCaption = caption;
-			_metricsAreInitialized = false;
-		}
-		void SetDescriptionFontSize(double fontSize)
-		{
-			_tickValuesFontSize = fontSize;
-			_metricsAreInitialized = false;
-		}
-		void SetTickValuesFontSize(double fontSize)
-		{
-			_tickValuesFontSize = fontSize;
-			_metricsAreInitialized = false;
-		}
-		void SetRotateUnits(bool rotate)
-		{
-			_rotateUnits = rotate;
-			_metricsAreInitialized = false;
-		}
-	private:
-		void drawUnits(Cairo::RefPtr<Cairo::Context> cairo);
-		bool ticksFit(Cairo::RefPtr<Cairo::Context> cairo);
-		void initializeMetrics(Cairo::RefPtr<Cairo::Context> cairo); 
-
-		double _plotWidth, _plotHeight, _topMargin, _verticalScaleWidth;
-		bool _metricsAreInitialized;
-		double _height, _rightMargin;
-		class TickSet *_tickSet;
-		bool _drawWithDescription;
-		std::string _unitsCaption;
-		double _descriptionFontSize;
-		double _tickValuesFontSize;
-		bool _rotateUnits;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/plot/plot2d.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/plot/plot2d.h
deleted file mode 100644
index 8748250b3d7e405d78c11c1cec7694e8ac22bb33..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/plot/plot2d.h
+++ /dev/null
@@ -1,175 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef PLOT2D_H
-#define PLOT2D_H
-
-#include <gtkmm/drawingarea.h>
-
-#include <stdexcept>
-#include <string>
-
-#include "plotable.h"
-#include "plot2dpointset.h"
-#include "system.h"
-#include "horizontalplotscale.h"
-#include "verticalplotscale.h"
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class Plot2D : public Plotable {
-	public:
-		enum RangeDetermination { MinMaxRange, WinsorizedRange, SpecifiedRange };
-		
-		Plot2D();
-		~Plot2D();
-
-		void Clear();
-		Plot2DPointSet &StartLine(const std::string &label, const std::string &xDesc = "x", const std::string &yDesc = "y", bool xIsTime = false, enum Plot2DPointSet::DrawingStyle drawingStyle = Plot2DPointSet::DrawLines)
-		{
-			Plot2DPointSet *newSet = new Plot2DPointSet();
-			newSet->SetLabel(label);
-			newSet->SetXIsTime(xIsTime);
-			newSet->SetXDesc(xDesc);
-			newSet->SetYDesc(yDesc);
-			newSet->SetDrawingStyle(drawingStyle);
-			_pointSets.push_back(newSet);
-			return *newSet;
-		}
-		Plot2DPointSet &StartLine(const std::string &label, enum Plot2DPointSet::DrawingStyle drawingStyle)
-		{
-			return StartLine(label, "x", "y", false, drawingStyle);
-		}
-		Plot2DPointSet &StartLine()
-		{
-			return StartLine("", "x", "y", false, Plot2DPointSet::DrawLines);
-		}
-		void PushDataPoint(double x, double y)
-		{
-			if(_pointSets.size() > 0)
-				(*_pointSets.rbegin())->PushDataPoint(x,y);
-			else
-				throw std::runtime_error("Trying to push a data point into a plot without point sets (call StartLine first).");
-		}
-		size_t PointSetCount() const { return _pointSets.size(); }
-		Plot2DPointSet &GetPointSet(size_t index) { return *_pointSets[index]; }
-		const Plot2DPointSet &GetPointSet(size_t index) const { return *_pointSets[index]; }
-		virtual void Render(Gtk::DrawingArea &drawingArea);
-		void SetIncludeZeroYAxis(bool includeZeroAxis)
-		{
-			_system.SetIncludeZeroYAxis(includeZeroAxis);
-			if(includeZeroAxis)
-				_logarithmicYAxis = false;
-		}
-		void SetLogarithmicYAxis(bool logarithmicYAxis)
-		{
-			_logarithmicYAxis = logarithmicYAxis;
-			if(_logarithmicYAxis)
-				_system.SetIncludeZeroYAxis(false);
-		}
-		bool LogarithmicYAxis() const
-		{
-			return _logarithmicYAxis;
-		}
-		void SetVRangeDetermination(enum RangeDetermination range) {
-			_vRangeDetermination = range;
-		}
-		enum RangeDetermination VRangeDetermination() const
-		{
-			return _vRangeDetermination;
-		}
-		void SetMaxY(double maxY)
-		{
-			_vRangeDetermination = SpecifiedRange;
-			_specifiedMaxY = maxY;
-		}
-		double MaxY() const
-		{
-			if(_vRangeDetermination == SpecifiedRange)
-				return _specifiedMaxY;
-			else if(_pointSets.empty())
-				return 1.0;
-			else
-				return _system.YRangeMax(**_pointSets.begin());
-		}
-		double MaxPositiveY() const
-		{
-			if(_vRangeDetermination == SpecifiedRange)
-				return _specifiedMaxY;
-			else if(_pointSets.empty())
-				return 1.0;
-			else
-				return _system.YRangePositiveMax(**_pointSets.begin());
-		}
-		void SetMinY(double minY)
-		{
-			_vRangeDetermination = SpecifiedRange;
-			_specifiedMinY = minY;
-		}
-		double MinY() const
-		{
-			if(_vRangeDetermination == SpecifiedRange)
-				return _specifiedMinY;
-			else if(_pointSets.empty())
-				return -1.0;
-			else
-				return _system.YRangeMin(**_pointSets.begin());
-		}
-		double MinPositiveY() const
-		{
-			if(_vRangeDetermination == SpecifiedRange)
-				return _specifiedMinY;
-			else if(_pointSets.empty())
-				return 0.1;
-			else
-				return _system.YRangePositiveMin(**_pointSets.begin());
-		}
-		void SetShowAxes(bool showAxes) {
-			_showAxes = showAxes;
-		}
-		bool ShowAxes() const {
-			return _showAxes;
-		}
-		void SetShowAxisDescriptions(bool showAxisDescriptions) {
-			_showAxisDescriptions = showAxisDescriptions;
-		}
-		bool ShowAxisDescriptions() const {
-			return _showAxisDescriptions;
-		}
-		void SetTitle(const std::string &title) { }
-		void SavePdf(const std::string &filename);
-		void SaveSvg(const std::string &filename);
-		void SavePng(const std::string &filename);
-	private:
-		void render(Cairo::RefPtr<Cairo::Context> cr);
-		void render(Cairo::RefPtr<Cairo::Context> cr, Plot2DPointSet &pointSet);
-
-		HorizontalPlotScale _horizontalScale;
-		VerticalPlotScale _verticalScale;
-		std::vector<Plot2DPointSet*> _pointSets;
-		int _width, _height;
-		double _topMargin;
-		System _system;
-		bool _logarithmicYAxis, _showAxes, _showAxisDescriptions;
-		double _specifiedMinY, _specifiedMaxY;
-		enum RangeDetermination _vRangeDetermination;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/plot/plot2dpointset.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/plot/plot2dpointset.h
deleted file mode 100644
index 23ff04be024524d62905fae987a00920d72ce804..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/plot/plot2dpointset.h
+++ /dev/null
@@ -1,231 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef PLOT2DPOINTSET_H
-#define PLOT2DPOINTSET_H
-
-#include <algorithm>
-#include <limits>
-#include <string>
-#include <vector>
-
-#include "../../msio/types.h"
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class Plot2DPointSet{
-	public:
-		Plot2DPointSet() :
-			_rotateUnits(false)
-		{ }
-		~Plot2DPointSet() { }
-		
-		enum DrawingStyle { DrawLines, DrawPoints, DrawColumns };
-
-		void SetLabel(const std::string &label) { _label = label; }
-		const std::string &Label() const { return _label; }
-		
-		void SetXIsTime(const bool xIsTime) { _xIsTime = xIsTime; }
-		bool XIsTime() const { return _xIsTime; }
-		
-		const std::string XUnits() const { return _xDesc; }
-		const std::string YUnits() const { return _yDesc; }
-
-		const std::string &XDesc() const { return _xDesc; }
-		void SetXDesc(std::string xDesc) { _xDesc = xDesc; }
-
-		const std::string &YDesc() const { return _yDesc; }
-		void SetYDesc(std::string yDesc) { _yDesc = yDesc; }
-
-		enum DrawingStyle DrawingStyle() const { return _drawingStyle; }
-		void SetDrawingStyle(enum DrawingStyle drawingStyle) { _drawingStyle = drawingStyle; }
-
-		void Clear()
-		{
-			_points.clear();
-		}
-
-		void PushDataPoint(double x, double y)
-		{
-			_points.push_back(Point2D(x,y));
-		}
-		double GetX(size_t index) const { return _points[index].x; }
-		double GetY(size_t index) const { return _points[index].y; }
-		size_t Size() const { return _points.size(); }
-
-		double MaxX() const
-		{
-			if(_points.empty())
-				return std::numeric_limits<double>::quiet_NaN();
-			double max = std::numeric_limits<double>::quiet_NaN();
-			for(std::vector<Point2D>::const_iterator i = _points.begin();i!=_points.end();++i)
-			{
-				if((i->x > max || (!std::isfinite(max))) && std::isfinite(i->x) ) max = i->x;
-			}
-			return max;
-		}
-		double MinX() const
-		{
-			if(_points.empty())
-				return std::numeric_limits<double>::quiet_NaN();
-			double min = std::numeric_limits<double>::quiet_NaN();
-			for(std::vector<Point2D>::const_iterator i = _points.begin();i!=_points.end();++i)
-			{
-				if((i->x < min || (!std::isfinite(min))) && std::isfinite(i->x) ) min = i->x;
-			}
-			return min;
-		}
-		double MaxY() const
-		{
-			if(_points.empty())
-				return std::numeric_limits<double>::quiet_NaN();
-			double max = std::numeric_limits<double>::quiet_NaN();
-			for(std::vector<Point2D>::const_iterator i = _points.begin();i!=_points.end();++i)
-			{
-				if((i->y > max || (!std::isfinite(max))) && std::isfinite(i->y) ) max = i->y;
-			}
-			return max;
-		}
-		double MaxPositiveY() const
-		{
-			double max = 0.0;
-			for(std::vector<Point2D>::const_iterator i = _points.begin();i!=_points.end();++i)
-			{
-				if((i->y > max) && std::isfinite(i->y)) max = i->y;
-			}
-			if(max == 0.0)
-				return std::numeric_limits<double>::quiet_NaN();
-			else
-				return max;
-		}
-		double MinY() const
-		{
-			if(_points.empty())
-				return std::numeric_limits<double>::quiet_NaN();
-			double min = std::numeric_limits<double>::quiet_NaN();
-			for(std::vector<Point2D>::const_iterator i = _points.begin();i!=_points.end();++i)
-			{
-				if((i->y < min || (!std::isfinite(min))) && std::isfinite(i->y) ) min = i->y;
-			}
-			return min;
-		}
-		double MinPositiveY() const
-		{
-			std::vector<Point2D>::const_iterator i;
-			double min = 0.0;
-			// Find first positive element
-			for(i = _points.begin();i!=_points.end();++i)
-			{
-				if((i->y > 0.0) && std::isfinite(i->y))
-				{
-					min = i->y;
-					break;
-				}
-			}
-			if(min == 0.0) return std::numeric_limits<double>::quiet_NaN();
-			for(;i!=_points.end();++i)
-			{
-				if((i->y > 0.0) && (i->y < min) && std::isfinite(i->y)) min = i->y;
-			}
-			return min;
-		}
-		void Sort()
-		{
-			std::sort(_points.begin(), _points.end());
-		}
-		double XRangeMin() const
-		{
-			if(_points.empty())
-				return 0.0;
-			else
-				return _points.begin()->x;
-		}
-		double XRangeMax() const
-		{
-			if(_points.empty())
-				return 1.0;
-			else
-				return _points.rbegin()->x;
-		}
-		double YRangeMin() const
-		{
-			return MinY();
-		}
-		double YRangePositiveMin() const
-		{
-			return MinPositiveY();
-		}
-		double YRangeMax() const
-		{
-			return MaxY();
-		}
-		double YRangePositiveMax() const
-		{
-			return MaxPositiveY();
-		}
-		void SetTickLabels(const std::vector<std::string> &tickLabels)
-		{
-			_tickLabels = tickLabels;
-		}
-		bool HasTickLabels() const
-		{
-			return !_tickLabels.empty();
-		}
-		const std::vector<std::string> &TickLabels() const
-		{
-			return _tickLabels;
-		}
-		void SetRotateUnits(bool rotateUnits)
-		{
-			_rotateUnits = rotateUnits;
-		}
-		bool RotateUnits() const
-		{
-			return _rotateUnits;
-		}
-		/**
-		 * Set the range that this point set minimally wants to have visualized. Other point sets might
-		 * request a larger range, which might enlarge this request.
-		 */
-		void SetYRange(double yMin, double yMax)
-		{
-		}
-	private:
-		struct Point2D
-		{
-			Point2D(double _x, double _y) : x(_x), y(_y) { }
-			double x, y;
-			bool operator<(const Point2D &other) const
-			{
-				return x < other.x;
-			}
-		};
-
-		std::vector<Point2D> _points;
-		std::string _label;
-		std::string _xDesc;
-		std::string _yDesc;
-		bool _xIsTime;
-		std::vector<std::string> _tickLabels;
-		bool _rotateUnits;
-		enum DrawingStyle _drawingStyle;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/plot/plotable.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/plot/plotable.h
deleted file mode 100644
index b791283740635a3f9451aeb2ed5619bfe903a671..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/plot/plotable.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#ifndef PLOT_PLOT2D_H
-#define PLOT_PLOT2D_H
-
-class Plotable
-{
-	public:
-		virtual ~Plotable() { }
-		virtual void Render(Gtk::DrawingArea &drawingArea) = 0;
-};
-
-#endif // PLOT_PLOT2D_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/plot/plotmanager.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/plot/plotmanager.h
deleted file mode 100644
index 19934faf02b7cf1d8e66413da2928081e98b707e..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/plot/plotmanager.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#ifndef PLOTMANAGER_H
-#define PLOTMANAGER_H
-
-#include <boost/function.hpp>
-
-#include <map>
-
-#include "plot2d.h"
-
-class PlotManager
-{
-	public:
-		Plot2D &NewPlot2D(const std::string &plotName)
-		{
-			Plot2D *plot = new Plot2D();
-			_items.push_back(plot);
-			return *plot;
-		}
-		
-		Plot2D &NewPlot2D()
-		{
-			return NewPlot2D("");
-		}
-		
-		void Update() { _onUpdate(); }
-		
-		boost::function<void()> &OnUpdate() { return _onUpdate; }
-		
-		const std::vector<Plot2D*> Items() const { return _items; }
-	private:
-		std::vector<Plot2D*> _items;
-		
-		boost::function<void()> _onUpdate;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/plot/plotpropertieswindow.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/plot/plotpropertieswindow.h
deleted file mode 100644
index 75e5a089017bfa8613585bc4c12db378af2b59d5..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/plot/plotpropertieswindow.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef PLOTPROPERTIESWINDOW_H
-#define PLOTPROPERTIESWINDOW_H
-
-#include <string>
-
-#include <gtkmm/box.h>
-#include <gtkmm/button.h>
-#include <gtkmm/buttonbox.h>
-#include <gtkmm/checkbutton.h>
-#include <gtkmm/entry.h>
-#include <gtkmm/image.h>
-#include <gtkmm/label.h>
-#include <gtkmm/frame.h>
-#include <gtkmm/radiobutton.h>
-#include <gtkmm/scale.h>
-#include <gtkmm/window.h>
-
-#include <boost/function.hpp>
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class PlotPropertiesWindow : public Gtk::Window {
-	public:
-		PlotPropertiesWindow(class Plot2D &plot, const std::string &title);
-		~PlotPropertiesWindow() { }
-		
-		boost::function<void()> OnChangesApplied;
-	private:
-		void onApplyClicked();
-		void onCloseClicked();
-		void onExportClicked();
-		
-		void onVRangeChanged()
-		{
-			_vRangeMinEntry.set_sensitive(_specifiedVRangeButton.get_active());
-			_vRangeMaxEntry.set_sensitive(_specifiedVRangeButton.get_active());
-		}
-		
-		void onHRangeChanged()
-		{
-			_hRangeMinEntry.set_sensitive(!_automaticHRangeButton.get_active());
-			_hRangeMaxEntry.set_sensitive(!_automaticHRangeButton.get_active());
-		}
-		
-		void initVRangeWidgets();
-		void initHRangeWidgets();
-		void initOptionsWidgets();
-		
-		void updateMinMaxEntries();
-
-		class Plot2D &_plot;
-
-		Gtk::HButtonBox _bottomButtonBox;
-		Gtk::VBox _topVBox;
-		Gtk::HBox _framesHBox;
-		
-		Gtk::Button _applyButton, _exportButton, _closeButton;
-		Gtk::Image _saveImage;
-		
-		Gtk::Frame _vRangeFrame;
-		Gtk::VBox _vRangeBox;
-		Gtk::RadioButton _minMaxVRangeButton, _winsorizedVRangeButton, _specifiedVRangeButton;
-		Gtk::Label _vRangeMinLabel, _vRangeMaxLabel;
-		Gtk::Entry _vRangeMinEntry, _vRangeMaxEntry;
-		
-		Gtk::Frame _hRangeFrame;
-		Gtk::HBox _hRangeBox;
-		Gtk::CheckButton _automaticHRangeButton;
-		Gtk::Label _hRangeMinLabel, _hRangeMaxLabel;
-		Gtk::Entry _hRangeMinEntry, _hRangeMaxEntry;
-		
-		Gtk::Frame _optionsFrame;
-		Gtk::VBox _optionsBox;
-		Gtk::RadioButton _normalOptionsButton, _logScaleButton, _zeroSymmetricButton;
-		
-		Gtk::CheckButton _showAxes, _showAxisDescriptionsButton;
-};
-
-#endif // PLOTPROPERTIESWINDOW_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/plot/plotwidget.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/plot/plotwidget.h
deleted file mode 100644
index 59f76c10bc23b7de94a6dd1a0a038ad74d313b80..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/plot/plotwidget.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef PLOTWIDGET_H
-#define PLOTWIDGET_H
-
-#include <gtkmm/drawingarea.h>
-
-#include "plotable.h"
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class PlotWidget : public Gtk::DrawingArea {
-	public:
-		PlotWidget() : _plot(0)
-		{
-			signal_expose_event().connect(sigc::mem_fun(*this, &PlotWidget::onExposeEvent) );
-		}
-		
-		~PlotWidget()
-		{
-		}
-
-		Plotable &Plot() const
-		{
-			return *_plot; 
-		}
-		void SetPlot(Plotable &plot)
-		{
-			_plot = &plot;
-			redraw();
-		}
-		void Clear()
-		{
-			_plot = 0;
-		}
-		void Update()
-		{
-			redraw();
-		}
-	private:
-		Plotable *_plot;
-
-		bool onExposeEvent(GdkEventExpose *)
-		{
-			redraw();
-			return true;
-		}
-
-		void redraw()
-		{
-			if(_plot != 0)
-				_plot->Render(*this);
-		}
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/plot/system.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/plot/system.h
deleted file mode 100644
index 4e70209f2e4d2c73e9f8297cd1a4da057eddf554..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/plot/system.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef SYSTEM_H
-#define SYSTEM_H
-
-#include <map>
-#include <string>
-
-#include "dimension.h"
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class System {
-	public:
-		System() : _includeZeroYAxis(false)
-		{
-		}
-
-		~System()
-		{
-			Clear();
-		}
-
-		void AddToSystem(class Plot2DPointSet &pointSet)
-		{
-			Dimension *dimension;
-			if(_dimensions.count(pointSet.YUnits()) == 0)
-			{
-				dimension = new Dimension();
-				_dimensions.insert(std::pair<std::string, Dimension*>(pointSet.YUnits(), dimension));
-			} else {
-				dimension = _dimensions.find(pointSet.YUnits())->second;
-			}
-			dimension->AdjustRanges(pointSet);
-		}
-
-		double XRangeMin(class Plot2DPointSet &pointSet) const
-		{
-			return _dimensions.find(pointSet.YUnits())->second->XRangeMin();
-		}
-		double XRangeMax(class Plot2DPointSet &pointSet) const
-		{
-			return _dimensions.find(pointSet.YUnits())->second->XRangeMax();
-		}
-		double YRangeMin(class Plot2DPointSet &pointSet) const
-		{
-			const double yMin = _dimensions.find(pointSet.YUnits())->second->YRangeMin();
-			if(yMin > 0.0 && _includeZeroYAxis)
-				return 0.0;
-			else
-				return yMin;
-		}
-		double YRangePositiveMin(class Plot2DPointSet &pointSet) const
-		{
-			return _dimensions.find(pointSet.YUnits())->second->YRangePositiveMin();
-		}
-		double YRangeMax(class Plot2DPointSet &pointSet) const
-		{
-			const double yMax = _dimensions.find(pointSet.YUnits())->second->YRangeMax();
-			if(yMax < 0.0 && _includeZeroYAxis)
-				return 0.0;
-			else
-				return yMax;
-		}
-		double YRangePositiveMax(class Plot2DPointSet &pointSet) const
-		{
-			return _dimensions.find(pointSet.YUnits())->second->YRangePositiveMax();
-		}
-		void Clear()
-		{
-			for(std::map<std::string, Dimension*>::iterator i=_dimensions.begin();i!=_dimensions.end();++i)
-				delete i->second;
-			_dimensions.clear();
-		}
-		void SetIncludeZeroYAxis(bool includeZeroYAxis) { _includeZeroYAxis = includeZeroYAxis; }
-	private:
-		std::map<std::string, Dimension*> _dimensions;
-		bool _includeZeroYAxis;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/plot/tickset.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/plot/tickset.h
deleted file mode 100644
index 7d08bf76000566b6ad208a5cae2d7874ad93181a..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/plot/tickset.h
+++ /dev/null
@@ -1,494 +0,0 @@
-
-#include <string>
-#include <vector>
-#include <cmath>
-#include <sstream>
-
-#include <AOFlagger/msio/date.h>
-
-#include <AOFlagger/util/aologger.h>
-
-typedef std::pair<double, std::string> Tick;
-
-class TickSet
-{
-	public:
-		TickSet()
-		{
-		}
-		virtual ~TickSet()
-		{
-		}
-		
-		virtual unsigned Size() const = 0;
-		virtual Tick GetTick(unsigned i) const = 0;
-		
-		virtual void DecreaseTicks()
-		{
-			if(Size() > 1)
-			{
-				Set(Size() - 1);
-			}
-		}
-		virtual void Set(unsigned maxSize) = 0;
-		virtual void Reset() = 0;
-	protected:
-	private:
-		
-};
-
-class NumericTickSet : public TickSet
-{
-	public:
-		NumericTickSet(double min, double max, unsigned sizeRequest) : _min(min), _max(max), _sizeRequest(sizeRequest)
-		{
-			set(sizeRequest);
-		}
-		
-		virtual unsigned Size() const
-		{
-			return _ticks.size();
-		}
-		
-		virtual Tick GetTick(unsigned i) const
-		{
-			std::stringstream tickStr;
-			tickStr << _ticks[i];
-			return Tick((_ticks[i] - _min) / (_max - _min), tickStr.str());
-		}
-		
-		virtual void Reset()
-		{
-			_ticks.clear();
-			set(_sizeRequest);
-		}
-		
-		virtual void Set(unsigned maxSize)
-		{
-			_ticks.clear();
-			set(maxSize);
-		}
-	private:
-		void set(unsigned sizeRequest)
-		{
-			if(_max == _min)
-				_ticks.push_back(_min);
-			else
-			{
-				if(sizeRequest == 0)
-					return;
-				double tickWidth = roundUpToNiceNumber(fabs(_max - _min) / (double) sizeRequest);
-				if(tickWidth == 0.0)
-					tickWidth = 1.0;
-				if(_min < _max)
-				{
-					double pos = roundUpToNiceNumber(_min, tickWidth);
-					while(pos <= _max)
-					{
-						if(fabs(pos) < tickWidth/100.0)
-							_ticks.push_back(0.0);
-						else
-							_ticks.push_back(pos);
-						pos += tickWidth;
-					}
-				} else {
-					double pos = -roundUpToNiceNumber(-_min, tickWidth);
-					while(pos >= _max)
-					{
-						if(fabs(pos) < tickWidth/100.0)
-							_ticks.push_back(0.0);
-						else
-							_ticks.push_back(pos);
-						pos -= tickWidth;
-					}
-				}
-				while(_ticks.size() > sizeRequest)
-					_ticks.pop_back();
-			}
-		}
-		
-		double roundUpToNiceNumber(double number)
-		{
-			if(!std::isfinite(number))
-				return number;
-			double roundedNumber = 1.0;
-			if(number <= 0.0)
-			{
-				if(number == 0.0)
-					return 0.0;
-				else
-				{
-					roundedNumber = -1.0;
-					number *= -1.0;
-				}
-			}
-			while(number > 10)
-			{
-				number /= 10;
-				roundedNumber *= 10;
-			}
-			while(number <= 1)
-			{
-				number *= 10;
-				roundedNumber /= 10;
-			}
-			if(number <= 2) return roundedNumber * 2;
-			else if(number <= 5) return roundedNumber * 5;
-			else return roundedNumber * 10;
-		}
-		double roundUpToNiceNumber(double number, double roundUnit)
-		{
-			return roundUnit * ceil(number / roundUnit);
-		}
-		
-		double _min, _max;
-		unsigned _sizeRequest;
-		std::vector<double> _ticks;
-};
-
-class LogarithmicTickSet : public TickSet
-{
-	public:
-		LogarithmicTickSet(double min, double max, unsigned sizeRequest) : _min(min), _minLog10(log10(min)), _max(max), _maxLog10(log10(max)), _sizeRequest(sizeRequest)
-		{
-			set(sizeRequest);
-		}
-		
-		virtual unsigned Size() const
-		{
-			return _ticks.size();
-		}
-		
-		virtual Tick GetTick(unsigned i) const
-		{
-			std::stringstream tickStr;
-			tickStr << _ticks[i];
-			return Tick((log10(_ticks[i]) - _minLog10) / (_maxLog10 - _minLog10), tickStr.str());
-		}
-		
-		virtual void Reset()
-		{
-			_ticks.clear();
-			set(_sizeRequest);
-		}
-		
-		virtual void Set(unsigned maxSize)
-		{
-			_ticks.clear();
-			set(maxSize);
-		}
-	private:
-		void set(unsigned sizeRequest)
-		{
-			if(_max == _min)
-				_ticks.push_back(_min);
-			else
-			{
-				if(sizeRequest == 0)
-					sizeRequest = 1;
-				const double
-					tickStart = roundUpToBase10Number(_min*0.999),
-					tickEnd = roundDownToBase10Number(_max*1.001);
-				_ticks.push_back(tickStart);
-				if(sizeRequest == 1)
-					return;
-				if(tickEnd > tickStart)
-				{
-					const unsigned distance = (unsigned) log10(tickEnd / tickStart);
-					const unsigned step = (distance + sizeRequest - 1) / sizeRequest;
-					const double factor = exp10((double) step);
-					double pos = tickStart * factor;
-					while(pos <= tickEnd && _ticks.size() < sizeRequest)
-					{
-						_ticks.push_back(pos);
-						pos *= factor;
-					}
-				}
-				// can we add two to nine?
-				if((_ticks.size()+1)*10 < sizeRequest)
-				{
-					double base = tickStart / 10.0;
-					do {
-						for(double i=2.0;i<9.5;++i)
-						{
-							double val = base * i;
-							if(val >= _min && val <= _max)
-								_ticks.push_back(val);
-						}
-						base *= 10.0;
-					} while(base < _max);
-				}
-				// can we add two, four, ... eight?
-				else if((_ticks.size()+1)*5 < sizeRequest)
-				{
-					double base = tickStart / 10.0;
-					do {
-						for(double i=2.0;i<9.0;i+=2.0)
-						{
-							double val = base * i;
-							if(val >= _min && val <= _max)
-								_ticks.push_back(val);
-						}
-						base *= 10.0;
-					} while(base < _max);
-				}
-				// can we add two and five?
-				else if((_ticks.size()+1)*3 < sizeRequest)
-				{
-					double base = tickStart / 10.0;
-					do {
-						for(double i=2.0;i<6.0;i+=3.0)
-						{
-							double val = base * i;
-							if(val >= _min && val <= _max)
-								_ticks.push_back(val);
-						}
-						base *= 10.0;
-					} while(base < _max);
-				}
-				// can we add two and five?
-				else if((_ticks.size()+1)*3 < sizeRequest)
-				{
-					double base = tickStart / 10.0;
-					do {
-						for(double i=2.0;i<6.0;i+=3.0)
-						{
-							double val = base * i;
-							if(val >= _min && val <= _max)
-								_ticks.push_back(val);
-						}
-						base *= 10.0;
-					} while(base < _max);
-				}
-				// can we add five?
-				else if((_ticks.size()+1)*2 < sizeRequest)
-				{
-					double base = tickStart / 10.0;
-					do {
-						double val = base * 5.0;
-						if(val >= _min && val <= _max)
-							_ticks.push_back(val);
-						base *= 10.0;
-					} while(base < _max);
-				}
-				std::sort(_ticks.begin(), _ticks.end());
-			}
-		}
-		
-		double roundUpToBase10Number(double number) const
-		{
-			if(!std::isfinite(number))
-				return number;
-			const double l = log10(number);
-			return exp10(ceil(l));
-		}
-		
-		double roundDownToBase10Number(double number) const
-		{
-			if(!std::isfinite(number))
-				return number;
-			const double l = log10(number);
-			return exp10(floor(l));
-		}
-		
-		double roundUpToNiceNumber(double number, double roundUnit) const
-		{
-			return roundUnit * ceil(number / roundUnit);
-		}
-		
-		double _min, _minLog10, _max, _maxLog10;
-		unsigned _sizeRequest;
-		std::vector<double> _ticks;
-};
-
-class TimeTickSet : public TickSet
-{
-	public:
-		TimeTickSet(double minTime, double maxTime, unsigned sizeRequest) : _min(minTime), _max(maxTime), _sizeRequest(sizeRequest)
-		{
-			set(sizeRequest);
-		}
-		
-		virtual unsigned Size() const
-		{
-			return _ticks.size();
-		}
-		
-		virtual Tick GetTick(unsigned i) const
-		{
-			double val = _ticks[i];
-			return Tick((val - _min) / (_max - _min), Date::AipsMJDToTimeString(val));
-		}
-		
-		virtual void Reset()
-		{
-			_ticks.clear();
-			set(_sizeRequest);
-		}
-		
-		virtual void Set(unsigned maxSize)
-		{
-			_ticks.clear();
-			set(maxSize);
-		}
-	private:
-		void set(unsigned sizeRequest)
-		{
-			if(_max == _min)
-				_ticks.push_back(_min);
-			else
-			{
-				if(sizeRequest == 0)
-					return;
-			double tickWidth = calculateTickWidth((_max - _min) / (double) sizeRequest);
-				if(tickWidth == 0.0)
-					tickWidth = 1.0;
-				double
-					pos = roundUpToNiceNumber(_min, tickWidth);
-				while(pos < _max)
-				{
-					_ticks.push_back(pos);
-					pos += tickWidth;
-				}
-				while(_ticks.size() > sizeRequest)
-					_ticks.pop_back();
-			}
-		}
-		
-		double calculateTickWidth(double lowerLimit) const
-		{
-			// number is in units of seconds
-			
-			// In days?
-			if(lowerLimit >= 60.0*60.0*24.0)
-			{
-				double width = 60.0*60.0*24.0;
-				while(width < lowerLimit)
-					width *= 2.0;
-				return width;
-			}
-			// in hours?
-			else if(lowerLimit > 60.0*30.0)
-			{
-				if(lowerLimit <= 60.0*60.0)
-					return 60.0*60.0; // hours
-				else if(lowerLimit <= 60.0*60.0*2.0)
-					return 60.0*60.0*2.0; // two hours
-				else if(lowerLimit <= 60.0*60.0*3.0)
-					return 60.0*60.0*3.0; // three hours
-				else if(lowerLimit <= 60.0*60.0*4.0)
-					return 60.0*60.0*4.0; // four hours
-				else if(lowerLimit <= 60.0*60.0*6.0)
-					return 60.0*60.0*6.0; // six hours
-				else
-					return 60.0*60.0*12.0; // twelve hours
-			}
-			// in minutes?
-			else if(lowerLimit > 30.0)
-			{
-				if(lowerLimit <= 60.0)
-					return 60.0; // in minutes
-				else if(lowerLimit <= 60.0*2.0)
-					return 60.0*2.0; // two minutes
-				else if(lowerLimit <= 60.0*5.0)
-					return 60.0*5.0; // five minutes
-				else if(lowerLimit <= 60.0*10.0)
-					return 60.0*10.0; // ten minutes
-				else if(lowerLimit <= 60.0*15.0)
-					return 60.0*15.0; // quarter hours
-				else
-					return 60.0*30.0; // half hours
-			}
-			// in seconds?
-			else if(lowerLimit > 0.5)
-			{
-				if(lowerLimit <= 1.0)
-					return 1.0; // in seconds
-				else if(lowerLimit <= 2.0)
-					return 2.0; // two seconds
-				else if(lowerLimit <= 5.0)
-					return 5.0; // five seconds
-				else if(lowerLimit <= 10.0)
-					return 10.0; // ten seconds
-				else if(lowerLimit <= 15.0)
-					return 15.0; // quarter minute
-				else
-					return 30.0; // half a minute
-			}
-			else if(lowerLimit == 0.0)
-				return 0.0;
-			// in 10th of seconds or lower?
-			else
-			{
-				double factor = 1.0;
-				while(lowerLimit < 0.1)
-				{
-					factor *= 0.1;
-					lowerLimit *= 10.0;
-				}
-				if(lowerLimit <= 0.1)
-					return 0.1 * factor;
-				else if(lowerLimit <= 0.2)
-					return 0.2 * factor;
-				else
-					return 0.5 * factor;
-			}
-		}
-		
-		double roundUpToNiceNumber(double number, double roundUnit)
-		{
-			return roundUnit * ceil(number / roundUnit);
-		}
-		
-		double _min, _max;
-		unsigned _sizeRequest;
-		std::vector<double> _ticks;
-};
-
-class TextTickSet : public TickSet
-{
-	public:
-		TextTickSet(const std::vector<std::string> &labels, unsigned sizeRequest) : _sizeRequest(sizeRequest), _labels(labels)
-		{
-			set(sizeRequest);
-		}
-		
-		virtual unsigned Size() const
-		{
-			return _ticks.size();
-		}
-		
-		virtual Tick GetTick(unsigned i) const
-		{
-			const size_t labelIndex = _ticks[i];
-			const double val = (_labels.size() == 1) ? 0.5 : (double) labelIndex / (double) (_labels.size() - 1);
-			return Tick(val, _labels[labelIndex]);
-		}
-		
-		virtual void Reset()
-		{
-			_ticks.clear();
-			set(_sizeRequest);
-		}
-		
-		virtual void Set(unsigned maxSize)
-		{
-			_ticks.clear();
-			set(maxSize);
-		}
-	private:
-		void set(unsigned sizeRequest)
-		{
-			if(sizeRequest > _labels.size())
-				sizeRequest = _labels.size();
-			const unsigned stepSize =
-				(unsigned) ceil((double) _labels.size() / (double) sizeRequest);
-			
-			for(size_t tick=0;tick<_labels.size();tick += stepSize)
-				_ticks.push_back(tick);
-		}
-		
-		unsigned _sizeRequest;
-		std::vector<std::string> _labels;
-		std::vector<size_t> _ticks;
-};
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/plot/verticalplotscale.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/plot/verticalplotscale.h
deleted file mode 100644
index 05dc9083c8c7e9727c5f12ba17ce2117bdc17389..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/plot/verticalplotscale.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef VERTICALPLOTSCALE_H
-#define VERTICALPLOTSCALE_H
-
-#include <string>
-#include <vector>
-
-#include <gtkmm/drawingarea.h>
-
-#include <AOFlagger/gui/plot/tickset.h>
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class VerticalPlotScale {
-	public:
-		VerticalPlotScale();
-		virtual ~VerticalPlotScale();
-		void SetPlotDimensions(double plotWidth, double plotHeight, double topMargin)
-		{
-			_plotWidth = plotWidth;
-			_plotHeight = plotHeight;
-			_topMargin = topMargin;
-			_metricsAreInitialized = false;
-		}
-		
-		double GetWidth(Cairo::RefPtr<Cairo::Context> cairo)
-		{
-			initializeMetrics(cairo);
-			return _width;
-		}
-		
-		double GetTextHeight(Cairo::RefPtr<Cairo::Context> cairo);
-		
-		void SetDrawWithDescription(bool drawWithDescription)
-		{
-			_drawWithDescription = drawWithDescription;
-			_metricsAreInitialized = false;
-		}
-		void SetUnitsCaption(const std::string &caption)
-		{
-			_unitsCaption = caption;
-			_metricsAreInitialized = false;
-		}
-		void SetDescriptionFontSize(double fontSize)
-		{
-			_tickValuesFontSize = fontSize;
-			_metricsAreInitialized = false;
-		}
-		void SetTickValuesFontSize(double fontSize)
-		{
-			_tickValuesFontSize = fontSize;
-			_metricsAreInitialized = false;
-		}
-		
-		void Draw(Cairo::RefPtr<Cairo::Context> cairo, double offsetX=0.0, double offsetY=0.0);
-		void InitializeNumericTicks(double min, double max);
-		void InitializeLogarithmicTicks(double min, double max);
-	private:
-		void drawUnits(Cairo::RefPtr<Cairo::Context> cairo, double offsetX, double offsetY);
-		bool ticksFit(Cairo::RefPtr<Cairo::Context> cairo);
-		void initializeMetrics(Cairo::RefPtr<Cairo::Context> cairo); 
-		double getTickYPosition(const Tick &tick);
-
-		double _plotWidth, _plotHeight, _topMargin;
-		bool _metricsAreInitialized;
-		double _width;
-		class TickSet *_tickSet;
-		bool _isLogarithmic;
-		bool _drawWithDescription;
-		std::string _unitsCaption;
-		double _descriptionFontSize;
-		double _tickValuesFontSize;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/plotframe.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/plotframe.h
deleted file mode 100644
index ef21fdec22b41f4180a8e2f75a18889394e3209c..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/plotframe.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef PLOTFRAME_H
-#define PLOTFRAME_H
-
-#include <gtkmm/box.h>
-
-#include "../msio/timefrequencydata.h"
-
-#include "plot/plotwidget.h"
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class PlotFrame : public Gtk::HBox {
-	public:
-		PlotFrame();
-		~PlotFrame();
-
-		void SetTimeFrequencyData(const TimeFrequencyData &data)
-		{
-			_data = data;
-		}
-		void SetSelectedSample(size_t x, size_t y)
-		{
-			_selectedXStart = x;
-			_selectedYStart = y;
-			_selectedXEnd = x+1;
-			_selectedYEnd = y+1;
-		}
-		void Update() { plot(); }
-	private:
-		TimeFrequencyData _data;
-		PlotWidget _plot;
-		class Plot2D *_plotData;
-
-		size_t _selectedXStart, _selectedYStart;
-		size_t _selectedXEnd, _selectedYEnd;
-
-		void plot();
-		void plotTimeGraph(const TimeFrequencyData &data, const std::string &label, enum PolarisationType polarisation);
-		void plotTimeGraph(const TimeFrequencyData &data, const std::string &label);
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/plotwindow.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/plotwindow.h
deleted file mode 100644
index 60e2e8f651b7b73bbfd8f5d8084c4f633386e6c2..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/plotwindow.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef PLOTWINDOW_H
-#define PLOTWINDOW_H
-
-#include <boost/bind/bind.hpp>
-
-#include <gtkmm/window.h>
-
-#include <AOFlagger/gui/plot/plotmanager.h>
-#include <AOFlagger/gui/plot/plotwidget.h>
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class PlotWindow : public Gtk::Window {
-	public:
-		PlotWindow(PlotManager &plotManager) : _plotManager(plotManager)
-		{
-			plotManager.OnUpdate() = boost::bind(&PlotWindow::handleUpdate, this);
-			add(_plotWidget);
-			_plotWidget.show();
-		}
-		~PlotWindow()
-		{
-		}
-		
-	private:
-		void handleUpdate()
-		{
-			const std::vector<Plot2D*> &plots = _plotManager.Items();
-			Plot2D &lastPlot = **plots.rbegin();
-			_plotWidget.SetPlot(lastPlot);
-			show();
-			raise();
-		}
-		
-		PlotWidget _plotWidget;
-		PlotManager &_plotManager;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/progresswindow.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/progresswindow.h
deleted file mode 100644
index 226a94ac5a67c89d5c675f605a87802907052496..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/progresswindow.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef PROGRESSWINDOW_H
-#define PROGRESSWINDOW_H
-
-#include <glibmm.h>
-
-#include <boost/thread/mutex.hpp>
-#include <boost/date_time/posix_time/posix_time_types.hpp>
-
-#include <gtkmm/box.h>
-#include <gtkmm/label.h>
-#include <gtkmm/progressbar.h>
-#include <gtkmm/window.h>
-
-#include "../types.h"
-
-#include "../util/progresslistener.h"
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class ProgressWindow : public Gtk::Window, public ProgressListener {
-	public:
-		ProgressWindow(class MSWindow &parentWindow);
-		~ProgressWindow();
-
-		virtual void OnStartTask(const rfiStrategy::Action &action, size_t taskNo, size_t taskCount, const std::string &description, size_t weight=1);
-		virtual void OnEndTask(const rfiStrategy::Action &action);
-		virtual void OnProgress(const rfiStrategy::Action &action, size_t progress, size_t maxProgress);
-		virtual void OnException(const rfiStrategy::Action &action, std::exception &thrownException);
-	private:
-		void UpdateProgress();
-		Glib::Dispatcher _progressChangeSignal;
-		boost::mutex _mutex;
-
-		Gtk::Label
-			_currentTaskTitleLabel, _currentTaskLabel,
-			_timeElapsedTitleLabel, _timeElapsedLabel,
-			_timeEstimatedTitleLabel, _timeEstimatedLabel;
-		
-		Gtk::VBox _topBox;
-		Gtk::ProgressBar _progressBar;
-
-		double _progressFraction;
-		std::vector<std::string> _tasks;
-		struct Ratio {
-			Ratio(size_t i, size_t c) : index(i), count(c) { }
-			size_t index, count;
-			};
-		std::vector<Ratio> _ratios;
-		boost::posix_time::ptime _startTime;
-		bool _started;
-		bool _exceptionOccured;
-		std::string _exceptionType;
-		std::string _exceptionDescription;
-
-		class MSWindow &_parentWindow;
-		double _progress;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/quality/antennaeplotpage.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/quality/antennaeplotpage.h
deleted file mode 100644
index 4aaef96f5b021d9af7f63b6441cba2afb06712cf..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/quality/antennaeplotpage.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef GUI_QUALITY__ANTENNAEPLOTPAGE_H
-#define GUI_QUALITY__ANTENNAEPLOTPAGE_H
-
-#include "twodimensionalplotpage.h"
-
-#include <AOFlagger/quality/statisticscollection.h>
-
-#include <AOFlagger/msio/measurementset.h>
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class AntennaePlotPage : public TwoDimensionalPlotPage {
-	protected:
-		virtual void processStatistics(class StatisticsCollection *statCollection, const std::vector<AntennaInfo> &antennas)
-		{
-			_antennas = antennas;
-			const BaselineStatisticsMap &map = statCollection->BaselineStatistics();
-			
-			vector<std::pair<unsigned, unsigned> > baselines = map.BaselineList();
-			for(vector<std::pair<unsigned, unsigned> >::const_iterator i=baselines.begin();i!=baselines.end();++i)
-			{
-				if(i->first != i->second)
-				{
-					const DefaultStatistics &stats = map.GetStatistics(i->first, i->second);
-					_statistics.insert(std::pair<double, DefaultStatistics>(i->first, stats));
-					_statistics.insert(std::pair<double, DefaultStatistics>(i->second, stats));
-				}
-			}
-		}
-		
-		virtual const std::map<double, class DefaultStatistics> &GetStatistics() const
-		{
-			return _statistics;
-		}
-		
-		virtual void StartLine(Plot2D &plot, const std::string &name, const std::string &yAxisDesc)
-		{
-			Plot2DPointSet &pointSet = plot.StartLine(name, "Antenna index", yAxisDesc, false, Plot2DPointSet::DrawColumns);
-			
-			std::vector<std::string> labels;
-			for(std::vector<AntennaInfo>::const_iterator i=_antennas.begin();i!=_antennas.end();++i)
-				labels.push_back(i->name);
-			pointSet.SetTickLabels(labels);
-			pointSet.SetRotateUnits(true);
-		}
-		
-	private:
-		std::map<double, DefaultStatistics> _statistics;
-		std::vector<AntennaInfo> _antennas;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/quality/aoqplotwindow.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/quality/aoqplotwindow.h
deleted file mode 100644
index 9de9824c103b18f338bc7f6f3d3bc51bc5264b27..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/quality/aoqplotwindow.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef AOQPLOT_WINDOW_H
-#define AOQPLOT_WINDOW_H
-
-#include <gtkmm/box.h>
-#include <gtkmm/main.h>
-#include <gtkmm/notebook.h>
-#include <gtkmm/statusbar.h>
-#include <gtkmm/window.h>
-
-#include <AOFlagger/gui/imagewidget.h>
-
-#include <AOFlagger/quality/qualitytablesformatter.h>
-
-#include "antennaeplotpage.h"
-#include "baselineplotpage.h"
-#include "blengthplotpage.h"
-#include "frequencyplotpage.h"
-#include "histogrampage.h"
-#include "openoptionswindow.h"
-#include "summarypage.h"
-#include "timefrequencyplotpage.h"
-#include "timeplotpage.h"
-
-#include <AOFlagger/msio/antennainfo.h>
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class AOQPlotWindow : public Gtk::Window {
-	public:
-		AOQPlotWindow();
-    virtual ~AOQPlotWindow()
-    { 
-			close();
-		}
-    
-		void Open(const std::string &filename);
-		void SetStatus(const std::string &newStatus)
-		{
-			onStatusChange(newStatus);
-		}
-	private:
-		void onOpenOptionsSelected(std::string filename, bool downsampleTime, bool downsampleFreq, size_t timeSize, size_t freqSize, bool correctHistograms);
-		void close();
-		void readStatistics(bool downsampleTime, bool downsampleFreq, size_t timeSize, size_t freqSize, bool correctHistograms);
-		void onHide()
-		{
-			Gtk::Main::quit();
-		}
-		void onStatusChange(const std::string &newStatus);
-		void onSwitchPage(GtkNotebookPage *page, guint pageNr)
-		{
-			switch(pageNr)
-			{
-				case 0: SetStatus("Baseline statistics"); break;
-				case 1: SetStatus("Antennae statistics"); break;
-				case 2: SetStatus("Baseline length statistics");  break;
-				case 3: SetStatus("Time statistics"); break;
-				case 4: SetStatus("Frequency statistics"); break;
-				case 5: SetStatus("Time-frequency statistics");  break;
-				case 6: SetStatus("Summary"); break;
-			}
-		}
-		void setShowHistograms(bool show)
-		{
-			_histogramPage.set_visible(show);
-		}
-		
-		Gtk::VBox _vBox;
-		Gtk::Notebook _notebook;
-		Gtk::Statusbar _statusBar;
-		
-		BaselinePlotPage _baselinePlotPage;
-		AntennaePlotPage _antennaePlotPage;
-		BLengthPlotPage  _bLengthPlotPage;
-		TimeFrequencyPlotPage _timeFrequencyPlotPage;
-		TimePlotPage _timePlotPage;
-		FrequencyPlotPage _frequencyPlotPage;
-		SummaryPage _summaryPage;
-		HistogramPage _histogramPage;
-		
-		OpenOptionsWindow _openOptionsWindow;
-
-		bool _isOpen;
-		std::string _filename;
-		class StatisticsCollection *_statCollection;
-		class HistogramCollection *_histCollection;
-		class StatisticsCollection *_fullStats;
-		std::vector<class AntennaInfo> _antennas;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/quality/baselineplotpage.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/quality/baselineplotpage.h
deleted file mode 100644
index cc0250679207517d124fedae37f0c78309d45591..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/quality/baselineplotpage.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef GUI_QUALITY__BASELINEPLOTPAGE_H
-#define GUI_QUALITY__BASELINEPLOTPAGE_H
-
-#include <gtkmm/box.h>
-#include <gtkmm/window.h>
-#include <gtkmm/frame.h>
-#include <gtkmm/radiobutton.h>
-
-#include <AOFlagger/gui/imagewidget.h>
-
-#include <AOFlagger/quality/qualitytablesformatter.h>
-
-#include "grayscaleplotpage.h"
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class BaselinePlotPage : public GrayScalePlotPage {
-	public:
-		BaselinePlotPage();
-    virtual ~BaselinePlotPage();
-		
-		sigc::signal<void, const std::string &> SignalStatusChange() { return _signalStatusChange; }
-		
-		void SetStatistics(class StatisticsCollection *statCollection, const std::vector<class AntennaInfo> &antennas)
-		{
-			_statCollection = statCollection;
-			_antennas = &antennas;
-			UpdateImage();
-		}
-		void CloseStatistics()
-		{
-			_statCollection = 0;
-			_antennas = 0;
-		}
-		bool HasStatistics() const
-		{
-			return _statCollection != 0;
-		}
-	protected:
-		virtual std::pair<TimeFrequencyData, TimeFrequencyMetaDataCPtr> ConstructImage();
-	private:
-		void onMouseMoved(size_t x, size_t y);
-		
-		class StatisticsCollection *_statCollection;
-		const std::vector<class AntennaInfo> *_antennas;
-		
-		sigc::signal<void, const std::string &> _signalStatusChange;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/quality/blengthplotpage.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/quality/blengthplotpage.h
deleted file mode 100644
index 290d9474d595674429d633b6b5299fbf7f25cdcd..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/quality/blengthplotpage.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef GUI_QUALITY__BLENGTHPLOTPAGE_H
-#define GUI_QUALITY__BLENGTHPLOTPAGE_H
-
-#include "twodimensionalplotpage.h"
-
-#include <AOFlagger/quality/statisticscollection.h>
-
-#include <AOFlagger/msio/measurementset.h>
-
-#include <AOFlagger/remote/clusteredobservation.h>
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class BLengthPlotPage : public TwoDimensionalPlotPage {
-	public:
-    BLengthPlotPage() :
-			_includeAutoCorrelationsButton("Auto-correlations")
-		{
-		}
-	protected:
-		virtual void processStatistics(class StatisticsCollection *statCollection, const std::vector<AntennaInfo> &antennas)
-		{
-			_statisticsWithAutocorrelations.clear();
-			_statisticsWithoutAutocorrelations.clear();
-			
-			const BaselineStatisticsMap &map = statCollection->BaselineStatistics();
-			
-			vector<std::pair<unsigned, unsigned> > baselines = map.BaselineList();
-			for(vector<std::pair<unsigned, unsigned> >::const_iterator i=baselines.begin();i!=baselines.end();++i)
-			{
-				Baseline bline(antennas[i->first], antennas[i->second]);
-				const DefaultStatistics &statistics = map.GetStatistics(i->first, i->second);
-				_statisticsWithAutocorrelations.insert(std::pair<double, DefaultStatistics>(bline.Distance(), statistics));
-				if(i->first != i->second)
-					_statisticsWithoutAutocorrelations.insert(std::pair<double, DefaultStatistics>(bline.Distance(), statistics));
-			}
-		}
-		
-		virtual const std::map<double, class DefaultStatistics> &GetStatistics() const
-		{
-			return _includeAutoCorrelationsButton.get_active() ? _statisticsWithAutocorrelations : _statisticsWithoutAutocorrelations;
-		}
-		
-		virtual void StartLine(Plot2D &plot, const std::string &name, const std::string &yAxisDesc)
-		{
-			plot.StartLine(name, "Baseline length (m)", yAxisDesc, false, Plot2DPointSet::DrawPoints);
-		}
-		virtual void addCustomPlotButtons(Gtk::VBox &container)
-		{
-			_includeAutoCorrelationsButton.signal_clicked().connect(sigc::mem_fun(*this, &BLengthPlotPage::onAutoCorrelationsClicked));
-			container.pack_start(_includeAutoCorrelationsButton);
-			_includeAutoCorrelationsButton.show();
-		}
-	private:
-		void onAutoCorrelationsClicked()
-		{
-			updatePlot();
-		}
-		
-		std::map<double, DefaultStatistics> _statisticsWithAutocorrelations;
-		std::map<double, DefaultStatistics> _statisticsWithoutAutocorrelations;
-		Gtk::CheckButton _includeAutoCorrelationsButton;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/quality/datawindow.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/quality/datawindow.h
deleted file mode 100644
index 36ffa0d0a7db1eaa9fc73c219c2b8027f16befbb..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/quality/datawindow.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef GUI_QUALITY__DATA_WINDOW_H
-#define GUI_QUALITY__DATA_WINDOW_H
-
-#include <string>
-
-#include <gtkmm/box.h>
-#include <gtkmm/combobox.h>
-#include <gtkmm/liststore.h>
-#include <gtkmm/scrolledwindow.h>
-#include <gtkmm/textview.h>
-#include <gtkmm/window.h>
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class DataWindow : public Gtk::Window {
-	public:
-		DataWindow()
-		{
-			_box.pack_start(_comboBox, Gtk::PACK_SHRINK);
-			_comboListStore = Gtk::ListStore::create(_comboColumnRecord);
-			_comboBox.set_model(_comboListStore);
-			_comboBox.pack_start(_comboColumnRecord._comboListNameColumn);
-			_comboBox.signal_changed().connect(sigc::mem_fun(*this, &DataWindow::onComboChange));
-			_comboBox.show();
-			
-			_scrolledWindow.add(_textView);
-			_textView.show();
-			
-			_box.pack_end(_scrolledWindow);
-			_scrolledWindow.show();
-			
-			add(_box);
-			_box.show();
-			
-			set_default_size(300, 400);
-		}
-    ~DataWindow()
-    {
-		}
-		void SetData(const std::string &data)
-		{
-			_textView.get_buffer()->set_text(data);
-		}
-		void SetData(const class Plot2D &plot);
-	private:
-		DataWindow(const DataWindow &dataWindow) { }
-		
-		void onComboChange();
-		void loadData(size_t plotSetIndex);
-		
-		class ComboColumnRecord : public Gtk::TreeModel::ColumnRecord
-		{
-		public:
-			ComboColumnRecord() { add(_comboListNameColumn); }
-			Gtk::TreeModelColumn<Glib::ustring> _comboListNameColumn;
-		} _comboColumnRecord;
-		Gtk::VBox _box;
-		Gtk::ComboBox _comboBox;
-		Glib::RefPtr<Gtk::ListStore> _comboListStore;
-		Gtk::ScrolledWindow _scrolledWindow;
-		Gtk::TextView _textView;
-		const class Plot2D *_plot;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/quality/frequencyplotpage.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/quality/frequencyplotpage.h
deleted file mode 100644
index 1a6904ff12c35db9f53e22aa56324912a75b1cb5..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/quality/frequencyplotpage.h
+++ /dev/null
@@ -1,120 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef GUI_QUALITY__FREQUENCYPLOTPAGE_H
-#define GUI_QUALITY__FREQUENCYPLOTPAGE_H
-
-#include "twodimensionalplotpage.h"
-
-#include <AOFlagger/quality/statisticscollection.h>
-#include <AOFlagger/quality/statisticsderivator.h>
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class FrequencyPlotPage : public TwoDimensionalPlotPage {
-	public:
-    FrequencyPlotPage() : _ftButton("FT")
-		{
-		}
-		
-		virtual void processStatistics(class StatisticsCollection *statCollection, const std::vector<AntennaInfo> &antennas)
-		{
-			_statistics.clear();
-			
-			const std::map<double, class DefaultStatistics> &map = statCollection->FrequencyStatistics();
-			
-			for(std::map<double, class DefaultStatistics>::const_iterator i=map.begin();i!=map.end();++i)
-			{
-				_statistics.insert(std::pair<double, DefaultStatistics>(i->first/1000000.0, i->second));
-			}
-		}
-		
-		virtual const std::map<double, class DefaultStatistics> &GetStatistics() const
-		{
-			return _statistics;
-		}
-		
-		virtual void StartLine(Plot2D &plot, const std::string &name, const std::string &yAxisDesc)
-		{
-			if(_ftButton.get_active())
-				plot.StartLine(name, "Time (μs)", yAxisDesc, false);
-			else
-				plot.StartLine(name, "Frequency (MHz)", yAxisDesc, false);
-		}
-		
-		virtual void processPlot(Plot2D &plot)
-		{
-			if(_ftButton.get_active())
-			{
-				performFt(plot);
-			}
-		}
-		
-		virtual void addCustomPlotButtons(Gtk::VBox &container)
-		{
-			_ftButton.signal_clicked().connect(sigc::mem_fun(*this, &FrequencyPlotPage::onFTButtonClicked));
-			container.pack_start(_ftButton);
-			_ftButton.show();
-		}
-	private:
-		void onFTButtonClicked()
-		{
-			updatePlot();
-		}
-		
-		void performFt(Plot2D &plot)
-		{
-			size_t count = plot.PointSetCount();
-			for(size_t line=0;line<count;++line)
-			{
-				Plot2DPointSet &pointSet = plot.GetPointSet(line);
-				std::vector<std::pair<double, std::complex<double> > > output;
-				const double min = pointSet.MinX();
-				const double width = pointSet.MaxX() - min;
-				const double fStart = -2.0 * M_PI * (double) pointSet.Size() / width;
-				const double fEnd = 2.0 * M_PI * (double) pointSet.Size() / width;
-				const double fStep = (fEnd - fStart) / (double) pointSet.Size();
-				for(double f = fStart; f < fEnd ; f += fStep)
-				{
-					std::pair<double, std::complex<double> > newElement(f/(2.0*M_PI), std::complex<double>(0.0, 0.0));
-					std::complex<double> &nextStat = newElement.second;
-					for(size_t i=0; i != pointSet.Size(); ++i)
-					{
-						const double t_f = pointSet.GetX(i) * f;
-						const double val = pointSet.GetY(i);
-						nextStat += std::complex<double>(val * cos(t_f), val * sin(t_f));
-					}
-					output.push_back(newElement);
-				}
-				
-				pointSet.Clear();
-				for(std::vector<std::pair<double, std::complex<double> > >::const_iterator i=output.begin();i!=output.end();++i)
-				{
-					double real = i->second.real(), imag=i->second.imag();
-					pointSet.PushDataPoint(i->first, sqrt(real*real + imag*imag));
-				}
-			}
-		}
-		
-		std::map<double, class DefaultStatistics> _statistics;
-		Gtk::CheckButton _ftButton;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/quality/grayscaleplotpage.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/quality/grayscaleplotpage.h
deleted file mode 100644
index 3ee430af7926a75a4bab0015f1498c56c60e1649..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/quality/grayscaleplotpage.h
+++ /dev/null
@@ -1,131 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef GUI_QUALITY__GRAYSCALEPLOTPAGE_H
-#define GUI_QUALITY__GRAYSCALEPLOTPAGE_H
-
-#include <gtkmm/box.h>
-#include <gtkmm/expander.h>
-#include <gtkmm/frame.h>
-#include <gtkmm/window.h>
-#include <gtkmm/radiobutton.h>
-
-#include <AOFlagger/gui/imagewidget.h>
-
-#include <AOFlagger/quality/qualitytablesformatter.h>
-
-#include <AOFlagger/msio/timefrequencydata.h>
-#include <AOFlagger/msio/timefrequencymetadata.h>
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class GrayScalePlotPage : public Gtk::HBox {
-	public:
-		GrayScalePlotPage();
-    virtual ~GrayScalePlotPage();
-		
-	protected:
-		virtual std::pair<TimeFrequencyData, TimeFrequencyMetaDataCPtr> ConstructImage() = 0;
-		
-		QualityTablesFormatter::StatisticKind GetSelectedStatisticKind() const
-		{
-			return _selectStatisticKind;
-		}
-		
-		void UpdateImage();
-		
-		ImageWidget &GrayScaleWidget() { return _imageWidget; }
-	private:
-		void initStatisticKinds();
-		void initPolarizations();
-		void initPhaseButtons();
-		void initPlotOptions();
-		
-		void onSelectCount() { _selectStatisticKind = QualityTablesFormatter::CountStatistic; UpdateImage(); }
-		void onSelectMean() { _selectStatisticKind = QualityTablesFormatter::MeanStatistic; UpdateImage(); }
-		void onSelectStdDev() { _selectStatisticKind = QualityTablesFormatter::StandardDeviationStatistic; UpdateImage(); }
-		void onSelectDCount() { _selectStatisticKind = QualityTablesFormatter::DCountStatistic; UpdateImage(); }
-		void onSelectDMean() { _selectStatisticKind = QualityTablesFormatter::DMeanStatistic; UpdateImage(); }
-		void onSelectDStdDev() { _selectStatisticKind = QualityTablesFormatter::DStandardDeviationStatistic; UpdateImage(); }
-		void onSelectRFIPercentage() { _selectStatisticKind = QualityTablesFormatter::RFIPercentageStatistic; UpdateImage(); }
-		void onSelectSNR() { _selectStatisticKind = QualityTablesFormatter::SignalToNoiseStatistic; UpdateImage(); }
-		void onPropertiesClicked();
-		
-		void onSelectMinMaxRange() { _imageWidget.SetRange(ImageWidget::MinMax); _imageWidget.Update(); }
-		void onSelectWinsorizedRange() { _imageWidget.SetRange(ImageWidget::Winsorized); _imageWidget.Update(); }
-		void onSelectSpecifiedRange() { _imageWidget.SetRange(ImageWidget::Specified); _imageWidget.Update(); }
-		void onLogarithmicScaleClicked()
-		{
-			if(_logarithmicScaleButton.get_active())
-				_imageWidget.SetScaleOption(ImageWidget::LogScale);
-			else
-				_imageWidget.SetScaleOption(ImageWidget::NormalScale);
-			 _imageWidget.Update();
-		}
-		void onNormalizeAxesButtonClicked()
-		{
-			UpdateImage();
-		}
-		void onChangeNormMethod()
-		{
-			if(_normalizeYAxisButton.get_active())
-				UpdateImage();
-		}
-		Image2DCPtr normalizeXAxis(Image2DCPtr input);
-		Image2DCPtr normalizeYAxis(Image2DCPtr input);
-		
-		void setToSelectedPolarization(TimeFrequencyData &data);
-		void setToSelectedPhase(TimeFrequencyData &data);
-		
-		Gtk::Expander _expander;
-		Gtk::VBox _sideBox;
-		
-		Gtk::Frame _statisticKindFrame;
-		Gtk::VBox _statisticKindBox;
-		
-		Gtk::RadioButton _countButton, _meanButton, _stdDevButton, _dCountButton, _dMeanButton, _dStdDevButton, _rfiPercentageButton, _snrButton;
-		
-		Gtk::Frame _polarizationFrame;
-		Gtk::VBox _polarizationBox;
-		
-		Gtk::RadioButton _polXXButton, _polXYButton, _polYXButton, _polYYButton, _polXXandYYButton, _polXYandYXButton;
-		
-		Gtk::Frame _phaseFrame;
-		Gtk::VBox _phaseBox;
-		
-		Gtk::RadioButton _amplitudePhaseButton, _phasePhaseButton, _realPhaseButton, _imaginaryPhaseButton;
-		
-		Gtk::Frame _plotFrame;
-		Gtk::VBox _plotBox;
-		
-		Gtk::RadioButton _rangeMinMaxButton, _rangeWinsorizedButton, _rangeSpecified;
-		Gtk::CheckButton _logarithmicScaleButton, _normalizeXAxisButton, _normalizeYAxisButton;
-		Gtk::RadioButton _meanNormButton, _winsorNormButton, _medianNormButton;
-		Gtk::Button _plotPropertiesButton;
-		
-		QualityTablesFormatter::StatisticKind _selectStatisticKind;
-		ImageWidget _imageWidget;
-		
-		bool _ready;
-		
-		class ImagePropertiesWindow *_imagePropertiesWindow;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/quality/histogrampage.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/quality/histogrampage.h
deleted file mode 100644
index f61befb781b19e53018bbcf53ef5c0f8639d6f5c..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/quality/histogrampage.h
+++ /dev/null
@@ -1,131 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef GUI_QUALITY__HISTOGRAMPAGE_H
-#define GUI_QUALITY__HISTOGRAMPAGE_H
-
-#include <string>
-#include <vector>
-
-#include <gtkmm/box.h>
-#include <gtkmm/checkbutton.h>
-#include <gtkmm/entry.h>
-#include <gtkmm/expander.h>
-#include <gtkmm/frame.h>
-#include <gtkmm/textview.h>
-
-#include <AOFlagger/quality/qualitytablesformatter.h>
-
-#include <AOFlagger/gui/plot/plot2d.h>
-#include <AOFlagger/gui/plot/plotwidget.h>
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class HistogramPage : public Gtk::HBox {
-	public:
-		HistogramPage();
-    ~HistogramPage();
-		void SetStatistics(const std::string &filename)
-		{
-			_statFilename = filename;
-			readFromFile();
-			updatePlot();
-		}
-		void SetStatistics(class HistogramCollection &collection);
-		void CloseStatistics();
-		bool HasStatistics() const
-		{
-			return _histograms != 0;
-		}
-	private:
-		void addHistogramToPlot(const class LogHistogram &histogram);
-		void addRayleighToPlot(const class LogHistogram &histogram, double sigma, double n);
-		void addRayleighDifferenceToPlot(const LogHistogram &histogram, double sigma, double n);
-		void updatePlot();
-		void plotPolarization(const HistogramCollection &histogramCollection, unsigned polarization);
-		void plotPolarization(const class LogHistogram &totalHistogram, const class LogHistogram &rfiHistogram);
-		void plotFit(const class LogHistogram &histogram, const std::string &title);
-		void plotSlope(const class LogHistogram &histogram, const std::string &title, bool useLowerLimit2);
-		void onPlotPropertiesClicked();
-		void onDataExportClicked();
-		void readFromFile();
-		void updateSlopeFrame(const LogHistogram &histogram);
-		void addSlopeText(std::stringstream &str, const LogHistogram &histogram, bool updateRange);
-		void updateDataWindow();
-		
-		void onAutoRangeClicked()
-		{
-			bool autoRange = _fitAutoRangeButton.get_active();
-			_fitStartEntry.set_sensitive(!autoRange);
-			_fitEndEntry.set_sensitive(!autoRange);
-			if(autoRange)
-				updatePlot();
-		}
-		
-		void onSlopeAutoRangeClicked()
-		{
-			bool autoRange = _slopeAutoRangeButton.get_active();
-			_slopeStartEntry.set_sensitive(!autoRange);
-			_slopeEndEntry.set_sensitive(!autoRange);
-			if(autoRange)
-				updatePlot();
-		}
-		
-		Gtk::Expander _expander;
-		Gtk::VBox _sideBox;
-		
-		Gtk::Frame _histogramTypeFrame;
-		Gtk::VBox _histogramTypeBox;
-		Gtk::CheckButton _totalHistogramButton, _rfiHistogramButton, _notRFIHistogramButton;
-		
-		Gtk::Frame _polarizationFrame;
-		Gtk::VBox _polarizationBox;
-		Gtk::CheckButton _xxPolarizationButton, _xyPolarizationButton, _yxPolarizationButton, _yyPolarizationButton, _sumPolarizationButton;
-		
-		Gtk::Frame _fitFrame;
-		Gtk::VBox _fitBox;
-		Gtk::CheckButton _fitButton, _subtractFitButton, _fitLogarithmicButton, _fitAutoRangeButton;
-		Gtk::Entry _fitStartEntry, _fitEndEntry;
-		Gtk::TextView _fitTextView;
-		
-		Gtk::Frame _functionFrame;
-		Gtk::VBox _functionBox;
-		Gtk::RadioButton _nsButton, _dndsButton;
-		Gtk::Entry _deltaSEntry;
-		
-		Gtk::Button _plotPropertiesButton, _dataExportButton;
-		
-		Gtk::Frame _slopeFrame;
-		Gtk::VBox _slopeBox;
-		Gtk::TextView _slopeTextView;
-		Gtk::CheckButton _drawSlopeButton, _drawSlope2Button;
-		Gtk::CheckButton _slopeAutoRangeButton;
-		Gtk::Entry _slopeStartEntry, _slopeEndEntry, _slopeRFIRatio;
-		
-		std::string _statFilename;
-		Plot2D _plot;
-		PlotWidget _plotWidget;
-		class PlotPropertiesWindow *_plotPropertiesWindow;
-		class DataWindow *_dataWindow;
-		class HistogramCollection *_histograms;
-		class HistogramCollection *_summedPolarizationHistograms;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/quality/openoptionswindow.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/quality/openoptionswindow.h
deleted file mode 100644
index debf9d6c9e16741dee485295119dcf9b0f5ce3d9..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/quality/openoptionswindow.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef GUI_QUALITY__OPEN_OPTIONS_WINDOW_H
-#define GUI_QUALITY__OPEN_OPTIONS_WINDOW_H
-
-#include <gtkmm/button.h>
-#include <gtkmm/buttonbox.h>
-#include <gtkmm/checkbutton.h>
-#include <gtkmm/entry.h>
-#include <gtkmm/stock.h>
-#include <gtkmm/window.h>
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class OpenOptionsWindow : public Gtk::Window {
-	public:
-		OpenOptionsWindow() :
-			_downsampleTimeButton("Lower time resolution (faster plots)"),
-			_downsampleFreqButton("Lower frequency resolution (faster plots)"),
-			_correctHistograms("Correct histograms for frequence response"),
-			_cancelButton(Gtk::Stock::CANCEL),
-			_openButton(Gtk::Stock::OPEN)
-		{
-			_timeBox.pack_start(_downsampleTimeButton);
-			_downsampleTimeButton.set_active(true);
-			
-			_timeBox.pack_start(_timeDownsampleEntry);
-			_timeDownsampleEntry.set_text("1000");
-			
-			_box.pack_start(_timeBox);
-			
-			_freqBox.pack_start(_downsampleFreqButton);
-			_downsampleFreqButton.set_active(true);
-			
-			_freqBox.pack_start(_freqDownsampleEntry);
-			_freqDownsampleEntry.set_text("1000");
-			
-			_box.pack_start(_freqBox);
-			
-			_box.pack_start(_correctHistograms);
-			
-			_buttonBox.pack_start(_cancelButton);
-			
-			_buttonBox.pack_start(_openButton);
-			_openButton.signal_clicked().connect(sigc::mem_fun(*this, &OpenOptionsWindow::onOpen));
-			
-			_box.pack_start(_buttonBox);
-			
-			add(_box);
-			_box.show_all();
-		}
-		
-    ~OpenOptionsWindow()
-    {
-		}
-		
-		void ShowForFile(const std::string &file)
-		{
-			_file = file;
-			show();
-		}
-		
-		sigc::signal<void, std::string, bool, bool, size_t, size_t, bool> &SignalOpen() { return _signalOpen; }
-	private:
-		void onOpen()
-		{
-			hide();
-			size_t timeRes = atol(_timeDownsampleEntry.get_text().c_str());
-			size_t freqRes = atol(_freqDownsampleEntry.get_text().c_str());
-			_signalOpen.emit(_file, _downsampleTimeButton.get_active(), _downsampleFreqButton.get_active(), timeRes, freqRes,
-			_correctHistograms.get_active()
-			);
-			_file.clear();
-		}
-		
-		Gtk::VBox _box;
-		Gtk::HBox _timeBox;
-		Gtk::CheckButton _downsampleTimeButton;
-		Gtk::Entry _timeDownsampleEntry;
-		Gtk::HBox _freqBox;
-		Gtk::CheckButton _downsampleFreqButton;
-		Gtk::Entry _freqDownsampleEntry;
-		Gtk::CheckButton _correctHistograms;
-		Gtk::HButtonBox _buttonBox;
-		Gtk::Button _cancelButton, _openButton;
-		sigc::signal<void, std::string, bool, bool, size_t, size_t, bool> _signalOpen;
-		
-		std::string _file;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/quality/summarypage.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/quality/summarypage.h
deleted file mode 100644
index faffcb9d26f636c6ebff67af0a50e4c7fd071683..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/quality/summarypage.h
+++ /dev/null
@@ -1,176 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef GUI_QUALITY__SUMMARYPAGE_H
-#define GUI_QUALITY__SUMMARYPAGE_H
-
-#include <gtkmm/box.h>
-#include <gtkmm/textbuffer.h>
-#include <gtkmm/textview.h>
-
-#include <AOFlagger/quality/statisticscollection.h>
-#include <AOFlagger/quality/statisticsderivator.h>
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class SummaryPage : public Gtk::HBox {
-	public:
-		SummaryPage()
-		{
-			add(_textView);
-			_textView.show();
-			
-			CloseStatistics();
-		}
-		
-		void SetStatistics(class StatisticsCollection *statCollection)
-		{
-			_statCollection = statCollection;
-			updateText();
-		}
-		void CloseStatistics()
-		{
-			_statCollection = 0;
-			_textView.get_buffer()->set_text("No open measurement set");
-		}
-		bool HasStatistics() const
-		{
-			return _statCollection != 0;
-		}
-		
-	private:
-		void updateText()
-		{
-			DefaultStatistics statistics(_statCollection->PolarizationCount());
-			Glib::RefPtr<Gtk::TextBuffer> buffer = _textView.get_buffer();
-			
-			buffer->set_text("Summary of statistics\n\n");
-			
-			_statCollection->GetGlobalCrossBaselineStatistics(statistics);
-			buffer->insert(buffer->end(), "Statistics of cross-correlated baselines\n");
-			addText(statistics);
-			
-			buffer->insert(buffer->end(), "\nAverages over cross-correlated baselines\n");
-			std::ostringstream s;
-			addBaselineAverages(s);
-			buffer->insert(buffer->end(), s.str());
-
-			_statCollection->GetGlobalAutoBaselineStatistics(statistics);
-			buffer->insert(buffer->end(), "\nStatistics of auto-correlated baselines\n");
-			addText(statistics);
-		}
-		
-		void addText(DefaultStatistics &statistics)
-		{
-			Glib::RefPtr<Gtk::TextBuffer > buffer = _textView.get_buffer();
-			
-			unsigned long totalRFICount = 0;
-			unsigned long totalCount = 0;
-			const unsigned polarizationCount = statistics.PolarizationCount();
-			double stdDev[polarizationCount];
-			double dStdDev[polarizationCount];
-			double variance[polarizationCount];
-			double dVariance[polarizationCount];
-			for(unsigned p=0;p<polarizationCount;++p)
-			{
-				totalRFICount += statistics.rfiCount[p];
-				totalCount += statistics.rfiCount[p] + statistics.count[p];
-				variance[p] = StatisticsDerivator::VarianceAmplitude(statistics.count[p], statistics.sum[p], statistics.sumP2[p]);
-				dVariance[p] = StatisticsDerivator::VarianceAmplitude(statistics.dCount[p], statistics.dSum[p], statistics.dSumP2[p]);
-				stdDev[p] = StatisticsDerivator::StandardDeviationAmplitude(statistics.count[p], statistics.sum[p], statistics.sumP2[p]);
-				dStdDev[p] = StatisticsDerivator::StandardDeviationAmplitude(statistics.dCount[p], statistics.dSum[p], statistics.dSumP2[p]);
-			}
-			
-			double rfiRatioValue = round(((double) totalRFICount * 10000.0 / (double) totalCount)) * 0.01;
-			
-			std::ostringstream s;
-			s << "Total RFI ratio = " << rfiRatioValue << "%\n";
-			s << "Standard deviation amplitude = ";
-			addValues(stdDev, polarizationCount, s);
-			s << " Jy\nDifferential stddev amplitude = ";
-			addValues(dStdDev, polarizationCount, s);
-			s << " Jy\nVariance amplitude = ";
-			addValues(variance, polarizationCount, s);
-			s << " Jy\nDifferential variance amplitude = ";
-			addValues(dVariance, polarizationCount, s);
-			s << " Jy\n";
-			buffer->insert(buffer->end(), s.str());
-		}
-		
-		void addBaselineAverages(std::ostringstream &s)
-		{
-			const BaselineStatisticsMap &map = _statCollection->BaselineStatistics();
-			std::vector<std::pair <unsigned, unsigned> > list = map.BaselineList();
-			double totalStdDev[map.PolarizationCount()], totalSNR[map.PolarizationCount()];
-			size_t count[map.PolarizationCount()];
-			for(size_t p=0;p<map.PolarizationCount();++p)
-			{
-				totalStdDev[p] = 0.0;
-				totalSNR[p] = 0.0;
-				count[p] = 0;
-			}
-			for(std::vector<std::pair <unsigned, unsigned> >::const_iterator i=list.begin(); i!=list.end(); ++i)
-			{
-				unsigned a1=i->first, a2=i->second;
-				if(a1 != a2)
-				{
-					const DefaultStatistics &stat = map.GetStatistics(a1, a2);
-					for(size_t p=0;p<map.PolarizationCount();++p)
-					{
-						const double
-							thisStdDev = StatisticsDerivator::GetStatisticAmplitude(QualityTablesFormatter::StandardDeviationStatistic, stat, p),
-							thisSNR = StatisticsDerivator::GetStatisticAmplitude(QualityTablesFormatter::SignalToNoiseStatistic, stat, p);
-						if(std::isfinite(thisStdDev) && std::isfinite(thisSNR))
-						{
-							totalStdDev[p] += thisStdDev;
-							totalSNR[p] += thisSNR;
-							++count[p];
-						}
-					}
-				}
-			}
-			for(size_t p=0;p<map.PolarizationCount();++p)
-			{
-				totalStdDev[p] /= (double) count[p];
-				totalSNR[p] /= (double) count[p];
-			}
-			s << "Average standard deviation = ";
-			addValues(totalStdDev, map.PolarizationCount(), s);
-			s << " Jy\nAverage signal to noise ratio = ";
-			addValues(totalSNR, map.PolarizationCount(), s);
-			s << " Jy\n(calculated with BaselineMean/BaselineDStdDev)\n";
-		}
-
-		void addValues(const double *values, unsigned polarizationCount, std::ostringstream &s)
-		{
-			s << '[' << values[0];
-			for(unsigned p=1;p<polarizationCount;++p)
-			{
-				s << ", " << values[p];
-			}
-			s << ']';
-		}
-
-		Gtk::TextView _textView;
-		
-		StatisticsCollection *_statCollection;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/quality/timefrequencyplotpage.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/quality/timefrequencyplotpage.h
deleted file mode 100644
index 3d4a10edd7e47fd2fce086e5d91773d731907945..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/quality/timefrequencyplotpage.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef GUI_QUALITY__TIMEFREQUENCYPLOTPAGE_H
-#define GUI_QUALITY__TIMEFREQUENCYPLOTPAGE_H
-
-#include <gtkmm/box.h>
-#include <gtkmm/window.h>
-#include <gtkmm/frame.h>
-#include <gtkmm/radiobutton.h>
-
-#include <AOFlagger/gui/imagewidget.h>
-
-#include <AOFlagger/quality/qualitytablesformatter.h>
-
-#include "grayscaleplotpage.h"
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class TimeFrequencyPlotPage : public GrayScalePlotPage {
-	public:
-		TimeFrequencyPlotPage();
-    virtual ~TimeFrequencyPlotPage();
-		
-		sigc::signal<void, const std::string &> SignalStatusChange() { return _signalStatusChange; }
-		
-		void SetStatistics(class StatisticsCollection *statCollection)
-		{
-			_statCollection = statCollection;
-			UpdateImage();
-		}
-		void CloseStatistics()
-		{
-			_statCollection = 0;
-		}
-		bool HasStatistics() const
-		{
-			return _statCollection != 0;
-		}
-		
-	protected:
-		virtual std::pair<TimeFrequencyData, TimeFrequencyMetaDataCPtr> ConstructImage();
-	private:
-		void onMouseMoved(size_t x, size_t y);
-		
-		class StatisticsCollection *_statCollection;
-		
-		sigc::signal<void, const std::string &> _signalStatusChange;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/quality/timeplotpage.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/quality/timeplotpage.h
deleted file mode 100644
index fc156722d09d1ee95c33d1d97a7217ad80bc4e05..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/quality/timeplotpage.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef GUI_QUALITY__TIMEPLOTPAGE_H
-#define GUI_QUALITY__TIMEPLOTPAGE_H
-
-#include "twodimensionalplotpage.h"
-
-#include <AOFlagger/quality/statisticscollection.h>
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class TimePlotPage : public TwoDimensionalPlotPage {
-	protected:
-		virtual const std::map<double, class DefaultStatistics> &GetStatistics() const
-		{
-			return GetStatCollection()->TimeStatistics();
-		}
-		
-		virtual void StartLine(Plot2D &plot, const std::string &name, const std::string &yAxisDesc)
-		{
-			plot.StartLine(name, "Time", yAxisDesc, true);
-		}
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/quality/twodimensionalplotpage.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/quality/twodimensionalplotpage.h
deleted file mode 100644
index cde8c7b1b937f11136ec7c4f407d1714092a485a..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/quality/twodimensionalplotpage.h
+++ /dev/null
@@ -1,148 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef GUI_QUALITY__2DPLOTPAGE_H
-#define GUI_QUALITY__2DPLOTPAGE_H
-
-#include <gtkmm/box.h>
-#include <gtkmm/checkbutton.h>
-#include <gtkmm/expander.h>
-#include <gtkmm/frame.h>
-
-#include <AOFlagger/quality/qualitytablesformatter.h>
-
-#include <AOFlagger/gui/plot/plot2d.h>
-#include <AOFlagger/gui/plot/plotwidget.h>
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class TwoDimensionalPlotPage : public Gtk::HBox {
-	public:
-		TwoDimensionalPlotPage();
-    virtual ~TwoDimensionalPlotPage();
-
-		void SetStatistics(class StatisticsCollection *statCollection, const std::vector<AntennaInfo> &antennas)
-		{
-			processStatistics(statCollection, antennas);
-			
-			_statCollection = statCollection;
-			// We need to do this here because it can not be done yet during construction in the
-			// constructor (virtual methods not yet available there).
-			if(!_customButtonsCreated)
-			{
-				addCustomPlotButtons(_plotBox);
-				_customButtonsCreated = true;
-			}
-			updatePlot();
-		}
-		void CloseStatistics()
-		{
-			_statCollection = 0;
-		}
-		bool HasStatistics() const
-		{
-			return _statCollection != 0;
-		}
-	protected:
-		virtual void processStatistics(class StatisticsCollection *, const std::vector<AntennaInfo> &)
-		{
-		}
-		
-		virtual const std::map<double, class DefaultStatistics> &GetStatistics() const = 0;
-		
-		virtual void StartLine(Plot2D &plot, const std::string &name, const std::string &yAxisDesc) = 0;
-		
-		virtual void processPlot(Plot2D &plot)
-		{
-		}
-		
-		virtual void addCustomPlotButtons(Gtk::VBox &container)
-		{
-		}
-		
-		class StatisticsCollection *GetStatCollection() const
-		{
-			return _statCollection;
-		}
-		void updatePlot();
-		
-		unsigned selectedKindCount() const;
-	private:
-		enum PhaseType { AmplitudePhaseType, PhasePhaseType, RealPhaseType, ImaginaryPhaseType} ;
-		
-		void updatePlotConfig();
-		void updateDataWindow();
-		
-		template<enum PhaseType Phase>
-		inline double getValue(const std::complex<long double> val);
-		void plotStatistic(QualityTablesFormatter::StatisticKind kind);
-		void plotPolarization(QualityTablesFormatter::StatisticKind kind, unsigned polarization);
-		void plotPolarization(QualityTablesFormatter::StatisticKind kind, unsigned polarizationA, unsigned polarizationB);
-		template<enum PhaseType Phase>
-		void plotPhase(QualityTablesFormatter::StatisticKind kind, unsigned polarization);
-		template<enum PhaseType Phase>
-		void plotPhase(QualityTablesFormatter::StatisticKind kind, unsigned polarizationA, unsigned polarizationB);
-		
-		void initStatisticKindButtons();
-		void initPolarizationButtons();
-		void initPhaseButtons();
-		void initPlotButtons();
-		
-		void onLogarithmicClicked()
-		{
-			_zeroAxisButton.set_sensitive(!_logarithmicButton.get_active());
-			updatePlotConfig();
-		}
-		void onPlotPropertiesClicked();
-		void onDataExportClicked();
-		
-		Gtk::Expander _expander;
-		Gtk::VBox _sideBox;
-		
-		Gtk::Frame _statisticFrame;
-		Gtk::VBox _statisticBox;
-		Gtk::CheckButton _countButton, _meanButton, _stdDevButton, _varianceButton, _dCountButton, _dMeanButton, _dStdDevButton,  _rfiPercentageButton, _snrButton;
-		
-		Gtk::Frame _polarizationFrame;
-		Gtk::VBox _polarizationBox;
-		Gtk::CheckButton _polXXButton, _polXYButton, _polYXButton, _polYYButton, _polXXandYYButton, _polXYandYXButton;
-		
-		Gtk::Frame _phaseFrame;
-		Gtk::VBox _phaseBox;
-		Gtk::CheckButton _amplitudeButton, _phaseButton, _realButton, _imaginaryButton;
-		
-		Gtk::Frame _plotFrame;
-		Gtk::VBox _plotBox;
-		Gtk::CheckButton _logarithmicButton, _zeroAxisButton;
-		Gtk::Button _plotPropertiesButton, _dataExportButton;
-		
-		class StatisticsCollection *_statCollection;
-		Plot2D _plot;
-		PlotWidget _plotWidget;
-		
-		class PlotPropertiesWindow *_plotPropertiesWindow;
-		class DataWindow *_dataWindow;
-		
-		bool _customButtonsCreated;
-		
-		std::string getYDesc() const;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/rawoptionwindow.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/rawoptionwindow.h
deleted file mode 100644
index e3a4c2830164a355da18b280f84b01a48777c74a..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/rawoptionwindow.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef RAWOPTIONWINDOW_H
-#define RAWOPTIONWINDOW_H
-
-#include <string>
-
-#include <gtkmm/box.h>
-#include <gtkmm/button.h>
-#include <gtkmm/buttonbox.h>
-#include <gtkmm/label.h>
-#include <gtkmm/frame.h>
-#include <gtkmm/radiobutton.h>
-#include <gtkmm/scale.h>
-#include <gtkmm/window.h>
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class RawOptionWindow : public Gtk::Window {
-	public:
-		RawOptionWindow(class MSWindow &msWindow, const std::string &filename);
-		~RawOptionWindow() { }
-		void onOpen();
-	private:
-		void initModeButtons();
-
-		class MSWindow &_msWindow;
-		const std::string _filename;
-
-		Gtk::HButtonBox _bottomButtonBox;
-		Gtk::VBox _topVBox;
-		Gtk::Button _openButton;
-		Gtk::Frame _modeFrame;
-		Gtk::VBox _modeBox;
-		Gtk::RadioButton _allBeamletsButton, _singleBeamletButton, _channelBeamletButton, _statisticsButton;
-		Gtk::Label _beamletsInSetLabel, _timeBlockSizeLabel;
-		Gtk::HScale _beamletsInSetScale, _timeBlockSizeScale;
-};
-
-#endif // RAWOPTIONWINDOW_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/absthresholdframe.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/absthresholdframe.h
deleted file mode 100644
index c5f6805b0989a4f2a931fa4723670b5ddc15bab2..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/absthresholdframe.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef ABSTHRESHOLDFRAME_H
-#define ABSTHRESHOLDFRAME_H
-
-#include <gtkmm/box.h>
-#include <gtkmm/button.h>
-#include <gtkmm/buttonbox.h>
-#include <gtkmm/frame.h>
-#include <gtkmm/label.h>
-#include <gtkmm/scale.h>
-
-#include <AOFlagger/strategy/actions/absthresholdaction.h>
-
-#include <AOFlagger/gui/editstrategywindow.h>
-
-class AbsThresholdFrame : public Gtk::Frame {
-	public:
-		AbsThresholdFrame(rfiStrategy::AbsThresholdAction &action, EditStrategyWindow &editStrategyWindow)
-		: Gtk::Frame("Absolute threshold"),
-		_editStrategyWindow(editStrategyWindow), _action(action),
-		_thresholdLabel("Threshold:"),
-		_applyButton(Gtk::Stock::APPLY)
-		{
-			_box.pack_start(_thresholdLabel);
-
-			_box.pack_start(_thresholdEntry);
-			std::stringstream s;
-			s << _action.Threshold();
-			_thresholdEntry.set_text(s.str());
-
-			_buttonBox.pack_start(_applyButton);
-			_applyButton.signal_clicked().connect(sigc::mem_fun(*this, &AbsThresholdFrame::onApplyClicked));
-
-			_box.pack_start(_buttonBox);
-
-			add(_box);
-			_box.show_all();
-		}
-	private:
-		EditStrategyWindow &_editStrategyWindow;
-		rfiStrategy::AbsThresholdAction &_action;
-
-		Gtk::VBox _box;
-		Gtk::HButtonBox _buttonBox;
-		Gtk::Label _thresholdLabel;
-		Gtk::Entry _thresholdEntry;
-		Gtk::Button _applyButton;
-
-		void onApplyClicked()
-		{
-			_action.SetThreshold(atof(_thresholdEntry.get_text().c_str()));
-			_editStrategyWindow.UpdateAction(&_action);
-		}
-};
-
-#endif // ABSTHRESHOLDFRAME_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/baselineselectionframe.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/baselineselectionframe.h
deleted file mode 100644
index 37a5d47fd528ed305760f23b038fd1ff2bfb1baf..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/baselineselectionframe.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef BASELINESELECTIONFRAME_H
-#define BASELINESELECTIONFRAME_H
-
-#include <gtkmm/box.h>
-#include <gtkmm/button.h>
-#include <gtkmm/buttonbox.h>
-#include <gtkmm/frame.h>
-#include <gtkmm/label.h>
-#include <gtkmm/radiobutton.h>
-
-#include <AOFlagger/strategy/actions/baselineselectionaction.h>
-
-#include <AOFlagger/gui/editstrategywindow.h>
-
-class BaselineSelectionFrame : public Gtk::Frame {
-	public:
-		BaselineSelectionFrame(rfiStrategy::BaselineSelectionAction &action, EditStrategyWindow &editStrategyWindow)
-		: Gtk::Frame("Baseline selection"),
-		_editStrategyWindow(editStrategyWindow), _action(action),
-		_preparationStepButton("This is the preparation step"),
-		_flagBadBaselinesButton("Flag bad baselines"),
-		_makePlotButton("Make a length-rfi plot"),
-		_applyButton(Gtk::Stock::APPLY)
-		{
-			_box.pack_start(_preparationStepButton);
-			_preparationStepButton.set_active(_action.PreparationStep());
-			_preparationStepButton.show();
-
-			_box.pack_start(_flagBadBaselinesButton);
-			_flagBadBaselinesButton.set_active(_action.FlagBadBaselines());
-			_flagBadBaselinesButton.show();
-
-			_box.pack_start(_makePlotButton);
-			_makePlotButton.set_active(_action.MakePlot());
-			_makePlotButton.show();
-
-			_buttonBox.pack_start(_applyButton);
-			_applyButton.signal_clicked().connect(sigc::mem_fun(*this, &BaselineSelectionFrame::onApplyClicked));
-			_applyButton.show();
-
-			_box.pack_start(_buttonBox);
-			_buttonBox.show();
-
-			add(_box);
-			_box.show();
-		}
-	private:
-		EditStrategyWindow &_editStrategyWindow;
-		rfiStrategy::BaselineSelectionAction &_action;
-
-		Gtk::VBox _box;
-		Gtk::HButtonBox _buttonBox;
-		Gtk::CheckButton _preparationStepButton, _flagBadBaselinesButton, _makePlotButton;
-		Gtk::Button _applyButton;
-
-		void onApplyClicked()
-		{
-			_action.SetPreparationStep(_preparationStepButton.get_active());
-			_action.SetFlagBadBaselines(_flagBadBaselinesButton.get_active());
-			_action.SetMakePlot(_makePlotButton.get_active());
-			_editStrategyWindow.UpdateAction(&_action);
-		}
-};
-
-#endif // BASELINESELECTIONFRAME_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/changeresolutionframe.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/changeresolutionframe.h
deleted file mode 100644
index c4b37e1d2ca9a196c6690852202ba47d815b7912..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/changeresolutionframe.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef CHANGERESOLUTIONFRAME_H
-#define CHANGERESOLUTIONFRAME_H
-
-#include <gtkmm/box.h>
-#include <gtkmm/button.h>
-#include <gtkmm/buttonbox.h>
-#include <gtkmm/frame.h>
-#include <gtkmm/label.h>
-#include <gtkmm/scale.h>
-
-#include <AOFlagger/strategy/actions/changeresolutionaction.h>
-
-#include <AOFlagger/gui/editstrategywindow.h>
-
-class ChangeResolutionFrame : public Gtk::Frame {
-	public:
-		ChangeResolutionFrame(rfiStrategy::ChangeResolutionAction &action, EditStrategyWindow &editStrategyWindow)
-		: Gtk::Frame("Change resolution"),
-		_editStrategyWindow(editStrategyWindow), _action(action),
-		_timeDecreaseFactorLabel("Time decrease factor:"),
-		_timeDecreaseFactorScale(0, 128, 1),
-		_frequencyDecreaseFactorLabel("Frequency decrease factor:"),
-		_frequencyDecreaseFactorScale(0, 256, 1),
-		_setRevisedToChangedImage("Set revised images to changed image"),
-		_setContaminatedToChangedImage("Set contaminated images to changed image"),
-		_setMasksToChangedMasks("Set masks to changed masks"),
-		_useMaskForAveraging("Use mask for averaging"),
-		_applyButton(Gtk::Stock::APPLY)
-		{
-			_box.pack_start(_timeDecreaseFactorLabel);
-
-			_box.pack_start(_timeDecreaseFactorScale);
-			_timeDecreaseFactorScale.set_value(_action.TimeDecreaseFactor());
-
-			_box.pack_start(_frequencyDecreaseFactorLabel);
-
-			_box.pack_start(_frequencyDecreaseFactorScale);
-			_frequencyDecreaseFactorScale.set_value(_action.FrequencyDecreaseFactor());
-
-			_box.pack_start(_setRevisedToChangedImage);
-			_setRevisedToChangedImage.set_active(_action.RestoreRevised());
-
-			_box.pack_start(_setContaminatedToChangedImage);
-			_setContaminatedToChangedImage.set_active(_action.RestoreContaminated());
-
-			_box.pack_start(_setMasksToChangedMasks);
-			_setMasksToChangedMasks.set_active(_action.RestoreMasks());
-
-			_box.pack_start(_useMaskForAveraging);
-			_useMaskForAveraging.set_active(_action.UseMaskInAveraging());
-			
-			_buttonBox.pack_start(_applyButton);
-			_applyButton.signal_clicked().connect(sigc::mem_fun(*this, &ChangeResolutionFrame::onApplyClicked));
-
-			_box.pack_start(_buttonBox);
-
-			add(_box);
-			_box.show_all();
-		}
-	private:
-		EditStrategyWindow &_editStrategyWindow;
-		rfiStrategy::ChangeResolutionAction &_action;
-
-		Gtk::VBox _box;
-		Gtk::HButtonBox _buttonBox;
-		Gtk::Label _timeDecreaseFactorLabel;
-		Gtk::HScale _timeDecreaseFactorScale;
-		Gtk::Label _frequencyDecreaseFactorLabel;
-		Gtk::HScale _frequencyDecreaseFactorScale;
-		Gtk::CheckButton _setRevisedToChangedImage;
-		Gtk::CheckButton _setContaminatedToChangedImage;
-		Gtk::CheckButton _setMasksToChangedMasks;
-		Gtk::CheckButton _useMaskForAveraging;
-		Gtk::Button _applyButton;
-
-		void onApplyClicked()
-		{
-			_action.SetTimeDecreaseFactor((size_t) _timeDecreaseFactorScale.get_value());
-			_action.SetFrequencyDecreaseFactor((size_t) _frequencyDecreaseFactorScale.get_value());
-			_action.SetRestoreRevised(_setRevisedToChangedImage.get_active());
-			_action.SetRestoreContaminated(_setContaminatedToChangedImage.get_active());
-			_action.SetRestoreMasks(_setMasksToChangedMasks.get_active());
-			_action.SetUseMaskInAveraging(_useMaskForAveraging.get_active());
-			_editStrategyWindow.UpdateAction(&_action);
-		}
-};
-
-#endif // CHANGERESOLUTIONFRAME_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/cutareaframe.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/cutareaframe.h
deleted file mode 100644
index bfbdaa6e3a11533cd87e9460f614bf17d2701c84..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/cutareaframe.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef CUTAREAFRAME_H
-#define CUTAREAFRAME_H
-
-#include <gtkmm/box.h>
-#include <gtkmm/button.h>
-#include <gtkmm/buttonbox.h>
-#include <gtkmm/frame.h>
-#include <gtkmm/label.h>
-#include <gtkmm/radiobutton.h>
-
-#include <AOFlagger/strategy/actions/cutareaaction.h>
-
-#include <AOFlagger/gui/editstrategywindow.h>
-
-class CutAreaFrame : public Gtk::Frame {
-	public:
-		CutAreaFrame(rfiStrategy::CutAreaAction &action, EditStrategyWindow &editStrategyWindow)
-		: Gtk::Frame("Cut area"),
-		_editStrategyWindow(editStrategyWindow), _action(action),
-		_startTimeLabel("Start time steps to cut:"),
-		_startTimeScale(0, 64, 1),
-		_endTimeLabel("End time steps to cut:"),
-		_endTimeScale(0, 64, 1),
-		_topChannelsLabel("Top channels to cut:"),
-		_topChannelsScale(0, 64, 1),
-		_bottomChannelsLabel("Bottom channels to cut:"),
-		_bottomChannelsScale(0, 64, 1),
-		_applyButton(Gtk::Stock::APPLY)
-		{
-			_box.pack_start(_startTimeLabel);
-			_startTimeLabel.show();
-			_box.pack_start(_startTimeScale);
-			_startTimeScale.set_value(_action.StartTimeSteps());
-			_startTimeScale.show();
-
-			_box.pack_start(_endTimeLabel);
-			_endTimeLabel.show();
-			_box.pack_start(_endTimeScale);
-			_endTimeScale.set_value(_action.EndTimeSteps());
-			_endTimeScale.show();
-
-			_box.pack_start(_topChannelsLabel);
-			_topChannelsLabel.show();
-			_box.pack_start(_topChannelsScale);
-			_topChannelsScale.set_value(_action.TopChannels());
-			_topChannelsScale.show();
-
-			_box.pack_start(_bottomChannelsLabel);
-			_bottomChannelsLabel.show();
-			_box.pack_start(_bottomChannelsScale);
-			_bottomChannelsScale.set_value(_action.BottomChannels());
-			_bottomChannelsScale.show();
-
-			_buttonBox.pack_start(_applyButton);
-			_applyButton.signal_clicked().connect(sigc::mem_fun(*this, &CutAreaFrame::onApplyClicked));
-			_applyButton.show();
-
-			_box.pack_start(_buttonBox);
-			_buttonBox.show();
-
-			add(_box);
-			_box.show();
-		}
-	private:
-		EditStrategyWindow &_editStrategyWindow;
-		rfiStrategy::CutAreaAction &_action;
-
-		Gtk::Label _startTimeLabel;
-		Gtk::HScale _startTimeScale;
-		Gtk::Label _endTimeLabel;
-		Gtk::HScale _endTimeScale;
-		Gtk::Label _topChannelsLabel;
-		Gtk::HScale _topChannelsScale;
-		Gtk::Label _bottomChannelsLabel;
-		Gtk::HScale _bottomChannelsScale;
-
-		Gtk::VBox _box;
-		Gtk::HButtonBox _buttonBox;
-		Gtk::Button _applyButton;
-
-		void onApplyClicked()
-		{
-			_action.SetStartTimeSteps((int) _startTimeScale.get_value());
-			_action.SetEndTimeSteps((int) _endTimeScale.get_value());
-			_action.SetTopChannels((int) _topChannelsScale.get_value());
-			_action.SetBottomChannels((int) _bottomChannelsScale.get_value());
-
-			_editStrategyWindow.UpdateAction(&_action);
-		}
-};
-
-#endif // CUTAREAFRAME_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/directionprofileframe.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/directionprofileframe.h
deleted file mode 100644
index f126c9ee99d9fdd6798d619f2ea25385a4b6a0d0..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/directionprofileframe.h
+++ /dev/null
@@ -1,139 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef DIRECTIONPROFILEFRAME_H
-#define DIRECTIONPROFILEFRAME_H
-
-#include <gtkmm/box.h>
-#include <gtkmm/button.h>
-#include <gtkmm/buttonbox.h>
-#include <gtkmm/frame.h>
-#include <gtkmm/label.h>
-#include <gtkmm/radiobutton.h>
-
-#include <AOFlagger/strategy/actions/directionprofileaction.h>
-
-#include <AOFlagger/gui/editstrategywindow.h>
-
-class DirectionProfileFrame : public Gtk::Frame {
-	public:
-		DirectionProfileFrame(rfiStrategy::DirectionProfileAction &action, EditStrategyWindow &editStrategyWindow)
-		: Gtk::Frame("Set flags"),
-		_editStrategyWindow(editStrategyWindow), _action(action),
-		_directionLabel("Direction: (function varies in that direction)"),
-		_horizontalDirectionButton("Horizontal"),
-		_verticalDirectionButton("Vertical"),
-		_actionLabel("Action to perform:"),
-		_storeModeButton("Store"),
-		_applyModeButton("Apply"),
-		_unapplyModeButton("Unapply"),
-		_applyButton(Gtk::Stock::APPLY)
-		{
-			_box.pack_start(_directionLabel);
-			
-			Gtk::RadioButton::Group axisGroup;
-
-			_box.pack_start(_horizontalDirectionButton);
-			_horizontalDirectionButton.set_group(axisGroup);
-
-			_box.pack_start(_verticalDirectionButton);
-			_verticalDirectionButton.set_group(axisGroup);
-
-			switch(_action.Axis())
-			{
-				default:
-				case rfiStrategy::DirectionProfileAction::HorizontalAxis:
-					_horizontalDirectionButton.set_active(true);
-					break;
-				case rfiStrategy::DirectionProfileAction::VerticalAxis:
-					_verticalDirectionButton.set_active(true);
-					break;
-			}
-
-			_box.pack_start(_actionLabel);
-
-			Gtk::RadioButton::Group modeGroup;
-
-			_box.pack_start(_storeModeButton);
-			_storeModeButton.set_group(modeGroup);
-
-			_box.pack_start(_applyModeButton);
-			_applyModeButton.set_group(modeGroup);
-
-			_box.pack_start(_unapplyModeButton);
-			_unapplyModeButton.set_group(modeGroup);
-
-			switch(action.ProfileAction())
-			{
-				case rfiStrategy::DirectionProfileAction::Store:
-					_storeModeButton.set_active(true);
-					break;
-				case rfiStrategy::DirectionProfileAction::Apply:
-					_applyModeButton.set_active(true);
-					break;
-				case rfiStrategy::DirectionProfileAction::Unapply:
-					_unapplyModeButton.set_active(true);
-					break;
-			}
-			
-			_buttonBox.pack_start(_applyButton);
-			_applyButton.signal_clicked().connect(sigc::mem_fun(*this, &DirectionProfileFrame::onApplyClicked));
-
-			_box.pack_start(_buttonBox);
-
-			add(_box);
-			_box.show_all();
-		}
-	private:
-		EditStrategyWindow &_editStrategyWindow;
-		rfiStrategy::DirectionProfileAction &_action;
-
-		Gtk::VBox _box;
-		Gtk::HButtonBox _buttonBox;
-		Gtk::Label _directionLabel;
-		Gtk::RadioButton
-			_horizontalDirectionButton,
-			_verticalDirectionButton;
-		Gtk::Label _actionLabel;
-		Gtk::RadioButton
-			_storeModeButton,
-			_applyModeButton,
-			_unapplyModeButton;
-			
-		Gtk::Button _applyButton;
-
-		void onApplyClicked()
-		{
-			if(_horizontalDirectionButton.get_active())
-				_action.SetAxis(rfiStrategy::DirectionProfileAction::HorizontalAxis);
-			else if(_verticalDirectionButton.get_active())
-				_action.SetAxis(rfiStrategy::DirectionProfileAction::VerticalAxis);
-			
-			if(_storeModeButton.get_active())
-				_action.SetProfileAction(rfiStrategy::DirectionProfileAction::Store);
-			else if(_applyModeButton.get_active())
-				_action.SetProfileAction(rfiStrategy::DirectionProfileAction::Apply);
-			else if(_unapplyModeButton.get_active())	
-				_action.SetProfileAction(rfiStrategy::DirectionProfileAction::Unapply);
-			
-			_editStrategyWindow.UpdateAction(&_action);
-		}
-};
-
-#endif // SETFLAGGINGFRAME_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/foreachbaselineframe.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/foreachbaselineframe.h
deleted file mode 100644
index 30f2bee45fae84354d7a981f26938590e0ebc3cf..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/foreachbaselineframe.h
+++ /dev/null
@@ -1,152 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef FOREACHBASELINEFRAME_H
-#define FOREACHBASELINEFRAME_H
-
-#include <gtkmm/box.h>
-#include <gtkmm/button.h>
-#include <gtkmm/buttonbox.h>
-#include <gtkmm/frame.h>
-#include <gtkmm/label.h>
-#include <gtkmm/radiobutton.h>
-#include <gtkmm/scale.h>
-
-#include <AOFlagger/strategy/actions/foreachbaselineaction.h>
-
-#include <AOFlagger/gui/editstrategywindow.h>
-
-class ForEachBaselineFrame : public Gtk::Frame {
-	public:
-		ForEachBaselineFrame(rfiStrategy::ForEachBaselineAction &action, EditStrategyWindow &editStrategyWindow)
-		: Gtk::Frame("For each baseline"),
-		_editStrategyWindow(editStrategyWindow), _action(action),
-		_baselinesLabel("Baselines to iterate over:"),
-		_allBaselinesButton("All"),
-		_crossBaselinesButton("Cross-correlated"),
-		_autoBaselinesButton("Auto-correlated"),
-		_equalToCurrentBaselinesButton("Equal to current"),
-		_autoOfCurrentBaselinesButton("Auto of current antennae"),
-		_currentBaselineButton("Current"),
-		_threadCountLabel("Thread count:"),
-		_threadCountScale(1, 10, 1),
-		_applyButton(Gtk::Stock::APPLY)
-		{
-			_box.pack_start(_baselinesLabel);
-			_baselinesLabel.show();
-
-			Gtk::RadioButton::Group group;
-
-			_box.pack_start(_allBaselinesButton);
-			_allBaselinesButton.set_group(group);
-
-			_box.pack_start(_crossBaselinesButton);
-			_crossBaselinesButton.set_group(group);
-
-			_box.pack_start(_autoBaselinesButton);
-			_autoBaselinesButton.set_group(group);
-
-			_box.pack_start(_equalToCurrentBaselinesButton);
-			_equalToCurrentBaselinesButton.set_group(group);
-
-			_box.pack_start(_autoOfCurrentBaselinesButton);
-			_autoOfCurrentBaselinesButton.set_group(group);
-
-			_box.pack_start(_currentBaselineButton);
-			_currentBaselineButton.set_group(group);
-
-			switch(_action.Selection())
-			{
-				case rfiStrategy::All:
-				_allBaselinesButton.set_active(true);
-					break;
-				case rfiStrategy::CrossCorrelations:
-				_crossBaselinesButton.set_active(true);
-					break;
-				case rfiStrategy::AutoCorrelations:
-				_autoBaselinesButton.set_active(true);
-					break;
-				case rfiStrategy::EqualToCurrent:
-				_equalToCurrentBaselinesButton.set_active(true);
-					break;
-				case rfiStrategy::AutoCorrelationsOfCurrentAntennae:
-				_autoOfCurrentBaselinesButton.set_active(true);
-					break;
-				case rfiStrategy::Current:
-				_currentBaselineButton.set_active(true);
-					break;
-			}
-
-			_allBaselinesButton.show();
-			_crossBaselinesButton.show();
-			_autoBaselinesButton.show();
-			_equalToCurrentBaselinesButton.show();
-			_autoOfCurrentBaselinesButton.show();
-			_currentBaselineButton.show();
-
-			_box.pack_start(_threadCountLabel);
-			_threadCountLabel.show();
-
-			_threadCountScale.set_value(action.ThreadCount());
-			_box.pack_start(_threadCountScale);
-			_threadCountScale.show();
-
-			_buttonBox.pack_start(_applyButton);
-			_applyButton.signal_clicked().connect(sigc::mem_fun(*this, &ForEachBaselineFrame::onApplyClicked));
-			_applyButton.show();
-
-			_box.pack_start(_buttonBox);
-			_buttonBox.show();
-
-			add(_box);
-			_box.show();
-		}
-	private:
-		EditStrategyWindow &_editStrategyWindow;
-		rfiStrategy::ForEachBaselineAction &_action;
-
-		Gtk::VBox _box;
-		Gtk::HButtonBox _buttonBox;
-		Gtk::Label _baselinesLabel;
-		Gtk::RadioButton
-			_allBaselinesButton, _crossBaselinesButton, _autoBaselinesButton, _equalToCurrentBaselinesButton, _autoOfCurrentBaselinesButton, _currentBaselineButton;
-		Gtk::Label _threadCountLabel;
-		Gtk::HScale _threadCountScale;
-		Gtk::Button _applyButton;
-
-		void onApplyClicked()
-		{
-			if(_allBaselinesButton.get_active())
-				_action.SetSelection(rfiStrategy::All);
-			else if(_crossBaselinesButton.get_active())
-				_action.SetSelection(rfiStrategy::CrossCorrelations);
-			else if(_autoBaselinesButton.get_active())
-				_action.SetSelection(rfiStrategy::AutoCorrelations);
-			else if(_equalToCurrentBaselinesButton.get_active())
-				_action.SetSelection(rfiStrategy::EqualToCurrent);
-			else if(_autoOfCurrentBaselinesButton.get_active())
-				_action.SetSelection(rfiStrategy::AutoCorrelationsOfCurrentAntennae);
-			else if(_currentBaselineButton.get_active())
-				_action.SetSelection(rfiStrategy::Current);
-			_action.SetThreadCount((int) _threadCountScale.get_value());
-			_editStrategyWindow.UpdateAction(&_action);
-		}
-};
-
-#endif // FOREACHBASELINEFRAME_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/foreachcomplexcomponentframe.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/foreachcomplexcomponentframe.h
deleted file mode 100644
index 8fa68427b95008d7257e408d6ed141679c7a9762..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/foreachcomplexcomponentframe.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef FOREACHCOMPLEXCOMPONENTFRAME_H
-#define FOREACHCOMPLEXCOMPONENTFRAME_H
-
-#include <gtkmm/box.h>
-#include <gtkmm/button.h>
-#include <gtkmm/buttonbox.h>
-#include <gtkmm/frame.h>
-#include <gtkmm/label.h>
-#include <gtkmm/radiobutton.h>
-
-#include <AOFlagger/strategy/actions/foreachcomplexcomponentaction.h>
-
-#include <AOFlagger/gui/editstrategywindow.h>
-
-class ForEachComplexComponentFrame : public Gtk::Frame {
-	public:
-		ForEachComplexComponentFrame(rfiStrategy::ForEachComplexComponentAction &action, EditStrategyWindow &editStrategyWindow)
-		: Gtk::Frame("For each complex component"),
-		_editStrategyWindow(editStrategyWindow), _action(action),
-		_onAmplitudeButton("On amplitude"),
-		_onPhaseButton("On phase"),
-		_onRealButton("On real"),
-		_onImaginaryButton("On imaginary"),
-		_restoreFromAmplitudeButton("Restore from amplitude"),
-		_applyButton(Gtk::Stock::APPLY)
-		{
-			_box.pack_start(_onAmplitudeButton);
-			_onAmplitudeButton.set_active(_action.OnAmplitude());
-			_onAmplitudeButton.show();
-
-			_box.pack_start(_onPhaseButton);
-			_onPhaseButton.set_active(_action.OnPhase());
-			_onPhaseButton.show();
-
-			_box.pack_start(_onRealButton);
-			_onRealButton.set_active(_action.OnReal());
-			_onRealButton.show();
-
-			_box.pack_start(_onImaginaryButton);
-			_onImaginaryButton.set_active(_action.OnImaginary());
-			_onImaginaryButton.show();
-
-			_box.pack_start(_restoreFromAmplitudeButton);
-			_restoreFromAmplitudeButton.set_active(_action.RestoreFromAmplitude());
-			_restoreFromAmplitudeButton.show();
-
-			_buttonBox.pack_start(_applyButton);
-			_applyButton.signal_clicked().connect(sigc::mem_fun(*this, &ForEachComplexComponentFrame::onApplyClicked));
-			_applyButton.show();
-
-			_box.pack_start(_buttonBox);
-			_buttonBox.show();
-
-			add(_box);
-			_box.show();
-		}
-	private:
-		EditStrategyWindow &_editStrategyWindow;
-		rfiStrategy::ForEachComplexComponentAction &_action;
-
-		Gtk::VBox _box;
-		Gtk::HButtonBox _buttonBox;
-		Gtk::CheckButton
-			_onAmplitudeButton, _onPhaseButton, _onRealButton, _onImaginaryButton,
-			_restoreFromAmplitudeButton;
-		Gtk::Button _applyButton;
-
-		void onApplyClicked()
-		{
-			_action.SetOnAmplitude(_onAmplitudeButton.get_active());
-			_action.SetOnPhase(_onPhaseButton.get_active());
-			_action.SetOnReal(_onRealButton.get_active());
-			_action.SetOnImaginary(_onImaginaryButton.get_active());
-			_action.SetRestoreFromAmplitude(_restoreFromAmplitudeButton.get_active());
-			_editStrategyWindow.UpdateAction(&_action);
-		}
-};
-
-#endif // FOREACHCOMPLEXCOMPONENTFRAME_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/foreachmsframe.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/foreachmsframe.h
deleted file mode 100644
index ef7c304222e462c7ae407f0048b96e56d6819c0c..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/foreachmsframe.h
+++ /dev/null
@@ -1,139 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef FOREACHMSFRAME_H
-#define FOREACHMSFRAME_H
-
-#include <gtkmm/box.h>
-#include <gtkmm/buttonbox.h>
-#include <gtkmm/filechooserdialog.h>
-#include <gtkmm/frame.h>
-#include <gtkmm/liststore.h>
-#include <gtkmm/treeview.h>
-
-#include <AOFlagger/strategy/actions/foreachmsaction.h>
-
-class ForEachMSFrame : public Gtk::Frame {
-	public:
-		ForEachMSFrame(rfiStrategy::ForEachMSAction &action, EditStrategyWindow &editStrategyWindow)
-		: Gtk::Frame("For each MS options"),
-		_editStrategyWindow(editStrategyWindow), _action(action),
-		_clearButton("Clear"),
-		_addOneButton("Add one"),
-		_addAllInDirButton("Add all in dir")
-		{
-			_addOneButton.signal_clicked().connect(sigc::mem_fun(*this, &ForEachMSFrame::onAddOneButtonClicked));
-			_addAllInDirButton.signal_clicked().connect(sigc::mem_fun(*this, &ForEachMSFrame::onAddAllInDirButtonClicked));
-			_clearButton.signal_clicked().connect(sigc::mem_fun(*this, &ForEachMSFrame::onClearButtonClicked));
-			
-			_fileListModel = Gtk::ListStore::create(_fileListColumns);
-			fillFileList();
-			
-			_fileListView.set_model(_fileListModel);
-			_fileListView.append_column("Title", _fileListColumns.title);
-			_box.pack_start(_fileListView);
-			_fileListView.show();
-			
-			_buttonBox.pack_start(_addOneButton);
-			_addOneButton.show();
-			
-			_buttonBox.pack_start(_addAllInDirButton);
-			_addAllInDirButton.show();
-			
-			_buttonBox.pack_start(_clearButton);
-			_clearButton.show();
-			
-			_box.pack_end(_buttonBox, false, false, 0);
-			_buttonBox.show();
-			
-			add(_box);
-			_box.show();
-		}
-	private:
-		EditStrategyWindow &_editStrategyWindow;
-		rfiStrategy::ForEachMSAction &_action;
-		Gtk::VBox _box;
-		Gtk::HButtonBox _buttonBox;
-		Gtk::Button _clearButton, _addOneButton, _addAllInDirButton;
-		Gtk::TreeView _fileListView;
-		Glib::RefPtr<Gtk::ListStore> _fileListModel;
-		struct FileListModelColumns : public Gtk::TreeModelColumnRecord {
-			public:
-				FileListModelColumns() { add(title); }
-				Gtk::TreeModelColumn<Glib::ustring> title;
-		} _fileListColumns;
-		
-		void fillFileList()
-		{
-			_fileListModel->clear();
-			std::vector<std::string> &filenames = _action.Filenames();
-			for(std::vector<std::string>::const_iterator i=filenames.begin();i!=filenames.end();++i)
-			{
-				Gtk::TreeModel::iterator iter = _fileListModel->append();
-				Gtk::TreeModel::Row row = *iter;
-				row[_fileListColumns.title] = *i;
-			}
-		}
-		
-		void onAddOneButtonClicked()
-		{
-			Gtk::FileChooserDialog dialog("Select a measurement set",
-							Gtk::FILE_CHOOSER_ACTION_SELECT_FOLDER);
-			dialog.set_transient_for(_editStrategyWindow);
-		
-			//Add response buttons the the dialog:
-			dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
-			dialog.add_button("Open", Gtk::RESPONSE_OK);
-		
-			int result = dialog.run();
-		
-			if(result == Gtk::RESPONSE_OK)
-			{
-				_action.Filenames().push_back(dialog.get_filename());
-				fillFileList();
-			}
-		}
-		
-		void onAddAllInDirButtonClicked()
-		{
-			Gtk::FileChooserDialog dialog("Select a dir with measurement sets",
-							Gtk::FILE_CHOOSER_ACTION_SELECT_FOLDER);
-			dialog.set_transient_for(_editStrategyWindow);
-		
-			//Add response buttons the the dialog:
-			dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
-			dialog.add_button("Open", Gtk::RESPONSE_OK);
-		
-			int result = dialog.run();
-		
-			if(result == Gtk::RESPONSE_OK)
-			{
-				_action.AddDirectory(dialog.get_filename());
-				fillFileList();
-			}
-		}
-		
-		void onClearButtonClicked()
-		{
-			_action.Filenames().clear();
-			fillFileList();
-		}
-};
-
-#endif // FOREACHMSFRAME_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/foreachpolarisationframe.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/foreachpolarisationframe.h
deleted file mode 100644
index 384ee05695f005654fae481759f9b373495faadb..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/foreachpolarisationframe.h
+++ /dev/null
@@ -1,121 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef FOREACHPOLARISATIONFRAME_H
-#define FOREACHPOLARISATIONFRAME_H
-
-#include <gtkmm/box.h>
-#include <gtkmm/button.h>
-#include <gtkmm/buttonbox.h>
-#include <gtkmm/frame.h>
-#include <gtkmm/label.h>
-#include <gtkmm/radiobutton.h>
-
-#include <AOFlagger/strategy/actions/foreachpolarisationaction.h>
-
-#include <AOFlagger/gui/editstrategywindow.h>
-
-class ForEachPolarisationFrame : public Gtk::Frame {
-	public:
-		ForEachPolarisationFrame(rfiStrategy::ForEachPolarisationBlock &action, EditStrategyWindow &editStrategyWindow)
-		: Gtk::Frame("For each baseline"),
-		_editStrategyWindow(editStrategyWindow), _action(action),
-		_onXXButton("XX"),
-		_onXYButton("XY"),
-		_onYXButton("YX"),
-		_onYYButton("YY"),
-		_onStokesIButton("Stokes I"),
-		_onStokesQButton("Stokes Q"),
-		_onStokesUButton("Stokes U"),
-		_onStokesVButton("Stokes V"),
-		_applyButton(Gtk::Stock::APPLY)
-		{
-			_box.pack_start(_onXXButton);
-			_onXXButton.set_active(_action.OnXX());
-			_onXXButton.show();
-
-			_box.pack_start(_onXYButton);
-			_onXYButton.set_active(_action.OnXY());
-			_onXYButton.show();
-
-			_box.pack_start(_onYXButton);
-			_onYXButton.set_active(_action.OnYX());
-			_onYXButton.show();
-
-			_box.pack_start(_onYYButton);
-			_onYYButton.set_active(_action.OnYY());
-			_onYYButton.show();
-
-			_box.pack_start(_onStokesIButton);
-			_onStokesIButton.set_active(_action.OnStokesI());
-			_onStokesIButton.show();
-
-			_box.pack_start(_onStokesQButton);
-			_onStokesQButton.set_active(_action.OnStokesQ());
-			_onStokesQButton.show();
-
-			_box.pack_start(_onStokesUButton);
-			_onStokesUButton.set_active(_action.OnStokesU());
-			_onStokesUButton.show();
-
-			_box.pack_start(_onStokesVButton);
-			_onStokesVButton.set_active(_action.OnStokesV());
-			_onStokesVButton.show();
-
-			_buttonBox.pack_start(_applyButton);
-			_applyButton.signal_clicked().connect(sigc::mem_fun(*this, &ForEachPolarisationFrame::onApplyClicked));
-			_applyButton.show();
-
-			_box.pack_start(_buttonBox);
-			_buttonBox.show();
-
-			add(_box);
-			_box.show();
-		}
-	private:
-		EditStrategyWindow &_editStrategyWindow;
-		rfiStrategy::ForEachPolarisationBlock &_action;
-
-		Gtk::VBox _box;
-		Gtk::HButtonBox _buttonBox;
-		Gtk::CheckButton _onXXButton;
-		Gtk::CheckButton _onXYButton;
-		Gtk::CheckButton _onYXButton;
-		Gtk::CheckButton _onYYButton;
-		Gtk::CheckButton _onStokesIButton;
-		Gtk::CheckButton _onStokesQButton;
-		Gtk::CheckButton _onStokesUButton;
-		Gtk::CheckButton _onStokesVButton;
-		Gtk::Button _applyButton;
-
-		void onApplyClicked()
-		{
-			_action.SetOnXX(_onXXButton.get_active());
-			_action.SetOnXY(_onXYButton.get_active());
-			_action.SetOnYX(_onYXButton.get_active());
-			_action.SetOnYY(_onYYButton.get_active());
-			_action.SetOnStokesI(_onStokesIButton.get_active());
-			_action.SetOnStokesQ(_onStokesQButton.get_active());
-			_action.SetOnStokesU(_onStokesUButton.get_active());
-			_action.SetOnStokesV(_onStokesVButton.get_active());
-			_editStrategyWindow.UpdateAction(&_action);
-		}
-};
-
-#endif // FOREACHPOLARISATIONFRAME_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/frequencyconvolutionframe.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/frequencyconvolutionframe.h
deleted file mode 100644
index 1a1c1118458139aec2ccaa92af52c0654c3d8615..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/frequencyconvolutionframe.h
+++ /dev/null
@@ -1,105 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef FREQUENCYCONVOLUTIONFRAME_H
-#define FREQUENCYCONVOLUTIONFRAME_H
-
-#include <gtkmm/box.h>
-#include <gtkmm/button.h>
-#include <gtkmm/buttonbox.h>
-#include <gtkmm/frame.h>
-#include <gtkmm/label.h>
-#include <gtkmm/scale.h>
-
-#include <AOFlagger/strategy/actions/frequencyconvolutionaction.h>
-
-#include <AOFlagger/gui/editstrategywindow.h>
-
-class FrequencyConvolutionFrame : public Gtk::Frame {
-	public:
-		FrequencyConvolutionFrame(rfiStrategy::FrequencyConvolutionAction &action, EditStrategyWindow &editStrategyWindow)
-		: Gtk::Frame("Frequency convolution"),
-		_editStrategyWindow(editStrategyWindow), _action(action),
-		_rectangularKernelButton("Rectangular kernel"),
-		_sincKernelButton("Sinc kernel"),
-		_totalKernelButton("Total kernel"),
-		_convolutionSizeLabel("Convolution size:"),
-		_convolutionSizeScale(1, 1024, 1),
-		_inSamplesButton("Size in samples"),
-		_applyButton(Gtk::Stock::APPLY)
-		{
-			Gtk::RadioButton::Group kernelGroup;
-		
-			_rectangularKernelButton.set_group(kernelGroup);
-			_box.pack_start(_rectangularKernelButton);
-			_sincKernelButton.set_group(kernelGroup);
-			_box.pack_start(_sincKernelButton);
-			_totalKernelButton.set_group(kernelGroup);
-			_box.pack_start(_totalKernelButton);
-			
-			if(_action.KernelKind() == rfiStrategy::FrequencyConvolutionAction::RectangleKernel)
-				_rectangularKernelButton.set_active(true);
-			else if(_action.KernelKind() == rfiStrategy::FrequencyConvolutionAction::SincKernel)
-				_sincKernelButton.set_active(true);
-			else
-				_totalKernelButton.set_active(true);
-
-			_box.pack_start(_convolutionSizeLabel);
-			
-			_box.pack_start(_convolutionSizeScale);
-			_convolutionSizeScale.set_value(_action.ConvolutionSize());
-
-			_box.pack_start(_inSamplesButton);
-			_inSamplesButton.set_active(_action.InSamples());
-
-			_buttonBox.pack_start(_applyButton);
-			_applyButton.signal_clicked().connect(sigc::mem_fun(*this, &FrequencyConvolutionFrame::onApplyClicked));
-
-			_box.pack_start(_buttonBox);
-
-			add(_box);
-			_box.show_all();
-		}
-	private:
-		EditStrategyWindow &_editStrategyWindow;
-		rfiStrategy::FrequencyConvolutionAction &_action;
-
-		Gtk::VBox _box;
-		Gtk::HButtonBox _buttonBox;
-		Gtk::RadioButton _rectangularKernelButton, _sincKernelButton, _totalKernelButton;
-		Gtk::Label _convolutionSizeLabel;
-		Gtk::HScale _convolutionSizeScale;
-		Gtk::CheckButton _inSamplesButton;
-		Gtk::Button _applyButton;
-
-		void onApplyClicked()
-		{
-			if(_rectangularKernelButton.get_active())
-				_action.SetKernelKind(rfiStrategy::FrequencyConvolutionAction::RectangleKernel);
-			else if(_sincKernelButton.get_active())
-				_action.SetKernelKind(rfiStrategy::FrequencyConvolutionAction::SincKernel);
-			else if(_totalKernelButton.get_active())
-				_action.SetKernelKind(rfiStrategy::FrequencyConvolutionAction::TotalKernel);
-			_action.SetConvolutionSize(_convolutionSizeScale.get_value());
-			_action.SetInSamples(_inSamplesButton.get_active());
-			_editStrategyWindow.UpdateAction(&_action);
-		}
-};
-
-#endif // FREQUENCYCONVOLUTIONFRAME_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/fringestoppingframe.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/fringestoppingframe.h
deleted file mode 100644
index a1a7994ba5816b58fe1c648eb3db011f08f77be0..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/fringestoppingframe.h
+++ /dev/null
@@ -1,132 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef FRINGESTOPPINGFRAME_H
-#define FRINGESTOPPINGFRAME_H
-
-#include <sstream>
-
-#include <gtkmm/box.h>
-#include <gtkmm/button.h>
-#include <gtkmm/buttonbox.h>
-#include <gtkmm/checkbutton.h>
-#include <gtkmm/frame.h>
-#include <gtkmm/label.h>
-#include <gtkmm/scale.h>
-
-#include <AOFlagger/strategy/actions/fringestopaction.h>
-
-#include <AOFlagger/gui/editstrategywindow.h>
-
-class FringeStoppingFrame : public Gtk::Frame {
-	public:
-		FringeStoppingFrame(rfiStrategy::FringeStopAction &action, EditStrategyWindow &editStrategyWindow)
-		: Gtk::Frame("Fringe stopping recovery"),
-		_editStrategyWindow(editStrategyWindow), _action(action),
-		_fringesToConsiderLabel("Considered fringes:"),
-		_fringesToConsiderScale(0, 25.0L, 0.25L),
-		_minWindowSizeLabel("Min window size:"),
-		_minWindowSizeScale(0, 2048, 16),
-		_maxWindowSizeLabel("Max window size:"),
-		_maxWindowSizeScale(0, 2048, 16),
-		_fitChannelsIndividuallyButton("Fit channels individually"),
-		_onlyFringeStopButton("No fit, only fringe stop"),
-		_raLabel("Right ascension:"),
-		_decLabel("Declination:"),
-		_applyButton(Gtk::Stock::APPLY)
-		{
-			_box.pack_start(_fringesToConsiderLabel);
-
-			_box.pack_start(_fringesToConsiderScale);
-			_fringesToConsiderScale.set_value(_action.FringesToConsider());
-
-			_box.pack_start(_minWindowSizeLabel);
-
-			_box.pack_start(_minWindowSizeScale);
-			_minWindowSizeScale.set_value(_action.MinWindowSize());
-
-			_box.pack_start(_maxWindowSizeLabel);
-
-			_box.pack_start(_maxWindowSizeScale);
-			_maxWindowSizeScale.set_value(_action.MaxWindowSize());
-
-			_box.pack_start(_fitChannelsIndividuallyButton);
-			_fitChannelsIndividuallyButton.set_active(_action.FitChannelsIndividually());
-
-			_box.pack_start(_onlyFringeStopButton);
-			_onlyFringeStopButton.set_active(_action.OnlyFringeStop());
-			
-			_box.pack_start(_raLabel);
-			
-			std::ostringstream raStr;
-			raStr << _action.NewPhaseCentreRA();
-			_raEntry.set_text(raStr.str());
-			_box.pack_start(_raEntry);
-
-			_box.pack_start(_decLabel);
-
-			std::ostringstream decStr;
-			decStr << _action.NewPhaseCentreDec();
-			_decEntry.set_text(decStr.str());
-			_box.pack_start(_decEntry);
-
-			_buttonBox.pack_start(_applyButton);
-			_applyButton.signal_clicked().connect(sigc::mem_fun(*this, &FringeStoppingFrame::onApplyClicked));
-
-			_box.pack_start(_buttonBox);
-
-			add(_box);
-			_box.show_all();
-		}
-	private:
-		EditStrategyWindow &_editStrategyWindow;
-		rfiStrategy::FringeStopAction &_action;
-
-		Gtk::VBox _box;
-		Gtk::HButtonBox _buttonBox;
-		Gtk::Label _fringesToConsiderLabel;
-		Gtk::HScale _fringesToConsiderScale;
-		Gtk::Label _minWindowSizeLabel;
-		Gtk::HScale _minWindowSizeScale;
-		Gtk::Label _maxWindowSizeLabel;
-		Gtk::HScale _maxWindowSizeScale;
-		Gtk::CheckButton _fitChannelsIndividuallyButton;
-		Gtk::CheckButton _onlyFringeStopButton;
-		Gtk::Label _raLabel;
-		Gtk::Label _decLabel;
-		Gtk::Entry _raEntry, _decEntry;
-		Gtk::Button _applyButton;
-
-		void onApplyClicked()
-		{
-			_action.SetFringesToConsider(_fringesToConsiderScale.get_value());
-			_action.SetMinWindowSize((size_t) _minWindowSizeScale.get_value());
-			_action.SetMaxWindowSize((size_t) _maxWindowSizeScale.get_value());
-			_action.SetFitChannelsIndividually(_fitChannelsIndividuallyButton.get_active());
-			_action.SetOnlyFringeStop(_onlyFringeStopButton.get_active());
-			std::string
-				raStr = _raEntry.get_text(),
-				decStr = _decEntry.get_text();
-			_action.SetNewPhaseCentreRA(atof(raStr.c_str()));
-			_action.SetNewPhaseCentreDec(atof(decStr.c_str()));
-			_editStrategyWindow.UpdateAction(&_action);
-		}
-};
-
-#endif // FRINGESTOPPINGFRAME_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/highpassfilterframe.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/highpassfilterframe.h
deleted file mode 100644
index 662f7ddf9634f22daabce9e0a367dfa5e6807a1c..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/highpassfilterframe.h
+++ /dev/null
@@ -1,116 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef HIGHPASSFILTERFRAME_H
-#define HIGHPASSFILTERFRAME_H
-
-#include <gtkmm/box.h>
-#include <gtkmm/button.h>
-#include <gtkmm/frame.h>
-#include <gtkmm/label.h>
-#include <gtkmm/scale.h>
-
-#include <AOFlagger/strategy/actions/highpassfilteraction.h>
-
-#include <AOFlagger/gui/editstrategywindow.h>
-
-class HighPassFilterFrame : public Gtk::Frame {
-	public:
-		HighPassFilterFrame(rfiStrategy::HighPassFilterAction &action, EditStrategyWindow &editStrategyWindow)
-		: Gtk::Frame("Sliding window fit"), _editStrategyWindow(editStrategyWindow), _action(action),
-		_hWindowSizeScale(0.0, 400.0, 1.0),
-		_vWindowSizeScale(0.0, 400.0, 1.0),
-		_hKernelSigmaScale(0.1, 1000.0, 0.1),
-		_vKernelSigmaScale(0.1, 1000.0, 0.1),
-		_hWindowSizeLabel("Horizontal sliding window size:", Gtk::ALIGN_LEFT),
-		_vWindowSizeLabel("Vertical sliding window size:", Gtk::ALIGN_LEFT),
-		_hKernelSigmaLabel("Horizontal kernel sigma:", Gtk::ALIGN_LEFT),
-		_vKernelSigmaLabel("Vertical kernel sigma:", Gtk::ALIGN_LEFT),
-		_modeContaminatedButton("Store in contaminated"),
-		_modeRevisedButton("Store in revised"),
-		_applyButton(Gtk::Stock::APPLY)
-		{
-			initScales();
-			
-			_box.pack_start(_modeContaminatedButton);
-			_box.pack_start(_modeRevisedButton);
-			Gtk::RadioButtonGroup group;
-			_modeContaminatedButton.set_group(group);
-			_modeRevisedButton.set_group(group);
-			if(_action.Mode() == rfiStrategy::HighPassFilterAction::StoreContaminated)
-				_modeContaminatedButton.set_active(true);
-			else
-				_modeRevisedButton.set_active(true);
-		
-			_applyButton.signal_clicked().connect(sigc::mem_fun(*this, &HighPassFilterFrame::onApplyClicked));
-			_box.pack_start(_applyButton);
-		
-			add(_box);
-			_box.show_all();
-		}
-
-	private:
-		void initScales()
-		{
-			_box.pack_start(_hWindowSizeLabel);
-			_hWindowSizeScale.set_value(_action.WindowWidth());
-			_box.pack_start(_hWindowSizeScale);
-		
-			_box.pack_start(_vWindowSizeLabel);
-			_vWindowSizeScale.set_value(_action.WindowHeight());
-			_box.pack_start(_vWindowSizeScale);
-		
-			_box.pack_start(_hKernelSigmaLabel);
-			_hKernelSigmaScale.set_value(sqrt(_action.HKernelSigmaSq()));
-			_box.pack_start(_hKernelSigmaScale);
-		
-			_box.pack_start(_vKernelSigmaLabel);
-			_vKernelSigmaScale.set_value(sqrt(_action.VKernelSigmaSq()));
-			_box.pack_start(_vKernelSigmaScale);
-		}
-
-		EditStrategyWindow &_editStrategyWindow;
-		rfiStrategy::HighPassFilterAction &_action;
-
-		Gtk::VBox _box;
-		Gtk::HScale
-			_hWindowSizeScale, _vWindowSizeScale,
-			_hKernelSigmaScale, _vKernelSigmaScale;
-		Gtk::Label
-			_hWindowSizeLabel, _vWindowSizeLabel,
-			_hKernelSigmaLabel, _vKernelSigmaLabel;
-		Gtk::RadioButton _modeContaminatedButton, _modeRevisedButton;
-		Gtk::Button _applyButton;
-
-		void onApplyClicked()
-		{
-			_action.SetWindowWidth((unsigned) _hWindowSizeScale.get_value());
-			_action.SetWindowHeight((unsigned) _vWindowSizeScale.get_value());
-			_action.SetHKernelSigmaSq(_hKernelSigmaScale.get_value()*_hKernelSigmaScale.get_value());
-			_action.SetVKernelSigmaSq(_vKernelSigmaScale.get_value()*_vKernelSigmaScale.get_value());
-			if(_modeContaminatedButton.get_active())
-				_action.SetMode(rfiStrategy::HighPassFilterAction::StoreContaminated);
-			else
-				_action.SetMode(rfiStrategy::HighPassFilterAction::StoreRevised);
-
-			_editStrategyWindow.UpdateAction(&_action);
-		}
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/iterationframe.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/iterationframe.h
deleted file mode 100644
index 83fd3c31b2f0265b8706c996e9f71c70898439c3..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/iterationframe.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef ITERATIONFRAME_H
-#define ITERATIONFRAME_H
-
-#include <gtkmm/box.h>
-#include <gtkmm/button.h>
-#include <gtkmm/buttonbox.h>
-#include <gtkmm/frame.h>
-#include <gtkmm/label.h>
-#include <gtkmm/scale.h>
-
-#include <AOFlagger/strategy/actions/iterationaction.h>
-
-#include <AOFlagger/gui/editstrategywindow.h>
-
-class IterationFrame : public Gtk::Frame {
-	public:
-		IterationFrame(rfiStrategy::IterationBlock &iterationBlock, EditStrategyWindow &editStrategyWindow)
-		: Gtk::Frame("Iteration"),
-		_editStrategyWindow(editStrategyWindow), _iterationBlock(iterationBlock),
-		_iterationCountLabel("Iteration count:"),
-		_sensitivityStartLabel("Sensitivity start value (moves to 1):"),
-		_iterationCountScale(0, 1000, 1),
-		_sensitivityStartScale(0, 25.0, 0.25),
-		_applyButton(Gtk::Stock::APPLY)
-		{
-			_box.pack_start(_iterationCountLabel);
-
-			_box.pack_start(_iterationCountScale);
-			_iterationCountScale.set_value(_iterationBlock.IterationCount());
-
-			_box.pack_start(_sensitivityStartLabel);
-
-			_box.pack_start(_sensitivityStartScale);
-			_sensitivityStartScale.set_value(_iterationBlock.SensitivityStart());
-
-			_buttonBox.pack_start(_applyButton);
-			_applyButton.signal_clicked().connect(sigc::mem_fun(*this, &IterationFrame::onApplyClicked));
-
-			_box.pack_start(_buttonBox);
-
-			add(_box);
-			_box.show_all();
-		}
-	private:
-		EditStrategyWindow &_editStrategyWindow;
-		rfiStrategy::IterationBlock &_iterationBlock;
-
-		Gtk::VBox _box;
-		Gtk::HButtonBox _buttonBox;
-		Gtk::Label _iterationCountLabel, _sensitivityStartLabel;
-		Gtk::HScale _iterationCountScale, _sensitivityStartScale;
-		Gtk::Button _applyButton;
-
-		void onApplyClicked()
-		{
-			_iterationBlock.SetIterationCount((size_t) _iterationCountScale.get_value());
-			_iterationBlock.SetSensitivityStart(_sensitivityStartScale.get_value());
-			_editStrategyWindow.UpdateAction(&_iterationBlock);
-
-		}
-};
-
-#endif // ITERATIONFRAME_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/plotframe.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/plotframe.h
deleted file mode 100644
index 6571eea62d7701b4b0c64f5405774d939f726917..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/plotframe.h
+++ /dev/null
@@ -1,168 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef STRATEGYFRAMES_PLOTFRAME_H
-#define STRATEGYFRAMES_PLOTFRAME_H
-
-#include <gtkmm/box.h>
-#include <gtkmm/button.h>
-#include <gtkmm/buttonbox.h>
-#include <gtkmm/checkbutton.h>
-#include <gtkmm/frame.h>
-#include <gtkmm/label.h>
-#include <gtkmm/radiobutton.h>
-#include <gtkmm/scale.h>
-
-#include <AOFlagger/strategy/actions/plotaction.h>
-
-#include <AOFlagger/gui/editstrategywindow.h>
-
-class StrategyPlotFrame : public Gtk::Frame {
-	public:
-		StrategyPlotFrame(rfiStrategy::PlotAction &action, EditStrategyWindow &editStrategyWindow)
-		: Gtk::Frame("For each baseline"),
-		_editStrategyWindow(editStrategyWindow), _action(action),
-		_plotKindLabel("Plot kind:"),
-		_antennaVsFlagsButton("Antenna vs. flags"),
-		_frequencyVsFlagsButton("Frequency vs. flags"),
-		_frequencyVsPowerButton("Frequency vs. power"),
-		_timeVsFlagsButton("Time vs. flgs"),
-		_polarizationVsFlagsButton("Polarization vs. flgs"),
-		_baselineSpectrumPlotButton("Spectrum per baseline"),
-		_baselineRMSButton("Baseline RMS"),
-		_iterationsButton("Iterations"),
-		_logYScaleButton("Logarithmic y-axis"),
-		_applyButton(Gtk::Stock::APPLY)
-		{
-			_box.pack_start(_plotKindLabel);
-			_plotKindLabel.show();
-
-			Gtk::RadioButton::Group group;
-
-			_box.pack_start(_antennaVsFlagsButton);
-			_antennaVsFlagsButton.set_group(group);
-			_antennaVsFlagsButton.show();
-
-			_box.pack_start(_frequencyVsFlagsButton);
-			_frequencyVsFlagsButton.set_group(group);
-			_frequencyVsFlagsButton.show();
-
-			_box.pack_start(_frequencyVsPowerButton);
-			_frequencyVsPowerButton.set_group(group);
-			_frequencyVsPowerButton.show();
-
-			_box.pack_start(_timeVsFlagsButton);
-			_timeVsFlagsButton.set_group(group);
-			_timeVsFlagsButton.show();
-
-			_box.pack_start(_polarizationVsFlagsButton);
-			_polarizationVsFlagsButton.set_group(group);
-			_polarizationVsFlagsButton.show();
-
-			_box.pack_start(_baselineSpectrumPlotButton);
-			_baselineSpectrumPlotButton.set_group(group);
-			_baselineSpectrumPlotButton.show();
-
-			_box.pack_start(_baselineRMSButton);
-			_baselineRMSButton.set_group(group);
-			_baselineRMSButton.show();
-
-			_box.pack_start(_iterationsButton);
-			_iterationsButton.set_group(group);
-			_iterationsButton.show();
-
-			switch(_action.PlotKind())
-			{
-				case rfiStrategy::PlotAction::AntennaFlagCountPlot:
-					_antennaVsFlagsButton.set_active(true);
-					break;
-				case rfiStrategy::PlotAction::FrequencyFlagCountPlot:
-					_frequencyVsFlagsButton.set_active(true);
-					break;
-				case rfiStrategy::PlotAction::FrequencyPowerPlot:
-					_frequencyVsPowerButton.set_active(true);
-					break;
-				case rfiStrategy::PlotAction::TimeFlagCountPlot:
-					_timeVsFlagsButton.set_active(true);
-					break;
-				case rfiStrategy::PlotAction::BaselineSpectrumPlot:
-					_baselineSpectrumPlotButton.set_active(true);
-					break;
-				case rfiStrategy::PlotAction::PolarizationStatisticsPlot:
-					_polarizationVsFlagsButton.set_active(true);
-					break;
-				case rfiStrategy::PlotAction::BaselineRMSPlot:
-					_baselineRMSButton.set_active(true);
-					break;
-				case rfiStrategy::PlotAction::IterationsPlot:
-					_iterationsButton.set_active(true);
-					break;
-			}
-
-			_logYScaleButton.set_active(_action.LogarithmicYAxis());
-			_box.pack_start(_logYScaleButton);
-			_logYScaleButton.show();
-
-			_buttonBox.pack_start(_applyButton);
-			_applyButton.signal_clicked().connect(sigc::mem_fun(*this, &StrategyPlotFrame::onApplyClicked));
-			_applyButton.show();
-
-			_box.pack_start(_buttonBox);
-			_buttonBox.show();
-
-			add(_box);
-			_box.show();
-		}
-	private:
-		EditStrategyWindow &_editStrategyWindow;
-		rfiStrategy::PlotAction &_action;
-
-		Gtk::VBox _box;
-		Gtk::HButtonBox _buttonBox;
-		Gtk::Label _plotKindLabel;
-		Gtk::RadioButton
-			_antennaVsFlagsButton, _frequencyVsFlagsButton, _frequencyVsPowerButton, _timeVsFlagsButton,
-			_polarizationVsFlagsButton, _baselineSpectrumPlotButton, _baselineRMSButton, _iterationsButton;
-		Gtk::CheckButton _logYScaleButton;
-		Gtk::Button _applyButton;
-
-		void onApplyClicked()
-		{
-			if(_antennaVsFlagsButton.get_active())
-				_action.SetPlotKind(rfiStrategy::PlotAction::AntennaFlagCountPlot);
-			else if(_frequencyVsFlagsButton.get_active())
-				_action.SetPlotKind(rfiStrategy::PlotAction::FrequencyFlagCountPlot);
-			else if(_frequencyVsPowerButton.get_active())
-				_action.SetPlotKind(rfiStrategy::PlotAction::FrequencyPowerPlot);
-			else if(_timeVsFlagsButton.get_active())
-				_action.SetPlotKind(rfiStrategy::PlotAction::TimeFlagCountPlot);
-			else if(_baselineSpectrumPlotButton.get_active())
-				_action.SetPlotKind(rfiStrategy::PlotAction::BaselineSpectrumPlot);
-			else if(_polarizationVsFlagsButton.get_active())
-				_action.SetPlotKind(rfiStrategy::PlotAction::PolarizationStatisticsPlot);
-			else if(_baselineRMSButton.get_active())
-				_action.SetPlotKind(rfiStrategy::PlotAction::BaselineRMSPlot);
-			else if(_iterationsButton.get_active())
-				_action.SetPlotKind(rfiStrategy::PlotAction::IterationsPlot);
-			_action.SetLogarithmicYAxis(_logYScaleButton.get_active());
-			_editStrategyWindow.UpdateAction(&_action);
-		}
-};
-
-#endif // STRATEGYFRAMES_PLOTFRAME_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/resamplingframe.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/resamplingframe.h
deleted file mode 100644
index 3148c8013b85c69b46d2ad81cc570da5c260b4e4..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/resamplingframe.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef RESAMPLINGFRAME_H
-#define RESAMPLINGFRAME_H
-
-#include <gtkmm/box.h>
-#include <gtkmm/button.h>
-#include <gtkmm/buttonbox.h>
-#include <gtkmm/frame.h>
-#include <gtkmm/label.h>
-#include <gtkmm/scale.h>
-
-#include <AOFlagger/strategy/actions/resamplingaction.h>
-
-#include <AOFlagger/gui/editstrategywindow.h>
-
-class ResamplingFrame : public Gtk::Frame {
-	public:
-		ResamplingFrame(rfiStrategy::ResamplingAction &action, EditStrategyWindow &editStrategyWindow)
-		: Gtk::Frame("Resampling"),
-		_editStrategyWindow(editStrategyWindow), _action(action),
-		_averagingButton("Average"),
-		_nnButton("Nearest neighbour"),
-		_sizeXLabel("Size x:"),
-		_sizeYLabel("Size y"),
-		_sizeXScale(1, 1024, 1),
-		_sizeYScale(1, 1024, 1),
-		_applyButton(Gtk::Stock::APPLY)
-		{
-			Gtk::RadioButton::Group group;
-			_averagingButton.set_group(group);
-			_box.pack_start(_averagingButton);
-			
-			_nnButton.set_group(group);
-			_box.pack_start(_nnButton);
-			if(_action.Operation() == rfiStrategy::ResamplingAction::Average)
-				_averagingButton.set_active(true);
-			else
-				_nnButton.set_active(true);
-			
-			_box.pack_start(_sizeXLabel);
-
-			_box.pack_start(_sizeXScale);
-			_sizeXScale.set_value(_action.SizeX());
-
-			_box.pack_start(_sizeYLabel);
-
-			_box.pack_start(_sizeYScale);
-			_sizeYScale.set_value(_action.SizeY());
-
-			_buttonBox.pack_start(_applyButton);
-			_applyButton.signal_clicked().connect(sigc::mem_fun(*this, &ResamplingFrame::onApplyClicked));
-
-			_box.pack_start(_buttonBox);
-
-			add(_box);
-			_box.show_all();
-		}
-	private:
-		EditStrategyWindow &_editStrategyWindow;
-		rfiStrategy::ResamplingAction &_action;
-
-		Gtk::VBox _box;
-		Gtk::HButtonBox _buttonBox;
-		Gtk::RadioButton _averagingButton, _nnButton;
-		Gtk::Label _sizeXLabel, _sizeYLabel;
-		Gtk::HScale _sizeXScale, _sizeYScale;
-		Gtk::Button _applyButton;
-
-		void onApplyClicked()
-		{
-			if(_averagingButton.get_active())
-				_action.SetOperation(rfiStrategy::ResamplingAction::Average);
-			else
-				_action.SetOperation(rfiStrategy::ResamplingAction::NearestNeighbour);
-			_action.SetSizeX((unsigned) _sizeXScale.get_value());
-			_action.SetSizeY((unsigned)_sizeYScale.get_value());
-			_editStrategyWindow.UpdateAction(&_action);
-		}
-};
-
-#endif // RESAMPLINGFRAME_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/setflaggingframe.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/setflaggingframe.h
deleted file mode 100644
index e10063a627f4275d86d83f9565555a521ed87f97..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/setflaggingframe.h
+++ /dev/null
@@ -1,155 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef SETFLAGGINGFRAME_H
-#define SETFLAGGINGFRAME_H
-
-#include <gtkmm/box.h>
-#include <gtkmm/button.h>
-#include <gtkmm/buttonbox.h>
-#include <gtkmm/frame.h>
-#include <gtkmm/label.h>
-#include <gtkmm/radiobutton.h>
-
-#include <AOFlagger/strategy/actions/setflaggingaction.h>
-
-#include <AOFlagger/gui/editstrategywindow.h>
-
-class SetFlaggingFrame : public Gtk::Frame {
-	public:
-		SetFlaggingFrame(rfiStrategy::SetFlaggingAction &action, EditStrategyWindow &editStrategyWindow)
-		: Gtk::Frame("Set flags"),
-		_editStrategyWindow(editStrategyWindow), _action(action),
-		_setNoneButton("Set none"),
-		_setAllButton("Set all"),
-		_setFromOriginalButton("Restore original"),
-		_setToOriginalButton("Change original"),
-		_setInvertButton("Invert"),
-		_setPolarisationsEqualButton("Equal polarisations"),
-		_flagZerosButton("Flag zeros"),
-		_orOriginalButton("Or with original"),
-		_applyButton(Gtk::Stock::APPLY)
-		{
-			Gtk::RadioButton::Group group;
-
-			_box.pack_start(_setNoneButton);
-			_setNoneButton.set_group(group);
-
-			_box.pack_start(_setAllButton);
-			_setAllButton.set_group(group);
-
-			_box.pack_start(_setFromOriginalButton);
-			_setFromOriginalButton.set_group(group);
-
-			_box.pack_start(_setToOriginalButton);
-			_setToOriginalButton.set_group(group);
-
-			_box.pack_start(_setInvertButton);
-			_setInvertButton.set_group(group);
-			
-			_box.pack_start(_setPolarisationsEqualButton);
-			_setPolarisationsEqualButton.set_group(group);
-
-			_box.pack_start(_flagZerosButton);
-			_flagZerosButton.set_group(group);
-
-			_box.pack_start(_orOriginalButton);
-			_orOriginalButton.set_group(group);
-
-			switch(_action.NewFlagging())
-			{
-				case rfiStrategy::SetFlaggingAction::None:
-					_setNoneButton.set_active(true);
-					break;
-				case rfiStrategy::SetFlaggingAction::Everything:
-					_setAllButton.set_active(true);
-					break;
-				case rfiStrategy::SetFlaggingAction::FromOriginal:
-					_setFromOriginalButton.set_active(true);
-					break;
-				case rfiStrategy::SetFlaggingAction::ToOriginal:
-					_setToOriginalButton.set_active(true);
-					break;
-				case rfiStrategy::SetFlaggingAction::Invert:
-					_setInvertButton.set_active(true);
-					break;
-				case rfiStrategy::SetFlaggingAction::PolarisationsEqual:
-					_setPolarisationsEqualButton.set_active(true);
-					break;
-				case rfiStrategy::SetFlaggingAction::FlagZeros:
-					_flagZerosButton.set_active(true);
-					break;
-				case rfiStrategy::SetFlaggingAction::OrOriginal:
-					_orOriginalButton.set_active(true);
-					break;
-			}
-
-			_setNoneButton.show();
-			_setAllButton.show();
-			_setFromOriginalButton.show();
-			_setToOriginalButton.show();
-			_setInvertButton.show();
-			_setPolarisationsEqualButton.show();
-			_flagZerosButton.show();
-			_orOriginalButton.show();
-
-			_buttonBox.pack_start(_applyButton);
-			_applyButton.signal_clicked().connect(sigc::mem_fun(*this, &SetFlaggingFrame::onApplyClicked));
-			_applyButton.show();
-
-			_box.pack_start(_buttonBox);
-			_buttonBox.show();
-
-			add(_box);
-			_box.show();
-		}
-	private:
-		EditStrategyWindow &_editStrategyWindow;
-		rfiStrategy::SetFlaggingAction &_action;
-
-		Gtk::VBox _box;
-		Gtk::HButtonBox _buttonBox;
-		Gtk::Label _baselinesLabel;
-		Gtk::RadioButton
-			_setNoneButton, _setAllButton, _setFromOriginalButton, _setToOriginalButton, _setInvertButton, _setPolarisationsEqualButton, _flagZerosButton, _orOriginalButton;
-		Gtk::Button _applyButton;
-
-		void onApplyClicked()
-		{
-			if(_setNoneButton.get_active())
-				_action.SetNewFlagging(rfiStrategy::SetFlaggingAction::None);
-			else if(_setAllButton.get_active())
-				_action.SetNewFlagging(rfiStrategy::SetFlaggingAction::Everything);
-			else if(_setFromOriginalButton.get_active())
-				_action.SetNewFlagging(rfiStrategy::SetFlaggingAction::FromOriginal);
-			else if(_setToOriginalButton.get_active())
-				_action.SetNewFlagging(rfiStrategy::SetFlaggingAction::ToOriginal);
-			else if(_setInvertButton.get_active())
-				_action.SetNewFlagging(rfiStrategy::SetFlaggingAction::Invert);
-			else if(_setPolarisationsEqualButton.get_active())
-				_action.SetNewFlagging(rfiStrategy::SetFlaggingAction::PolarisationsEqual);
-			else if(_flagZerosButton.get_active())
-				_action.SetNewFlagging(rfiStrategy::SetFlaggingAction::FlagZeros);
-			else if(_orOriginalButton.get_active())
-				_action.SetNewFlagging(rfiStrategy::SetFlaggingAction::OrOriginal);
-			_editStrategyWindow.UpdateAction(&_action);
-		}
-};
-
-#endif // SETFLAGGINGFRAME_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/setimageframe.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/setimageframe.h
deleted file mode 100644
index 9748a428cc61f244ef76a3f5c876086dd65ad006..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/setimageframe.h
+++ /dev/null
@@ -1,163 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef SETIMAGEFRAME_H
-#define SETIMAGEFRAME_H
-
-#include <gtkmm/box.h>
-#include <gtkmm/button.h>
-#include <gtkmm/buttonbox.h>
-#include <gtkmm/frame.h>
-#include <gtkmm/label.h>
-#include <gtkmm/radiobutton.h>
-
-#include <AOFlagger/strategy/actions/setimageaction.h>
-
-#include <AOFlagger/gui/editstrategywindow.h>
-
-class SetImageFrame : public Gtk::Frame {
-	public:
-		SetImageFrame(rfiStrategy::SetImageAction &action, EditStrategyWindow &editStrategyWindow)
-		: Gtk::Frame("Set image"),
-		_editStrategyWindow(editStrategyWindow), _action(action),
-		_zeroButton("Zero"),
-		_originalButton("Original"),
-		_revisedButton("Revised"),
-		_contaminatedToOriginalButton("Original=contaminated"),
-		_swapButton("Swap revised and contaminated"),
-		_replaceFlaggedValuesButton("Replace flagged values"),
-		_setFlaggedValuesToZeroButton("Set flagged values to zero"),
-		_interpolateNansButton("Interpolate NaNs"),
-		_addButton("Add instead of set"),
-		_applyButton(Gtk::Stock::APPLY)
-		{
-			Gtk::RadioButton::Group group;
-
-			_box.pack_start(_zeroButton);
-			_zeroButton.set_group(group);
-
-			_box.pack_start(_originalButton);
-			_originalButton.set_group(group);
-
-			_box.pack_start(_revisedButton);
-			_revisedButton.set_group(group);
-			
-			_box.pack_start(_contaminatedToOriginalButton);
-			_contaminatedToOriginalButton.set_group(group);
-
-			_box.pack_start(_swapButton);
-			_swapButton.set_group(group);
-
-			_box.pack_start(_replaceFlaggedValuesButton);
-			_replaceFlaggedValuesButton.set_group(group);
-			
-			_box.pack_start(_setFlaggedValuesToZeroButton);
-			_setFlaggedValuesToZeroButton.set_group(group);
-
-			_box.pack_start(_interpolateNansButton);
-			_interpolateNansButton.set_group(group);
-
-			switch(_action.NewImage())
-			{
-				case rfiStrategy::SetImageAction::Zero:
-				_zeroButton.set_active(true);
-					break;
-				case rfiStrategy::SetImageAction::FromOriginal:
-				_originalButton.set_active(true);
-					break;
-				case rfiStrategy::SetImageAction::FromRevised:
-				_revisedButton.set_active(true);
-					break;
-				case rfiStrategy::SetImageAction::ContaminatedToOriginal:
-				_contaminatedToOriginalButton.set_active(true);
-					break;
-				case rfiStrategy::SetImageAction::SwapRevisedAndContaminated:
-				_swapButton.set_active(true);
-					break;
-				case rfiStrategy::SetImageAction::ReplaceFlaggedValues:
-				_replaceFlaggedValuesButton.set_active(true);
-					break;
-				case rfiStrategy::SetImageAction::SetFlaggedValuesToZero:
-				_setFlaggedValuesToZeroButton.set_active(true);
-					break;
-				case rfiStrategy::SetImageAction::InterpolateNans:
-				_interpolateNansButton.set_active(true);
-					break;
-			}
-
-			_zeroButton.show();
-			_originalButton.show();
-			_revisedButton.show();
-			_contaminatedToOriginalButton.show();
-			_swapButton.show();
-			_replaceFlaggedValuesButton.show();
-			_setFlaggedValuesToZeroButton.show();
-			_interpolateNansButton.show();
-
-			_box.pack_start(_addButton);
-			_addButton.set_active(_action.Add());
-			_addButton.show();
-
-			_buttonBox.pack_start(_applyButton);
-			_applyButton.signal_clicked().connect(sigc::mem_fun(*this, &SetImageFrame::onApplyClicked));
-			_applyButton.show();
-
-			_box.pack_start(_buttonBox);
-			_buttonBox.show();
-
-			add(_box);
-			_box.show();
-		}
-	private:
-		EditStrategyWindow &_editStrategyWindow;
-		rfiStrategy::SetImageAction &_action;
-
-		Gtk::VBox _box;
-		Gtk::HButtonBox _buttonBox;
-		Gtk::Label _baselinesLabel;
-		Gtk::RadioButton
-			_zeroButton, _originalButton, _revisedButton, _contaminatedToOriginalButton, _swapButton, _replaceFlaggedValuesButton, _setFlaggedValuesToZeroButton, _interpolateNansButton;
-		Gtk::CheckButton
-			_addButton;
-		Gtk::Button _applyButton;
-
-		void onApplyClicked()
-		{
-			if(_zeroButton.get_active())
-				_action.SetNewImage(rfiStrategy::SetImageAction::Zero);
-			else if(_originalButton.get_active())
-				_action.SetNewImage(rfiStrategy::SetImageAction::FromOriginal);
-			else if(_revisedButton.get_active())
-				_action.SetNewImage(rfiStrategy::SetImageAction::FromRevised);
-			else if(_contaminatedToOriginalButton.get_active())
-				_action.SetNewImage(rfiStrategy::SetImageAction::ContaminatedToOriginal);
-			else if(_swapButton.get_active())
-				_action.SetNewImage(rfiStrategy::SetImageAction::SwapRevisedAndContaminated);
-			else if(_replaceFlaggedValuesButton.get_active())
-				_action.SetNewImage(rfiStrategy::SetImageAction::ReplaceFlaggedValues);
-			else if(_setFlaggedValuesToZeroButton.get_active())
-				_action.SetNewImage(rfiStrategy::SetImageAction::SetFlaggedValuesToZero);
-			else if(_interpolateNansButton.get_active())
-				_action.SetNewImage(rfiStrategy::SetImageAction::InterpolateNans);
-			_action.SetAdd(_addButton.get_active());
-			_editStrategyWindow.UpdateAction(&_action);
-		}
-};
-
-#endif // SETIMAGEFRAME_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/slidingwindowfitframe.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/slidingwindowfitframe.h
deleted file mode 100644
index b61b2e898c4552bec21e2833a03d5cd00dc49ee4..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/slidingwindowfitframe.h
+++ /dev/null
@@ -1,185 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef SLIDINGWINDOWFITFRAME_H
-#define SLIDINGWINDOWFITFRAME_H
-
-#include <gtkmm/box.h>
-#include <gtkmm/button.h>
-#include <gtkmm/buttonbox.h>
-#include <gtkmm/frame.h>
-#include <gtkmm/label.h>
-#include <gtkmm/scale.h>
-
-#include <AOFlagger/strategy/actions/slidingwindowfitaction.h>
-#include <AOFlagger/strategy/actions/slidingwindowfitparameters.h>
-
-#include <AOFlagger/gui/editstrategywindow.h>
-
-class SlidingWindowFitFrame : public Gtk::Frame {
-	public:
-		SlidingWindowFitFrame(rfiStrategy::SlidingWindowFitAction &action, EditStrategyWindow &editStrategyWindow)
-		: Gtk::Frame("Sliding window fit"), _editStrategyWindow(editStrategyWindow), _action(action),
-		_hWindowSizeScale(0.0, 400.0, 1.0),
-		_vWindowSizeScale(0.0, 400.0, 1.0),
-		_hKernelSizeScale(0.1, 1000.0, 0.1),
-		_vKernelSizeScale(0.1, 1000.0, 0.1),
-		_hWindowSizeLabel("Horizontal sliding window size:", Gtk::ALIGN_LEFT),
-		_vWindowSizeLabel("Vertical sliding window size:", Gtk::ALIGN_LEFT),
-		_hKernelSizeLabel("Horizontal kernel size:", Gtk::ALIGN_LEFT),
-		_vKernelSizeLabel("Vertical kernel size:", Gtk::ALIGN_LEFT),
-		_fitNoneButton("None"),
-		_fitAverageButton("Average"),
-		_fitWeightedAverageButton("W.Average"),
-		_fitMedianButton("Median"),
-		_fitMinimumButton("Minimum"),
-		_applyButton(Gtk::Stock::APPLY)
-		{
-			initParameterWidgets();
-		
-			_applyButton.signal_clicked().connect(sigc::mem_fun(*this, &SlidingWindowFitFrame::onApplyClicked));
-			_buttonBox.pack_start(_applyButton);
-			_applyButton.show();
-		
-			_buttonBox.show();
-			_box.pack_end(_buttonBox);
-		
-			_box.show();
-			add(_box);
-		}
-
-	private:
-		void initParameterWidgets()
-		{
-			initMethodWidgets();
-			initScales();
-		}
-
-		void initMethodWidgets()
-		{
-			Gtk::RadioButton::Group methodGroup;
-		
-			_fitNoneButton.set_group(methodGroup);
-			_box.pack_start(_fitNoneButton);
-		
-			_fitAverageButton.set_group(methodGroup);
-			_box.pack_start(_fitAverageButton);
-		
-			_fitWeightedAverageButton.set_group(methodGroup);
-			_box.pack_start(_fitWeightedAverageButton);
-		
-			_fitMedianButton.set_group(methodGroup);
-			_box.pack_start(_fitMedianButton);
-		
-			_fitMinimumButton.set_group(methodGroup);
-			_box.pack_start(_fitMinimumButton);
-
-			switch(_action.Parameters().method)
-			{
-				case rfiStrategy::SlidingWindowFitParameters::None:
-					_fitNoneButton.set_active(true);
-					break;
-				case rfiStrategy::SlidingWindowFitParameters::Average:
-					_fitAverageButton.set_active(true);
-					break;
-				case rfiStrategy::SlidingWindowFitParameters::GaussianWeightedAverage:
-					_fitWeightedAverageButton.set_active(true);
-					break;
-				case rfiStrategy::SlidingWindowFitParameters::Median:
-					_fitMedianButton.set_active(true);
-					break;
-				case rfiStrategy::SlidingWindowFitParameters::Minimum:
-					_fitMinimumButton.set_active(true);
-					break;
-			}
-
-			_fitNoneButton.show();
-			_fitAverageButton.show();
-			_fitWeightedAverageButton.show();
-			_fitMedianButton.show();
-			_fitMinimumButton.show();
-		}
-
-		void initScales()
-		{
-			_box.pack_start(_hWindowSizeLabel);
-			_hWindowSizeLabel.show();
-			_hWindowSizeScale.set_value(_action.Parameters().timeDirectionWindowSize);
-			_box.pack_start(_hWindowSizeScale);
-			_hWindowSizeScale.show();
-		
-			_box.pack_start(_vWindowSizeLabel);
-			_vWindowSizeLabel.show();
-			_vWindowSizeScale.set_value(_action.Parameters().frequencyDirectionWindowSize);
-			_box.pack_start(_vWindowSizeScale);
-			_vWindowSizeScale.show();
-		
-			_box.pack_start(_hKernelSizeLabel);
-			_hKernelSizeLabel.show();
-			_hKernelSizeScale.set_value(_action.Parameters().timeDirectionKernelSize);
-			_box.pack_start(_hKernelSizeScale);
-			_hKernelSizeScale.show();
-		
-			_box.pack_start(_vKernelSizeLabel);
-			_vKernelSizeLabel.show();
-			_vKernelSizeScale.set_value(_action.Parameters().frequencyDirectionKernelSize);
-			_box.pack_start(_vKernelSizeScale);
-			_vKernelSizeScale.show();
-		}
-
-		EditStrategyWindow &_editStrategyWindow;
-		rfiStrategy::SlidingWindowFitAction &_action;
-
-		Gtk::VBox _box;
-		Gtk::HButtonBox _buttonBox;
-		Gtk::HScale
-			_hWindowSizeScale, _vWindowSizeScale,
-			_hKernelSizeScale, _vKernelSizeScale;
-		Gtk::Label
-			_hWindowSizeLabel, _vWindowSizeLabel,
-			_hKernelSizeLabel, _vKernelSizeLabel;
-		Gtk::HScale _iterationCountScale;
-		Gtk::RadioButton
-			_fitNoneButton, _fitAverageButton, _fitWeightedAverageButton, _fitMedianButton, _fitMinimumButton;
-		Gtk::Button _applyButton;
-
-		void onApplyClicked()
-		{
-			enum rfiStrategy::SlidingWindowFitParameters::Method method;
-			if(_fitAverageButton.get_active())
-				method = rfiStrategy::SlidingWindowFitParameters::Average;
-			else if(_fitWeightedAverageButton.get_active())
-				method = rfiStrategy::SlidingWindowFitParameters::GaussianWeightedAverage;
-			else if(_fitMedianButton.get_active())
-				method = rfiStrategy::SlidingWindowFitParameters::Median;
-			else if(_fitMinimumButton.get_active())
-				method = rfiStrategy::SlidingWindowFitParameters::Minimum;
-			else
-				method = rfiStrategy::SlidingWindowFitParameters::None;
-			_action.Parameters().method = method;
-			_action.Parameters().timeDirectionWindowSize = (size_t) _hWindowSizeScale.get_value();
-			_action.Parameters().frequencyDirectionWindowSize = (size_t) _vWindowSizeScale.get_value();
-			_action.Parameters().timeDirectionKernelSize = _hKernelSizeScale.get_value();
-			_action.Parameters().frequencyDirectionKernelSize = _vKernelSizeScale.get_value();
-
-			_editStrategyWindow.UpdateAction(&_action);
-		}
-};
-
-#endif // SLIDINGWINDOWFITFRAME_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/spatialcompositionframe.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/spatialcompositionframe.h
deleted file mode 100644
index 37215c76a8817330da161e2e530026a32f95b811..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/spatialcompositionframe.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef SPATIALCOMPOSITIONFRAME_H
-#define SPATIALCOMPOSITIONFRAME_H
-
-#include <gtkmm/box.h>
-#include <gtkmm/button.h>
-#include <gtkmm/buttonbox.h>
-#include <gtkmm/frame.h>
-#include <gtkmm/label.h>
-#include <gtkmm/radiobutton.h>
-
-#include <AOFlagger/strategy/actions/spatialcompositionaction.h>
-
-#include <AOFlagger/gui/editstrategywindow.h>
-
-class SpatialCompositionFrame : public Gtk::Frame {
-	public:
-		SpatialCompositionFrame(rfiStrategy::SpatialCompositionAction &action, EditStrategyWindow &editStrategyWindow)
-		: Gtk::Frame("Set image"),
-		_editStrategyWindow(editStrategyWindow), _action(action),
-		_sumCrossButton("Sum cross correlations"),
-		_sumAutoButton("Sum auto correlations"),
-		_eigenvalueButton("First eigenvalues of complete matrix"),
-		_removeEigenvalueButton("Remove first eigenvalues"),
-		_applyButton(Gtk::Stock::APPLY)
-		{
-			Gtk::RadioButton::Group group;
-
-			_box.pack_start(_sumCrossButton);
-			_sumCrossButton.set_group(group);
-
-			_box.pack_start(_sumAutoButton);
-			_sumAutoButton.set_group(group);
-
-			_box.pack_start(_eigenvalueButton);
-			_eigenvalueButton.set_group(group);
-			
-			_box.pack_start(_removeEigenvalueButton);
-			_removeEigenvalueButton.set_group(group);
-			
-			switch(_action.Operation())
-			{
-				case rfiStrategy::SpatialCompositionAction::SumCrossCorrelationsOperation:
-				_sumCrossButton.set_active(true);
-					break;
-				case rfiStrategy::SpatialCompositionAction::SumAutoCorrelationsOperation:
-				_sumAutoButton.set_active(true);
-					break;
-				case rfiStrategy::SpatialCompositionAction::EigenvalueDecompositionOperation:
-				_eigenvalueButton.set_active(true);
-					break;
-				case rfiStrategy::SpatialCompositionAction::EigenvalueRemovalOperation:
-				_removeEigenvalueButton.set_active(true);
-					break;
-			}
-
-			_sumCrossButton.show();
-			_sumAutoButton.show();
-			_eigenvalueButton.show();
-			_removeEigenvalueButton.show();
-
-			_buttonBox.pack_start(_applyButton);
-			_applyButton.signal_clicked().connect(sigc::mem_fun(*this, &SpatialCompositionFrame::onApplyClicked));
-			_applyButton.show();
-
-			_box.pack_start(_buttonBox);
-			_buttonBox.show();
-
-			add(_box);
-			_box.show();
-		}
-	private:
-		EditStrategyWindow &_editStrategyWindow;
-		rfiStrategy::SpatialCompositionAction &_action;
-
-		Gtk::VBox _box;
-		Gtk::HButtonBox _buttonBox;
-		Gtk::Label _baselinesLabel;
-		Gtk::RadioButton
-			_sumCrossButton, _sumAutoButton, _eigenvalueButton, _removeEigenvalueButton;
-		Gtk::Button _applyButton;
-
-		void onApplyClicked()
-		{
-			if(_sumCrossButton.get_active())
-				_action.SetOperation(rfiStrategy::SpatialCompositionAction::SumCrossCorrelationsOperation);
-			else if(_sumAutoButton.get_active())
-				_action.SetOperation(rfiStrategy::SpatialCompositionAction::SumAutoCorrelationsOperation);
-			else if(_eigenvalueButton.get_active())
-				_action.SetOperation(rfiStrategy::SpatialCompositionAction::EigenvalueDecompositionOperation);
-			else if(_removeEigenvalueButton.get_active())
-				_action.SetOperation(rfiStrategy::SpatialCompositionAction::EigenvalueRemovalOperation);
-			_editStrategyWindow.UpdateAction(&_action);
-		}
-};
-
-#endif // SPATIALCOMPOSITIONFRAME_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/statisticalflaggingframe.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/statisticalflaggingframe.h
deleted file mode 100644
index 15c7b5efb080ddece5b11171c39177440eaa305a..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/statisticalflaggingframe.h
+++ /dev/null
@@ -1,105 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef STATISTICALFLAGGINGFRAME_H
-#define STATISTICALFLAGGINGFRAME_H
-
-#include <gtkmm/box.h>
-#include <gtkmm/button.h>
-#include <gtkmm/buttonbox.h>
-#include <gtkmm/frame.h>
-#include <gtkmm/label.h>
-#include <gtkmm/scale.h>
-
-#include <AOFlagger/strategy/actions/statisticalflagaction.h>
-
-#include <AOFlagger/gui/editstrategywindow.h>
-
-class StatisticalFlaggingFrame : public Gtk::Frame {
-	public:
-		StatisticalFlaggingFrame(rfiStrategy::StatisticalFlagAction &action, EditStrategyWindow &editStrategyWindow)
-		: Gtk::Frame("Statistical flagging"),
-		_editStrategyWindow(editStrategyWindow), _action(action),
-		_dilluteTimeSizeLabel("Dillution time size:"),
-		_dilluteTimeSizeScale(0, 100, 1),
-		_dilluteFrequencySizeLabel("Dillution frequency size:"),
-		_dilluteFrequencySizeScale(0, 100, 1),
-		_minTimeRatioLabel("Minimum time ratio:"),
-		_minTimeRatioScale(0, 100, 1),
-		_minFreqRatioLabel("Minimum frequency ratio:"),
-		_minFreqRatioScale(0, 100, 1),
-		_applyButton(Gtk::Stock::APPLY)
-		{
-			_box.pack_start(_dilluteTimeSizeLabel);
-
-			_dilluteTimeSizeScale.set_value(_action.EnlargeTimeSize());
-			_box.pack_start(_dilluteTimeSizeScale);
-
-			_box.pack_start(_dilluteFrequencySizeLabel);
-
-			_dilluteFrequencySizeScale.set_value(_action.EnlargeFrequencySize());
-			_box.pack_start(_dilluteFrequencySizeScale);
-
-			_box.pack_start(_minTimeRatioLabel);
-
-			_minTimeRatioScale.set_value(_action.MinimumGoodTimeRatio()*100.0);
-			_box.pack_start(_minTimeRatioScale);
-
-			_box.pack_start(_minFreqRatioLabel);
-
-			_minFreqRatioScale.set_value(_action.MinimumGoodFrequencyRatio()*100.0);
-			_box.pack_start(_minFreqRatioScale);
-
-			_buttonBox.pack_start(_applyButton);
-			_applyButton.signal_clicked().connect(sigc::mem_fun(*this, &StatisticalFlaggingFrame::onApplyClicked));
-
-			_box.pack_start(_buttonBox);
-
-			add(_box);
-			_box.show_all();
-		}
-	private:
-		EditStrategyWindow &_editStrategyWindow;
-		rfiStrategy::StatisticalFlagAction &_action;
-
-		Gtk::VBox _box;
-		Gtk::HButtonBox _buttonBox;
-		Gtk::Label _dilluteTimeSizeLabel;
-		Gtk::HScale _dilluteTimeSizeScale;
-		Gtk::Label _dilluteFrequencySizeLabel;
-		Gtk::HScale _dilluteFrequencySizeScale;
-		
-		Gtk::Label _minTimeRatioLabel;
-		Gtk::HScale _minTimeRatioScale;
-		Gtk::Label _minFreqRatioLabel;
-		Gtk::HScale _minFreqRatioScale;
-		
-		Gtk::Button _applyButton;
-
-		void onApplyClicked()
-		{
-			_action.SetEnlargeTimeSize((size_t) _dilluteTimeSizeScale.get_value());
-			_action.SetEnlargeFrequencySize((size_t) _dilluteFrequencySizeScale.get_value());
-			_action.SetMinimumGoodTimeRatio(_minTimeRatioScale.get_value()/100.0);
-			_action.SetMinimumGoodFrequencyRatio(_minFreqRatioScale.get_value()/100.0);
-			_editStrategyWindow.UpdateAction(&_action);
-		}
-};
-
-#endif // STATISTICALFLAGGINGFRAME_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/sumthresholdframe.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/sumthresholdframe.h
deleted file mode 100644
index e5be4eabf687955b79f36cffa5e316d7e6d0c5f6..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/sumthresholdframe.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef THRESHOLDFRAME_H
-#define THRESHOLDFRAME_H
-
-#include <gtkmm/box.h>
-#include <gtkmm/button.h>
-#include <gtkmm/buttonbox.h>
-#include <gtkmm/frame.h>
-#include <gtkmm/label.h>
-#include <gtkmm/scale.h>
-
-#include <AOFlagger/strategy/actions/sumthresholdaction.h>
-
-#include <AOFlagger/gui/editstrategywindow.h>
-
-class SumThresholdFrame : public Gtk::Frame {
-	public:
-		SumThresholdFrame(rfiStrategy::SumThresholdAction &action, EditStrategyWindow &editStrategyWindow)
-		: Gtk::Frame("SumThreshold"),
-		_editStrategyWindow(editStrategyWindow), _action(action),
-		_sensitivityLabel("Base sensitivity: (low = sensitive)"),
-		_sensitivityScale(0, 10, 0.1),
-		_timeDirectionButton("In time direction"),
-		_frequencyDirectionButton("In frequency direction"),
-		_applyButton(Gtk::Stock::APPLY)
-		{
-			_box.pack_start(_sensitivityLabel);
-			_sensitivityLabel.show();
-
-			_box.pack_start(_sensitivityScale);
-			_sensitivityScale.set_value(_action.BaseSensitivity());
-			_sensitivityScale.show();
-			
-			_timeDirectionButton.set_active(_action.TimeDirectionFlagging());
-			_buttonBox.pack_start(_timeDirectionButton);
-			_timeDirectionButton.show();
-
-			_frequencyDirectionButton.set_active(_action.FrequencyDirectionFlagging());
-			_buttonBox.pack_start(_frequencyDirectionButton);
-			_frequencyDirectionButton.show();
-
-			_buttonBox.pack_start(_applyButton);
-			_applyButton.signal_clicked().connect(sigc::mem_fun(*this, &SumThresholdFrame::onApplyClicked));
-			_applyButton.show();
-
-			_box.pack_start(_buttonBox);
-			_buttonBox.show();
-
-			add(_box);
-			_box.show();
-		}
-	private:
-		EditStrategyWindow &_editStrategyWindow;
-		rfiStrategy::SumThresholdAction &_action;
-
-		Gtk::VBox _box;
-		Gtk::HButtonBox _buttonBox;
-		Gtk::Label _sensitivityLabel;
-		Gtk::HScale _sensitivityScale;
-		Gtk::CheckButton _timeDirectionButton, _frequencyDirectionButton;
-		Gtk::Button _applyButton;
-
-		void onApplyClicked()
-		{
-			_action.SetBaseSensitivity(_sensitivityScale.get_value());
-			_action.SetTimeDirectionFlagging(_timeDirectionButton.get_active());
-			_action.SetFrequencyDirectionFlagging(_frequencyDirectionButton.get_active());
-			_editStrategyWindow.UpdateAction(&_action);
-		}
-};
-
-#endif // THRESHOLDFRAME_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/svdframe.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/svdframe.h
deleted file mode 100644
index 3f9be7a9c7bd29352c001df2846f9160f89a6de5..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/svdframe.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef SVDFRAME_H
-#define SVDFRAME_H
-
-#include <gtkmm/box.h>
-#include <gtkmm/button.h>
-#include <gtkmm/buttonbox.h>
-#include <gtkmm/frame.h>
-#include <gtkmm/label.h>
-#include <gtkmm/scale.h>
-
-#include <AOFlagger/strategy/actions/svdaction.h>
-
-#include <AOFlagger/gui/editstrategywindow.h>
-
-class SVDFrame : public Gtk::Frame {
-	public:
-		SVDFrame(rfiStrategy::SVDAction &svdAction, EditStrategyWindow &editStrategyWindow)
-		: Gtk::Frame("Singular value decomposition"),
-		_editStrategyWindow(editStrategyWindow), _svdAction(svdAction),
-		_singularValueCountLabel("Singular value count:"),
-		_singularValueCountScale(0, 100, 1),
-		_applyButton(Gtk::Stock::APPLY)
-		{
-			_box.pack_start(_singularValueCountLabel);
-			_singularValueCountLabel.show();
-
-			_box.pack_start(_singularValueCountScale);
-			_singularValueCountScale.set_value(_svdAction.SingularValueCount());
-			_singularValueCountScale.show();
-
-			_buttonBox.pack_start(_applyButton);
-			_applyButton.signal_clicked().connect(sigc::mem_fun(*this, &SVDFrame::onApplyClicked));
-			_applyButton.show();
-
-			_box.pack_start(_buttonBox);
-			_buttonBox.show();
-
-			add(_box);
-			_box.show();
-		}
-	private:
-		EditStrategyWindow &_editStrategyWindow;
-		rfiStrategy::SVDAction &_svdAction;
-
-		Gtk::VBox _box;
-		Gtk::HButtonBox _buttonBox;
-		Gtk::Label _singularValueCountLabel;
-		Gtk::HScale _singularValueCountScale;
-		Gtk::Button _applyButton;
-
-		void onApplyClicked()
-		{
-			_svdAction.SetSingularValueCount((size_t) _singularValueCountScale.get_value());
-			_editStrategyWindow.UpdateAction(&_svdAction);
-		}
-};
-
-#endif // SVDFRAME_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/timeconvolutionframe.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/timeconvolutionframe.h
deleted file mode 100644
index 3d2cae09009848af1685c549b901e82a95b2adc8..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/timeconvolutionframe.h
+++ /dev/null
@@ -1,211 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef TIMECONVOLUTIONFRAME_H
-#define TIMECONVOLUTIONFRAME_H
-
-#include <gtkmm/box.h>
-#include <gtkmm/button.h>
-#include <gtkmm/buttonbox.h>
-#include <gtkmm/frame.h>
-#include <gtkmm/label.h>
-#include <gtkmm/scale.h>
-
-#include <AOFlagger/strategy/actions/timeconvolutionaction.h>
-
-#include <AOFlagger/gui/editstrategywindow.h>
-
-class TimeConvolutionFrame : public Gtk::Frame {
-	public:
-		TimeConvolutionFrame(rfiStrategy::TimeConvolutionAction &action, EditStrategyWindow &editStrategyWindow)
-		: Gtk::Frame("UV project"),
-		_editStrategyWindow(editStrategyWindow), _action(action),
-		_singleSincOperationButton("Single sinc"),
-		_sincOperationButton("Sinc"),
-		_projectedSincOperationButton("Projected sinc"),
-		_projectedFourierOperationButton("Projected FT"),
-		_extrapolatedSincOperationButton("Extrapolated sinc"),
-		_iterativeExtrapolatedSincOperationButton("Iterative extr. sinc"),
-		_fftSincOperationButton("FFT sinc"),
-		_sincSizeLabel("Sinc size: (relative to uv track diameter)"),
-		_sincSizeScale(0, 10000, 1),
-		_angleLabel("Angle: (degrees)"),
-		_angleScale(-180, 180, 1),
-		_etaLabel("Eta"),
-		_etaScale(0, 1, 0.01),
-		_iterationsLabel("Iterations"),
-		_iterationsScale(0, 100, 1),
-		_channelAveragingSizeLabel("Channel averaging size"),
-		_channelAveragingSizeScale(0, 512, 1),
-		_sincScaleInSamplesButton("Sinc scale is in time steps"),
-		_autoAngleButton("Auto angle"),
-		_alwaysRemoveButton("Always remove"),
-		_hammingButton("Use hamming window"),
-		_applyButton(Gtk::Stock::APPLY)
-		{
-			Gtk::RadioButton::Group group;
-
-			_box.pack_start(_singleSincOperationButton);
-			_singleSincOperationButton.set_group(group);
-			_singleSincOperationButton.show();
-			
-			_box.pack_start(_sincOperationButton);
-			_sincOperationButton.set_group(group);
-			_sincOperationButton.show();
-			
-			_box.pack_start(_projectedSincOperationButton);
-			_projectedSincOperationButton.set_group(group);
-			_projectedSincOperationButton.show();
-
-			_box.pack_start(_projectedFourierOperationButton);
-			_projectedFourierOperationButton.set_group(group);
-			_projectedFourierOperationButton.show();
-
-			_box.pack_start(_extrapolatedSincOperationButton);
-			_extrapolatedSincOperationButton.set_group(group);
-			_extrapolatedSincOperationButton.show();
-
-			_box.pack_start(_iterativeExtrapolatedSincOperationButton);
-			_iterativeExtrapolatedSincOperationButton.set_group(group);
-			_iterativeExtrapolatedSincOperationButton.show();
-			
-			_box.pack_start(_fftSincOperationButton);
-			_fftSincOperationButton.set_group(group);
-			_fftSincOperationButton.show();
-
-			switch(action.Operation())
-			{
-				case rfiStrategy::TimeConvolutionAction::SingleSincOperation:
-					_singleSincOperationButton.set_active(true);
-					break;
-				case rfiStrategy::TimeConvolutionAction::SincOperation:
-					_sincOperationButton.set_active(true);
-					break;
-				case rfiStrategy::TimeConvolutionAction::ProjectedSincOperation:
-					_projectedSincOperationButton.set_active(true);
-					break;
-				case rfiStrategy::TimeConvolutionAction::ProjectedFTOperation:
-					_projectedFourierOperationButton.set_active(true);
-					break;
-				case rfiStrategy::TimeConvolutionAction::ExtrapolatedSincOperation:
-					_extrapolatedSincOperationButton.set_active(true);
-					break;
-				case rfiStrategy::TimeConvolutionAction::IterativeExtrapolatedSincOperation:
-					_iterativeExtrapolatedSincOperationButton.set_active(true);
-					break;
-				case rfiStrategy::TimeConvolutionAction::FFTSincOperation:
-					_fftSincOperationButton.set_active(true);
-					break;
-			}
-
-			_box.pack_start(_sincSizeLabel);
-
-			_box.pack_start(_sincSizeScale);
-			_sincSizeScale.set_value(action.SincScale());
-			
-			_box.pack_start(_angleLabel);
-
-			_box.pack_start(_angleScale);
-			_angleScale.set_value(action.DirectionRad()*180.0/M_PI);
-			
-			_box.pack_start(_etaLabel);
-
-			_box.pack_start(_etaScale);
-			_etaScale.set_value(action.EtaParameter());
-			
-			_box.pack_start(_iterationsLabel);
-
-			_box.pack_start(_iterationsScale);
-			_iterationsScale.set_value(action.Iterations());
-			
-			_box.pack_start(_channelAveragingSizeLabel);
-
-			_box.pack_start(_channelAveragingSizeScale);
-			_channelAveragingSizeScale.set_value(action.ChannelAveragingSize());
-			
-			_box.pack_start(_sincScaleInSamplesButton);
-			_sincScaleInSamplesButton.set_active(action.IsSincScaleInSamples());
-
-			_box.pack_start(_autoAngleButton);
-			_autoAngleButton.set_active(action.AutoAngle());
-
-			_box.pack_start(_alwaysRemoveButton);
-			_alwaysRemoveButton.set_active(action.AlwaysRemove());
-			
-			_box.pack_start(_hammingButton);
-			_hammingButton.set_active(action.UseHammingWindow());
-
-			_buttonBox.pack_start(_applyButton);
-			_applyButton.signal_clicked().connect(sigc::mem_fun(*this, &TimeConvolutionFrame::onApplyClicked));
-
-			_box.pack_start(_buttonBox);
-
-			add(_box);
-			_box.show_all();
-		}
-	private:
-		EditStrategyWindow &_editStrategyWindow;
-		rfiStrategy::TimeConvolutionAction &_action;
-
-		Gtk::VBox _box;
-		Gtk::HButtonBox _buttonBox;
-		Gtk::RadioButton _singleSincOperationButton, _sincOperationButton, _projectedSincOperationButton, _projectedFourierOperationButton, _extrapolatedSincOperationButton, _iterativeExtrapolatedSincOperationButton, _fftSincOperationButton;
-		Gtk::Label _sincSizeLabel;
-		Gtk::HScale _sincSizeScale;
-		Gtk::Label _angleLabel;
-		Gtk::HScale _angleScale;
-		Gtk::Label _etaLabel;
-		Gtk::HScale _etaScale;
-		Gtk::Label _iterationsLabel;
-		Gtk::HScale _iterationsScale;
-		Gtk::Label _channelAveragingSizeLabel;
-		Gtk::HScale _channelAveragingSizeScale;
-		Gtk::CheckButton _sincScaleInSamplesButton, _autoAngleButton, _alwaysRemoveButton, _hammingButton;
-		Gtk::Button _applyButton;
-
-		void onApplyClicked()
-		{
-			_action.SetDirectionRad((num_t) _angleScale.get_value()/180.0*M_PI);
-			_action.SetSincScale(_sincSizeScale.get_value());
-			_action.SetEtaParameter(_etaScale.get_value());
-			_action.SetIterations((unsigned) _iterationsScale.get_value());
-			_action.SetIsSincScaleInSamples(_sincScaleInSamplesButton.get_active());
-			_action.SetAutoAngle(_autoAngleButton.get_active());
-			_action.SetAlwaysRemove(_alwaysRemoveButton.get_active());
-			_action.SetChannelAveragingSize((unsigned) _channelAveragingSizeScale.get_value());
-			_action.SetUseHammingWindow(_hammingButton.get_active());
-			if(_singleSincOperationButton.get_active())
-				_action.SetOperation(rfiStrategy::TimeConvolutionAction::SingleSincOperation);
-			else if(_sincOperationButton.get_active())
-				_action.SetOperation(rfiStrategy::TimeConvolutionAction::SincOperation);
-			else if(_projectedSincOperationButton.get_active())
-				_action.SetOperation(rfiStrategy::TimeConvolutionAction::ProjectedSincOperation);
-			else if(_projectedFourierOperationButton.get_active())
-				_action.SetOperation(rfiStrategy::TimeConvolutionAction::ProjectedFTOperation);
-			else if(_extrapolatedSincOperationButton.get_active())
-				_action.SetOperation(rfiStrategy::TimeConvolutionAction::ExtrapolatedSincOperation);
-			else if(_iterativeExtrapolatedSincOperationButton.get_active())
-				_action.SetOperation(rfiStrategy::TimeConvolutionAction::IterativeExtrapolatedSincOperation);
-			else // if(_fftSincOperationButton
-				_action.SetOperation(rfiStrategy::TimeConvolutionAction::FFTSincOperation);
-			_editStrategyWindow.UpdateAction(&_action);
-		}
-};
-
-#endif // TIMECONVOLUTIONFRAME_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/timeselectionframe.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/timeselectionframe.h
deleted file mode 100644
index 58c317d9a5d185a31a5e0e1516d4b3a533152969..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/timeselectionframe.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef TIMESELECTIONFRAME_H
-#define TIMESELECTIONFRAME_H
-
-#include <gtkmm/box.h>
-#include <gtkmm/button.h>
-#include <gtkmm/buttonbox.h>
-#include <gtkmm/frame.h>
-#include <gtkmm/label.h>
-#include <gtkmm/scale.h>
-
-#include <AOFlagger/strategy/actions/timeselectionaction.h>
-
-#include <AOFlagger/gui/editstrategywindow.h>
-
-class TimeSelectionFrame : public Gtk::Frame {
-	public:
-		TimeSelectionFrame(rfiStrategy::TimeSelectionAction &action, EditStrategyWindow &editStrategyWindow)
-		: Gtk::Frame("Time selection"),
-		_editStrategyWindow(editStrategyWindow), _action(action),
-		_thresholdLabel("Threshold:"),
-		_thresholdScale(0, 10, 0.1),
-		_applyButton(Gtk::Stock::APPLY)
-		{
-			_box.pack_start(_thresholdLabel);
-
-			_box.pack_start(_thresholdScale);
-			_thresholdScale.set_value(_action.Threshold());
-
-			_buttonBox.pack_start(_applyButton);
-			_applyButton.signal_clicked().connect(sigc::mem_fun(*this, &TimeSelectionFrame::onApplyClicked));
-
-			_box.pack_start(_buttonBox);
-
-			add(_box);
-			_box.show_all();
-		}
-	private:
-		EditStrategyWindow &_editStrategyWindow;
-		rfiStrategy::TimeSelectionAction &_action;
-
-		Gtk::VBox _box;
-		Gtk::HButtonBox _buttonBox;
-		Gtk::Label _thresholdLabel;
-		Gtk::HScale _thresholdScale;
-		Gtk::Button _applyButton;
-
-		void onApplyClicked()
-		{
-			_action.SetThreshold(_thresholdScale.get_value());
-			_editStrategyWindow.UpdateAction(&_action);
-		}
-};
-
-#endif // TIMESELECTIONFRAME_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/uvprojectframe.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/uvprojectframe.h
deleted file mode 100644
index 2065b8e51cc980b2ff9fd2c75a9ec33e490d40ea..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/uvprojectframe.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef UV_PROJECT_FRAME_H
-#define UV_PROJECT_FRAME_H
-
-#include <gtkmm/box.h>
-#include <gtkmm/button.h>
-#include <gtkmm/buttonbox.h>
-#include <gtkmm/frame.h>
-#include <gtkmm/label.h>
-#include <gtkmm/scale.h>
-
-#include <AOFlagger/strategy/actions/uvprojectaction.h>
-
-#include <AOFlagger/gui/editstrategywindow.h>
-
-class UVProjectFrame : public Gtk::Frame {
-	public:
-		UVProjectFrame(rfiStrategy::UVProjectAction &action, EditStrategyWindow &editStrategyWindow)
-		: Gtk::Frame("UV project"),
-		_editStrategyWindow(editStrategyWindow), _action(action),
-		_onRevisedButton("On revised"),
-		_onContaminatedButton("On contaminated"),
-		_angleLabel("Angle: (degrees)"),
-		_angleScale(-180, 180, 0.1),
-		_etaLabel("Eta: (ratio)"),
-		_etaScale(0.0, 1.0, 0.01),
-		_reverseButton("Reverse"),
-		_applyButton(Gtk::Stock::APPLY)
-		{
-			_box.pack_start(_onRevisedButton);
-			_onRevisedButton.set_active(action.OnRevised());
-			_onRevisedButton.show();
-			
-			_box.pack_start(_onContaminatedButton);
-			_onContaminatedButton.set_active(action.OnContaminated());
-			_onContaminatedButton.show();
-			
-			_box.pack_start(_angleLabel);
-			_angleLabel.show();
-
-			_box.pack_start(_angleScale);
-			_angleScale.set_value(action.DirectionRad()*180.0/M_PI);
-			_angleScale.show();
-			
-			_box.pack_start(_etaLabel);
-			_etaLabel.show();
-
-			_box.pack_start(_etaScale);
-			_etaScale.set_value(action.EtaParameter());
-			_etaScale.show();
-			
-			_box.pack_start(_reverseButton);
-			_reverseButton.set_active(action.Reverse());
-			_reverseButton.show();
-
-			_buttonBox.pack_start(_applyButton);
-			_applyButton.signal_clicked().connect(sigc::mem_fun(*this, &UVProjectFrame::onApplyClicked));
-			_applyButton.show();
-
-			_box.pack_start(_buttonBox);
-			_buttonBox.show();
-
-			add(_box);
-			_box.show();
-		}
-	private:
-		EditStrategyWindow &_editStrategyWindow;
-		rfiStrategy::UVProjectAction &_action;
-
-		Gtk::VBox _box;
-		Gtk::HButtonBox _buttonBox;
-		Gtk::CheckButton _onRevisedButton, _onContaminatedButton;
-		Gtk::Label _angleLabel;
-		Gtk::HScale _angleScale;
-		Gtk::Label _etaLabel;
-		Gtk::HScale _etaScale;
-		Gtk::CheckButton _reverseButton;
-		Gtk::Button _applyButton;
-
-		void onApplyClicked()
-		{
-			_action.SetOnRevised(_onRevisedButton.get_active());
-			_action.SetOnContaminated(_onContaminatedButton.get_active());
-			_action.SetDirectionRad((num_t) _angleScale.get_value()/180.0*M_PI);
-			_action.SetEtaParameter(_etaScale.get_value());
-			_action.SetReverse(_reverseButton.get_active());
-			_editStrategyWindow.UpdateAction(&_action);
-		}
-};
-
-#endif // UV_PROJECT_FRAME_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/tfstatoptionwindow.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/tfstatoptionwindow.h
deleted file mode 100644
index 7225f845ebf5b92aa596656cc3fd17913fe92dbb..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/gui/tfstatoptionwindow.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef TFSTATOPTIONWINDOW_H
-#define TFSTATOPTIONWINDOW_H
-
-#include <string>
-
-#include <gtkmm/box.h>
-#include <gtkmm/button.h>
-#include <gtkmm/buttonbox.h>
-#include <gtkmm/label.h>
-#include <gtkmm/frame.h>
-#include <gtkmm/radiobutton.h>
-#include <gtkmm/scale.h>
-#include <gtkmm/window.h>
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class TFStatOptionWindow : public Gtk::Window {
-	public:
-		TFStatOptionWindow(class MSWindow &msWindow, const std::string &filename);
-		~TFStatOptionWindow() { }
-		void onOpen();
-	private:
-		void initModeButtons();
-
-		class MSWindow &_msWindow;
-		const std::string _filename;
-
-		Gtk::HButtonBox _bottomButtonBox;
-		Gtk::VBox _topVBox;
-		Gtk::Button _openButton;
-		Gtk::Frame _modeFrame;
-		Gtk::VBox _modeBox;
-		Gtk::RadioButton _rfiPercentangeButton, _totalAmplitudeButton, _rfiAmplitudeButton, _nonRfiAmplitudeButton;
-};
-
-#endif // TFSTATOPTIONWINDOW_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/imaging/defaultmodels.h b/CEP/DP3/AOFlagger/include/AOFlagger/imaging/defaultmodels.h
deleted file mode 100644
index e668df3cf976910b0d1a8bff96f214a48fdb16a5..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/imaging/defaultmodels.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef DEFAULTMODELS_H
-#define DEFAULTMODELS_H
-
-#include <AOFlagger/imaging/model.h>
-#include <AOFlagger/imaging/observatorium.h>
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class DefaultModels {
-	public:
-		enum SetLocation { EmptySet, NCPSet, B1834Set };
-		enum Distortion { NoDistortion, ConstantDistortion, VariableDistortion, FaintDistortion, MislocatedDistortion, OnAxisSource };
-
-		static double DistortionRA()
-		{
-			return 4.940;
-		}
-		
-		static double DistortionDec()
-		{
-			return 0.571;
-		}
-		
-		static std::pair<TimeFrequencyData, TimeFrequencyMetaDataPtr> LoadSet(enum SetLocation setLocation, enum Distortion distortion, double noiseSigma, size_t channelCount = 64, double bandwidth = 2500000.0*16.0, unsigned a1=0, unsigned a2=5)
-		{
-			double ra, dec, factor;
-			getSetData(setLocation, ra, dec, factor);
-			Model model;
-			model.SetNoiseSigma(noiseSigma);
-			if(setLocation != EmptySet)
-				model.loadUrsaMajor(ra, dec, factor);
-			switch(distortion)
-			{
-				case NoDistortion:
-					break;
-				case ConstantDistortion:
-					model.loadUrsaMajorDistortingSource(ra, dec, factor, true);
-					break;
-				case VariableDistortion:
-					model.loadUrsaMajorDistortingVariableSource(ra, dec, factor, false, false);
-					break;
-				case FaintDistortion:
-					model.loadUrsaMajorDistortingVariableSource(ra, dec, factor, true, false);
-					break;
-				case MislocatedDistortion:
-					model.loadUrsaMajorDistortingVariableSource(ra, dec, factor, false, true);
-					break;
-				case OnAxisSource:
-					model.loadOnAxisSource(ra, dec, factor);
-					break;
-			}
-			WSRTObservatorium wsrtObservatorium(channelCount, bandwidth);
-			return model.SimulateObservation(wsrtObservatorium, dec, ra, a1, a2);
-		}
-	
-	private:
-		static void getSetData(enum SetLocation setLocation, double &ra, double &dec, double &factor)
-		{
-			if(setLocation == NCPSet)
-			{
-				dec = 0.5*M_PI + 0.12800;
-				ra = -0.03000;
-				factor = 1.0;
-			} else {
-				dec = 1.083;
-				ra = 4.865;
-				factor = 4.0;
-			}
-		}
-	
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/imaging/fourproductcorrelatortester.h b/CEP/DP3/AOFlagger/include/AOFlagger/imaging/fourproductcorrelatortester.h
deleted file mode 100644
index 35a3bb8fbf78700d3eb215b118bf9b305eb91877..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/imaging/fourproductcorrelatortester.h
+++ /dev/null
@@ -1,32 +0,0 @@
-#ifndef FOURPRODUCTCORRELATORTESTER_H
-#define FOURPRODUCTCORRELATORTESTER_H
-
-#include <AOFlagger/msio/types.h>
-
-#include <cstring>
-
-class FourProductCorrelatorTester
-{
-	public:
-		FourProductCorrelatorTester(class Model &model, class UVImager &imager, class Observatorium &observatorium);
-	
-		void SimulateObservation(num_t delayDirectionDEC, num_t delayDirectionRA, num_t frequency);
-	
-		void SimulateCorrelation(num_t delayDirectionDEC, num_t delayDirectionRA, const class AntennaInfo &a1, const class AntennaInfo &a2, const class AntennaInfo &a3, const class AntennaInfo &a4, num_t frequency, double totalTime, double integrationTime);
-
-		void SimulateTwoProdObservation(num_t delayDirectionDEC, num_t delayDirectionRA, num_t frequency);
-	
-		void SimulateTwoProdCorrelation(num_t delayDirectionDEC, num_t delayDirectionRA, const class AntennaInfo &a1, const class AntennaInfo &a2, num_t frequency, double totalTime, double integrationTime);
-	private:
-		void SimulateAntenna(double time, num_t delayDirectionDEC, num_t delayDirectionRA, num_t dx, num_t dy, num_t frequency, num_t earthLattitude, num_t &r, num_t &i, size_t index);
-
-		void complexSqrt(num_t &r, num_t &i);
-		void phaseMul2(num_t &r, num_t &i);
-		void amplitudeSqrt(num_t &r, num_t &i);
-		class Model &_model;
-		class UVImager &_imager;
-		class Observatorium &_observatorium;
-		bool _incoherent;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/imaging/model.h b/CEP/DP3/AOFlagger/include/AOFlagger/imaging/model.h
deleted file mode 100644
index b73c713c6ff3b0e3d33ca76317ed3e039d0de8fb..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/imaging/model.h
+++ /dev/null
@@ -1,153 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef MODEL_H
-#define MODEL_H
-
-#include <vector>
-#include <cmath>
-
-#include <AOFlagger/msio/image2d.h>
-#include <AOFlagger/msio/types.h>
-
-#include <AOFlagger/imaging/uvimager.h>
-
-template<typename T>
-struct OutputReceiver
-{
-	void SetY(size_t) { }
-};
-template<>
-struct OutputReceiver<UVImager>
-{
-	UVImager *_imager;
-	void SetUVValue(size_t, double u, double v, double r, double i, double w)
-	{
-		_imager->SetUVValue(u, v, r, i, w);
-		_imager->SetUVValue(-u, -v, r, -i, w);
-	}
-	void SetY(size_t) { }
-};
-template<>
-struct OutputReceiver<TimeFrequencyData>
-{
-	Image2DPtr _real, _imaginary;
-	size_t _y;
-	void SetUVValue(size_t x, double, double, double r, double i, double)
-	{
-		_real->SetValue(x, _y, r);
-		_imaginary->SetValue(x, _y, i);
-	}
-	void SetY(size_t y) { _y = y; }
-};
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class Model {
-	struct Source {
-		virtual ~Source() { }
-		virtual numl_t Dec(num_t t) const = 0;
-		virtual numl_t Ra(num_t t) const = 0;
-		virtual numl_t FluxIntensity(num_t t) const = 0;
-		virtual numl_t SqrtFluxIntensity(num_t t) const
-		{
-			return sqrtnl(FluxIntensity(t));
-		}
-	};
-	struct StablePointSource : public Source {
-		long double dec, ra, fluxIntensity, sqrtFluxIntensity;
-		virtual numl_t Dec(num_t) const { return dec; }
-		virtual numl_t Ra(num_t) const { return ra; }
-		virtual numl_t FluxIntensity(num_t) const { return fluxIntensity; }
-		virtual numl_t SqrtFluxIntensity(num_t) const { return sqrtFluxIntensity; }
-	};
-	struct VariablePointSource : public Source {
-		long double dec, ra, fluxIntensity;
-		double peakTime, oneOverSigmaSq;
-		virtual numl_t Dec(num_t) const { return dec; }
-		virtual numl_t Ra(num_t) const { return ra; }
-		virtual numl_t FluxIntensity(num_t t) const
-		{
-			numl_t mu = fmodnl(fabsnl(t-peakTime), 1.0);
-			if(mu > 0.5) mu = 1.0 - mu;
-			return fluxIntensity * (1.0+expnl(mu*mu*oneOverSigmaSq)) * (1.0 + fmod(t*1007.0, 13.0) / 26.0);
-		}
-	};
-	
-	public:
-		Model();
-		~Model();
-		void AddSource(long double dec, long double ra, long double fluxIntensity)
-		{
-			StablePointSource *source = new StablePointSource();
-			source->dec = dec;
-			source->ra = ra;
-			source->fluxIntensity = fluxIntensity;
-			source->sqrtFluxIntensity = sqrt(fluxIntensity);
-			_sources.push_back(source);
-		}
-		void AddVariableSource(long double dec, long double ra, long double fluxIntensity)
-		{
-			VariablePointSource *source = new VariablePointSource();
-			source->dec = dec;
-			source->ra = ra;
-			source->fluxIntensity = fluxIntensity;
-			source->peakTime = 0.2;
-			source->oneOverSigmaSq = 1.0/(0.3*0.3);
-			_sources.push_back(source);
-		}
-		void SimulateAntenna(double time, num_t delayDirectionDEC, num_t delayDirectionRA, num_t dx, num_t dy, num_t frequency, num_t earthLattitude, num_t &r, num_t &i);
-		void SimulateUncoherentAntenna(double time, num_t delayDirectionDEC, num_t delayDirectionRA, num_t dx, num_t dy, num_t frequency, num_t earthLattitude, num_t &r, num_t &i, size_t index);
-
-		template<typename T>
-		void SimulateCorrelation(struct OutputReceiver<T> &receiver, num_t delayDirectionDEC, num_t delayDirectionRA, num_t dx, num_t dy, num_t dz, num_t frequency, num_t channelWidth, double totalTime, double integrationTime);
-
-		void SimulateObservation(class UVImager &imager, class Observatorium &observatorium, num_t delayDirectionDEC, num_t delayDirectionRA)
-		{
-			srand(1);
-			OutputReceiver<UVImager> imagerOutputter;
-			imagerOutputter._imager = &imager;
-			SimulateObservation(imagerOutputter, observatorium, delayDirectionDEC, delayDirectionRA);
-		}
-
-		std::pair<TimeFrequencyData, TimeFrequencyMetaDataPtr> SimulateObservation(class Observatorium &observatorium, num_t delayDirectionDEC, num_t delayDirectionRA, size_t a1, size_t a2);
-
-		template<typename T>
-		void SimulateObservation(struct OutputReceiver<T> &receiver, class Observatorium &observatorium, num_t delayDirectionDEC, num_t delayDirectionRA);
-
-		static void GetUVPosition(num_t &u, num_t &v, num_t earthLattitudeAngle, num_t delayDirectionDEC, num_t delayDirectionRA, num_t dx, num_t dy, num_t dz, num_t waveLength);
-		static num_t GetWPosition(num_t delayDirectionDec, num_t delayDirectionRA, num_t frequency, num_t earthLattitudeAngle, num_t dx, num_t dy)
-		{
-			return UVImager::GetWPosition(delayDirectionDec, delayDirectionRA, frequency, earthLattitudeAngle, dx, dy);
-		}
-
-		void loadUrsaMajor(double ra, double dec, double factor);
-		void loadUrsaMajorDistortingSource(double ra, double dec, double factor, bool slightlyMiss = false);
-		void loadUrsaMajorDistortingVariableSource(double ra, double dec, double factor, bool weak=false, bool slightlyMiss=false);
-		void loadOnAxisSource(double ra, double dec, double factor);
-		
-		double NoiseSigma() const { return _noiseSigma; }
-		void SetNoiseSigma(double noiseSigma) { _noiseSigma = noiseSigma; }
-	private:
-		std::vector<Source *> _sources;
-		double _noiseSigma, _sourceSigma;
-		double _integrationTime;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/imaging/observatorium.h b/CEP/DP3/AOFlagger/include/AOFlagger/imaging/observatorium.h
deleted file mode 100644
index f209435a9ef3bf853c6578f16a54080099d12694..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/imaging/observatorium.h
+++ /dev/null
@@ -1,188 +0,0 @@
-#ifndef OBSERVATORIUM_H
-#define OBSERVATORIUM_H
-
-#include <vector>
-
-#include <AOFlagger/msio/antennainfo.h>
-
-class Observatorium
-{
-	public:
-		void AddAntenna(AntennaInfo &antenna)
-		{
-			_antennae.push_back(antenna);
-		}
-		size_t AntennaCount() const { return _antennae.size(); }
-		const AntennaInfo &GetAntenna(size_t index) const { return _antennae[index]; }
-		
-		void SetChannelWidthHz(double channelWidthHz)
-		{
-			_channelWidthHz = channelWidthHz;
-		}
-		double ChannelWidthHz() const { return _channelWidthHz; }
-		
-		const class BandInfo &BandInfo() const
-		{
-			return _bandInfo;
-		}
-	protected:
-		class BandInfo &GetBandInfo() { return _bandInfo; }
-	private:
-		std::vector<AntennaInfo> _antennae;
-		double _channelWidthHz;
-		class BandInfo _bandInfo;
-};
-
-struct WSRTObservatorium : public Observatorium
-{
-	explicit WSRTObservatorium(size_t channelCount = 16*4, double bandwidthHz = 2500000.0 * 16.0)
-	{
-		AntennaInfo antennas[14];
-		for(unsigned i=0;i<14;++i)
-		{
-			WSRTCommon(antennas[i]);
-			WSRTn(i, antennas[i]);
-			AddAntenna(antennas[i]);
-		}
-		SetChannelWidthHz(bandwidthHz / channelCount);
-		initBand(channelCount);
-	}
-	explicit WSRTObservatorium(size_t antenna1, size_t antenna2, size_t channelCount = 16*4)
-	{
-		AntennaInfo antennas[2];
-		WSRTCommon(antennas[0]);
-		WSRTCommon(antennas[1]);
-		WSRTn(antenna1, antennas[0]);
-		WSRTn(antenna2, antennas[1]);
-		AddAntenna(antennas[0]);
-		AddAntenna(antennas[1]);
-		SetChannelWidthHz(10000.0 * 256.0 * 16.0 / channelCount);
-		initBand(channelCount);
-	}
-
-	private:
-		void WSRTCommon(AntennaInfo &antenna)
-		{
-			antenna.diameter = 25;
-			antenna.mount = "equatorial";
-			antenna.station = "WSRT";
-		}
-		void WSRTn(size_t antennaIndex, AntennaInfo &antenna)
-		{
-			switch(antennaIndex)
-			{
-				case 0:
-					antenna.id = 0;
-					antenna.name = "RT0";
-					antenna.position.x = 3.82876e+06;
-					antenna.position.y = 442449;
-					antenna.position.z = 5.06492e+06;
-				break;
-				case 1:
-					antenna.id = 1;
-					antenna.name = "RT1";
-					antenna.position.x = 3.82875e+06;
-					antenna.position.y = 442592;
-					antenna.position.z = 5.06492e+06;
-				break;
-				case 2:
-					antenna.id = 2;
-					antenna.name = "RT2";
-					antenna.position.x = 3.82873e+06;
-					antenna.position.y = 442735;
-					antenna.position.z = 5.06492e+06;
-				break;
-				case 3:
-					antenna.id = 3;
-					antenna.name = "RT3";
-					antenna.position.x = 3.82871e+06;
-					antenna.position.y = 442878;
-					antenna.position.z = 5.06492e+06;
-				break;
-				case 4:
-					antenna.id = 4;
-					antenna.name = "RT4";
-					antenna.position.x = 3.8287e+06;
-					antenna.position.y = 443021;
-					antenna.position.z = 5.06492e+06;
-				break;
-				case 5:
-					antenna.id = 5;
-					antenna.name = "RT5";
-					antenna.position.x = 3.82868e+06;
-					antenna.position.y = 443164;
-					antenna.position.z = 5.06492e+06;
-				break;
-				case 6:
-					antenna.id = 6;
-					antenna.name = "RT6";
-					antenna.position.x = 3.82866e+06;
-					antenna.position.y = 443307;
-					antenna.position.z = 5.06492e+06;
-				break;
-				case 7:
-					antenna.id = 7;
-					antenna.name = "RT7";
-					antenna.position.x = 3.82865e+06;
-					antenna.position.y = 443450;
-					antenna.position.z = 5.06492e+06;
-				break;
-				case 8:
-					antenna.id = 8;
-					antenna.name = "RT8";
-					antenna.position.x = 3.82863e+06;
-					antenna.position.y = 443593;
-					antenna.position.z = 5.06492e+06;
-				break;
-				case 9:
-					antenna.id = 9;
-					antenna.name = "RT9";
-					antenna.position.x = 3.82861e+06;
-					antenna.position.y = 443736;
-					antenna.position.z = 5.06492e+06;
-				break;
-				case 10:
-					antenna.id = 10;
-					antenna.name = "RTA";
-					antenna.position.x = 3.8286e+06;
-					antenna.position.y = 443832;
-					antenna.position.z = 5.06492e+06;
-				break;
-				case 11:
-					antenna.id = 11;
-					antenna.name = "RTB";
-					antenna.position.x = 3.82859e+06;
-					antenna.position.y = 443903;
-					antenna.position.z = 5.06492e+06;
-				break;
-				case 12:
-					antenna.id = 12;
-					antenna.name = "RTC";
-					antenna.position.x = 3.82845e+06;
-					antenna.position.y = 445119;
-					antenna.position.z = 5.06492e+06;
-				break;
-				case 13:
-					antenna.id = 13;
-					antenna.name = "RTD";
-					antenna.position.x = 3.82845e+06;
-					antenna.position.y = 445191;
-					antenna.position.z = 5.06492e+06;
-				break;
-			}
-		}
-		void initBand(size_t channelCount)
-		{
-			GetBandInfo().windowIndex = 0;
-			for(size_t i=0;i<channelCount;++i)
-			{
-				ChannelInfo channel;
-				channel.frequencyIndex = i;
-				channel.channelWidthHz = ChannelWidthHz();
-				channel.frequencyHz = 147000000.0 - 20000000.0 + ChannelWidthHz() * i;
-				GetBandInfo().channels.push_back(channel);
-			}
-		}
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/imaging/uvimager.h b/CEP/DP3/AOFlagger/include/AOFlagger/imaging/uvimager.h
deleted file mode 100644
index 6097af96e712edbcc9292d61ceb270dbf44a0c52..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/imaging/uvimager.h
+++ /dev/null
@@ -1,193 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef UVIMAGER_H
-#define UVIMAGER_H
-
-#include <AOFlagger/msio/timefrequencymetadata.h>
-#include <AOFlagger/msio/measurementset.h>
-#include <AOFlagger/msio/date.h>
-
-#include <AOFlagger/msio/timefrequencydata.h>
-
-struct SingleFrequencySingleBaselineData {
-	casa::Complex data;
-	bool flag;
-	bool available;
-	double time;
-	unsigned field;
-};
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class UVImager {
-	public:
-		enum ImageKind { Homogeneous, Flagging };
-		UVImager(unsigned long xRes, unsigned long yRes, ImageKind imageKind=Homogeneous);
-		~UVImager();
-		void Image(class MeasurementSet &measurementSet, unsigned band);
-		void Image(class MeasurementSet &measurementSet, unsigned band, const class IntegerDomain &frequencies);
-		void Image(const class TimeFrequencyData &data, TimeFrequencyMetaDataCPtr metaData, unsigned frequencyIndex);
-		void Image(const class TimeFrequencyData &data, TimeFrequencyMetaDataCPtr metaData)
-		{
-			for(unsigned y=0;y<data.ImageHeight();++y)
-				Image(data, metaData, y);
-		}
-		void Image(const class TimeFrequencyData &data, class SpatialMatrixMetaData *metaData);
-		void InverseImage(class MeasurementSet &prototype, unsigned band, const class Image2D &uvReal, const class Image2D &uvImaginary, unsigned antenna1, unsigned antenna2);
-		const class Image2D &WeightImage() const { return *_uvWeights; }
-		const class Image2D &RealUVImage() const { return *_uvReal; }
-		const class Image2D &ImaginaryUVImage() const { return *_uvImaginary; }
-		void SetInvertFlagging(bool newValue) { _invertFlagging = newValue; }
-		void SetDirectFT(bool directFT) { _directFT = directFT; }
-
-		/**
-		 * This function calculates the uv position, but it's not optimized for speed, so it's not to be used in an imager.
-		 * @param [out] u the u position (in the uv-plane domain)
-		 * @param [out] v the v position (in the uv-plane domain)
-		 * @param [in] timeIndex the time index to calculate the u,v position for
-		 * @param [in] frequencyIndex the frequency index to calculate the u,v position for
-		 * @param [in] metaData information about the baseline
-		 */
-		static void GetUVPosition(num_t &u, num_t &v, size_t timeIndex, size_t frequencyIndex, TimeFrequencyMetaDataCPtr metaData);
-
-		static num_t GetFringeStopFrequency(size_t time, const Baseline &baseline, num_t delayDirectionRA, num_t delayDirectionDec, num_t frequency, TimeFrequencyMetaDataCPtr metaData);
-		//static double GetFringeCount(long double timeStart, long double timeEnd, const Baseline &baseline, long double delayDirectionRA, long double delayDirectionDec, long double frequency);
-		static num_t GetFringeCount(size_t timeIndexStart, size_t timeIndexEnd, unsigned channelIndex, TimeFrequencyMetaDataCPtr metaData);
-		
-		static numl_t GetWPosition(numl_t delayDirectionDec, numl_t delayDirectionRA, numl_t frequency, numl_t earthLattitudeAngle, numl_t dx, numl_t dy)
-		{
-			numl_t wavelength = 299792458.0L / frequency;
-			numl_t raSinEnd = sinn(-delayDirectionRA - earthLattitudeAngle);
-			numl_t raCosEnd = cosn(-delayDirectionRA - earthLattitudeAngle);
-			numl_t decCos = cosn(delayDirectionDec);
-			// term "+ dz * decCos" is eliminated because of subtraction
-			num_t wPosition =
-				(dx*raCosEnd - dy*raSinEnd) * (-decCos) / wavelength;
-			return wPosition;
-		}
-		
-		static numl_t TimeToEarthLattitude(unsigned x, TimeFrequencyMetaDataCPtr metaData)
-		{
-			return TimeToEarthLattitude(metaData->ObservationTimes()[x]);
-		}
-		
-		static numl_t TimeToEarthLattitude(double time)
-		{
-			return time*M_PInl/(12.0*60.0*60.0);
-		}
-		
-		void Empty();
-		void PerformFFT();
-		bool HasUV() const { return _uvReal != 0; }
-		bool HasFFT() const { return _uvFTReal != 0; }
-		const class Image2D &FTReal() const { return *_uvFTReal; }
-		const class Image2D &FTImaginary() const { return *_uvFTImaginary; }
-		class Image2D &FTReal() { return *_uvFTReal; }
-		class Image2D &FTImaginary() { return *_uvFTImaginary; }
-		void SetUVScaling(num_t newScale)
-		{
-			_uvScaling = newScale;
-		}
-		num_t UVScaling() const {
-			return _uvScaling;
-		}
-		void ApplyWeightsToUV();
-		void SetUVValue(num_t u, num_t v, num_t r, num_t i, num_t weight);
-
-		template<typename T>
-		static T FrequencyToWavelength(const T frequency)
-		{
-			return SpeedOfLight() / frequency; 
-		}
-		static long double SpeedOfLight()
-		{
-			return 299792458.0L;
-		}
-		numl_t ImageDistanceToDecRaDistance(numl_t imageDistance) const
-		{
-			return imageDistance * _uvScaling;
-		}
-		static numl_t AverageUVDistance(TimeFrequencyMetaDataCPtr metaData, const double frequencyHz)
-		{
-			const std::vector<UVW> &uvw = metaData->UVW();
-			numl_t avgDist = 0.0;
-			for(std::vector<UVW>::const_iterator i=uvw.begin();i!=uvw.end();++i)
-			{
-				numl_t dist = i->u*i->u + i->v*i->v;
-				avgDist += sqrtnl(dist);
-			}
-			return avgDist * frequencyHz / (SpeedOfLight() * (numl_t) uvw.size());
-		}
-		static numl_t UVTrackLength(TimeFrequencyMetaDataCPtr metaData, const double frequencyHz)
-		{
-			const std::vector<UVW> &uvw = metaData->UVW();
-			numl_t length = 0.0;
-			std::vector<UVW>::const_iterator i=uvw.begin();
-			if(i == uvw.end()) return 0.0;
-			while((i+1)!=uvw.end())
-			{
-				std::vector<UVW>::const_iterator n=i;
-				++n;
-				const numl_t
-					du = n->u - i->u,
-					dv = n->v - i->v;
-				length += sqrtnl(du*du + dv*dv);
-				i=n;
-			}
-			return length * frequencyHz / SpeedOfLight();
-		}
-		numl_t ImageDistanceToFringeSpeedInSamples(numl_t imageDistance, double frequencyHz, TimeFrequencyMetaDataCPtr metaData) const
-		{
-			return ImageDistanceToDecRaDistance(imageDistance) * AverageUVDistance(metaData, frequencyHz) / (0.5 * (numl_t) metaData->UVW().size());
-		}
-	private:
-		void Clear();
-		struct AntennaCache {
-			num_t wavelength;
-			num_t dx, dy, dz;
-		};
-		void Image(const class IntegerDomain &frequencies);
-		void Image(const IntegerDomain &frequencies, const IntegerDomain &antenna1Domain, const IntegerDomain &antenna2Domain);
-		void Image(unsigned frequencyIndex, class AntennaInfo &antenna1, class AntennaInfo &antenna2, SingleFrequencySingleBaselineData *data);
-
-		// This is the fast variant.
-		void GetUVPosition(num_t &u, num_t &v, const SingleFrequencySingleBaselineData &data, const AntennaCache &cache);
-		void SetUVFTValue(num_t u, num_t v, num_t r, num_t i, num_t weight);
-
-
-		unsigned long _xRes, _yRes;
-		unsigned long _xResFT, _yResFT;
-		num_t _uvScaling;
-		class Image2D *_uvReal, *_uvImaginary, *_uvWeights;
-		class Image2D *_uvFTReal, *_uvFTImaginary;
-		class Image2D *_timeFreq;
-		MeasurementSet *_measurementSet;
-		unsigned _antennaCount, _fieldCount;
-		AntennaInfo *_antennas;
-		BandInfo _band;
-		FieldInfo *_fields;
-		size_t _scanCount;
-		ImageKind _imageKind;
-		bool _invertFlagging, _directFT;
-		bool _ignoreBoundWarnings;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/imaging/zenithimager.h b/CEP/DP3/AOFlagger/include/AOFlagger/imaging/zenithimager.h
deleted file mode 100644
index d42e59bfa022963ab1171063b1902fefb1cebdca..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/imaging/zenithimager.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2012 by A.R. Offringa                                   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#ifndef ZENITH_IMAGER_H
-#define ZENITH_IMAGER_H
-
-#include <complex>
-
-#include <AOFlagger/msio/image2d.h>
-
-class ZenithImager
-{
-	public:
-		ZenithImager();
-		
-		void Initialize(size_t resolution);
-		
-		void Clear();
-		
-		void Add(const class BandInfo &band, const std::complex<float> *samples, const bool *isRFI, double u, double v, double w, double phaseRotation);
-		
-		void FourierTransform(Image2DPtr &real, Image2DPtr &imaginary);
-		
-		Image2DCPtr UVReal() const { return _real; }
-		Image2DCPtr UVImaginary() const { return _imaginary; }
-	private:
-		void add(const class BandInfo &band, double r, double i, double u, double v, double w, double phaseRotation, double wavelength);
-		
-		static long double Wavelength(long double frequency)
-		{
-			return 299792458.0L / frequency;
-		}
-		
-		size_t _resolution, _totalCount, _outsideCount;
-		
-		Image2DPtr _real, _imaginary, _weights;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/msio/antennainfo.h b/CEP/DP3/AOFlagger/include/AOFlagger/msio/antennainfo.h
deleted file mode 100644
index 8c9b33b97a3478bd947b04ce257d274fd90d0853..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/msio/antennainfo.h
+++ /dev/null
@@ -1,334 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef ANTENNAINFO_H
-#define ANTENNAINFO_H
-
-#include <string>
-#include <sstream>
-#include <cmath>
-#include <cstdlib>
-#include <vector>
-
-#include "types.h"
-
-#include <AOFlagger/util/serializable.h>
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class EarthPosition {
-public:
-	EarthPosition() : x(0.0), y(0.0), z(0.0) { }
-	
-	double x, y, z;
-	std::string ToString() {
-		std::stringstream s;
-		s.setf(std::ios::fixed,std::ios::floatfield);
-		s.width(16);
-		s.precision(16);
-		s << x << "," << y << "," << z << " (alt " << sqrtl(x*x+y*y+z*z) << "), or "
-		<< "N" << Latitude()*180/M_PI << " E" << Longitude()*180/M_PI;
-		return s.str();
-	}
-	EarthPosition FromITRS(long double x, long double y, long double z);
-	
-	double Longitude() const
-	{
-		return atan2l(y, x);
-	}
-	
-	long double LongitudeL() const
-	{
-		return atan2l(y, x);
-	}
-
-	double Latitude() const
-	{
-		return atan2l(z, sqrtl((long double) x*x + y*y));
-	}
-	
-	long double LatitudeL() const
-	{
-		return atan2l(z, sqrtl((long double) x*x + y*y));
-	}
-	
-	double Altitude() const
-	{
-		return sqrtl((long double) x*x+y*y+z*z);
-	}
-	
-	double AltitudeL() const
-	{
-		return sqrtl((long double) x*x+y*y+z*z);
-	}
-
-	void Serialize(std::ostream &stream) const
-	{
-		Serializable::SerializeToDouble(stream, x);
-		Serializable::SerializeToDouble(stream, y);
-		Serializable::SerializeToDouble(stream, z);
-	}
-	
-	void Unserialize(std::istream &stream)
-	{
-		x = Serializable::UnserializeDouble(stream);
-		y = Serializable::UnserializeDouble(stream);
-		z = Serializable::UnserializeDouble(stream);
-	}
-};
-
-class UVW {
-public:
-	UVW() : u(0.0), v(0.0), w(0.0) { }
-	UVW(num_t _u, num_t _v, num_t _w) : u(_u), v(_v), w(_w) { }
-	num_t u, v, w;
-};
-
-class AntennaInfo {
-public:
-	AntennaInfo() { }
-	AntennaInfo(const AntennaInfo &source)
-		: id(source.id), position(source.position), name(source.name), diameter(source.diameter), mount(source.mount), station(source.station)
-	{
-	}
-	void operator=(const AntennaInfo &source)
-	{
-		id = source.id;
-		position = source.position;
-		name = source.name;
-		diameter = source.diameter;
-		mount = source.mount;
-		station = source.station;
-	}
-	unsigned id;
-	EarthPosition position;
-	std::string name;
-	double diameter;
-	std::string mount;
-	std::string station;
-	
-	void Serialize(std::ostream &stream) const
-	{
-		Serializable::SerializeToUInt32(stream, id);
-		position.Serialize(stream);
-		Serializable::SerializeToString(stream, name);
-		Serializable::SerializeToDouble(stream, diameter);
-		Serializable::SerializeToString(stream, mount);
-		Serializable::SerializeToString(stream, station);
-	}
-	
-	void Unserialize(std::istream &stream)
-	{
-		id = Serializable::UnserializeUInt32(stream);
-		position.Unserialize(stream);
-		Serializable::UnserializeString(stream, name);
-		diameter = Serializable::UnserializeDouble(stream);
-		Serializable::UnserializeString(stream, mount);
-		Serializable::UnserializeString(stream, station);
-	}
-};
-
-class ChannelInfo {
-public:
-	unsigned frequencyIndex;
-	double frequencyHz;
-	double channelWidthHz;
-	double effectiveBandWidthHz;
-	double resolutionHz;
-	
-	double MetersToLambda(double meters) const
-	{
-		return meters * frequencyHz / 299792458.0L;
-	}
-	void Serialize(std::ostream &stream) const
-	{
-		Serializable::SerializeToUInt32(stream, frequencyIndex);
-		Serializable::SerializeToDouble(stream, frequencyHz);
-		Serializable::SerializeToDouble(stream, channelWidthHz);
-		Serializable::SerializeToDouble(stream, effectiveBandWidthHz);
-		Serializable::SerializeToDouble(stream, resolutionHz);
-	}
-	
-	void Unserialize(std::istream &stream)
-	{
-		frequencyIndex = Serializable::UnserializeUInt32(stream);
-		frequencyHz = Serializable::UnserializeDouble(stream);
-		channelWidthHz = Serializable::UnserializeDouble(stream);
-		effectiveBandWidthHz = Serializable::UnserializeDouble(stream);
-		resolutionHz = Serializable::UnserializeDouble(stream);
-	}
-};
-
-class BandInfo {
-public:
-	unsigned windowIndex;
-	std::vector<ChannelInfo> channels;
-
-	BandInfo() : windowIndex(0) { }
-	BandInfo(const BandInfo &source) :
-		windowIndex(source.windowIndex),
-		channels(source.channels)
-	{
-	}
-	void operator=(const BandInfo &source)
-	{
-		windowIndex = source.windowIndex;
-		channels = source.channels;
-	}
-	num_t CenterFrequencyHz() const
-	{
-		num_t total = 0.0;
-		for(std::vector<ChannelInfo>::const_iterator i=channels.begin();i!=channels.end();++i)
-			total += i->frequencyHz;
-		return total / channels.size();
-	}
-	void Serialize(std::ostream &stream) const
-	{
-		Serializable::SerializeToUInt32(stream, windowIndex);
-		Serializable::SerializeToUInt32(stream, channels.size());
-		for(std::vector<ChannelInfo>::const_iterator i=channels.begin();i!=channels.end();++i)
-			i->Serialize(stream);
-	}
-	
-	void Unserialize(std::istream &stream)
-	{
-		windowIndex = Serializable::UnserializeUInt32(stream);
-		size_t channelCount = Serializable::UnserializeUInt32(stream);
-		channels.resize(channelCount);
-		for(size_t i=0;i<channelCount;++i)
-			channels[i].Unserialize(stream);
-	}
-};
-
-class FieldInfo {
-public:
-	unsigned fieldId;
-	num_t delayDirectionRA;
-	num_t delayDirectionDec;
-	num_t delayDirectionDecNegSin;
-	num_t delayDirectionDecNegCos;
-};
-
-class Baseline {
-public:
-	EarthPosition antenna1, antenna2;
-	Baseline()
-		: antenna1(), antenna2() { }
-	Baseline(const AntennaInfo &_antenna1, const AntennaInfo &_antenna2)
-		: antenna1(_antenna1.position), antenna2(_antenna2.position) { }
-	Baseline(EarthPosition _antenna1, EarthPosition _antenna2)
-		: antenna1(_antenna1), antenna2(_antenna2) { }
-
-	num_t Distance() const {
-		num_t dx = antenna1.x-antenna2.x;
-		num_t dy = antenna1.y-antenna2.y;
-		num_t dz = antenna1.z-antenna2.z;
-		return sqrtn(dx*dx+dy*dy+dz*dz);
-	}
-	num_t Angle() const {
-		num_t dz = antenna1.z-antenna2.z;
- 		// baseline is either orthogonal to the earths axis, or
-		// the length of the baseline is zero. 
-		if(dz == 0.0) return 0.0;
-		num_t transf = 1.0/(antenna1.z-antenna2.z);
-		num_t dx = (antenna1.x-antenna2.x)*transf;
-		num_t dy = (antenna1.y-antenna2.y)*transf;
-		num_t length = sqrtn(dx*dx + dy*dy + 1.0);
-		return acosn(1.0/length);
-	}
-	num_t DeltaX() const { return antenna2.x-antenna1.x; }
-	num_t DeltaY() const { return antenna2.y-antenna1.y; }
-	num_t DeltaZ() const { return antenna2.z-antenna1.z; }
-};
-
-class Frequency {
-public:
-	static std::string ToString(num_t value)
-	{
-		std::stringstream s;
-		if(value >= 1000000.0L)
-			s << round(value/10000.0L)/100.0L << " MHz";
-		else if(value >= 1000.0L)
-			s << round(value/10.0L)/100.0L << " KHz";
-		else
-			s << value << " Hz";
-		return s.str();
-	}
-};
-
-class RightAscension {
-public:
-	static std::string ToString(numl_t value)
-	{
-		value = fmod(value, 2.0*M_PInl);
-		if(value < 0.0) value += 2.0*M_PInl;
-		std::stringstream s;
-		s << (int) floorn(value*12.0/M_PInl) << ':';
-		int d2 = (int) floornl(fmodnl(value*12.0*60.0/M_PInl, 60.0));
-		if(d2 < 10) s << '0';
-		s << d2 << ':';
-		numl_t d3 = fmodnl(value*12.0*60.0*60.0/M_PInl, 60.0);
-		if(d3 < 10.0) s << '0';
-		s << d3;
-		return s.str();
-	}
-};
-
-class Declination {
-public:
-	static std::string ToString(numl_t value)
-	{
-		value = fmod(value, 2.0*M_PInl);
-		if(value < 0.0) value += 2.0*M_PInl;
-		if(value > M_PInl*0.5) value = M_PInl - value;
-		std::stringstream s;
-		if(value > 0.0)
-			s << '+';
-		else
-			s << '-';
-		value = fabsnl(value);
-		s << (int) floornl(value*180.0/M_PIn) << '.';
-		int d2 = (int) fmodnl(value*180.0*60.0/M_PIn, 60.0);
-		if(d2 < 10) s << '0';
-		s << d2 << '.';
-		numl_t d3 = fmodnl(value*180.0*60.0*60.0/M_PIn, 60.0);
-		if(d3 < 10.0) s << '0';
-		s << d3;
-		return s.str();
-	}
-};
-
-class Angle {
-public:
-	static std::string ToString(numl_t valueRad)
-	{
-		std::stringstream s;
-		numl_t deg = valueRad * 180.0/M_PI;
-		if(std::abs(deg) > 3)
-			s << deg << " deg";
-		else if(std::abs(deg) > 3.0/60.0)
-			s << (deg / 60.0) << " arcmin";
-		else
-			s << (deg / 3600.0) << " arcsec";
-		return s.str();
-	}
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/msio/arraycolumniterator.h b/CEP/DP3/AOFlagger/include/AOFlagger/msio/arraycolumniterator.h
deleted file mode 100644
index 0d4692afc13e2e85f4a0749c543269d510f7902d..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/msio/arraycolumniterator.h
+++ /dev/null
@@ -1,164 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef ARRAYCOLUMNITERATOR_H
-#define ARRAYCOLUMNITERATOR_H
-
-//#define AIPS_NO_TEMPLATE_SRC
-//#define CASACORE_NO_AUTO_TEMPLATES
-#include <ms/MeasurementSets/MSColumns.h>
-#include <tables/Tables/RefRows.h>
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-template<typename T>
-class ROArrayColumnIterator {
-	public:
-		ROArrayColumnIterator(class casa::ROArrayColumn<T> &column, unsigned row) throw() :
-			_column(column), _row(row)
-		{
-		}
-		ROArrayColumnIterator(const ROArrayColumnIterator<T> &source) throw() :
-			_column(source._column), _row(source._row)
-		{
-		}
-		~ROArrayColumnIterator() throw()
-		{
-		}
-		ROArrayColumnIterator<T> &operator++() throw() {
-			_row++;
-			return *this;
-		}
-		casa::Array<T> *operator->() const throw() {
-			return &_column(_row);
-		}
-		casa::Array<T> operator*() const throw() {
-			return _column(_row);
-		}
-		void Set(const casa::Array<T> &values) throw() {
-			_column.putColumnCells(casa::RefRows(_row, _row), values);
-		}
-		bool operator!=(const ROArrayColumnIterator<T> &other) const throw() {
-			return _row!=other._row;
-		}
-		bool operator==(const ROArrayColumnIterator<T> &other) const throw() {
-			return _row==other._row;
-		}
-		static ROArrayColumnIterator First(casa::ROArrayColumn<T> &column)
-		{
-			return ROArrayColumnIterator<T>(column, 0);
-		}
-	protected:
-		casa::ROArrayColumn<T> &_column;
-		unsigned _row;
-};
-
-template<typename T>
-class ArrayColumnIterator : public ROArrayColumnIterator<T> {
-	public:
-		ArrayColumnIterator(class casa::ArrayColumn<T> &column, unsigned row) throw() :
-			ROArrayColumnIterator<T>(column, row)
-		{
-		}
-		ArrayColumnIterator(const ArrayColumnIterator<T> &source) throw() :
-			ROArrayColumnIterator<T>(source)
-		{
-		}
-		~ArrayColumnIterator() throw()
-		{
-		}
-		void Set(const casa::Array<T> &values) throw() {
-			casa::ArrayColumn<T> *col = static_cast<casa::ArrayColumn<T>* >(&this->_column);
-			col->basePut(this->_row, values);
-		}
-		static ArrayColumnIterator First(casa::ArrayColumn<T> &column)
-		{
-			return ArrayColumnIterator<T>(column, 0);
-		}
-};
-
-
-// I'm using the casa header files with a different version
-// of the casa library. It, of course, is highly hacky work,
-// but it was the only way it has worked for me so far. This however
-// makes the following two definitions necessary. 
-
-/*
-namespace casa {//#Begin casa namespace
-template<class T>
-Array<T>::ConstIteratorSTL::ConstIteratorSTL (const Array<T>& arr)
-: itsLineIncr (0),
-  itsCurPos   (arr.ndim(), 0),
-  itsArray    (&arr),
-  itsContig   (arr.contiguousStorage())
-{
-  // An empty array has to be handled.
-  if (arr.nelements() == 0) {
-    itsPos = 0;
-    itsContig = True;
-  } else {
-    // Set the last cursor position.
-    // Handle the case for the end iterator.
-    itsLastPos = arr.shape() - 1;
-    // If the array is not contiguous, we iterate "line by line" in
-    // the increment function. Optimize for the case where the length
-    // of the lower dimensions is 1. All such dimensions can be included
-    // in the "line".
-    // At the end itsLineAxis gives the axis where the next "line" starts.
-    itsPos = &((*itsArray)(itsCurPos));
-    if (!itsContig) {
-      itsLineAxis = 0;
-      while (itsLineAxis < arr.ndim()-1
-             &&  itsLastPos(itsLineAxis) == 0) {
-        itsLineAxis++;
-      }
-      itsCurPos(itsLineAxis) = 1;
-      itsLineIncr = itsArray->steps()(itsLineAxis) - 1;
-      ///&((*itsArray)(itsCurPos)) - itsPos - 1;
-      itsLineEnd = itsPos + itsLastPos(itsLineAxis) * (itsLineIncr+1);
-      itsCurPos(itsLineAxis) = 0;
-    }
-  }
-}
-
-template<class T>
-void Array<T>::ConstIteratorSTL::increment()
-{
-  uInt axis;
-  for (axis=itsLineAxis+1; axis<itsCurPos.nelements(); axis++) {
-    if (itsCurPos(axis) < itsLastPos(axis)) {
-      itsCurPos(axis)++;
-      itsLineEnd += itsArray->steps()(axis);
-      break;
-    }
-    itsCurPos(axis) = 0;
-    itsLineEnd -= itsLastPos(axis) * itsArray->steps()(axis);
-  }
-  if (axis == itsCurPos.nelements()) {
-    itsPos = itsArray->end();
-  } else {
-    itsPos = itsLineEnd - itsLastPos(itsLineAxis) * (itsLineIncr+1);
-  }
-}
-
-};
-*/
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/msio/baselinematrixloader.h b/CEP/DP3/AOFlagger/include/AOFlagger/msio/baselinematrixloader.h
deleted file mode 100644
index e93a0282f0ff4f64f3add33f64e258762d2aa752..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/msio/baselinematrixloader.h
+++ /dev/null
@@ -1,41 +0,0 @@
-#ifndef BASELINEMATRIXLOADER_H
-#define BASELINEMATRIXLOADER_H
-
-#include <cstring>
-
-#include <tables/Tables/TableIter.h>
-
-#include "timefrequencydata.h"
-#include "measurementset.h"
-
-class BaselineMatrixLoader
-{
-	public:
-		explicit BaselineMatrixLoader(MeasurementSet &measurementSet);
-		~BaselineMatrixLoader();
-
-		TimeFrequencyData Load(size_t timeIndex)
-		{
-			return LoadSummed(timeIndex);
-		}
-		void LoadPerChannel(size_t timeIndex, std::vector<TimeFrequencyData> &data);
-
-		size_t TimeIndexCount() const { return _timeIndexCount; }
-		class SpatialMatrixMetaData &MetaData() const
-		{
-			return *_metaData;
-		}
-		size_t FrequencyCount() const { return _frequencyCount; }
-	private:
-		TimeFrequencyData LoadSummed(size_t timeIndex);
-
-		casa::Table *_sortedTable;
-		casa::TableIterator *_tableIter;
-		size_t _currentIterIndex;
-		MeasurementSet _measurementSet;
-		size_t _timeIndexCount;
-		class SpatialMatrixMetaData *_metaData;
-		size_t _frequencyCount;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/msio/baselinereader.h b/CEP/DP3/AOFlagger/include/AOFlagger/msio/baselinereader.h
deleted file mode 100644
index 315c3bd2ad8e353945f4c2dadb4b635660ad7636..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/msio/baselinereader.h
+++ /dev/null
@@ -1,220 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef BASELINEREADER_H
-#define BASELINEREADER_H
-
-#include <map>
-#include <vector>
-#include <stdexcept>
-
-#include <boost/shared_ptr.hpp>
-
-#include <AOFlagger/msio/antennainfo.h>
-#include <AOFlagger/msio/image2d.h>
-#include <AOFlagger/msio/mask2d.h>
-#include <AOFlagger/msio/measurementset.h>
-
-typedef boost::shared_ptr<class BaselineReader> BaselineReaderPtr;
-typedef boost::shared_ptr<const class BaselineReader> BaselineReaderCPtr;
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class BaselineReader {
-	public:
-		BaselineReader(const std::string &msFile);
-		virtual ~BaselineReader();
-
-		bool ReadFlags() const { return _readFlags; }
-		void SetReadFlags(bool readFlags) { _readFlags = readFlags; }
-
-		bool ReadData() const { return _readData; }
-		void SetReadData(bool readData) { _readData = readData; }
-
-		const std::string &DataColumnName() const { return _dataColumnName; }
-		void SetDataColumnName(const std::string &name) { _dataColumnName = name; }
-
-		bool SubtractModel() const { return _subtractModel; }
-		void SetSubtractModel(bool subtractModel) { _subtractModel = subtractModel; }
-
-		size_t PolarizationCount()
-		{
-			initializePolarizations();
-			return _polarizationCount;
-		}
-
-		size_t FrequencyCount() const
-		{
-			return _frequencyCount;
-		}
-
-		class casa::Table *Table() const { return _table; }
-
-		MeasurementSet &Set() { return _measurementSet; }
-
-		const std::map<double,size_t> &AllObservationTimes() const { return _observationTimes; }
-		
-		std::vector<double> ObservationTimes(size_t startIndex, size_t endIndex) const {
-			std::vector<double> times;
-			times.insert(times.begin(), _observationTimesVector.begin()+startIndex, _observationTimesVector.begin()+endIndex);
-			return times;
-		}
-
-		void AddReadRequest(size_t antenna1, size_t antenna2, size_t spectralWindow);
-		void AddReadRequest(size_t antenna1, size_t antenna2, size_t spectralWindow, size_t startIndex, size_t endIndex)
-		{
-			addReadRequest(antenna1, antenna2, spectralWindow, startIndex, endIndex);
-		}
-		virtual void PerformReadRequests() = 0;
-		
-		void AddWriteTask(std::vector<Mask2DCPtr> flags, int antenna1, int antenna2, int spectralWindow)
-		{
-			if(!flags.empty())
-				AddWriteTask(flags, antenna1, antenna2, spectralWindow, 0, flags[0]->Width());
-		}
-		void AddWriteTask(std::vector<Mask2DCPtr> flags, int antenna1, int antenna2, int spectralWindow, size_t timeOffset, size_t timeEnd, size_t leftBorder=0, size_t rightBorder=0)
-		{
-			initializePolarizations();
-			if(flags.size() != _polarizationCount)
-			{
-				std::stringstream s;
-				s << "Trying to write image with " << flags.size() << " polarizations to a measurement set with " << _polarizationCount;
-				throw std::runtime_error(s.str());
-			}
-			WriteRequest task;
-			task.flags = flags;
-			task.antenna1 = antenna1;
-			task.antenna2 = antenna2;
-			task.spectralWindow = spectralWindow;
-			task.startIndex = timeOffset;
-			task.endIndex = timeEnd;
-			task.leftBorder = leftBorder;
-			task.rightBorder = rightBorder;
-			_writeRequests.push_back(task);
-		}
-		virtual void PerformFlagWriteRequests() = 0;
-		virtual void PerformDataWriteTask(std::vector<Image2DCPtr> _realImages, std::vector<Image2DCPtr> _imaginaryImages, int antenna1, int antenna2, int spectralWindow) = 0;
-		
-		class TimeFrequencyData GetNextResult(std::vector<class UVW> &uvw);
-		void PartInfo(size_t maxTimeScans, size_t &timeScanCount, size_t &partCount);
-
-		virtual size_t GetMinRecommendedBufferSize(size_t threadCount) { return threadCount; }
-		virtual size_t GetMaxRecommendedBufferSize(size_t threadCount) { return 2*threadCount; }
-	protected:
-		struct ReadRequest {
-			int antenna1;
-			int antenna2;
-			int spectralWindow;
-			size_t startIndex;
-			size_t endIndex;
-		};
-		struct WriteRequest {
-			WriteRequest() { }
-			WriteRequest(const WriteRequest &source)
-			: flags(source.flags), antenna1(source.antenna1), antenna2(source.antenna2), spectralWindow(source.spectralWindow), startIndex(source.startIndex), endIndex(source.endIndex),
-			leftBorder(source.leftBorder), rightBorder(source.rightBorder)
-			{
-			}
-			void operator=(const WriteRequest &source)
-			{
-				flags = source.flags;
-				antenna1 = source.antenna1;
-				antenna2 = source.antenna2;
-				spectralWindow = source.spectralWindow;
-				startIndex = source.startIndex;
-				endIndex = source.endIndex;
-				leftBorder = source.leftBorder;
-				rightBorder = source.rightBorder;
-			}
-			std::vector<Mask2DCPtr> flags;
-			int antenna1;
-			int antenna2;
-			int spectralWindow;
-			size_t startIndex;
-			size_t endIndex;
-			size_t leftBorder;
-			size_t rightBorder;
-		};
-		
-		struct Result {
-			Result() { }
-			Result(const Result &source) :
-				_realImages(source._realImages),
-				_imaginaryImages(source._imaginaryImages),
-				_flags(source._flags),
-				_uvw(source._uvw),
-				_bandInfo(source._bandInfo)
-				{
-				}
-			void operator=(const Result &source)
-			{
-				_realImages = source._realImages;
-				_imaginaryImages = source._imaginaryImages;
-				_flags = source._flags;
-				_uvw = source._uvw;
-				_bandInfo = source._bandInfo;
-			}
-			std::vector<Image2DPtr> _realImages;
-			std::vector<Image2DPtr> _imaginaryImages;
-			std::vector<Mask2DPtr> _flags;
-			std::vector<class UVW> _uvw;
-			class BandInfo _bandInfo;
-		};
-		void initialize()
-		{
-			initObservationTimes();
-			initializePolarizations();
-		}
-		casa::ROArrayColumn<casa::Complex> *CreateDataColumn(const std::string &columnName, class casa::Table &table);
-		casa::ArrayColumn<casa::Complex> *CreateDataColumnRW(const std::string &columnName, class casa::Table &table);
-		void clearTableCaches();
-
-		std::vector<ReadRequest> _readRequests;
-		std::vector<WriteRequest> _writeRequests;
-		std::vector<Result> _results;
-	private:
-		void initializePolarizations();
-		void initObservationTimes();
-		
-		void addReadRequest(size_t antenna1, size_t antenna2, size_t spectralWindow, size_t startIndex, size_t endIndex)
-		{
-			ReadRequest request;
-			request.antenna1 = antenna1;
-			request.antenna2 = antenna2;
-			request.spectralWindow = spectralWindow;
-			request.startIndex = startIndex;
-			request.endIndex = endIndex;
-			_readRequests.push_back(request);
-		}
-
-		MeasurementSet _measurementSet;
-		class casa::Table *_table;
-		
-		std::string _dataColumnName;
-		bool _subtractModel;
-		bool _readData, _readFlags;
-		
-		std::map<double,size_t> _observationTimes;
-		std::vector<double> _observationTimesVector;
-		size_t _polarizationCount;
-		size_t _frequencyCount;
-};
-
-#endif // BASELINEREADER_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/msio/colormap.h b/CEP/DP3/AOFlagger/include/AOFlagger/msio/colormap.h
deleted file mode 100644
index bf7bf98832fc8780e9c45cb71a9eaa32b5f85b41..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/msio/colormap.h
+++ /dev/null
@@ -1,456 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2007 by Andre Offringa   *
- *   offringa@gmail.com   *
- *                                                                         *
- *   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.             *
- ***************************************************************************/
-/** @file
- * This is the header file for the ColorMap base class and several specific color map classes.
- * @author André Offringa <offringa@gmail.com>
- */
-#ifndef COLORMAP_H
-#define COLORMAP_H
-
-#include <math.h>
-#include <string>
-
-/**
- * The ColorMap class turns a value between -1 and 1 into a gradient color scale.
- */
-class ColorMap {
-	public:
-		/**
-		 * Constructor.
-		 */
-		ColorMap();
-		/**
-		 * Destructor.
-		 */
-		virtual ~ColorMap();
-		/**
-		 * Maps a double value to the red component of the color map.
-		 * @param value Value to be mapped  (-1 to 1).
-		 * @return The red color value (0 - 255).
-		 */
-		virtual unsigned char ValueToColorR(long double value) const = 0;
-		/**
-		 * Maps a double value to the green component of the color map.
-		 * @param value Value to be mapped (-1 to 1).
-		 * @return The green color value (0 - 255).
-		 */
-		virtual unsigned char ValueToColorG(long double value) const = 0;
-		/**
-		 * Maps a double value to the blue component of the color map.
-		 * @param value Value to be mapped (-1 to 1).
-		 * @return The blue color value (0 - 255).
-		 */
-		virtual unsigned char ValueToColorB(long double value) const = 0;
-		/**
-		 * Maps a double value to the alfa (transparency) component of the color map.
-		 * @param value Value to be mapped (-1 to 1).
-		 * @return The alfa (transparency) color value (0 - 255). 255=fully opaque, 0=fully transparent.
-		 */
-		virtual unsigned char ValueToColorA(long double value) const = 0;
-		/**
-		 * Create a color map given its name. The human readable list of names can be retrieved with GetColorMapsString().
-		 * @param typeStr name of the color map type.
-		 * @return The new create color map. The caller is responsible for @c delete -ing the color map after usage.
-		 * @see GetColorMapsString().
-		 */
-		static ColorMap *CreateColorMap(const std::string &typeStr) throw();
-		/**
-		 * Returns a string containing a description of the color map names. These names can be used to
-		 * create the color map with CreateColorMap().
-		 * @return 
-		 * @see CreateColorMap().
-		 */
-		static const std::string &GetColorMapsString() throw();
-	private:
-		static const std::string _colorMapsString;
-};
-
-/**
- * ColorMap that turns a value into a gray scale value. High values represent whiter colors.
- */
-class MonochromeMap : public ColorMap {
-	public:
-		MonochromeMap() { }
-		~MonochromeMap() { }
-		unsigned char ValueToColorR(long double value) const { return (unsigned char) (value*127.5+127.5); }
-		unsigned char ValueToColorG(long double value) const { return (unsigned char) (value*127.5+127.5); }
-		unsigned char ValueToColorB(long double value) const { return (unsigned char) (value*127.5+127.5); }
-		unsigned char ValueToColorA(long double) const { return 255; }
-};
-
-/**
- * ColorMap that turns a value into a gray scale value. High values represent whiter colors.
- */
-class InvertedMap : public ColorMap {
-	public:
-		InvertedMap() { }
-		~InvertedMap() { }
-		unsigned char ValueToColorR(long double value) const { return (unsigned char) (127.5-value*127.5); }
-		unsigned char ValueToColorG(long double value) const { return (unsigned char) (127.5-value*127.5); }
-		unsigned char ValueToColorB(long double value) const { return (unsigned char) (127.5-value*127.5); }
-		unsigned char ValueToColorA(long double) const { return 255; }
-};
-
-/**
- * ColorMap that turns negative values into blue and positive values into red. Zero is represented with black.
- */
-class RedBlueMap : public ColorMap {
-	public:
-		RedBlueMap() { }
-		~RedBlueMap() { }
-		unsigned char ValueToColorR(long double value) const {
-			if(value>0.0)
-				return (unsigned char) (value*255.0);
-			else
-				return 0;
-		}
-		unsigned char ValueToColorG(long double) const { return 0; }
-		unsigned char ValueToColorB(long double value) const {
-			if(value<0.0)
-				return (unsigned char) (value*-255.0);
-			else
-				return 0;
-		}
-		unsigned char ValueToColorA(long double) const { return 255; }
-};
-
-/**
- * ColorMap that turns negative values into red and positive values into black. Zero is represented with white.
- */
-class BlackRedMap : public ColorMap {
-	public:
-		BlackRedMap() { }
-		~BlackRedMap() { }
-		unsigned char ValueToColorR(long double value) const {
-			if(value>0.0)
-				return (unsigned char) (255-value*255.0);
-			else
-				return 255;
-		}
-		unsigned char ValueToColorG(long double value) const
-		{
-			if(value>0.0)
-				return (unsigned char) (255-value*255.0);
-			else
-				return 255+value*255.0;
-		}
-		unsigned char ValueToColorB(long double value) const {
-			if(value>0.0)
-				return (unsigned char) (255-value*255.0);
-			else
-				return 255+value*255.0;
-		}
-		unsigned char ValueToColorA(long double) const { return 255; }
-};
-
-/**
- * ColorMap that turns negative values into blue and positive values into red. Zero is represented with white.
- */
-class RedWhiteBlueMap : public ColorMap {
-	public:
-		RedWhiteBlueMap() { }
-		~RedWhiteBlueMap() { }
-		unsigned char ValueToColorR(long double value) const {
-			if(value<0.0)
-				return (unsigned char) (255.0 + (value*255.0));
-			else
-				return 255;
-		}
-		unsigned char ValueToColorG(long double value) const {
-			if(value<0.0)
-				return (unsigned char) (255.0 + (value*255.0));
-			else
-				return (unsigned char) (255.0 - (value*255.0));
-		}
-		unsigned char ValueToColorB(long double value) const {
-			if(value>0.0)
-				return (unsigned char) (255.0 - (value*255.0));
-			else
-				return 255;
-		}
-		unsigned char ValueToColorA(long double) const { return 255; }
-};
-
-/**
- * ColorMap that passes several colors.
- */
-class ColdHotMap : public ColorMap {
-	public:
-		ColdHotMap() { }
-		~ColdHotMap() { }
-		unsigned char ValueToColorR(long double value) const {
-			if(value >= 0.5)
-				return (unsigned char) ((1.5 - value) * 255.0);
-			else if(value < -0.5)
-				return 0;
-			else if(value < 0.0)
-				return (unsigned char) (((value + 0.5)*2.0) * 255.0);
-			else
-				return 255;
-		}
-		unsigned char ValueToColorG(long double value) const {
-			if(value < -0.5)
-				return (unsigned char) (((value + 1.0)*2.0) * 255.0);
-			else if(value < 0.0)
-				return 255;
-			else if(value < 0.5)
-				return (unsigned char) (((0.5 - value)*2.0)*255.0);
-			else
-				return 0;
-		}
-		unsigned char ValueToColorB(long double value) const {
-			if(value < -0.5)
-				return (unsigned char) ((value + 1.5) * 255.0);
-			else if(value < 0.0)
-				return (unsigned char) (((-value)*2.0)*255.0);
-			else
-				return 0;
-		}
-		unsigned char ValueToColorA(long double) const { return 255; }
-};
-
-/**
- * ColorMap that uses another color map and increases its contrast.
- */
-class ContrastMap : public ColorMap {
-	private:
-		const ColorMap *_map;
-	public:
-		ContrastMap(const std::string type) :
-			_map(CreateColorMap(type)) { }
-		~ContrastMap() { delete _map; }
-		unsigned char ValueToColorR(long double value) const { return _map->ValueToColorR(value>=0.0 ? sqrt(value) : -sqrt(-value)); }
-		unsigned char ValueToColorG(long double value) const { return _map->ValueToColorG(value>=0.0 ? sqrt(value) : -sqrt(-value)); }
-		unsigned char ValueToColorB(long double value) const { return _map->ValueToColorB(value>=0.0 ? sqrt(value) : -sqrt(-value)); }
-		unsigned char ValueToColorA(long double value) const { return _map->ValueToColorA(value>=0.0 ? sqrt(value) : -sqrt(-value)); }
-};
-
-/**
- * ColorMap that uses another color map and applies logarithmic scaling to it. Expects inputs
- * between 0 and 1, will output to map between -1 and 1.
- */
-class PosLogMap : public ColorMap {
-	private:
-		const ColorMap &_map;
-	public:
-		PosLogMap(const ColorMap &map) :
-			_map(map) { }
-		~PosLogMap() { }
-		unsigned char ValueToColorR(long double value) const { return value >= 0.0  ? _map.ValueToColorR((log10(value*0.9999+0.0001)+2.0)/2.0) : _map.ValueToColorR(-1.0); }
-		unsigned char ValueToColorG(long double value) const { return value >= 0.0  ? _map.ValueToColorG((log10(value*0.9999+0.0001)+2.0)/2.0) : _map.ValueToColorG(-1.0);  }
-		unsigned char ValueToColorB(long double value) const { return value >= 0.0  ? _map.ValueToColorB((log10(value*0.9999+0.0001)+2.0)/2.0) : _map.ValueToColorB(-1.0);  }
-		unsigned char ValueToColorA(long double value) const { return value >= 0.0  ? _map.ValueToColorA((log10(value*0.9999+0.0001)+2.0)/2.0) : _map.ValueToColorA(-1.0);  }
-};
-
-class PosMonochromeLogMap : public PosLogMap {
-	private:
-		const MonochromeMap _monochromeMap;
-	public:
-		PosMonochromeLogMap() : PosLogMap(_monochromeMap) { }
-};
-
-/**
- * ColorMap that uses another color map and applies logarithmic scaling to it. Expects inputs
- * between -1 and 1, will output to map between -1 and 1.
- */
-class FullLogMap : public ColorMap {
-	private:
-		const ColorMap &_map;
-	public:
-		FullLogMap(const ColorMap &map) :
-			_map(map) { }
-		~FullLogMap() { }
-		unsigned char ValueToColorR(long double value) const { return _map.ValueToColorR((log10(value*0.49995+0.50005)+2.0)/2.0); }
-		unsigned char ValueToColorG(long double value) const { return _map.ValueToColorG((log10(value*0.49995+0.50005)+2.0)/2.0);  }
-		unsigned char ValueToColorB(long double value) const { return _map.ValueToColorB((log10(value*0.49995+0.50005)+2.0)/2.0);  }
-		unsigned char ValueToColorA(long double value) const { return _map.ValueToColorA((log10(value*0.49995+0.50005)+2.0)/2.0);  }
-};
-
-/**
- * ColorMap that turns negative values into blue and positive values into red. Zero is represented with yellow.
- */
-class RedYellowBlueMap : public ColorMap {
-	public:
-		RedYellowBlueMap() { }
-		~RedYellowBlueMap() { }
-		unsigned char ValueToColorR(long double value) const {
-			if(value >= 1.0/3.0)
-				return 255;
-			else if(value >= -1.0/3.0)
-				return (unsigned char) (value*(255.0 * 3.0/2.0)) + 128;
-			else
-				return 0;
-		}
-		unsigned char ValueToColorG(long double value) const {
-			if(value >= 1.0/3.0)
-				return 255 - (unsigned char) ((value-1.0/3.0)*(255.0*3.0/2.0));
-			else if(value >= 0.0)
-				return 255;
-			else if(value >= -1.0/3.0)
-				return (unsigned char) ((value+1.0/3.0)*(255.0*6.0/2.0));
-			else 
-				return 0;
-		}
-		unsigned char ValueToColorB(long double value) const {
-			if(value >= 1.0/3.0)
-				return 0;
-			else if(value >= -1.0/3.0)
-				return 255 - (unsigned char) ((value+1.0/3.0)*(255.0*3.0/2.0));
-			else
-				return (unsigned char) ((value+1.0)*(255.0*3.0/2.0));
-		}
-		unsigned char ValueToColorA(long double) const { return 255; }
-};
-
-/**
- * ColorMap that turns negative values into blue and positive values into red. Zero is represented with black.
- */
-class RedYellowBlackBlueMap : public ColorMap {
-	public:
-		RedYellowBlackBlueMap() { }
-		~RedYellowBlackBlueMap() { }
-		unsigned char ValueToColorR(long double value) const {
-			if(value < 0.0)
-				return 0;
-			else if(value < 0.5)
-				return (unsigned char) (value*2.0*255.0);
-			else
-				return 255;
-		}
-		unsigned char ValueToColorG(long double value) const {
-			if(value < -0.5)
-				return (unsigned char) ((value+1.0)*255.0*2.0);
-			else if(value >= 0.5)
-				return (unsigned char) ((-value+1.0)*255.0*2.0);
-			else if(value < 0.0)
-				return (unsigned char) (-value*2.0*255.0);
-			else
-				return (unsigned char) (value*2.0*255.0);
-		}
-		unsigned char ValueToColorB(long double value) const {
-			if(value >= 0.0)
-				return 0;
-			else if(value >= -0.5)
-				return (unsigned char) (-value*2.0*255.0);
-			else
-				return 255;
-		}
-		unsigned char ValueToColorA(long double) const { return 255; }
-};
-
-/**
- * ColorMap that turns all negative values into black and positive values into a gray scale.
- */
-class PositiveMap : public ColorMap {
-	public:
-		PositiveMap() { }
-		~PositiveMap() { }
-		unsigned char ValueToColorR(long double value) const { return (unsigned char) (value>0.0 ? value*255.0 : 0); }
-		unsigned char ValueToColorG(long double value) const { return (unsigned char) (value>0.0 ? value*255.0 : 0); }
-		unsigned char ValueToColorB(long double value) const { return (unsigned char) (value>0.0 ? value*255.0 : 0); }
-		unsigned char ValueToColorA(long double) const { return 255; }
-};
-
-/**
- * ColorMap that is the negation of PositiveMap.
- */
-class InvPositiveMap : public ColorMap {
-	public:
-		InvPositiveMap() { }
-		~InvPositiveMap() { }
-		unsigned char ValueToColorR(long double value) const { return (unsigned char) (value>0.0 ? 255.0-value*255.0 : 255.0); }
-		unsigned char ValueToColorG(long double value) const { return (unsigned char) (value>0.0 ? 255.0-value*255.0 : 255.0); }
-		unsigned char ValueToColorB(long double value) const { return (unsigned char) (value>0.0 ? 255.0-value*255.0 : 255.0); }
-		unsigned char ValueToColorA(long double) const { return 255; }
-};
-
-/**
- * ColorMap that is the logarithmic negation of PositiveMap.
- */
-class LogInvPositiveMap : public ColorMap {
-	public:
-		LogInvPositiveMap() { }
-		~LogInvPositiveMap() { }
-		unsigned char ValueToColorR(long double value) const { return (unsigned char) (value>0.0 ? -log10(value*0.9+0.1)*255.0 : 255.0); }
-		unsigned char ValueToColorG(long double value) const { return (unsigned char) (value>0.0 ? -log10(value*0.9+0.1)*255.0 : 255.0); }
-		unsigned char ValueToColorB(long double value) const { return (unsigned char) (value>0.0 ? -log10(value*0.9+0.1)*255.0 : 255.0); }
-		unsigned char ValueToColorA(long double) const { return 255; }
-};
-
-/**
- * ColorMap that turns different integer values into different colours.
- */
-class IntMap {
-	public:
-		static unsigned char R(int value) {
-			switch (value%16)
-			{
-				case 0:
-				case 3:
-				case 5:
-				case 6:
-					return 255;
-				case 8:
-				case 11:
-				case 13:
-				case 14:
-					return 127;
-				default:
-					return 0;	
-			}
-		}
-		static unsigned char G(int value) {
-			switch (value%16)
-			{
-				case 1:
-				case 3:
-				case 4:
-				case 6:
-					return 255;
-				case 9:
-				case 11:
-				case 12:
-				case 14:
-					return 127;
-				default:
-					return 0;	
-			}
-		}
-		static unsigned char B(int value) {
-			switch (value%16)
-			{
-				case 2:
-				case 4:
-				case 5:
-				case 6:
-					return 255;
-				case 10:
-				case 12:
-				case 13:
-				case 14:
-					return 127;
-				default:
-					return 0;	
-			}
-		}
-		static unsigned char A(int) { return 255; }
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/msio/date.h b/CEP/DP3/AOFlagger/include/AOFlagger/msio/date.h
deleted file mode 100644
index 55005422d764d546c7191e35bb939299a06b378b..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/msio/date.h
+++ /dev/null
@@ -1,161 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#ifndef MSIODATE_H
-#define MSIODATE_H
-
-#include <string>
-#include <sstream>
-#include <cmath>
-
-class Date {
-	public:
-		static double JDToYears(double jd) {
-			return jd / 365.25L - 4712.0L;
-		}
-		static double JDToMonth(double jd) {
-			return ((int) floor((jd / (365.25L)- 4712.0L)/12.0L))%12;
-		}
-		static int JDToDayOfYear(double jd) {
-			//return floor(jd - floor(jd / (365.25L))*365.25L);
-			double x2 = (jd-1721119.5); // number of days since year 0
-			int c2 = (int) ((8.0*x2 + 7.0)/292194.0);
-			double x1 = x2-floor(146097.0*c2/4.0); // number of days since beginning of century
-			int c1 = (int) ((200*x1 + 199)/73050);
-			double x0 = x1 - floor(36525.0*c1/100.0);
-			return (int) x0;
-		}
-		static void JDToDate(double jd, int &dayOfMonth, int &month, int &year)
-		{
-			double x2 = (jd-1721119.5); // number of days since year 0
-			int c2 = (int) ((8.0*x2 + 7.0)/292194.0);
-			double x1 = x2-floor(146097.0*c2/4.0); // number of days since beginning of century
-			int c1 = (int) ((200*x1 + 199)/73050);
-			double x0 = x1 - floor(36525.0*c1/100.0);
-			year = 100*c2 + c1;
-			month = (int) ((10.0*x0 + 923.0)/306.0);
-			dayOfMonth = (int) x0-((153*month-457)/5) + 1;
-			if(month>12)
-			{
-				month -= 12;
-				++year;
-			}
-		}
-		static double JDToHourOfDay(double jd) {
-			return fmodl(jd+0.5, 1.0) * 24.0;
-		}
-		static double MJDToJD(double mjd) {
-			return mjd + 2400000.5;
-		}
-		static double JDToMJD(double jd) {
-			return jd - 2400000.5;
-		}
-		static double JDToAipsMJD(double jd) {
-			return JDToMJD(jd) * (60.0*60.0*24.0);
-		} 
-		static double MJDToAipsMJD(double jd) {
-			return jd * (60.0*60.0*24.0);
-		} 
-		static double AipsMJDToJD(double aipsMjd) {
-			return MJDToJD(aipsMjd / (60.0*60.0*24.0));
-		}
-		static double AipsMJDToYears(double aipsMjd) {
-			return JDToYears(AipsMJDToJD(aipsMjd));
-		}
-		static std::string ToString(double time, int dayOfMonth, int month, int year)
-		{
-			std::stringstream s;
-			int mins = int(time*60)%60;
-			int secs = int(time*3600)%60;
-			int msec = int(time*3600000)%1000;
-			s << floor(time) << ":" << (mins/10) << (mins%10) << ":" << (secs/10) << (secs%10) << "." << msec/100 << (msec/10)%10 << (msec)%10
-				<< ", " << year << "-";
-			if(month < 10) s << "0";
-			s << month << "-";
-			if(dayOfMonth < 10) s << "0";
-			s << dayOfMonth;
-			return s.str();
-		}
-		static std::string ToString(double time)
-		{
-			std::stringstream s;
-			int msec = int(round(time*3600000))%1000;
-			time -= msec/3600000.0;
-			
-			int secs = int(round(time*3600))%60;
-			time -= secs/3600.0;
-			
-			int mins = int(round(time*60))%60;
-			time -= mins/60.0;
-			
-			int hours = int(round(time));
-			time -= hours;
-			s << hours << ":" << (mins/10) << (mins%10);
-			if(msec != 0 || secs != 0)
-			{
-				s << ":" << (secs/10) << (secs%10);
-				if(msec != 0)
-					s << "." << msec/100 << (msec/10)%10 << (msec)%10;
-			}
-			return s.str();
-		}
-		static std::string ToString(int dayOfMonth, int month, int year)
-		{
-			std::stringstream s;
-			s << year << "-";
-			if(month < 10) s << "0";
-			s << month << "-";
-			if(dayOfMonth < 10) s << "0";
-			s << dayOfMonth;
-			return s.str();
-		}
-		static std::string AipsMJDToString(double aipsMjd) {
-			double jd = AipsMJDToJD(aipsMjd);
-			double time = JDToHourOfDay(jd);
-			int year, month, day;
-			JDToDate(jd, day, month, year);
-			return ToString(time, day, month, year);
-		}
-		static std::string AipsMJDToDateString(double aipsMjd) {
-			double jd = AipsMJDToJD(aipsMjd);
-			int year, month, day;
-			JDToDate(jd, day, month, year);
-			return ToString(day, month, year);
-		}
-		static std::string AipsMJDToTimeString(double aipsMjd) {
-			double jd = AipsMJDToJD(aipsMjd);
-			double time = JDToHourOfDay(jd);
-			return ToString(time);
-		}
-		static std::string AipsMJDToRoundTimeString(double aipsMjd) {
-			double jd = AipsMJDToJD(aipsMjd);
-			double time = round(JDToHourOfDay(jd)*60.0*60.0)/(60.0*60.0);
-			return ToString(time);
-		}
-		static std::string JDToString(double jd)
-		{
-			double time = JDToHourOfDay(jd);
-			int year, month, day;
-			JDToDate(jd, day, month, year);
-			return ToString(time, day, month, year);
-		}
-};
-
-#endif //MSIODATE_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/msio/directbaselinereader.h b/CEP/DP3/AOFlagger/include/AOFlagger/msio/directbaselinereader.h
deleted file mode 100644
index 164826db9a72e8c56c2840756f3a9b2d8b9824af..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/msio/directbaselinereader.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef DIRECTBASELINEREADER_H
-#define DIRECTBASELINEREADER_H
-
-#include <map>
-#include <vector>
-#include <stdexcept>
-
-#include <AOFlagger/msio/antennainfo.h>
-#include <AOFlagger/msio/baselinereader.h>
-#include <AOFlagger/msio/image2d.h>
-#include <AOFlagger/msio/mask2d.h>
-#include <AOFlagger/msio/measurementset.h>
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class DirectBaselineReader : public BaselineReader {
-	public:
-		explicit DirectBaselineReader(const std::string &msFile);
-		~DirectBaselineReader();
-
-		virtual void PerformReadRequests();
-		virtual void PerformFlagWriteRequests();
-		virtual void PerformDataWriteTask(std::vector<Image2DCPtr> /*_realImages*/, std::vector<Image2DCPtr> /*_imaginaryImages*/, int /*antenna1*/, int /*antenna2*/, int /*spectralWindow*/)
-		{
-			throw std::runtime_error("The direct baseline reader can not write data back to file: use the indirect reader");
-		}
-		std::vector<UVW> ReadUVW(unsigned antenna1, unsigned antenna2, unsigned spectralWindow);
-		void ShowStatistics();
-	private:
-		struct BaselineCacheItem
-		{
-			BaselineCacheItem() { }
-			BaselineCacheItem(const BaselineCacheItem &source)
-			: antenna1(source.antenna1), antenna2(source.antenna2), spectralWindow(source.spectralWindow), rows(source.rows)
-			{
-			}
-			void operator=(const BaselineCacheItem &source)
-			{
-				antenna1 = source.antenna1;
-				antenna2 = source.antenna2;
-				spectralWindow = source.spectralWindow;
-				rows = source.rows;
-			}
-			
-			int antenna1, antenna2, spectralWindow;
-			std::vector<size_t> rows;
-		};
-		
-		void initBaselineCache();
-		
-		void addRequestRows(ReadRequest request, size_t requestIndex, std::vector<std::pair<size_t, size_t> > &rows);
-		void addRequestRows(WriteRequest request, size_t requestIndex, std::vector<std::pair<size_t, size_t> > &rows);
-		void addRowToBaselineCache(int antenna1, int antenna2, int spectralWindow, size_t row);
-		void readUVWData();
-
-		void readTimeData(size_t requestIndex, size_t xOffset, int frequencyCount, const casa::Array<casa::Complex> data, const casa::Array<casa::Complex> *model);
-		void readTimeFlags(size_t requestIndex, size_t xOffset, int frequencyCount, const casa::Array<bool> flag);
-		void readWeights(size_t requestIndex, size_t xOffset, int frequencyCount, const casa::Array<float> weight);
-
-		std::vector<BaselineCacheItem> _baselineCache;
-};
-
-#endif // DIRECTBASELINEREADER_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/msio/fitsfile.h b/CEP/DP3/AOFlagger/include/AOFlagger/msio/fitsfile.h
deleted file mode 100644
index 5431034118abbe7286023e02982a07d625c6158f..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/msio/fitsfile.h
+++ /dev/null
@@ -1,284 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2007 by Andre Offringa   *
- *   offringa@gmail.com   *
- *                                                                         *
- *   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.             *
- ***************************************************************************/
-/** @file
- * This is the header file for the FitsFile and FitsIOException class.
- * @author André Offringa <offringa@gmail.com>
- */
-#ifndef FITSFILE_H
-#define FITSFILE_H
-
-#include "../baseexception.h"
-
-#include <fitsio.h>
-#include <string>
-#include <exception>
-
-#include <math.h>
-
-#include "types.h"
-
-/**
- * This class represents an exception that occurred during reading/writing of a FITS file.
- * @see FitsFile
- */
-class FitsIOException : public BaseException {
-	public:
-		FitsIOException() : BaseException() { }
-		FitsIOException(const std::string &description) : BaseException(description) { }
-		~FitsIOException() throw() { }
-};
-
-/**
- * This class wraps the cfitsio library. It can be used to read or write a FITS file with
- * a (two dimensional) image. The fits file supports some other things, like tables, which
- * are not supported in this class. The FITS files generated by the MeqTrees process can
- * be read by this file. The FITS file can store multiple images in one file.
- *
- * This class works closely together with the Image2D class.
- * @see Image2D
- */
-class FitsFile {
-	public:
-		/**
-		 * Specifies how a FITS file should be opened
-		 */
-		enum FileMode {
-			/**
-			 * Only open for reading
-			 */
-			ReadOnlyMode,
-	 		/**
-			 * Open for reading and writing
-			 */
-	 		ReadWriteMode
-		};
-		
-		/**
-		 * The HDU is an entity inside a FITS file. This enum defines the possible entity types.
-		 */
-		enum HDUType {
-			/**
-			 * One or more two dimensional images
-			 */
-			ImageHDUType,
-	 		/**
-			 * An ASCII table
-			 */
-			ASCIITableHDUType,
-			/**
-			 * A binary table
-			 */
-			BinaryTableHDUType
-		};
-		
-		/**
-		 * This enum defines the possible image types in an image HDU.
-		 */
-		enum ImageType {
-			/**
-			 * Image consisting of 8 bit integers.
-			 */
-			Int8ImageType,
-			/**
-			 * Image consisting of 16 bit integers.
-			 */
-			Int16ImageType,
-			/**
-			 * Image consisting of 32 bit integers.
-			 */
-			Int32ImageType,
-			/**
-			 * Image consisting of 32 bit floats.
-			 */
-			Float32ImageType,
-			/**
-			 * Image consisting of 64 bit doubles.
-			 */
-			Double64ImageType
-		};
-		
-		/**
-		 * Construct a new FitsFile class associated with the specified filename.
-		 * @param filename The file name of the fits file, to be opened with Open() or
-		 * created with Create().
-		 */
-		FitsFile(const std::string &filename);
-		
-		/**
-		 * Destructor.
-		 * @throws FitsIOException in case something failed due to an IO error.
-		 */
-		~FitsFile();
-		
-		/**
-		 * Open the file.
-		 * @param mode In which way the file should be opened.
-		 * @throws FitsIOException in case opening failed due to an IO error.
-		 */
-		void Open(FileMode mode = ReadOnlyMode);
-		
-		/**
-		 * Create a new FITS file.
-		 * @throws FitsIOException in case writing failed due to an IO error.
-		 */
-		void Create();
-		
-		/**
-		 * Close the file, releasing resources.
-		 * @throws FitsIOException in case something happent due to an IO error.
-		 */
-		void Close();
-		
-		/**
-		 * Determine whether the file is ready for reading and/or writing.
-		 * @return @c true if the file has been opened.
-		 */
-		bool IsOpen() const { return _isOpen; }
-		
-		/**
-		 * Retrieve the number of HDU blocks inside the file.
-		 * @return The number of HDU blocks inside the file.
-		 * @throws FitsIOException in case reading failed due to an IO error.
-		 */
-		int GetHDUCount();
-		
-		/**
-		 * Retrieve the index of the current HDU block.
-		 * @return The index of the current HDU block.
-		 * @throws FitsIOException in case reading failed due to an IO error.
-		 */
-		int GetCurrentHDU();
-		
-		/**
-		 * Retrieve the type of the current HDU block.
-		 * @return The type of the current HDU block.
-		 * @throws FitsIOException in case reading failed due to an IO error.
-		 */
-		enum HDUType GetCurrentHDUType();
-		
-		/**
-		 * Start reading another HDU block, specified by its index.
-		 * @param hduNumber Index of the HDU block to move to.
-		 * @throws FitsIOException in case reading failed due to an IO error.
-		 */
-		void MoveToHDU(int hduNumber);
-		
-		/**
-		 * Retrieve what kind of image this HDU image block is. Only call this
-		 * method if GetCurrentHDUType() returned ImageHDUType.
-		 * @return The image type.
-		 * @throws FitsIOException in case reading failed due to an IO error.
-		 */
-		FitsFile::ImageType GetCurrentImageType();
-		
-		/**
-		 * Retrieve the number of dimensions of an image. This is often more than
-		 * 2, although the FITS file actually contains (several) 2D images.
-		 * @return The number of dimensions.
-		 * @see GetCurrentImageSize()
-		 * @throws FitsIOException in case reading failed due to an IO error.
-		 */
-		int GetCurrentImageDimensionCount();
-		
-		/**
-		 * Retrieve the size of a specific dimension.
-		 * @param dimension The dimension to retrieve the size for (first dimension = 0)
-		 * @return The size of the dimension.
-		 * @see GetCurrentImageDimensionCount()
-		 * @throws FitsIOException in case reading failed due to an IO error.
-		 */
-		long GetCurrentImageSize(int dimension);
-
-		/**
-		 * Writes a new image HUD to the FITS file. Does not write the data itself, only the headers. The WriteImage()
-		 * call should be called next.
-		 * @param imageType Type of image
-		 * @param width Width of image
-		 * @param height Height of image
-		 * @throws FitsIOException in case writing failed due to an IO error.
-		 */
-		void AppendImageHUD(enum FitsFile::ImageType imageType, long width, long height);
-
-		/**
-		 * Reads one image into a buffer. The image will be converted to @c long @c doubles.
-		 * @param startPos This specifies where to start reading. If several images are stored in the 3rd or 4th dimension,
-		 * they can be read one by one by starting at different start positions.
-		 * @param buffer The buffer where the image will be stored.
-		 * @param bufferSize Size of the buffer. Reading will stop once the buffer is full. It makes sense to use buffer the size
-		 * of the 1st x 2nd dimension.
-		 * @param nullValue What value should be used to represent null values.
-		 * @throws FitsIOException in case reading failed due to an IO error.
-		 */
-		void ReadCurrentImageData(long startPos, num_t *buffer, long bufferSize, long double nullValue = nan("Unset value"));
-		
-		/**
-		 * Writes an image to the FITS file.
-		 * @param startPos Where inside the image to start writing.
-		 * @param buffer Buffer containing the image data
-		 * @param bufferSize Size of the buffer
-		 * @param nullValue What value was used to represent null values.
-		 * @see ReadCurrentImageData
-		 * @throws FitsIOException in case writing failed due to an IO error.
-		 */
-		void WriteImage(long startPos, double *buffer, long bufferSize, double nullValue = nan("Unset value"));
-		
-		int GetKeywordCount();
-		std::string GetKeyword(int keywordNumber);
-		std::string GetKeywordValue(int keywordNumber);
-		std::string GetKeywordValue(const std::string &keywordName);
-		std::string GetKeywordComment(int keywordNumber);
-		int GetRowCount();
-		int GetColumnCount();
-		int GetColumnType(int colNumber);
-		bool HasGroups();
-		int GetIntKeywordValue(int keywordNumber);
-		int GetIntKeywordValue(const std::string &keywordName);
-		double GetDoubleKeywordValue(int keywordNumber);
-		double GetDoubleKeywordValue(const std::string &keywordName);
-		int GetGroupCount();
-		int GetParameterCount();
-		long GetImageSize();
-		long GetGroupSize();
-		void ReadGroup(long groupIndex, long double *groupData);
-		void ReadGroupData(long groupIndex, long double *groupData);
-		void ReadGroupParameters(long groupIndex, long double *parametersData);
-		void ReadTableCell(int row, int col, long double *output, size_t size);
-		void ReadTableCell(int row, int col, double *output, size_t size);
-		void ReadTableCell(int row, int col, bool *output, size_t size);
-		void ReadTableCell(int row, int col, char *output);
-		void WriteTableCell(int row, int col, double *data, size_t size);
-		void WriteTableCell(int row, int col, const bool *data, size_t size);
-		bool HasTableColumn(const std::string &columnName, int columnIndex);
-		int GetTableColumnIndex(const std::string &columnName);
-		int GetTableColumnArraySize(int columnIndex);
-		long GetTableDimensionSize(int columnIndex, int dimension);
-		int GetGroupParameterIndex(const std::string &parameterName);
-		int GetGroupParameterIndex(const std::string &parameterName, int number);
-		bool HasGroupParameter(const std::string &parameterName);
-		bool HasGroupParameter(const std::string &parameterName, int number);
-		const std::string &Filename() const { return _filename; }
-	private:
-		const std::string _filename;
-		fitsfile *_fptr;
-		bool _isOpen;
-		inline void CheckStatus(int status) const;
-		inline void CheckOpen() const;
-};
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/msio/image2d.h b/CEP/DP3/AOFlagger/include/AOFlagger/msio/image2d.h
deleted file mode 100644
index 149e0db6f03b19b9a7576013611c379e4627d1df..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/msio/image2d.h
+++ /dev/null
@@ -1,458 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2007 by Andre Offringa   *
- *   offringa@gmail.com   *
- *                                                                         *
- *   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.             *
- ***************************************************************************/
-/** @file
- * This is the header file for the Image2D class.
- * @author André Offringa <offringa@gmail.com>
- */
-#ifndef IMAGE2D_H
-#define IMAGE2D_H
-
-#include "../baseexception.h"
-#include "colormap.h"
-#include "types.h"
-
-#include <string.h>
-
-#include <boost/shared_ptr.hpp>
-
-#include <exception>
-
-typedef boost::shared_ptr<class Image2D> Image2DPtr;
-typedef boost::shared_ptr<const class Image2D> Image2DCPtr;
-
-/**
- * This class represents a two dimensional single-valued (=gray scale) image. It can be
- * read from and written to a @c .fits file and written to a @c .png file. A new Image2D can
- * be constructed with e.g. the CreateFromFits(), CreateEmptyImage() or CreateFromDiff() static methods.
- */
-class Image2D {
-	public:
-		
-		/**
-		 * Creates an image containing unset values.
-		 * @param width Width of the new image.
-		 * @param height Height of the new image.
-		 * @return The new image. Should be deleted by the caller.
-		 */
-		static Image2D *CreateUnsetImage(size_t width, size_t height)
-		{
-			return new Image2D(width, height);
-		}
-		
-		/**
-		 * As CreateUnsetImage(), but returns a smart pointer instead.
-		 * @param width Width of the new image.
-		 * @param height Height of the new image.
-		 * @return A (unique) smart pointer to the new image.
-		 */
-		static Image2DPtr CreateUnsetImagePtr(size_t width, size_t height)
-		{
-			return Image2DPtr(CreateUnsetImage(width, height));
-		}
-		
-		/**
-		 * Creates an image containing zeros.
-		 * @param width Width of the new image.
-		 * @param height Height of the new image.
-		 * @return The new created image. Should be deleted by the caller.
-		 */
-		static Image2D *CreateZeroImage(size_t width, size_t height);
-		
-		/**
-		 * As CreateZeroImage(), but returns a smart pointer instead.
-		 * @param width Width of the new image.
-		 * @param height Height of the new image.
-		 * @return The (unique) smart pointer to the new image.
-		 */
-		static Image2DPtr CreateZeroImagePtr(size_t width, size_t height)
-		{
-			return Image2DPtr(CreateZeroImage(width, height));
-		}
-
-		/**
-		 * Destructor.
-		 */
-		~Image2D();
-		
-		/**
-		 * Creates a new image by subtracting two images of the same size.
-		 * @param imageA first image.
-		 * @param imageB second image.
-		 * @return The new created image. Should be deleted by the caller.
-		 * @throws FitsIOException if the images do not match in size.
-		 */
-		static Image2D *CreateFromSum(const Image2D &imageA, const Image2D &imageB);
-		static Image2DPtr CreateFromSum(const Image2DCPtr &imageA, const Image2DCPtr &imageB)
-		{
-			return Image2DPtr(CreateFromSum(*imageA, *imageB));
-		}
-		/**
-		 * Creates a new image by subtracting two images of the same size.
-		 * @param imageA first image.
-		 * @param imageB second image.
-		 * @return The new created image. Should be deleted by the caller.
-		 * @throws FitsIOException if the images do not match in size.
-		 */
-		static Image2D *CreateFromDiff(const Image2D &imageA, const Image2D &imageB);
-		static Image2DPtr CreateFromDiff(const Image2DCPtr &imageA, const Image2DCPtr &imageB)
-		{
-			return Image2DPtr(CreateFromDiff(*imageA, *imageB));
-		}
-
-		static Image2D *CreateCopy(const Image2D &image);
-		static Image2DPtr CreateCopy(const Image2DCPtr &image)
-		{
-			return Image2DPtr(CreateCopy(*image));
-		}
-		static Image2DPtr CreateCopyPtr(const Image2D &image)
-		{
-			return Image2DPtr(CreateCopy(image));
-		}
-
-		/**
-		 * Retrieves the average value of the image.
-		 * @return The average value.
-		 */
-		num_t GetAverage() const;
-		
-		/**
-		 * Returns the maximum value in the image.
-		 * @return The maximimum value.
-		 */
-		num_t GetMaximum() const;
-		
-		/**
-		 * Returns the maximum value in the specified range.
-		 * @return The maximimum value.
-		 */
-		num_t GetMaximum(size_t xOffset, size_t yOffset, size_t width, size_t height) const;
-
-		/**
-		 * Returns the minimum value in the image.
-		 * @return The minimum value.
-		 */
-		num_t GetMinimum() const;
-		
-		/**
-		 * Returns the minimum value in the specified range.
-		 * @return The minimum value.
-		 */
-		num_t GetMinimum(size_t xOffset, size_t yOffset, size_t width, size_t height) const;
-
-		/**
-		 * Returns the maximum finite value in the image.
-		 * @return The maximimum value.
-		 */
-		num_t GetMaximumFinite() const;
-		
-		/**
-		 * Returns the minimum finite value in the image.
-		 * @return The minimum value.
-		 */
-		num_t GetMinimumFinite() const;
-		
-		/**
-		 * Retrieves the value at a specific position.
-		 * @param x x-coordinate
-		 * @param y y-coordinate
-		 * @return The value.
-		 */
-		inline num_t Value(size_t x, size_t y) const { return _dataPtr[y][x]; }
-		
-		/**
-		 * Get the width of the image.
-		 * @return Width of the image.
-		 */
-		inline size_t Width() const { return _width; }
-		
-		/**
-		 * Get the height of the image.
-		 * @return Height of the image.
-		 */
-		inline size_t Height() const { return _height; }
-		
-		/**
-		 * Change a value at a specific position.
-		 * @param x x-coordinate of value to change.
-		 * @param y y-coordinate of value to change.
-		 * @param newValue New value.
-		 */
-		inline void SetValue(size_t x, size_t y, num_t newValue)
-		{
-			_dataPtr[y][x] = newValue;
-		}
-
-		void SetValues(const Image2D &source);
-		void SetValues(const Image2DCPtr &source)
-		{
-			SetValues(*source);
-		}
-
-		void SetAll(num_t value);
-		
-		inline void AddValue(size_t x, size_t y, num_t addValue)
-		{
-			_dataPtr[y][x] += addValue;
-		}
-		
-		/**
-		 * Check whether this image is completely zero.
-		 * @return @c true if the value only contains zeros.
-		 */
-		bool ContainsOnlyZeros() const;
-		
-		/**
-		 * Compute the sum of all values
-		 */
-		num_t Sum() const
-		{
-			num_t sum = 0.0;
-			for(size_t y=0;y<_height;++y)
-			{
-				for(size_t x=0;x<_width;++x)
-					sum += Value(x, y);
-			}
-			return sum;
-		}
-		
-		void SetToAbs()
-		{
-			for(size_t y=0;y<_height;++y)
-			{
-				for(size_t x=0;x<_width;++x)
-					SetValue(x, y,  fabsn(Value(x, y)));
-			}
-		}
-		
-		/**
-		 * Retrieve a factor to multiply the values with to normalise them.
-		 * @return Normalisation factor.
-		 */
-		num_t GetMaxMinNormalizationFactor() const;
-
-		num_t GetStdDev() const;
-
-		num_t GetRMS() const
-		{
-			return GetRMS(0, 0, _width, _height);
-		}
-
-		num_t GetMode() const;
-		
-		num_t GetRMS(size_t xOffset, size_t yOffset, size_t width, size_t height) const;
-
-		/**
-		 * Normalize the data so that the variance is 1.
-		 */
-		void NormalizeVariance();
-
-		/**
-		* Create a new image instance by reading a fitsfile.
-		* @param file The fits file.
-		* @param imageNumber The number of the image.
-		* @return The new created image. Should be deleted by the caller.
-		* @throws FitsIOException if something goes wrong during reading the .fits file.
-		*/
-		static Image2D *CreateFromFits(class FitsFile &file, int imageNumber);
-
-		/**
-		* Number of images that can be read from the current HUD block
-		* in the fits file.
-		* @param file Fits file.
-		* @return Number of images.
-		*/
-		static long GetImageCountInHUD(class FitsFile &file);
-
-		/**
-		* Save the image to a fits file.
-		* @param filename Fits filename.
-		* @throws IOException if something goes wrong during writing
-		*/
-		void SaveToFitsFile(const std::string &filename) const;
-
-		/**
-		 * Count the number of values that are above a specified value.
-		 */
-		size_t GetCountAbove(num_t value) const;
-		size_t GetCountBelowOrEqual(num_t value) const
-		{
-			return _width*_height - GetCountAbove(value);
-		}
-
-		/**
-		 * Returns a threshold for which @c count values are above the
-		 * the threshold. That is, GetCountAbove(GetTresholdForCountAbove(x)) = x.
-		 */
-		num_t GetTresholdForCountAbove(size_t count) const;
-
-		/**
-		 * Copies all values to the specified array. The array should be of size width*height.
-		 */
-		void CopyData(num_t *destination) const;
-
-		/**
-		 * Multiply all values with a factor.
-		 */
-		void MultiplyValues(num_t factor);
-		
-		/**
-		 * Will set all values to lhs - this.
-		 */
-		void SubtractAsRHS(const Image2DCPtr &lhs);
-
-		/**
-		 * Flips the image round the diagonal, i.e., x becomes y and y becomes x.
-		 */
-		Image2DPtr CreateXYFlipped() const
-		{
-			Image2D *image = new Image2D(_height, _width);
-			for(unsigned y=0;y<_height;++y)
-			{
-				for(unsigned x=0;x<_width;++x)
-					image->_dataPtr[x][y] = _dataPtr[y][x];
-			}
-			return Image2DPtr(image);
-		}
-		
-		void SwapXY()
-		{
-			Image2DPtr swapped = CreateXYFlipped();
-			Swap(swapped);
-		}
-		
-		/**
-		 * Swaps the contents of the two masks. This can be used as a move assignment operator, as it
-		 * only swaps pointers; hence it is fast.
-		 */
-		void Swap(Image2D &source)
-		{
-			std::swap(source._width, _width);
-			std::swap(source._stride, _stride);
-			std::swap(source._height, _height);
-			std::swap(source._dataPtr, _dataPtr);
-			std::swap(source._dataConsecutive, _dataConsecutive);
-		}
-		
-		/**
-		 * Swaps the contents of the two masks. This can be used as a move assignment operator, as it
-		 * only swaps pointers; hence it is fast.
-		 */
-		void Swap(const Image2DPtr &source)
-		{
-			Swap(*source);
-		}
-		
-		/**
-		 * Resample the image horizontally by decreasing the width
-		 * with an integer factor.
-		 */
-		Image2DPtr ShrinkHorizontally(size_t factor) const;
-
-		/**
-		 * Resample the image vertically by decreasing the height
-		 * with an integer factor.
-		 */
-		Image2DPtr ShrinkVertically(size_t factor) const;
-
-		/**
-		 * Resample the image horizontally by increasing the width
-		 * with an integer factor.
-		 */
-		Image2DPtr EnlargeHorizontally(size_t factor, size_t newWidth) const;
-
-		/**
-		 * Resample the image vertically by increasing the width
-		 * with an integer factor.
-		 */
-		Image2DPtr EnlargeVertically(size_t factor, size_t newHeight) const;
-
-		Image2DPtr Trim(size_t startX, size_t startY, size_t endX, size_t endY) const;
-		
-		void SetTrim(size_t startX, size_t startY, size_t endX, size_t endY);
-		
-		void CopyFrom(const Image2DCPtr &source, size_t destX, size_t destY)
-		{
-			size_t
-				x2 = source->_width + destX,
-				y2 = source->_height + destY;
-			if(x2 > _width) x2 = _width;
-			if(y2 > _height) y2 = _height;
-			for(size_t y=destY;y<y2;++y)
-			{
-				for(size_t x=destX;x<x2;++x)
-					SetValue(x, y, source->Value(x-destX, y-destY));
-			}
-		}
-		
-		/**
-		 * Returns a pointer to one row of data. This can be used to step
-		 * quickly over the data in x direction. Note that the next row
-		 * is not exactly at "one times width", because the number of
-		 * samples in a row is made divisable by four. This makes it
-		 * possible to execute SSE instruction easily.
-		 * 
-		 * If you want to skip over a whole row, use the Stride() method
-		 * to determine the intrinsicly used width of one row.
-		 * 
-		 * @see Stride()
-		 */
-		inline num_t *ValuePtr(unsigned x, unsigned y)
-		{
-			return &_dataPtr[y][x];
-		}
-		
-		/**
-		 * Returns a constant pointer to one row of data. This can be used to
-		 * step quickly over the data in x direction. Note that the next row
-		 * is not exactly at "one times width", because the number of
-		 * samples in a row is made divisable by four. This makes it
-		 * possible to execute SSE instruction easily.
-		 * 
-		 * If you want to skip over a whole row, use the Stride() method
-		 * to determine the intrinsicly used width of one row.
-		 * 
-		 * @see Stride()
-		 */
-		inline const num_t *ValuePtr(unsigned x, unsigned y) const
-		{
-			return &_dataPtr[y][x];
-		}
-		
-		/**
-		 * This value specifies the intrinsic width of one row. It is
-		 * normally the first number that is >= Width() and divisable by
-		 * four. When using the ValuePtr(unsigned, unsigned) method,
-		 * this value can be used to step over one row.
-		 * 
-		 * @see ValuePtr(unsigned, unsigned)
-		 */
-		inline size_t Stride() const
-		{
-			return _stride;
-		}
-		
-	private:
-		Image2D(size_t width, size_t height);
-		size_t _width, _height;
-		size_t _stride;
-		num_t **_dataPtr, *_dataConsecutive;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/msio/indirectbaselinereader.h b/CEP/DP3/AOFlagger/include/AOFlagger/msio/indirectbaselinereader.h
deleted file mode 100644
index 9fbc2ff85a5aa7584d6443274e63b42126d594fc..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/msio/indirectbaselinereader.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef INDIRECTBASELINEREADER_H
-#define INDIRECTBASELINEREADER_H
-
-#include <map>
-#include <vector>
-#include <stdexcept>
-
-#include <AOFlagger/msio/baselinereader.h>
-#include <AOFlagger/msio/directbaselinereader.h>
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class IndirectBaselineReader : public BaselineReader {
-	public:
-		explicit IndirectBaselineReader(const std::string &msFile);
-		~IndirectBaselineReader();
-
-		virtual void PerformReadRequests();
-		virtual void PerformFlagWriteRequests();
-		virtual void PerformDataWriteTask(std::vector<Image2DCPtr> _realImages, std::vector<Image2DCPtr> _imaginaryImages, int antenna1, int antenna2, int spectralWindow);
-		
-		void ShowStatistics();
-		virtual size_t GetMinRecommendedBufferSize(size_t /*threadCount*/) { return 1; }
-		virtual size_t GetMaxRecommendedBufferSize(size_t /*threadCount*/) { return 2; }
-		void SetReadUVW(bool readUVW) { _readUVW = readUVW; }
-	private:
-		void initializeReorderedMS();
-		void reorderMS();
-		void updateOriginalMSData();
-		void updateOriginalMSFlags();
-		void performFlagWriteTask(std::vector<Mask2DCPtr> flags, int antenna1, int antenna2);
-		
-		template<bool UpdateData, bool UpdateFlags>
-		void updateOriginalMS();
-		
-		void removeTemporaryFiles();
-		std::string DataFilename(int antenna1, int antenna2) const
-		{
-			std::stringstream dataFilename;
-			dataFilename << "data-" << antenna1 << "x" << antenna2 << ".tmp";
-			return dataFilename.str();
-		}
-		std::string FlagFilename(int antenna1, int antenna2) const
-		{
-			std::stringstream flagFilename;
-			flagFilename << "flag-" << antenna1 << "x" << antenna2 << ".tmp";
-			return flagFilename.str();
-		}
-
-		DirectBaselineReader _directReader;
-		bool _msIsReordered;
-		bool _removeReorderedFiles;
-		bool _reorderedDataFilesHaveChanged;
-		bool _reorderedFlagFilesHaveChanged;
-		size_t _maxMemoryUse;
-		bool _readUVW;
-};
-
-#endif // INDIRECTBASELINEREADER_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/msio/mask2d.h b/CEP/DP3/AOFlagger/include/AOFlagger/msio/mask2d.h
deleted file mode 100644
index 7395be256420b35eaf0b0be3c33dbf480a5a4604..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/msio/mask2d.h
+++ /dev/null
@@ -1,353 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef MASK2D_H
-#define MASK2D_H
-
-#include <string.h>
-
-#include <boost/shared_ptr.hpp>
-
-#include "image2d.h"
-
-typedef boost::shared_ptr<class Mask2D> Mask2DPtr;
-typedef boost::shared_ptr<const class Mask2D> Mask2DCPtr;
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class Mask2D {
-	public:
-		~Mask2D();
-
-		// This method assumes equal height and width.
-		void operator=(Mask2DCPtr source)
-		{
-			memcpy(_valuesConsecutive, source->_valuesConsecutive, _stride * _height * sizeof(bool));
-		}
-
-		// This method assumes equal height and width.
-		void operator=(const Mask2D &source)
-		{
-			memcpy(_valuesConsecutive, source._valuesConsecutive, _stride * _height * sizeof(bool));
-		}
-		
-		/**
-		 * Swaps the contents of the two masks. This can be used as a move assignment operator, as it
-		 * only swaps pointers; hence it is fast.
-		 */
-		void Swap(Mask2D &source)
-		{
-			std::swap(source._width, _width);
-			std::swap(source._stride, _stride);
-			std::swap(source._height, _height);
-			std::swap(source._values, _values);
-			std::swap(source._valuesConsecutive, _valuesConsecutive);
-		}
-
-		/**
-		 * Swaps the contents of the two masks. This can be used as a move assignment operator, as it
-		 * only swaps pointers; hence it is fast.
-		 */
-		void Swap(Mask2DPtr source)
-		{
-			Swap(*source);
-		}
-		
-		static Mask2D *CreateUnsetMask(size_t width, size_t height)
-		{
-			return new Mask2D(width, height);
-		}
-		static Mask2DPtr CreateUnsetMaskPtr(size_t width, size_t height)
-		{
-			return Mask2DPtr(new Mask2D(width, height));
-		}
-
-		static Mask2D *CreateUnsetMask(const class Image2D &templateImage);
-		static Mask2DPtr CreateUnsetMask(Image2DCPtr templateImage)
-		{
-			return Mask2DPtr(CreateUnsetMask(*templateImage));
-		}
-
-		template<bool InitValue>
-		static Mask2D *CreateSetMask(const class Image2D &templateImage);
-
-		template<bool InitValue>
-		static Mask2DPtr CreateSetMask(Image2DCPtr templateImage)
-		{
-			return Mask2DPtr(CreateSetMask<InitValue>(*templateImage));
-		}
-
-		template<bool InitValue>
-		static Mask2D *CreateSetMask(size_t width, size_t height)
-		{
-			Mask2D *newMask = new Mask2D(width, height);
-			memset(newMask->_valuesConsecutive, InitValue, newMask->_stride * height * sizeof(bool));
-			return newMask;
-		}
-
-		template<bool InitValue>
-		static Mask2DPtr CreateSetMaskPtr(size_t width, size_t height)
-		{
-			return Mask2DPtr(CreateSetMask<InitValue>(width, height));
-		}
-
-		static Mask2D *CreateCopy(const Mask2D &source);
-		static Mask2DPtr CreateCopy(Mask2DCPtr source)
-		{
-			return Mask2DPtr(CreateCopy(*source));
-		}
-
-		inline bool Value(size_t x, size_t y) const
-		{
-			return _values[y][x];
-		}
-		
-		inline void SetValue(size_t x, size_t y, bool newValue)
-		{
-			_values[y][x] = newValue;
-		}
-		
-		inline void SetHorizontalValues(size_t x, size_t y, bool newValue, size_t count)
-		{
-			memset(&_values[y][x], newValue, count * sizeof(bool));
-		}
-		
-		inline size_t Width() const { return _width; }
-		
-		inline size_t Height() const { return _height; }
-
-		bool AllFalse() const
-		{
-			for(size_t y=0;y<_height;++y)
-			{
-				for(size_t x=0;x<_width;++x)
-				{
-					if(_values[y][x])
-						return false;
-				}
-			}
-			return true;
-		}
-
-		/**
-		 * Returns a pointer to one row of data. This can be used to step
-		 * quickly over the data in x direction. Note that the next row
-		 * is not exactly at "one times width", because the number of
-		 * samples in a row is made divisable by four. This makes it
-		 * possible to execute SSE instruction easily.
-		 * 
-		 * If you want to skip over a whole row, use the Stride() method
-		 * to determine the intrinsicly used width of one row.
-		 * 
-		 * @see Stride()
-		 */
-		inline bool *ValuePtr(size_t x, size_t y)
-		{
-			return &_values[y][x];
-		}
-		
-		/**
-		 * Returns a constant pointer to one row of data. This can be used to
-		 * step quickly over the data in x direction. Note that the next row
-		 * is not exactly at "one times width", because the number of
-		 * samples in a row is made divisable by four. This makes it
-		 * possible to execute SSE instruction easily.
-		 * 
-		 * If you want to skip over a whole row, use the Stride() method
-		 * to determine the intrinsicly used width of one row.
-		 * 
-		 * @see Stride()
-		 */
-		inline const bool *ValuePtr(size_t x, size_t y) const
-		{
-			return &_values[y][x];
-		}
-		
-		/**
-		 * This value specifies the intrinsic width of one row. It is
-		 * normally the first number that is >= Width() and divisable by
-		 * four. When using the ValuePtr(unsigned, unsigned) method,
-		 * this value can be used to step over one row.
-		 * 
-		 * @see ValuePtr(unsigned, unsigned)
-		 */
-		inline size_t Stride() const
-		{
-			return _stride;
-		}
-		
-		template<bool NewValue>
-		void SetAll()
-		{
-			memset(_valuesConsecutive, NewValue, _stride  * _height * sizeof(bool));
-		}
-
-		template<bool NewValue>
-		void SetAllVertically(size_t x)
-		{
-			for(size_t y=0;y<_height;++y)
-				_values[y][x] = NewValue;
-		}
-
-		template<bool NewValue>
-		void SetAllVertically(size_t startX, size_t endX)
-		{
-			for(size_t x=startX;x<endX;++x)
-			{
-				for(size_t y=0;y<_height;++y)
-					_values[y][x] = NewValue;
-			}
-		}
-
-		template<bool NewValue>
-		void SetAllHorizontally(size_t y)
-		{
-			memset(_values[y], NewValue, _width * sizeof(bool));
-		}
-
-		template<bool BoolValue>
-		void SetAllHorizontally(size_t startY, size_t endY)
-		{
-			memset(_values[startY], BoolValue, _width * sizeof(bool) * (endY - startY));
-		}
-
-		void Invert()
-		{
-			for(size_t y=0;y<_height;++y)
-			{
-				for(size_t x=0;x<_width;++x)
-					_values[y][x] = !_values[y][x];
-			}
-		}
-		
-		/**
-		 * Flips the image round the diagonal, i.e., x becomes y and y becomes x.
-		 */
-		Mask2DPtr CreateXYFlipped() const
-		{
-			Mask2D *mask = new Mask2D(_height, _width);
-			for(size_t y=0;y<_height;++y)
-			{
-				for(size_t x=0;x<_width;++x)
-					mask->_values[x][y] = _values[y][x];
-			}
-			return Mask2DPtr(mask);
-		}
-
-		template<bool BoolValue>
-		size_t GetCount() const
-		{
-			size_t count = 0;
-			for(size_t y=0;y<_height;++y)
-			{
-				for(size_t x=0;x<_width;++x)
-					if(BoolValue == _values[y][x])
-						++count;
-			}
-			return count;
-		}
-		
-		bool Equals(Mask2DCPtr other) const
-		{
-			for(size_t y=0;y<_height;++y)
-			{
-				for(size_t x=0;x<_width;++x)
-					if(_values[y][x] != other->_values[y][x])
-						return false;
-			}
-			return true;
-		}
-
-		Mask2DPtr ShrinkHorizontally(int factor) const;
-		Mask2DPtr ShrinkHorizontallyForAveraging(int factor) const;
-		
-		Mask2DPtr ShrinkVertically(int factor) const;
-
-		void EnlargeHorizontallyAndSet(Mask2DCPtr smallMask, int factor);
-		void EnlargeVerticallyAndSet(Mask2DCPtr smallMask, int factor);
-
-		void Join(Mask2DCPtr other)
-		{
-			for(size_t y=0;y<_height;++y) {
-				for(size_t x=0;x<_width;++x)
-					SetValue(x, y, other->Value(x, y) || Value(x, y));
-			}
-		}
-		
-		void Intersect(Mask2DCPtr other)
-		{
-			for(size_t y=0;y<_height;++y) {
-				for(size_t x=0;x<_width;++x)
-					SetValue(x, y, other->Value(x, y) && Value(x, y));
-			}
-		}
-		
-		Mask2DPtr Trim(size_t startX, size_t startY, size_t endX, size_t endY) const
-		{
-			size_t
-				width = endX - startX,
-				height = endY - startY;
-			Mask2D *mask = new Mask2D(width, height);
-			for(size_t y=startY;y<endY;++y)
-			{
-				for(size_t x=startX;x<endX;++x)
-					mask->SetValue(x-startX, y-startY, Value(x, y));
-			}
-			return Mask2DPtr(mask);
-		}
-		
-		void CopyFrom(Mask2DCPtr source, size_t destX, size_t destY)
-		{
-			size_t
-				x2 = source->_width + destX,
-				y2 = source->_height + destY;
-			if(x2 > _width) x2 = _width;
-			if(y2 > _height) y2 = _height;
-			for(size_t y=destY;y<y2;++y)
-			{
-				for(size_t x=destX;x<x2;++x)
-					SetValue(x, y, source->Value(x-destX, y-destY));
-			}
-		}
-		
-		void SwapXY()
-		{
-			Mask2D *tempMask = new Mask2D(_height, _width);
-			for(size_t y=0;y<_height;++y)
-			{
-				for(size_t x=0;x<_width;++x)
-				{
-					tempMask->SetValue(y, x, Value(x, y));
-				}
-			}
-			Swap(*tempMask);
-			delete tempMask;
-		}
-	private:
-		Mask2D(size_t width, size_t height);
-
-		size_t _width, _height;
-		size_t _stride;
-		
-		bool **_values;
-		bool *_valuesConsecutive;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/msio/measurementset.h b/CEP/DP3/AOFlagger/include/AOFlagger/msio/measurementset.h
deleted file mode 100644
index 9fc23c043725fd02357c568f50e2122a37853987..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/msio/measurementset.h
+++ /dev/null
@@ -1,179 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef MEASUREMENTSET_H
-#define MEASUREMENTSET_H
-
-#include <string>
-#include <vector>
-#include <utility>
-#include <set>
-
-#include <ms/MeasurementSets/MSColumns.h>
-#include <tables/Tables/DataManager.h>
-
-#include <AOFlagger/strategy/control/types.h>
-
-#include <AOFlagger/msio/antennainfo.h>
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-
-class MSIterator {
-	public:
-		MSIterator(class MeasurementSet &ms, bool hasCorrectedData=true);
-		~MSIterator();
-		MSIterator &operator++() { _row++; return *this; }
-		size_t TotalRows() { return _table->nrow(); }
-
-		casa::Complex Data(unsigned frequencyIndex, unsigned polarisation)
-		{
-			return (*_dataCol)(_row)(casa::IPosition(2, frequencyIndex, polarisation));
-		}
-
-		bool Flag(unsigned frequencyIndex, unsigned polarisation) { return (*_flagCol)(_row)(casa::IPosition(2, frequencyIndex, polarisation)); }
-		casa::Array<bool>::const_iterator FlagIterator()
-		{
-			return (*_flagCol)(_row).begin();
-		}
-
-		casa::Complex CorrectedData(unsigned frequencyIndex, unsigned polarisation)
-		{
-			return (*_correctedDataCol)(_row)(casa::IPosition(2, frequencyIndex, polarisation));
-		}
-
-		casa::Array<casa::Complex>::const_iterator CorrectedDataIterator()
-		{
-			return (*_correctedDataCol)(_row).begin();
-		}
-
-		int Field() { return (*_fieldCol)(_row); }
-		double Time() { return (*_timeCol)(_row); }
-		unsigned Antenna1() { return (*_antenna1Col)(_row); }
-		unsigned Antenna2() { return (*_antenna2Col)(_row); }
-		unsigned ScanNumber() { return (*_scanNumberCol)(_row); }
-		class UVW UVW() {
-			class UVW uvw;
-			casa::Array<double> arr = (*_uvwCol)(_row);
-			casa::Array<double>::const_iterator i = arr.begin();
-			uvw.u = *i; ++i;
-			uvw.v = *i; ++i;
-			uvw.w = *i;
-			return uvw;
-		}
-		unsigned Window() { return (*_windowCol)(_row); }
-	private:
-		unsigned long _row;
-		casa::ROScalarColumn<int> *_antenna1Col;
-		casa::ROScalarColumn<int> *_antenna2Col;
-		casa::ROArrayColumn<casa::Complex> *_dataCol;
-		casa::ROArrayColumn<bool> *_flagCol;
-		casa::ROArrayColumn<casa::Complex> *_correctedDataCol;
-		casa::ROScalarColumn<double> *_timeCol;
-		casa::ROScalarColumn<int> *_fieldCol;
-		casa::ROScalarColumn<int> *_scanNumberCol;
-		casa::ROArrayColumn<double> *_uvwCol;
-		casa::ROScalarColumn<int> *_windowCol;
-		casa::Table *_table;
-};
-
-class MeasurementSet {
-	public:
-		MeasurementSet(const std::string &location) throw()
-			: _location(location), _maxSpectralBandIndex(-1),
-			_maxFrequencyIndex(-1), _maxScanIndex(-1), _cacheInitialized(false)
-		{
-		}
-		MeasurementSet(const std::string &newLocation, const MeasurementSet &formatExample);
-		~MeasurementSet();
-		casa::Table *OpenTable(bool update = false) const;
-		size_t MaxSpectralBandIndex();
-		size_t FrequencyCount();
-		size_t TimestepCount()
-		{
-			if(_maxScanIndex==-1)
-				CalculateScanCounts();
-			return _maxScanIndex;
-		}
-		size_t MaxScanIndex()
-		{
-			if(_maxScanIndex==-1)
-				CalculateScanCounts();
-			return _maxScanIndex;
-		}
-		size_t MinScanIndex()
-		{
-			if(_maxScanIndex==-1)
-				CalculateScanCounts();
-			return _minScanIndex;
-		}
-		size_t GetPolarizationCount();
-		static size_t GetPolarizationCount(const std::string &filename);
-		static class BandInfo GetBandInfo(const std::string &filename, unsigned bandIndex);
-		size_t AntennaCount();
-		size_t FieldCount();
-		size_t BandCount() { return BandCount(_location); }
-		static size_t BandCount(const std::string &filename);
-		class AntennaInfo GetAntennaInfo(unsigned antennaId);
-		class BandInfo GetBandInfo(unsigned bandIndex) {return GetBandInfo(_location, bandIndex);}
-		class FieldInfo GetFieldInfo(unsigned fieldIndex);
-		void DataMerge(const MeasurementSet &source);
-		std::string Location() const throw() { return _location; }
-		void GetBaselines(std::vector<std::pair<size_t,size_t> > &baselines)
-		{
-			if(!_cacheInitialized)
-				InitCacheData();
-			baselines = _baselines;
-		}
-		const std::set<double> &GetObservationTimesSet()
-		{
-			if(!_cacheInitialized)
-				InitCacheData();
-			return _observationTimes;
-		}
-		std::vector<double> *CreateObservationTimesVector()
-		{
-			if(!_cacheInitialized)
-				InitCacheData();
-			std::vector<double> *times = new std::vector<double>();
-			for(std::set<double>::const_iterator i=_observationTimes.begin();i!=_observationTimes.end();++i)
-				times->push_back(*i);
-			return times;
-		}
-		bool HasRFIConsoleHistory();
-		void GetAOFlaggerHistory(std::ostream &stream);
-		void AddAOFlaggerHistory(const class rfiStrategy::Strategy &strategy, const std::string &commandline);
-		std::string GetStationName() const;
-		bool ChannelZeroIsRubish();
-	private:
-		void InitCacheData();
-		void CalculateScanCounts();
-
-		const std::string _location;
-		int _maxSpectralBandIndex;
-		int _maxFrequencyIndex;
-		int _maxScanIndex, _minScanIndex;
-
-		bool _cacheInitialized;
-		std::vector<std::pair<size_t,size_t> > _baselines;
-		std::set<double> _observationTimes;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/msio/memorybaselinereader.h b/CEP/DP3/AOFlagger/include/AOFlagger/msio/memorybaselinereader.h
deleted file mode 100644
index 2a536e3212f60096d72fb03dfaaf9eed31fed686..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/msio/memorybaselinereader.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef MEMORY_BASELINE_READER_H
-#define MEMORY_BASELINE_READER_H
-
-#include <map>
-#include <vector>
-#include <stdexcept>
-
-#include <AOFlagger/msio/antennainfo.h>
-#include <AOFlagger/msio/baselinereader.h>
-#include <AOFlagger/msio/image2d.h>
-#include <AOFlagger/msio/mask2d.h>
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class MemoryBaselineReader : public BaselineReader {
-	public:
-		explicit MemoryBaselineReader(const std::string &msFile)
-			: BaselineReader(msFile), _isRead(false), _areFlagsChanged(false)
-		{
-		}
-		
-		~MemoryBaselineReader()
-		{
-			if(_areFlagsChanged) writeFlags();
-		}
-
-		virtual void PerformReadRequests();
-		
-		virtual void PerformFlagWriteRequests();
-		
-		virtual void PerformDataWriteTask(std::vector<Image2DCPtr> /*_realImages*/, std::vector<Image2DCPtr> /*_imaginaryImages*/, int /*antenna1*/, int /*antenna2*/, int /*spectralWindow*/)
-		{
-			throw std::runtime_error("The full mem reader can not write data back to file: use the indirect reader");
-		}
-		
-		static bool IsEnoughMemoryAvailable(const std::string &msFile);
-		
-		virtual size_t GetMinRecommendedBufferSize(size_t /*threadCount*/) { return 1; }
-		virtual size_t GetMaxRecommendedBufferSize(size_t /*threadCount*/) { return 2; }
-	private:
-		void readSet();
-		void writeFlags();
-		
-		bool _isRead, _areFlagsChanged;
-		
-		class BaselineID
-		{
-		public:
-			unsigned antenna1, antenna2, spw;
-			
-			bool operator<(const BaselineID &other) const
-			{
-				if(antenna1<other.antenna1) return true;
-				else if(antenna1==other.antenna1)
-				{
-					if(antenna2<other.antenna2) return true;
-					else if(antenna2==other.antenna2) return spw < other.spw;
-				}
-				return false;
-			}
-		};
-		
-		std::map<BaselineID, BaselineReader::Result> _baselines;
-};
-
-#endif // DIRECTBASELINEREADER_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/msio/msrowdata.h b/CEP/DP3/AOFlagger/include/AOFlagger/msio/msrowdata.h
deleted file mode 100644
index 728d98805815a17c36bfc1cd86c5df318fe5d4bb..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/msio/msrowdata.h
+++ /dev/null
@@ -1,129 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2011 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#ifndef MS_ROW_DATA_H
-#define MS_ROW_DATA_H
-
-#include <string.h>
-
-#include <ms/MeasurementSets/MSColumns.h>
-
-#include "types.h"
-
-#include <AOFlagger/util/serializable.h>
-
-/**
- * Encapsulates the information that is contained in the Data column in one row
- * of a measurement set.
- * If some of the meta data needs to be stored as well, use the MSRowDataExt class.
- * @see MSRowDataExt
- */
-class MSRowData : public Serializable
-{
-	public:
-		MSRowData()
-		: _polarizationCount(0), _channelCount(0), _realData(0), _imagData(0)
-		{
-		}
-		
-		MSRowData(unsigned polarizationCount, unsigned channelCount)
-		: _polarizationCount(polarizationCount), _channelCount(channelCount)
-		{
-			size_t size = polarizationCount * channelCount;
-			_realData = new num_t[size*2];
-			_imagData = &_realData[size];
-		}
-		
-		/**
-		 * Copy construct.
-		 */
-		MSRowData(const MSRowData &source) :
-			_polarizationCount(source._polarizationCount),
-			_channelCount(source._channelCount)
-		{
-			size_t size = _polarizationCount * _channelCount;
-			_realData = new num_t[size*2];
-			_imagData = &_realData[size];
-			memcpy(_realData, source._realData, size*2*sizeof(num_t));
-		}
-		
-		~MSRowData()
-		{
-			delete[] _realData;
-		}
-		
-		/**
-		 * Assignment.
-		 */
-		MSRowData &operator=(const MSRowData &source)
-		{
-			size_t size = source._polarizationCount * source._channelCount;
-			if(size != _polarizationCount * _channelCount)
-			{
-				delete[] _realData;
-				_realData = new num_t[size*2];
-				_imagData = &_realData[size];
-			}
-			_polarizationCount = source._polarizationCount;
-			_channelCount = source._channelCount;
-			memcpy(_realData, source._realData, size*2*sizeof(num_t));
-			return *this;
-		}
-		
-		virtual void Serialize(std::ostream &stream) const
-		{
-			SerializeToUInt32(stream, _polarizationCount);
-			SerializeToUInt32(stream, _channelCount);
-			size_t count = _polarizationCount * _channelCount * 2;
-			for(size_t i=0 ; i<count ; ++i)
-				SerializeToFloat(stream, _realData[i]);
-		}
-		
-		virtual void Unserialize(std::istream &stream)
-		{
-			const size_t oldSize = _polarizationCount * _channelCount;
-			_polarizationCount = UnserializeUInt32(stream);
-			_channelCount = UnserializeUInt32(stream);
-			const size_t size = _polarizationCount * _channelCount;
-			if(oldSize != size)
-			{
-					delete[] _realData;
-					_realData = new num_t[size*2];
-					_imagData = &_realData[size];
-			}
-			for(size_t i=0 ; i<size * 2; ++i)
-				_realData[i] = UnserializeFloat(stream);
-		}
-		unsigned PolarizationCount() const { return _polarizationCount; }
-		unsigned ChannelCount() const { return _channelCount; }
-		const num_t *RealPtr() const { return _realData; }
-		const num_t *ImagPtr() const { return _imagData; }
-		num_t *RealPtr() { return _realData; }
-		num_t *ImagPtr() { return _imagData; }
-		const num_t *RealPtr(size_t channel) const { return &_realData[_polarizationCount * channel]; }
-		const num_t *ImagPtr(size_t channel) const { return &_imagData[_polarizationCount * channel]; }
-		num_t *RealPtr(size_t channel) { return &_realData[_polarizationCount * channel]; }
-		num_t *ImagPtr(size_t channel) { return &_imagData[_polarizationCount * channel]; }
-	private:
-		unsigned _polarizationCount, _channelCount;
-		num_t *_realData, *_imagData;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/msio/msrowdataext.h b/CEP/DP3/AOFlagger/include/AOFlagger/msio/msrowdataext.h
deleted file mode 100644
index 01715cd7cb4355cdfeca56106aa5bbd2a72f8906..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/msio/msrowdataext.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2011 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#ifndef MS_ROW_DATAEXT_H
-#define MS_ROW_DATAEXT_H
-
-#include "msrowdata.h"
-
-#include <AOFlagger/util/serializable.h>
-
-class MSRowDataExt : public Serializable
-{
-	public:
-		MSRowDataExt()
-		: _data()
-		{
-		}
-		
-		MSRowDataExt(unsigned polarizationCount, unsigned channelCount)
-		: _data(polarizationCount, channelCount)
-		{
-		}
-		
-		MSRowDataExt(const MSRowDataExt &source) :
-		_data(source._data),
-		_antenna1(source._antenna1),
-		_antenna2(source._antenna2),
-		_timeOffsetIndex(source._timeOffsetIndex),
-		_u(source._u),
-		_v(source._v),
-		_w(source._w),
-		_time(source._time)
-		{
-		}
-		
-		MSRowDataExt &operator=(const MSRowDataExt &source)
-		{
-			_data = source._data;
-			_antenna1 = source._antenna1;
-			_antenna2 = source._antenna2;
-			_timeOffsetIndex = source._timeOffsetIndex;
-			_u = source._u;
-			_v = source._v;
-			_w = source._w;
-			_time = source._time;
-			return *this;
-		}
-		
-		const MSRowData &Data() const { return _data; }
-		MSRowData &Data() { return _data; }
-		unsigned Antenna1() const { return _antenna1; }
-		unsigned Antenna2() const { return _antenna2; }
-		double U() const { return _u; }
-		double V() const { return _v; }
-		double W() const { return _w; }
-		double Time() const { return _time; }
-		size_t TimeOffsetIndex() const { return _timeOffsetIndex; }
-		
-		void SetU(double u) { _u = u; }
-		void SetV(double v) { _v = v; }
-		void SetW(double w) { _w = w; }
-		void SetAntenna1(double antenna1) { _antenna1 = antenna1; }
-		void SetAntenna2(double antenna2) { _antenna2 = antenna2; }
-		void SetTime(double time) { _time = time; }
-		void SetTimeOffsetIndex(size_t timeOffsetIndex) { _timeOffsetIndex = timeOffsetIndex; }
-		
-		virtual void Serialize(std::ostream &stream) const
-		{
-			_data.Serialize(stream);
-			SerializeToUInt32(stream, _antenna1);
-			SerializeToUInt32(stream, _antenna2);
-			SerializeToUInt64(stream, _timeOffsetIndex);
-			SerializeToDouble(stream, _u);
-			SerializeToDouble(stream, _v);
-			SerializeToDouble(stream, _w);
-			SerializeToDouble(stream, _time);
-		}
-		
-		virtual void Unserialize(std::istream &stream)
-		{
-			_data.Unserialize(stream);
-			_antenna1 = UnserializeUInt32(stream);
-			_antenna2 = UnserializeUInt32(stream);
-			_timeOffsetIndex = UnserializeUInt64(stream);
-			_u = UnserializeDouble(stream);
-			_v = UnserializeDouble(stream);
-			_w = UnserializeDouble(stream);
-			_time = UnserializeDouble(stream);
-		}
-	private:
-		MSRowData _data;
-		unsigned _antenna1, _antenna2;
-		size_t _timeOffsetIndex;
-		double _u, _v, _w;
-		double _time;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/msio/parmtable.h b/CEP/DP3/AOFlagger/include/AOFlagger/msio/parmtable.h
deleted file mode 100644
index 88c33fc2e83e0d668aeb092151fb41f9d5cef4b2..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/msio/parmtable.h
+++ /dev/null
@@ -1,272 +0,0 @@
-#ifndef PARM_TABLE_H
-#define PARM_TABLE_H
-
-#include <map>
-#include <set>
-#include <stdexcept>
-
-#include <ms/MeasurementSets/MSTable.h>
-
-#include <tables/Tables/ArrayColumn.h>
-#include <tables/Tables/ScalarColumn.h>
-
-#include <AOFlagger/util/aologger.h>
-
-#include <AOFlagger/msio/image2d.h>
-#include <AOFlagger/msio/timefrequencydata.h>
-
-class ParmTable
-{
-	public:
-		struct GainNameEntry
-		{
-			int index;
-			int x, y;
-			enum Component { Real, Imaginary } component;
-			std::string antenna;
-			
-			GainNameEntry() :
-				index(0), x(0), y(0), component(Real), antenna()
-				{
-				}
-			GainNameEntry(const GainNameEntry &source) :
-				index(source.index), x(source.x), y(source.y), component(source.component), antenna(source.antenna)
-				{
-				}
-			void operator=(const GainNameEntry &source)
-			{
-				index = source.index;
-				x = source.x;
-				y = source.y;
-				component = source.component;
-				antenna = source.antenna;
-			}
-		};
-		
-		ParmTable(const std::string &path)
-			: _path(path)
-		{
-			readNames();
-		}
-		
-		std::set<std::string> GetAntennas() const
-		{
-			std::set<std::string> antennas;
-			for(GainNameEntryMap::const_iterator i=_nameEntries.begin();i!=_nameEntries.end();++i)
-			{
-				const GainNameEntry &entry = i->second;
-				antennas.insert(entry.antenna);
-			}
-			return antennas;
-		}
-		
-		TimeFrequencyData Read(const std::string &antenna)
-		{
-			AOLogger::Debug << "Reading antenna " << antenna << "\n";
-			
-			// find the nameid's that we need to select
-			const int
-				r00 = FindEntry(0, 0, GainNameEntry::Real, antenna).index,
-				r11 = FindEntry(1, 1, GainNameEntry::Real, antenna).index,
-				i00 = FindEntry(0, 0, GainNameEntry::Imaginary, antenna).index,
-				i11 = FindEntry(1, 1, GainNameEntry::Imaginary, antenna).index;
-			AOLogger::Debug
-				<< "Names: r00=" << r00 << ", "
-				<< "r11=" << r11 << ", "
-				<< "i00=" << i00 << ", "
-				<< "i11=" << i11 << "\n";
-				
-			casa::Table table(_path);
-			
-			// Construct the images
-			unsigned width, height;
-			getImageDimensions(table, width, height, r00, r11, i00, i11);
-			Image2DPtr
-				xxReal = Image2D::CreateZeroImagePtr(width, height),
-				yyReal = Image2D::CreateZeroImagePtr(width, height),
-				xxImag = Image2D::CreateZeroImagePtr(width, height),
-				yyImag = Image2D::CreateZeroImagePtr(width, height);
-				
-			// Read data
-			casa::ROScalarColumn<unsigned int> nameIdColumn(table, "NAMEID");
-			casa::ROScalarColumn<double>
-				startX(table, "STARTX"),
-				startY(table, "STARTY");
-			casa::ROArrayColumn<double> values(table, "VALUES");
-				
-			int xPos=0, yPos=0;
-			//double currentX=startX(0);
-			double currentY=startY(0);
-			unsigned r00Count=0, r11Count=0, i00Count=0, i11Count=0;
-			unsigned curXShape=0;
-			unsigned componentMatches = 0;
-			for(unsigned row=0;row < table.nrow();++row)
-			{
-				int nameId = nameIdColumn(row);
-				if(nameId == r00 || nameId == r11 || nameId == i00 || nameId == i11)
-				{
-					Image2DPtr destImage;
-					if(nameId == r00) {
-						destImage = xxReal;
-						++r00Count;
-					} else if(nameId==r11) {
-						destImage = yyReal;
-						++r11Count;
-					} else if(nameId==i00) {
-						destImage = xxImag;
-						++i00Count;
-					} else if(nameId==i11) {
-						destImage = yyImag;
-						++i11Count;
-					}
-					
-					const unsigned curYShape = values.shape(row)[1];
-					const unsigned xShape = values.shape(row)[0];
-					if(xShape > curXShape)
-						curXShape = xShape;
-					
-					const casa::Array<double> valueArray = values(row);
-					casa::Array<double>::const_iterator vIter = valueArray.begin();
-					for(unsigned x=0;x<xShape;++x) {
-						for(unsigned y=0;y<curYShape;++y) {
-							destImage->SetValue(yPos + y, xPos + x, *vIter);
-							++vIter;
-						}
-					}
-					
-					++componentMatches;
-					if(componentMatches >= 4)
-					{
-						if(startY(row) < currentY)
-						{
-							xPos += curXShape;
-							yPos = 0;
-							curXShape = 0;
-						} else {
-							yPos += curYShape;
-						}
-						//currentX=startX(row);
-						currentY=startY(row);
-						componentMatches = 0;
-					}
-				}
-			}
-			AOLogger::Debug
-				<< "Counts: r00=" << r00Count << ", "
-				<< "r11=" << r11Count << ", "
-				<< "i00=" << i00Count << ", "
-				<< "i11=" << i11Count << "\n";
-			return TimeFrequencyData(AutoDipolePolarisation, xxReal, xxImag, yyReal, yyImag);
-		}
-		
-		const GainNameEntry &FindEntry(int x, int y, enum GainNameEntry::Component c, const std::string &antenna) const
-		{
-			for(GainNameEntryMap::const_iterator i=_nameEntries.begin();i!=_nameEntries.end();++i)
-			{
-				const GainNameEntry &entry = i->second;
-				if(entry.x == x && entry.y == y && entry.component == c && entry.antenna == antenna)
-				{
-					return entry;
-				}
-			}
-			throw std::runtime_error("Entry not found");
-		}
-
-	private:
-		void readNames()
-		{
-			casa::Table namesTable;
-			if(_path.size()>0 && *_path.rbegin()!='/')
-				namesTable = casa::Table(_path + "/NAMES");
-			else
-				namesTable = casa::Table(_path + "NAMES");
-			
-			casa::ROScalarColumn<casa::String> nameColumn(namesTable, "NAME");
-			for(unsigned i=0;i!=namesTable.nrow();++i)
-			{
-				std::string name = nameColumn(i);
-				addName(i, name);
-			}
-		}
-		
-		void getImageDimensions(casa::Table &table, unsigned &width, unsigned &height, int r00, int /*r11*/, int /*i00*/, int /*i11*/)
-		{
-			casa::ROScalarColumn<unsigned int> nameIdColumn(table, "NAMEID");
-			casa::ROScalarColumn<double>
-				startX(table, "STARTX"),
-				startY(table, "STARTY");
-			casa::ROArrayColumn<double> values(table, "VALUES");
-			
-			int maxX=0,yPos=0;
-			int maxY=0;
-			unsigned matches = 0;
-			unsigned curXShape=0;
-			double currentX=startX(0), currentY=startY(0);
-			for(unsigned row=0;row < table.nrow();++row)
-			{
-				int nameId = nameIdColumn(row);
-				if(nameId == r00)
-				{
-					const unsigned curYShape = values.shape(row)[1];
-					if(values.shape(row)[0] > curXShape)
-						curXShape = values.shape(row)[0];
-					if(startX(row) < currentX)
-						throw std::runtime_error("Table is not correctly ordered");
-					yPos += curYShape;
-					if(startY(row) < currentY)
-					{
-						maxX += curXShape;
-						curXShape = 0;
-						if(yPos > maxY) maxY = yPos;
-						yPos = 0;
-					}
-					
-					currentX=startX(row);
-					currentY=startY(row);
-					++matches;
-				}
-			}
-			maxX += curXShape;
-			if(yPos > maxY) maxY = yPos;
-			
-			width = maxY;
-			height = maxX;
-			AOLogger::Debug << "Rows in table: " << table.nrow() << "\n"
-				"Matching rows: " << matches << "\n"
-				"Number of blocks: " << maxX << " x " << maxY << "\n"
-				"Image size: " << width << " x " << height << "\n";
-		}
-		
-		void addName(unsigned index, const std::string &line)
-		{
-			size_t
-				d1 = line.find(':');
-			std::string type = line.substr(0, d1);
-			if(type == "Gain")
-			{
-				GainNameEntry entry;
-				size_t
-					d2 = line.find(':', d1+1),
-					d3 = line.find(':', d2+1),
-					d4 = line.find(':', d3+1);
-				entry.index = index;
-				entry.x = atoi(line.substr(d1+1, d2-d1-1).c_str());
-				entry.y = atoi(line.substr(d2+1, d3-d2-1).c_str());
-				std::string component = line.substr(d3+1, d4-d3-1);
-				if(component == "Real")
-					entry.component = GainNameEntry::Real;
-				else if(component == "Imag")
-					entry.component = GainNameEntry::Imaginary;
-				else
-					throw std::runtime_error("Incorrect complex component type given");
-				entry.antenna = line.substr(d4+1);
-				_nameEntries.insert(std::pair<unsigned, GainNameEntry>(index, entry));
-			}
-		}
-		
-		std::string _path;
-		typedef std::map<unsigned, GainNameEntry> GainNameEntryMap;
-		GainNameEntryMap _nameEntries;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/msio/pngfile.h b/CEP/DP3/AOFlagger/include/AOFlagger/msio/pngfile.h
deleted file mode 100644
index 050a266c0a6234a26b041ba0f5d99319465ab475..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/msio/pngfile.h
+++ /dev/null
@@ -1,162 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2007 by Andre Offringa   *
- *   offringa@gmail.com   *
- *                                                                         *
- *   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.             *
- ***************************************************************************/
-/** @file
- * This is the header file for the PngFile class.
- * @author André Offringa <offringa@gmail.com>
- */
-#ifndef PNGFILE_H
-#define PNGFILE_H
-
-#include <string>
-
-#include <png.h>
-
-#include "../baseexception.h"
-
-/**
- * This class wraps the libpng library. It can save an Image2D class to a .png file.
- * @see Image2D
- */
-class PngFile {
-	public:
-		/**
-		 * Construct a new png file with a filename, a width and a height.
-		 * @param filename Name of the png file.
-		 * @param width Width of the image
-		 * @param height Height of the image
-		 */
-		PngFile(const std::string &filename, unsigned width, unsigned height);
-		
-		/**
-		 * Destructor.
-		 */
-		~PngFile();
-		
-		/**
-		 * Start writing.
-		 * @throws IOException if something goes wrong.
-		 */
-		void BeginWrite() throw(IOException);
-		
-		/**
-		 * Closes the image.
-		 */
-		void Close();
-		
-		/**
-		 * Returns the size of one pixel in bytes.
-		 * @return Size of one pixel in bytes.
-		 */
-		int PixelSize() const throw() { return _pixelSize; }
-		
-		/**
-		 * Clears the entire image.
-		 * @param colorR Red background value.
-		 * @param colorG Green background value.
-		 * @param colorB Blue background value.
-		 * @param colorA Alfa background value.
-		 */
-		void Clear(int colorR=255, int colorG=255, int colorB=255, int colorA=255) throw();
-
-		/**
-		 * Sets a pixel in the image to a specific color.
-		 * @param x x-coordinate.
-		 * @param y y-coordinate.
-		 * @param colorR Red value.
-		 * @param colorG Green value.
-		 * @param colorB Blue value.
-		 * @param colorA Alfa value.
-		 */
-		void PlotPixel(unsigned x, unsigned y, int colorR, int colorG, int colorB, int colorA) throw()
-		{
-			_row_pointers[y][x*_pixelSize] = colorR;
-			_row_pointers[y][x*_pixelSize+1] = colorG;
-			_row_pointers[y][x*_pixelSize+2] = colorB;
-			_row_pointers[y][x*_pixelSize+3] = colorA;
-		}
-
-		/**
-		 * Sets a square in the image to a specific color.
-		 * @param x x-coordinate.
-		 * @param y y-coordinate.
-		 * @param colorR Red value.
-		 * @param colorG Green value.
-		 * @param colorB Blue value.
-		 * @param colorA Alfa value.
-		 */
-		void PlotDatapoint(unsigned x, unsigned y, int colorR, int colorG, int colorB, int colorA) throw();
-		
-		/**
-		 * Retrieve the array of row pointers.
-		 * @return an array of row pointers.
-		 */
-		png_bytep *RowPointers() const throw() { return _row_pointers; }
-		
-		/**
-		 * Sets all pixels in the rowpointers to match the image.
-     */
-		void SetFromImage(const class Image2D &image, const class ColorMap &colorMap, long double normalizeFactor, long double zeroLevel = 0.0) throw(IOException);
-
-		/**
-		 * Write an image directly to disk. The image will be normalized.
-		 * @param image Image containing the data.
-		 * @param filename Name of the file to write.
-		 * @throws IOException if writing fails.
-		 */
-		static void Save(const class Image2D &image, const std::string &filename) throw(IOException);
-		
-		/**
-		 * Write an image directly to disk by using a specific colormap. The image will be normalized.
-		 * @param image Image containing the data.
-		 * @param filename Name of the file to write.
-		 * @param colorMap ColorMap to use.
-		 * @throws IOException if writing fails.
-		 */
-		static void Save(const class Image2D &image, const std::string &filename, const class ColorMap &colorMap) throw(IOException);
-		
-		/**
-		 * Write an image directly to disk by using a specific colormap. The image will be normalized with a specified
-		 * factor.
-		 * @param image Image containing the data.
-		 * @param filename Name of the file to write.
-		 * @param colorMap ColorMap to use.
-		 * @param normalizeFactor Factor to use for normalisation.
-		 * @throws IOException if writing fails.
-		 */
-		static void Save(const class Image2D &image, const std::string &filename, const class ColorMap &colorMap, long double normalizeFactor, long double zeroLevel = 0.0) throw(IOException);
-		
-		/**
-		 * Fill this instance with the values of the image by using the color map, and save it to disk.
-		 * @param image Image to use.
-		 * @param colorMap Color map to use.
-		 * @throws IOException if writing fails.
-		 */
-		void Save(const class Image2D &image, const class ColorMap &colorMap) throw(IOException);
-	private:
-		const std::string _filename;
-		const unsigned _width, _height;
-		png_bytep *_row_pointers;
-		png_structp _png_ptr;
-		png_infop _info_ptr;
-		FILE *_fp;
-		const int _pixelSize;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/msio/rawdescfile.h b/CEP/DP3/AOFlagger/include/AOFlagger/msio/rawdescfile.h
deleted file mode 100644
index fe1db726e2c09e8f29e5543a48ac4254a1312aca..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/msio/rawdescfile.h
+++ /dev/null
@@ -1,124 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef RAWDESCFILE_H
-#define RAWDESCFILE_H
-
-#include <fstream>
-#include <string>
-#include <vector>
-
-#include <AOFlagger/util/aologger.h>
-
-class RawDescFile
-{
-	public:
-		explicit RawDescFile(const std::string &filename) :
-		_filename(filename)
-		{
-			readFile();
-		}
-		
-		size_t GetCount() const { return _sets.size(); }
-		
-		std::string GetSet(size_t index) const { return _sets[index]; }
-		
-		const std::string &Filename() const { return _filename; }
-		
-		unsigned BeamCount() const { return _beamCount; }
-		
-		unsigned SubbandCount() const { return _subbandCount; }
-		
-		unsigned ChannelsPerSubbandCount() const { return _channelsPerSubbandCount; }
-		
-		unsigned TimestepsPerBlockCount() const { return _timestepsPerBlockCount; }
-		
-		unsigned BlockHeaderSize() const { return _blockHeaderSize; }
-		
-		unsigned BlockFooterSize() const { return _blockFooterSize; }
-		
-		unsigned SelectedBeam() const { return _selectedBeam; }
-		
-		const double TimeResolution() const { return _timeRes; }
-
-		double DisplayedTimeDuration() const { return _displayedTimeDuration; }
-		
-		const double FrequencyResolution() const { return _freqRes; }
-
-		const double FrequencyStart() const { return _freqStart; }
-	private:
-		const std::string _filename;
-		std::vector<std::string> _sets;
-		
-		unsigned _beamCount;
-		unsigned _subbandCount;
-		unsigned _channelsPerSubbandCount;
-		unsigned _timestepsPerBlockCount;
-		
-		unsigned _blockHeaderSize;
-		unsigned _blockFooterSize;
-		
-		unsigned _selectedBeam;
-		
-		double _timeRes;
-		double _displayedTimeDuration;
-		
-		double _freqRes;
-		double _freqStart;
-		
-		void readFile()
-		{
-			std::ifstream file(_filename.c_str());
-			std::string l;
-			
-			std::getline(file, l);
-			_beamCount = (unsigned) atol(l.c_str());
-			std::getline(file, l);
-			_subbandCount = (unsigned) atol(l.c_str());
-			std::getline(file, l);
-			_channelsPerSubbandCount = (unsigned) atol(l.c_str());
-			std::getline(file, l);
-			_timestepsPerBlockCount = (unsigned) atol(l.c_str());
-			
-			std::getline(file, l);
-			_blockHeaderSize = (unsigned) atol(l.c_str());
-			std::getline(file, l);
-			_blockFooterSize = (unsigned) atol(l.c_str());
-			
-			std::getline(file, l);
-			_selectedBeam = (unsigned) atol(l.c_str());
-			
-			std::getline(file, l);
-			_timeRes = atof(l.c_str());
-			std::getline(file, l);
-			_displayedTimeDuration = atof(l.c_str());
-			std::getline(file, l);
-			_freqStart = atof(l.c_str());
-			std::getline(file, l);
-			_freqRes = atof(l.c_str());
-			while(file.good())
-			{
-				std::getline(file, l);
-				if(l != "")
-					_sets.push_back(l);
-			}
-		}
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/msio/rawreader.h b/CEP/DP3/AOFlagger/include/AOFlagger/msio/rawreader.h
deleted file mode 100644
index 2b35283b0ea03b57c7c29d8b3b134e2056218652..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/msio/rawreader.h
+++ /dev/null
@@ -1,309 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef RAWREADER_H
-#define RAWREADER_H
-
-#include <cstring>
-#include <fstream>
-#include <string>
-
-#include <AOFlagger/util/aologger.h>
-
-class RawReader
-{
-	public:
-		explicit RawReader(const std::string &filename) :
-		_blockHeaderSize(512),
-		_blockFooterSize(8),
-		_beamCount(1),
-		_subbandCount(1),
-		_channelsPerSubbandCount(1),
-		_timestepsPerBlockCount(12208),
-		_filename(filename),
-		_useNetworkOrder(true),
-		_outputStream(0),
-		_timeStepsInWriteBlock(0),
-		_block(*this)
-		{
-			AOLogger::Debug << "RawReader for " << filename << " constructed.\n";
-		}
-		
-		~RawReader()
-		{
-			if(_outputStream != 0)
-				FinishWrite();
-		}
-		
-		size_t TimestepCount()
-		{
-			std::ifstream stream(_filename.c_str());
-			stream.seekg(0, std::ios_base::end);
-			std::streampos fileSize = stream.tellg();
-			unsigned long blockSize = BlockSize();
-			return (fileSize / blockSize) * _timestepsPerBlockCount;
-		}
-		
-		void Read(size_t startIndex, size_t endIndex, float *dest)
-		{
-			AOLogger::Debug << "Reading " << startIndex << " to " << endIndex << " (total: " << TimestepCount() << ") with " << _beamCount << " beams. \n";
-			
-			std::ifstream stream(_filename.c_str());
-			
-			size_t startBlock = startIndex / _timestepsPerBlockCount;
-			stream.seekg(startBlock * BlockSize(), std::ios_base::beg);
-			
-			const size_t rowsPerTimestep =  _beamCount * _subbandCount * _channelsPerSubbandCount;
-			const size_t bytesPerTimestep = sizeof(float) * rowsPerTimestep;
-			
-			RawBlock block(*this);
-			block.read(stream);
-			
-			size_t startTimestepInFirstBlock = startIndex - startBlock * _timestepsPerBlockCount;
-			
-			size_t totalTimestepsInFirstBlock = (_timestepsPerBlockCount - startTimestepInFirstBlock);
-			if(totalTimestepsInFirstBlock > endIndex - startIndex)
-				totalTimestepsInFirstBlock = endIndex - startIndex;
-			
-			memcpy(dest, block.SamplePtr(startTimestepInFirstBlock), bytesPerTimestep * totalTimestepsInFirstBlock);
-			
-			size_t samplesCopied = rowsPerTimestep * totalTimestepsInFirstBlock;
-			
-			size_t currentIndex = (startBlock + 1) * _timestepsPerBlockCount;
-			while(currentIndex < endIndex)
-			{
-				AOLogger::Debug << currentIndex << ", stream=" << stream.tellg() << "\n";
-				block.read(stream);
-				if(currentIndex + _timestepsPerBlockCount > endIndex)
-				{
-					// Whole block won't fit
-					memcpy(&dest[samplesCopied], block.SamplePtr(), bytesPerTimestep * (endIndex - currentIndex));
-					samplesCopied += rowsPerTimestep * (endIndex - currentIndex);
-					currentIndex += (endIndex - currentIndex);
-				}
-				else {
-					// Block fits
-					memcpy(&dest[samplesCopied], block.SamplePtr(), bytesPerTimestep * _timestepsPerBlockCount);
-					samplesCopied += rowsPerTimestep * _timestepsPerBlockCount;
-					currentIndex += _timestepsPerBlockCount;
-				}
-			}
-			AOLogger::Debug << "Done reading.\n";
-		}
-		
-		void StartWrite()
-		{
-			_outputStream = new std::ofstream(_filename.c_str());
-			_block = RawBlock(*this);
-		}
-		
-		void FinishWrite()
-		{
-			if(_timeStepsInWriteBlock != 0)
-			{
-				for(size_t i=_timeStepsInWriteBlock;i<_timestepsPerBlockCount;++i)
-				{
-					float *currentSamplePtr = _block.SamplePtr(i);
-					for(size_t j=0;j<_beamCount * _subbandCount * _channelsPerSubbandCount;++j)
-					{
-						currentSamplePtr[j] = 0.0;
-					}
-				}
-				_block.write(*_outputStream);
-			}
-			delete _outputStream;
-			_outputStream = 0;
-		}
-		
-		void Write(float *data, size_t timestepCount)
-		{
-			float *currentSamplePtr = _block.SamplePtr(_timeStepsInWriteBlock);
-			size_t writeCount;
-			
-			// Fill the current block
-			size_t writeTimesteps = _timestepsPerBlockCount - _timeStepsInWriteBlock;
-			if(writeTimesteps > timestepCount)
-				writeTimesteps = timestepCount;
-			writeCount = _beamCount * _subbandCount * _channelsPerSubbandCount * writeTimesteps;
-			memcpy(currentSamplePtr, data, sizeof(float) * writeCount);
-			timestepCount -= writeTimesteps;
-			data += writeTimesteps;
-			_timeStepsInWriteBlock += writeTimesteps;
-			
-			// Has the block been filled?
-			if(_timeStepsInWriteBlock == _timestepsPerBlockCount)
-			{
-				_block.write(*_outputStream);
-				_timeStepsInWriteBlock = 0;
-				
-				// Write whole blocks until no whole block of data is available
-				writeCount = _beamCount * _subbandCount * _channelsPerSubbandCount * _timestepsPerBlockCount;
-				while(timestepCount >= _timestepsPerBlockCount)
-				{
-					memcpy(_block.SamplePtr(), data, sizeof(float) * writeCount);
-					_block.write(*_outputStream);
-					timestepCount -= _timestepsPerBlockCount;
-					data += _timestepsPerBlockCount;
-				}
-				
-				// Fill the last block as far as available
-				writeCount = _beamCount * _subbandCount * _channelsPerSubbandCount * timestepCount;
-				memcpy(_block.SamplePtr(_timeStepsInWriteBlock), data, sizeof(float) * writeCount);
-				_timeStepsInWriteBlock += timestepCount;
-			}
-		}
-		
-		const std::string &Filename() const { return _filename; }
-		
-		size_t BlockSize() const
-		{
-			return _blockHeaderSize + _blockFooterSize +
-				_beamCount * _subbandCount * _channelsPerSubbandCount * _timestepsPerBlockCount * sizeof(float);
-		}
-		
-		void SetSubbandCount(unsigned count) { _subbandCount = count; }
-		void SetChannelCount(unsigned count) { _channelsPerSubbandCount = count; }
-		void SetBeamCount(unsigned count) { _beamCount = count; }
-		void SetTimestepsPerBlockCount(unsigned count) { _timestepsPerBlockCount = count; }
-		void SetBlockHeaderSize(unsigned size) { _blockHeaderSize = size; }
-		void SetBlockFooterSize(unsigned size) { _blockFooterSize = size; }
-		
-	private:
-		unsigned _blockHeaderSize;
-		unsigned _blockFooterSize;
-		unsigned _beamCount;
-		unsigned _subbandCount;
-		unsigned _channelsPerSubbandCount;
-		unsigned _timestepsPerBlockCount;
-		const std::string _filename;
-		bool _useNetworkOrder;
-		
-		std::ofstream *_outputStream;
-		size_t _timeStepsInWriteBlock;
-		
-		void readBlock();
-
-		class RawBlock
-		{
-			public:
-				RawBlock(RawReader &reader) :
-				_reader(reader)
-				{
-					initialize();
-				}
-				
-				~RawBlock()
-				{
-					deinitialize();
-				}
-				
-				void operator=(const RawBlock &source)
-				{
-					deinitialize();
-					initialize();
-				}
-				
-				void initialize()
-				{
-					_header = new unsigned char[_reader._blockHeaderSize];
-					_data = new float[_reader._beamCount * _reader._subbandCount * _reader._channelsPerSubbandCount * _reader._timestepsPerBlockCount];
-					_postFix = new unsigned char[_reader._blockFooterSize];
-				}
-				
-				void deinitialize()
-				{
-					delete[] _header;
-					delete[] _data;
-					delete[] _postFix;
-				}
-				
-				void read(std::istream &stream)
-				{
-					size_t length = _reader._beamCount * _reader._subbandCount * _reader._channelsPerSubbandCount * _reader._timestepsPerBlockCount;
-					stream.read(reinterpret_cast<char*>(_header), _reader._blockHeaderSize);
-					stream.read(reinterpret_cast<char*>(_data), length * sizeof(float));
-					stream.read(reinterpret_cast<char*>(_postFix), _reader._blockFooterSize);
-					
-					if(_reader._useNetworkOrder)
-					{
-						for(size_t i=0;i<length;++i)
-						{
-							_data[i] = swapfloat(_data[i]);
-						}
-					}
-				}
-				
-				void write(std::ostream &stream)
-				{
-					size_t length = _reader._beamCount * _reader._subbandCount * _reader._channelsPerSubbandCount * _reader._timestepsPerBlockCount;
-					if(_reader._useNetworkOrder)
-					{
-						for(size_t i=0;i<length;++i)
-						{
-							_data[i] = swapfloat(_data[i]);
-						}
-					}
-					
-					stream.write(reinterpret_cast<char*>(_header), _reader._blockHeaderSize);
-					stream.write(reinterpret_cast<char*>(_data), length * sizeof(float));
-					stream.write(reinterpret_cast<char*>(_postFix), _reader._blockFooterSize);
-					
-					if(_reader._useNetworkOrder)
-					{
-						for(size_t i=0;i<length;++i)
-						{
-							_data[i] = swapfloat(_data[i]);
-						}
-					}
-				}
-				
-				float *SamplePtr()
-				{
-					return _data;
-				}
-				
-				float *SamplePtr(size_t sampleIndex)
-				{
-					size_t dataIndex =
-						sampleIndex * _reader._beamCount * _reader._channelsPerSubbandCount * _reader._subbandCount;
-					return &_data[dataIndex];
-				}
-				
-				float swapfloat(float input)
-				{
-					union { char valueChar[4]; float valueFloat; } a, b;
-					a.valueFloat = input;
-					b.valueChar[3] = a.valueChar[0];
-					b.valueChar[2] = a.valueChar[1];
-					b.valueChar[1] = a.valueChar[2];
-					b.valueChar[0] = a.valueChar[3];
-					return b.valueFloat;
-				}
-				
-			private:
-				RawReader &_reader;
-				unsigned char *_header;
-				float *_data;
-				unsigned char *_postFix;
-		};
-		
-		RawBlock _block;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/msio/rspreader.h b/CEP/DP3/AOFlagger/include/AOFlagger/msio/rspreader.h
deleted file mode 100644
index 5531e6dd5bdaa55b5263e2db17e558ceb25577ea..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/msio/rspreader.h
+++ /dev/null
@@ -1,227 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef RSPREADER_H
-#define RSPREADER_H
-
-#include <fstream>
-
-#include <AOFlagger/util/aologger.h>
-
-#include <AOFlagger/msio/timefrequencydata.h>
-#include <AOFlagger/msio/timefrequencymetadata.h>
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class RSPReader {
-	public:
-		explicit RSPReader(const std::string &rawFile) : _rawFile(rawFile), _clockSpeed(200000000)
-		{
-		}
-		
-		~RSPReader()
-		{
-		}
-		
-		std::pair<TimeFrequencyData,TimeFrequencyMetaDataPtr> ReadChannelBeamlet(unsigned long timestepStart, unsigned long timestepEnd, unsigned beamletCount, unsigned beamletIndex);
-		
-		std::pair<TimeFrequencyData,TimeFrequencyMetaDataPtr> ReadSingleBeamlet(unsigned long timestepStart, unsigned long timestepEnd, unsigned beamletCount, unsigned beamletIndex);
-		
-		std::pair<TimeFrequencyData,TimeFrequencyMetaDataPtr> ReadAllBeamlets(unsigned long timestepStart, unsigned long timestepEnd, unsigned beamletCount);
-		
-		void ReadForStatistics(unsigned beamletCount);
-		
-		const std::string &File() const { return _rawFile; }
-		
-		unsigned long TimeStepCount(size_t beamletCount) const;
-	private:
-		static const unsigned char BitReverseTable256[256];
-
-		static void readNetworkOrder(std::ifstream &stream, char *buffer, unsigned length)
-		{
-			char swappedBuffer[length];
-			stream.read(swappedBuffer, length);
-			for(unsigned i=0,j=length-1;i<length;++i,--j)
-				buffer[j] = swappedBuffer[i];
-		}
-		static unsigned char reverse(unsigned char c)
-		{
-			return BitReverseTable256[c];
-		}
-		static unsigned short reverse(unsigned short c)
-		{
-			return
-				BitReverseTable256[c >> 8] |
-				(BitReverseTable256[c &0xFF]<<8);
-		}
-		static signed short reverse(signed short c)
-		{
-			return
-				BitReverseTable256[c >> 8] |
-				(BitReverseTable256[c &0xFF]<<8);
-		}
-		static unsigned int reverse(unsigned int c)
-		{
-			return
-				BitReverseTable256[c >> 24] |
-				(BitReverseTable256[(c >> 16)&0xFF]<<8) |
-				(BitReverseTable256[(c >> 8)&0xFF]<<16) |
-				(BitReverseTable256[c & 0xFF]<<24);
-		}
-		static signed short toShort(unsigned char c1, unsigned char c2)
-		{
-			return (c2<<8) | c1;
-		}
-		static unsigned short toUShort(unsigned char c1, unsigned char c2)
-		{
-			return (c1<<8) | c2;
-		}
-		static unsigned int toUInt(unsigned char c1, unsigned char c2, unsigned char c3, unsigned char c4)
-		{
-			return (c1<<24) | (c2<<16) | (c3<<8) | c4;
-		}
-		
-		const std::string _rawFile;
-		const unsigned long _clockSpeed;
-		static const unsigned long STATION_INTEGRATION_STEPS;
-
-		struct RCPTransportHeader {
-			unsigned char versionAndHeaderLength : 8;
-			unsigned char typeOfService : 8;
-			unsigned short totalLength : 16;
-			unsigned short identification : 16;
-			unsigned int flagsAndFragmentOffset : 8;
-			unsigned int ttl : 8;
-			unsigned int protocol : 8;
-			unsigned int headerCrc : 16;
-			unsigned int sourceIP : 32;
-			unsigned int destinationIP : 32;
-			unsigned int udpSourcePort : 16;
-			unsigned int udpDestPort : 16;
-			unsigned int udpLength : 16;
-			unsigned int udpChecksum : 16;
-			
-			void Print() const
-			{
-				AOLogger::Debug
-					<< "versionAndHeaderLength=" << versionAndHeaderLength << "\n"
-					<< "typeOfService=" << typeOfService << "\n"
-					<< "totalLength=" << totalLength << "\n"
-					<< "identification=" << identification << "\n"
-					<< "flagsAndFragmentOffset=" << flagsAndFragmentOffset << "\n"
-					<< "ttl=" << ttl << "\n"
-					<< "protocol=" << protocol << "\n"
-					<< "headerCrc=" << headerCrc << "\n"
-					<< "sourceIP=" << sourceIP << "\n"
-					<< "destinationIP=" << destinationIP << "\n"
-					<< "udpSourcePort=" << udpSourcePort << "\n"
-					<< "udpDestPort=" << udpDestPort << "\n"
-					<< "udpLength=" << udpLength << "\n"
-					<< "udpChecksum=" << udpChecksum << "\n";
-			}
-		};
-
-		struct RCPApplicationHeader {
-			unsigned char versionId;
-			unsigned char sourceInfo;
-			unsigned short configurationId;
-			unsigned short stationId;
-			unsigned char nofBeamlets;
-			unsigned char nofBlocks;
-			unsigned int timestamp;
-			unsigned int blockSequenceNumber;
-			
-			static const unsigned int SIZE;
-			
-			void Read(std::ifstream &stream)
-			{
-				unsigned char buffer[16];
-				stream.read(reinterpret_cast<char*>(buffer), 16);
-				versionId = buffer[0];
-				sourceInfo = buffer[1];
-				configurationId = toUShort(buffer[3], buffer[2]);
-				stationId = toUShort(buffer[5], buffer[4]);
-				nofBeamlets = buffer[6];
-				nofBlocks = buffer[7];
-				timestamp = toUInt(buffer[11], buffer[10], buffer[9], buffer[8]);
-				blockSequenceNumber = toUInt(buffer[15], buffer[14], buffer[13], buffer[12]);
-			}
-			
-			void Print() const
-			{
-				AOLogger::Debug
-					<< "versionId=" << (unsigned int) versionId << "\n"
-					<< "sourceInfo=" << (unsigned int) sourceInfo << "\n"
-					<< "configurationId=" << (unsigned int) configurationId << "\n"
-					<< "stationId=" << (unsigned int) stationId << "\n"
-					<< "nofBeamlets=" << (unsigned int) nofBeamlets << "\n"
-					<< "nofBlocks=" << (unsigned int) nofBlocks << "\n"
-					<< "timestamp=" << (unsigned int) timestamp << "\n"
-					<< "blockSequenceNumber=" << (unsigned int) blockSequenceNumber << "\n";
-			}
-		};
-		struct RCPBeamletData {
-			signed short xr, xi;
-			signed short yr, yi;
-			
-			static const unsigned int SIZE;
-			
-			void Read(std::ifstream &stream)
-			{
-				unsigned char buffer[8];
-				stream.read(reinterpret_cast<char*>(buffer), 8);
-				xr = toShort(buffer[6], buffer[7]);
-				xi = toShort(buffer[4], buffer[5]);
-				yr = toShort(buffer[2], buffer[3]);
-				yi = toShort(buffer[0], buffer[1]);
-			}
-			
-			void Print()
-			{
-				AOLogger::Debug << "x=" << xr;
-				if(xi > 0) AOLogger::Debug << "+" << xi << "i";
-				else AOLogger::Debug << "-" << (-xi) << "i";
-				AOLogger::Debug << ",y=" << yr;
-				if(yi > 0) AOLogger::Debug << "+" << yi << "i\n";
-				else AOLogger::Debug << "-" << (-yi) << "i\n";
-			}
-		};
-		struct BeamletStatistics {
-			BeamletStatistics() : totalCount(0) {
-				for(unsigned i=0;i<16;++i)
-					bitUseCount[i] = 0;
-			}
-			void Print()
-			{
-				for(unsigned bit=0;bit<16;++bit)
-				{
-					AOLogger::Info
-						<< "Bit " << bit << " times required: "
-						<< bitUseCount[bit] << " ("
-						<< (100.0 * (double) bitUseCount[bit] / (double) totalCount) << "%)"
-						<< '\n';
-				}
-			}
-			unsigned long totalCount;
-			unsigned long bitUseCount[16];
-		};
-};
-
-#endif // RSPREADER_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/msio/samplerow.h b/CEP/DP3/AOFlagger/include/AOFlagger/msio/samplerow.h
deleted file mode 100644
index 6bc1891da7a0d217ba941dbc44ac9f28b7de855d..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/msio/samplerow.h
+++ /dev/null
@@ -1,355 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef SAMPLEROW_H
-#define SAMPLEROW_H
-
-#include <limits>
-#include <cmath>
-
-#include <boost/shared_ptr.hpp>
-
-#include <AOFlagger/msio/image2d.h>
-#include <AOFlagger/msio/mask2d.h>
-
-typedef boost::shared_ptr<class SampleRow> SampleRowPtr;
-typedef boost::shared_ptr<const class SampleRow> SampleRowCPtr;
-
-#include <AOFlagger/strategy/algorithms/convolutions.h>
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class SampleRow {
-	public:
-		~SampleRow()
-		{
-			delete[] _values;
-		}
-
-		static SampleRowPtr CreateEmpty(size_t size) {
-			return SampleRowPtr(new SampleRow(size));
-		}
-		static SampleRowPtr CreateZero(size_t size) {
-			SampleRow *row = new SampleRow(size);
-			for(size_t i=0;i<size;++i)
-				row->_values[i] = 0.0;
-			return SampleRowPtr(row);
-		}
-		static SampleRowPtr CreateFromRow(Image2DCPtr image, size_t y)
-		{
-			SampleRow *row = new SampleRow(image->Width());
-			for(size_t x=0;x<image->Width();++x)
-				row->_values[x] = image->Value(x, y);
-			return SampleRowPtr(row);
-		}
-		static SampleRowPtr CreateFromRow(Image2DCPtr image, size_t xStart, size_t length, size_t y)
-		{
-			SampleRow *row = new SampleRow(length);
-			for(size_t x=0;x<length;++x)
-				row->_values[x] = image->Value(x+xStart, y);
-			return SampleRowPtr(row);
-		}
-		static SampleRowPtr CreateFromRowWithMissings(Image2DCPtr image, Mask2DCPtr mask, size_t y)
-		{
-			SampleRow *row = new SampleRow(image->Width());
-			for(size_t x=0;x<image->Width();++x)
-			{
-				if(mask->Value(x, y))
-					row->_values[x] = std::numeric_limits<num_t>::quiet_NaN();
-				else
-					row->_values[x] = image->Value(x, y);
-			}
-			return SampleRowPtr(row);
-		}
-		static SampleRowPtr CreateAmplitudeFromRow(Image2DCPtr real, Image2DCPtr imaginary, size_t y)
-		{
-			SampleRow *row = new SampleRow(real->Width());
-			for(size_t x=0;x<real->Width();++x)
-			{
-				row->_values[x] = sqrtn(real->Value(x,y)*real->Value(x,y) + imaginary->Value(x,y)*imaginary->Value(x,y));
-			}
-			return SampleRowPtr(row);
-		}
-		static SampleRowPtr CreateFromColumn(Image2DCPtr image, size_t x)
-		{
-			SampleRow *row = new SampleRow(image->Height());
-			for(size_t y=0;y<image->Height();++y)
-				row->_values[y] = image->Value(x, y);
-			return SampleRowPtr(row);
-		}
-		static SampleRowPtr CreateFromColumnWithMissings(Image2DCPtr image, Mask2DCPtr mask, size_t x)
-		{
-			SampleRow *row = new SampleRow(image->Height());
-			for(size_t y=0;y<image->Height();++y)
-			{
-				if(mask->Value(x, y))
-					row->_values[y] = std::numeric_limits<num_t>::quiet_NaN();
-				else
-					row->_values[y] = image->Value(x, y);
-			}
-			return SampleRowPtr(row);
-		}
-		static SampleRowPtr CreateFromRowSum(Image2DCPtr image, size_t yStart, size_t yEnd)
-		{
-			if(yEnd > yStart) {
-				SampleRowPtr row = CreateFromRow(image, yStart);
-	
-				for(size_t y=yStart+1;y<yEnd;++y) {
-					for(size_t x=0;x<image->Width();++x)
-						row->_values[x] += image->Value(x, y);
-				}
-				return row;
-			} else {
-				return CreateZero(image->Width());
-			}
-		}
-		static SampleRowPtr CreateFromColumnSum(Image2DCPtr image, size_t xStart, size_t xEnd)
-		{
-			if(xEnd > xStart) {
-				SampleRowPtr row = CreateFromColumn(image, xStart);
-	
-				for(size_t x=xStart+1;x<xEnd;++x) {
-					for(size_t y=0;y<image->Width();++y)
-						row->_values[y] += image->Value(x, y);
-				}
-				return row;
-			} else {
-				return CreateZero(image->Width());
-			}
-		}
-		static SampleRowPtr CreateCopy(SampleRowCPtr source)
-		{
-			return SampleRowPtr(new SampleRow(*source));
-		}
-		SampleRowPtr Copy() const
-		{
-			return SampleRowPtr(new SampleRow(*this));
-		}
-		
-		void SetHorizontalImageValues(Image2DPtr image, unsigned y) const
-		{
-			for(size_t i=0;i<_size;++i)
-			{
-				image->SetValue(i, y, _values[i]);
-			}
-		}
-		void SetHorizontalImageValues(Image2DPtr image, unsigned xStart, unsigned y) const
-		{
-			for(size_t i=0;i<_size;++i)
-			{
-				image->SetValue(i+xStart, y, _values[i]);
-			}
-		}
-		void SetVerticalImageValues(Image2DPtr image, unsigned x) const
-		{
-			for(size_t i=0;i<_size;++i)
-			{
-				image->SetValue(x, i, _values[i]);
-			}
-		}
-		void SetVerticalImageValues(Image2DPtr image, unsigned x, unsigned yStart) const
-		{
-			for(size_t i=0;i<_size;++i)
-			{
-				image->SetValue(x, i+yStart, _values[i]);
-			}
-		}
-		
-		num_t Value(size_t i) const { return _values[i]; }
-		void SetValue(size_t i, num_t newValue) { _values[i] = newValue; }
-
-		size_t Size() const { return _size; }
-		
-		size_t IndexOfMax() const
-		{
-			size_t maxIndex = 0;
-			num_t maxValue = _values[0];
-			for(size_t i = 1; i<_size;++i)
-			{
-				if(_values[i] > maxValue)
-				{
-					maxIndex = i;
-					maxValue = _values[i];
-				}
-			}
-			return maxIndex;
-		}
-
-		numl_t RMS() const
-		{
-			if(_size == 0) return std::numeric_limits<numl_t>::quiet_NaN();
-			numl_t sum = 0.0;
-			for(size_t i=0;i<_size;++i)
-				sum += _values[i] * _values[i];
-			return sqrtnl(sum / _size);
-		}
-		num_t Median() const
-		{
-			if(_size == 0) return std::numeric_limits<num_t>::quiet_NaN();
-
-			num_t *copy = new num_t[_size];
-			for(size_t i=0;i<_size;++i)
-				copy[i] = _values[i];
-			if(_size % 2 == 0)
-			{
-				size_t
-					m = _size / 2 - 1;
-				std::nth_element(copy, copy + m, copy + _size);
-				num_t leftMid = *(copy + m);
-				std::nth_element(copy, copy + m + 1, copy + _size);
-				num_t rightMid = *(copy + m + 1);
-				delete[] copy;
-				return (leftMid + rightMid) / 2;
-			} else {
-				size_t
-					m = _size / 2;
-				std::nth_element(copy, copy + m, copy + _size);
-				num_t mid = *(copy + m);
-				delete[] copy;
-				return mid;
-			}
-		}
-		numl_t Mean() const
-		{
-			numl_t mean = 0.0;
-			for(size_t i = 0; i<_size;++i)
-				mean += _values[i];
-			return mean / _size;
-		}
-		numl_t MeanWithMissings() const
-		{
-			numl_t mean = 0.0;
-			size_t count = 0;
-			for(size_t i = 0; i<_size;++i)
-			{
-				if(std::isfinite(_values[i]))
-				{
-					mean += _values[i];
-					++count;
-				}
-			}
-			return mean / count;
-		}
-		numl_t StdDev(double mean) const
-		{
-			numl_t stddev = 0.0;
-			for(size_t i = 0; i<_size;++i)
-				stddev += (_values[i] - mean) * (_values[i] - mean);
-			return sqrtnl(stddev / _size);
-		}
-		num_t RMSWithMissings() const
-		{
-			SampleRowPtr row = CreateWithoutMissings();
-			return row->RMS();
-		}
-		num_t MedianWithMissings() const
-		{
-			SampleRowPtr row = CreateWithoutMissings();
-			return row->Median();
-		}
-		num_t StdDevWithMissings(double mean) const
-		{
-			SampleRowPtr row = CreateWithoutMissings();
-			return row->StdDev(mean);
-		}
-		SampleRowPtr CreateWithoutMissings() const;
-		bool ValueIsMissing(size_t i) const
-		{
-			return !std::isfinite(Value(i));
-		}
-		void SetValueMissing(size_t i)
-		{
-			SetValue(i, std::numeric_limits<num_t>::quiet_NaN());
-		}
-		void ConvolveWithGaussian(num_t sigma)
-		{
-			Convolutions::OneDimensionalGausConvolution(_values, _size, sigma);
-		}
-		void ConvolveWithSinc(num_t frequency)
-		{
-			Convolutions::OneDimensionalSincConvolution(_values, _size, frequency);
-		}
-		void Subtract(SampleRowCPtr source)
-		{
-			for(unsigned i=0;i<_size;++i)
-				_values[i] -= source->_values[i];
-		}
-		num_t WinsorizedMean() const
-		{
-			num_t *data = new num_t[_size];
-			memcpy(data, _values, sizeof(num_t) * _size);
-			std::sort(data, data + _size, numLessThanOperator);
-			size_t lowIndex = (size_t) floor(0.1 * _size);
-			size_t highIndex = (size_t) ceil(0.9 * _size)-1;
-			num_t lowValue = data[lowIndex];
-			num_t highValue = data[highIndex];
-			delete[] data;
-
-			// Calculate mean
-			num_t mean = 0.0;
-			for(size_t x = 0;x < _size; ++x) {
-				const num_t value = data[x];
-				if(value < lowValue)
-					mean += lowValue;
-				else if(value > highValue)
-					mean += highValue;
-				else
-					mean += value;
-			}
-			return mean / (num_t) _size;
-		}
-		num_t WinsorizedMeanWithMissings() const
-		{
-			SampleRowPtr row = CreateWithoutMissings();
-			return row->WinsorizedMean();
-		}
-	private:
-		explicit SampleRow(size_t size) :
-			_size(size), _values(new num_t[_size])
-		{
-		}
-		SampleRow(const SampleRow &source) :
-			_size(source._size), _values(new num_t[_size])
-		{
-			for(unsigned i=0;i<_size;++i)
-				_values[i] = source._values[i];
-		}
-		SampleRow &operator=(const SampleRow &)
-		{
-			return *static_cast<SampleRow*>(0);
-		}
-		size_t _size;
-		num_t *_values;
-		
-		// We need this less than operator, because the normal operator
-		// does not enforce a strictly ordered set, because a<b != !(b<a) in the case
-		// of nans/infs.
-		static bool numLessThanOperator(const num_t &a, const num_t &b) {
-			if(std::isfinite(a)) {
-				if(std::isfinite(b))
-					return a < b;
-				else
-					return true;
-			}
-			return false;
-		}
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/msio/scalarcolumniterator.h b/CEP/DP3/AOFlagger/include/AOFlagger/msio/scalarcolumniterator.h
deleted file mode 100644
index c5cef140c0f9ed193b68a6169ebebabe78cb4f53..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/msio/scalarcolumniterator.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef SCALARCOLUMNITERATOR_H
-#define SCALARCOLUMNITERATOR_H
-
-#include <ms/MeasurementSets/MSColumns.h>
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-template<typename T>
-class ScalarColumnIterator {
-	public:
-		ScalarColumnIterator(class casa::ROScalarColumn<T> &column, unsigned row) :
-			_column(&column), _row(row)
-		{
-		}
-		ScalarColumnIterator(const ScalarColumnIterator<T> &source) :
-			_column(source._column), _row(source._row)
-		{ }
-		~ScalarColumnIterator() { }
-		ScalarColumnIterator &operator=(const ScalarColumnIterator<T> &source)
-		{
-			_column = source._column;
-			_row = source._row;
-			return *this;
-		}
-		ScalarColumnIterator<T> &operator++() {
-			_row++;
-			return *this;
-		}
-		T *operator->() const {
-			return (*_column)(_row);
-		}
-		T operator*() const {
-			return (*_column)(_row);
-		}
-		bool operator!=(const ScalarColumnIterator<T> &other) const {
-			return _row!=other._row;
-		}
-		bool operator==(const ScalarColumnIterator<T> &other) const {
-			return _row==other._row;
-		}
-		static ScalarColumnIterator First(casa::ROScalarColumn<T> &column)
-		{
-			return ScalarColumnIterator<T>(column, 0);
-		}
-  /*///
-		static ScalarColumnIterator First(casa::ScalarColumn<T> &column)
-		{
-			return ScalarColumnIterator<T>(column, 0);
-		}
-  */
-	private:
-		casa::ROScalarColumn<T> *_column;
-		unsigned _row;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/msio/segmentedimage.h b/CEP/DP3/AOFlagger/include/AOFlagger/msio/segmentedimage.h
deleted file mode 100644
index caff24b101c7ba3d87839eaf52794b361bd092e9..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/msio/segmentedimage.h
+++ /dev/null
@@ -1,136 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef SEGMENTEDIMAGE_H
-#define SEGMENTEDIMAGE_H
-
-#include <cstring>
-
-#include <boost/shared_ptr.hpp>
-
-typedef boost::shared_ptr<class SegmentedImage> SegmentedImagePtr;
-typedef boost::shared_ptr<const class SegmentedImage> SegmentedImageCPtr;
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class SegmentedImage{
-	public:
-		~SegmentedImage()
-		{
-			for(size_t y=0;y<_height;++y)
-				delete[] _data[y];
-			delete[] _data;
-		}
-		
-		static SegmentedImage *Create(size_t width, size_t height, size_t initialValue=0)
-		{
-			SegmentedImage *image = new SegmentedImage(width, height);
-			for(size_t y=0;y<height;++y)
-			{
-				for(size_t x=0;x<width;++x)
-					image->_data[y][x] = initialValue;
-			}
-			return image;
-		}
-		static SegmentedImagePtr CreatePtr(size_t width, size_t height, size_t initialValue=0)
-		{
-			return SegmentedImagePtr(Create(width, height, initialValue));
-		}
-		
-		static SegmentedImage *CreateUnset(size_t width, size_t height)
-		{
-			return new SegmentedImage(width, height);
-		}
-		static SegmentedImagePtr CreateUnsetPtr(size_t width, size_t height)
-		{
-			return SegmentedImagePtr(CreateUnset(width, height));
-		}
-		static SegmentedImagePtr CreateCopy(SegmentedImagePtr segmentedImage)
-		{
-			SegmentedImage *copy = CreateUnset(segmentedImage->_width, segmentedImage->_height);
-			for(size_t y=0;y<segmentedImage->_height;++y) {
-				for(size_t x=0;x<segmentedImage->_width;++x) {
-					copy->SetValue(x, y, segmentedImage->Value(x, y));
-				}
-			}
-			copy->_segmentCount = segmentedImage->_segmentCount;
-			return SegmentedImagePtr(copy);
-		}
-
-		size_t Value(size_t x, size_t y) const
-		{
-			return _data[y][x];
-		}
-		void SetValue(size_t x, size_t y, size_t newValue)
-		{
-			_data[y][x] = newValue;
-		}
-
-		size_t Width() const { return _width; }
-		size_t Height() const { return _height; }
-
-		size_t NewSegmentValue()
-		{
-			++_segmentCount;
-			return _segmentCount;
-		}
-		size_t SegmentCount() const { return _segmentCount; }
-
-		void MergeSegments(size_t destinationSegment, size_t otherSegment)
-		{
-			for(size_t y=0;y<_height;++y)
-			{
-				for(size_t x=0;x<_width;++x)
-					if(_data[y][x] == otherSegment)
-						_data[y][x] = destinationSegment;
-			}
-		}
-		void RemoveSegment(size_t segment)
-		{
-			for(size_t y=0;y<_height;++y)
-			{
-				for(size_t x=0;x<_width;++x)
-					if(_data[y][x] == segment)
-						_data[y][x] = 0;
-			}
-		}
-		void RemoveSegment(size_t segment, size_t xLeft, size_t xRight, size_t yTop, size_t yBottom)
-		{
-			for(size_t y=yTop;y<yBottom;++y)
-			{
-				for(size_t x=xLeft;x<xRight;++x)
-					if(_data[y][x] == segment)
-						_data[y][x] = 0;
-			}
-		}
-	private:
-		SegmentedImage(size_t width, size_t height)
-			: _width(width), _height(height), _data(new size_t*[height]), _segmentCount(0)
-		{
-			for(size_t y=0;y<height;++y)
-				_data[y] = new size_t[width];
-		}
-		
-		size_t _width, _height;
-		size_t **_data;
-		size_t _segmentCount;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/msio/sortedtimestepaccessor.h b/CEP/DP3/AOFlagger/include/AOFlagger/msio/sortedtimestepaccessor.h
deleted file mode 100644
index 7b234efbe79e3003bd9096506ed74ecc770c7ff8..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/msio/sortedtimestepaccessor.h
+++ /dev/null
@@ -1,203 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2011 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#ifndef MSIO_TIMESTEP_ACCESSOR_H
-#define MSIO_TIMESTEP_ACCESSOR_H
-
-#include <stdexcept>
-#include <vector>
-
-#include <ms/MeasurementSets/MSTable.h>
-#include <tables/Tables/TableIter.h>
-
-#include <AOFlagger/msio/types.h>
-
-class TimestepAccessorException : public std::runtime_error
-{
-	public: TimestepAccessorException(const std::string &str) : std::runtime_error(str) { }
-};
-
-class SortedTimestepAccessor
-{
-	public:
-		class TimestepIndex
-		{
-			public:
-				TimestepIndex(unsigned tableCount) : tables(new casa::Table*[tableCount]), _tableCount(tableCount)
-				{
-					for(unsigned i=0;i<tableCount;++i)
-						tables[i] = 0;
-				}
-				~TimestepIndex()
-				{
-					FreeTables();
-					delete[] tables;
-				}
-				void FreeTables()
-				{
-					for(unsigned i=0;i<_tableCount;++i)
-					{
-						if(tables[i] != 0)
-						{
-							delete tables[i];
-							tables[i] = 0;
-						}
-					}
-				}
-	
-				casa::Table **tables;
-			private:
-				unsigned _tableCount;
-				TimestepIndex(TimestepIndex &) { }
-				void operator=(TimestepIndex &) { }
-		};
-		struct TimestepData
-		{
-			num_t **realData, **imagData;
-			unsigned antenna1, antenna2;
-			double u,v;
-
-			void Allocate(unsigned polarizationCount, unsigned channelCount)
-			{
-				realData = new num_t*[polarizationCount];
-				imagData = new num_t*[polarizationCount];
-				for(unsigned p=0;p<polarizationCount;++p)
-				{
-					realData[p] = new num_t[channelCount];
-					imagData[p] = new num_t[channelCount];
-				}
-			}
-			void Free(unsigned polarizationCount)
-			{
-				for(unsigned p=0;p<polarizationCount;++p)
-				{
-					delete[] realData[p];
-					delete[] imagData[p];
-				}
-				delete[] realData;
-				delete[] imagData;
-			}
-		};
-
-		SortedTimestepAccessor() : _isOpen(false), _polarizationCount(0), _totalChannelCount(0)
-		{
-		}
-
-		~SortedTimestepAccessor()
-		{
-			if(_isOpen)
-				Close();
-		}
-
-		void Open();
-
-		void Close();
-
-		void AddMS(const std::string &path)
-		{
-			assertNotOpen();
-			SetInfo newInfo;
-			newInfo.path = path;
-			_sets.push_back(newInfo);
-		}
-
-		unsigned TotalChannelCount() const
-		{
-			assertOpen();
-			return _totalChannelCount;
-		}
-
-		unsigned PolarizationCount() const
-		{
-			assertOpen();
-			return _polarizationCount;
-		}
-
-		double LowestFrequency() const
-		{
-			assertOpen();
-			return _lowestFrequency;
-		}
-
-		double HighestFrequency() const
-		{
-			assertOpen();
-			return _highestFrequency;
-		}
-
-		unsigned TableCount() const
-		{
-			return _sets.size();
-		}
-
-		bool ReadNext(TimestepIndex &index, TimestepData &data);
-
-		void Write(TimestepIndex &index, const TimestepData &data);
-
-	private:
-		struct SetInfo
-		{
-			SetInfo() : tableIter(0)
-			{
-			}
-			SetInfo(const SetInfo &source) :
-				path(source.path),
-				tableIter(source.tableIter),
-				bandCount(source.bandCount),
-				channelsPerBand(source.channelsPerBand),
-				highestFrequency(source.highestFrequency),
-				lowestFrequency(source.lowestFrequency)
-			{
-			}
-			void operator=(const SetInfo &source)
-			{
-				path = source.path;
-				tableIter = source.tableIter;
-				bandCount = source.bandCount;
-				channelsPerBand = source.channelsPerBand;
-				highestFrequency = source.highestFrequency;
-				lowestFrequency = source.lowestFrequency;
-			}
-			std::string path;
-			casa::TableIterator *tableIter;
-			unsigned bandCount, channelsPerBand;
-			double highestFrequency, lowestFrequency;
-		};
-
-		typedef std::vector<SetInfo> SetInfoVector;
-
-		bool _isOpen;
-		unsigned _polarizationCount, _totalChannelCount;
-		SetInfoVector _sets;
-		double _highestFrequency, _lowestFrequency;
-
-		void assertOpen() const
-		{
-			if(!_isOpen)
-				throw TimestepAccessorException("Timestep accessor has not been opened yet");
-		}
-		void assertNotOpen() const
-		{
-			if(_isOpen)
-				throw TimestepAccessorException("Timestep accessor has already been opened");
-		}
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/msio/spatialmatrixmetadata.h b/CEP/DP3/AOFlagger/include/AOFlagger/msio/spatialmatrixmetadata.h
deleted file mode 100644
index c2113f47f9f256b8d9f2a030f20c11e4e241c885..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/msio/spatialmatrixmetadata.h
+++ /dev/null
@@ -1,109 +0,0 @@
-#ifndef SPATIALMATRIXMETADATA_H
-#define SPATIALMATRIXMETADATA_H
-
-#include "antennainfo.h"
-
-class SpatialMatrixMetaData
-{
-	public:
-		SpatialMatrixMetaData(size_t antennaCount)
-			: _antennaCount(antennaCount), _antennae(new AntennaInfo[antennaCount]),
-				_uvw(new class UVW*[antennaCount]), _frequency(0.0), _channelIndex(0), _timeIndex(0)
-		{
-			for(size_t i=0;i<_antennaCount;++i)
-				_uvw[i] = new class UVW[_antennaCount];
-		}
-		SpatialMatrixMetaData(const SpatialMatrixMetaData &source)
-			: _antennaCount(source._antennaCount),
-			_antennae(new AntennaInfo[_antennaCount]),
-			_uvw(new class UVW*[_antennaCount]),
-			_frequency(source._frequency),
-			_channelIndex(source._channelIndex),
-			_timeIndex(source._timeIndex)
-		{
-			for(size_t i=0;i<_antennaCount;++i)
-			{
-				_uvw[i] = new class UVW[_antennaCount];
-				_antennae[i] = source._antennae[i];
-				for(size_t j=0;j<_antennaCount;++j)
-					_uvw[i][j] = source._uvw[i][j];
-			}
-		}
-		~SpatialMatrixMetaData()
-		{
-			for(size_t i=0;i<_antennaCount;++i)
-				delete[] _uvw[i];
-			delete[] _uvw;
-			delete[] _antennae;
-		}
-		void operator=(const SpatialMatrixMetaData &source)
-		{
-			_antennaCount = source._antennaCount;
-			_antennae = new AntennaInfo[_antennaCount];
-			_uvw = new class UVW*[_antennaCount];
-			_frequency = source._frequency;
-			_channelIndex = source._channelIndex;
-			_timeIndex = source._timeIndex;
-
-			for(size_t i=0;i<_antennaCount;++i)
-			{
-				_uvw[i] = new class UVW[_antennaCount];
-				_antennae[i] = source._antennae[i];
-				for(size_t j=0;j<_antennaCount;++j)
-					_uvw[i][j] = source._uvw[i][j];
-			}
-		}
-		void SetAntenna(unsigned index, const AntennaInfo &antenna)
-		{
-			_antennae[index] = antenna;
-		}
-		const AntennaInfo &Antenna(unsigned index) const
-		{
-			return _antennae[index];
-		}
-		void SetUVW(unsigned a1, unsigned a2, const class UVW &uvw)
-		{
-			_uvw[a2][a1] = uvw;
-		}
-		const class UVW &UVW(unsigned a1, unsigned a2) const
-		{
-			return _uvw[a2][a1];
-		}
-		size_t AntennaCount() const
-		{
-			return _antennaCount;
-		}
-		void SetFrequency(num_t frequency)
-		{
-			_frequency = frequency;
-		}
-		num_t Frequency() const
-		{
-			return _frequency;
-		}
-		void SetChannelIndex(size_t channelIndex)
-		{
-			_channelIndex = channelIndex;
-		}
-		size_t ChannelIndex() const
-		{
-			return _channelIndex;
-		}
-		void SetTimeIndex(size_t timeIndex)
-		{
-			_timeIndex = timeIndex;
-		}
-		size_t TimeIndex() const
-		{
-			return _timeIndex;
-		}
-	private:
-		size_t _antennaCount;
-		AntennaInfo *_antennae;
-		class UVW **_uvw;
-		num_t _frequency;
-		size_t _channelIndex;
-		size_t _timeIndex;
-};
-
-#endif // SPATIALMATRIXMETADATA_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/msio/spatialtimeloader.h b/CEP/DP3/AOFlagger/include/AOFlagger/msio/spatialtimeloader.h
deleted file mode 100644
index d01fcefcffc220b3c646d11581f7ab86283fb38f..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/msio/spatialtimeloader.h
+++ /dev/null
@@ -1,32 +0,0 @@
-#ifndef SPATIALTIMELOADER_H
-#define SPATIALTIMELOADER_H
-
-#include <cstring>
-
-#include <tables/Tables/TableIter.h>
-
-#include "timefrequencydata.h"
-#include "measurementset.h"
-
-class SpatialTimeLoader
-{
-	public:
-		explicit SpatialTimeLoader(MeasurementSet &measurementSet);
-		~SpatialTimeLoader();
-
-		TimeFrequencyData Load(unsigned channelIndex, bool fringeStop = true);
-
-		unsigned ChannelCount() const { return _channelCount; }
-		
-		unsigned TimestepsCount() const { return _timestepsCount; }
-	private:
-		MeasurementSet &_measurementSet;
-		casa::Table *_sortedTable;
-		casa::TableIterator *_tableIter;
-		unsigned _channelCount;
-		unsigned _timestepsCount;
-		unsigned _antennaCount;
-		unsigned _polarizationCount;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/msio/stokesimager.h b/CEP/DP3/AOFlagger/include/AOFlagger/msio/stokesimager.h
deleted file mode 100644
index cf54bdbf0165e1ffb4480868b3d358a15bcb570e..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/msio/stokesimager.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef STOKESIMAGER_H
-#define STOKESIMAGER_H
-
-#include "timefrequencyimager.h"
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class StokesImager{
-	public:
-		StokesImager();
-		~StokesImager();
-
-		const class Image2D &StokesI() const throw() { return *_stokesI; }
-		const class Image2D &StokesQ() const throw() { return *_stokesQ; }
-		const class Image2D &StokesU() const throw() { return *_stokesU; }
-		const class Image2D &StokesV() const throw() { return *_stokesV; }
-
-		void Image(const TimeFrequencyImager &timeFreq) {
-			Image(*timeFreq.RealXX(), *timeFreq.ImaginaryXX(), *timeFreq.RealXY(), *timeFreq.ImaginaryXY(), *timeFreq.RealYY(), *timeFreq.ImaginaryYY());
-		}
-
-		void Image(const Image2D &realXX, const Image2D &imaginaryXX, const Image2D &realXY, const Image2D &imaginaryXY, const Image2D &realYY, const Image2D &imaginaryYY); 
-		
-		static Image2DPtr CreateSum(Image2DCPtr left, Image2DCPtr right);
-		static Image2DPtr CreateDifference(Image2DCPtr left, Image2DCPtr right);
-		static Image2DPtr CreateNegatedSum(Image2DCPtr left, Image2DCPtr right);
-
-		static Image2DPtr CreateStokesIAmplitude(Image2DCPtr realXX, Image2DCPtr imaginaryXX, Image2DCPtr realYY, Image2DCPtr imaginaryYY);
-		static Image2DPtr CreateStokesI(Image2DCPtr xx, Image2DCPtr yy) { return CreateSum(xx, yy); }
-		static Image2DPtr CreateStokesQ(Image2DCPtr xx, Image2DCPtr yy) { return CreateDifference(xx, yy); }
-
-		static Image2DPtr CreateAvgPhase(Image2DCPtr xx, Image2DCPtr yy);
-	private:
-
-		Image2D *_stokesI, *_stokesQ, *_stokesU, *_stokesV;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/msio/system.h b/CEP/DP3/AOFlagger/include/AOFlagger/msio/system.h
deleted file mode 100644
index 877c0c0db3571f7db0d2adda40e34d40d643e9c1..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/msio/system.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef MSIOSYSTEM_H
-#define MSIOSYSTEM_H
-
-#include <casa/OS/HostInfo.h>
-
-class System
-{
-	public:
-		static long TotalMemory()
-		{
-			return casa::HostInfo::memoryTotal()*1024;
-		}
-		
-		static unsigned ProcessorCount()
-		{
-			unsigned cpus = casa::HostInfo::numCPUs();
-			if(cpus == 0) cpus = 1;
-			return cpus;
-		}
-};
-
-#endif //MSIOSYSTEM_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/msio/timefrequencydata.h b/CEP/DP3/AOFlagger/include/AOFlagger/msio/timefrequencydata.h
deleted file mode 100644
index cf3fb7f69975ed27b9ef8b993f7e382021fbd19b..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/msio/timefrequencydata.h
+++ /dev/null
@@ -1,1237 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#ifndef TIMEFREQUENCYDATA_H
-#define TIMEFREQUENCYDATA_H
-
-#include <string>
-#include <vector>
-#include <utility>
-#include <sstream>
-#include <stdexcept>
-
-#include <AOFlagger/msio/image2d.h>
-#include <AOFlagger/msio/mask2d.h>
-#include <AOFlagger/msio/types.h>
-
-#include <AOFlagger/baseexception.h>
-
-class TimeFrequencyData
-{
-	public:
-		enum PhaseRepresentation { PhasePart, AmplitudePart, RealPart, ImaginaryPart, ComplexRepresentation };
-
-		enum FlagCoverage { NoFlagCoverage, GlobalFlagCoverage, IndividualPolarisationFlagCoverage };
-		
-		TimeFrequencyData() : _containsData(false), _flagCoverage(NoFlagCoverage) { }
-
-		TimeFrequencyData(const TimeFrequencyData &source) :
-			_containsData(source._containsData),
-			_phaseRepresentation(source._phaseRepresentation),
-			_polarisationType(source._polarisationType),
-			_flagCoverage(source._flagCoverage),
-			_images(source._images),
-			_flagging(source._flagging)
-		{
-		}
-		
-		TimeFrequencyData(PhaseRepresentation phaseRepresentation,
-												 PolarisationType polarisationType,
-												 const Image2DCPtr &image) :
-				_containsData(true),
-				_phaseRepresentation(phaseRepresentation),
-				_polarisationType(polarisationType),
-				_flagCoverage(NoFlagCoverage)
-		{
-			if(phaseRepresentation == ComplexRepresentation)
-				throw BadUsageException("Incorrect construction of time/frequency data: trying to create complex representation from single image");
-			if(polarisationType == DipolePolarisation)
-				throw BadUsageException("Incorrect construction of time/frequency data: trying to create dipole polarised data from single image");
-			_images.push_back(image);
-		}
-
-		TimeFrequencyData(PhaseRepresentation phaseRepresentation,
-												 PolarisationType polarisationType,
-												 const Image2DCPtr &imageA,
-												 const Image2DCPtr &imageB) :
-				_containsData(true),
-				_phaseRepresentation(phaseRepresentation),
-				_polarisationType(polarisationType),
-				_flagCoverage(NoFlagCoverage)
-		{
-			if(phaseRepresentation == ComplexRepresentation)
-			{
-				if(PolarisationCount(polarisationType) != 1)
-					throw BadUsageException("Invalid initialization of time/frequency data: two images specified, but multiple polarizations and complex representation");
-			} else {
-				if(polarisationType != AutoDipolePolarisation && polarisationType != CrossDipolePolarisation)
-					throw BadUsageException("Invalid initialization of time/frequency data: two images specified but no two polarizations requested");
-			}
-			_images.push_back(imageA);
-			_images.push_back(imageB);
-		}
-
-		TimeFrequencyData(PolarisationType polarisationType,
-											const Image2DCPtr &real,
-											const Image2DCPtr &imaginary) :
-				_containsData(true),
-				_phaseRepresentation(ComplexRepresentation),
-				_polarisationType(polarisationType),
-				_flagCoverage(NoFlagCoverage)
-		{
-			if(polarisationType == DipolePolarisation || polarisationType == AutoDipolePolarisation || polarisationType == CrossDipolePolarisation)
-				throw BadUsageException("Wrong constructor called");
-			_images.push_back(real);
-			_images.push_back(imaginary);
-		}
-		
-		TimeFrequencyData(PolarisationType polarisationType,
-											const Image2DCPtr &realA,
-											const Image2DCPtr &imaginaryA,
-											const Image2DCPtr &realB,
-											const Image2DCPtr &imaginaryB) :
-				_containsData(true),
-				_phaseRepresentation(ComplexRepresentation),
-				_polarisationType(polarisationType),
-				_flagCoverage(NoFlagCoverage)
-		{
-			if(polarisationType != AutoDipolePolarisation && polarisationType != CrossDipolePolarisation)
-				throw BadUsageException("Incorrect construction of time/frequency data: trying to create non-auto/cross dipole polarised data from two images");
-			_images.push_back(realA);
-			_images.push_back(imaginaryA);
-			_images.push_back(realB);
-			_images.push_back(imaginaryB);
-		}
-		
-		TimeFrequencyData(PhaseRepresentation phaseRepresentation,
-											const Image2DCPtr &xx,
-											const Image2DCPtr &xy,
-											const Image2DCPtr &yx,
-											const Image2DCPtr &yy) :
-				_containsData(true),
-				_phaseRepresentation(phaseRepresentation),
-				_polarisationType(DipolePolarisation),
-				_flagCoverage(NoFlagCoverage)
-		{
-			if(phaseRepresentation == ComplexRepresentation) throw;
-			_images.push_back(xx);
-			_images.push_back(xy);
-			_images.push_back(yx);
-			_images.push_back(yy);
-		}
-
-		TimeFrequencyData(const Image2DCPtr &xxReal,
-											const Image2DCPtr &xxImag,
-											const Image2DCPtr &xyReal,
-											const Image2DCPtr &xyImag,
-											const Image2DCPtr &yxReal,
-											const Image2DCPtr &yxImag,
-											const Image2DCPtr &yyReal,
-											const Image2DCPtr &yyImag) :
-				_containsData(true),
-				_phaseRepresentation(ComplexRepresentation),
-				_polarisationType(DipolePolarisation),
-				_flagCoverage(NoFlagCoverage)
-		{
-			_images.push_back(xxReal);
-			_images.push_back(xxImag);
-			_images.push_back(xyReal);
-			_images.push_back(xyImag);
-			_images.push_back(yxReal);
-			_images.push_back(yxImag);
-			_images.push_back(yyReal);
-			_images.push_back(yyImag);
-		}
-
-		TimeFrequencyData &operator=(const TimeFrequencyData &source)
-		{
-			_containsData = source._containsData;
-			
-			_phaseRepresentation = source._phaseRepresentation;
-			_polarisationType = source._polarisationType;
-			_flagCoverage = source._flagCoverage;
-	
-			_images = source._images;
-			_flagging = source._flagging;
-			return *this;
-		}
-		
-		static TimeFrequencyData CreateComplexTFData(size_t polarisationCount, Image2DCPtr *realImages, Image2DCPtr *imagImages)
-		{
-			switch(polarisationCount)
-			{
-				case 1:
-					return TimeFrequencyData(StokesIPolarisation, realImages[0], imagImages[0]);
-				case 2:
-					return TimeFrequencyData(AutoDipolePolarisation, realImages[0], imagImages[0], realImages[1], imagImages[1]);
-				case 4:
-					return TimeFrequencyData(realImages[0], imagImages[0], realImages[1], imagImages[1], realImages[2], imagImages[2], realImages[3], imagImages[3]);
-				default:
-					throw BadUsageException("Can not create TimeFrequencyData structure with polarization type other than 1, 2 or 4 polarizations.");
-			}
-		}
-		
-		bool IsEmpty() const { return !_containsData; }
-
-		bool HasXX() const
-		{
-			return _polarisationType == DipolePolarisation || _polarisationType == AutoDipolePolarisation || _polarisationType == XXPolarisation;
-		}
-
-		bool HasXY() const
-		{
-			return _polarisationType == DipolePolarisation || _polarisationType == CrossDipolePolarisation || _polarisationType == XYPolarisation;
-		}
-
-		bool HasYX() const
-		{
-			return _polarisationType == DipolePolarisation || _polarisationType == CrossDipolePolarisation || _polarisationType == YXPolarisation;
-		}
-
-		bool HasYY() const
-		{
-			return _polarisationType == DipolePolarisation || _polarisationType == AutoDipolePolarisation || _polarisationType == YYPolarisation;
-		}
-		
-		/**
-		 * This function returns a new Image2D that contains
-		 * an image that can be used best for thresholding-like
-		 * RFI methods, or visualization. The encapsulated data
-		 * may be converted in order to do so.
-		 * @return A new image containing the TF-data.
-		 */
-		Image2DCPtr GetSingleImage() const
-		{
-			switch(_phaseRepresentation)
-			{
-				case PhasePart:
-				case AmplitudePart:
-				case RealPart:
-				case ImaginaryPart:
-					return GetSingleImageFromSinglePhaseImage();
-				case ComplexRepresentation:
-					return GetSingleAbsoluteFromComplex();
-			}
-			throw BadUsageException("Incorrect phase representation");
-		}
-
-		Mask2DCPtr GetSingleMask() const
-		{
-			switch(_flagCoverage)
-			{
-				case NoFlagCoverage:
-					return GetSetMask<false>();
-				case GlobalFlagCoverage:
-					return _flagging[0];
-				case IndividualPolarisationFlagCoverage:
-					return GetCombinedMask();
-			}
-			throw BadUsageException("Incorrect flag coverage in GetSingleMask()");
-		}
-
-		std::pair<Image2DCPtr,Image2DCPtr> GetSingleComplexImage() const
-		{
-			if(_phaseRepresentation != ComplexRepresentation)
-				throw BadUsageException("Trying to create single complex image, but no complex data available");
-			switch(_polarisationType)
-			{
-				case SinglePolarisation:
-				case StokesIPolarisation:
-				case StokesQPolarisation:
-				case StokesUPolarisation:
-				case StokesVPolarisation:
-				case XXPolarisation:
-				case XYPolarisation:
-				case YXPolarisation:
-				case YYPolarisation:
-					return std::pair<Image2DCPtr,Image2DCPtr>(_images[0], _images[1]);
-				case DipolePolarisation:
-				case AutoDipolePolarisation:
-				case CrossDipolePolarisation:
-				default:
-					throw BadUsageException("Not implemented");
-					//return CreateSingleComplexImageFromDipole();
-			}
-		}
-		
-		void Set(PolarisationType polarisationType,
-								const Image2DCPtr &real,
-								const Image2DCPtr &imaginary)
-		{
-			_containsData = true;
-			_phaseRepresentation = ComplexRepresentation;
-			_polarisationType = polarisationType;
-			if(polarisationType == DipolePolarisation) throw;
-			_images.clear();
-			_images.push_back(real);
-			_images.push_back(imaginary);
-		}
-
-		void SetNoMask()
-		{
-			_flagging.clear();
-			_flagCoverage = NoFlagCoverage;
-		}
-
-		void SetGlobalMask(const Mask2DCPtr &mask)
-		{
-			_flagging.clear();
-			_flagging.push_back(mask);
-			_flagCoverage = GlobalFlagCoverage;
-		}
-
-		Mask2DCPtr GetMask(enum PolarisationType polarisation) const
-		{
-			if(polarisation == DipolePolarisation || polarisation == AutoDipolePolarisation)
-				throw BadUsageException("Need a single polarisation for GetMask()");
-			else if(_flagCoverage == NoFlagCoverage)
-				return GetSetMask<false>();
-			else if(polarisation == _polarisationType)
-				return _flagging[0];
-			else if(_polarisationType==DipolePolarisation) {
-				if(_flagCoverage == GlobalFlagCoverage) return _flagging[0];
-				switch(polarisation)
-				{
-					case XXPolarisation: return _flagging[0];
-					case XYPolarisation: return _flagging[1];
-					case YXPolarisation: return _flagging[2];
-					case YYPolarisation: return _flagging[3];
-					case StokesIPolarisation: return GetSingleMask();
-					case StokesQPolarisation: return GetSingleMask();
-					case StokesUPolarisation: return GetSingleMask();
-					case StokesVPolarisation: return GetSingleMask();
-					case SinglePolarisation: throw BadUsageException("Requesting single polarisation mask from dipole information, which polarisation to return?");
-					case DipolePolarisation:
-					case AutoDipolePolarisation:
-					case CrossDipolePolarisation:
-						break;
-				}
-			}
-			else if(_polarisationType==AutoDipolePolarisation) {
-				if(_flagCoverage == GlobalFlagCoverage) return _flagging[0];
-				if(polarisation == XXPolarisation)
-					return _flagging[0];
-				else if(polarisation == YYPolarisation)
-					return _flagging[1];
-				else if(polarisation == StokesIPolarisation || polarisation == StokesQPolarisation)
-					return GetSingleMask();
-				else if(polarisation == SinglePolarisation)
-					throw BadUsageException("Requesting single polarisation mask from auto dipole information, which polarisation to return?");
-			}
-			else if(_polarisationType==CrossDipolePolarisation) {
-				if(_flagCoverage == GlobalFlagCoverage) return _flagging[0];
-				if(polarisation == XYPolarisation)
-					return _flagging[0];
-				else if(polarisation == YXPolarisation)
-					return _flagging[1];
-				else if(polarisation == StokesIPolarisation)
-					return GetSingleMask();
-				else if(polarisation == SinglePolarisation)
-					throw BadUsageException("Requesting single polarisation mask from cross dipole information, which polarisation to return?");
-			}
-			else if((_flagCoverage==GlobalFlagCoverage || _flagCoverage==IndividualPolarisationFlagCoverage) && ( _polarisationType == SinglePolarisation || _polarisationType == StokesIPolarisation)) {
-				if(polarisation == XXPolarisation || polarisation == XYPolarisation || polarisation == YXPolarisation || polarisation == YYPolarisation || polarisation == StokesIPolarisation || polarisation == SinglePolarisation)
-				return _flagging[0];
-			}
-			else if(_flagCoverage==GlobalFlagCoverage)
-				return _flagging[0];
-			throw BadUsageException("Mask requested that was not available in the given time frequency data");
-		}
-
-		void SetIndividualPolarisationMasks(const Mask2DCPtr &xxMask, const Mask2DCPtr &yyMask)
-		{
-			if(_polarisationType != AutoDipolePolarisation && _polarisationType != CrossDipolePolarisation)
-				throw BadUsageException("Trying to set two individual mask in non-dipole time frequency data");
-			_flagging.clear();
-			_flagging.push_back(xxMask);
-			_flagging.push_back(yyMask);
-			_flagCoverage = IndividualPolarisationFlagCoverage;
-		}
-
-		void SetIndividualPolarisationMasks(const Mask2DCPtr &xxMask, const Mask2DCPtr &xyMask, const Mask2DCPtr &yxMask, const Mask2DCPtr &yyMask)
-		{
-			if(_polarisationType != DipolePolarisation)
-				throw BadUsageException("Trying to set four individual mask in non-dipole time frequency data");
-			_flagging.clear();
-			_flagging.push_back(xxMask);
-			_flagging.push_back(xyMask);
-			_flagging.push_back(yxMask);
-			_flagging.push_back(yyMask);
-			_flagCoverage = IndividualPolarisationFlagCoverage;
-		}
-
-		TimeFrequencyData *CreateTFData(PhaseRepresentation phase) const
-		{
-			if(phase == _phaseRepresentation)
-				return new TimeFrequencyData(*this);
-			else if(_phaseRepresentation == ComplexRepresentation)
-			{
-				if(_polarisationType == DipolePolarisation)
-				{
-					return CreateTFDataFromDipoleComplex(phase);
-				} else if(_polarisationType == AutoDipolePolarisation) {
-					return CreateTFDataFromAutoDipoleComplex(phase);
-				} else if(_polarisationType == CrossDipolePolarisation) {
-					return CreateTFDataFromCrossDipoleComplex(phase);
-				} else {
-					return CreateTFDataFromSingleComplex(phase);
-				}
-			} else throw BadUsageException("Request for time/frequency data with a phase representation that can not be extracted from the source (source is not complex)");
-		}
-
-		TimeFrequencyData *CreateTFData(PolarisationType polarisation) const
-		{
-			TimeFrequencyData *data = 0;
-			if(_polarisationType == polarisation)
-				data = new TimeFrequencyData(*this);
-			else if(_polarisationType == DipolePolarisation && _phaseRepresentation == ComplexRepresentation) {
-				switch(polarisation)
-				{
-					case XXPolarisation:
-						data = new TimeFrequencyData(XXPolarisation, _images[0], _images[1]);
-						data->SetGlobalMask(GetMask(polarisation));
-						break;
-					case XYPolarisation:
-						data = new TimeFrequencyData(XYPolarisation, _images[2], _images[3]);
-						data->SetGlobalMask(GetMask(polarisation));
-						break;
-					case YXPolarisation:
-						data = new TimeFrequencyData(YXPolarisation, _images[4], _images[5]);
-						data->SetGlobalMask(GetMask(polarisation));
-						break;
-					case YYPolarisation:
-						data = new TimeFrequencyData(YYPolarisation, _images[6], _images[7]);
-						data->SetGlobalMask(GetMask(polarisation));
-						break;
-					case StokesIPolarisation:
-						data = new TimeFrequencyData(StokesIPolarisation, GetStokesIFromDipole(0, 6), GetStokesIFromDipole(1, 7));
-						data->SetGlobalMask(GetMask(polarisation));
-						break;
-					case StokesQPolarisation:
-						data = new TimeFrequencyData(StokesQPolarisation, GetStokesQFromDipole(0,6), GetStokesQFromDipole(1,7));
-						data->SetGlobalMask(GetMask(polarisation));
-						break;
-					case StokesUPolarisation:
-						data = new TimeFrequencyData(StokesUPolarisation, GetStokesUFromDipole(2, 4), GetStokesUFromDipole(3, 5));
-						data->SetGlobalMask(GetMask(polarisation));
-						break;
-					case StokesVPolarisation:
-						data = new TimeFrequencyData(StokesVPolarisation, GetRealStokesVFromDipole(3, 4), GetImaginaryStokesVFromDipole(2, 5));
-						data->SetGlobalMask(GetMask(polarisation));
-						break;
-					case AutoDipolePolarisation:
-						data = new TimeFrequencyData(AutoDipolePolarisation, _images[0], _images[1], _images[6], _images[7]);
-						if(_flagCoverage == GlobalFlagCoverage)
-							data->SetGlobalMask(_flagging[0]);
-						else if(_flagCoverage == IndividualPolarisationFlagCoverage)
-							data->SetIndividualPolarisationMasks(_flagging[0], _flagging[3]);
-						break;
-					case CrossDipolePolarisation:
-						data = new TimeFrequencyData(CrossDipolePolarisation, _images[2], _images[3], _images[4], _images[5]);
-						if(_flagCoverage == GlobalFlagCoverage)
-							data->SetGlobalMask(_flagging[0]);
-						else if(_flagCoverage == IndividualPolarisationFlagCoverage)
-							data->SetIndividualPolarisationMasks(_flagging[1], _flagging[2]);
-						break;
-					case SinglePolarisation:
-						throw BadUsageException("Single polarisation requested from dipole polarisation time frequency data: which single polarisation do you want?");
-					case DipolePolarisation:
-						break;
-				}
-			} else if(_polarisationType == DipolePolarisation) {
-				switch(polarisation)
-				{
-					case XXPolarisation:
-						data = new TimeFrequencyData(_phaseRepresentation, XXPolarisation, _images[0]);
-						break;
-					case XYPolarisation:
-						data = new TimeFrequencyData(_phaseRepresentation, XYPolarisation, _images[1]);
-						break;
-					case YXPolarisation:
-						data = new TimeFrequencyData(_phaseRepresentation, YXPolarisation, _images[2]);
-						break;
-					case YYPolarisation:
-						data = new TimeFrequencyData(_phaseRepresentation, YYPolarisation, _images[3]);
-						break;
-					case StokesIPolarisation:
-					case StokesQPolarisation:
-					case StokesUPolarisation:
-					case StokesVPolarisation:
-					case AutoDipolePolarisation:
-					case CrossDipolePolarisation:
-					case DipolePolarisation:
-					case SinglePolarisation:
-						throw BadUsageException("Requested polarisation type not available in time frequency data");
-				}
-				data->SetGlobalMask(GetMask(polarisation));
-			} else if(_polarisationType == AutoDipolePolarisation && _phaseRepresentation == ComplexRepresentation) {
-				switch(polarisation)
-				{
-					case XXPolarisation:
-						data = new TimeFrequencyData(XXPolarisation, _images[0], _images[1]);
-						data->SetGlobalMask(GetMask(polarisation));
-						break;
-					case YYPolarisation:
-						data = new TimeFrequencyData(YYPolarisation, _images[2], _images[3]);
-						data->SetGlobalMask(GetMask(polarisation));
-						break;
-					case StokesIPolarisation:
-						data= new TimeFrequencyData(StokesIPolarisation, GetStokesIFromDipole(0, 2), GetStokesIFromDipole(1, 3));
-						data->SetGlobalMask(GetMask(polarisation));
-						break;
-					case StokesQPolarisation:
-						data= new TimeFrequencyData(StokesQPolarisation, GetStokesQFromDipole(0, 2), GetStokesQFromDipole(1, 3));
-						data->SetGlobalMask(GetMask(polarisation));
-						break;
-					case StokesUPolarisation:
-					case StokesVPolarisation:
-					case XYPolarisation:
-					case YXPolarisation:
-					case AutoDipolePolarisation:
-					case DipolePolarisation:
-					case CrossDipolePolarisation:
-						throw BadUsageException("Trying to create the time frequency data from auto dipole without the requested polarisation(s)"); 
-					case SinglePolarisation:
-						throw BadUsageException("Single polarisation requested from auto dipole polarisation time frequency data: which single polarisation do you want?");
-				}
-			} else if(_polarisationType == AutoDipolePolarisation) {
-				switch(polarisation)
-				{
-					case XXPolarisation:
-						data = new TimeFrequencyData(_phaseRepresentation, XXPolarisation, _images[0]);
-						break;
-					case YYPolarisation:
-						data = new TimeFrequencyData(_phaseRepresentation, YYPolarisation, _images[1]);
-						break;
-					case StokesIPolarisation:
-						data = new TimeFrequencyData(_phaseRepresentation, StokesQPolarisation, GetStokesIFromDipole(0, 1));
-						break;
-					case StokesQPolarisation:
-						data = new TimeFrequencyData(_phaseRepresentation, StokesQPolarisation, GetStokesQFromDipole(0, 1));
-						break;
-					case XYPolarisation:
-					case YXPolarisation:
-					case StokesUPolarisation:
-					case StokesVPolarisation:
-					case AutoDipolePolarisation:
-					case CrossDipolePolarisation:
-					case DipolePolarisation:
-					case SinglePolarisation:
-						throw BadUsageException("Requested polarisation type not available in time frequency data");
-				}
-				data->SetGlobalMask(GetMask(polarisation));
-			} else if(_polarisationType == CrossDipolePolarisation && _phaseRepresentation == ComplexRepresentation) {
-				switch(polarisation)
-				{
-					case XYPolarisation:
-						data = new TimeFrequencyData(XYPolarisation, _images[0], _images[1]);
-						data->SetGlobalMask(GetMask(polarisation));
-						break;
-					case YXPolarisation:
-						data = new TimeFrequencyData(YXPolarisation, _images[2], _images[3]);
-						data->SetGlobalMask(GetMask(polarisation));
-						break;
-					case StokesIPolarisation:
-					case StokesQPolarisation:
-					case StokesUPolarisation:
-					case StokesVPolarisation:
-					case XXPolarisation:
-					case YYPolarisation:
-					case AutoDipolePolarisation:
-					case DipolePolarisation:
-					case CrossDipolePolarisation:
-						throw BadUsageException("Trying to create the time frequency data from auto dipole without the requested polarisation(s)"); 
-					case SinglePolarisation:
-						throw BadUsageException("Single polarisation requested from auto dipole polarisation time frequency data: which single polarisation do you want?");
-				}
-			} else if(_polarisationType == CrossDipolePolarisation) {
-				switch(polarisation)
-				{
-					case XYPolarisation:
-						data = new TimeFrequencyData(_phaseRepresentation, XYPolarisation, _images[0]);
-						break;
-					case YXPolarisation:
-						data = new TimeFrequencyData(_phaseRepresentation, YXPolarisation, _images[1]);
-						break;
-					case XXPolarisation:
-					case YYPolarisation:
-					case StokesIPolarisation:
-					case StokesQPolarisation:
-					case StokesUPolarisation:
-					case StokesVPolarisation:
-					case AutoDipolePolarisation:
-					case DipolePolarisation:
-					case SinglePolarisation:
-					case CrossDipolePolarisation:
-						throw BadUsageException("Requested polarisation type not available in time frequency data");
-				}
-				data->SetGlobalMask(GetMask(polarisation));
-			} else if(polarisation == DipolePolarisation) {
-				throw BadUsageException("Requesting time frequency data with dipole polarisation, but not all polarisations are available");
-			} else {
-				throw BadUsageException("Trying to convert the polarization in time frequency data in an invalid way");
-			}
-			return data;
-		}
-
-		Image2DCPtr GetRealPart() const
-		{
-			if(_polarisationType == DipolePolarisation || _polarisationType == AutoDipolePolarisation)
-			{
-				throw BadUsageException("This image contains >1 polarizations; which real part should I return?");
-			} else if(_phaseRepresentation == ComplexRepresentation || _phaseRepresentation == RealPart) {
-				return _images[0];
-			} else {
-				throw BadUsageException("Trying to retrieve real part from time frequency data in which phase doesn't have a complex or real representation");
-			}
-		}
-
-		Image2DCPtr GetImaginaryPart() const
-		{
-			if(_polarisationType == DipolePolarisation)
-			{
-				throw BadUsageException("This image contains 4 polarizations; which imaginary part should I return?");
-			} else if(_phaseRepresentation == ComplexRepresentation) {
-				return _images[1];
-			} else if(_phaseRepresentation == ImaginaryPart) {
-				return _images[0];
-			} else {
-				throw BadUsageException("Trying to retrieve imaginary part from time frequency data in which phase doesn't have a complex or real representation");
-			}
-		}
-
-		bool ContainsData() const
-		{
-			return _containsData;
-		}
-
-		size_t ImageWidth() const
-		{
-			if(!_images.empty())
-				return _images[0]->Width();
-			else
-				return 0;
-		}
-		size_t ImageHeight() const
-		{
-			if(!_images.empty())
-				return _images[0]->Height();
-			else
-				return 0;
-		}
-
-		enum PhaseRepresentation PhaseRepresentation() const
-		{
-			return _phaseRepresentation;
-		}
-
-		enum PolarisationType Polarisation() const
-		{
-			return _polarisationType;
-		}
-
-		void Subtract(const TimeFrequencyData &rhs)
-		{
-			if(rhs._images.size() != _images.size())
-			{
-				std::stringstream s;
-				s << "Can not subtract time-frequency data: they do not have the same number of polarisations or phase representation! ("
-					<< rhs._images.size() << " vs. " << _images.size() << ")";
-				throw BadUsageException(s.str());
-			}
-			for(size_t i=0;i<_images.size();++i)
-			{
-				_images[i] = Image2D::CreateFromDiff(_images[i], rhs._images[i]);
-			}
-		}
-
-		void SubtractAsRHS(const TimeFrequencyData &lhs)
-		{
-			if(lhs._images.size() != _images.size())
-			{
-				std::stringstream s;
-				s << "Can not subtract time-frequency data: they do not have the same number of polarisations or phase representation! ("
-					<< lhs._images.size() << " vs. " << _images.size() << ")";
-				throw BadUsageException(s.str());
-			}
-			for(size_t i=0;i<_images.size();++i)
-			{
-				_images[i] = Image2D::CreateFromDiff(lhs._images[i], _images[i]);
-			}
-		}
-
-		static TimeFrequencyData *CreateTFDataFromDiff(const TimeFrequencyData &lhs, const TimeFrequencyData &rhs)
-		{
-			if(lhs._images.size() != rhs._images.size())
-			{
-				std::stringstream s;
-				s << "Can not subtract time-frequency data: they do not have the same number of polarisations or phase representation! ("
-					<< lhs._images.size() << " vs. " << rhs._images.size() << ")";
-				throw BadUsageException(s.str());
-			}
-			TimeFrequencyData *data = new TimeFrequencyData(lhs);
-			for(size_t i=0;i<lhs._images.size();++i)
-				data->_images[i] = Image2D::CreateFromDiff(lhs._images[i], rhs._images[i]);
-			return data;
-		}
-
-		static TimeFrequencyData *CreateTFDataFromSum(const TimeFrequencyData &lhs, const TimeFrequencyData &rhs)
-		{
-			if(lhs._images.size() != rhs._images.size())
-			{
-				std::stringstream s;
-				s << "Can not add time-frequency data: they do not have the same number of polarisations or phase representation! ("
-					<< lhs._images.size() << " vs. " << rhs._images.size() << ")";
-				throw BadUsageException(s.str());
-			}
-			TimeFrequencyData *data = new TimeFrequencyData(lhs);
-			for(size_t i=0;i<lhs._images.size();++i)
-				data->_images[i] = Image2D::CreateFromSum(lhs._images[i], rhs._images[i]);
-			return data;
-		}
-
-		size_t ImageCount() const { return _images.size(); }
-		size_t MaskCount() const { return _flagging.size(); }
-
-		Image2DCPtr GetImage(size_t imageIndex) const
-		{
-			return _images[imageIndex];
-		}
-		Mask2DCPtr GetMask(size_t maskIndex) const
-		{
-			return _flagging[maskIndex];
-		}
-		void SetImage(size_t imageIndex, const Image2DCPtr &image)
-		{
-			_images[imageIndex] = image;
-		}
-		void SetMask(size_t maskIndex, const Mask2DCPtr &mask)
-		{
-			_flagging[maskIndex] = mask;
-		}
-		void SetMask(const TimeFrequencyData &source)
-		{
-			source.CopyFlaggingTo(this);
-		}
-
-		static TimeFrequencyData *CreateTFDataFromComplexCombination(const TimeFrequencyData &real, const TimeFrequencyData &imaginary);
-
-		static TimeFrequencyData *CreateTFDataFromDipoleCombination(const TimeFrequencyData &xx, const TimeFrequencyData &xy, const TimeFrequencyData &yx, const TimeFrequencyData &yy);
-
-		static TimeFrequencyData *CreateTFDataFromAutoDipoleCombination(const TimeFrequencyData &xx, const TimeFrequencyData &yy);
-
-		static TimeFrequencyData *CreateTFDataFromCrossDipoleCombination(const TimeFrequencyData &xx, const TimeFrequencyData &yy);
-
-		void SetImagesToZero();
-		void MultiplyImages(long double factor);
-		void JoinMask(const TimeFrequencyData &other);
-
-		void Trim(unsigned timeStart, unsigned freqStart, unsigned timeEnd, unsigned freqEnd)
-		{
-			for(std::vector<Image2DCPtr>::iterator i=_images.begin();i!=_images.end();++i)
-				*i = (*i)->Trim(timeStart, freqStart, timeEnd, freqEnd);
-			for(std::vector<Mask2DCPtr>::iterator i=_flagging.begin();i!=_flagging.end();++i)
-				*i = (*i)->Trim(timeStart, freqStart, timeEnd, freqEnd);
-		}
-		static std::string GetPolarisationName(enum PolarisationType polarization)
-		{
-			switch(polarization)
-			{
-				case StokesIPolarisation: return "Stokes I";
-				case StokesQPolarisation: return "Stokes Q";
-				case StokesUPolarisation: return "Stokes U";
-				case StokesVPolarisation: return "Stokes V";
-				case DipolePolarisation: return "All polarizations"; 
-				case AutoDipolePolarisation: return "Combination of XX and YY";
-				case CrossDipolePolarisation: return "Combination of XY and YX";
-				case XXPolarisation: return "XX";
-				case XYPolarisation: return "XY";
-				case YXPolarisation: return "YX";
-				case YYPolarisation: return "YY";
-				case SinglePolarisation: return "Single polarization";
-				default: return "Unknown polarization";
-			}
-		}
-		
-		std::string Description() const
-		{
-			if(_phaseRepresentation == ComplexRepresentation)
-			{
-				return GetPolarisationName(_polarisationType);
-			} else {
-				std::ostringstream s;
-				switch(_phaseRepresentation)
-				{
-					case RealPart: s << "Real component of "; break;
-					case ImaginaryPart: s << "Imaginary component of "; break;
-					case PhasePart: s << "Phase of "; break;
-					case AmplitudePart: s << "Amplitude of "; break;
-					case ComplexRepresentation:
-						break;
-				}
-				s << GetPolarisationName(_polarisationType);
-				return s.str();
-			}
-		}
-		size_t PolarisationCount() const
-		{
-			return PolarisationCount(_polarisationType);
-		}
-		static size_t PolarisationCount(enum PolarisationType type)
-		{
-			switch(type)
-			{
-				case SinglePolarisation:
-				case XXPolarisation:
-				case XYPolarisation:
-				case YXPolarisation:
-				case YYPolarisation:
-				case StokesIPolarisation:
-				case StokesQPolarisation:
-				case StokesUPolarisation:
-				case StokesVPolarisation:
-					return 1;
-				case AutoDipolePolarisation:
-				case CrossDipolePolarisation:
-					return 2;
-				case DipolePolarisation:
-					return 4;
-			}
-			throw BadUsageException("Incorrect polarization");
-		}
-		TimeFrequencyData *CreateTFDataFromPolarisationIndex(size_t index) const
-		{
-			switch(_polarisationType)
-			{
-				case SinglePolarisation:
-				case XXPolarisation:
-				case XYPolarisation:
-				case YXPolarisation:
-				case YYPolarisation:
-				case StokesIPolarisation:
-				case StokesQPolarisation:
-				case StokesUPolarisation:
-				case StokesVPolarisation:
-					if(index == 0)
-						return new TimeFrequencyData(*this);
-					else
-						throw BadUsageException("Index out of bounds in CreateTFDataFromPolarisationIndex(..), one polarisation");
-				case AutoDipolePolarisation:
-					if(index == 0)
-						return CreateTFData(XXPolarisation);
-					else if(index == 1)
-						return CreateTFData(YYPolarisation);
-					else
-						throw BadUsageException("Index out of bounds in CreateTFDataFromPolarisationIndex(..), two polarisations");
-				case CrossDipolePolarisation:
-					if(index == 0)
-						return CreateTFData(XYPolarisation);
-					else if(index == 1)
-						return CreateTFData(YXPolarisation);
-					else
-						throw BadUsageException("Index out of bounds in CreateTFDataFromPolarisationIndex(..), two polarisations");
-				case DipolePolarisation:
-					switch(index)
-					{
-						case 0: return CreateTFData(XXPolarisation);
-						case 1: return CreateTFData(XYPolarisation);
-						case 2: return CreateTFData(YXPolarisation);
-						case 3: return CreateTFData(YYPolarisation);
-						default: throw BadUsageException("Index out of bounds in CreateTFDataFromPolarisationIndex(..), four polarisations");
-					}
-			}
-			throw BadUsageException("Incorrect polarization");
-		}
-		void SetPolarizationData(size_t polarizationIndex, const TimeFrequencyData &data)
-		{
-			if(data.PolarisationCount() != 1)
-				throw BadUsageException("Trying to set multiple polarizations by single polarization index");
-			else if(data.PhaseRepresentation() != PhaseRepresentation())
-				throw BadUsageException("Trying to combine TFData's with different phase representations");
-			else {
-				if(data.PhaseRepresentation() == ComplexRepresentation)
-				{
-					_images[polarizationIndex*2] = data._images[0];
-					_images[polarizationIndex*2+1] = data._images[1];
-				} else {
-					_images[polarizationIndex] = data._images[0];
-				}
-				if(data._flagCoverage != NoFlagCoverage)
-				{
-					if(data._flagging.size() != 1)
-						throw BadUsageException("Input has several flag masks");
-
-					switch(_flagCoverage)
-					{
-						case NoFlagCoverage: {
-							Mask2DCPtr emptyMask = Mask2D::CreateSetMaskPtr<false>(ImageWidth(), ImageHeight());
-							for(size_t i=0;i<PolarisationCount();++i)
-								_flagging.push_back(emptyMask);
-							_flagCoverage = IndividualPolarisationFlagCoverage;
-							} break;
-						case GlobalFlagCoverage: {
-							for(size_t i=0;i<PolarisationCount()-1;++i)
-								_flagging.push_back(_flagging[0]);
-							_flagCoverage = IndividualPolarisationFlagCoverage;
-							} break;
-						case IndividualPolarisationFlagCoverage:
-							break;
-					}
-
-					_flagging[polarizationIndex] = data._flagging[0];
-				}
-			}
-		}
-
-		void SetImageSize(size_t width, size_t height)
-		{
-			for(size_t i=0;i<_images.size();++i)
-				_images[i] = Image2D::CreateUnsetImagePtr(width, height);
-
-			for(size_t i=0;i<_flagging.size();++i)
-				_flagging[i] = Mask2D::CreateUnsetMaskPtr(width, height);
-		}
-
-		void CopyFrom(const TimeFrequencyData &source, size_t destX, size_t destY)
-		{
-			if(source._images.size() != _images.size())
-				throw BadUsageException("CopyFrom: tf data do not match");
-			if(source._flagging.size() != _flagging.size())
-				throw BadUsageException("CopyFrom: tf masks do not match");
-			for(size_t i=0;i<_images.size();++i)
-			{
-				Image2DPtr image = Image2D::CreateCopy(_images[i]);
-				image->CopyFrom(source._images[i], destX, destY);
-				_images[i] = image;
-			}
-			for(size_t i=0;i<_flagging.size();++i)
-			{
-				Mask2DPtr mask = Mask2D::CreateCopy(_flagging[i]);
-				mask->CopyFrom(source._flagging[i], destX, destY);
-				_flagging[i] = mask;
-			}
-		}
-		enum FlagCoverage FlagCoverage() const
-		{
-			return _flagCoverage;
-		}
-		/**
-		 * Will return true when this is the imaginary part of the visibilities. Will throw
-		 * an exception when the data is neither real nor imaginary.
-		 */
-		bool IsImaginary() const
-		{
-			if(PhaseRepresentation() == RealPart)
-				return false;
-			else if(PhaseRepresentation() == ImaginaryPart)
-				return true;
-			else
-				throw std::runtime_error("Data is not real or imaginary");
-		}
-	private:
-		Image2DCPtr GetSingleAbsoluteFromComplex() const
-		{
-			switch(_polarisationType)
-			{
-				case DipolePolarisation:
-					return GetSingleAbsoluteFromComplexDipole();
-				case AutoDipolePolarisation:
-					return GetSingleAbsoluteFromComplexAutoDipole();
-				case CrossDipolePolarisation:
-					return GetSingleAbsoluteFromComplexCrossDipole();
-				case SinglePolarisation:
-				case StokesIPolarisation:
-				case StokesQPolarisation:
-				case StokesUPolarisation:
-				case StokesVPolarisation:
-				case XXPolarisation:
-				case XYPolarisation:
-				case YXPolarisation:
-				case YYPolarisation:
-					return GetAbsoluteFromComplex(0, 1);
-			}
-			throw BadUsageException("Incorrect polarisation type");
-		}
-
-		Image2DCPtr GetSingleImageFromSinglePhaseImage() const
-		{
-			switch(_polarisationType)
-			{
-				case DipolePolarisation:
-					if(_phaseRepresentation == PhasePart)
-						return GetSinglePhaseFromDipolePhase(0, 3);
-					else
-						return GetStokesIFromDipole(0, 3);
-				case AutoDipolePolarisation:
-					if(_phaseRepresentation == PhasePart)
-						return GetSinglePhaseFromDipolePhase(0, 1);
-					else
-						return GetStokesIFromDipole(0, 1);
-				case CrossDipolePolarisation:
-					if(_phaseRepresentation == PhasePart)
-						return GetSinglePhaseFromDipolePhase(0, 1);
-					else
-						return GetStokesIFromDipole(0, 1);
-				case SinglePolarisation:
-				case StokesIPolarisation:
-				case StokesQPolarisation:
-				case StokesUPolarisation:
-				case StokesVPolarisation:
-				case XXPolarisation:
-				case XYPolarisation:
-				case YXPolarisation:
-				case YYPolarisation:
-					return _images[0];
-			}
-			throw BadUsageException("Incorrect polarisation type");
-		}
-
-		Image2DCPtr GetAbsoluteFromComplex(size_t realImage, size_t imagImage) const
-		{
-			return GetAbsoluteFromComplex(_images[realImage], _images[imagImage]);
-		}
-
-		Image2DCPtr GetRealPartFromDipole(enum PolarisationType polarisation) const
-		{
-			switch(polarisation)
-			{
-				case XXPolarisation: return _images[0];
-				case XYPolarisation: return _images[2];
-				case YXPolarisation: return _images[4];
-				case YYPolarisation: return _images[6];
-				default: throw BadUsageException("Could not extract real part for given polarisation");
-			}
-		}
-
-		Image2DCPtr GetRealPartFromAutoDipole(enum PolarisationType polarisation) const
-		{
-			switch(polarisation)
-			{
-				case XXPolarisation: return _images[0];
-				case YYPolarisation: return _images[2];
-				default: throw BadUsageException("Could not extract real part for given polarisation");
-			}
-		}
-
-		Image2DCPtr GetRealPartFromCrossDipole(enum PolarisationType polarisation) const
-		{
-			switch(polarisation)
-			{
-				case XYPolarisation: return _images[0];
-				case YXPolarisation: return _images[2];
-				default: throw BadUsageException("Could not extract real part for given polarisation");
-			}
-		}
-
-		Image2DCPtr GetImaginaryPartFromDipole(enum PolarisationType polarisation) const
-		{
-			switch(polarisation)
-			{
-				case XXPolarisation: return _images[1];
-				case XYPolarisation: return _images[3];
-				case YXPolarisation: return _images[5];
-				case YYPolarisation: return _images[7];
-				default: throw BadUsageException("Could not extract imaginary part for given polarisation");
-			}
-		}
-
-		Image2DCPtr GetImaginaryPartFromAutoDipole(enum PolarisationType polarisation) const
-		{
-			switch(polarisation)
-			{
-				case XXPolarisation: return _images[1];
-				case YYPolarisation: return _images[3];
-				default: throw BadUsageException("Could not extract imaginary part for given polarisation");
-			}
-		}
-
-		Image2DCPtr GetImaginaryPartFromCrossDipole(enum PolarisationType polarisation) const
-		{
-			switch(polarisation)
-			{
-				case XYPolarisation: return _images[1];
-				case YXPolarisation: return _images[3];
-				default: throw BadUsageException("Could not extract imaginary part for given polarisation");
-			}
-		}
-
-		Image2DCPtr GetAmplitudePartFromDipole(enum PolarisationType polarisation) const
-		{
-			switch(polarisation)
-			{
-				case XXPolarisation: return GetAbsoluteFromComplex(0, 1);
-				case XYPolarisation: return GetAbsoluteFromComplex(2, 3);
-				case YXPolarisation: return GetAbsoluteFromComplex(4, 5);
-				case YYPolarisation: return GetAbsoluteFromComplex(6, 7);
-				default: throw BadUsageException("Could not extract amplitude part for given polarisation");
-			}
-		}
-
-		Image2DCPtr GetAmplitudePartFromAutoDipole(enum PolarisationType polarisation) const
-		{
-			switch(polarisation)
-			{
-				case XXPolarisation: return GetAbsoluteFromComplex(0, 1);
-				case YYPolarisation: return GetAbsoluteFromComplex(2, 3);
-				default: throw BadUsageException("Could not extract amplitude part for given polarisation");
-			}
-		}
-
-		Image2DCPtr GetAmplitudePartFromCrossDipole(enum PolarisationType polarisation) const
-		{
-			switch(polarisation)
-			{
-				case XYPolarisation: return GetAbsoluteFromComplex(0, 1);
-				case YXPolarisation: return GetAbsoluteFromComplex(2, 3);
-				default: throw BadUsageException("Could not extract amplitude part for given polarisation");
-			}
-		}
-
-		Image2DCPtr GetPhasePartFromDipole(enum PolarisationType polarisation) const
-		{
-			switch(polarisation)
-			{
-				case XXPolarisation: return GetPhaseFromComplex(_images[0], _images[1]);
-				case XYPolarisation: return GetPhaseFromComplex(_images[2], _images[3]);
-				case YXPolarisation: return GetPhaseFromComplex(_images[4], _images[5]);
-				case YYPolarisation: return GetPhaseFromComplex(_images[6], _images[7]);
-				default: throw BadUsageException("Could not extract phase part for given polarisation");
-			}
-		}
-
-		Image2DCPtr GetPhasePartFromAutoDipole(enum PolarisationType polarisation) const
-		{
-			switch(polarisation)
-			{
-				case XXPolarisation: return GetPhaseFromComplex(_images[0], _images[1]);
-				case YYPolarisation: return GetPhaseFromComplex(_images[2], _images[3]);
-				default: throw BadUsageException("Could not extract phase part for given polarisation");
-			}
-		}
-
-		Image2DCPtr GetPhasePartFromCrossDipole(enum PolarisationType polarisation) const
-		{
-			switch(polarisation)
-			{
-				case XYPolarisation: return GetPhaseFromComplex(_images[0], _images[1]);
-				case YXPolarisation: return GetPhaseFromComplex(_images[2], _images[3]);
-				default: throw BadUsageException("Could not extract phase part for given polarisation");
-			}
-		}
-
-		void CopyFlaggingTo(TimeFrequencyData *data) const
-		{
-			if(_flagCoverage == NoFlagCoverage)
-				data->SetNoMask();
-			else if(_flagCoverage == GlobalFlagCoverage || PolarisationCount()==1)
-				data->SetGlobalMask(_flagging[0]);
-			else if(_flagCoverage == IndividualPolarisationFlagCoverage)
-			{
-				if(Polarisation() == DipolePolarisation && data->Polarisation() == DipolePolarisation)
-					data->SetIndividualPolarisationMasks(_flagging[0], _flagging[1], _flagging[2], _flagging[3]);
-				else if((Polarisation()==AutoDipolePolarisation && data->Polarisation() == AutoDipolePolarisation)
-					|| (Polarisation()==CrossDipolePolarisation && data->Polarisation() == CrossDipolePolarisation))
-					data->SetIndividualPolarisationMasks(_flagging[0], _flagging[1]);
-				else
-					throw BadUsageException("Trying to copy flagging from dipole time frequency data to single polarisation time frequency data");
-			}
-			else
-				throw BadUsageException("Invalid flag coverage in CopyFlaggingTo()");
-		}
-		
-		Image2DCPtr GetSingleAbsoluteFromComplexDipole() const
-		{
-			Image2DCPtr real = GetSum(_images[0], _images[6]);
-			Image2DCPtr imag = GetSum(_images[1], _images[7]);
-			return GetAbsoluteFromComplex(real, imag);
-		}
-
-		Image2DCPtr GetSingleAbsoluteFromComplexAutoDipole() const
-		{
-			Image2DCPtr real = GetSum(_images[0], _images[2]);
-			Image2DCPtr imag = GetSum(_images[1], _images[3]);
-			return GetAbsoluteFromComplex(real, imag);
-		}
-
-		Image2DCPtr GetSingleAbsoluteFromComplexCrossDipole() const
-		{
-			Image2DCPtr real = GetSum(_images[0], _images[2]);
-			Image2DCPtr imag = GetSum(_images[1], _images[3]);
-			return GetAbsoluteFromComplex(real, imag);
-		}
-
-		Image2DCPtr GetStokesIFromDipole(size_t xx, size_t yy) const
-		{
-			return GetSum(_images[xx], _images[yy]);
-		}
-		Image2DCPtr GetStokesQFromDipole(size_t xx, size_t yy) const
-		{
-			return GetDifference(_images[xx], _images[yy]);
-		}
-		Image2DCPtr GetStokesUFromDipole(size_t xy, size_t yx) const
-		{
-			return GetSum(_images[xy], _images[yx]);
-		}
-		Image2DCPtr GetRealStokesVFromDipole(size_t xyImaginary, size_t yxReal) const
-		{
-			return GetNegatedSum(_images[xyImaginary], _images[yxReal]);
-		}
-		Image2DCPtr GetImaginaryStokesVFromDipole(size_t xyReal, size_t yxImaginary) const
-		{
-			return GetDifference(_images[xyReal], _images[yxImaginary]);
-		}
-
-		Image2DCPtr GetAbsoluteFromComplex(const Image2DCPtr &real, const Image2DCPtr &imag) const;
-		Image2DCPtr GetPhaseFromComplex(const Image2DCPtr &real, const Image2DCPtr &imag) const;
-
-		Image2DCPtr GetSum(const Image2DCPtr &left, const Image2DCPtr &right) const;
-		Image2DCPtr GetNegatedSum(const Image2DCPtr &left, const Image2DCPtr &right) const;
-		Image2DCPtr GetDifference(const Image2DCPtr &left, const Image2DCPtr &right) const;
-
-		Image2DCPtr GetSinglePhaseFromDipolePhase(size_t xx, size_t yy) const;
-		Image2DCPtr GetZeroImage() const;
-		template<bool InitValue>
-		Mask2DCPtr GetSetMask() const
-		{
-			if(_images.size() == 0)
-				throw BadUsageException("Can't make a mask without an image");
-			return Mask2D::CreateSetMaskPtr<InitValue>(_images[0]->Width(), _images[0]->Height());
-		}
-		Mask2DCPtr GetCombinedMask() const;
-
-		TimeFrequencyData *CreateTFDataFromSingleComplex(enum PhaseRepresentation phase) const;
-		TimeFrequencyData *CreateTFDataFromDipoleComplex(enum PhaseRepresentation phase) const;
-		TimeFrequencyData *CreateTFDataFromAutoDipoleComplex(enum PhaseRepresentation phase) const;
-		TimeFrequencyData *CreateTFDataFromCrossDipoleComplex(enum PhaseRepresentation phase) const;
-
-		bool _containsData;
-		
-		enum PhaseRepresentation _phaseRepresentation;
-		enum PolarisationType _polarisationType;
-		enum FlagCoverage _flagCoverage;
-
-		// The images that are referenced from this object
-		// From least significant to most significant index contribution:
-		// phase, polarisation
-		std::vector<Image2DCPtr> _images;
-		std::vector<Mask2DCPtr> _flagging;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/msio/timefrequencyimager.h b/CEP/DP3/AOFlagger/include/AOFlagger/msio/timefrequencyimager.h
deleted file mode 100644
index 9b868367863bf2385c1d8b341ae655219332f709..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/msio/timefrequencyimager.h
+++ /dev/null
@@ -1,129 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef TIMEFREQUENCYIMAGER_H
-#define TIMEFREQUENCYIMAGER_H
-
-#include <map>
-
-#include "image2d.h"
-#include "mask2d.h"
-#include "measurementset.h"
-#include "antennainfo.h"
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class TimeFrequencyImager {
-	public:
-		explicit TimeFrequencyImager(MeasurementSet &measurementSet);
-		~TimeFrequencyImager();
-		void Image(size_t antenna1Select, size_t antenna2Select, size_t spectralWindowSelect);
-		void Image(size_t antenna1Select, size_t antenna2Select, size_t spectralWindowSelect, size_t startIndex, size_t endIndex);
-
-		Image2DCPtr RealXX() const { return _realXX; }
-		Image2DCPtr ImaginaryXX() const { return _imaginaryXX; }
-		Image2DCPtr RealXY() const { return _realXY; }
-		Image2DCPtr ImaginaryXY() const { return _imaginaryXY; }
-		Image2DCPtr RealYX() const { return _realYX; }
-		Image2DCPtr ImaginaryYX() const { return _imaginaryYX; }
-		Image2DCPtr RealYY() const { return _realYY; }
-		Image2DCPtr ImaginaryYY() const { return _imaginaryYY; }
-
-		Mask2DCPtr FlagXX() const { return _flagXX; }
-		Mask2DCPtr FlagXY() const { return _flagXY; }
-		Mask2DCPtr FlagYX() const { return _flagYX; }
-		Mask2DCPtr FlagYY() const { return _flagYY; }
-		Mask2DCPtr FlagStokesI() const { return _flagCombined; }
-
-		bool HasData() const { return _realXX != 0; }
-		bool HasFlags() const { return _flagXX != 0; }
-		void SetReadFlags(bool readFlags) { _readFlags = readFlags; }
-		void SetReadData(bool readData) { _readData = readData; }
-		void SetReadStokesI(bool readStokesI) { _readStokesI = readStokesI; }
-		void SetReadIndividualPolarisations(bool readPolarisations) throw()
-		{
-			_readXX = readPolarisations;
-			_readXY = readPolarisations;
-			_readYX = readPolarisations;
-			_readYY = readPolarisations;
-		}
-		void SetReadXX(bool readXX) { _readXX = readXX; }
-		void SetReadXY(bool readXY) { _readXY = readXY; }
-		void SetReadYX(bool readYX) { _readYX = readYX; }
-		void SetReadYY(bool readYY) { _readYY = readYY; }
-
-		void WriteNewFlags(Mask2DCPtr newXX, Mask2DCPtr newXY, Mask2DCPtr newYX, Mask2DCPtr newYY);
-		void WriteNewFlags(Mask2DCPtr newXX, Mask2DCPtr newXY, Mask2DCPtr newYX, Mask2DCPtr newYY, int antenna1, int antenna2, int spectralWindow);
-		void WriteNewFlagsPart(Mask2DCPtr newXX, Mask2DCPtr newXY, Mask2DCPtr newYX, Mask2DCPtr newYY, int antenna1, int antenna2, int spectralWindow, size_t timeOffset, size_t timeEnd, size_t leftBorder=0, size_t rightBorder=0);
-		void SetDataKind(enum DataKind kind) { _dataKind = kind; }
-
-		const class BandInfo &BandInfo() const { return _bandInfo; }
-
-		size_t Antenna1() const { return _antenna1Select; }
-		size_t Antenna2() const { return _antenna2Select; }
-		size_t SpectralWindow() const { return _spectralWindowSelect; }
-
-		class TimeFrequencyData GetData() const;
-		static void PartInfo(const std::string &msFile, size_t maxTimeScans, size_t &timeScanCount, size_t &partCount);
-		const std::vector<class UVW> &UVW() const { return _uvw; }
-		void ClearImages();
-	private:
-		void initializePolarizations();
-		void checkPolarizations();
-		void image(size_t antenna1Select, size_t antenna2Select, size_t spectralWindowSelect, size_t startIndex, size_t endIndex);
-
-		static void setObservationTimes(MeasurementSet &set, std::map<double,size_t> &observationTimes);
-		void readUVWData();
-
-		casa::ROArrayColumn<casa::Complex> *CreateDataColumn(DataKind kind, class casa::Table &table);
-		void ReadTimeData(size_t xOffset, int frequencyCount, const casa::Array<casa::Complex> data, const casa::Array<casa::Complex> *model);
-		void ReadTimeFlags(size_t xOffset, int frequencyCount, const casa::Array<bool> flag);
-		void ReadWeights(size_t xOffset, int frequencyCount, const casa::Array<float> weight);
-
-		Image2DPtr _realXX, _imaginaryXX;
-		Image2DPtr _realXY, _imaginaryXY;
-		Image2DPtr _realYX, _imaginaryYX;
-		Image2DPtr _realYY, _imaginaryYY;
-
-		Image2DPtr _realStokesI, _imaginaryStokesI;
-
-		Mask2DPtr _flagXX;
-		Mask2DPtr _flagXY;
-		Mask2DPtr _flagYX;
-		Mask2DPtr _flagYY;
-		Mask2DPtr _flagCombined;
-
-		bool _readData, _readFlags;
-
-		bool _readXX, _readXY, _readYX, _readYY, _readStokesI, _readStokesIDirectly;
-		int _xxIndex, _xyIndex, _yxIndex, _yyIndex, _stokesIIndex;
-
-		class MeasurementSet *_measurementSet;
-		size_t _antenna1Select;
-		size_t _antenna2Select;
-		size_t _spectralWindowSelect;
-		enum DataKind _dataKind;
-		class BandInfo _bandInfo;
-		std::map<double,size_t> _observationTimes;
-		std::vector<class UVW> _uvw;
-		casa::Table *_sortedTable;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/msio/timefrequencymetadata.h b/CEP/DP3/AOFlagger/include/AOFlagger/msio/timefrequencymetadata.h
deleted file mode 100644
index 3b7a763a0e195ff1d7cf441cda6ecb773589a8e1..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/msio/timefrequencymetadata.h
+++ /dev/null
@@ -1,208 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#ifndef MSIO_TIME_FREQUENCY_META_DATA_H
-#define MSIO_TIME_FREQUENCY_META_DATA_H
-
-#include <string>
-#include <vector>
-
-#include <boost/shared_ptr.hpp>
-
-#include "antennainfo.h"
-
-typedef boost::shared_ptr<class TimeFrequencyMetaData> TimeFrequencyMetaDataPtr;
-typedef boost::shared_ptr<const class TimeFrequencyMetaData> TimeFrequencyMetaDataCPtr;
-
-class TimeFrequencyMetaData
-{
-	public:
-		TimeFrequencyMetaData()
-			: _antenna1(0), _antenna2(0), _band(0), _field(0), _observationTimes(0), _uvw(0), _dataDescription("Visibility"), _dataUnits("Jy")
-		{
-		}
-		TimeFrequencyMetaData(const AntennaInfo &antenna1, const AntennaInfo &antenna2, const BandInfo &band, const FieldInfo &field, const std::vector<double> &observationTimes)
-		:
-			_antenna1(new AntennaInfo(antenna1)),
-			_antenna2(new AntennaInfo(antenna2)),
-			_band(new BandInfo(band)),
-			_field(new FieldInfo(field)),
-			_observationTimes(new std::vector<double>(observationTimes)),
-			_uvw(0),
-			_dataDescription("Visibility"),
-			_dataUnits("Jy")
-		{
-		}
-		TimeFrequencyMetaData(const TimeFrequencyMetaData &source)
-			: _antenna1(0), _antenna2(0), _band(0), _field(0), _observationTimes(0), _uvw(0),
-			_dataDescription(source._dataDescription),
-			_dataUnits(source._dataUnits)
-		{
-			if(source._antenna1 != 0)
-				_antenna1 = new AntennaInfo(*source._antenna1);
-			if(source._antenna2 != 0)
-				_antenna2 = new AntennaInfo(*source._antenna2);
-			if(source._band != 0)
-				_band = new BandInfo(*source._band);
-			if(source._field != 0)
-				_field = new FieldInfo(*source._field);
-			if(source._observationTimes != 0)
-				_observationTimes = new std::vector<double>(*source._observationTimes);
-			if(source._uvw != 0)
-				_uvw = new std::vector<class UVW>(*source._uvw);
-		}
-		~TimeFrequencyMetaData()
-		{
-			ClearAntenna1();
-			ClearAntenna2();
-			ClearBand();
-			ClearField();
-			ClearObservationTimes();
-			ClearUVW();
-		}
-
-		const AntennaInfo &Antenna1() const { return *_antenna1; }
-		void ClearAntenna1()
-		{
-			if(_antenna1 != 0)
-			{
-				delete _antenna1;
-				_antenna1 = 0;
-			}
-		}
-		void SetAntenna1(const AntennaInfo &antenna1)
-		{
-			ClearAntenna1();
-			_antenna1 = new AntennaInfo(antenna1);
-		}
-		bool HasAntenna1() const { return _antenna1 != 0; }
-
-		const AntennaInfo &Antenna2() const { return *_antenna2; }
-		void ClearAntenna2()
-		{
-			if(_antenna2 != 0)
-			{
-				delete _antenna2;
-				_antenna2 = 0;
-			}
-		}
-		void SetAntenna2(const AntennaInfo &antenna2)
-		{
-			ClearAntenna2();
-			_antenna2 = new AntennaInfo(antenna2);
-		}
-		bool HasAntenna2() const { return _antenna2 != 0; }
-
-		const BandInfo &Band() const { return *_band; }
-		void ClearBand()
-		{
-			if(_band != 0)
-			{
-				delete _band;
-				_band = 0;
-			}
-		}
-		void SetBand(const BandInfo &band)
-		{
-			ClearBand();
-			_band = new BandInfo(band);
-		}
-		bool HasBand() const { return _band != 0; }
-
-		const FieldInfo &Field() const { return *_field; }
-		void ClearField()
-		{
-			if(_field != 0)
-			{
-				delete _field;
-				_field = 0;
-			}
-		}
-		void SetField(const FieldInfo &field)
-		{
-			ClearField();
-			_field = new FieldInfo(field);
-		}
-		bool HasField() const { return _field != 0; }
-
-		const std::vector<double> &ObservationTimes() const {
-			return *_observationTimes;
-		}
-		void ClearObservationTimes()
-		{
-			if(_observationTimes != 0)
-			{
-				delete _observationTimes;
-				_observationTimes = 0;
-			}
-		}
-		void SetObservationTimes(const std::vector<double> &times)
-		{
-			ClearObservationTimes();
-			_observationTimes = new std::vector<double>(times);
-		}
-		bool HasObservationTimes() const { return _observationTimes != 0; }
-
-		const std::vector<class UVW> &UVW() const { return *_uvw; }
-		void ClearUVW()
-		{
-			if(_uvw != 0)
-			{
-				delete _uvw;
-				_uvw = 0;
-			}
-		}
-		void SetUVW(const std::vector<class UVW> &uvw)
-		{
-			ClearUVW();
-			_uvw = new std::vector<class UVW>(uvw);
-		}
-		bool HasUVW() const { return _uvw != 0; }
-
-		bool HasBaseline() const {
-			return HasAntenna1() && HasAntenna2();
-		}
-		class Baseline Baseline() const {
-			return ::Baseline(*_antenna1, *_antenna2);
-		}
-		const std::string &DataDescription() const { return _dataDescription; }
-		void SetDataDescription(const std::string &dataDescription)
-		{
-			_dataDescription = dataDescription;
-		}
-		
-		const std::string &DataUnits() const { return _dataUnits; }
-		void SetDataUnits(const std::string &dataUnits)
-		{
-			_dataUnits = dataUnits;
-		}
-	private:
-		void operator=(const TimeFrequencyMetaData &) { }
-		
-		AntennaInfo *_antenna1;
-		AntennaInfo *_antenna2;
-		BandInfo *_band;
-		FieldInfo *_field;
-		std::vector<double> *_observationTimes;
-		std::vector<class UVW> *_uvw;
-		std::string _dataDescription, _dataUnits;
-};
-
-#endif // MSIO_TIME_FREQUENCY_META_DATA_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/msio/timestepaccessor.h b/CEP/DP3/AOFlagger/include/AOFlagger/msio/timestepaccessor.h
deleted file mode 100644
index 2b6181868856df43ab1ed59199c8727445e3447f..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/msio/timestepaccessor.h
+++ /dev/null
@@ -1,265 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2011 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#ifndef MSIO_TIMESTEP_ACCESSOR_H
-#define MSIO_TIMESTEP_ACCESSOR_H
-
-#include <stdexcept>
-#include <vector>
-
-#include <ms/MeasurementSets/MSTable.h>
-#include <ms/MeasurementSets/MSColumns.h>
-
-#include <tables/Tables/TableIter.h>
-
-#include <AOFlagger/msio/types.h>
-
-class TimestepAccessorException : public std::runtime_error
-{
-	public: TimestepAccessorException(const std::string &str) : std::runtime_error(str) { }
-};
-
-class TimestepAccessor
-{
-	public:
-		class TimestepIndex
-		{
-			public:
-				TimestepIndex()
-				{
-				}
-				~TimestepIndex()
-				{
-				}
-				unsigned long row;
-			private:
-				TimestepIndex(TimestepIndex &) { }
-				void operator=(TimestepIndex &) { }
-		};
-		struct TimestepData
-		{
-			num_t **realData, **imagData;
-			unsigned antenna1, antenna2;
-			double u,v;
-			double timestep;
-
-			void Allocate(unsigned polarizationCount, unsigned channelCount)
-			{
-				realData = new num_t*[polarizationCount];
-				imagData = new num_t*[polarizationCount];
-				for(unsigned p=0;p<polarizationCount;++p)
-				{
-					realData[p] = new num_t[channelCount];
-					imagData[p] = new num_t[channelCount];
-				}
-			}
-			void Free(unsigned polarizationCount)
-			{
-				for(unsigned p=0;p<polarizationCount;++p)
-				{
-					delete[] realData[p];
-					delete[] imagData[p];
-				}
-				delete[] realData;
-				delete[] imagData;
-			}
-			void CopyTo(TimestepData &dest, unsigned polarizationCount, unsigned channelCount) const
-			{
-				for(unsigned p=0;p<polarizationCount;++p)
-				{
-					for(unsigned c=0;c<channelCount;++c)
-					{
-						dest.realData[p][c] = realData[p][c];
-						dest.imagData[p][c] = imagData[p][c];
-					}
-				}
-				dest.antenna1 = antenna1;
-				dest.antenna2 = antenna2;
-				dest.u = u;
-				dest.v = v;
-				dest.timestep = timestep;
-			}
-		};
-
-		TimestepAccessor(bool performLocking=true) : _isOpen(false), _polarizationCount(0), _totalChannelCount(0), _startRow(0), _endRow(0), _performLocking(performLocking), _writeActionCount(0), _columnName("DATA")
-		{
-		}
-
-		~TimestepAccessor()
-		{
-			if(_isOpen)
-				Close();
-		}
-
-		void Open();
-
-		void Close();
-
-		void AddMS(const std::string &path)
-		{
-			assertNotOpen();
-			SetInfo newInfo(_sets.size());
-			newInfo.path = path;
-			_sets.push_back(newInfo);
-		}
-
-		unsigned TotalChannelCount() const
-		{
-			assertOpen();
-			return _totalChannelCount;
-		}
-
-		unsigned TotalRowCount() const
-		{
-			assertOpen();
-			return _totalRowCount;
-		}
-
-		void SetStartRow(unsigned long startRow)
-		{
-			assertOpen();
-			_currentRow = startRow;
-			_startRow = startRow;
-		}
-
-		void SetEndRow(unsigned long endRow)
-		{
-			assertOpen();
-			if(endRow < _totalRowCount)
-				_endRow = endRow;
-			else
-				_endRow = _totalRowCount;
-		}
-
-		unsigned PolarizationCount() const
-		{
-			assertOpen();
-			return _polarizationCount;
-		}
-
-		double LowestFrequency() const
-		{
-			assertOpen();
-			return _lowestFrequency;
-		}
-
-		double HighestFrequency() const
-		{
-			assertOpen();
-			return _highestFrequency;
-		}
-
-		unsigned TableCount() const
-		{
-			return _sets.size();
-		}
-		
-		bool ReadNext(TimestepIndex &index, TimestepData &data);
-
-		void Write(TimestepIndex &index, const TimestepData &data);
-		
-		unsigned long WriteActionCount() const { return _writeActionCount; }
-
-		void SetColumnName(const std::string columnName)
-		{
-			assertNotOpen();
-			_columnName = columnName;
-		}
-
-	private:
-		struct SetInfo
-		{
-			SetInfo(unsigned index_) : index(index_), table(0)
-			{
-			}
-			SetInfo(const SetInfo &source) :
-				index(source.index),
-				path(source.path),
-				table(source.table),
-				bandCount(source.bandCount),
-				channelsPerBand(source.channelsPerBand),
-				highestFrequency(source.highestFrequency),
-				lowestFrequency(source.lowestFrequency)
-			{
-			}
-			void operator=(const SetInfo &source)
-			{
-				index = source.index;
-				path = source.path;
-				table = source.table;
-				bandCount = source.bandCount;
-				channelsPerBand = source.channelsPerBand;
-				highestFrequency = source.highestFrequency;
-				lowestFrequency = source.lowestFrequency;
-			}
-			unsigned index;
-			std::string path;
-			casa::Table *table;
-			unsigned bandCount, channelsPerBand;
-			double highestFrequency, lowestFrequency;
-			casa::ROScalarColumn<int> *antenna1Column, *antenna2Column;
-			casa::ROScalarColumn<double> *timeColumn;
-			casa::ROArrayColumn<casa::Complex> *dataColumn;
-			casa::ArrayColumn<casa::Complex> *updateDataColumn;
-			casa::ROArrayColumn<double> *uvwColumn;
-		};
-		struct BufferItem
-		{
-			unsigned row;
-			TimestepData data;
-		};
-
-		typedef std::vector<SetInfo> SetInfoVector;
-
-		bool _isOpen;
-		unsigned _polarizationCount, _totalChannelCount;
-		SetInfoVector _sets;
-		double _highestFrequency, _lowestFrequency;
-		unsigned long _totalRowCount, _currentRow;
-		unsigned long _startRow, _endRow;
-		BufferItem *_readBuffer, *_writeBuffer;
-		unsigned _bufferSize;
-		unsigned _inReadBuffer, _readBufferPtr;
-		unsigned _inWriteBuffer;
-		bool _performLocking;
-		
-		unsigned long _writeActionCount;
-		std::string _columnName;
-
-		void assertOpen() const
-		{
-			if(!_isOpen)
-				throw TimestepAccessorException("Timestep accessor has not been opened yet");
-		}
-		void assertNotOpen() const
-		{
-			if(_isOpen)
-				throw TimestepAccessorException("Timestep accessor has already been opened");
-		}
-		void lock(unsigned setIndex);
-		void unlock(unsigned setIndex);
-		
-		bool fillReadBuffer();
-		void emptyWriteBuffer();
-		void openSet(SetInfo &set, bool update=false);
-		void closeSet(SetInfo &set);
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/msio/types.h b/CEP/DP3/AOFlagger/include/AOFlagger/msio/types.h
deleted file mode 100644
index f64495f77dcfa1b858d1eaae3825df96c06fa316..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/msio/types.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#ifndef MSIO_TYPES
-#define MSIO_TYPES
-
-class AntennaInfo;
-class BandInfo;
-class FieldInfo;
-class TimeFrequencyData;
-class TimeFrequencyImager;
-class FitsFile;
-
-#define NUM_T_IS_FLOAT
-
-#ifdef NUM_T_IS_FLOAT
-typedef float num_t;
-
-#define sqrtn(X) sqrtf(X)
-#define expn(X) expf(X)
-#define logn(X) logf(X)
-#define sinn(X) sinf(X)
-#define asinn(X) asinf(X)
-#define cosn(X) cosf(X)
-#define acosn(X) acosf(X)
-#define tann(X) tanf(X)
-#define atann(X) atanf(X)
-#define atan2n(X, Y) atan2(X, Y)
-#define fabsn(X) fabsf(X)
-#define floorn(X) floorf(X)
-#define ceiln(X) ceilf(X)
-#define roundn(X) roundf(X)
-#define pown(X, Y) powf(X, Y)
-#define fmodn(X, Y) fmodf(X, Y)
-#define M_PIn M_PI
-
-#else // NOT NUM_T_IS_FLOAT
-
-typedef double num_t;
-
-#define sqrtn(X) sqrt(X)
-#define expn(X) exp(X)
-#define logn(X) log(X)
-#define sinn(X) sin(X)
-#define asinn(X) asin(X)
-#define cosn(X) cos(X)
-#define acosn(X) acos(X)
-#define tann(X) tan(X)
-#define atann(X) atan(X)
-#define atan2n(X, Y) atan2(X, Y)
-#define fabsn(X) fabs(X)
-#define floorn(X) floor(X)
-#define ceiln(X) ceil(X)
-#define roundn(X) round(X)
-#define pown(X, Y) pow(X, Y)
-#define fmodn(X, Y) fmod(X, Y)
-#define M_PIn M_PI
-
-#endif
-
-// numl_t is the numeric type for high precision, intermediate calculations
-typedef long double numl_t;
-
-#define sqrtnl(X) sqrtl(X)
-#define expnl(X) expl(X)
-#define lognl(X) logl(X)
-#define sinnl(X) sinl(X)
-#define asinnl(X) asinl(X)
-#define cosnl(X) cosl(X)
-#define tannl(X) tanl(X)
-#define atannl(X) atanl(X)
-#define atan2nl(X, Y) atan2l(X, Y)
-#define fabsnl(X) fabsl(X)
-#define floornl(X) floorl(X)
-#define ceilnl(X) ceill(X)
-#define roundnl(X) roundl(X)
-#define pownl(X, Y) powl(X, Y)
-#define fmodnl(X, Y) fmodl(X, Y)
-// M_PIl is not defined on some OS-X systems
-#ifndef M_PIl
-# define M_PIl          3.1415926535897932384626433832795029L  /* pi */
-#endif
-#define M_PInl M_PIl
-
-enum DataKind { ObservedData, CorrectedData, ResidualData, ModelData, WeightData };
-
-enum PolarisationType { SinglePolarisation, DipolePolarisation, AutoDipolePolarisation, CrossDipolePolarisation, StokesIPolarisation, StokesQPolarisation, StokesUPolarisation, StokesVPolarisation, XXPolarisation, XYPolarisation, YXPolarisation, YYPolarisation };
-
-class ParmTable;
-
-enum BaselineIOMode { DirectReadMode, IndirectReadMode, MemoryReadMode, AutoReadMode };
-
-#endif // MSIO_TYPES
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/msio/xyswappedmask2d.h b/CEP/DP3/AOFlagger/include/AOFlagger/msio/xyswappedmask2d.h
deleted file mode 100644
index 28a24f29700106d51039442cd6d1792abc3cfc55..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/msio/xyswappedmask2d.h
+++ /dev/null
@@ -1,53 +0,0 @@
-#ifndef XYSWAPPEDMASK2D_H
-#define XYSWAPPEDMASK2D_H
-
-#include <boost/shared_ptr.hpp>
-
-#include "mask2d.h"
-
-/**
- * This class wraps a mask and swappes the x and y axes. It provides only the
- * trivial @ref Mask2D functions, and swappes x and y in there, such that the original
- * width becomes the new height, etc. It is useful to convert an algorithm
- * that works originally only in one direction to work in the other direction
- * without rewriting it. If a template parameter is used, the overhead should
- * be negligable.
- * 
- * Note that this method uses references to the original mask. However, masks
- * are normally wrapped in a smart pointer. The caller should make sure the
- * mask exists as long as the XYSwappedMask2D exists.
- * 
- * @author Andre Offringa
- */
-class XYSwappedMask2D
-{
-	public:
-		inline XYSwappedMask2D(Mask2D &mask) : _mask(mask)
-		{
-		}
-		
-		inline bool Value(unsigned x, unsigned y) const
-		{
-			return _mask.Value(y, x);
-		}
-		
-		inline void SetValue(unsigned x, unsigned y, bool newValue)
-		{
-			_mask.SetValue(y, x, newValue);
-		}
-		
-		inline unsigned Width() const
-		{
-			return _mask.Height();
-		}
-		
-		inline unsigned Height() const
-		{
-			return _mask.Width();
-		}
-		
-	private:
-		Mask2D &_mask;
-};
-
-#endif // XYSWAPPEDMASK2D_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/quality/baselinestatisticsmap.h b/CEP/DP3/AOFlagger/include/AOFlagger/quality/baselinestatisticsmap.h
deleted file mode 100644
index b4839453d27ec98a44cdb29b3762579d5870c104..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/quality/baselinestatisticsmap.h
+++ /dev/null
@@ -1,216 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef BASELINESTATISTICSMAP_H
-#define BASELINESTATISTICSMAP_H
-
-#include <vector>
-#include <map>
-#include <stdexcept>
-
-#include <AOFlagger/util/serializable.h>
-
-#include "defaultstatistics.h"
-
-class BaselineStatisticsMap : public Serializable
-{
-	public:
-		BaselineStatisticsMap(unsigned polarizationCount) : _polarizationCount(polarizationCount)
-		{
-		}
-		
-		BaselineStatisticsMap(const BaselineStatisticsMap &source) :
-			_map(source._map),
-			_polarizationCount(source._polarizationCount)
-		{
-		}
-		
-		void operator+=(const BaselineStatisticsMap &other)
-		{
-			for(OuterMap::const_iterator i=other._map.begin();i!=other._map.end();++i)
-			{
-				unsigned antenna1 = i->first;
-				const InnerMap &innerMap = i->second;
-				for(InnerMap::const_iterator j=innerMap.begin();j!=innerMap.end();++j)
-				{
-					unsigned antenna2 = j->first;
-					const DefaultStatistics &stat = j->second;
-					GetStatistics(antenna1, antenna2) += stat;
-				}
-			}
-		}
-		
-		DefaultStatistics &GetStatistics(unsigned antenna1, unsigned antenna2)
-		{
-			OuterMap::iterator antenna1Map = _map.insert(OuterPair(antenna1, InnerMap())).first;
-			InnerMap &innerMap = antenna1Map->second;
-			InnerMap::iterator antenna2Value = innerMap.find(antenna2);
-			DefaultStatistics *statistics;
-			if(antenna2Value == innerMap.end())
-			{
-				// The baseline does not exist yet, create empty statistics.
-				statistics = &(innerMap.insert(InnerPair(antenna2, DefaultStatistics(_polarizationCount))).first->second);
-			} else {
-				statistics = &antenna2Value->second;
-			}
-			return *statistics;
-		}
-		
-		const DefaultStatistics &GetStatistics(unsigned antenna1, unsigned antenna2) const
-		{
-			OuterMap::const_iterator antenna1Map = _map.find(antenna1);
-			if(antenna1Map == _map.end())
-			{
-				throw std::runtime_error("BaselineStatisticsMap::GetStatistics() : Requested unavailable baseline");
-			} else {
-				const InnerMap &innerMap = antenna1Map->second;
-				InnerMap::const_iterator antenna2Value = innerMap.find(antenna2);
-				if(antenna2Value == innerMap.end())
-				{
-					throw std::runtime_error("BaselineStatisticsMap::GetStatistics() : Requested unavailable baseline");
-				} else {
-					return antenna2Value->second;
-				}
-			}
-		}
-		
-		std::vector<std::pair<unsigned, unsigned> > BaselineList() const
-		{
-			std::vector<std::pair<unsigned, unsigned> > list;
-			for(OuterMap::const_iterator outerIter = _map.begin(); outerIter!=_map.end(); ++outerIter)
-			{
-				const unsigned antenna1 = outerIter->first;
-				const InnerMap &innerMap = outerIter->second;
-				
-				for(InnerMap::const_iterator innerIter = innerMap.begin(); innerIter!=innerMap.end(); ++innerIter)
-				{
-					const unsigned antenna2 = innerIter->first;
-					list.push_back(std::pair<unsigned, unsigned>(antenna1, antenna2));
-				}
-			}
-			return list;
-		}
-		
-		unsigned AntennaCount() const
-		{
-			if(_map.empty()) return 0;
-			unsigned highestIndex = _map.rbegin()->first;
-			
-			for(OuterMap::const_iterator outerIter = _map.begin(); outerIter!=_map.end(); ++outerIter)
-			{
-				const InnerMap &innerMap = outerIter->second;
-				if(highestIndex < innerMap.rbegin()->first)
-					highestIndex = innerMap.rbegin()->first;
-			}
-			return highestIndex + 1;
-		}
-		
-		void Clear()
-		{
-			_map.clear();
-		}
-		
-		unsigned PolarizationCount() const
-		{
-			return _polarizationCount;
-		}
-		
-		virtual void Serialize(std::ostream &stream) const
-		{
-			SerializeToUInt32(stream, _polarizationCount);
-			serializeOuterMap(stream, _map);
-		}
-		
-		virtual void Unserialize(std::istream &stream)
-		{
-			_map.clear();
-			_polarizationCount = UnserializeUInt32(stream);
-			unserializeOuterMap(stream, _map);
-		}
-		
-	private:
-		void operator=(BaselineStatisticsMap &) { } // don't allow assignment
-		
-		typedef std::map<unsigned, DefaultStatistics> InnerMap;
-		typedef std::pair<unsigned, DefaultStatistics> InnerPair;
-		typedef std::map<unsigned, InnerMap > OuterMap;
-		typedef std::pair<unsigned, InnerMap > OuterPair;
-		
-		OuterMap _map;
-		unsigned _polarizationCount;
-		
-		void serializeOuterMap(std::ostream &stream, const OuterMap &map) const
-		{
-			SerializeToUInt32(stream, map.size());
-			
-			for(OuterMap::const_iterator i=map.begin();i!=map.end();++i)
-			{
-				unsigned antenna1 = i->first;
-				SerializeToUInt32(stream, antenna1);
-				
-				const InnerMap &innerMap = i->second;
-				serializeInnerMap(stream, innerMap);
-			}
-		}
-		
-		void unserializeOuterMap(std::istream &stream, OuterMap &map) const
-		{
-			size_t size = UnserializeUInt32(stream);
-			for(size_t j=0;j<size;++j)
-			{
-				unsigned antenna1 = UnserializeUInt32(stream);
-				
-				OuterMap::iterator i =
-					map.insert(std::pair<unsigned, InnerMap>(antenna1, InnerMap())).first;
-				unserializeInnerMap(stream, i->second);
-			}
-		}
-		
-		void serializeInnerMap(std::ostream &stream, const InnerMap &map) const
-		{
-			SerializeToUInt32(stream, map.size());
-			
-			for(InnerMap::const_iterator i=map.begin();i!=map.end();++i)
-			{
-				unsigned antenna2 = i->first;
-				SerializeToUInt32(stream, antenna2);
-				
-				const DefaultStatistics &statistics = i->second;
-				statistics.Serialize(stream);
-			}
-		}
-		
-		void unserializeInnerMap(std::istream &stream, InnerMap &map) const
-		{
-			size_t size = UnserializeUInt32(stream);
-			for(size_t j=0;j<size;++j)
-			{
-				unsigned antenna2 = UnserializeUInt32(stream);
-				
-				InnerMap::iterator i =
-					map.insert(std::pair<unsigned, DefaultStatistics>(antenna2, DefaultStatistics(_polarizationCount))).first;
-				
-				i->second.Unserialize(stream);
-			}
-		}
-		
-};
-
-#endif
-
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/quality/defaultstatistics.h b/CEP/DP3/AOFlagger/include/AOFlagger/quality/defaultstatistics.h
deleted file mode 100644
index b001c011c97db5809f0d83080e080ba7be31c716..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/quality/defaultstatistics.h
+++ /dev/null
@@ -1,236 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef QUALITY__DEFAULT_STATISTICS_H
-#define QUALITY__DEFAULT_STATISTICS_H
-
-#include <complex>
-#include <stdint.h>
-
-#include <AOFlagger/util/serializable.h>
-
-class DefaultStatistics : public Serializable
-{
-	public:
-		DefaultStatistics(unsigned polarizationCount) :
-			_polarizationCount(polarizationCount)
-		{
-			initialize();
-			for(unsigned p=0;p<_polarizationCount;++p)
-			{
-				rfiCount[p] = 0;
-				count[p] = 0;
-				sum[p] = 0.0;
-				sumP2[p] = 0.0;
-				dCount[p] = 0;
-				dSum[p] = 0.0;
-				dSumP2[p] = 0.0;
-			}
-		}
-		
-		~DefaultStatistics()
-		{
-			destruct();
-		}
-		
-		DefaultStatistics(const DefaultStatistics &other)
-		: _polarizationCount(other._polarizationCount)
-		{
-			initialize();
-			for(unsigned p=0;p<_polarizationCount;++p)
-			{
-				rfiCount[p] = other.rfiCount[p];
-				count[p] = other.count[p];
-				sum[p] = other.sum[p];
-				sumP2[p] = other.sumP2[p];
-				dCount[p] = other.dCount[p];
-				dSum[p] = other.dSum[p];
-				dSumP2[p] = other.dSumP2[p];
-			}
-		}
-		
-		DefaultStatistics &operator=(const DefaultStatistics &other)
-		{
-			if(other._polarizationCount != _polarizationCount)
-			{
-				destruct();
-				_polarizationCount = other._polarizationCount;
-				initialize();
-			}
-			for(unsigned p=0;p<_polarizationCount;++p)
-			{
-				rfiCount[p] = other.rfiCount[p];
-				count[p] = other.count[p];
-				sum[p] = other.sum[p];
-				sumP2[p] = other.sumP2[p];
-				dCount[p] = other.dCount[p];
-				dSum[p] = other.dSum[p];
-				dSumP2[p] = other.dSumP2[p];
-			}
-			return *this;
-		}
-		
-		DefaultStatistics &operator+=(const DefaultStatistics &other)
-		{
-			for(unsigned p=0;p<_polarizationCount;++p)
-			{
-				rfiCount[p] += other.rfiCount[p];
-				count[p] += other.count[p];
-				sum[p] += other.sum[p];
-				sumP2[p] += other.sumP2[p];
-				dCount[p] += other.dCount[p];
-				dSum[p] += other.dSum[p];
-				dSumP2[p] += other.dSumP2[p];
-			}
-			return *this;
-		}
-		
-		DefaultStatistics ToSinglePolarization() const
-		{
-			if(_polarizationCount == 1)
-				return *this;
-			
-			DefaultStatistics singlePol(1);
-			for(unsigned p=0;p<_polarizationCount;++p)
-			{
-				singlePol.rfiCount[0] += rfiCount[p];
-				singlePol.count[0] += count[p];
-				singlePol.sum[0] += sum[p];
-				singlePol.sumP2[0] += sumP2[p];
-				singlePol.dCount[0] += dCount[p];
-				singlePol.dSum[0] += dSum[p];
-				singlePol.dSumP2[0] += dSumP2[p];
-			}
-			return singlePol;
-		}
-		
-		virtual void Serialize(std::ostream &stream) const
-		{
-			SerializeToUInt32(stream, _polarizationCount);
-			
-			for(unsigned p=0;p<_polarizationCount;++p)
-			{
-				SerializeToUInt64(stream, rfiCount[p]);
-				SerializeToUInt64(stream, count[p]);
-				SerializeToLDoubleC(stream, sum[p]);
-				SerializeToLDoubleC(stream, sumP2[p]);
-				SerializeToUInt64(stream, dCount[p]);
-				SerializeToLDoubleC(stream, dSum[p]);
-				SerializeToLDoubleC(stream, dSumP2[p]);
-			}
-		}
-		
-		virtual void Unserialize(std::istream &stream)
-		{
-			uint32_t pCount = UnserializeUInt32(stream);
-			if(pCount != _polarizationCount)
-			{
-				destruct();
-				_polarizationCount = pCount;
-				initialize();
-			}
-			
-			for(unsigned p=0;p<_polarizationCount;++p)
-			{
-				rfiCount[p] = UnserializeUInt64(stream);
-				count[p] = UnserializeUInt64(stream);
-				sum[p] = UnserializeLDoubleC(stream);
-				sumP2[p] = UnserializeLDoubleC(stream);
-				dCount[p] = UnserializeUInt64(stream);
-				dSum[p] = UnserializeLDoubleC(stream);
-				dSumP2[p] = UnserializeLDoubleC(stream);
-			}
-		}
-		
-		unsigned PolarizationCount() const
-		{
-			return _polarizationCount;
-		}
-		
-		template<typename T>
-		std::complex<T> Mean(unsigned polarization) const
-		{
-			return std::complex<T>(sum[polarization].real() / count[polarization], sum[polarization].imag() / count[polarization]);
-		}
-		
-		template<typename T>
-		std::complex<T> Sum(unsigned polarization) const
-		{
-			return std::complex<T>(sum[polarization].real(), sum[polarization].imag());
-		}
-		
-		template<typename T>
-		std::complex<T> SumP2(unsigned polarization) const
-		{
-			return std::complex<T>(sumP2[polarization].real(), sumP2[polarization].imag());
-		}
-		
-		template<typename T>
-		std::complex<T> DMean(unsigned polarization) const
-		{
-			return std::complex<T>(dSum[polarization].real() / dCount[polarization], dSum[polarization].imag() / dCount[polarization]);
-		}
-		
-		template<typename T>
-		std::complex<T> DSum(unsigned polarization) const
-		{
-			return std::complex<T>(dSum[polarization].real(), dSum[polarization].imag());
-		}
-
-		template<typename T>
-		std::complex<T> DSumP2(unsigned polarization) const
-		{
-			return std::complex<T>(dSumP2[polarization].real(), dSumP2[polarization].imag());
-		}
-		
-		unsigned long *rfiCount;
-		unsigned long *count;
-		std::complex<long double> *sum;
-		std::complex<long double> *sumP2;
-		unsigned long *dCount;
-		std::complex<long double> *dSum;
-		std::complex<long double> *dSumP2;
-		
-	private:
-		void initialize()
-		{
-			rfiCount = new unsigned long[_polarizationCount];
-			count = new unsigned long[_polarizationCount];
-			sum = new std::complex<long double>[_polarizationCount];
-			sumP2 = new std::complex<long double>[_polarizationCount];
-			dCount = new unsigned long[_polarizationCount];
-			dSum = new std::complex<long double>[_polarizationCount];
-			dSumP2 = new std::complex<long double>[_polarizationCount];
-		}
-		
-		void destruct()
-		{
-			delete[] rfiCount;
-			delete[] count;
-			delete[] sum;
-			delete[] sumP2;
-			delete[] dCount;
-			delete[] dSum;
-			delete[] dSumP2;
-		}
-		
-		unsigned _polarizationCount;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/quality/histogramcollection.h b/CEP/DP3/AOFlagger/include/AOFlagger/quality/histogramcollection.h
deleted file mode 100644
index bdcd3abe3d8e6e62ef1801634473e239c6ebe011..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/quality/histogramcollection.h
+++ /dev/null
@@ -1,312 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef HISTOGRAM_COLLECTION_H
-#define HISTOGRAM_COLLECTION_H
-
-#include "loghistogram.h"
-
-#include <complex>
-#include <map>
-#include <vector>
-
-#include <AOFlagger/msio/image2d.h>
-#include <AOFlagger/msio/mask2d.h>
-
-#include <AOFlagger/util/serializable.h>
-
-class HistogramCollection : public Serializable
-{
-	public:
-		typedef std::pair<unsigned, unsigned> AntennaPair;
-		
-		HistogramCollection() : _polarizationCount(0)
-		{
-		}
-		
-		explicit HistogramCollection(unsigned polarizationCount) : _polarizationCount(polarizationCount)
-		{
-			init();
-		}
-		
-		HistogramCollection(const HistogramCollection &source) : _polarizationCount(source._polarizationCount)
-		{
-			init();
-			for(unsigned i=0;i<_polarizationCount;++i)
-			{
-				copy(_totalHistograms[i], source._totalHistograms[i]);
-				copy(_rfiHistograms[i], source._rfiHistograms[i]);
-			}
-		}
-		
-		~HistogramCollection()
-		{
-			destruct();
-		}
-		
-		void SetPolarizationCount(unsigned polarizationCount)
-		{
-			destruct();
-			_polarizationCount = polarizationCount;
-			init();
-		}
-		
-		void Add(const unsigned antenna1, const unsigned antenna2, const unsigned polarization, const std::complex<float> *values, const bool *isRFI, size_t sampleCount)
-		{
-			LogHistogram &totalHistogram = GetTotalHistogram(antenna1, antenna2, polarization);
-			LogHistogram &rfiHistogram = GetRFIHistogram(antenna1, antenna2, polarization);
-			
-			for(size_t i=0;i<sampleCount;++i)
-			{
-				const double amplitude = sqrt(values[i].real()*values[i].real() + values[i].imag()*values[i].imag());
-				totalHistogram.Add(amplitude);
-				if(isRFI[i])
-					rfiHistogram.Add(amplitude);
-			}
-		}
-		
-		void Add(const HistogramCollection &collection)
-		{
-			if(collection._polarizationCount != _polarizationCount)
-				throw std::runtime_error("Polarization counts of histogram collections don't match");
-			for(unsigned p=0;p<_polarizationCount;++p)
-			{
-				add(collection, p, p);
-			}
-		}
-		
-		bool Empty() const
-		{
-			if(_polarizationCount == 0)
-				return true;
-			for(unsigned p=0;p!=_polarizationCount;++p)
-			{
-				if(!_totalHistograms[p].empty() || !_rfiHistograms[p].empty())
-					return false;
-			}
-			return true;
-		}
-		
-		void Add(const unsigned antenna1, const unsigned antenna2, const unsigned polarization, Image2DCPtr image, Mask2DCPtr mask);
-		
-		LogHistogram &GetTotalHistogram(const unsigned a1, const unsigned a2, const unsigned polarization)
-		{
-			return getHistogram(_totalHistograms, a1, a2, polarization);
-		}
-		
-		LogHistogram &GetRFIHistogram(const unsigned a1, const unsigned a2, const unsigned polarization)
-		{
-			return getHistogram(_rfiHistograms, a1, a2, polarization);
-		}
-		
-		const std::map<AntennaPair, LogHistogram*> &GetTotalHistogram(const unsigned polarization) const
-		{
-			return _totalHistograms[polarization];
-		}
-		
-		const std::map<AntennaPair, LogHistogram*> &GetRFIHistogram(const unsigned polarization) const
-		{
-			return _rfiHistograms[polarization];
-		}
-		
-		void GetTotalHistogramForCrossCorrelations(const unsigned polarization, LogHistogram &target) const
-		{
-			getHistogramForCrossCorrelations(_totalHistograms, polarization, target);
-		}
-		
-		void GetRFIHistogramForCrossCorrelations(const unsigned polarization, LogHistogram &target) const
-		{
-			getHistogramForCrossCorrelations(_rfiHistograms, polarization, target);
-		}
-		
-		void Clear()
-		{
-			destruct();
-			init();
-		}
-		
-		void Save(class HistogramTablesFormatter &histogramTables);
-		
-		void Load(class HistogramTablesFormatter &histogramTables);
-				
-		unsigned PolarizationCount() const { return _polarizationCount; }
-		
-		virtual void Serialize(std::ostream &stream) const
-		{
-			SerializeToUInt64(stream, _polarizationCount);
-			serializeMapArray(stream, _totalHistograms);
-			serializeMapArray(stream, _rfiHistograms);
-		}
-		
-		virtual void Unserialize(std::istream &stream)
-		{
-			destruct();
-			_polarizationCount = UnserializeUInt64(stream);
-			init();
-			unserializeMapArray(stream, _totalHistograms);
-			unserializeMapArray(stream, _rfiHistograms);
-		}
-		
-		HistogramCollection *CreateSummedPolarizationCollection() const
-		{
-			HistogramCollection *newCollection = new HistogramCollection(1);
-			for(unsigned p=0;p<_polarizationCount;++p)
-				newCollection->add(*this, p, 0);
-			return newCollection;
-		}
-		
-		void Rescale(double factor)
-		{
-			for(unsigned p=0;p<_polarizationCount;++p)
-			{
-				for(std::map<AntennaPair, LogHistogram*>::iterator i=_totalHistograms[p].begin(); i!=_totalHistograms[p].end(); ++i)
-				{
-					i->second->Rescale(factor);
-				}
-				for(std::map<AntennaPair, LogHistogram*>::iterator i=_rfiHistograms[p].begin(); i!=_rfiHistograms[p].end(); ++i)
-				{
-					i->second->Rescale(factor);
-				}
-			}
-		}
-	private:
-		unsigned _polarizationCount;
-		std::map<AntennaPair, LogHistogram*> *_totalHistograms;
-		std::map<AntennaPair, LogHistogram*> *_rfiHistograms;
-		
-		void init()
-		{
-			if(_polarizationCount != 0)
-			{
-				_totalHistograms = new std::map<AntennaPair, LogHistogram*>[_polarizationCount];
-				_rfiHistograms = new std::map<AntennaPair, LogHistogram*>[_polarizationCount];
-			} else {
-				_totalHistograms = 0;
-				_rfiHistograms = 0;
-			}
-		}
-		
-		void destruct()
-		{
-			if(_polarizationCount != 0)
-			{
-				for(unsigned p=0;p<_polarizationCount;++p)
-				{
-					for(std::map<AntennaPair, LogHistogram*>::iterator i=_totalHistograms[p].begin(); i!=_totalHistograms[p].end(); ++i)
-					{
-						delete i->second;
-					}
-					for(std::map<AntennaPair, LogHistogram*>::iterator i=_rfiHistograms[p].begin(); i!=_rfiHistograms[p].end(); ++i)
-					{
-						delete i->second;
-					}
-				}
-				delete[] _totalHistograms;
-				delete[] _rfiHistograms;
-			}
-		}
-		
-		void serializeMapArray(std::ostream &stream, const std::map<AntennaPair, LogHistogram*> *map) const
-		{
-			for(unsigned p=0;p<_polarizationCount;++p)
-				serializeMap(stream, map[p]);
-		}
-		
-		void unserializeMapArray(std::istream &stream, std::map<AntennaPair, LogHistogram*> *map)
-		{
-			for(unsigned p=0;p<_polarizationCount;++p)
-				unserializeMap(stream, map[p]);
-		}
-		
-		void serializeMap(std::ostream &stream, const std::map<AntennaPair, LogHistogram*> &map) const
-		{
-			SerializeToUInt64(stream, map.size());
-			for(std::map<AntennaPair, LogHistogram*>::const_iterator i=map.begin();i!=map.end();++i)
-			{
-				const AntennaPair &antennae = i->first;
-				const LogHistogram *histogram = i->second;
-				SerializeToUInt32(stream, antennae.first);
-				SerializeToUInt32(stream, antennae.second);
-				histogram->Serialize(stream);
-			}
-		}
-		
-		void unserializeMap(std::istream &stream, std::map<AntennaPair, LogHistogram*> &map)
-		{
-			map.clear();
-			size_t mapSize = UnserializeUInt64(stream);
-			std::map<AntennaPair, LogHistogram*>::iterator insertPos = map.begin();
-			for(size_t i=0;i!=mapSize;++i)
-			{
-				std::pair<AntennaPair, LogHistogram*> p;
-				p.first.first = UnserializeUInt32(stream);
-				p.first.second = UnserializeUInt32(stream);
-				p.second = new LogHistogram();
-				p.second->Unserialize(stream);
-				insertPos = map.insert(insertPos, p);
-			}
-		}
-		
-		void copy(std::map<AntennaPair, LogHistogram*> &destination, const std::map<AntennaPair, LogHistogram*> &source)
-		{
-			for(std::map<AntennaPair, LogHistogram*>::const_iterator i=source.begin();i!=source.end();++i)
-			{
-				destination.insert(std::pair<AntennaPair, LogHistogram*>(i->first, new LogHistogram(*i->second)));
-			}
-		}
-
-		void add(const HistogramCollection &collection, unsigned fromPolarization, unsigned toPolarization)
-		{
-			for(std::map<AntennaPair, LogHistogram*>::const_iterator i=collection._totalHistograms[fromPolarization].begin(); i!=collection._totalHistograms[fromPolarization].end(); ++i)
-			{
-				LogHistogram &histogram = GetTotalHistogram(i->first.first, i->first.second, toPolarization);
-				histogram.Add(*i->second);
-			}
-			
-			for(std::map<AntennaPair, LogHistogram*>::const_iterator i=collection._rfiHistograms[fromPolarization].begin(); i!=collection._rfiHistograms[fromPolarization].end(); ++i)
-			{
-				LogHistogram &histogram = GetRFIHistogram(i->first.first, i->first.second, toPolarization);
-				histogram.Add(*i->second);
-			}
-		}
-		
-		LogHistogram &getHistogram(std::map<AntennaPair, LogHistogram*> *histograms, const unsigned a1, const unsigned a2, const unsigned polarization)
-		{
-			const AntennaPair antennae(a1, a2);
-			std::map<AntennaPair, LogHistogram*>::iterator i = histograms[polarization].find(antennae);
-			if(i == histograms[polarization].end())
-			{
-				i = histograms[polarization].insert(std::pair<AntennaPair, LogHistogram*>(antennae, new LogHistogram())).first;
-			}
-			return *i->second;
-		}
-		
-		void getHistogramForCrossCorrelations(std::map<AntennaPair, LogHistogram*> *histograms, const unsigned polarization, LogHistogram &target) const
-		{
-			for(std::map<AntennaPair, LogHistogram*>::const_iterator i=histograms[polarization].begin(); i!=histograms[polarization].end(); ++i)
-			{
-				if(i->first.first != i->first.second)
-					target.Add(*i->second);
-			}
-		}
-
-
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/quality/histogramtablesformatter.h b/CEP/DP3/AOFlagger/include/AOFlagger/quality/histogramtablesformatter.h
deleted file mode 100644
index fa7d784129b46c4aa316f7e4046b340aa20efe67..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/quality/histogramtablesformatter.h
+++ /dev/null
@@ -1,248 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef HISTOGRAM_TABLES_FORMATTER_H
-#define HISTOGRAM_TABLES_FORMATTER_H
-
-#include <ms/MeasurementSets/MeasurementSet.h>
-#include <tables/Tables/TableRecord.h>
-
-#include <vector>
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class HistogramTablesFormatter {
-	public:
-		enum TableKind { HistogramCountTable, HistogramTypeTable };
-		
-		struct HistogramItem
-		{
-			double binStart;
-			double binEnd;
-			double count;
-		};
-		
-		enum HistogramType
-		{
-			TotalHistogram,
-			RFIHistogram
-		};
-	
-		HistogramTablesFormatter(const std::string &measurementSetName) :
-			_measurementSet(0),
-			_measurementSetName(measurementSetName),
-			_typeTable(0),
-			_countTable(0)
-		{
-		}
-		
-		~HistogramTablesFormatter()
-		{
-			Close();
-		}
-		
-		void Close()
-		{
-			if(_countTable != 0)
-			{
-				delete _countTable;
-				_countTable = 0;
-			}
-			if(_typeTable != 0)
-			{
-				delete _typeTable;
-				_typeTable = 0;
-			}
-			closeMainTable();
-		}
-		
-		std::string CountTableName() const
-		{
-			return "QUALITY_HISTOGRAM_COUNT";
-		}
-		
-		std::string TypeTableName() const
-		{
-			return "QUALITY_HISTOGRAM_TYPE";
-		}
-		
-		std::string TableName(enum TableKind table) const
-		{
-			switch(table)
-			{
-				case HistogramCountTable:
-					return CountTableName();
-				case HistogramTypeTable:
-					return TypeTableName();
-				default:
-					return "";
-			}
-		}
-		
-		std::string TypeToName(HistogramType type) const
-		{
-			switch(type)
-			{
-				case TotalHistogram: return "Total";
-				case RFIHistogram: return "RFI";
-				default: return std::string();
-			}
-		}
-		
-		std::string TableFilename(enum TableKind table) const
-		{
-			return _measurementSetName + '/' + TableName(table);
-		}
-		
-		bool TableExists(enum TableKind table) const
-		{
-			return _measurementSet->isReadable(TableFilename(table));
-		}
-		
-		bool IsAvailable(unsigned typeIndex)
-		{
-			if(!TableExists(HistogramCountTable) || !TableExists(HistogramTypeTable))
-				return false;
-			return hasOneEntry(typeIndex);
-		}
-		
-		void InitializeEmptyTables()
-		{
-			if(TableExists(HistogramCountTable))
-				removeEntries(HistogramCountTable);
-			else
-				createCountTable();
-			
-			if(TableExists(HistogramTypeTable))
-				removeEntries(HistogramTypeTable);
-			else
-				createTypeTable();
-		}
-		
-		void RemoveTable(enum TableKind table)
-		{
-			if(TableExists(table))
-			{
-				Close();
-				openMainTable(true);
-				if(_measurementSet->keywordSet().isDefined(TableName(table)))
-					_measurementSet->rwKeywordSet().removeField(TableName(table));
-				if(_measurementSet->isReadable(TableFilename(table)))
-					casa::Table::deleteTable(TableFilename(table));
-			}
-		}
-		
-		void StoreValue(unsigned typeIndex, double binStart, double binEnd, double count);
-		
-		void QueryHistogram(unsigned typeIndex, std::vector<HistogramItem> &histogram);
-		
-		unsigned QueryTypeIndex(enum HistogramType type, unsigned polarizationIndex);
-		bool QueryTypeIndex(enum HistogramType type, unsigned polarizationIndex, unsigned &destTypeIndex);
-		unsigned StoreOrQueryTypeIndex(enum HistogramType type, unsigned polarizationIndex)
-		{
-			unsigned typeIndex;
-			if(QueryTypeIndex(type, polarizationIndex, typeIndex))
-				return typeIndex;
-			else
-				return StoreType(type, polarizationIndex);
-		}
-		unsigned StoreType(enum HistogramType type, unsigned polarizationIndex);
-		bool HistogramsExist()
-		{
-			return TableExists(HistogramCountTable) && TableExists(HistogramTypeTable);
-		}
-		void RemoveAll()
-		{
-			RemoveTable(HistogramCountTable);
-			RemoveTable(HistogramTypeTable);
-		}
-	private:
-		HistogramTablesFormatter(const HistogramTablesFormatter &) { } // don't allow copies
-		void operator=(const HistogramTablesFormatter &) { } // don't allow assignment
-		
-		const static std::string ColumnNameType;
-		const static std::string ColumnNameName;
-		const static std::string ColumnNamePolarization;
-		
-		const static std::string ColumnNameBinStart;
-		const static std::string ColumnNameBinEnd;
-		const static std::string ColumnNameCount;
-		
-		casa::Table *_measurementSet;
-		const std::string _measurementSetName;
-		
-		casa::Table *_typeTable;
-		casa::Table *_countTable;
-		
-		bool hasOneEntry(unsigned typeIndex);
-		void removeTypeEntry(enum HistogramType type, unsigned polarizationIndex);
-		void removeEntries(enum TableKind table);
-		
-		void addTimeColumn(casa::TableDesc &tableDesc);
-		void addFrequencyColumn(casa::TableDesc &tableDesc);
-		void addValueColumn(casa::TableDesc &tableDesc);
-		
-		void createTable(enum TableKind table)
-		{
-			switch(table)
-			{
-				case HistogramTypeTable:  createTypeTable(); break;
-				case HistogramCountTable: createCountTable(); break;
-				default: break;
-			}
-		}
-		
-		void createTypeTable();
-		void createCountTable();
-		unsigned findFreeTypeIndex(casa::Table &typeTable);
-		
-		void openMainTable(bool needWrite);
-		void closeMainTable()
-		{
-			if(_measurementSet != 0)
-			{
-				delete _measurementSet;
-				_measurementSet = 0;
-			}
-		}
-		
-		void openTable(TableKind table, bool needWrite, casa::Table **tablePtr);
-		void openTypeTable(bool needWrite)
-		{
-			openTable(HistogramTypeTable, needWrite, &_typeTable);
-		}
-		void openCountTable(bool needWrite)
-		{
-			openTable(HistogramCountTable, needWrite, &_countTable);
-		}
-		casa::Table &getTable(TableKind table, bool needWrite)
-		{
-			casa::Table **tablePtr = 0;
-			switch(table)
-			{
-				case HistogramTypeTable: tablePtr = &_typeTable; break;
-				case HistogramCountTable: tablePtr = &_countTable; break;
-			}
-			openTable(table, needWrite, tablePtr);
-			return **tablePtr;
-		}
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/quality/loghistogram.h b/CEP/DP3/AOFlagger/include/AOFlagger/quality/loghistogram.h
deleted file mode 100644
index 47283a9fcded326769298b58ad078d0f207957c3..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/quality/loghistogram.h
+++ /dev/null
@@ -1,522 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef LOGHISTOGRAM_H
-#define LOGHISTOGRAM_H
-
-#include <map>
-#include <cmath>
-#include <stdexcept>
-#include <vector>
-
-#include "histogramtablesformatter.h"
-
-#include <AOFlagger/util/serializable.h>
-
-//# pow10 seems to be undefined on OS-X
-#ifdef __APPLE__
-# define pow10(x) pow(10., (x))
-#endif
-
-
-class LogHistogram : public Serializable
-{
-	private:
-		class AmplitudeBin : public Serializable
-		{
-                public:
-			AmplitudeBin() :
-				count(0)
-			{
-			}
-			long unsigned count;
-			
-			long unsigned GetCount() const
-			{
-				return count;
-			}
-			
-			AmplitudeBin &operator+=(const AmplitudeBin &other)
-			{
-				count += other.count;
-				return *this;
-			}
-			AmplitudeBin &operator-=(const AmplitudeBin &other)
-			{
-				if(count >= other.count)
-					count -= other.count;
-				else
-					count = 0;
-				return *this;
-			}
-			
-			virtual void Serialize(std::ostream &stream) const
-			{
-				SerializeToUInt64(stream, count);
-			}
-			virtual void Unserialize(std::istream &stream)
-			{
-				count = UnserializeUInt64(stream);
-			}
-		};
-		
-	public:
-		LogHistogram()
-		{
-		}
-		
-		LogHistogram(const LogHistogram &source) : _amplitudes(source._amplitudes)
-		{
-		}
-		
-		void Add(const double amplitude)
-		{
-			if(std::isfinite(amplitude))
-			{
-				const double centralAmp = getCentralAmplitude(amplitude);
-				AmplitudeBin &bin = getBin(centralAmp);
-				++bin.count;
-			}
-		}
-		
-		void Add(const LogHistogram &histogram)
-		{
-			for(std::map<double, AmplitudeBin>::const_iterator i=histogram._amplitudes.begin(); i!=histogram._amplitudes.end();++i)
-			{
-				AmplitudeBin &bin = getBin(i->first);
-				bin += i->second;
-			}
-		}
-		
-		void operator-=(const LogHistogram &histogram)
-		{
-			for(std::map<double, AmplitudeBin>::const_iterator i=histogram._amplitudes.begin(); i!=histogram._amplitudes.end();++i)
-			{
-				AmplitudeBin &bin = getBin(i->first);
-				bin -= i->second;
-			}
-		}
-		
-		double MaxAmplitude() const
-		{
-			if(_amplitudes.empty())
-				return 0.0;
-			return _amplitudes.rbegin()->first;
-		}
-		
-		double MinPositiveAmplitude() const
-		{
-			std::map<double, AmplitudeBin>::const_iterator i = _amplitudes.begin();
-			if(i == _amplitudes.end())
-				return 0.0;
-			while(i->first <= 0.0)
-			{
-				++i;
-				if(i == _amplitudes.end())
-					return 0.0;
-			}
-			return i->first;
-		}
-		
-		double NormalizedCount(double startAmplitude, double endAmplitude) const
-		{
-			unsigned long count = 0;
-			for(std::map<double, class AmplitudeBin>::const_iterator i=_amplitudes.begin();i!=_amplitudes.end();++i)
-			{
-				if(i->first >= startAmplitude && i->first < endAmplitude)
-					count += i->second.GetCount();
-			}
-			return (double) count / (endAmplitude - startAmplitude);
-		}
-		
-		double NormalizedCount(double centreAmplitude) const
-		{
-			const double key = getCentralAmplitude(centreAmplitude);
-			std::map<double, AmplitudeBin>::const_iterator i = _amplitudes.find(key);
-			if(i == _amplitudes.end()) return 0.0;
-			return (double) i->second.GetCount() / (binEnd(centreAmplitude) - binStart(centreAmplitude));
-		}
-		
-		double MinNormalizedCount() const
-		{
-			const_iterator i = begin();
-			if(i == end())
-				return 0.0;
-			double minCount = i.normalizedCount();
-			do
-			{
-				const double c = i.normalizedCount();
-				if(c < minCount) minCount = c;
-				++i;
-			} while(i != end());
-			return minCount;
-		}
-		
-		double MaxNormalizedCount() const
-		{
-			double maxCount = 0.0;
-			for (LogHistogram::const_iterator i=begin(); i!=end(); ++i)
-			{
-				if(i.normalizedCount() > maxCount && i.value() > 0 && std::isfinite(i.value()))
-					maxCount = i.normalizedCount();
-			}
-			return maxCount;
-		}
-		
-		double NormalizedTotalCount() const
-		{
-			unsigned long count = 0;
-			for (LogHistogram::const_iterator i=begin(); i!=end(); ++i)
-				count += i.unnormalizedCount();
-			return count;
-		}
-		
-		double NormalizedCountAbove(double lowerLimitingAmplitude) const
-		{
-			unsigned long count = 0;
-			LogHistogram::const_iterator i=begin();
-			while(i!=end() && i.value() <= lowerLimitingAmplitude)
-			{
-				++i;
-			}
-			while(i!=end())
-			{
-				count += i.unnormalizedCount();
-				++i;
-			}
-			return count;
-		}
-		
-		double AmplitudeWithMaxNormalizedCount() const
-		{
-			double maxCount = 0.0, maxPosition = 0.0;
-			for (LogHistogram::const_iterator i=begin(); i!=end(); ++i)
-			{
-				if(i.normalizedCount() > maxCount && i.value() > 0 && std::isfinite(i.value()))
-				{
-					maxCount = i.normalizedCount();
-					maxPosition = i.value();
-				}
-			}
-			return maxPosition;
-		}
-		
-		double MinPosNormalizedCount() const
-		{
-			const_iterator i = begin();
-			if(i == end())
-				return 0.0;
-			double minCount = std::isfinite(i.normalizedCount()) ? i.normalizedCount() + 1.0 : 1.0;
-			do
-			{
-				const double c = i.normalizedCount();
-				if(c < minCount && c > 0.0 && std::isfinite(c)) minCount = c;
-				++i;
-			} while(i != end());
-			return minCount;
-		}
-		
-		double NormalizedSlope(double startAmplitude, double endAmplitude) const
-		{
-			unsigned long n = 0;
-			long double sumX = 0.0, sumXY = 0.0, sumY = 0.0, sumXSquare = 0.0;
-			for(const_iterator i=begin();i!=end();++i)
-			{
-				if(i.value() >= startAmplitude && i.value() < endAmplitude)
-				{
-					double x = log10(i.value());
-					double y = log10(i.normalizedCount());
-					++n;
-					sumX += x;
-					sumXSquare += x * x;
-					sumY += y;
-					sumXY += x * y;
-				}
-			}
-			return (sumXY - sumX*sumY/n)/(sumXSquare - (sumX*sumX/n));
-		}
-		
-		
-		double PowerLawExponent(double startAmplitude) const
-		{
-			const long double xMin = startAmplitude;
-			long double termSum = 0.0;
-			long double termCount = 0.0;
-			for(const_iterator i=begin();i!=end();++i)
-			{
-				const long double x = i.value();
-				if(x >= startAmplitude)
-				{
-					const long double count = i.unnormalizedCount();
-					const long double thisTerm = logl(x / xMin);
-					termCount += count;
-					termSum += thisTerm * count;
-				}
-			}
-			return (double) (-1.0L - termCount / termSum);
-		}
-		
-		double PowerLawExponentStdError(double startAmplitude, double expEstimator) const
-		{
-			long double termCount = 0.0;
-			for(const_iterator i=begin();i!=end();++i)
-			{
-				if(i.value() >= startAmplitude)
-				{
-					const long double count = i.unnormalizedCount();
-					termCount += count;
-				}
-			}
-			return (double) ((-expEstimator - 1.0L) / sqrtl(termCount));
-		}
-		
-		double NormalizedSlopeOffset(double startAmplitude, double endAmplitude, double slope) const
-		{
-			unsigned long n = 0;
-			long double sumOffset = 0.0;
-			for(const_iterator i=begin();i!=end();++i)
-			{
-				if(i.value() >= startAmplitude && i.value() < endAmplitude)
-				{
-					double y = log10(i.normalizedCount());
-					double x = log10(i.value());
-					double ySlope = x*slope;
-					++n;
-					sumOffset += (y - ySlope);
-				}
-			}
-			return (double) (sumOffset/(long double) n);
-		}
-		
-		double NormalizedSlopeStdError(double startAmplitude, double endAmplitude, double slope) const
-		{
-			long double ssxx = 0.0, ssxy = 0.0, ssyy = 0.0, xSum = 0.0, ySum = 0.0;
-			unsigned long n = 0;
-			// determine the 'average' x and y
-			for(const_iterator i=begin();i!=end();++i)
-			{
-				if(i.value() >= startAmplitude && i.value() < endAmplitude)
-				{
-					xSum += log10(i.value());
-					ySum += log10(i.normalizedCount());
-					++n;
-				}
-			}
-			const long double avgX = xSum / (long double) n, avgY = ySum / (long double) n;
-			for(const_iterator i=begin();i!=end();++i)
-			{
-				if(i.value() >= startAmplitude && i.value() < endAmplitude)
-				{
-					long double y = log10(i.normalizedCount());
-					long double x = log10(i.value());
-					ssxx += (x-avgX)*(x-avgX);
-					ssxy += (x-avgX)*(y-avgY);
-					ssyy += (y-avgY)*(y-avgY);
-				}
-			}
-			return (double) sqrtl((ssyy-slope*ssxy)/(ssxx * (long double) (n-2)));
-		}
-		
-		double NormalizedSlopeStdDevBySampling(double startAmplitude, double endAmplitude, double slope, double stepFactor) const
-		{
-			long double sum = 0.0;
-			unsigned long n = 0;
-			if(stepFactor <= 1.0001) stepFactor = 1.0001;
-			while(startAmplitude < endAmplitude)
-			{
-				const double stepEnd = startAmplitude * stepFactor;
-				double sampledSlope = NormalizedSlope(startAmplitude, stepEnd);
-				double sampleError = sampledSlope - slope;
-				sum += sampleError * sampleError;
-				++n;
-				
-				startAmplitude = stepEnd;
-			}
-			
-			return (double) sqrtl(sum / ((long double) n*n - n));
-		}
-		
-		double PowerLawUpperLimit(double constrainingAmplitude, double exponent, double factor) const
-		{
-			const double count = NormalizedCountAbove(constrainingAmplitude);
-			const double term = count * (exponent+1.0)/factor + pow(constrainingAmplitude, exponent+1.0);
-			return pow(term, 1.0/(exponent+1.0));
-		}
-		
-		double PowerLawLowerLimit(double constrainingAmplitude, double exponent, double factor, double rfiRatio) const
-		{
-			const double countPart = NormalizedCountAbove(constrainingAmplitude);
-			const double countTotal = NormalizedTotalCount() * rfiRatio;
-			const double term = (countPart - countTotal) * (exponent+1.0)/factor + pow(constrainingAmplitude, exponent+1.0);
-			return pow(term, 1.0/(exponent+1.0));
-		}
-		
-		double PowerLawLowerLimit2(double constrainingAmplitude, double exponent, double factor, double rfiRatio) const
-		{
-			const double countPart = NormalizedCountAbove(constrainingAmplitude);
-			const double countTotal = NormalizedTotalCount() * rfiRatio;
-			const double term = (countPart - countTotal) * (exponent+1.0)/factor + pow(constrainingAmplitude, exponent+1.0);
-			return pow(term/-exponent, 1.0/(exponent+1.0));
-		}
-		
-		void GetRFIRegion(double &start, double &end) const
-		{
-			double sigmaEstimate = AmplitudeWithMaxNormalizedCount();
-			double maxAmplitude = MaxAmplitude();
-			start = sigmaEstimate * 20.0;
-			double halfWay = exp((log(start) + log(maxAmplitude)) * 0.5);
-			end = halfWay;
-		}
-
-		double NormalizedSlopeInRFIRegion() const
-		{
-			double start, end;
-			GetRFIRegion(start ,end);
-			return NormalizedSlope(start, end);
-		}
-		
-		void SetData(std::vector<HistogramTablesFormatter::HistogramItem> &histogramData)
-		{
-			for(std::vector<HistogramTablesFormatter::HistogramItem>::const_iterator i=histogramData.begin(); i!=histogramData.end();++i)
-			{
-				const double b = (i->binStart + i->binEnd) * 0.5; // TODO somewhat inefficient...
-				getBin(getCentralAmplitude(b)).count = (unsigned long) i->count;
-			}
-		}
-		
-		void Rescale(double factor)
-		{
-			std::map<double, AmplitudeBin> newAmplitudes;
-			std::map<double, AmplitudeBin>::iterator position = newAmplitudes.begin();
-			for(std::map<double, AmplitudeBin>::const_iterator i=_amplitudes.begin();
-					i!=_amplitudes.end();++i)
-			{
-				position = newAmplitudes.insert(position, std::pair<double, AmplitudeBin>(getCentralAmplitude(i->first * factor), i->second));
-			}
-			_amplitudes = newAmplitudes;
-		}
-		
-		class const_iterator
-		{
-			public:
-				const_iterator(const LogHistogram &histogram, std::map<double, AmplitudeBin>::const_iterator iter) :
-					_iterator(iter)
-				{ }
-				const_iterator(const const_iterator &source) :
-					_iterator(source._iterator)
-				{ }
-				const_iterator &operator=(const const_iterator &source)
-				{
-					_iterator = source._iterator;
-					return *this;
-				}
-				bool operator==(const const_iterator &other) const { return other._iterator == _iterator; }
-				bool operator!=(const const_iterator &other) const { return other._iterator != _iterator; }
-				const_iterator &operator++() { ++_iterator; return *this; }
-				const_iterator &operator--() { --_iterator; return *this; }
-				double value() const { return _iterator->first; }
-				double normalizedCount() const { return _iterator->second.GetCount() / (binEnd() - binStart()); }
-				long unsigned unnormalizedCount() const { return _iterator->second.GetCount(); }
-				double binStart() const
-				{
-					return _iterator->first>0.0 ?
-						pow10(log10(_iterator->first)-0.005) :
-						-pow10(log10(-_iterator->first)-0.005);
-				}
-				double binEnd() const
-				{
-					return _iterator->first>0.0 ?
-						pow10(log10(_iterator->first)+0.005) :
-						-pow10(log10(-_iterator->first)+0.005);
-				}
-			private:
-				std::map<double, AmplitudeBin>::const_iterator _iterator;
-		};
-		typedef const_iterator iterator;
-		
-		const_iterator begin() const
-		{
-			return const_iterator(*this, _amplitudes.begin());
-		}
-		
-		const_iterator end() const
-		{
-			return const_iterator(*this, _amplitudes.end());
-		}
-		
-		virtual void Serialize(std::ostream &stream) const
-		{
-			SerializeToUInt64(stream, _amplitudes.size());
-			for(std::map<double, AmplitudeBin>::const_iterator i=_amplitudes.begin();i!=_amplitudes.end();++i)
-			{
-				SerializeToDouble(stream, i->first);
-				i->second.Serialize(stream);
-			}
-		}
-		
-		virtual void Unserialize(std::istream &stream)
-		{
-			_amplitudes.clear();
-			size_t mapSize = UnserializeUInt64(stream);
-			std::map<double, AmplitudeBin>::iterator insertPos = _amplitudes.begin();
-			for(size_t i=0;i!=mapSize;++i)
-			{
-				std::pair<double, AmplitudeBin> p;
-				p.first = UnserializeDouble(stream);
-				p.second.Unserialize(stream);
-				insertPos = _amplitudes.insert(insertPos, p);
-			}
-		}
-	private:
-		std::map<double, AmplitudeBin> _amplitudes;
-		
-		AmplitudeBin &getBin(double centralAmplitude)
-		{
-			std::map<double, class AmplitudeBin>::iterator element =
-				_amplitudes.find(centralAmplitude);
-			
-			if(element == _amplitudes.end())
-			{
-				element = _amplitudes.insert(std::pair<double, AmplitudeBin>(centralAmplitude, AmplitudeBin())).first;
-			}
-			return element->second;
-		}
-		double binStart(double x) const
-		{
-			return x>0.0 ?
-				pow10(log10(x)-0.005) :
-				-pow10(log10(x)-0.005);
-		}
-		double binEnd(double x) const
-		{
-			return x>0.0 ?
-				pow10(log10(x)+0.005) :
-				-pow10(log10(x)+0.005);
-		}
-		
-		static double getCentralAmplitude(const double amplitude)
-		{
-			if(amplitude>=0.0)
-				return pow10(round(100.0*log10(amplitude))/100.0);
-			else
-				return -pow10(round(100.0*log10(-amplitude))/100.0);
-		}
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/quality/qualitytablesformatter.h b/CEP/DP3/AOFlagger/include/AOFlagger/quality/qualitytablesformatter.h
deleted file mode 100644
index b02c7ccac49e479405e18ed34f1449923cb5737b..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/quality/qualitytablesformatter.h
+++ /dev/null
@@ -1,411 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef MSIO_QUALITY_DATA_H
-#define MSIO_QUALITY_DATA_H
-
-#include <ms/MeasurementSets/MeasurementSet.h>
-#include <tables/Tables/TableRecord.h>
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-
-#define QUALITY_TABLES_VERSION      1
-#define QUALITY_TABLES_VERSION_STR "1"
-
-class QualityTablesFormatter {
-	public:
-		enum StatisticKind
-		{
-			CountStatistic,
-			SumStatistic,
-			MeanStatistic,
-			RFICountStatistic,
-			RFISumStatistic,
-			RFIMeanStatistic,
-			RFIRatioStatistic,
-			RFIPercentageStatistic,
-			FlaggedCountStatistic,
-			FlaggedRatioStatistic,
-			SumP2Statistic,
-			SumP3Statistic,
-			SumP4Statistic,
-			VarianceStatistic,
-			VarianceOfVarianceStatistic,
-			StandardDeviationStatistic,
-			SkewnessStatistic,
-			KurtosisStatistic, 
-			SignalToNoiseStatistic,
-			DSumStatistic,
-			DMeanStatistic,
-			DSumP2Statistic,
-			DSumP3Statistic,
-			DSumP4Statistic,
-			DVarianceStatistic,
-			DVarianceOfVarianceStatistic,
-			DStandardDeviationStatistic,
-			DCountStatistic,
-			BadSolutionCountStatistic,
-			CorrectCountStatistic,
-			CorrectedMeanStatistic,
-			CorrectedSumP2Statistic,
-			CorrectedDCountStatistic,
-			CorrectedDMeanStatistic,
-			CorrectedDSumP2Statistic,
-			FTSumStatistic,
-			FTSumP2Statistic
-		};
-		
-		enum StatisticDimension
-		{
-			TimeDimension,
-			FrequencyDimension,
-			BaselineDimension,
-			BaselineTimeDimension
-		};
-		
-		enum QualityTable
-		{
-			KindNameTable,
-			TimeStatisticTable,
-			FrequencyStatisticTable,
-			BaselineStatisticTable,
-			BaselineTimeStatisticTable
-		};
-		
-		struct TimePosition
-		{
-			double time;
-			double frequency;
-		};
-		
-		struct FrequencyPosition
-		{
-			double frequency;
-		};
-		
-		struct BaselinePosition
-		{
-			unsigned antenna1;
-			unsigned antenna2;
-			double frequency;
-		};
-		
-		struct BaselineTimePosition
-		{
-			double time;
-			unsigned antenna1;
-			unsigned antenna2;
-			double frequency;
-		};
-		
-		QualityTablesFormatter(const std::string &measurementSetName) :
-			_measurementSet(0),
-			_measurementSetName(measurementSetName),
-			_kindNameTable(0),
-			_timeTable(0),
-			_frequencyTable(0),
-			_baselineTable(0),
-			_baselineTimeTable(0)
-		{
-		}
-		
-		~QualityTablesFormatter()
-		{
-			Close();
-		}
-		
-		void Close()
-		{
-			if(_kindNameTable != 0)
-				delete _kindNameTable;
-			_kindNameTable = 0;
-			if(_timeTable != 0)
-				delete _timeTable;
-			_timeTable = 0;
-			if(_frequencyTable != 0)
-				delete _frequencyTable;
-			_frequencyTable = 0;
-			if(_baselineTable != 0)
-				delete _baselineTable;
-			_baselineTable = 0;
-			if(_baselineTimeTable != 0)
-				delete _baselineTimeTable;
-			_baselineTimeTable = 0;
-			
-			closeMainTable();
-		}
-		
-		bool TableExists(enum QualityTable table) const
-		{
-			return _measurementSet->isReadable(TableToFilename(table));
-		}
-		
-		static const std::string &KindToName(const enum StatisticKind kind)
-		{
-			return _kindToNameTable[(int) kind];
-		}
-		
-		static enum StatisticKind NameToKind(const std::string &kindName);
-		
-		static const std::string &TableToName(const enum QualityTable table)
-		{
-			return _tableToNameTable[(int) table];
-		}
-		
-		const std::string TableToFilename(const enum QualityTable table) const
-		{
-			return _measurementSetName + '/' + TableToName(table);
-		}
-		
-		enum QualityTable DimensionToTable(const enum StatisticDimension dimension) const
-		{
-			return _dimensionToTableTable[(int) dimension];
-		}
-		
-		bool IsStatisticAvailable(enum StatisticDimension dimension, enum StatisticKind kind)
-		{
-			QualityTable table = DimensionToTable(dimension);
-			if(!TableExists(KindNameTable) || !TableExists(table))
-				return false;
-			unsigned kindIndex;
-			if(!QueryKindIndex(kind, kindIndex))
-				return false;
-			return hasOneEntry(table, kindIndex);
-		}
-		
-		void InitializeEmptyStatistic(enum StatisticDimension dimension, enum StatisticKind kind, unsigned polarizationCount)
-		{
-			if(!TableExists(KindNameTable))
-				createKindNameTable();
-			
-			QualityTable table = DimensionToTable(dimension);
-			if(!TableExists(table))
-				InitializeEmptyTable(table, polarizationCount);
-			else
-			{
-				removeStatisticFromStatTable(table, kind);
-			}
-		}
-		
-		void InitializeEmptyTable(enum QualityTable table, unsigned polarizationCount)
-		{
-			if(TableExists(table))
-				removeEntries(table);
-			else
-				createTable(table, polarizationCount);
-		}
-		
-		void RemoveTable(enum QualityTable table)
-		{
-			if(TableExists(table))
-			{
-				Close();
-				openMainTable(true);
-				if(_measurementSet->keywordSet().isDefined(TableToName(table)))
-					_measurementSet->rwKeywordSet().removeField(TableToName(table));
-				if(_measurementSet->isReadable(TableToFilename(table)))
-					casa::Table::deleteTable(TableToFilename(table));
-			}
-		}
-		
-		void RemoveAllQualityTables()
-		{
-			RemoveTable(BaselineTimeStatisticTable);
-			RemoveTable(BaselineStatisticTable);
-			RemoveTable(FrequencyStatisticTable);
-			RemoveTable(TimeStatisticTable);
-			RemoveTable(KindNameTable);
-		}
-		
-		unsigned StoreKindName(enum StatisticKind kind)
-		{
-			return StoreKindName(KindToName(kind));
-		}
-
-		unsigned StoreKindName(const std::string &name);
-		
-		void StoreTimeValue(double time, double frequency, const class StatisticalValue &value);
-		void StoreFrequencyValue(double frequency, const class StatisticalValue &value);
-		void StoreBaselineValue(unsigned antenna1, unsigned antenna2, double frequency, const class StatisticalValue &value);
-		void StoreBaselineTimeValue(unsigned antenna1, unsigned antenna2, double time, double frequency, const class StatisticalValue &value);
-		
-		unsigned QueryKindIndex(enum StatisticKind kind);
-		bool QueryKindIndex(enum StatisticKind kind, unsigned &destKindIndex);
-		unsigned StoreOrQueryKindIndex(enum StatisticKind kind)
-		{
-			unsigned kindIndex;
-			if(QueryKindIndex(kind, kindIndex))
-				return kindIndex;
-			else
-				return StoreKindName(kind);
-		}
-		
-		unsigned QueryStatisticEntryCount(enum StatisticDimension dimension, unsigned kindIndex);
-		
-		void QueryTimeStatistic(unsigned kindIndex, std::vector<std::pair<TimePosition, class StatisticalValue> > &entries);
-		void QueryFrequencyStatistic(unsigned kindIndex, std::vector<std::pair<FrequencyPosition, class StatisticalValue> > &entries);
-		void QueryBaselineStatistic(unsigned kindIndex, std::vector<std::pair<BaselinePosition, class StatisticalValue> > &entries);
-		void QueryBaselineTimeStatistic(unsigned kindIndex, std::vector<std::pair<BaselineTimePosition, class StatisticalValue> > &entries);
-		
-		unsigned GetPolarizationCount();
-	private:
-		QualityTablesFormatter(const QualityTablesFormatter &) { } // don't allow copies
-		void operator=(const QualityTablesFormatter &) { } // don't allow assignment
-		
-		const static std::string _kindToNameTable[];
-		const static std::string _tableToNameTable[];
-		const static enum QualityTable _dimensionToTableTable[];
-		
-		const static std::string ColumnNameAntenna1;
-		const static std::string ColumnNameAntenna2;
-		const static std::string ColumnNameFrequency;
-		const static std::string ColumnNameKind;
-		const static std::string ColumnNameName;
-		const static std::string ColumnNameTime;
-		const static std::string ColumnNameValue;
-		
-		casa::Table *_measurementSet;
-		const std::string _measurementSetName;
-		
-		casa::Table *_kindNameTable;
-		casa::Table *_timeTable;
-		casa::Table *_frequencyTable;
-		casa::Table *_baselineTable;
-		casa::Table *_baselineTimeTable;
-		
-		bool hasOneEntry(enum QualityTable table, unsigned kindIndex);
-		void removeStatisticFromStatTable(enum QualityTable table, enum StatisticKind kind);
-		void removeKindNameEntry(enum StatisticKind kind);
-		void removeEntries(enum QualityTable table);
-		
-		/**
-			* Add the time column to the table descriptor. Used by create..Table() methods.
-			* It holds "Measure"s of time, which is what casacore defines as a value including
-			* a unit and a reference frame.
-			*/
-		void addTimeColumn(casa::TableDesc &tableDesc);
-		
-		/**
-		 * Add the frequency column to the table descriptor. Used by create..Table() methods.
-		 * It holds "Quantum"s of frequency, which is what casacore defines as a value including
-		 * a unit (Hertz).
-		 */
-		void addFrequencyColumn(casa::TableDesc &tableDesc);
-		
-		/**
-		 * Add value column to the table descriptor. Used by create..Table() methods.
-		 * It consist of an array of statistics, each element holds a polarization.
-		 */
-		void addValueColumn(casa::TableDesc &tableDesc, unsigned polarizationCount);
-		
-		void createTable(enum QualityTable table, unsigned polarizationCount)
-		{
-			switch(table)
-			{
-				case KindNameTable:              createKindNameTable(); break;
-				case TimeStatisticTable:         createTimeStatisticTable(polarizationCount); break;
-				case FrequencyStatisticTable:    createFrequencyStatisticTable(polarizationCount); break;
-				case BaselineStatisticTable:     createBaselineStatisticTable(polarizationCount); break;
-				case BaselineTimeStatisticTable: createBaselineTimeStatisticTable(polarizationCount); break;
-				default: break;
-			}
-		}
-		
-		/**
-		 * Will add an empty table to the measurement set named "QUALITY_KIND_NAME" and
-		 * initialize its default column.
-		 * This table can hold a list of quality statistic types that are referred to in
-		 * the statistic value tables.
-		 */
-		void createKindNameTable();
-		/**
-		 * Will add an empty table to the measurement set named "QUALITY_TIME_STATISTIC" and
-		 * initialize its default column.
-		 * This table can hold several statistic kinds per time step. 
-		 * @param polarizationCount specifies the nr polarizations. This is required for the
-		 * shape of the value column.
-		 */
-		void createTimeStatisticTable(unsigned polarizationCount);
-		/**
-		 * Will add an empty table to the measurement set named "QUALITY_FREQUENCY_STATISTIC" and
-		 * initialize its default column.
-		 * This table can hold several statistic kinds per time step. 
-		 * @param polarizationCount specifies the nr polarizations. This is required for the
-		 * shape of the value column.
-		 */
-		void createFrequencyStatisticTable(unsigned polarizationCount);
-		/**
-		 * Will add an empty table to the measurement set named "QUALITY_BASELINE_STATISTIC" and
-		 * initialize its default column.
-		 * This table can hold several statistic kinds per time step. 
-		 * @param polarizationCount specifies the nr polarizations. This is required for the
-		 * shape of the value column.
-		 */
-		void createBaselineStatisticTable(unsigned polarizationCount);
-		void createBaselineTimeStatisticTable(unsigned polarizationCount);
-		unsigned findFreeKindIndex(casa::Table &kindTable);
-		
-		void openMainTable(bool needWrite);
-		void closeMainTable()
-		{
-			if(_measurementSet != 0)
-				delete _measurementSet;
-			_measurementSet = 0;
-		}
-		
-		void openTable(QualityTable table, bool needWrite, casa::Table **tablePtr);
-		void openKindNameTable(bool needWrite)
-		{
-			openTable(KindNameTable, needWrite, &_kindNameTable);
-		}
-		void openTimeTable(bool needWrite)
-		{
-			openTable(TimeStatisticTable, needWrite, &_timeTable);
-		}
-		void openFrequencyTable(bool needWrite)
-		{
-			openTable(FrequencyStatisticTable, needWrite, &_frequencyTable);
-		}
-		void openBaselineTable(bool needWrite)
-		{
-			openTable(BaselineStatisticTable, needWrite, &_baselineTable);
-		}
-		void openBaselineTimeTable(bool needWrite)
-		{
-			openTable(BaselineTimeStatisticTable, needWrite, &_baselineTimeTable);
-		}
-		casa::Table &getTable(QualityTable table, bool needWrite)
-		{
-			casa::Table **tablePtr = 0;
-			switch(table)
-			{
-				case KindNameTable: tablePtr = &_kindNameTable; break;
-				case TimeStatisticTable: tablePtr = &_timeTable; break;
-				case FrequencyStatisticTable: tablePtr = &_frequencyTable; break;
-				case BaselineStatisticTable: tablePtr = &_baselineTable; break;
-				case BaselineTimeStatisticTable: tablePtr = &_baselineTimeTable; break;
-			}
-			openTable(table, needWrite, tablePtr);
-			return **tablePtr;
-		}
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/quality/rayleighfitter.h b/CEP/DP3/AOFlagger/include/AOFlagger/quality/rayleighfitter.h
deleted file mode 100644
index 6bbea9e65b998b7fe97507927f43726253915f8f..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/quality/rayleighfitter.h
+++ /dev/null
@@ -1,31 +0,0 @@
-#ifndef RAYLEIGHFITTER_H
-#define RAYLEIGHFITTER_H
-
-#include "loghistogram.h"
-
-class RayleighFitter
-{
- public:
-	RayleighFitter() : _fitLogarithmic(true) { }
-	 
-	void Fit(double minVal, double maxVal, const LogHistogram &hist, double &sigma, double &n);
-	static double SigmaEstimate(const LogHistogram &hist);
-	static double NEstimate(const LogHistogram &hist, double rangeStart, double rangeEnd);
-	static void FindFitRangeUnderRFIContamination(double minPositiveAmplitude, double sigmaEstimate, double &minValue, double &maxValue);
-	static double RayleighValue(double sigma, double n, double x)
-	{
-		double sigmaP2 = sigma*sigma;
-		return n * x / (sigmaP2) * exp(-x*x/(2*sigmaP2));
-	}
-	static double ErrorOfFit(const LogHistogram &histogram, double rangeStart, double rangeEnd, double sigma, double n);
-	
-	const LogHistogram *_hist;
-	double _minVal, _maxVal;
-	
-	bool FitLogarithmic() const { return _fitLogarithmic; }
-	void SetFitLogarithmic(bool fitLogarithmic) { _fitLogarithmic = fitLogarithmic; }
- private:
-	 bool _fitLogarithmic;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/quality/statisticalvalue.h b/CEP/DP3/AOFlagger/include/AOFlagger/quality/statisticalvalue.h
deleted file mode 100644
index c9692dcddcadb7f0680585b462a4721176afd423..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/quality/statisticalvalue.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef MSIO_STATISTICAL_VALUE_H
-#define MSIO_STATISTICAL_VALUE_H
-
-#include <complex>
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-
-class StatisticalValue {
-	public:
-		StatisticalValue(unsigned _polarizationCount) :
-			_polarizationCount(_polarizationCount),
-			_values(new std::complex<float>[_polarizationCount])
-		{
-		}
-		
-		StatisticalValue(const StatisticalValue &source) :
-			_polarizationCount(source._polarizationCount),
-			_values(new std::complex<float>[source._polarizationCount])
-		{
-			_kindIndex = source._kindIndex;
-			for(unsigned i=0;i<_polarizationCount;++i)
-				_values[i] = source._values[i];
-		}
-		
-		~StatisticalValue()
-		{
-			delete[] _values;
-		}
-		
-		StatisticalValue &operator=(const StatisticalValue &source)
-		{
-			if(_polarizationCount != source._polarizationCount)
-			{
-				_polarizationCount = source._polarizationCount;
-				delete[] _values;
-				_values = new std::complex<float>[_polarizationCount];
-			}
-			_kindIndex = source._kindIndex;
-			for(unsigned i=0;i<_polarizationCount;++i)
-				_values[i] = source._values[i];
-			return *this;
-		}
-		
-		unsigned PolarizationCount() const { return _polarizationCount; }
-		
-		unsigned KindIndex() const { return _kindIndex; }
-		void SetKindIndex(unsigned kindIndex) { _kindIndex = kindIndex; }
-		
-		std::complex<float> Value(unsigned polarizationIndex) const { return _values[polarizationIndex]; }
-		void SetValue(unsigned polarizationIndex, std::complex<float> newValue)
-		{
-			_values[polarizationIndex] = newValue;
-		}
-	
-	private:
-		unsigned _polarizationCount;
-		unsigned _kindIndex;
-		std::complex<float> *_values;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/quality/statisticscollection.h b/CEP/DP3/AOFlagger/include/AOFlagger/quality/statisticscollection.h
deleted file mode 100644
index 8a4028e2aeacb383b77059404e15ffbfb34ae804..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/quality/statisticscollection.h
+++ /dev/null
@@ -1,976 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef STATISTICS_COLLECTION_H
-#define STATISTICS_COLLECTION_H
-
-#include <stdint.h>
-
-#include <AOFlagger/util/serializable.h>
-
-#include "baselinestatisticsmap.h"
-#include "defaultstatistics.h"
-#include "qualitytablesformatter.h"
-#include "statisticalvalue.h"
-#include <boost/concept_check.hpp>
-
-class StatisticsCollection : public Serializable
-{
-	private:
-		typedef std::map<double, DefaultStatistics> DoubleStatMap;
-	public:
-		StatisticsCollection() : _polarizationCount(0)
-		{
-		}
-		
-		explicit StatisticsCollection(unsigned polarizationCount) : _polarizationCount(polarizationCount)
-		{
-		}
-		
-		StatisticsCollection(const StatisticsCollection &source) :
-			_timeStatistics(source._timeStatistics),
-			_frequencyStatistics(source._frequencyStatistics),
-			_baselineStatistics(source._baselineStatistics),
-			_polarizationCount(source._polarizationCount)
-		{
-		}
-		
-		void Clear()
-		{
-			_timeStatistics.clear();
-			_frequencyStatistics.clear();
-			_baselineStatistics.clear();
-		}
-		
-		void InitializeBand(unsigned band, const double *frequencies, unsigned channelCount)
-		{
-			std::vector<DefaultStatistics *> pointers;
-			for(unsigned i=0;i<channelCount;++i)
-			{
-				pointers.push_back(&getFrequencyStatistic(frequencies[i]));
-			}
-			_bands.insert(std::pair<unsigned, std::vector<DefaultStatistics *> >(band, pointers));
-			double centralFrequency = (frequencies[0] + frequencies[channelCount-1]) / 2.0;
-			_centralFrequencies.insert(std::pair<unsigned, double>(band, centralFrequency));
-		}
-		
-		void Add(unsigned antenna1, unsigned antenna2, double time, unsigned band, int polarization, const float *reals, const float *imags, const bool *isRFI, const bool* origFlags, unsigned nsamples, unsigned step, unsigned stepRFI, unsigned stepFlags)
-		{
-			if(nsamples == 0) return;
-			
-			const double centralFrequency = _centralFrequencies.find(band)->second;
-			
-			addTimeAndBaseline(antenna1, antenna2, time, centralFrequency, polarization, reals, imags, isRFI, origFlags, nsamples, step, stepRFI, stepFlags, false);
-			if(antenna1 != antenna2)
-			  addFrequency(band, polarization, reals, imags, isRFI, origFlags, nsamples, step, stepRFI, stepFlags, false, false);
-			
-			// Allocate vector with length nsamples, so there is
-			// a diff element, even if nsamples=1.
-			std::vector<float> diffReals(nsamples);
-			std::vector<float> diffImags(nsamples);
-			bool *diffRFIFlags  = new bool[nsamples];
-			bool *diffOrigFlags = new bool[nsamples];
-			for (unsigned i=0;i<nsamples-1;++i)
-			{
-				diffReals[i] = (reals[(i+1)*step] - reals[i*step]) * M_SQRT1_2;
-				diffImags[i] = (imags[(i+1)*step] - imags[i*step]) * M_SQRT1_2;
-				diffRFIFlags[i] = isRFI[i*stepRFI] | isRFI[(i+1)*stepRFI];
-				diffOrigFlags[i] = origFlags[i*stepFlags] | origFlags[(i+1)*stepFlags];
-			}
-			addTimeAndBaseline(antenna1, antenna2, time, centralFrequency, polarization, &(diffReals[0]), &(diffImags[0]), diffRFIFlags, diffOrigFlags, nsamples-1, 1, 1, 1, true);
-			if(antenna1 != antenna2)
-			{
-			  addFrequency(band, polarization, &(diffReals[0]), &(diffImags[0]), diffRFIFlags, diffOrigFlags, nsamples-1, 1, 1, 1, true, false);
-			  addFrequency(band, polarization, &(diffReals[0]), &(diffImags[0]), diffRFIFlags, diffOrigFlags, nsamples-1, 1, 1, 1, true, true);
-			}
-			delete[] diffRFIFlags;
-			delete[] diffOrigFlags;
-		}
-		
-		void Add(unsigned antenna1, unsigned antenna2, double time, unsigned band, int polarization, const std::vector<std::complex<float> > &samples, const bool *isRFI)
-		{
-			const float *dataPtr =
-				reinterpret_cast<const float*>(&(samples[0]));
-			bool origFlag = false;
-			Add(antenna1, antenna2, time, band, polarization,
-					 dataPtr, dataPtr+1,   // real and imag parts
-			    isRFI, &origFlag, samples.size(), 2, 1, 0);
-		}
-		
-		void Save(QualityTablesFormatter &qualityData) const
-		{
-			saveTime(qualityData);
-			saveFrequency(qualityData);
-			saveBaseline(qualityData);
-		}
-		
-		void Load(QualityTablesFormatter &qualityData)
-		{
-			loadTime<false>(qualityData);
-			loadFrequency<false>(qualityData);
-			loadBaseline<false>(qualityData);
-		}
-		
-		void LoadTimeStatisticsOnly(QualityTablesFormatter &qualityData)
-		{
-			loadTime<false>(qualityData);
-		}
-		
-		void Add(QualityTablesFormatter &qualityData)
-		{
-			loadTime<true>(qualityData);
-			loadFrequency<true>(qualityData);
-			loadBaseline<true>(qualityData);
-		}
-		
-		void Add(const StatisticsCollection &collection)
-		{
-			addTime(collection);
-			addFrequency(collection);
-			addBaseline(collection);
-		}
-		
-		void GetGlobalTimeStatistics(DefaultStatistics &statistics)
-		{
-			statistics = getGlobalStatistics(_timeStatistics);
-		}
-		
-		void GetGlobalFrequencyStatistics(DefaultStatistics &statistics)
-		{
-			statistics = getGlobalStatistics(_frequencyStatistics);
-		}
-		
-		void GetGlobalAutoBaselineStatistics(DefaultStatistics &statistics)
-		{
-			statistics = getGlobalBaselineStatistics<true>();
-		}
-		
-		void GetGlobalCrossBaselineStatistics(DefaultStatistics &statistics)
-		{
-			statistics = getGlobalBaselineStatistics<false>();
-		}
-		
-		const BaselineStatisticsMap &BaselineStatistics() const
-		{
-			if(_baselineStatistics.size() == 1)
-				return _baselineStatistics.begin()->second;
-			else
-				throw std::runtime_error("Requesting single band single baseline statistics in statistics collection with multiple bands");
-		}
-		
-		const std::map<double, DefaultStatistics> &TimeStatistics() const
-		{
-			if(_timeStatistics.size() == 1)
-				return _timeStatistics.begin()->second;
-			else
-				throw std::runtime_error("Requesting single band single timestep statistics in statistics collection with multiple bands");
-		}
-		
-		const std::map<double, std::map<double, DefaultStatistics> > &AllTimeStatistics() const
-		{
-			return _timeStatistics;
-		}
-		
-		const std::map<double, DefaultStatistics> &FrequencyStatistics() const
-		{
-			return _frequencyStatistics;
-		}
-		
-		unsigned PolarizationCount() const
-		{
-			return _polarizationCount;
-		}
-		
-		void SetPolarizationCount(unsigned newCount)
-		{
-			_polarizationCount = newCount;
-		}
-		
-		virtual void Serialize(std::ostream &stream) const
-		{
-			SerializeToUInt64(stream, _polarizationCount);
-			serializeTime(stream);
-			serializeFrequency(stream);
-			serializeBaselines(stream);
-		}
-		
-		virtual void Unserialize(std::istream &stream)
-		{
-			_polarizationCount = UnserializeUInt64(stream);
-			unserializeTime(stream);
-			unserializeFrequency(stream);
-			unserializeBaselines(stream);
-		}
-		
-		void IntegrateBaselinesToOneChannel()
-		{
-			const size_t size = _baselineStatistics.size();
-			if(size > 1)
-			{
-				BaselineStatisticsMap fullMap(_polarizationCount);
-				double frequencySum = 0.0;
-				
-				for(std::map<double, BaselineStatisticsMap>::const_iterator i=_baselineStatistics.begin();i!=_baselineStatistics.end();++i)
-				{
-					frequencySum += i->first;
-					fullMap += i->second;
-				}
-				
-				_baselineStatistics.clear();
-				_baselineStatistics.insert(std::pair<double, BaselineStatisticsMap>(frequencySum/size, fullMap));
-			}
-		}
-		
-		void IntegrateTimeToOneChannel()
-		{
-			const size_t size = _timeStatistics.size();
-			if(size > 1)
-			{
-				DoubleStatMap fullMap;
-				double frequencySum = 0.0;
-				
-				for(std::map<double, DoubleStatMap>::const_iterator i=_timeStatistics.begin();i!=_timeStatistics.end();++i)
-				{
-					frequencySum += i->first;
-					addToDoubleStatMap(fullMap, i->second);
-				}
-				
-				_timeStatistics.clear();
-				_timeStatistics.insert(std::pair<double, DoubleStatMap>(frequencySum/size, fullMap));
-			}
-		}
-		
-		void LowerTimeResolution(size_t maxSteps)
-		{
-			for(std::map<double, DoubleStatMap>::iterator i=_timeStatistics.begin();i!=_timeStatistics.end();++i)
-			{
-				lowerResolution(i->second, maxSteps);
-			}
-		}
-		
-		void LowerFrequencyResolution(size_t maxSteps)
-		{
-			lowerResolution(_frequencyStatistics, maxSteps);
-		}
-		
-		/**
-		 * The regrid method will force all channels(/sub-bands) inside the collection to have the same
-		 * uniform grid. It will do this by moving around time steps, using the first grid as reference.
-		 * This is useful for raw (not NDPPP-ed) data, that might contain slightly different time steps in the
-		 * different sub-bands, but are otherwise similarly gridded.
-		 */
-		void RegridTime()
-		{
-			if(_timeStatistics.size() > 1)
-			{
-				std::map<double, DoubleStatMap>::iterator i = _timeStatistics.begin();
-				const DoubleStatMap &referenceMap = i->second;
-				++i;
-				do {
-					regrid(referenceMap, i->second);
-					++i;
-				} while(i != _timeStatistics.end());
-			}
-		}
-	private:
-		struct StatisticSaver
-		{
-			QualityTablesFormatter::StatisticDimension dimension;
-			double time;
-			double frequency;
-			unsigned antenna1;
-			unsigned antenna2;
-			QualityTablesFormatter *qualityData;
-			
-			void Save(StatisticalValue &value, unsigned kindIndex)
-			{
-				value.SetKindIndex(kindIndex);
-				switch(dimension)
-				{
-					case QualityTablesFormatter::TimeDimension:
-						qualityData->StoreTimeValue(time, frequency, value);
-						break;
-					case QualityTablesFormatter::FrequencyDimension:
-						qualityData->StoreFrequencyValue(frequency, value);
-						break;
-					case QualityTablesFormatter::BaselineDimension:
-						qualityData->StoreBaselineValue(antenna1, antenna2, frequency, value);
-						break;
-					case QualityTablesFormatter::BaselineTimeDimension:
-						qualityData->StoreBaselineTimeValue(antenna1, antenna2, time, frequency, value);
-						break;
-				}
-			}
-		};
-		
-		struct Indices
-		{
-			unsigned kindRFICount;
-			unsigned kindCount;
-			unsigned kindSum;
-			unsigned kindSumP2;
-			unsigned kindDCount;
-			unsigned kindDSum;
-			unsigned kindDSumP2;
-			
-			void fill(QualityTablesFormatter &qd)
-			{
-				kindRFICount = qd.StoreOrQueryKindIndex(QualityTablesFormatter::RFICountStatistic),
-				kindCount = qd.StoreOrQueryKindIndex(QualityTablesFormatter::CountStatistic),
-				kindSum = qd.StoreOrQueryKindIndex(QualityTablesFormatter::SumStatistic),
-				kindSumP2 = qd.StoreOrQueryKindIndex(QualityTablesFormatter::SumP2Statistic),
-				kindDCount = qd.StoreOrQueryKindIndex(QualityTablesFormatter::DCountStatistic),
-				kindDSum = qd.StoreOrQueryKindIndex(QualityTablesFormatter::DSumStatistic),
-				kindDSumP2 = qd.StoreOrQueryKindIndex(QualityTablesFormatter::DSumP2Statistic);
-			}
-		};
-		
-		StatisticsCollection & operator=(const StatisticsCollection &/*source*/) // don't allow assignment
-		{
-			return *this;
-		}
-
-		void addTimeAndBaseline(unsigned antenna1, unsigned antenna2, double time, double centralFrequency, int polarization, const float *reals, const float *imags, const bool *isRFI, const bool* origFlags, unsigned nsamples, unsigned step, unsigned stepRFI, unsigned stepFlags, bool isDiff)
-		{
-			unsigned long rfiCount = 0;
-			unsigned long count = 0;
-			long double sum_R = 0.0, sum_I = 0.0;
-			long double sumP2_R = 0.0, sumP2_I = 0.0;
-			for(unsigned j=0;j<nsamples;++j)
-			{
-			    if (!origFlags[j*stepFlags]) {
-				unsigned i = j*step;
-				if(std::isfinite(reals[i]) && std::isfinite(imags[i]))
-				{
-					if(isRFI[j*stepRFI])
-					{
-						++rfiCount;
-					} else {
-						const long double rVal = reals[i];
-						const long double iVal = imags[i];
-						++count;
-						sum_R += rVal;
-						sum_I += iVal;
-						sumP2_R += rVal*rVal;
-						sumP2_I += iVal*iVal;
-					}
-				}
-			    }
-			}
-			
-			if(antenna1 != antenna2)
-			{
-				DefaultStatistics &timeStat = getTimeStatistic(time, centralFrequency);
-				addToStatistic(timeStat, polarization, count, sum_R, sum_I, sumP2_R, sumP2_I, rfiCount, isDiff);
-			}
-			DefaultStatistics &baselineStat = getBaselineStatistic(antenna1, antenna2, centralFrequency);
-			addToStatistic(baselineStat, polarization, count, sum_R, sum_I, sumP2_R, sumP2_I, rfiCount, isDiff);
-		}
-		
-		void addToStatistic(DefaultStatistics &statistic, unsigned polarization, unsigned long count, long double sum_R, long double sum_I, long double sumP2_R, long double sumP2_I, unsigned long rfiCount, bool isDiff)
-		{
-			if(isDiff)
-			{
-				statistic.dCount[polarization] += count;
-				statistic.dSum[polarization] += std::complex<long double>(sum_R, sum_I);
-				statistic.dSumP2[polarization] += std::complex<long double>(sumP2_R, sumP2_I);
-			} else {
-				statistic.count[polarization] += count;
-				statistic.sum[polarization] += std::complex<long double>(sum_R, sum_I);
-				statistic.sumP2[polarization] += std::complex<long double>(sumP2_R, sumP2_I);
-				statistic.rfiCount[polarization] += rfiCount;
-			}
-		}
-		
-		void addFrequency(unsigned band, int polarization, const float *reals, const float *imags, const bool *isRFI, const bool *origFlags, unsigned nsamples, unsigned step, unsigned stepRFI, unsigned stepFlags, bool isDiff, bool shiftOneUp)
-		{
-			std::vector<DefaultStatistics *> &bandStats = _bands.find(band)->second;
-			const unsigned fAdd = shiftOneUp ? 1 : 0;
-			for(unsigned j=0;j<nsamples;++j)
-			{
-				if (!origFlags[j*stepFlags])
-				{
-					unsigned f = j*step;
-					if(std::isfinite(reals[f]) && std::isfinite(imags[f]))
-					{
-						DefaultStatistics &freqStat = *bandStats[j + fAdd];
-						if(isRFI[j*stepRFI])
-						{
-							addToStatistic(freqStat, polarization, 0, 0.0, 0.0, 0.0, 0.0, 1, isDiff);
-						} else {
-							const long double r = reals[f], i = imags[f];
-							addToStatistic(freqStat, polarization, 1, r, i, r*r, i*i, 0, isDiff);
-						}
-					}
-				}
-			}
-		}
-		
-		void initializeEmptyStatistics(QualityTablesFormatter &qualityData, QualityTablesFormatter::StatisticDimension dimension) const
-		{
-			qualityData.InitializeEmptyStatistic(dimension, QualityTablesFormatter::RFICountStatistic, _polarizationCount);
-			qualityData.InitializeEmptyStatistic(dimension, QualityTablesFormatter::CountStatistic, _polarizationCount);
-			qualityData.InitializeEmptyStatistic(dimension, QualityTablesFormatter::SumStatistic, _polarizationCount);
-			qualityData.InitializeEmptyStatistic(dimension, QualityTablesFormatter::SumP2Statistic, _polarizationCount);
-			qualityData.InitializeEmptyStatistic(dimension, QualityTablesFormatter::DCountStatistic, _polarizationCount);
-			qualityData.InitializeEmptyStatistic(dimension, QualityTablesFormatter::DSumStatistic, _polarizationCount);
-			qualityData.InitializeEmptyStatistic(dimension, QualityTablesFormatter::DSumP2Statistic, _polarizationCount);
-		}
-		
-		void saveEachStatistic(StatisticSaver &saver, const DefaultStatistics &stat, const Indices &indices) const
-		{
-			StatisticalValue value(_polarizationCount);
-			
-			for(unsigned p=0;p<_polarizationCount;++p)
-				value.SetValue(p, std::complex<float>(stat.rfiCount[p], 0.0f));
-			saver.Save(value, indices.kindRFICount);
-			
-			for(unsigned p=0;p<_polarizationCount;++p)
-				value.SetValue(p, std::complex<float>(stat.count[p], 0.0f));
-			saver.Save(value, indices.kindCount);
-
-			for(unsigned p=0;p<_polarizationCount;++p)
-				value.SetValue(p, stat.Sum<float>(p));
-			saver.Save(value, indices.kindSum);
-
-			for(unsigned p=0;p<_polarizationCount;++p)
-				value.SetValue(p, stat.SumP2<float>(p));
-			saver.Save(value, indices.kindSumP2);
-			
-			for(unsigned p=0;p<_polarizationCount;++p)
-				value.SetValue(p, std::complex<float>(stat.dCount[p], 0.0f));
-			saver.Save(value, indices.kindDCount);
-			
-			for(unsigned p=0;p<_polarizationCount;++p)
-				value.SetValue(p, stat.DSum<float>(p));
-			saver.Save(value, indices.kindDSum);
-
-			for(unsigned p=0;p<_polarizationCount;++p)
-				value.SetValue(p, stat.DSumP2<float>(p));
-			saver.Save(value, indices.kindDSumP2);
-		}
-		
-		void saveTime(QualityTablesFormatter &qd) const
-		{
-			initializeEmptyStatistics(qd, QualityTablesFormatter::TimeDimension);
-			
-			Indices indices;
-			indices.fill(qd);
-				
-			StatisticSaver saver;
-			saver.dimension = QualityTablesFormatter::TimeDimension;
-			saver.qualityData = &qd;
-			
-			for(std::map<double, DoubleStatMap>::const_iterator j=_timeStatistics.begin();j!=_timeStatistics.end();++j)
-			{
-				saver.frequency = j->first;
-				const DoubleStatMap &map = j->second;
-				
-				for(DoubleStatMap::const_iterator i=map.begin();i!=map.end();++i)
-				{
-					saver.time = i->first;
-					const DefaultStatistics &stat = i->second;
-					
-					saveEachStatistic(saver, stat, indices);
-				}
-			}
-		}
-		
-		void saveFrequency(QualityTablesFormatter &qd) const
-		{
-			initializeEmptyStatistics(qd, QualityTablesFormatter::FrequencyDimension);
-			
-			Indices indices;
-			indices.fill(qd);
-				
-			StatisticSaver saver;
-			saver.dimension = QualityTablesFormatter::FrequencyDimension;
-			saver.qualityData = &qd;
-			
-			for(DoubleStatMap::const_iterator i=_frequencyStatistics.begin();i!=_frequencyStatistics.end();++i)
-			{
-				saver.frequency = i->first;
-				const DefaultStatistics &stat = i->second;
-				
-				saveEachStatistic(saver, stat, indices);
-			}
-		}
-		
-		void saveBaseline(QualityTablesFormatter &qd) const
-		{
-			initializeEmptyStatistics(qd, QualityTablesFormatter::BaselineDimension);
-			
-			Indices indices;
-			indices.fill(qd);
-			
-			StatisticSaver saver;
-			saver.dimension = QualityTablesFormatter::BaselineDimension;
-			saver.frequency = centralFrequency();
-			saver.qualityData = &qd;
-			
-			for(std::map<double, BaselineStatisticsMap>::const_iterator j=_baselineStatistics.begin();j!=_baselineStatistics.end();++j)
-			{
-				saver.frequency = j->first;
-				const BaselineStatisticsMap &map = j->second;
-				
-				const std::vector<std::pair<unsigned, unsigned> > baselines = map.BaselineList();
-			
-				for(std::vector<std::pair<unsigned, unsigned> >::const_iterator i=baselines.begin();i!=baselines.end();++i)
-				{
-					saver.antenna1 = i->first;
-					saver.antenna2 = i->second;
-					
-					const DefaultStatistics &stat = map.GetStatistics(saver.antenna1, saver.antenna2);
-					
-					saveEachStatistic(saver, stat, indices);
-				}
-			}
-		}
-		
-		DefaultStatistics &getTimeStatistic(double time, double centralFrequency)
-		{
-			// We use find() to see if the value exists, and only use insert() when it does not,
-			// because insert is slow (because a "Statistic" needs to be created). Holds for both
-			// frequency and time maps.
-			std::map<double, DoubleStatMap>::iterator i = _timeStatistics.find(centralFrequency);
-			if(i == _timeStatistics.end())
-			{
-				i = _timeStatistics.insert(std::pair<double, DoubleStatMap>(centralFrequency, DoubleStatMap())).first;
-			}
-			DoubleStatMap &selectedTimeStatistic = i->second;
-			
-			return getDoubleStatMapStatistic(selectedTimeStatistic, time);
-		}
-		
-		DefaultStatistics &getFrequencyStatistic(double frequency)
-		{
-			return getDoubleStatMapStatistic(_frequencyStatistics, frequency);
-		}
-		
-		DefaultStatistics &getDoubleStatMapStatistic(DoubleStatMap &map, double key)
-		{
-			// Use insert() only when not exist, as it is slower then find because a
-			// Statistic is created.
-			DoubleStatMap::iterator i = map.find(key);
-			if(i == map.end())
-			{
-				i = map.insert(std::pair<double, DefaultStatistics>(key, DefaultStatistics(_polarizationCount))).first;
-			}
-			return i->second;
-		}
-		
-		DefaultStatistics &getBaselineStatistic(unsigned antenna1, unsigned antenna2, double centralFrequency)
-		{
-			std::map<double, BaselineStatisticsMap>::iterator i = _baselineStatistics.find(centralFrequency);
-			if(i == _baselineStatistics.end())
-			{
-				i = _baselineStatistics.insert(std::pair<double, BaselineStatisticsMap>(centralFrequency, BaselineStatisticsMap(_polarizationCount))).first;
-			}
-			BaselineStatisticsMap &selectedBaselineStatistic = i->second;
-			return selectedBaselineStatistic.GetStatistics(antenna1, antenna2);
-		}
-		
-		template<bool PerformAdd, typename T>
-		void assignOrAdd(T &value, const T otherValue)
-		{
-			if(PerformAdd)
-				value += otherValue;
-			else
-				value = otherValue;
-		}
-		
-		template<bool AddStatistics>
-		void assignStatistic(DefaultStatistics &destination, const StatisticalValue &source, QualityTablesFormatter::StatisticKind kind)
-		{
-			for(unsigned p=0;p<_polarizationCount;++p)
-			{
-				switch(kind)
-				{
-					case QualityTablesFormatter::RFICountStatistic:
-						assignOrAdd<AddStatistics>(destination.rfiCount[p] , (long unsigned) source.Value(p).real());
-						break;
-					case QualityTablesFormatter::CountStatistic:
-						assignOrAdd<AddStatistics>(destination.count[p] , (long unsigned) source.Value(p).real());
-						break;
-					case QualityTablesFormatter::SumStatistic:
-						assignOrAdd<AddStatistics>(destination.sum[p] , std::complex<long double>(source.Value(p).real(), source.Value(p).imag() ));
-						break;
-					case QualityTablesFormatter::SumP2Statistic:
-						assignOrAdd<AddStatistics>(destination.sumP2[p] , std::complex<long double>(source.Value(p).real(), source.Value(p).imag() ));
-						break;
-					case QualityTablesFormatter::DCountStatistic:
-						assignOrAdd<AddStatistics>(destination.dCount[p] , (long unsigned) source.Value(p).real());
-						break;
-					case QualityTablesFormatter::DSumStatistic:
-						assignOrAdd<AddStatistics>(destination.dSum[p] , std::complex<long double>(source.Value(p).real(), source.Value(p).imag() ));
-						break;
-					case QualityTablesFormatter::DSumP2Statistic:
-						assignOrAdd<AddStatistics>(destination.dSumP2[p] , std::complex<long double>(source.Value(p).real(), source.Value(p).imag() ));
-						break;
-					default:
-						break;
-				}
-			}
-		}
-		
-		void forEachDefaultStatistic(QualityTablesFormatter &qd, void (StatisticsCollection::*functionName)(QualityTablesFormatter &, QualityTablesFormatter::StatisticKind))
-		{
-			(this->*functionName)(qd, QualityTablesFormatter::CountStatistic);
-			(this->*functionName)(qd, QualityTablesFormatter::SumStatistic);
-			(this->*functionName)(qd, QualityTablesFormatter::SumP2Statistic);
-			(this->*functionName)(qd, QualityTablesFormatter::DCountStatistic);
-			(this->*functionName)(qd, QualityTablesFormatter::DSumStatistic);
-			(this->*functionName)(qd, QualityTablesFormatter::DSumP2Statistic);
-			(this->*functionName)(qd, QualityTablesFormatter::RFICountStatistic);
-		}
-		
-		template<bool AddStatistics>
-		void loadSingleTimeStatistic(QualityTablesFormatter &qd, QualityTablesFormatter::StatisticKind kind)
-		{
-			std::vector<std::pair<QualityTablesFormatter::TimePosition, StatisticalValue> > values;
-			unsigned kindIndex = qd.QueryKindIndex(kind);
-			qd.QueryTimeStatistic(kindIndex, values);
-			for(std::vector<std::pair<QualityTablesFormatter::TimePosition, StatisticalValue> >::const_iterator i=values.begin();i!=values.end();++i)
-			{
-				const QualityTablesFormatter::TimePosition &position = i->first;
-				const StatisticalValue &statValue = i->second;
-				
-				DefaultStatistics &stat = getTimeStatistic(position.time, position.frequency);
-				assignStatistic<AddStatistics>(stat, statValue, kind);
-			}
-		}
-		
-		template<bool AddStatistics>
-		void loadTime(QualityTablesFormatter &qd)
-		{
-			forEachDefaultStatistic(qd, &StatisticsCollection::loadSingleTimeStatistic<AddStatistics>);
-		}
-		
-		template<bool AddStatistics>
-		void loadSingleFrequencyStatistic(QualityTablesFormatter &qd, QualityTablesFormatter::StatisticKind kind)
-		{
-			std::vector<std::pair<QualityTablesFormatter::FrequencyPosition, StatisticalValue> > values;
-			unsigned kindIndex = qd.QueryKindIndex(kind);
-			qd.QueryFrequencyStatistic(kindIndex, values);
-			for(std::vector<std::pair<QualityTablesFormatter::FrequencyPosition, StatisticalValue> >::const_iterator i=values.begin();i!=values.end();++i)
-			{
-				const QualityTablesFormatter::FrequencyPosition &position = i->first;
-				const StatisticalValue &statValue = i->second;
-				
-				DefaultStatistics &stat = getFrequencyStatistic(position.frequency);
-				assignStatistic<AddStatistics>(stat, statValue, kind);
-			}
-		}
-		
-		template<bool AddStatistics>
-		void loadFrequency(QualityTablesFormatter &qd)
-		{
-			forEachDefaultStatistic(qd, &StatisticsCollection::loadSingleFrequencyStatistic<AddStatistics>);
-		}
-		
-		template<bool AddStatistics>
-		void loadSingleBaselineStatistic(QualityTablesFormatter &qd, QualityTablesFormatter::StatisticKind kind)
-		{
-			std::vector<std::pair<QualityTablesFormatter::BaselinePosition, StatisticalValue> > values;
-			unsigned kindIndex = qd.QueryKindIndex(kind);
-			qd.QueryBaselineStatistic(kindIndex, values);
-			for(std::vector<std::pair<QualityTablesFormatter::BaselinePosition, StatisticalValue> >::const_iterator i=values.begin();i!=values.end();++i)
-			{
-				const QualityTablesFormatter::BaselinePosition &position = i->first;
-				const StatisticalValue &statValue = i->second;
-				
-				DefaultStatistics &stat = getBaselineStatistic(position.antenna1, position.antenna2, position.frequency);
-				assignStatistic<AddStatistics>(stat, statValue, kind);
-			}
-		}
-		
-		template<bool AddStatistics>
-		void loadBaseline(QualityTablesFormatter &qd)
-		{
-			forEachDefaultStatistic(qd, &StatisticsCollection::loadSingleBaselineStatistic<AddStatistics>);
-		}
-		
-		double centralFrequency() const
-		{
-			double min =_frequencyStatistics.begin()->first;
-			double max = _frequencyStatistics.rbegin()->first;
-			return (min + max) / 2.0;
-		}
-		
-		DefaultStatistics getGlobalStatistics(const DoubleStatMap &statMap) const
-		{
-			DefaultStatistics global(_polarizationCount);
-			for(DoubleStatMap::const_iterator i=statMap.begin();i!=statMap.end();++i)
-			{
-				const DefaultStatistics &stat = i->second;
-				global += stat;
-			}
-			return global;
-		}
-		
-		DefaultStatistics getGlobalStatistics(const std::map<double, DoubleStatMap> &statMap) const
-		{
-			DefaultStatistics global(_polarizationCount);
-			for(std::map<double, DoubleStatMap>::const_iterator i=statMap.begin();i!=statMap.end();++i)
-			{
-				const DefaultStatistics &stat = getGlobalStatistics(i->second);
-				global += stat;
-			}
-			return global;
-		}
-		
-		template<bool AutoCorrelations>
-		DefaultStatistics getGlobalBaselineStatistics() const
-		{
-			DefaultStatistics global(_polarizationCount);
-			
-			for(std::map<double, BaselineStatisticsMap>::const_iterator f=_baselineStatistics.begin();f!=_baselineStatistics.end();++f)
-			{
-				const BaselineStatisticsMap &map = f->second;
-				const std::vector<std::pair<unsigned, unsigned> > baselines = map.BaselineList();
-				
-				for(std::vector<std::pair<unsigned, unsigned> >::const_iterator i=baselines.begin();i!=baselines.end();++i)
-				{
-					const unsigned
-						antenna1 = i->first,
-						antenna2 =  i->second;
-					if( ((antenna1 == antenna2) && AutoCorrelations) || ((antenna1 != antenna2) && (!AutoCorrelations)))
-					{
-						const DefaultStatistics &stat = map.GetStatistics(antenna1, antenna2);
-						global += stat;
-					}
-				}
-			}
-			return global;
-		}
-		
-		void serializeTime(std::ostream &stream) const
-		{
-			SerializeToUInt64(stream, _timeStatistics.size());
-			
-			for(std::map<double, DoubleStatMap>::const_iterator i=_timeStatistics.begin();i!=_timeStatistics.end();++i)
-			{
-				const double frequency = i->first;
-				const DoubleStatMap &map = i->second;
-				
-				SerializeToDouble(stream, frequency);
-				serializeDoubleStatMap(stream, map);
-			}
-		}
-		
-		void unserializeTime(std::istream &stream)
-		{
-			_timeStatistics.clear();
-			size_t count = (size_t) UnserializeUInt64(stream);
-			
-			std::map<double, DoubleStatMap>::iterator insertPos = _timeStatistics.begin();
-			for(size_t i=0;i<count;++i)
-			{
-				double frequency = UnserializeDouble(stream);
-				insertPos =
-					_timeStatistics.insert(insertPos, std::pair<double, DoubleStatMap>(frequency, DoubleStatMap()));
-				unserializeDoubleStatMap(stream, insertPos->second);
-			}
-		}
-		
-		void serializeFrequency(std::ostream &stream) const
-		{
-			serializeDoubleStatMap(stream, _frequencyStatistics);
-		}
-		
-		void unserializeFrequency(std::istream &stream)
-		{
-			_frequencyStatistics.clear();
-			unserializeDoubleStatMap(stream, _frequencyStatistics);
-		}
-		
-		void serializeBaselines(std::ostream &stream) const
-		{
-			SerializeToUInt64(stream, _baselineStatistics.size());
-			
-			for(std::map<double, BaselineStatisticsMap>::const_iterator i=_baselineStatistics.begin();i!=_baselineStatistics.end();++i)
-			{
-				const double frequency = i->first;
-				const BaselineStatisticsMap &map = i->second;
-				
-				SerializeToDouble(stream, frequency);
-				map.Serialize(stream);
-			}
-		}
-		
-		void unserializeBaselines(std::istream &stream)
-		{
-			_baselineStatistics.clear();
-			size_t count = (size_t) UnserializeUInt64(stream);
-			
-			std::map<double, BaselineStatisticsMap>::iterator insertPos = _baselineStatistics.begin();
-			for(size_t i=0;i<count;++i)
-			{
-				double frequency = UnserializeDouble(stream);
-				insertPos = _baselineStatistics.insert(
-					insertPos, std::pair<double, BaselineStatisticsMap>(frequency, BaselineStatisticsMap(_polarizationCount)));
-				insertPos->second.Unserialize(stream);
-			}
-		}
-		
-		void serializeDoubleStatMap(std::ostream &stream, const DoubleStatMap &statMap) const
-		{
-			uint64_t statCount = statMap.size();
-			stream.write(reinterpret_cast<char *>(&statCount), sizeof(statCount));
-			for(DoubleStatMap::const_iterator i=statMap.begin();i!=statMap.end();++i)
-			{
-				const double &key = i->first;
-				const DefaultStatistics &stat = i->second;
-				stream.write(reinterpret_cast<const char *>(&key), sizeof(key));
-				stat.Serialize(stream);
-			}
-		}
-		
-		void unserializeDoubleStatMap(std::istream &stream, DoubleStatMap &statMap) const
-		{
-			size_t count = (size_t) UnserializeUInt64(stream);
-			
-			std::map<double, DefaultStatistics>::iterator insertPos = statMap.begin();
-			for(size_t i=0;i<count;++i)
-			{
-				double key = UnserializeDouble(stream);
-				insertPos =
-					statMap.insert(insertPos, std::pair<double, DefaultStatistics>(key, DefaultStatistics(_polarizationCount)));
-				insertPos->second.Unserialize(stream);
-			}
-		}
-		
-		void addTime(const StatisticsCollection &collection)
-		{
-			for(std::map<double, DoubleStatMap>::const_iterator i=collection._timeStatistics.begin();i!=collection._timeStatistics.end();++i)
-			{
-				const double frequency = i->first;
-				const DoubleStatMap &map = i->second;
-				
-				for(DoubleStatMap::const_iterator j=map.begin();j!=map.end();++j)
-				{
-					const double time = j->first;
-					const DefaultStatistics &stat = j->second;
-					getTimeStatistic(time, frequency) += stat;
-				}
-			}
-		}
-		
-		void addFrequency(const StatisticsCollection &collection)
-		{
-			for(DoubleStatMap::const_iterator j=collection._frequencyStatistics.begin();j!=collection._frequencyStatistics.end();++j)
-			{
-				const double frequency = j->first;
-				const DefaultStatistics &stat = j->second;
-				getFrequencyStatistic(frequency) += stat;
-			}
-		}
-		
-		void addBaseline(const StatisticsCollection &collection)
-		{
-			for(std::map<double, BaselineStatisticsMap>::const_iterator i=collection._baselineStatistics.begin();i!=collection._baselineStatistics.end();++i)
-			{
-				const double frequency = i->first;
-				const BaselineStatisticsMap &map = i->second;
-				
-				vector<std::pair<unsigned, unsigned> > baselines = map.BaselineList();
-				for(vector<std::pair<unsigned, unsigned> >::const_iterator j=baselines.begin();j!=baselines.end();++j)
-				{
-					const unsigned antenna1 = j->first;
-					const unsigned antenna2 = j->second;
-					const DefaultStatistics &stat = map.GetStatistics(antenna1, antenna2);
-					getBaselineStatistic(antenna1, antenna2, frequency) += stat;
-				}
-			}
-		}
-		
-		void addToDoubleStatMap(DoubleStatMap &dest, const DoubleStatMap &source)
-		{
-			for(DoubleStatMap::const_iterator i=source.begin();i!=source.end();++i)
-			{
-				double key = i->first;
-				const DefaultStatistics &sourceStats = i->second;
-				
-				getDoubleStatMapStatistic(dest, key) += sourceStats;
-			}
-		}
-		
-		void lowerResolution(DoubleStatMap &map, size_t maxSteps) const
-		{
-			if(map.size() > maxSteps)
-			{
-				DoubleStatMap newMap;
-				const size_t factor = (map.size() + maxSteps - 1) / maxSteps;
-				for(DoubleStatMap::iterator i=map.begin();i!=map.end();)
-				{
-					DefaultStatistics integratedStat(_polarizationCount);
-					double keySum = 0.0;
-					size_t count = 0;
-					for(size_t x=0;x<factor && i!=map.end();++x)
-					{
-						++count;
-						keySum += i->first;
-						integratedStat += i->second;
-						++i;
-					}
-					if(count > 0)
-						newMap.insert(std::pair<double, DefaultStatistics>(keySum / count, integratedStat));
-				}
-				map = newMap;
-			}
-		}
-		
-		static void regrid(const DoubleStatMap &referenceMap, DoubleStatMap &regridMap)
-		{
-			DoubleStatMap newMap;
-			for(DoubleStatMap::const_iterator i=regridMap.begin();i!=regridMap.end();++i)
-			{
-				double key = i->first;
-				
-				// find the key in the reference map that is closest to this key, if it is within range
-				DoubleStatMap::const_iterator bound = referenceMap.lower_bound(key);
-				if(bound != referenceMap.end())
-				{
-					double rightKey = bound->first;
-					if(bound != referenceMap.begin())
-					{
-						--bound;
-						double leftKey = bound->first;
-						if(key - rightKey < leftKey - key)
-							key = rightKey;
-						else
-							key = leftKey;
-					}
-				}
-				newMap.insert(std::pair<double, DefaultStatistics>(key, i->second));
-			}
-			regridMap = newMap;
-		}
-		
-		std::map<double, DoubleStatMap> _timeStatistics;
-		DoubleStatMap _frequencyStatistics;
-		std::map<double, BaselineStatisticsMap> _baselineStatistics;
-		
-		std::map<unsigned, std::vector< DefaultStatistics *> > _bands;
-		std::map<unsigned, double> _centralFrequencies;
-		
-		unsigned _polarizationCount;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/quality/statisticsderivator.h b/CEP/DP3/AOFlagger/include/AOFlagger/quality/statisticsderivator.h
deleted file mode 100644
index 19dd7a4fabb63137902989a4d854729df9eb3e5d..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/quality/statisticsderivator.h
+++ /dev/null
@@ -1,321 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef QUALITY__STATISTICS_DERIVATOR_H
-#define QUALITY__STATISTICS_DERIVATOR_H
-
-#include "statisticscollection.h"
-
-#include <complex>
-#include <set>
-
-#include <AOFlagger/msio/antennainfo.h>
-#include <AOFlagger/msio/timefrequencydata.h>
-
-#include <AOFlagger/strategy/imagesets/noisestatimageset.h>
-
-struct stat;
-class StatisticsDerivator
-{
-	public:
-		StatisticsDerivator(const StatisticsCollection &collection) :
-			_collection(collection)
-		{
-		}
-		
-		std::complex<long double> GetComplexBaselineStatistic(QualityTablesFormatter::StatisticKind kind, unsigned antenna1, unsigned antenna2, unsigned polarization) const
-		{
-			const DefaultStatistics &statistics = _collection.BaselineStatistics().GetStatistics(antenna1, antenna2);
-			return deriveComplex<long double>(kind, statistics, polarization);
-		}
-		
-		std::complex<long double> GetComplexTimeStatistic(QualityTablesFormatter::StatisticKind kind, double time, unsigned polarization) const
-		{
-			const DefaultStatistics &statistics = _collection.TimeStatistics().find(time)->second;
-			return deriveComplex<long double>(kind, statistics, polarization);
-		}
-	
-		std::complex<long double> GetComplexFrequencyStatistic(QualityTablesFormatter::StatisticKind kind, double frequency, unsigned polarization) const
-		{
-			const DefaultStatistics &statistics = _collection.FrequencyStatistics().find(frequency)->second;
-			return deriveComplex<long double>(kind, statistics, polarization);
-		}
-	
-		static std::complex<long double> GetComplexStatistic(QualityTablesFormatter::StatisticKind kind, const DefaultStatistics &statistics, unsigned polarization)
-		{
-			return deriveComplex<long double>(kind, statistics, polarization);
-		}
-		
-		static long double GetStatisticAmplitude(QualityTablesFormatter::StatisticKind kind, const DefaultStatistics &statistics, unsigned polarization)
-		{
-			const std::complex<long double> val = GetComplexStatistic(kind, statistics, polarization);
-			return sqrtl(val.real()*val.real() + val.imag()*val.imag());
-		}
-		
-		static std::complex<long double> Variance(unsigned long n, std::complex<long double> sum, std::complex<long double> sumP2)
-		{
-			return deriveVariance<long double>(n, sum, sumP2);
-		}
-		
-		static long double VarianceAmplitude(unsigned long n, std::complex<long double> sum, std::complex<long double> sumP2)
-		{
-			const std::complex<long double> variance = deriveVariance<long double>(n, sum, sumP2);
-			return sqrtl(variance.real()*variance.real() + variance.imag()*variance.imag());
-		}
-		
-		static long double StandardDeviationAmplitude(unsigned long n, std::complex<long double> sum, std::complex<long double> sumP2)
-		{
-			const std::complex<long double> stdDev = deriveStandardDeviation<long double>(n, sum, sumP2);
-			return sqrtl(stdDev.real()*stdDev.real() + stdDev.imag()*stdDev.imag());
-		}
-		
-		std::pair<TimeFrequencyData, TimeFrequencyMetaDataPtr> CreateTFData(QualityTablesFormatter::StatisticKind kind)
-		{
-			const std::map<double, std::map<double, DefaultStatistics> > &map = _collection.AllTimeStatistics();
-			std::set<double> frequencies;
-			std::set<double> timesteps;
-			// List the frequencies and timesteps
-			for(std::map<double, std::map<double, DefaultStatistics> >::const_iterator i=map.begin();i!=map.end();++i)
-			{
-				const double frequency = i->first;
-				frequencies.insert(frequency);
-				
-				const std::map<double, DefaultStatistics> &innerMap = i->second;
-				for(std::map<double, DefaultStatistics>::const_iterator j=innerMap.begin();j!=innerMap.end();++j)
-				{
-					const double time = j->first;
-					timesteps.insert(time);
-				}
-			}
-			std::map<double, size_t> freqIndices;
-			std::map<double, size_t> timeIndices;
-			std::vector<double> observationTimes;
-			BandInfo band;
-			size_t index = 0;
-			for(std::set<double>::const_iterator i=frequencies.begin();i!=frequencies.end();++i)
-			{
-				freqIndices.insert(std::pair<double, size_t>(*i, index));
-				ChannelInfo channel;
-				channel.frequencyIndex = index;
-				channel.frequencyHz = *i;
-				band.channels.push_back(channel);
-				++index;
-			}
-			index = 0;
-			for(std::set<double>::const_iterator i=timesteps.begin();i!=timesteps.end();++i)
-			{
-				timeIndices.insert(std::pair<double, size_t>(*i, index));
-				observationTimes.push_back(*i);
-				++index;
-			}
-			
-			// create the images
-			const size_t pCount = _collection.PolarizationCount();
-                        std::vector<Image2DPtr> realImage(pCount), imagImage(pCount);
-			Mask2DPtr mask = Mask2D::CreateSetMaskPtr<true>(timesteps.size(), frequencies.size());
-			for(size_t p=0;p<pCount;++p)
-			{
-				realImage[p] = Image2D::CreateZeroImagePtr(timesteps.size(), frequencies.size());
-				imagImage[p] = Image2D::CreateZeroImagePtr(timesteps.size(), frequencies.size());
-			}
-
-			// add the statistis
-			for(std::map<double, std::map<double, DefaultStatistics> >::const_iterator i=map.begin();i!=map.end();++i)
-			{
-				const double frequency = i->first;
-				const size_t freqIndex = freqIndices.find(frequency)->second;
-				
-				const std::map<double, DefaultStatistics> &innerMap = i->second;
-				for(std::map<double, DefaultStatistics>::const_iterator j=innerMap.begin();j!=innerMap.end();++j)
-				{
-					const double time = j->first;
-					const size_t timeIndex = timeIndices.find(time)->second;
-					
-					mask->SetValue(timeIndex, freqIndex, false);
-					for(size_t p=0;p<pCount;++p)
-					{
-						const std::complex<num_t> statValue = deriveComplex<num_t>(kind, j->second, p);
-						realImage[p]->SetValue(timeIndex, freqIndex, statValue.real());
-						imagImage[p]->SetValue(timeIndex, freqIndex, statValue.imag());
-					}
-				}
-			}
-			TimeFrequencyData data = TimeFrequencyData::CreateComplexTFData(pCount, (Image2DCPtr*) &(realImage[0]), (Image2DCPtr*) &(imagImage[0]));
-			data.SetGlobalMask(mask);
-			TimeFrequencyMetaDataPtr metaData(new TimeFrequencyMetaData());
-			metaData->SetObservationTimes(observationTimes);
-			metaData->SetBand(band);
-			return std::pair<TimeFrequencyData, TimeFrequencyMetaDataPtr>(data, metaData);
-		}
-		static std::string GetDescription(QualityTablesFormatter::StatisticKind kind)
-		{
-			switch(kind)
-			{
-				case QualityTablesFormatter::MeanStatistic: return "Mean";
-				case QualityTablesFormatter::VarianceStatistic: return "Variance";
-				case QualityTablesFormatter::StandardDeviationStatistic: return "Standard deviation";
-				case QualityTablesFormatter::CountStatistic: return "Sample count";
-				case QualityTablesFormatter::DMeanStatistic: return "Differential mean";
-				case QualityTablesFormatter::DVarianceStatistic: return "Differential variance";
-				case QualityTablesFormatter::DStandardDeviationStatistic: return "Differential standard deviation";
-				case QualityTablesFormatter::DCountStatistic: return "Sample count in differential statistics";
-				case QualityTablesFormatter::RFICountStatistic: return "Sample count affected by RFI";
-				case QualityTablesFormatter::RFIRatioStatistic: return "RFI";
-				case QualityTablesFormatter::RFIPercentageStatistic: return "RFI";
-				case QualityTablesFormatter::SignalToNoiseStatistic: return "SNR";
-				default: return "Value";
-			}
-		}
-		static bool HasUnits(QualityTablesFormatter::StatisticKind kind)
-		{
-			return !GetUnits(kind).empty();
-		}
-		static std::string GetUnits(QualityTablesFormatter::StatisticKind kind)
-		{
-			switch(kind)
-			{
-				case QualityTablesFormatter::MeanStatistic:
-				case QualityTablesFormatter::VarianceStatistic:
-				case QualityTablesFormatter::StandardDeviationStatistic:
-				case QualityTablesFormatter::DMeanStatistic:
-				case QualityTablesFormatter::DVarianceStatistic:
-				case QualityTablesFormatter::DStandardDeviationStatistic:
-					return "arbitrary units";
-				case QualityTablesFormatter::RFIPercentageStatistic:
-					return "%";
-				case QualityTablesFormatter::CountStatistic:
-				case QualityTablesFormatter::DCountStatistic:
-				case QualityTablesFormatter::RFICountStatistic:
-				case QualityTablesFormatter::RFIRatioStatistic:
-				case QualityTablesFormatter::SignalToNoiseStatistic:
-				default:
-					return "";
-			}
-		}
-		static std::string GetDescWithUnits(QualityTablesFormatter::StatisticKind kind)
-		{
-			std::ostringstream str;
-			str << GetDescription(kind);
-			if(HasUnits(kind))
-				str << " (" << GetUnits(kind) << ")";
-			return str.str();
-		}
-	private:
-		template<typename T>
-		static std::complex<T> deriveComplex(QualityTablesFormatter::StatisticKind kind, const DefaultStatistics &statistics, unsigned polarization)
-		{
-			switch(kind)
-			{
-				case QualityTablesFormatter::CountStatistic:
-					return std::complex<T>(statistics.count[polarization], 0.0);
-					break;
-				case QualityTablesFormatter::MeanStatistic:
-					return statistics.Mean<T>(polarization);
-					break;
-				case QualityTablesFormatter::SumStatistic:
-					return statistics.Sum<T>(polarization);
-					break;
-				case QualityTablesFormatter::SumP2Statistic:
-					return statistics.SumP2<T>(polarization);
-					break;
-				case QualityTablesFormatter::VarianceStatistic:
-					return deriveVariance<T>(statistics.count[polarization],
-															 	statistics.sum[polarization],
-																statistics.sumP2[polarization]);
-					break;
-				case QualityTablesFormatter::StandardDeviationStatistic:
-					return deriveStandardDeviation<T>(statistics.count[polarization],
-															 	statistics.sum[polarization],
-																statistics.sumP2[polarization]);
-					break;
-				case QualityTablesFormatter::DCountStatistic:
-					return std::complex<T>(statistics.dCount[polarization], 0.0f);
-					break;
-				case QualityTablesFormatter::DMeanStatistic:
-					return statistics.DMean<T>(polarization);
-					break;
-				case QualityTablesFormatter::DSumStatistic:
-					return statistics.DSum<T>(polarization);
-					break;
-				case QualityTablesFormatter::DSumP2Statistic:
-					return statistics.DSumP2<T>(polarization);
-					break;
-				case QualityTablesFormatter::DVarianceStatistic:
-					return deriveVariance<T>(statistics.dCount[polarization],
-																statistics.dSum[polarization],
-																statistics.dSumP2[polarization]);
-					break;
-				case QualityTablesFormatter::DStandardDeviationStatistic:
-					return deriveStandardDeviation<T>(statistics.dCount[polarization],
-																statistics.dSum[polarization],
-																statistics.dSumP2[polarization]);
-					break;
-				case QualityTablesFormatter::RFIRatioStatistic:
-					return std::complex<T>((double) statistics.rfiCount[polarization] / (statistics.count[polarization] + statistics.rfiCount[polarization]), 0.0f);
-					break;
-				case QualityTablesFormatter::RFIPercentageStatistic:
-					return std::complex<T>(100.0 * (double) statistics.rfiCount[polarization] / (statistics.count[polarization] + statistics.rfiCount[polarization]), 0.0f);
-					break;
-				case QualityTablesFormatter::RFICountStatistic:
-					return std::complex<T>(statistics.rfiCount[polarization], 0.0f);
-					break;
-				case QualityTablesFormatter::SignalToNoiseStatistic:
-				{
-					const std::complex<T> stddev =
-						deriveComplex<T>(QualityTablesFormatter::DStandardDeviationStatistic, statistics, polarization);
-					return std::complex<T>(fabsl(statistics.Mean<T>(polarization).real() / stddev.real()), fabsl(statistics.Mean<T>(polarization).imag() / stddev.imag()));
-					break;
-				}
-				default:
-					throw std::runtime_error("Can not derive requested statistic");
-			}
-		}
-		
-		template<typename T>
-		static std::complex<T> deriveVariance(unsigned long n, std::complex<long double> sum, std::complex<long double> sumP2)
-		{
-			return std::complex<T>(deriveVarianceSingle(n, sum.real(), sumP2.real()),
-															 deriveVarianceSingle(n, sum.imag(), sumP2.imag()));
-		}
-		
-		template<typename T>
-		static std::complex<T> deriveStandardDeviation(unsigned long n, std::complex<long double> sum, std::complex<long double> sumP2)
-		{
-			return std::complex<T>(deriveStandardDeviationSingle(n, sum.real(), sumP2.real()),
-															 deriveStandardDeviationSingle(n, sum.imag(), sumP2.imag()));
-		}
-		
-		template<typename T>
-		static T deriveVarianceSingle(unsigned long n, T sum, T sumP2)
-		{
-			T sumMeanSquared = sum * sum / n;
-			return (sumP2 - sumMeanSquared) / (n-1.0);
-		}
-		
-		template<typename T>
-		static T deriveStandardDeviationSingle(unsigned long n, T sum, T sumP2)
-		{
-			T sumMeanSquared = sum * sum / n;
-			return sqrt((sumP2 - sumMeanSquared) / n);
-		}
-		
-		const StatisticsCollection &_collection;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/ref/concatenatescript.h b/CEP/DP3/AOFlagger/include/AOFlagger/ref/concatenatescript.h
deleted file mode 100644
index 41b7846023c671db2d5d1ed04fe238c2bb63eab6..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/ref/concatenatescript.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2011 by A.R. Offringa                                   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#ifndef AO_CONCATENATESCRIPT_H
-#define AO_CONCATENATESCRIPT_H
-
-#include <iostream>
-#include <string>
-
-#include <AOFlagger/ref/reffile.h>
-
-namespace AOTools
-{
-	class ConcatenateScript
-	{
-		public:
-		static void Make(std::ostream &stream, const std::string &refFilePath, const std::string &destination)
-		{
-			RefFile file(refFilePath);
-
-			stream <<
-				"#!/usr/bin/env python\n\n"
-				"import pyrap.tables as pt\n\n"
-				"pt.msconcat([";
-
-			RefFile::const_iterator i=file.begin();
-			if(i!=file.end())
-			{
-				stream << "\"/net/" << i->Node() << i->Path() << '\"';
-				++i;
-			}
-
-			while(i!=file.end())
-			{
-				stream << ", \"/net/" << i->Node() << i->Path() << '\"';
-				++i;
-			}
-
-			stream << "], \"" << destination << "\")\n"; 
-		}
-	};
-}
-
-#endif // AO_CONCATENATESCRIPT_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/ref/copyallscript.h b/CEP/DP3/AOFlagger/include/AOFlagger/ref/copyallscript.h
deleted file mode 100644
index 98aa46ec6b690b168ef354071d767eeffcfff53a..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/ref/copyallscript.h
+++ /dev/null
@@ -1,100 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2011 by A.R. Offringa                                   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#ifndef AO_COPYALLSCRIPT_H
-#define AO_COPYALLSCRIPT_H
-
-#include <iostream>
-#include <map>
-#include <string>
-#include <vector>
-
-#include <AOFlagger/ref/reffile.h>
-
-namespace AOTools
-{
-	class CopyAllScript
-	{
-		public:
-		static void Make(std::ostream &stream, const std::string &refFilePath, const std::string &destination)
-		{
-			typedef std::vector<std::string> PathList;
-			typedef std::map<std::string, PathList> PathsPerNodeType;
-			typedef std::pair<std::string, PathList> NodeAndPaths;
-
-			std::string correctedDest;
-			if(*destination.rbegin() == '/')
-				correctedDest = destination;
-			else
-				correctedDest = destination + "/";
-
-			RefFile file(refFilePath);
-			
-			PathsPerNodeType pathsPerNode;
-
-			for(RefFile::const_iterator i = file.begin(); i != file.end() ; ++i)
-			{
-				if(pathsPerNode.count(i->Node()) != 0)
-					pathsPerNode.find(i->Node())->second.push_back(i->Path());
-				else
-				{
-					PathList newPathList;
-					newPathList.push_back(i->Path());
-					pathsPerNode.insert(NodeAndPaths(i->Node(), newPathList));
-				} 
-			}
-
-			stream <<
-				"#! /bin/bash\n"
-				"# Created by aorefscript to move sets in \n# " << refFilePath << "\n"
-				"# to local path\n# " << correctedDest << "\n"
-				"# Set contains " << file.Count() << " MS directories\n"
-				"# Number of nodes: " << pathsPerNode.size() << "\n";
-			for(PathsPerNodeType::const_iterator i=pathsPerNode.begin(); i!=pathsPerNode.end(); ++i)
-			{
-				const std::string node = i->first;
-				const PathList &paths = i->second;
-
-				stream
-					<< "function copy_" << node << " {\n"
-					<< "  ssh " << node << " -C \"mkdir -p " << correctedDest << "\"\n";
-				for(PathList::const_iterator p=paths.begin();p!=paths.end();++p)
-				{
-					const std::string &path = *p;
-					stream
-						<< "  echo " << path << " \\(" << node << "\\)\n"
-						<< "  ssh " << node << " -C \"cp -r " << path << " " << correctedDest << "\"\n";
-				}
-				stream
-					<< "}\n\n";
-			}
-			for(PathsPerNodeType::const_iterator i=pathsPerNode.begin(); i!=pathsPerNode.end(); ++i)
-			{
-				const std::string node = i->first;
-				stream << "copy_" << node << " &\n";
-			}
-			stream
-				<< "wait\n"
-				<< "echo All done.\n";
-		}
-	};
-}
-
-#endif // AO_COPYALLSCRIPT_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/ref/flagallscript.h b/CEP/DP3/AOFlagger/include/AOFlagger/ref/flagallscript.h
deleted file mode 100644
index d28a2e4b4272f66125645d196f430eb85b2a715f..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/ref/flagallscript.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2011 by A.R. Offringa                                   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#ifndef AO_FLAGALLSCRIPT_H
-#define AO_FLAGALLSCRIPT_H
-
-#include <iostream>
-#include <map>
-#include <string>
-#include <vector>
-
-#include <AOFlagger/ref/reffile.h>
-
-namespace AOTools
-{
-	class FlagAllScript
-	{
-		public:
-		static void Make(std::ostream &stream, const std::string &refFilePath, const std::string &logDestination)
-		{
-			typedef std::vector<std::string> PathList;
-			typedef std::map<std::string, PathList> PathsPerNodeType;
-			typedef std::pair<std::string, PathList> NodeAndPaths;
-
-			RefFile file(refFilePath);
-			
-			PathsPerNodeType pathsPerNode;
-
-			for(RefFile::const_iterator i = file.begin(); i != file.end() ; ++i)
-			{
-				if(pathsPerNode.count(i->Node()) != 0)
-					pathsPerNode.find(i->Node())->second.push_back(i->Path());
-				else
-				{
-					PathList newPathList;
-					newPathList.push_back(i->Path());
-					pathsPerNode.insert(NodeAndPaths(i->Node(), newPathList));
-				} 
-			}
-
-			stream <<
-				"#! /bin/bash\n"
-				"# Created by aorefscript to flag sets in \n# " << refFilePath << "\n"
-				"# log goes to local path\n# " << logDestination << "\n"
-				"# Set contains " << file.Count() << " MS directories\n"
-				"# Number of nodes: " << pathsPerNode.size() << "\n\n"
-				"function flagcmd {\n"
-				"  ssh $2 -C \"rficonsole $1\"\n"
-				"}\n\n";
-			for(PathsPerNodeType::const_iterator i=pathsPerNode.begin(); i!=pathsPerNode.end(); ++i)
-			{
-				const std::string node = i->first;
-				const PathList &paths = i->second;
-
-				stream
-					<< "function flag_" << node << " {\n";
-				for(PathList::const_iterator p=paths.begin();p!=paths.end();++p)
-				{
-					const std::string &path = *p;
-					stream
-						<< "  flagcmd " << path << " " << node << "\n";
-				}
-				stream
-					<< "}\n\n";
-			}
-			for(PathsPerNodeType::const_iterator i=pathsPerNode.begin(); i!=pathsPerNode.end(); ++i)
-			{
-				const std::string node = i->first;
-				stream << "flag_" << node << " &\n";
-			}
-			stream
-				<< "wait\n"
-				<< "echo All done.\n";
-		}
-	};
-}
-
-#endif // AO_COPYALLSCRIPT_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/ref/listnodes.h b/CEP/DP3/AOFlagger/include/AOFlagger/ref/listnodes.h
deleted file mode 100644
index 680b196a2b0a16560e59bc10db68fc9a5aec0117..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/ref/listnodes.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2011 by A.R. Offringa                                   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#ifndef AO_LISTNODES_H
-#define AO_LISTNODES_H
-
-#include <iostream>
-#include <set>
-#include <string>
-
-#include <AOFlagger/ref/reffile.h>
-
-namespace AOTools
-{
-	class ListNodes
-	{
-		public:
-		static void Make(std::ostream &stream, const std::string &refFilePath)
-		{
-			RefFile file(refFilePath);
-			std::set<std::string> nodes;
-			
-			for(RefFile::const_iterator i = file.begin(); i != file.end() ; ++i)
-			{
-				nodes.insert(i->Node());
-			}
-
-			for(std::set<std::string>::const_iterator i = nodes.begin(); i!=nodes.end(); ++i)
-			{
-				stream << *i << "\n";
-			}
-		}
-	};
-}
-
-#endif // AO_COPYALLSCRIPT_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/ref/listsets.h b/CEP/DP3/AOFlagger/include/AOFlagger/ref/listsets.h
deleted file mode 100644
index 822cf9c645b4b170c9d7d8c3daccd1909beddc42..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/ref/listsets.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2011 by A.R. Offringa                                   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#ifndef AO_LISTSETS_H
-#define AO_LISTSETS_H
-
-#include <iostream>
-#include <set>
-#include <string>
-#include <boost/filesystem.hpp>
-
-#include <AOFlagger/ref/reffile.h>
-
-namespace AOTools
-{
-	class ListSets
-	{
-		public:
-		static void Make(std::ostream &stream, const std::string &refFilePath)
-		{
-			RefFile file(refFilePath);
-			std::set<std::string> nodes;
-			
-			for(RefFile::const_iterator i = file.begin(); i != file.end() ; ++i)
-			{
-				boost::filesystem::path entryPath("/net");
-				entryPath = entryPath / i->Node() / i->Path();
-				stream << entryPath << "\n";
-			}
-		}
-	};
-}
-
-#endif // AO_COPYALLSCRIPT_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/ref/reffile.h b/CEP/DP3/AOFlagger/include/AOFlagger/ref/reffile.h
deleted file mode 100644
index f2aa1f45efcf789fd12d39de7419b0027accb056..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/ref/reffile.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2011 by A.R. Offringa                                   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#ifndef AO_REFFILE_H
-#define AO_REFFILE_H
-
-#include <fstream>
-#include <string>
-#include <vector>
-
-#include <AOFlagger/ref/reffileentry.h>
-#include <AOFlagger/ref/reffileexception.h>
-
-namespace AOTools
-{
-	class RefFile
-	{
-		public:
-			typedef std::vector<RefFileEntry>::const_iterator const_iterator;
-
-			RefFile()
-			{
-			}
-
-			explicit RefFile(const std::string &refFilePath)
-			{
-				Read(refFilePath);
-			}
-
-			void Read(const std::string &refFilePath)
-			{
-				_entries.clear();
-				_refFilePath = refFilePath;
-				std::ifstream file(_refFilePath.c_str());
-				RefFileEntry entry;
-				while(entry.read(file))
-				{
-					_entries.push_back(entry);
-				}
-			}
-
-			void Write(std::ostream &destination) const
-			{
-				for(const_iterator i=begin();i!=end();++i)
-					i->write(destination);
-			}
-
-			size_t Count() const
-			{
-				return _entries.size();
-			}
-
-			const RefFileEntry &operator[](const size_t index) const
-			{
-				return _entries[index];
-			}
-
-			void Add(const RefFileEntry &entry)
-			{
-				_entries.push_back(entry);
-			}
-	
-			const_iterator begin() const
-			{
-				return _entries.begin();
-			}
-
-			const_iterator end() const
-			{
-				return _entries.end();
-			}
-
-		private:
-			RefFile(const RefFile &) // don't allow copy
-			{
-			}
-
-			void operator=(const RefFile &) // don't allow assignment
-			{
-			}
-
-			std::vector<RefFileEntry> _entries;
-			std::string _refFilePath;
-	};
-}
-
-#endif //AO_REFFILE_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/ref/reffileentry.h b/CEP/DP3/AOFlagger/include/AOFlagger/ref/reffileentry.h
deleted file mode 100644
index 8e3c896a453e6221ecbfab98a7201212dacc2bc1..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/ref/reffileentry.h
+++ /dev/null
@@ -1,135 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2011 by A.R. Offringa                                   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#ifndef AO_REFFILEENTRY_H
-#define AO_REFFILEENTRY_H
-
-#include <string>
-#include <sstream>
-#include <cstdlib>
-
-#include <AOFlagger/ref/reffileexception.h>
-
-namespace AOTools
-{
-	class RefFileEntry
-	{
-		public:
-			friend class RefFile;
-	
-			RefFileEntry() : _size(0)
-			{
-			}
-
-			RefFileEntry(const RefFileEntry &source) :
-				_path(source._path),
-				_frequency(source._frequency),
-				_size(source._size),
-				_node(source._node)
-			{
-			}
-			
-			void operator=(const RefFileEntry &source)
-			{
-				_path = source._path;
-				_frequency = source._frequency;
-				_size = source._size;
-				_node = source._node;
-			}
-
-			const std::string &Path() const { return _path; }
-			const std::string &Frequency() const { return _frequency; }
-			unsigned Size() const { return _size; }
-			const std::string &Node() const { return _node; }
-
-			void SetPath(const std::string &path) { _path = path; }
-		private:
-			std::string _path;
-			std::string _frequency;
-			unsigned _size;
-			std::string _node;
-
-			bool read(std::istream &stream)
-			{
-				std::string line;
-				do {
-					if(!stream.good()) return false;
-					std::getline(stream, line);
-					if(stream.fail()) return false;
-					if(stream.bad()) throw RefFileException("Error in IO");
-				} while(ignoreLine(line));
-
-				assignFromString(line);
-				return true;
-			}
-
-			void write(std::ostream &stream) const
-			{
-				stream << _path << ' ' << _frequency << ' ' << _size << ' ' << _node << "\n";
-			}
-
-			void assignFromString(const std::string &line)
-			{
-				std::string::const_iterator i=line.begin();
-				if(!getNextToken(_path, i, line.end()))
-					throw RefFileException("Expecting a path");
-				if(!getNextToken(_frequency, i, line.end()))
-					throw RefFileException("Expecting frequency description");
-				std::string sizeString;
-				if(!getNextToken(sizeString, i, line.end()))
-					throw RefFileException("Expecting a size");
-				_size = atoi(sizeString.c_str());
-				if(!getNextToken(_node, i, line.end()))
-					throw RefFileException("Expecting a node");
-			}
-
-			static bool ignoreLine(const std::string &line)
-			{
-				for(std::string::const_iterator i=line.begin();i!=line.end();++i)
-				{
-					if(*i == '#') return true;
-					if(!ignorable(*i)) return false;
-				}
-				return true;
-			}
-
-			static bool ignorable(std::string::value_type ch)
-			{
-				return ch == ' ' || ch == '\t' || ch == '\n' || ch == '\r';
-			}
-
-			static bool getNextToken(std::string &dest, std::string::const_iterator &ptr, const std::string::const_iterator end)
-			{
-				std::ostringstream token;
-				while(ptr != end && ignorable(*ptr))
-					++ptr;
-				if(ptr == end) return false;
-				while(ptr != end && !ignorable(*ptr))
-				{
-					token << *ptr;
-					++ptr;
-				}
-				dest = token.str();
-				return dest.size() != 0;
-			}
-	};
-}
-
-#endif //AO_REFFILEENTRY_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/ref/reffileexception.h b/CEP/DP3/AOFlagger/include/AOFlagger/ref/reffileexception.h
deleted file mode 100644
index 7076ea11adbef89049263e07bb68909ff75fa374..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/ref/reffileexception.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2011 by A.R. Offringa                                   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#ifndef AO_REFFILEEXCEPTION_H
-#define AO_REFFILEEXCEPTION_H
-
-#include <stdexcept>
-
-namespace AOTools
-{
-	class RefFileException : public std::runtime_error
-	{
-		public:
-		RefFileException() : std::runtime_error("Exception in reference file") { }
-		RefFileException(const std::string &message) : std::runtime_error(message) { }
-	};
-}
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/ref/refmovescript.h b/CEP/DP3/AOFlagger/include/AOFlagger/ref/refmovescript.h
deleted file mode 100644
index 3857d2ad33df316ed6ef8ccc2fcd0c372845cf17..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/ref/refmovescript.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2011 by A.R. Offringa                                   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#ifndef AO_REFMOVESCRIPT_H
-#define AO_REFMOVESCRIPT_H
-
-#include <iostream>
-#include <string>
-
-#include <boost/filesystem.hpp>
-
-#include <AOFlagger/ref/reffile.h>
-
-namespace AOTools
-{
-	class RefMoveScript
-	{
-		public:
-		static void Make(std::ostream &stream, const std::string &refFilePath, const std::string &destination)
-		{
-			RefFile file(refFilePath);
-			RefFile destFile;
-
-			const boost::filesystem::path destPath(destination);
-
-			for(RefFile::const_iterator i=file.begin();i!=file.end();++i)
-			{
-				RefFileEntry entry = *i;
-				boost::filesystem::path entryPath(entry.Path());
-				entry.SetPath((destPath / entryPath.leaf()).string());
-				destFile.Add(entry);
-			}
-
-			destFile.Write(stream);
-		}
-	};
-}
-
-#endif // AO_REFMOVESCRIPT_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/remote/client.h b/CEP/DP3/AOFlagger/include/AOFlagger/remote/client.h
deleted file mode 100644
index 58f45a6d28686535559f9f7dbca12fc94dd59841..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/remote/client.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#ifndef AOREMOTE__CLIENT_H
-#define AOREMOTE__CLIENT_H
-
-#include <boost/asio/io_service.hpp>
-#include <boost/asio/ip/tcp.hpp>
-
-#include "format.h"
-
-namespace aoRemote {
-
-class Client
-{
-	public:
-		Client();
-		
-		void Run(const std::string &serverHost);
-		
-		static unsigned PORT() { return 1892; }
-		
-	private:
-		boost::asio::io_service _ioService;
-		boost::asio::ip::tcp::socket _socket;
-		
-		void writeGenericReadException(const std::exception &e);
-		void writeGenericReadException(const std::string &s);
-		void writeGenericReadError(enum ErrorCode code);
-		void writeDataResponse(std::ostringstream &buffer);
-		
-		std::string readStr(unsigned size);
-		
-		void handleReadQualityTables(unsigned dataSize);
-		void handleReadAntennaTables(unsigned dataSize);
-		void handleReadBandTable(unsigned dataSize);
-		void handleReadDataRows(unsigned dataSize);
-		void handleWriteDataRows(unsigned dataSize);
-};
-	
-}
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/remote/clusteredobservation.h b/CEP/DP3/AOFlagger/include/AOFlagger/remote/clusteredobservation.h
deleted file mode 100644
index b72a9daa4a552e57cc578a4f3170894a6a342424..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/remote/clusteredobservation.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#ifndef AOREMOTE__CLUSTERED_OBSERVATION_H
-#define AOREMOTE__CLUSTERED_OBSERVATION_H
-
-#include <string>
-#include <vector>
-#include <map>
-
-namespace aoRemote
-{
-
-class ClusteredObservationItem
-{
-	public:
-		ClusteredObservationItem() :
-			_index(0), _localPath(), _hostName()
-		{ }
-		ClusteredObservationItem(unsigned index, const std::string &localPath, const std::string &hostName) :
-			_index(index), _localPath(localPath), _hostName(hostName)
-		{ }
-		ClusteredObservationItem(const ClusteredObservationItem &source) :
-			_index(source._index), _localPath(source._localPath), _hostName(source._hostName)
-		{ }
-		ClusteredObservationItem &operator=(const ClusteredObservationItem &source)
-		{
-			_index = source._index;
-			_localPath = source._localPath;
-			_hostName = source._hostName;
-			return *this;
-		}
-		bool operator<(const ClusteredObservationItem &rhs) const
-		{
-			return _index < rhs._index;
-		}
-		unsigned Index() const { return _index; }
-		const std::string &LocalPath() const { return _localPath; }
-		const std::string &HostName() const { return _hostName; }
-	private:
-		unsigned _index;
-		std::string _localPath;
-		std::string _hostName;
-};
-
-class ClusteredObservation
-{
-	public:
-		ClusteredObservation();
-		
-		static bool IsClusteredFilename(const std::string &filename)
-		{
-			return IsVdsFilename(filename) || IsRefFilename(filename);
-		}
-		
-		static bool IsVdsFilename(const std::string &filename);
-		
-		static bool IsRefFilename(const std::string &filename);
-		
-		static ClusteredObservation *Load(const std::string &filename);
-		
-		static ClusteredObservation *LoadFromVds(const std::string &vdsFilename);
-		
-		static ClusteredObservation *LoadFromRef(const std::string &refFilename);
-		
-		void AddItem(const ClusteredObservationItem &item)
-		{
-			_items.push_back(item);
-		}
-		
-		const std::vector<ClusteredObservationItem> &GetItems() const
-		{
-			return _items;
-		}
-		
-		static bool IsRemoteModuleEnabled();
-		
-		size_t Size() const { return _items.size(); }
-		
-	private:
-		// disable copying
-		ClusteredObservation(const ClusteredObservation &source)
-		{
-		}
-		// disable assignment
-		void operator=(const ClusteredObservation &source)
-		{
-		}
-		
-		static void throwIfNotEnabled();
-		
-		std::vector<ClusteredObservationItem> _items;
-};
-
-
-}
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/remote/format.h b/CEP/DP3/AOFlagger/include/AOFlagger/remote/format.h
deleted file mode 100644
index d48bcfd047aeb2b0241b115e178d52bcf045e299..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/remote/format.h
+++ /dev/null
@@ -1,153 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#ifndef AOREMOTE__FORMAT_H
-#define AOREMOTE__FORMAT_H
-
-#include <stdint.h>
-#include <string>
-
-#define AO_REMOTE_PROTOCOL_VERSION 1
-
-namespace aoRemote {
-
-enum BlockId
-{
-	InitialId = 0x414F , // letters 'AO'
-	InitialResponseId = 2,
-	RequestId = 3,
-	GenericReadResponseHeaderId = 10
-};
-
-enum ErrorCode {
-	NoError = 0,
-	UnexpectedExceptionOccured = 1,
-	ProtocolNotUnderstoodError = 10,
-	CouldNotOpenMeasurementSetError = 20,
-	CouldNotOpenTableError = 21
-} ;
-
-struct ErrorStr
-{
-	static std::string GetStr(enum ErrorCode errorCode)
-	{
-		switch(errorCode)
-		{
-			case NoError: return "No error";
-				break;
-			case UnexpectedExceptionOccured: return "Unexpected exception occured";
-				break;
-			case ProtocolNotUnderstoodError: return "Protocol not understood";
-				break;
-			case CouldNotOpenMeasurementSetError: return "Could not open measurement set";
-				break;
-			case CouldNotOpenTableError: return "Could not open requested table";
-				break;
-			default: return "Unknown error code";
-				break;
-		}
-	}
-	static std::string GetStr(int16_t errorCode)
-	{
-		return GetStr((enum ErrorCode) errorCode);
-	}
-};
-
-enum RequestType {
-	StopClientRequest = 0,
-	ReadQualityTablesRequest = 1,
-	ReadAntennaTablesRequest = 2,
-	ReadBandTableRequest = 3,
-	ReadDataRowsRequest = 4,
-	WriteDataRowsRequest = 5
-};
-
-struct InitialBlock
-{
-	int16_t blockSize;
-	int16_t blockIdentifier;
-	int16_t protocolVersion;
-	int16_t options;
-};
-struct InitialResponseBlock
-{
-	int16_t blockSize;
-	int16_t blockIdentifier;
-	int16_t negotiatedProtocolVersion;
-	int16_t errorCode;
-	int16_t hostNameSize;
-	// std::string hostname will follow
-};
-struct RequestBlock
-{
-	int16_t blockSize;
-	int16_t blockIdentifier;
-	int16_t request;
-	int16_t dataSize;
-};
-struct GenericReadResponseHeader
-{
-	int16_t blockSize;
-	int16_t blockIdentifier;
-	int16_t errorCode;
-	int64_t dataSize;
-};
-
-#define READ_QTABLES_OPTION_COLLECT_IF_REQUIRED  0x0001
-#define READ_QTABLES_OPTION_SAVE_COLLECTED       0x0002
-
-struct ReadQualityTablesRequestOptions
-{
-	int32_t flags;
-	std::string msFilename;
-};
-
-struct ReadAntennaTablesRequestOptions
-{
-	int32_t flags;
-	std::string msFilename;
-};
-
-struct ReadBandTableRequestOptions
-{
-	int32_t flags;
-	std::string msFilename;
-};
-
-struct ReadDataRowsRequestOptions
-{
-	int32_t flags;
-	std::string msFilename;
-	uint64_t startRow;
-	uint64_t rowCount;
-};
-
-struct WriteDataRowsRequestOptions
-{
-	int32_t flags;
-	std::string msFilename;
-	uint64_t startRow;
-	uint64_t rowCount;
-	uint64_t dataSize;
-};
-
-}
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/remote/nodecommandmap.h b/CEP/DP3/AOFlagger/include/AOFlagger/remote/nodecommandmap.h
deleted file mode 100644
index 560c218505006e139f22ddf34d2bab379c8472e0..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/remote/nodecommandmap.h
+++ /dev/null
@@ -1,133 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#ifndef AOREMOTE__NODE_COMMAND_MAP_H
-#define AOREMOTE__NODE_COMMAND_MAP_H
-
-#include <stdexcept>
-
-#include "clusteredobservation.h"
-
-namespace aoRemote {
-
-class NodeCommandMap
-{
-	public:
-		/**
-		 * Adds all measurement sets in the observation to the 'command list'. Each node
-		 * will receive the list of measurement sets that are stored on the specific
-		 * node.
-		 */
-		void Initialize(const ClusteredObservation &observation)
-		{
-			const std::vector<ClusteredObservationItem> &items = observation.GetItems();
-			for(std::vector<ClusteredObservationItem>::const_iterator i=items.begin();i!=items.end();++i)
-			{
-				_nodeMap[i->HostName()].push_back(*i);
-			}
-		}
-		
-		const ClusteredObservationItem &Top(const std::string &hostname) const
-		{
-			NodeMap::const_iterator iter = _nodeMap.find(hostname);
-			if(iter == _nodeMap.end())
-				throw std::runtime_error("Could not find hostname in map. This might mean that your host knows the host under a different name (check case).");
-			const std::deque<ClusteredObservationItem> &items = iter->second;
-			return items.front();
-		}
-		
-		/**
-		 * Removes the top clustered observation item ('command') from the node map and
-		 * returns it. The item can be re-requested by calling Current(), until the GetNext()
-		 * is called again or the host is removed.
-		 * @returns @c true when the node had another item ('command')
-		 */
-		bool Pop(const std::string &hostname, ClusteredObservationItem &item)
-		{
-			NodeMap::iterator iter = _nodeMap.find(hostname);
-			if(iter == _nodeMap.end())
-			{
-				return false;
-			}
-			else {
-				std::deque<ClusteredObservationItem> &items = iter->second;
-				if(items.empty())
-				{
-					_nodeMap.erase(iter);
-					return false;
-				}
-				else
-				{
-					item = items.front();
-					items.pop_front();
-					_lastItem[hostname] = item;
-					return true;
-				}
-			}
-		}
-		
-		/**
-		 * Removes all commands that had to be executed for the given node.
-		 * Also removes the 'current' item for this host.
-		 * @returns @c true when the hostname was found and removed.
-		 */
-		bool RemoveNode(const std::string &hostname)
-		{
-			_lastItem.erase(hostname);
-			return _nodeMap.erase(hostname) != 0;
-		}
-		
-		bool Empty() const
-		{
-			return _nodeMap.empty();
-		}
-		
-		void NodeList(std::vector<std::string> &dest) const
-		{
-			dest.resize(_nodeMap.size());
-			size_t p = 0;
-			for(std::map<std::string, std::deque<ClusteredObservationItem> >::const_iterator i=_nodeMap.begin();i!=_nodeMap.end();++i)
-			{
-				dest[p] = i->first;
-				++p;
-			}
-		}
-		
-		bool Current(const std::string &hostname, ClusteredObservationItem &item) const
-		{
-			std::map<std::string, ClusteredObservationItem>::const_iterator iter = _lastItem.find(hostname);
-			if(iter == _lastItem.end())
-				return false;
-			else
-			{
-				item = iter->second;
-				return true;
-			}
-		}
-	private:
-		typedef std::map<std::string, std::deque<ClusteredObservationItem> > NodeMap;
-		NodeMap _nodeMap;
-		
-		std::map<std::string, ClusteredObservationItem> _lastItem;
-};
-
-}
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/remote/observationtimerange.h b/CEP/DP3/AOFlagger/include/AOFlagger/remote/observationtimerange.h
deleted file mode 100644
index 2813b038067348cd2a2805d73d6bc61c5d130b9d..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/remote/observationtimerange.h
+++ /dev/null
@@ -1,324 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#ifndef AOREMOTE__OBSERVATION_TIMERANGE_H
-#define AOREMOTE__OBSERVATION_TIMERANGE_H
-
-#include <algorithm>
-#include <stdexcept>
-#include <map>
-#include <vector>
-
-#include <AOFlagger/msio/antennainfo.h>
-#include <AOFlagger/msio/types.h>
-#include <AOFlagger/msio/msrowdataext.h>
-
-#include "clusteredobservation.h"
-
-namespace aoRemote {
-	
-class ObservationTimerange
-{
-	public:
-		ObservationTimerange(const ClusteredObservation &observation) :
-			_observation(observation),
-			_bands(observation.Size()),
-			_bandStartLookup(observation.Size()),
-			_gridIndexLookup(),
-			_polarizationCount(0),
-			_timestepCount(0),
-			_timeOffsetIndex(0),
-			_gridFrequencySize(0),
-			_startFrequency(0.0),
-			_frequencyWidth(0.0),
-			_realData(0), _imagData(0),
-			_u(0), _v(0), _w(0),
-			_antenna1(0), _antenna2(0)
-		{
-		}
-		
-		ObservationTimerange(const ObservationTimerange &source) :
-			_observation(source._observation),
-			_bands(source._bands),
-			_bandStartLookup(source._bandStartLookup),
-			_gridIndexLookup(source._gridIndexLookup),
-			_polarizationCount(source._polarizationCount),
-			_timestepCount(source._timestepCount),
-			_timeOffsetIndex(source._timeOffsetIndex),
-			_gridFrequencySize(source._gridFrequencySize),
-			_startFrequency(source._startFrequency),
-			_frequencyWidth(source._frequencyWidth)
-		{
-			allocate();
-			const size_t size = _gridFrequencySize * _timestepCount * _polarizationCount * 2;
-			memcpy(_realData, source._realData, sizeof(num_t) * size);
-			memcpy(_u, source._u, sizeof(double) * _timestepCount);
-			memcpy(_v, source._v, sizeof(double) * _timestepCount);
-			memcpy(_w, source._w, sizeof(double) * _timestepCount);
-			memcpy(_antenna1, source._antenna1, sizeof(unsigned) * _timestepCount);
-			memcpy(_antenna2, source._antenna2, sizeof(unsigned) * _timestepCount);
-		}
-		
-		~ObservationTimerange()
-		{
-			deallocate();
-		}
-		
-		void SetBandInfo(size_t nodeIndex, const BandInfo &bandInfo)
-		{
-			_bands[nodeIndex] = bandInfo;
-		}
-		
-		void Initialize(size_t polarizationCount, size_t timestepCount)
-		{
-			deallocate();
-			
-			_polarizationCount = polarizationCount;
-			_timestepCount = timestepCount;
-			
-			std::map<double, BandRangeInfo > ranges;
-			
-			if(_bands.empty())
-				throw std::runtime_error("InitializeChannels was called, but no bands are available");
-			
-			size_t indx = 0;
-			for(std::vector<BandInfo>::const_iterator i = _bands.begin();i != _bands.end();++i)
-			{
-				const BandInfo &band = *i;
-				double startFreq = band.channels.begin()->frequencyHz;
-				BandRangeInfo range;
-				range.endFrequency = band.channels.rbegin()->frequencyHz;
-				range.nodeIndex = indx;
-				ranges.insert(std::pair<double, BandRangeInfo>(startFreq, range));
-				++indx;
-			}
-			// Check for overlap
-			if(!ranges.empty())
-			{
-				std::map<double, BandRangeInfo>::const_iterator nextPtr = ranges.begin();
-					++nextPtr;
-				for(std::map<double, BandRangeInfo>::const_iterator i=ranges.begin();nextPtr!=ranges.end();++i)
-				{
-					const double
-						endFirst = i->second.endFrequency,
-						beginSecond = nextPtr->first;
-					if(endFirst >= beginSecond)
-						throw std::runtime_error("Observation has measurement sets whose bands overlap in frequency");
-					++nextPtr;
-				}
-			}
-			// Enumerate channels
-			std::vector<double> channels;
-			for(std::map<double, BandRangeInfo>::const_iterator i=ranges.begin();i!=ranges.end();++i)
-			{
-				const BandInfo &band = _bands[i->second.nodeIndex];
-				for(std::vector<ChannelInfo>::const_iterator c=band.channels.begin();c!=band.channels.end();++c)
-					channels.push_back(c->frequencyHz);
-			}
-			_startFrequency = channels[0];
-			
-			// Find the median distance between channels
-			std::vector<double> distances;
-			for(std::vector<double>::const_iterator i=channels.begin();i+1!=channels.end();++i)
-			{
-				const double curDistance = *(i+1)-*i;
-				if(curDistance > 0.0)
-					distances.push_back(curDistance);
-				else if(curDistance == 0.0)
-					throw std::runtime_error("The full set contains two channels with the same frequency");
-				else
-					throw std::runtime_error("Channels were not ordered correctly in one of the sets");
-			}
-			double gridDistance = *std::min_element(distances.begin(), distances.end());
-			std::cout << "Frequency resolution: " << gridDistance << "\n";
-			
-			// Create band start index lookup table
-			size_t channelCount = 0;
-			for(std::map<double, BandRangeInfo>::const_iterator i=ranges.begin();i!=ranges.end();++i)
-			{
-				size_t nodeIndex = i->second.nodeIndex;
-				_bandStartLookup[nodeIndex] = channelCount;
-				channelCount += _bands[nodeIndex].channels.size();
-			}
-			std::cout << "Channel count: " << channelCount << "\n";
-			
-			// Create grid
-			_gridIndexLookup.resize(channelCount);
-			size_t lookupIndex = 0;
-			size_t gridIndex = 0;
-			double gridPos = channels[0];
-			while(lookupIndex < channels.size())
-			{
-				// we will round each channel to its nearest point on the grid with resolution "gridDistance"
-				size_t gridDist = (size_t) round((channels[lookupIndex] - gridPos) / gridDistance);
-				gridPos = channels[lookupIndex];
-				gridIndex += gridDist;
-				_gridIndexLookup[lookupIndex] = gridIndex;
-				++lookupIndex;
-			}
-			_gridFrequencySize = gridIndex+1;
-			std::cout << "Grid points: " << _gridFrequencySize << "\n";
-			_frequencyWidth = _gridFrequencySize * gridDistance;
-			
-			allocate();
-		}
-		
-		void SetZero()
-		{
-			const size_t size = _gridFrequencySize * _timestepCount * _polarizationCount * 2;
-			for(size_t i=0;i<size;++i)
-				_realData[i] = 0.0f;
-		}
-		
-		void SetTimestepData(size_t nodeIndex, const MSRowDataExt *rows, size_t rowCount)
-		{
-			size_t bandStart = _bandStartLookup[nodeIndex];
-			const unsigned pCount = _polarizationCount;
-			for(size_t r=0;r<rowCount;++r)
-			{
-				const MSRowDataExt &rowExt = rows[r];
-				const MSRowData &row = rowExt.Data();
-				const num_t *realPtr = row.RealPtr();
-				const num_t *imagPtr = row.ImagPtr();
-				std::vector<size_t>::const_iterator gridPtr = _gridIndexLookup.begin()+bandStart;
-				for(size_t c=0;c<row.ChannelCount();++c)
-				{
-					const size_t gridIndex = *gridPtr;
-					size_t fullIndex = (r * _gridFrequencySize + gridIndex) * pCount;
-					for(unsigned p=0;p<pCount;++p)
-					{
-						_realData[fullIndex] = *realPtr;
-						_imagData[fullIndex] = *imagPtr;
-						++fullIndex;
-						++realPtr;
-						++imagPtr;
-					}
-					++gridPtr;
-				}
-				
-				_u[r] = rowExt.U();
-				_v[r] = rowExt.V();
-				_w[r] = rowExt.W();
-				_antenna1[r] = rowExt.Antenna1();
-				_antenna2[r] = rowExt.Antenna2();
-			}
-			_timestepCount = rowCount;
-		}
-		
-		void GetTimestepData(size_t nodeIndex, MSRowDataExt *rows)
-		{
-			size_t bandStart = _bandStartLookup[nodeIndex];
-			const unsigned pCount = _polarizationCount;
-			for(size_t r=0;r<_timestepCount;++r)
-			{
-				MSRowDataExt &rowExt = rows[r];
-				MSRowData &row = rowExt.Data();
-				size_t thisChannelCount = _bands[nodeIndex].channels.size();
-				if(row.ChannelCount() != thisChannelCount)
-					throw std::runtime_error("Given rows do not match in channel count with the bands");
-				num_t *realPtr = row.RealPtr();
-				num_t *imagPtr = row.ImagPtr();
-				std::vector<size_t>::const_iterator gridPtr = _gridIndexLookup.begin()+bandStart;
-				for(size_t c=0;c<row.ChannelCount();++c)
-				{
-					const size_t gridIndex = *gridPtr;
-					size_t fullIndex = (r * _gridFrequencySize + gridIndex) * pCount;
-					
-					for(unsigned p=0;p<pCount;++p)
-					{
-						*realPtr = _realData[fullIndex];
-						*imagPtr = _imagData[fullIndex];
-						++fullIndex;
-						++realPtr;
-						++imagPtr;
-					}
-					++gridPtr;
-				}
-				
-				rowExt.SetU(_u[r]);
-				rowExt.SetV(_v[r]);
-				rowExt.SetW(_w[r]);
-				rowExt.SetAntenna1(_antenna1[r]);
-				rowExt.SetAntenna2(_antenna2[r]);
-			}
-		}
-		
-		size_t PolarizationCount() const { return _polarizationCount; }
-		size_t TimestepCount() const { return _timestepCount; }
-		size_t TimeOffsetIndex() const { return _timeOffsetIndex; }
-		size_t ChannelCount() const { return _gridFrequencySize; }
-		num_t *RealData(size_t timestep) { return &_realData[timestep * _polarizationCount * _gridFrequencySize]; }
-		num_t *ImagData(size_t timestep) { return &_imagData[timestep * _polarizationCount * _gridFrequencySize]; }
-		double StartFrequency() const { return _startFrequency; }
-		double FrequencyWidth() const { return _frequencyWidth; }
-		double U(size_t timestep) const { return _u[timestep]; }
-		double V(size_t timestep) const { return _u[timestep]; }
-		double W(size_t timestep) const { return _u[timestep]; }
-		unsigned Antenna1(size_t timestep) const { return _antenna1[timestep]; }
-		unsigned Antenna2(size_t timestep) const { return _antenna2[timestep]; }
-		
-		void SetTimeOffsetIndex(size_t timeOffsetIndex) { _timeOffsetIndex = timeOffsetIndex; }
-		const BandInfo &Band(size_t nodeIndex) { return _bands[nodeIndex]; }
-	private:
-		struct BandRangeInfo { double endFrequency; size_t nodeIndex; };
-		const ClusteredObservation &_observation;
-		std::vector<BandInfo> _bands;
-		std::vector<size_t> _bandStartLookup;
-		std::vector<size_t> _gridIndexLookup;
-		size_t _polarizationCount;
-		size_t _timestepCount;
-		size_t _timeOffsetIndex;
-		size_t _gridFrequencySize;
-		double _startFrequency, _frequencyWidth;
-		
-		// First index is polarization, second is frequency, third is timestep
-		num_t *_realData;
-		num_t *_imagData;
-		double *_u, *_v, *_w;
-		unsigned *_antenna1, *_antenna2;
-		
-		void operator=(const ObservationTimerange &source) { }
-		
-		void allocate()
-		{
-			const size_t allocSize = _gridFrequencySize * _timestepCount * _polarizationCount;
-			_realData = new num_t[allocSize * 2];
-			_imagData = &_realData[allocSize];
-			_u = new double[_timestepCount];
-			_v = new double[_timestepCount];
-			_w = new double[_timestepCount];
-			_antenna1 = new unsigned[_timestepCount];
-			_antenna2 = new unsigned[_timestepCount];
-		}
-		
-		void deallocate()
-		{
-			delete[] _realData;
-			delete[] _u;
-			delete[] _v;
-			delete[] _w;
-			delete[] _antenna1;
-			delete[] _antenna2;
-		}
-};
-	
-}
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/remote/processcommander.h b/CEP/DP3/AOFlagger/include/AOFlagger/remote/processcommander.h
deleted file mode 100644
index 74ac1534e86db38091ac92459b636515155cea1f..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/remote/processcommander.h
+++ /dev/null
@@ -1,182 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#ifndef AOREMOTE__PROCESS_COMMANDER_H
-#define AOREMOTE__PROCESS_COMMANDER_H
-
-#include <map>
-#include <string>
-#include <deque>
-#include <vector>
-
-#include "clusteredobservation.h"
-#include "nodecommandmap.h"
-#include "remoteprocess.h"
-#include "server.h"
-
-#include <AOFlagger/msio/antennainfo.h>
-
-class StatisticsCollection;
-
-namespace aoRemote {
-	
-class ObservationTimerange;
-
-class ProcessCommander
-{
-	public:
-		ProcessCommander(const ClusteredObservation &observation);
-		~ProcessCommander();
-		
-		void Run(bool finishConnections = true);
-		
-		static std::string GetHostName();
-		const StatisticsCollection &Statistics() const { return *_statisticsCollection; }
-		const HistogramCollection &Histograms() const { return *_histogramCollection; }
-		size_t PolarizationCount() const { return _polarizationCount; }
-		const std::vector<AntennaInfo> &Antennas() const { return _antennas; }
-		const std::vector<BandInfo> &Bands() const { return _bands; }
-		const ObservationTimerange &ObsTimerange() const { return *_observationTimerange; }
-		size_t RowsTotal() const { return _rowsTotal; }
-		
-		const std::vector<std::string> &Errors() const { return _errors; }
-		std::string ErrorString() const;
-		void CheckErrors() const;
-		
-		void PushReadQualityTablesTask(StatisticsCollection *dest, HistogramCollection *destHistogram, bool correctHistograms = false)
-		{
-			_correctHistograms = correctHistograms;
-			_tasks.push_back(ReadQualityTablesTask);
-			_statisticsCollection = dest;
-			_histogramCollection = destHistogram;
-		}
-		void PushReadAntennaTablesTask() { _tasks.push_back(ReadAntennaTablesTask); }
-		void PushReadBandTablesTask()
-		{ 
-			_tasks.push_back(ReadBandTablesTask);
-			_bands.resize(_observation.Size());
-		}
-		
-		/**
-		 * @param rowBuffer should have #NODES elements, each which is an array of #ROWCOUNT rows.
-		 * It is not expected to hold the data yet; it is a parameter so that repeated calls do not have
-		 * to allocate that memory over and over.
-		 */
-		void PushReadDataRowsTask(class ObservationTimerange &timerange, size_t rowStart, size_t rowCount, MSRowDataExt **rowBuffer)
-		{
-			_tasks.push_back(ReadDataRowsTask);
-			_observationTimerange = &timerange;
-			_readRowBuffer = rowBuffer;
-			_rowStart = rowStart;
-			_rowCount = rowCount;
-			_rowsTotal = 0;
-		}
-		
-		/**
-		 * @param rowBuffer should have #NODES elements, each which is an array of timerange.#ROW rows.
-		 * It is not expected to hold the data yet; it is a parameter so that repeated calls do not have
-		 * to allocate that memory over and over.
-		 */
-		void PushWriteDataRowsTask(class ObservationTimerange &timerange, MSRowDataExt **rowBuffer)
-		{
-			_tasks.push_back(WriteDataRowsTask);
-			_observationTimerange = &timerange;
-			_writeRowBuffer = rowBuffer;
-			_rowsTotal = 0;
-		}
-		
-		const ClusteredObservation &Observation() const { return _observation; }
-	private:
-		enum Task {
-			NoTask,
-			ReadQualityTablesTask,
-			ReadAntennaTablesTask,
-			ReadBandTablesTask,
-			ReadDataRowsTask,
-			WriteDataRowsTask
-		};
-		
-		void endIdleConnections();
-		void continueReadQualityTablesTask(ServerConnectionPtr serverConnection);
-		void continueReadAntennaTablesTask(ServerConnectionPtr serverConnection);
-		void continueReadBandTablesTask(ServerConnectionPtr serverConnection);
-		void continueReadDataRowsTask(ServerConnectionPtr serverConnection);
-		void continueWriteDataRowsTask(ServerConnectionPtr serverConnection);
-		
-		void onConnectionCreated(ServerConnectionPtr serverConnection, bool &acceptConnection);
-		void onConnectionAwaitingCommand(ServerConnectionPtr serverConnection);
-		void onConnectionFinishReadQualityTables(ServerConnectionPtr serverConnection, StatisticsCollection &statisticsCollection, HistogramCollection &histogramCollection);
-		void onConnectionFinishReadAntennaTables(ServerConnectionPtr serverConnection, boost::shared_ptr<std::vector<AntennaInfo> > antennas, size_t polarizationCount);
-		void onConnectionFinishReadBandTable(ServerConnectionPtr serverConnection, BandInfo &band);
-		void onConnectionFinishReadDataRows(ServerConnectionPtr serverConnection, MSRowDataExt *rowData, size_t rowCount);
-		void onConnectionFinishWriteDataRows(ServerConnectionPtr serverConnection);
-		void onError(ServerConnectionPtr connection, const std::string &error);
-		void onProcessFinished(RemoteProcess &process, bool error, int status);
-		
-		Server _server;
-		typedef std::vector<ServerConnectionPtr> ConnectionVector;
-		ConnectionVector _idleConnections;
-		std::vector<RemoteProcess *> _processes;
-		
-		StatisticsCollection *_statisticsCollection;
-		HistogramCollection *_histogramCollection;
-		bool _correctHistograms;
-		size_t _polarizationCount;
-		std::vector<AntennaInfo> _antennas;
-		std::vector<BandInfo> _bands;
-		class ObservationTimerange *_observationTimerange;
-		MSRowDataExt **_readRowBuffer;
-		MSRowDataExt **_writeRowBuffer;
-		size_t _rowStart, _rowCount, _rowsTotal;
-		
-		const ClusteredObservation &_observation;
-		NodeCommandMap _nodeCommands;
-		bool _finishConnections;
-		
-		std::vector<std::string> _errors;
-		std::deque<enum Task> _tasks;
-		
-		/** 
-		 * Because the processes have separate threads that can send signals from
-		 * their thread, locking is required for accessing data that might be
-		 * accessed by the processes.
-		 */
-		boost::mutex _mutex;
-		
-		Task currentTask() const {
-			if(!_tasks.empty()) return _tasks.front();
-			else return NoTask;
-		}
-		void onCurrentTaskFinished() {
-			_tasks.pop_front();
-			if(currentTask() == NoTask)
-				_server.Stop();
-		}
-		void handleIdleConnection(ServerConnectionPtr serverConnection) {
-			if(_finishConnections)
-				serverConnection->StopClient();
-			else
-				_idleConnections.push_back(serverConnection);
-		}
-};
-
-}
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/remote/remoteprocess.h b/CEP/DP3/AOFlagger/include/AOFlagger/remote/remoteprocess.h
deleted file mode 100644
index 6c1c85b29268f6cb4fb3d0d22795444c5328ce8a..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/remote/remoteprocess.h
+++ /dev/null
@@ -1,132 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#ifndef AOREMOTE__REMOTE_PROCESS_H
-#define AOREMOTE__REMOTE_PROCESS_H
-
-#include <sys/types.h>
-#include <sys/wait.h>
-
-#include <unistd.h>
-
-#include <sstream>
-#include <iostream>
-#include <stdexcept>
-
-#include <sigc++/signal.h>
-
-#include <boost/thread/thread.hpp>
-
-#include "clusteredobservation.h"
-
-namespace aoRemote
-{
-
-class RemoteProcess
-{
-	public:
-		RemoteProcess(const std::string &clientHostName, const std::string &serverHostName)
-		: _clientHostName(clientHostName), _serverHostName(serverHostName),  _running(false)
-		{
-		}
-		
-		~RemoteProcess()
-		{
-			Join();
-		}
-		
-		void Join()
-		{
-			if(_running)
-			{
-				_thread->join();
-				delete _thread;
-				_running = false;
-			}
-		}
-		
-		void Start()
-		{
-			_running = true;
-			_thread = new boost::thread(ThreadFunctor(*this));
-		}
-		
-		sigc::signal<void, RemoteProcess &/*process*/, bool /*error*/, int /*status*/> &SignalFinished()
-		{
-			return _onFinished;
-		}
-		
-		const std::string &ClientHostname() const
-		{
-			return _clientHostName;
-		}
-	private:
-		RemoteProcess(const RemoteProcess &source) { }
-		void operator=(const RemoteProcess &source) { }
-		
-		struct ThreadFunctor
-		{
-			ThreadFunctor(RemoteProcess &process) : _remoteProcess(process) { }
-			RemoteProcess &_remoteProcess;
-			void operator()()
-			{
-				std::ostringstream commandLine;
-				commandLine
-					<< "ssh " << _remoteProcess._clientHostName << " -x \"bash --login -c \\\"aoremoteclient connect "
-					<< _remoteProcess._serverHostName << "\\\" \"";
-				std::cout << commandLine.str() << std::endl;
-				int pid = vfork();
-				switch (pid) {
-					case -1: // Error
-						throw std::runtime_error("Could not vfork() new process for executing remote client");
-					case 0: // Child
-						execl("/bin/sh", "sh", "-c", commandLine.str().c_str(), NULL);
-						_exit(127);
-				}
-				
-				// Wait for process to terminate
-				int pStatus;
-				do {
-					int pidReturn;
-					do {
-						pidReturn = waitpid(pid, &pStatus, 0);
-					} while (pidReturn == -1 && errno == EINTR);
-				} while(!WIFEXITED(pStatus) && !WIFSIGNALED(pStatus));
-				if(WIFEXITED(pStatus))
-				{
-					const int exitStatus = WEXITSTATUS(pStatus);
-					_remoteProcess._onFinished(_remoteProcess, exitStatus!=0, exitStatus);
-				} else {
-					_remoteProcess._onFinished(_remoteProcess, true, 0);
-				}
-			}
-		};
-		
-		const ClusteredObservationItem _item;
-		const std::string _clientHostName, _serverHostName;
-		boost::thread *_thread;
-		bool _running;
-		
-		sigc::signal<void, RemoteProcess &/*process*/, bool /*error*/, int /*status*/> _onFinished;
-};
-
-}
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/remote/server.h b/CEP/DP3/AOFlagger/include/AOFlagger/remote/server.h
deleted file mode 100644
index 627977e0e6aa862c838e34439ce13bd58cf25941..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/remote/server.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#ifndef AOREMOTE__SERVER_H
-#define AOREMOTE__SERVER_H
-
-#include <AOFlagger/remote/format.h>
-
-#include <boost/asio/io_service.hpp>
-#include <boost/asio/ip/tcp.hpp>
-
-#include <sigc++/signal.h>
-
-#include "serverconnection.h"
-
-class StatisticsCollection;
-
-namespace aoRemote {
-
-/**
-	* A server can listen for incoming connections on a TCP port. When incoming connections are created,
-	* the class will spawn ServerConnection instances. All operations are asynchroneous.
-	* @see ServerConnection
-	*/
-class Server
-{
-	public:
-		/** After the Server has been constructed, incoming connections will no longer be refused. Only after
-		 * Run() has been called, the connections will actually be accepted.
-		 */
-		Server();
-		
-		/**
-		 * Open the server so that it will accept connections on the specific TCP port. Will not return
-		 * untill the server has been stopped by calling Stop().
-		 */
-		void Run();
-		
-		/**
-		 * Stop listening for connections. This will cause Run() to return. Note that this will not terminate
-		 * any currently running connections; it will merely stop accepting new connections.
-		 */
-		void Stop();
-		
-		static unsigned PORT() { return 1892; }
-		
-		sigc::signal<void, ServerConnectionPtr, bool&> &SignalConnectionCreated()
-		{
-			return _onConnectionCreated;
-		}
-	private:
-		void startAccept();
-		void handleAccept(ServerConnectionPtr connection, const boost::system::error_code &error);
-		
-		boost::asio::io_service _ioService;
-		boost::asio::ip::tcp::acceptor _acceptor;
-		sigc::signal<void, ServerConnectionPtr, bool&> _onConnectionCreated;
-};
-	
-}
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/remote/serverconnection.h b/CEP/DP3/AOFlagger/include/AOFlagger/remote/serverconnection.h
deleted file mode 100644
index 681090ad5c9c1d1f25f6bdda22816c1e81c9d741..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/remote/serverconnection.h
+++ /dev/null
@@ -1,120 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#ifndef AOREMOTE__SERVER_CONNECTION_H
-#define AOREMOTE__SERVER_CONNECTION_H
-
-#include <string>
-
-#include <boost/asio/ip/tcp.hpp>
-
-#include <boost/enable_shared_from_this.hpp>
-
-#include <sigc++/signal.h>
-
-#include <AOFlagger/remote/format.h>
-
-#include <AOFlagger/msio/antennainfo.h>
-#include <AOFlagger/msio/msrowdataext.h>
-
-class StatisticsCollection;
-class HistogramCollection;
-
-namespace aoRemote {
-
-typedef boost::shared_ptr<class ServerConnection> ServerConnectionPtr;
-
-class ServerConnection : public boost::enable_shared_from_this<ServerConnection>
-
-{
-	public:
-		static ServerConnectionPtr Create(boost::asio::io_service &ioService)
-		{
-			return ServerConnectionPtr(new ServerConnection(ioService));
-		}
-		~ServerConnection();
-		
-		void StopClient();
-		void ReadQualityTables(const std::string &msFilename, class StatisticsCollection &collection, HistogramCollection &histogramCollection);
-		void ReadAntennaTables(const std::string &msFilename, boost::shared_ptr<std::vector<AntennaInfo> > antennas);
-		void ReadBandTable(const std::string &msFilename, BandInfo &band);
-		void ReadDataRows(const std::string &msFilename, size_t rowStart, size_t rowCount, MSRowDataExt *destinationArray);
-		void WriteDataRows(const std::string &msFilename, size_t rowStart, size_t rowCount, const MSRowDataExt *rowArray);
-		void Start();
-		
-		boost::asio::ip::tcp::socket &Socket() { return _socket; }
-		
-		sigc::signal<void, ServerConnectionPtr> &SignalAwaitingCommand() { return _onAwaitingCommand; }
-		sigc::signal<void, ServerConnectionPtr, StatisticsCollection&, HistogramCollection&> &SignalFinishReadQualityTables() { return _onFinishReadQualityTables; }
-		sigc::signal<void, ServerConnectionPtr, boost::shared_ptr<std::vector<AntennaInfo> >, size_t > &SignalFinishReadAntennaTables() { return _onFinishReadAntennaTables; }
-		sigc::signal<void, ServerConnectionPtr, BandInfo&> &SignalFinishReadBandTable() { return _onFinishReadBandTable; }
-		sigc::signal<void, ServerConnectionPtr, MSRowDataExt*, size_t> &SignalFinishReadDataRows() { return _onFinishReadDataRows; }
-		sigc::signal<void, ServerConnectionPtr, const std::string&> &SignalError() { return _onError; }
-		
-		const std::string &Hostname() const { return _hostname; }
-	private:
-		ServerConnection(boost::asio::io_service &ioService);
-		boost::asio::ip::tcp::socket _socket;
-		std::string _hostname;
-		
-		sigc::signal<void, ServerConnectionPtr> _onAwaitingCommand;
-		sigc::signal<void, ServerConnectionPtr, StatisticsCollection&, HistogramCollection&> _onFinishReadQualityTables;
-		sigc::signal<void, ServerConnectionPtr, boost::shared_ptr<std::vector<AntennaInfo> >, size_t > _onFinishReadAntennaTables;
-		sigc::signal<void, ServerConnectionPtr, BandInfo&> _onFinishReadBandTable;
-		sigc::signal<void, ServerConnectionPtr, MSRowDataExt*, size_t> _onFinishReadDataRows;
-		sigc::signal<void, ServerConnectionPtr, const std::string&> _onError;
-		
-		char *_buffer;
-		
-		void onReceiveInitialResponse();
-		
-		void onReceiveQualityTablesResponseHeader();
-		void onReceiveQualityTablesResponseData(size_t dataSize);
-		
-		void onReceiveAntennaTablesResponseHeader();
-		void onReceiveAntennaTablesResponseData(size_t dataSize);
-		
-		void onReceiveBandTableResponseHeader();
-		void onReceiveBandTableResponseData(size_t dataSize);
-		
-		void onReceiveReadDataRowsResponseHeader();
-		void onReceiveReadDataRowsResponseData(size_t dataSize);
-		
-		void onReceiveWriteDataRowsResponseHeader();
-		
-		void prepareBuffer(size_t size)
-		{
-			if(_buffer != 0) delete[] _buffer;
-			_buffer = new char[size];
-		}
-		
-		void handleError(const GenericReadResponseHeader &header);
-		
-		StatisticsCollection *_collection;
-		HistogramCollection *_histogramCollection;
-		boost::shared_ptr<std::vector<AntennaInfo> > _antennas;
-		BandInfo *_band;
-		MSRowDataExt *_readRowData;
-		const MSRowDataExt *_writeRowData;
-};
-	
-}
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/absthresholdaction.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/absthresholdaction.h
deleted file mode 100644
index d12674fa0fcd01c3ceb945c1fbb4597ba3da9348..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/absthresholdaction.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#ifndef RFIABSTHRESHOLDACTION_H
-#define RFIABSTHRESHOLDACTION_H
-
-#include <AOFlagger/util/progresslistener.h>
-
-#include <AOFlagger/msio/timefrequencydata.h>
-
-#include <AOFlagger/strategy/control/actioncontainer.h>
-#include <AOFlagger/strategy/control/artifactset.h>
-
-namespace rfiStrategy {
-
-	class AbsThresholdAction : public Action
-	{
-		public:
-			AbsThresholdAction() : _threshold(1.0)
-			{
-			}
-			
-			virtual std::string Description()
-			{
-				return "Absolute threshold";
-			}
-			
-			virtual void Perform(class ArtifactSet &artifacts, class ProgressListener &)
-			{
-				TimeFrequencyData &data = artifacts.ContaminatedData();
-				if(data.PolarisationCount() != 1)
-					throw std::runtime_error("Can not threshold multiple polarisations at once; use a for-each-polarisation block.");
-				
-				data.SetGlobalMask(PerformThreshold(data.GetSingleImage()));
-			}
-			virtual ActionType Type() const { return AbsThresholdActionType; }
-			
-			double Threshold() const { return _threshold; }
-			void SetThreshold(double threshold) { _threshold = threshold; }
-		private:
-			Mask2DPtr PerformThreshold(Image2DCPtr image) const
-			{
-				const unsigned
-					width = image->Width(),
-					height = image->Height();
-				Mask2DPtr mask = Mask2D::CreateUnsetMaskPtr(width, height);
-				for(unsigned y=0;y<height;++y)
-				{
-					for(unsigned x=0;x<width;++x)
-					{
-						const num_t value = image->Value(x, y);
-						const bool flag = !std::isfinite(value) || fabsn(value)>_threshold;
-						mask->SetValue(x, y, flag);
-					}
-				}
-				return mask;
-			}
-			
-			double _threshold;
-	};
-}
-
-#endif // RFIADDSTATISTICSACTION_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/action.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/action.h
deleted file mode 100644
index 2e32a8313018ed6ec9d8ec2356dd85470b94d744..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/action.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#ifndef RFIACTION_H
-#define RFIACTION_H 
-
-#include <string>
-
-#include <AOFlagger/util/types.h>
-
-namespace rfiStrategy {
-
-	enum ActionType
-	{
-		AbsThresholdActionType,
-		ActionBlockType,
-		AdapterType,
-		AddStatisticsActionType,
-		BaselineSelectionActionType,
-		ChangeResolutionActionType,
-		CollectNoiseStatisticsActionType,
-		CombineFlagResultsType,
-		CutAreaActionType,
-		DirectionProfileActionType,
-		DirectionalCleanActionType,
-		EigenValueVerticalActionType,
-		ForEachBaselineActionType,
-		ForEachComplexComponentActionType,
-		ForEachMSActionType,
-		ForEachPolarisationBlockType,
-		ForEachSimulatedBaselineActionType,
-		FourierTransformActionType,
-		FrequencyConvolutionActionType,
-		FrequencySelectionActionType,
-		FringeStopActionType,
-		HighPassFilterActionType,
-		ImagerActionType,
-		IterationBlockType,
-		NormalizeVarianceActionType,
-		PlotActionType,
-		QuickCalibrateActionType,
-		RawAppenderActionType,
-		ResamplingActionType,
-		SetFlaggingActionType,
-		SetImageActionType,
-		SlidingWindowFitActionType,
-		SpatialCompositionActionType,
-		StatisticalFlagActionType,
-		StrategyType,
-		SumThresholdActionType,
-		SVDActionType,
-		TimeConvolutionActionType,
-		TimeSelectionActionType,
-		UVProjectActionType,
-		WriteDataActionType,
-		WriteFlagsActionType
-	};
-
-	class Action
-	{
-		friend class ActionContainer;
-
-		public:
-			Action() : _parent(0) { }
-			virtual ~Action() { }
-			virtual std::string Description() = 0;
-			virtual void Initialize() { }
-			virtual void Finish() { }
-			/**
-			 * Write any cached / delayed data to disk
-			 */
-			virtual void Sync() { }
-			virtual void Perform(class ArtifactSet &artifacts, class ProgressListener &progress) = 0;
-			class ActionContainer *Parent() const { return _parent; }
-			virtual ActionType Type() const = 0;
-
-			inline ActionContainer *GetRoot() const;
-			virtual unsigned int Weight() const { return 1; }
-		private:
-			class ActionContainer *_parent;
-	};
-}
-
-#include <AOFlagger/strategy/control/actioncontainer.h>
-
-namespace rfiStrategy {
-
-	ActionContainer *Action::GetRoot() const
-	{
-		if(_parent == 0)
-			return static_cast<ActionContainer*>(_parent);
-		else
-		{
-			ActionContainer *iter = _parent;
-			while(iter->_parent != 0) iter = iter->_parent;
-			return iter;
-		}
-	}
-
-}
-
-#endif // RFIACTION_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/adapter.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/adapter.h
deleted file mode 100644
index 036c76c61eec528341b47cebb545de1e3fd10a39..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/adapter.h
+++ /dev/null
@@ -1,117 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef RFI_ADAPTER
-#define RFI_ADAPTER
-
-#include <AOFlagger/strategy/control/artifactset.h>
-#include <AOFlagger/strategy/control/actionblock.h>
-
-namespace rfiStrategy {
-
-	class Adapter : public ActionBlock
-	{
-		public:
-			Adapter() : ActionBlock(), _restoreOriginals(false)
-			{
-			}
-			virtual std::string Description()
-			{
-				return "On amplitude";
-			}
-			virtual ActionType Type() const { return AdapterType; }
-			virtual void Perform(ArtifactSet &artifacts, class ProgressListener &listener)
-			{
-				enum TimeFrequencyData::PhaseRepresentation contaminatedPhase = 
-					artifacts.ContaminatedData().PhaseRepresentation();
-				enum TimeFrequencyData::PhaseRepresentation revisedPhase = 
-					artifacts.RevisedData().PhaseRepresentation();
-				enum TimeFrequencyData::PhaseRepresentation originalPhase = 
-					artifacts.OriginalData().PhaseRepresentation();
-
-				if(contaminatedPhase == TimeFrequencyData::ComplexRepresentation)
-				{
-					TimeFrequencyData *newContaminatedData =
-						artifacts.ContaminatedData().CreateTFData(TimeFrequencyData::AmplitudePart);
-					artifacts.SetContaminatedData(*newContaminatedData);
-					delete newContaminatedData;
-				}
-				if(revisedPhase == TimeFrequencyData::ComplexRepresentation)
-				{
-					TimeFrequencyData *newRevisedData =
-						artifacts.RevisedData().CreateTFData(TimeFrequencyData::AmplitudePart);
-					artifacts.SetRevisedData(*newRevisedData);
-					delete newRevisedData;
-				}
-				if(originalPhase == TimeFrequencyData::ComplexRepresentation)
-				{
-					TimeFrequencyData *newOriginalData =
-						artifacts.OriginalData().CreateTFData(TimeFrequencyData::AmplitudePart);
-					artifacts.SetOriginalData(*newOriginalData);
-					delete newOriginalData;
-				}
-
-				ActionBlock::Perform(artifacts, listener);
-
-				if(_restoreOriginals)
-				{
-					if(contaminatedPhase == TimeFrequencyData::ComplexRepresentation)
-					{
-						TimeFrequencyData *newContaminatedData =
-							TimeFrequencyData::CreateTFDataFromComplexCombination(artifacts.ContaminatedData(), artifacts.ContaminatedData());
-						newContaminatedData->MultiplyImages(1.0L/M_SQRT2);
-						newContaminatedData->SetMask(artifacts.ContaminatedData());
-						artifacts.SetContaminatedData(*newContaminatedData);
-						delete newContaminatedData;
-					}
-					if(revisedPhase == TimeFrequencyData::ComplexRepresentation)
-					{
-						TimeFrequencyData *newRevisedData =
-							TimeFrequencyData::CreateTFDataFromComplexCombination(artifacts.RevisedData(), artifacts.RevisedData());
-						newRevisedData->MultiplyImages(1.0L/M_SQRT2);
-						newRevisedData->SetMask(artifacts.RevisedData());
-						artifacts.SetRevisedData(*newRevisedData);
-						delete newRevisedData;
-					}
-					if(originalPhase == TimeFrequencyData::ComplexRepresentation)
-					{
-						TimeFrequencyData *newOriginalData =
-							TimeFrequencyData::CreateTFDataFromComplexCombination(artifacts.OriginalData(), artifacts.OriginalData());
-						newOriginalData->MultiplyImages(1.0L/M_SQRT2);
-						newOriginalData->SetMask(artifacts.OriginalData());
-						artifacts.SetOriginalData(*newOriginalData);
-						delete newOriginalData;
-					}
-				}
-			}
-			void SetRestoreOriginals(bool restoreOriginals)
-			{
-				_restoreOriginals = restoreOriginals;
-			}
-			bool RestoreOriginals() const
-			{
-				return _restoreOriginals;
-			}
-		private:
-			bool _restoreOriginals;
-	};
-
-} // namespace
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/addstatisticsaction.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/addstatisticsaction.h
deleted file mode 100644
index 5fe36add565815cebf23957d4189da06e316936d..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/addstatisticsaction.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#ifndef RFIADDSTATISTICSACTION_H
-#define RFIADDSTATISTICSACTION_H
-
-#include <AOFlagger/strategy/control/actioncontainer.h>
-#include <AOFlagger/strategy/control/artifactset.h>
-
-#include <string>
-
-#include <AOFlagger/util/progresslistener.h>
-
-#include <AOFlagger/strategy/algorithms/rfistatistics.h>
-#include <AOFlagger/strategy/algorithms/noisestatistics.h>
-
-namespace rfiStrategy {
-
-	class AddStatisticsAction : public Action
-	{
-		public:
-			AddStatisticsAction() : _comparison(false), _separateBaselineStatistics(false), _performClassification(true), _writeImmediately(false)
-			{
-			}
-			
-			virtual ~AddStatisticsAction()
-			{
-				Sync();
-			}
-
-			virtual std::string Description()
-			{
-				return "Add to statistics";
-			}
-			
-			virtual void Sync()
-			{
-				statistics.Save();
-			}
-			
-			virtual void Perform(class ArtifactSet &artifacts, class ProgressListener &)
-			{
-				statistics.SetSeparateBaselineStatistics(_separateBaselineStatistics);
-				statistics.SetPerformClassification(_performClassification);
-				statistics.SetWriteImmediately(_writeImmediately);
-				if(_comparison)
-					statistics.Add(artifacts.ContaminatedData(), artifacts.MetaData(), artifacts.OriginalData().GetSingleMask());
-				else
-					statistics.Add(artifacts.ContaminatedData(), artifacts.MetaData());
-			}
-			virtual ActionType Type() const { return AddStatisticsActionType; }
-			
-			void SetFilePrefix(const std::string &filePrefix) { statistics.SetFilePrefix(filePrefix); }
-			const std::string &FilePrefix() const { return statistics.FilePrefix(); }
-
-			bool CompareOriginalAndAlternative() const { return _comparison; }
-			void SetCompareOriginalAndAlternative(bool compare) { _comparison = compare; }
-
-			bool SeparateBaselineStatistics() const { return _separateBaselineStatistics; }
-			void SetSeparateBaselineStatistics(bool separateBaselineStatistics)
-			{
-				_separateBaselineStatistics = separateBaselineStatistics;
-			}
-
-			bool PerformClassification() const { return _performClassification; }
-			void SetPerformClassification(bool performClassification)
-			{
-				_performClassification = performClassification;
-			}
-
-			bool WriteImmediately() const { return _writeImmediately; }
-			void SetWriteImmediately(bool writeImmediately)
-			{
-				_writeImmediately = writeImmediately;
-			}
-		private:
-			RFIStatistics statistics;
-			bool _comparison;
-			bool _separateBaselineStatistics;
-			bool _performClassification;
-			bool _writeImmediately;
-	};
-}
-
-#endif // RFIADDSTATISTICSACTION_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/baselineselectionaction.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/baselineselectionaction.h
deleted file mode 100644
index 16700bdd295f71dba730e26cabad981828c40c59..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/baselineselectionaction.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef RFIBASELINESELECTIONACTION_H
-#define RFIBASELINESELECTIONACTION_H
-
-#include <vector>
-
-#include <boost/thread/mutex.hpp>
-
-#include <AOFlagger/msio/types.h>
-
-#include <AOFlagger/strategy/actions/action.h>
-
-#include <AOFlagger/strategy/algorithms/baselineselector.h>
-
-namespace rfiStrategy {
-
-	class BaselineSelectionAction : public Action
-	{
-		public:
-			BaselineSelectionAction() : _preparationStep(true), _flagBadBaselines(false), _makePlot(false), _threshold(8.0), _absThreshold(0.4), _smoothingSigma(0.6) { }
-
-			virtual std::string Description()
-			{
-				if(_preparationStep)
-					return "Select baselines (preparation)";
-				else
-					return "Mark bad baselines";
-			}
-			virtual void Perform(class ArtifactSet &artifacts, class ProgressListener &listener)
-			{
-				if(_preparationStep)
-					prepare(artifacts, listener);
-				else
-					mark(artifacts, listener);
-			}
-			virtual ActionType Type() const { return BaselineSelectionActionType; }
-
-			bool PreparationStep() const { return _preparationStep; }
-			void SetPreparationStep(bool preparationStep) { _preparationStep = preparationStep; }
-
-			bool FlagBadBaselines() const { return _flagBadBaselines; }
-			void SetFlagBadBaselines(bool flagBadBaselines) { _flagBadBaselines = flagBadBaselines; }
-
-			bool MakePlot() const { return _makePlot; }
-			void SetMakePlot(bool makePlot) { _makePlot = makePlot; }
-
-			num_t AbsThreshold() const { return _absThreshold; }
-			void SetAbsThreshold(double absThreshold) { _absThreshold = absThreshold; }
-
-			num_t Threshold() const { return _threshold; }
-			void SetThreshold(double threshold) { _threshold = threshold; }
-
-			num_t SmoothingSigma() const { return _smoothingSigma; }
-			void SetSmoothingSigma(double smoothingSigma) { _smoothingSigma = smoothingSigma; }
-		private:
-			void prepare(class ArtifactSet &artifacts, class ProgressListener &listener);
-			void mark(class ArtifactSet &artifacts, class ProgressListener &listener);
-			void flagBaselines(ArtifactSet &artifacts, const std::vector<BaselineSelector::SingleBaselineInfo> &baselines);
-
-			bool _preparationStep;
-			bool _flagBadBaselines;
-			bool _makePlot;
-			num_t _threshold, _absThreshold, _smoothingSigma;
-	};
-}
-
-#endif // RFIBASELINESELECTIONACTION_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/changeresolutionaction.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/changeresolutionaction.h
deleted file mode 100644
index 338b255af75bc0b137475cdbc5245d29f7db2d2f..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/changeresolutionaction.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef CHANGERESOLUTIONACTION_H
-#define CHANGERESOLUTIONACTION_H
-
-#include <AOFlagger/msio/timefrequencydata.h>
-
-#include <AOFlagger/strategy/control/actionblock.h>
-
-namespace rfiStrategy {
-	
-	/**
-		@author A.R. Offringa <offringa@astro.rug.nl>
-	*/
-	class ChangeResolutionAction : public ActionBlock {
-		public:
-			ChangeResolutionAction() : _timeDecreaseFactor(10), _frequencyDecreaseFactor(1), _restoreRevised(true), _restoreContaminated(false), _restoreMasks(false), _useMaskInAveraging(false)
-			{
-			}
-			~ChangeResolutionAction()
-			{
-			}
-			virtual std::string Description()
-			{
-				return "Change resolution";
-			}
-
-			void SetTimeDecreaseFactor(int newFactor) { _timeDecreaseFactor = newFactor; }
-			int TimeDecreaseFactor() const { return _timeDecreaseFactor; }
-
-			void SetFrequencyDecreaseFactor(int newFactor) { _frequencyDecreaseFactor = newFactor; }
-			int FrequencyDecreaseFactor() const { return _frequencyDecreaseFactor; }
-
-			virtual void Perform(class ArtifactSet &artifacts, class ProgressListener &listener);
-			virtual ActionType Type() const { return ChangeResolutionActionType; }
-
-			bool RestoreRevised() const { return _restoreRevised; }
-			void SetRestoreRevised(bool restoreRevised) { _restoreRevised = restoreRevised; }
-
-			bool RestoreContaminated() const { return _restoreContaminated; }
-			void SetRestoreContaminated(bool restoreContaminated) { _restoreContaminated = restoreContaminated; }
-
-			bool RestoreMasks() const { return _restoreMasks; }
-			void SetRestoreMasks(bool restoreMasks) { _restoreMasks = restoreMasks; }
-			
-			bool UseMaskInAveraging() const { return _useMaskInAveraging; }
-			void SetUseMaskInAveraging(bool useMask) { _useMaskInAveraging = useMask; }
-		private:
-			void PerformFrequencyChange(class ArtifactSet &artifacts, class ProgressListener &listener);
-
-			int _timeDecreaseFactor;
-			int _frequencyDecreaseFactor;
-
-			void DecreaseTime(TimeFrequencyData &data);
-			void IncreaseTime(TimeFrequencyData &originalData, TimeFrequencyData &changedData, bool restoreImage, bool restoreMask);
-
-			void DecreaseFrequency(TimeFrequencyData &data);
-			void IncreaseFrequency(TimeFrequencyData &originalData, TimeFrequencyData &changedData, bool restoreImage, bool restoreMask);
-			
-			void DecreaseTimeWithMask(TimeFrequencyData &data);
-
-			/**
-			 * If this is true, the subtasks of this task can change the revised image, and
-			 * this task will scale the changed images back to the original format. If it
-			 * is false, the images before this task will be restored (which is faster, because
-			 * then the changed image does not need to be enlarged).
-			 */
-			bool _restoreRevised;
-
-			bool _restoreContaminated;
-
-			/**
-			 * This is like _restoreRevised, but for the masks.
-			 */
-			bool _restoreMasks;
-			
-			/**
-			 * If set, values which are partially flagged, will be averaged only over
-			 * non-flagged samples. This only changes the decreasing of resolution.
-			 */
-			bool _useMaskInAveraging;
-	};
-
-}
-	
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/collectnoisestatisticsaction.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/collectnoisestatisticsaction.h
deleted file mode 100644
index 3d5a17978362c5dae6346ef9609bb81eb4dfbc11..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/collectnoisestatisticsaction.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#ifndef COLLECTNOISESTATISTICSACTION_H
-#define COLLECTNOISESTATISTICSACTION_H
-
-#include <string>
-
-#include <boost/thread/mutex.hpp>
-
-#include <AOFlagger/strategy/control/artifactset.h>
-
-#include <AOFlagger/util/progresslistener.h>
-
-#include <AOFlagger/strategy/algorithms/noisestatisticscollector.h>
-
-namespace rfiStrategy {
-
-	class CollectNoiseStatisticsAction : public Action
-	{
-		public:
-			CollectNoiseStatisticsAction() : _filename("noise-statistics")
-			{
-			}
-			
-			virtual ~CollectNoiseStatisticsAction()
-			{
-				_statistics.SaveTF(_filename + "-tf.txt");
-				_statistics.SaveTA(_filename + "-ta.txt");
-			}
-
-			virtual std::string Description()
-			{
-				return "Collect noise statistics";
-			}
-			
-			virtual void Perform(class ArtifactSet &artifacts, class ProgressListener &)
-			{
-				TimeFrequencyData data = artifacts.ContaminatedData();
-				if(data.PolarisationCount() != 1)
-					throw std::runtime_error("The noise collector action needs a single polarization");
-				boost::mutex::scoped_lock lock(_mutex);
-				if(data.PhaseRepresentation() == TimeFrequencyData::ComplexRepresentation)
-					_statistics.Add(data.GetRealPart(), data.GetImaginaryPart(), artifacts.OriginalData().GetSingleMask(), artifacts.MetaData());
-				else
-					_statistics.Add(data.GetSingleImage(), data.GetSingleImage(), artifacts.OriginalData().GetSingleMask(), artifacts.MetaData());
-			}
-			virtual ActionType Type() const { return CollectNoiseStatisticsActionType; }
-			
-			void SetFilename(const std::string &filename) { _filename = filename; }
-			const std::string &Filename() const { return _filename; }
-			
-			unsigned ChannelDistance() const { return _statistics.ChannelDistance(); }
-			void SetChannelDistance(unsigned channelDistance)
-			{
-				_statistics.SetChannelDistance(channelDistance);
-			}
-			
-			unsigned TileWidth() const { return _statistics.TileWidth(); }
-			void SetTileWidth(unsigned tileWidth)
-			{
-				_statistics.SetTileWidth(tileWidth);
-			}
-
-			unsigned TileHeight() const { return _statistics.TileHeight(); }
-			void SetTileHeight(unsigned tileHeight)
-			{
-				_statistics.SetTileHeight(tileHeight);
-			}
-		private:
-			boost::mutex _mutex;
-			NoiseStatisticsCollector _statistics;
-			std::string _filename;
-	};
-}
-
-#endif // COLLECTNOISESTATISTICSACTION_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/combineflagresultsaction.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/combineflagresultsaction.h
deleted file mode 100644
index 007e1950d13edc86c1edffa18883cdd10a6dbe50..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/combineflagresultsaction.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef COMBINE_FLAG_RESULTS_H
-#define COMBINE_FLAG_RESULTS_H
-
-#include <AOFlagger/util/progresslistener.h>
-
-#include <AOFlagger/strategy/control/artifactset.h>
-#include <AOFlagger/strategy/control/actioncontainer.h>
-
-namespace rfiStrategy {
-
-	class CombineFlagResults : public ActionContainer
-	{
-			public:
-				virtual std::string Description()
-				{
-					return "Combine flag results";
-				}
-				virtual ActionType Type() const { return CombineFlagResultsType; }
-				virtual void Perform(ArtifactSet &artifacts, class ProgressListener &listener)
-				{
-					if(GetChildCount() == 1)
-					{
-						GetFirstChild().Perform(artifacts, listener);
-					} else {
-						TimeFrequencyData originalFlags = artifacts.ContaminatedData();
-						TimeFrequencyData joinedFlags = artifacts.ContaminatedData();
-						size_t nr = 0;
-						for(const_iterator i=begin();i!=end();++i)
-						{
-							artifacts.SetContaminatedData(originalFlags);
-							Action *action = *i;
-							listener.OnStartTask(*this, nr, GetChildCount(), action->Description());
-							action->Perform(artifacts, listener);
-							listener.OnEndTask(*this);
-							++nr;
-	
-							joinedFlags.JoinMask(artifacts.ContaminatedData());
-						}
-						artifacts.SetContaminatedData(joinedFlags);
-					}
-				}
-	};
-
-} // namespace
-
-#endif //COMBINE_FLAG_RESULTS_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/cutareaaction.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/cutareaaction.h
deleted file mode 100644
index 2cc539eb21471267fb28932bfaebc8365853f83c..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/cutareaaction.h
+++ /dev/null
@@ -1,129 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef CUTAREAACTION_H
-#define CUTAREAACTION_H
-
-#include <AOFlagger/msio/timefrequencydata.h>
-#include <AOFlagger/msio/timefrequencymetadata.h>
-
-#include <AOFlagger/strategy/control/actionblock.h>
-#include <AOFlagger/strategy/control/artifactset.h>
-
-namespace rfiStrategy {
-	
-	/**
-		@author A.R. Offringa <offringa@astro.rug.nl>
-	*/
-	class CutAreaAction : public ActionBlock {
-		public:
-			CutAreaAction() : _startTimeSteps(0), _endTimeSteps(0), _topChannels(1), _bottomChannels(0)
-			{
-			}
-			~CutAreaAction()
-			{
-			}
-			virtual std::string Description()
-			{
-				return "Cut area";
-			}
-
-			void SetStartTimeSteps(int channels) { _startTimeSteps = channels; }
-			int StartTimeSteps() const { return _startTimeSteps; }
-
-			void SetEndTimeSteps(int channels) { _endTimeSteps = channels; }
-			int EndTimeSteps() const { return _endTimeSteps; }
-
-			void SetTopChannels(int channels) { _topChannels = channels; }
-			int TopChannels() const { return _topChannels; }
-
-			void SetBottomChannels(int channels) { _bottomChannels = channels; }
-			int BottomChannels() const { return _bottomChannels; }
-
-			virtual void Perform(class ArtifactSet &artifacts, class ProgressListener &progress)
-			{
-				TimeFrequencyData oldOriginal(artifacts.OriginalData());
-				TimeFrequencyData oldRevised(artifacts.RevisedData());
-				TimeFrequencyData oldContaminated(artifacts.ContaminatedData());
-				TimeFrequencyMetaDataCPtr oldMetaData = artifacts.MetaData();
-
-				Cut(artifacts.OriginalData());
-				Cut(artifacts.RevisedData());
-				Cut(artifacts.ContaminatedData());
-
-				artifacts.SetMetaData(Cut(oldMetaData));
-
-				ActionBlock::Perform(artifacts, progress);
-				
-				PlaceBack(artifacts.OriginalData(), oldOriginal);
-				PlaceBack(artifacts.RevisedData(), oldRevised);
-				PlaceBack(artifacts.ContaminatedData(), oldContaminated);
-
-				artifacts.SetOriginalData(oldOriginal);
-				artifacts.SetRevisedData(oldRevised);
-				artifacts.SetContaminatedData(oldContaminated);
-				artifacts.SetMetaData(oldMetaData);
-			}
-
-			virtual ActionType Type() const { return CutAreaActionType; }
-		private:
-			void Cut(class TimeFrequencyData &data)
-			{
-				size_t endTime = data.ImageWidth() - _endTimeSteps;
-				size_t endChannel = data.ImageHeight() - _bottomChannels;
-				data.Trim(_startTimeSteps, _topChannels, endTime, endChannel);
-			}
-			TimeFrequencyMetaDataPtr Cut(TimeFrequencyMetaDataCPtr &metaData)
-			{
-				TimeFrequencyMetaData *newMetaData = new TimeFrequencyMetaData(*metaData);
-				if(newMetaData->HasUVW())
-				{
-					std::vector<UVW> newUVW;
-					newUVW.insert(newUVW.begin(), newMetaData->UVW().begin()+_startTimeSteps, newMetaData->UVW().end()-(_startTimeSteps+_endTimeSteps));
-					newMetaData->SetUVW(newUVW);
-				}
-				if(newMetaData->HasObservationTimes())
-				{
-					std::vector<double> times;
-					times.insert(times.begin(), newMetaData->ObservationTimes().begin() +_startTimeSteps, newMetaData->ObservationTimes().end()-(_startTimeSteps+_endTimeSteps));
-					newMetaData->SetObservationTimes(times);
-				}
-				return TimeFrequencyMetaDataPtr(newMetaData);
-				if(newMetaData->HasBand())
-				{
-					BandInfo band(newMetaData->Band());
-					band.channels.erase(band.channels.end() - (_topChannels+_bottomChannels), band.channels.end());
-					band.channels.erase(band.channels.begin(), band.channels.begin() + _topChannels);
-					newMetaData->SetBand(band);
-				}
-			}
-			void PlaceBack(class TimeFrequencyData &cuttedData, class TimeFrequencyData &oldData)
-			{
-				oldData.CopyFrom(cuttedData, _startTimeSteps, _topChannels);
-			}
-
-			int _startTimeSteps;
-			int _endTimeSteps;
-			int _topChannels;
-			int _bottomChannels;
-	};
-
-}
-	
-#endif // CUTAREAACTION_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/directionalcleanaction.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/directionalcleanaction.h
deleted file mode 100644
index 2d46c522baa5fc1b91f42c66d1d3d64edc843006..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/directionalcleanaction.h
+++ /dev/null
@@ -1,259 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef RFI_DIRECTIONALCLEAN_ACTION_H
-#define RFI_DIRECTIONALCLEAN_ACTION_H
-
-#include <iostream>
-
-#include <AOFlagger/util/ffttools.h>
-#include <AOFlagger/util/plot.h>
-
-#include <AOFlagger/msio/samplerow.h>
-#include <AOFlagger/msio/timefrequencydata.h>
-
-#include <AOFlagger/strategy/actions/action.h>
-
-#include <AOFlagger/strategy/algorithms/thresholdtools.h>
-#include <AOFlagger/strategy/algorithms/uvprojection.h>
-
-#include <AOFlagger/strategy/control/artifactset.h>
-#include <AOFlagger/strategy/control/actionblock.h>
-
-namespace rfiStrategy {
-
-	class DirectionalCleanAction : public Action
-	{
-		public:
-			DirectionalCleanAction() : Action(), _limitingDistance(1.0), _removeRatio(0.25), _attenuationOfCenter(0.01), _channelConvolutionSize(1), _makePlot(true), _values(0)
-			{
-			}
-			virtual ~DirectionalCleanAction()
-			{
-				Finish();
-			}
-			virtual void Finish()
-			{
-				if(_values != 0)
-				{
-					if(_makePlot)
-					{
-						Plot plot("clean.pdf");
-						unsigned left = 0, right = 0;
-						for(unsigned i=0;i!=_valueWidth/2;++i)
-						{
-							if(_values[i] != 0) left = i;
-							if(_values[_valueWidth-i-1] != 0) right = i;
-						}
-						plot.StartScatter("Positive");
-						for(unsigned i=0;i<=left;++i)
-							plot.PushDataPoint(i, _values[i]);
-						plot.StartScatter("Negative");
-						for(unsigned i=0;i<=right;++i)
-							plot.PushDataPoint(i, _values[_valueWidth-i-1]);
-						plot.Close();
-						plot.Show();
-					}
-					delete[] _values;
-					_values = 0;
-				}
-			}
-			virtual std::string Description()
-			{
-				return "Directional cleaning";
-			}
-			virtual ActionType Type() const { return DirectionalCleanActionType; }
-			virtual void Perform(ArtifactSet &artifacts, class ProgressListener &)
-			{
-				TimeFrequencyData &contaminated = artifacts.ContaminatedData();
-				if(contaminated.ImageCount() != 2 || contaminated.PhaseRepresentation() != TimeFrequencyData::ComplexRepresentation)
-					throw std::runtime_error("Directional clean action requires single complex image in contaminated data");
-
-				TimeFrequencyData &revised = artifacts.RevisedData();
-				if(revised.ImageCount() != 2 || revised.PhaseRepresentation() != TimeFrequencyData::ComplexRepresentation)
-					throw std::runtime_error("Directional clean action requires single complex image in revised data");
-
-				TimeFrequencyData &original = artifacts.OriginalData();
-				if(original.ImageCount() != 2 || original.PhaseRepresentation() != TimeFrequencyData::ComplexRepresentation)
-					throw std::runtime_error("Directional clean action requires single complex image in original data");
-
-				Image2DPtr
-					realDest = Image2D::CreateCopy(revised.GetRealPart()),
-					imagDest = Image2D::CreateCopy(revised.GetImaginaryPart()),
-					realOriginal = Image2D::CreateCopy(original.GetRealPart()),
-					imagOriginal = Image2D::CreateCopy(original.GetImaginaryPart());
-
-				Image2DPtr amplitudes = FFTTools::CreateAbsoluteImage(contaminated.GetImage(0), contaminated.GetImage(1));
-
-				if(_channelConvolutionSize != 1)
-					amplitudes = ThresholdTools::FrequencyRectangularConvolution(amplitudes, _channelConvolutionSize);
-
-				if(_values == 0)
-				{
-					_valueWidth = amplitudes->Width();
-					_values = new num_t[amplitudes->Width()];
-					for(unsigned i=0;i<amplitudes->Width();++i) _values[i] = 0.0;
-				}
-
-				for(unsigned y=0;y<contaminated.ImageHeight();++y)
-				{
-					performFrequency(artifacts, amplitudes, realDest, imagDest, realOriginal, imagOriginal, y, y == contaminated.ImageHeight()/2);
-				}
-				revised.SetImage(0, realDest);
-				revised.SetImage(1, imagDest);
-				original.SetImage(0, realOriginal);
-				original.SetImage(1, imagOriginal);
-				AOLogger::Debug << "Done: direction clean iteration\n";
-			}
-			numl_t LimitingDistance() const { return _limitingDistance; }
-			void SetLimitingDistance(double limitingDistance) { _limitingDistance = limitingDistance; }
-
-			numl_t RemoveRatio() const { return _removeRatio; }
-			void SetRemoveRatio(numl_t ratio) { _removeRatio = ratio; }
-
-			unsigned ChannelConvolutionSize() const { return _channelConvolutionSize; }
-			void SetChannelConvolutionSize(unsigned channelConvolutionSize) { _channelConvolutionSize = channelConvolutionSize; }
-
-			numl_t AttenuationOfCenter() const { return _attenuationOfCenter; }
-			void SetAttenuationOfCenter(numl_t attenuationOfCenter) { _attenuationOfCenter = attenuationOfCenter; }
-
-			bool MakePlot() const { return _makePlot; }
-			void SetMakePlot(bool makePlot) { _makePlot = makePlot; }
-		private:
-			double _limitingDistance;
-			numl_t _removeRatio, _attenuationOfCenter;
-			unsigned _channelConvolutionSize;
-			unsigned _valueWidth;
-			bool _makePlot;
-			num_t *_values;
-
-			void performFrequency(ArtifactSet &artifacts, Image2DCPtr amplitudeValues, Image2DPtr realDest, Image2DPtr imagDest, Image2DPtr realOriginal, Image2DPtr imagOriginal, unsigned y, bool verbose=false)
-			{
-				Image2DCPtr
-					realInput = artifacts.ContaminatedData().GetRealPart(),
-					imagInput = artifacts.ContaminatedData().GetImaginaryPart();
-				
-				const size_t
-					inputWidth = realInput->Width(),
-					destWidth = realDest->Width();
-
-				numl_t
-					*uPositions = new numl_t[inputWidth],
-					*vPositions = new numl_t[inputWidth];
-					
-				SampleRowPtr row = SampleRow::CreateFromRow(amplitudeValues, y);
-				
-				UVProjection::ProjectPositions(artifacts.MetaData(), inputWidth, y, uPositions, vPositions, artifacts.ProjectedDirectionRad());
-				
-				numl_t minU, maxU;
-				UVProjection::MaximalUPositions(inputWidth, uPositions, minU, maxU);
-				
-				unsigned lowestIndex, highestIndex;
-				UVProjection::GetIndicesInProjectedImage(_limitingDistance, minU, maxU, inputWidth, destWidth, lowestIndex, highestIndex);
-				for(unsigned i=0;i!=lowestIndex;++i)
-				{
-					const numl_t weight = (1.0-_attenuationOfCenter)*((numl_t) i / lowestIndex) + _attenuationOfCenter;
-					row->SetValue(i, weight * row->Value(i));
-				}
-				for(unsigned i=highestIndex;i!=destWidth;++i)
-				{
-					const numl_t weight = _attenuationOfCenter;
-					row->SetValue(i, weight * row->Value(i));
-				}
-				
-				unsigned fIndex = row->IndexOfMax();
-				
-				if(verbose)
-					AOLogger::Debug << "Removing component index " << fIndex << '\n';
-				
-				const numl_t
-					mean = row->Mean(),
-					sigma = row->StdDev(mean),
-					diffR = realInput->Value(fIndex, y),
-					diffI = imagInput->Value(fIndex, y),
-					amplitude = sqrtnl(diffR*diffR + diffI*diffI),
-					phase = atan2nl(diffI, diffR);
-				
-				if(verbose)
-					AOLogger::Debug << "Mean=" << mean << ", sigma=" << sigma << ", component = " << ((amplitude-mean)/sigma) << " x sigma\n";
-				
-				numl_t amplitudeRemoved = amplitude * _removeRatio;
-
-				numl_t limit = mean;
-
-				if(amplitude < limit || amplitude < 0.0)
-				{
-					if(verbose)
-						AOLogger::Debug << "Strongest component is < limit not continuing with clean\n";
-				} else
-				{
-					subtractComponent(realDest, imagDest, inputWidth, uPositions, fIndex, amplitudeRemoved, phase, y);
-					
-					//unsigned upperLimit = ((lowestIndex*2) > (destWidth/2)) ? (destWidth/2) : (lowestIndex*2);
-					unsigned upperLimit = destWidth/2;
-					if(fIndex >= lowestIndex && fIndex < upperLimit)
-					{
-						if(verbose)
-							AOLogger::Debug << "Within limits " << lowestIndex << "-" << upperLimit << '\n';
-						_values[fIndex] += amplitudeRemoved;
-						subtractComponent(realOriginal, imagOriginal, inputWidth, uPositions, fIndex, amplitudeRemoved, phase, y);
-					} else {
-						if(verbose)
-							AOLogger::Debug << "Outside limits " << lowestIndex << "-" << upperLimit << '\n';
-					}
-				}
-				
-				delete[] uPositions;
-				delete[] vPositions;
-			}
-
-			void subtractComponent(Image2DPtr real, Image2DPtr imaginary, const size_t inputWidth, const numl_t *uPositions, unsigned fIndex, numl_t amplitude, numl_t phase, unsigned y)
-			{
-				numl_t minU, maxU;
-				UVProjection::MaximalUPositions(inputWidth, uPositions, minU, maxU);
-
-				numl_t w = (numl_t) fIndex;
-				if(w >= real->Width()/2) {
-					w -= real->Width();
-				}
-
-				// The following component will be subtracted:
-				// amplitude e ^ ( -i (2 pi w (u - minU) / (maxU - minU) + phase) )
-				
-				// prefactor w
-				w = w / (maxU - minU);
-				
-				// Since fftw performs unnormalized fft, we have to divide by N
-				amplitude = amplitude / real->Width();
-				
-				for(unsigned t=0;t<real->Width();++t)
-				{
-					numl_t u = uPositions[t];
-					numl_t exponent = -2.0 * M_PInl * w * (u - minU) - phase;
-					numl_t realValue = amplitude * cosnl(exponent);
-					numl_t imagValue = amplitude * sinnl(exponent);
-					real->SetValue(t, y, real->Value(t, y) - realValue);
-					imaginary->SetValue(t, y, imaginary->Value(t, y) - imagValue);
-				}
-			}
-	};
-
-} // namespace
-
-#endif // RFI_DIRECTIONALCLEAN_ACTION_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/directionprofileaction.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/directionprofileaction.h
deleted file mode 100644
index 3035de51426e1c35573936cd725c70a040e64109..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/directionprofileaction.h
+++ /dev/null
@@ -1,208 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef DIRECTIONPROFILEACTION_H
-#define DIRECTIONPROFILEACTION_H
-
-#include <cmath>
-
-#include <AOFlagger/msio/timefrequencydata.h>
-
-#include <AOFlagger/strategy/actions/action.h>
-
-#include <AOFlagger/strategy/algorithms/vertevd.h>
-
-#include <AOFlagger/strategy/control/artifactset.h>
-
-namespace rfiStrategy {
-	
-	/**
-		@author A.R. Offringa <offringa@astro.rug.nl>
-	*/
-	class DirectionProfileAction : public Action {
-		public:
-			enum Axis { HorizontalAxis, VerticalAxis };
-			enum ProfileAction { Store, Apply, Unapply };
-			
-			DirectionProfileAction() : _axis(HorizontalAxis), _profileAction(Store)
-			{
-			}
-			~DirectionProfileAction()
-			{
-			}
-			virtual std::string Description()
-			{
-				std::string s;
-				if(_axis == VerticalAxis)
-					s = "vertically";
-				else
-					s = "horizontally";
-				switch(_profileAction)
-				{
-					default:
-					case Store: return std::string("Store profile ") + s;
-					case Apply: return std::string("Apply profile ") + s;
-					case Unapply: return std::string("Unapply profile ") + s;
-				}
-			}
-
-			virtual void Perform(class ArtifactSet &artifacts, class ProgressListener &)
-			{
-				TimeFrequencyData data(artifacts.ContaminatedData());
-				if(data.PolarisationCount()!=1)
-				{
-					throw std::runtime_error("Profile changing requires one polarization");
-				}
-				switch(_profileAction)
-				{
-					default:
-					case Store:
-						if(_axis == HorizontalAxis)
-							storeHorizontalProfile(artifacts);
-						else
-							storeVerticalProfile(artifacts);
-						break;
-					case Apply:
-						if(_axis == HorizontalAxis)
-							applyHorizontalProfile(artifacts, false);
-						else
-							applyVerticalProfile(artifacts, false);
-						break;
-					case Unapply:
-						if(_axis == HorizontalAxis)
-							applyHorizontalProfile(artifacts, true);
-						else
-							applyVerticalProfile(artifacts, true);
-						break;
-				}
-			}
-
-			virtual ActionType Type() const { return DirectionProfileActionType; }
-			
-			enum Axis Axis() const { return _axis; }
-			void SetAxis(enum Axis axis) { _axis = axis; }
-			
-			enum ProfileAction ProfileAction() const { return _profileAction; }
-			void SetProfileAction(enum ProfileAction profileAction) { _profileAction = profileAction; }
-		private:
-			enum Axis _axis;
-			enum ProfileAction _profileAction;
-			
-			void storeHorizontalProfile(ArtifactSet &artifacts)
-			{
-				const TimeFrequencyData &data = artifacts.ContaminatedData();
-				std::vector<num_t> &profile = artifacts.HorizontalProfile();
-				profile.clear();
-			
-				Image2DCPtr input = data.GetSingleImage();
-				for(unsigned x=0;x<input->Width();++x)
-				{
-					num_t timeAvg = 0.0;
-					for(unsigned y=0;y<input->Height();++y)
-					{
-						if(std::isfinite(input->Value(x, y)))
-							timeAvg += input->Value(x, y);
-					}
-					timeAvg /= (num_t) input->Height();
-					profile.push_back(timeAvg);
-				}
-			}
-			
-			void storeVerticalProfile(ArtifactSet &artifacts)
-			{
-				const TimeFrequencyData &data = artifacts.ContaminatedData();
-				std::vector<num_t> &profile = artifacts.VerticalProfile();
-				profile.clear();
-				
-				Image2DCPtr input = data.GetSingleImage();
-				for(unsigned y=0;y<input->Height();++y)
-				{
-					num_t timeAvg = 0.0;
-					for(unsigned x=0;x<input->Width();++x)
-					{
-						if(std::isfinite(input->Value(x, y)))
-							timeAvg += input->Value(x, y);
-					}
-					timeAvg /= (num_t) input->Width();
-					profile.push_back(timeAvg);
-				}
-			}
-			
-			void applyHorizontalProfile(ArtifactSet &artifacts, bool inverse)
-			{
-				TimeFrequencyData &data = artifacts.ContaminatedData();
-				const std::vector<num_t> &profile = artifacts.HorizontalProfile();
-				if(profile.size() != data.ImageWidth())
-					throw std::runtime_error("Can not apply horizontal profile: profile not stored or stored for different image size");
-				for(unsigned i=0;i<data.ImageCount();++i)
-				{
-					Image2DCPtr input = data.GetImage(i);
-					Image2DPtr output = Image2D::CreateUnsetImagePtr(input->Width(), input->Height());
-					for(unsigned x=0;x<input->Width();++x)
-					{
-						for(unsigned y=0;y<input->Height();++y)
-						{
-							if(inverse)
-							{
-								if(profile[x] != 0.0)
-									output->SetValue(x, y, input->Value(x, y) / profile[x]);
-								else
-									output->SetValue(x, y, 0.0);
-							} else {
-									output->SetValue(x, y, input->Value(x, y) * profile[x]);
-							}
-						}
-					}
-					data.SetImage(i, output);
-				}
-			}
-			
-			void applyVerticalProfile(ArtifactSet &artifacts, bool inverse)
-			{
-				TimeFrequencyData &data = artifacts.ContaminatedData();
-				const std::vector<num_t> &profile = artifacts.VerticalProfile();
-				if(profile.size() != data.ImageHeight())
-					throw std::runtime_error("Can not apply horizontal profile: profile not stored or stored for different image size");
-				for(unsigned i=0;i<data.ImageCount();++i)
-				{
-					Image2DCPtr input = data.GetImage(i);
-					Image2DPtr output = Image2D::CreateUnsetImagePtr(input->Width(), input->Height());
-					for(unsigned y=0;y<input->Height();++y)
-					{
-						for(unsigned x=0;x<input->Width();++x)
-						{
-							if(inverse)
-							{
-								if(profile[y] != 0.0)
-									output->SetValue(x, y, input->Value(x, y) / profile[y]);
-								else
-									output->SetValue(x, y, 0.0);
-							} else {
-									output->SetValue(x, y, input->Value(x, y) * profile[y]);
-							}
-						}
-					}
-					data.SetImage(i, output);
-				}
-			}
-	};
-
-}
-	
-#endif // DIRECTIONPROFILEACTION_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/eigenvalueverticalaction.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/eigenvalueverticalaction.h
deleted file mode 100644
index 888ad70810674ab34678c6717b77592fe1eb4674..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/eigenvalueverticalaction.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef EIGENVALUEVERTICALACTION_H
-#define EIGENVALUEVERTICALACTION_H
-
-#include <AOFlagger/msio/timefrequencydata.h>
-
-#include <AOFlagger/strategy/actions/action.h>
-
-#include <AOFlagger/strategy/algorithms/vertevd.h>
-
-#include <AOFlagger/strategy/control/artifactset.h>
-
-namespace rfiStrategy {
-	
-	/**
-		@author A.R. Offringa <offringa@astro.rug.nl>
-	*/
-	class EigenValueVerticalAction : public Action {
-		public:
-			EigenValueVerticalAction() : _timeIntegrated(true)
-			{
-			}
-			~EigenValueVerticalAction()
-			{
-			}
-			virtual std::string Description()
-			{
-				return "Eigen value decomposition (vertical)";
-			}
-
-			virtual void Perform(class ArtifactSet &artifacts, class ProgressListener &)
-			{
-				TimeFrequencyData &data = artifacts.ContaminatedData();
-				if(data.PolarisationCount()!=1)
-				{
-					throw std::runtime_error("Eigen value decompisition requires one polarization");
-				}
-				VertEVD::Perform(data, _timeIntegrated);
-			}
-
-			virtual ActionType Type() const { return EigenValueVerticalActionType; }
-		private:
-			bool _timeIntegrated;
-	};
-
-}
-	
-#endif // EIGENVALUEVERTICALACTION_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/foreachbaselineaction.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/foreachbaselineaction.h
deleted file mode 100644
index d15bdf59ca69e54155c894743c2edd180aed6687..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/foreachbaselineaction.h
+++ /dev/null
@@ -1,185 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef RFISTRATEGYFOREACHBASELINEACTION_H
-#define RFISTRATEGYFOREACHBASELINEACTION_H
-
-#include <AOFlagger/strategy/control/actionblock.h>
-#include <AOFlagger/strategy/control/artifactset.h>
-
-#include <AOFlagger/strategy/imagesets/imageset.h>
-
-#include <stack>
-#include <set>
-
-#include <boost/thread/mutex.hpp>
-#include <boost/thread/condition.hpp>
-
-#include <AOFlagger/util/progresslistener.h>
-
-namespace rfiStrategy {
-
-	/**
-		@author A.R. Offringa <offringa@astro.rug.nl>
-	*/
-	class ForEachBaselineAction : public ActionBlock {
-		public:
-			ForEachBaselineAction() : _threadCount(4), _selection(CrossCorrelations), _resultSet(0), _exceptionOccured(false),  _hasInitAntennae(false)
-			{
-			}
-			virtual ~ForEachBaselineAction()
-			{
-			}
-			virtual std::string Description()
-			{
-				return "For each baseline";
-			}
-			virtual void Initialize()
-			{
-			}
-			virtual void Perform(ArtifactSet &artifacts, ProgressListener &progress);
-
-			enum BaselineSelection Selection() const throw() { return _selection; }
-			void SetSelection(enum BaselineSelection selection) throw() { _selection = selection; }
-			
-			size_t ThreadCount() const throw() { return _threadCount; }
-			void SetThreadCount(size_t threadCount) throw() { _threadCount = threadCount; }
-			
-			virtual ActionType Type() const { return ForEachBaselineActionType; }
-
-			std::set<size_t> &AntennaeToSkip() { return _antennaeToSkip; }
-			const std::set<size_t> &AntennaeToSkip() const { return _antennaeToSkip; }
-			
-			std::set<size_t> &AntennaeToInclude() { return _antennaeToInclude; }
-			const std::set<size_t> &AntennaToInclude() const { return _antennaeToInclude; }
-		private:
-			bool IsBaselineSelected(ImageSetIndex &index);
-			class ImageSetIndex *GetNextIndex();
-			
-			void SetExceptionOccured();
-			void SetFinishedBaselines();
-			void SetProgress(ProgressListener &progress, int no, int count, std::string taskName, int threadId);
-			size_t mathThreadCount() const
-			{
-				// Since IO also takes some CPU, and IO should not be
-				// starved by math (because it is mostly IO limited),
-				// we reserve one of the threads for that.
-				//if(_threadCount > 1)
-				//	return _threadCount - 1;
-				//else
-					return _threadCount;
-			}
-
-			size_t BaselineProgress()
-			{
-				boost::mutex::scoped_lock lock(_mutex);
-				return _baselineProgress;
-			}
-			void IncBaselineProgress()
-			{
-				boost::mutex::scoped_lock lock(_mutex);
-				++_baselineProgress;
-			}
-			
-			void WaitForBufferAvailable(size_t maxSize)
-			{
-				boost::mutex::scoped_lock lock(_mutex);
-				while(_baselineBuffer.size() > maxSize && !_exceptionOccured)
-					_dataProcessed.wait(lock);
-			}
-			
-			class BaselineData *GetNextBaseline()
-			{
-				boost::mutex::scoped_lock lock(_mutex);
-				while(_baselineBuffer.size() == 0 && !_exceptionOccured && !_finishedBaselines)
-					_dataAvailable.wait(lock);
-				if((_finishedBaselines && _baselineBuffer.size() == 0) || _exceptionOccured)
-					return 0;
-				else
-				{
-					BaselineData *next = _baselineBuffer.top();
-					_baselineBuffer.pop();
-					_dataProcessed.notify_one();
-					return next;
-				}
-			}
-
-			size_t GetBaselinesInBufferCount()
-			{
-				boost::mutex::scoped_lock lock(_mutex);
-				return _baselineBuffer.size();
-			}
-			
-			struct PerformFunction : public ProgressListener
-			{
-				PerformFunction(ForEachBaselineAction &action, ProgressListener &progress, size_t threadIndex)
-				  : _action(action), _progress(progress), _threadIndex(threadIndex)
-				{
-				}
-				PerformFunction(const PerformFunction &source)
-					: ProgressListener(source), _action(source._action), _progress(source._progress), _threadIndex(source._threadIndex)
-				{
-				}
-				ForEachBaselineAction &_action;
-				ProgressListener &_progress;
-				size_t _threadIndex;
-				void operator()();
-				virtual void OnStartTask(const Action &action, size_t taskNo, size_t taskCount, const std::string &description, size_t weight=1);
-				virtual void OnEndTask(const Action &action);
-				virtual void OnProgress(const Action &action, size_t progres, size_t maxProgress);
-				virtual void OnException(const Action &action, std::exception &thrownException);
-			};
-			
-			struct ReaderFunction
-			{
-				ReaderFunction(ForEachBaselineAction &action)
-				  : _action(action)
-				{
-				}
-				void operator()();
-
-				ForEachBaselineAction &_action;
-			};
-			
-			size_t _baselineCount, _nextIndex;
-			size_t _threadCount;
-			BaselineSelection _selection;
-
-			ImageSetIndex *_loopIndex;
-			ArtifactSet *_artifacts, *_resultSet;
-			
-			boost::mutex _mutex;
-			boost::condition _dataAvailable, _dataProcessed;
-			std::stack<BaselineData*> _baselineBuffer;
-			bool _finishedBaselines;
-
-			int *_progressTaskNo, *_progressTaskCount;
-			bool _exceptionOccured;
-			size_t _baselineProgress;
-			
-			// Initial data
-			AntennaInfo _initAntenna1, _initAntenna2;
-			bool _hasInitAntennae;
-			size_t _initPartIndex;
-			std::set<size_t> _antennaeToInclude;
-			std::set<size_t> _antennaeToSkip;
-	};
-}
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/foreachcomplexcomponentaction.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/foreachcomplexcomponentaction.h
deleted file mode 100644
index dcc40a117b855bf7c4342ef8e49a04cbfe86481a..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/foreachcomplexcomponentaction.h
+++ /dev/null
@@ -1,285 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef FOR_EACH_COMPLEX_COMPONENT_ACTION_H
-#define FOR_EACH_COMPLEX_COMPONENT_ACTION_H
-
-#include <AOFlagger/strategy/actions/action.h>
-
-#include <AOFlagger/util/progresslistener.h>
-
-#include <AOFlagger/strategy/control/artifactset.h>
-#include <AOFlagger/strategy/control/actionblock.h>
-
-namespace rfiStrategy {
-
-	class ForEachComplexComponentAction : public ActionBlock
-	{
-		public:
-			ForEachComplexComponentAction() : ActionBlock(), _onAmplitude(false), _onPhase(false), _onReal(true), _onImaginary(true), _restoreFromAmplitude(false)
-			{
-			}
-			virtual std::string Description()
-			{
-				if(IterationCount() == 1)
-				{
-					if(_onAmplitude) {
-						if(_restoreFromAmplitude)
-							return "On amplitude (restore)";
-						else
-							return "On amplitude";
-					}
-					if(_onPhase) return "On phase";
-					if(_onReal) return "On real";
-					if(_onImaginary) return "On imaginary";
-				}
-				return "For each complex component";
-			}
-			virtual ActionType Type() const { return ForEachComplexComponentActionType; }
-			virtual void Perform(ArtifactSet &artifacts, class ProgressListener &listener)
-			{
-				size_t taskCount = 0;
-				if(_onAmplitude) ++taskCount;
-				if(_onPhase) ++taskCount;
-				if(_onReal) ++taskCount;
-				if(_onImaginary) ++taskCount;
-				
-				size_t taskIndex = 0;
-				
-				if(_onAmplitude) {
-					listener.OnStartTask(*this, taskIndex, taskCount, "On amplitude");
-					performOnAmplitude(artifacts, listener);
-					listener.OnEndTask(*this);
-					++taskIndex;
-				}
-				if(_onPhase) {
-					listener.OnStartTask(*this, taskIndex, taskCount, "On phase");
-					performOnPhaseRepresentation(artifacts, listener, TimeFrequencyData::PhasePart);
-					listener.OnEndTask(*this);
-					++taskIndex;
-				}
-				if(_onReal) {
-					listener.OnStartTask(*this, taskIndex, taskCount, "On real");
-					performOnPhaseRepresentation(artifacts, listener, TimeFrequencyData::RealPart);
-					listener.OnEndTask(*this);
-					++taskIndex;
-				}
-				if(_onImaginary) {
-					listener.OnStartTask(*this, taskIndex, taskCount, "On imaginary");
-					performOnPhaseRepresentation(artifacts, listener, TimeFrequencyData::ImaginaryPart);
-					listener.OnEndTask(*this);
-					++taskIndex;
-				}
-			}
-			unsigned IterationCount() const {
-				unsigned count = 0;
-				if(_onAmplitude) ++count;
-				if(_onPhase) ++count;
-				if(_onReal) ++count;
-				if(_onImaginary) ++count;
-				return count;
-			}
-			void SetRestoreFromAmplitude(bool restoreFromAmplitude)
-			{
-				_restoreFromAmplitude = restoreFromAmplitude;
-			}
-			bool RestoreFromAmplitude() const
-			{
-				return _restoreFromAmplitude;
-			}
-			void SetOnAmplitude(bool onAmplitude)
-			{
-				_onAmplitude = onAmplitude;
-			}
-			bool OnAmplitude() const
-			{
-				return _onAmplitude;
-			}
-			void SetOnPhase(bool onPhase)
-			{
-				_onPhase = onPhase;
-			}
-			bool OnPhase() const
-			{
-				return _onPhase;
-			}
-			void SetOnReal(bool onReal)
-			{
-				_onReal = onReal;
-			}
-			bool OnReal() const
-			{
-				return _onReal;
-			}
-			void SetOnImaginary(bool onImaginary)
-			{
-				_onImaginary = onImaginary;
-			}
-			bool OnImaginary() const
-			{
-				return _onImaginary;
-			}
-		private:
-			void performOnAmplitude(ArtifactSet &artifacts, class ProgressListener &listener)
-			{
-				enum TimeFrequencyData::PhaseRepresentation contaminatedPhase = 
-					artifacts.ContaminatedData().PhaseRepresentation();
-				enum TimeFrequencyData::PhaseRepresentation revisedPhase = 
-					artifacts.RevisedData().PhaseRepresentation();
-				enum TimeFrequencyData::PhaseRepresentation originalPhase = 
-					artifacts.OriginalData().PhaseRepresentation();
-
-				if(contaminatedPhase == TimeFrequencyData::ComplexRepresentation)
-				{
-					TimeFrequencyData *newContaminatedData =
-						artifacts.ContaminatedData().CreateTFData(TimeFrequencyData::AmplitudePart);
-					artifacts.SetContaminatedData(*newContaminatedData);
-					delete newContaminatedData;
-				}
-				if(revisedPhase == TimeFrequencyData::ComplexRepresentation)
-				{
-					TimeFrequencyData *newRevisedData =
-						artifacts.RevisedData().CreateTFData(TimeFrequencyData::AmplitudePart);
-					artifacts.SetRevisedData(*newRevisedData);
-					delete newRevisedData;
-				}
-				if(originalPhase == TimeFrequencyData::ComplexRepresentation)
-				{
-					TimeFrequencyData *newOriginalData =
-						artifacts.OriginalData().CreateTFData(TimeFrequencyData::AmplitudePart);
-					artifacts.SetOriginalData(*newOriginalData);
-					delete newOriginalData;
-				}
-
-				ActionBlock::Perform(artifacts, listener);
-
-				if(_restoreFromAmplitude)
-				{
-					if(contaminatedPhase == TimeFrequencyData::ComplexRepresentation)
-					{
-						TimeFrequencyData *newContaminatedData =
-							TimeFrequencyData::CreateTFDataFromComplexCombination(artifacts.ContaminatedData(), artifacts.ContaminatedData());
-						newContaminatedData->MultiplyImages(1.0L/M_SQRT2);
-						newContaminatedData->SetMask(artifacts.ContaminatedData());
-						artifacts.SetContaminatedData(*newContaminatedData);
-						delete newContaminatedData;
-					}
-					if(revisedPhase == TimeFrequencyData::ComplexRepresentation)
-					{
-						TimeFrequencyData *newRevisedData =
-							TimeFrequencyData::CreateTFDataFromComplexCombination(artifacts.RevisedData(), artifacts.RevisedData());
-						newRevisedData->MultiplyImages(1.0L/M_SQRT2);
-						newRevisedData->SetMask(artifacts.RevisedData());
-						artifacts.SetRevisedData(*newRevisedData);
-						delete newRevisedData;
-					}
-					if(originalPhase == TimeFrequencyData::ComplexRepresentation)
-					{
-						TimeFrequencyData *newOriginalData =
-							TimeFrequencyData::CreateTFDataFromComplexCombination(artifacts.OriginalData(), artifacts.OriginalData());
-						newOriginalData->MultiplyImages(1.0L/M_SQRT2);
-						newOriginalData->SetMask(artifacts.OriginalData());
-						artifacts.SetOriginalData(*newOriginalData);
-						delete newOriginalData;
-					}
-				}
-			}
-			
-			void performOnPhaseRepresentation(ArtifactSet &artifacts, class ProgressListener &listener, enum TimeFrequencyData::PhaseRepresentation phaseRepresentation)
-			{
-				enum TimeFrequencyData::PhaseRepresentation
-					contaminatedPhase = artifacts.ContaminatedData().PhaseRepresentation(),
-					revisedPhase = artifacts.RevisedData().PhaseRepresentation(),
-					originalPhase = artifacts.OriginalData().PhaseRepresentation();
-					
-				TimeFrequencyData
-					prevContaminated = artifacts.ContaminatedData(),
-					prevRevised = artifacts.RevisedData(),
-					prevOriginal = artifacts.OriginalData();
-					
-				bool phaseRepresentationIsAvailable = false;
-
-				if(contaminatedPhase == TimeFrequencyData::ComplexRepresentation || contaminatedPhase == phaseRepresentation)
-				{
-					TimeFrequencyData *newContaminatedData =
-						artifacts.ContaminatedData().CreateTFData(phaseRepresentation);
-					artifacts.SetContaminatedData(*newContaminatedData);
-					delete newContaminatedData;
-					phaseRepresentationIsAvailable = true;
-				}
-				if(revisedPhase == TimeFrequencyData::ComplexRepresentation || revisedPhase == phaseRepresentation)
-				{
-					TimeFrequencyData *newRevisedData =
-						artifacts.RevisedData().CreateTFData(phaseRepresentation);
-					artifacts.SetRevisedData(*newRevisedData);
-					delete newRevisedData;
-					phaseRepresentationIsAvailable = true;
-				}
-				if(originalPhase == TimeFrequencyData::ComplexRepresentation || originalPhase == phaseRepresentation)
-				{
-					TimeFrequencyData *newOriginalData =
-						artifacts.OriginalData().CreateTFData(phaseRepresentation);
-					artifacts.SetOriginalData(*newOriginalData);
-					delete newOriginalData;
-					phaseRepresentationIsAvailable = true;
-				}
-
-				if(phaseRepresentationIsAvailable)
-				{
-					ActionBlock::Perform(artifacts, listener);
-
-					if(phaseRepresentation != TimeFrequencyData::PhasePart)
-					{
-						if(contaminatedPhase == TimeFrequencyData::ComplexRepresentation)
-							setPart(artifacts.ContaminatedData(), prevContaminated);
-						if(revisedPhase == TimeFrequencyData::ComplexRepresentation)
-							setPart(artifacts.RevisedData(), prevRevised);
-						if(originalPhase == TimeFrequencyData::ComplexRepresentation)
-							setPart(artifacts.OriginalData(), prevOriginal);
-					}
-				}
-			}
-			void setPart(TimeFrequencyData &changedData, TimeFrequencyData &prevData)
-			{
-				TimeFrequencyData *newData, *otherPart;
-				switch(changedData.PhaseRepresentation())
-				{
-					default:
-					case TimeFrequencyData::RealPart:
-						otherPart = prevData.CreateTFData(TimeFrequencyData::ImaginaryPart);
-						newData = TimeFrequencyData::CreateTFDataFromComplexCombination(changedData, *otherPart);
-						break;
-					case TimeFrequencyData::ImaginaryPart:
-						otherPart = prevData.CreateTFData(TimeFrequencyData::RealPart);
-						newData = TimeFrequencyData::CreateTFDataFromComplexCombination(*otherPart, changedData);
-						break;
-				}
-				changedData = *newData;
-				changedData.SetMask(prevData);
-				delete newData;
-				delete otherPart;
-			}
-			
-			bool _onAmplitude, _onPhase, _onReal, _onImaginary;
-			bool _restoreFromAmplitude;
-		};
-
-} // namespace
-
-#endif // FOR_EACH_COMPLEX_COMPONENT_ACTION_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/foreachmsaction.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/foreachmsaction.h
deleted file mode 100644
index e8670ba029055b86948196c903785f73e3b8cbbd..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/foreachmsaction.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef FOREACHMSACTION_H
-#define FOREACHMSACTION_H
-
-#include <AOFlagger/strategy/control/actionblock.h>
-
-#include <AOFlagger/msio/types.h>
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-namespace rfiStrategy {
-
-	class ForEachMSAction  : public ActionBlock {
-		public:
-			ForEachMSAction() : _readUVW(false), _dataColumnName("DATA"), _subtractModel(false), _skipIfAlreadyProcessed(false), _baselineIOMode(AutoReadMode)
-			{
-			}
-			~ForEachMSAction()
-			{
-			}
-			virtual std::string Description()
-			{
-				return "For each measurement set";
-			}
-			virtual void Initialize()
-			{
-			}
-			virtual void Perform(ArtifactSet &artifacts, ProgressListener &progress);
-			virtual ActionType Type() const { return ForEachMSActionType; }
-			virtual unsigned int Weight() const { return ActionBlock::Weight() * _filenames.size(); }
-			void AddDirectory(const std::string &name);
-			void writeHistory(const std::string &filename);
-
-			std::vector<std::string> &Filenames() { return _filenames; }
-			const std::vector<std::string> &Filenames() const { return _filenames; }
-
-			BaselineIOMode IOMode() const { return _baselineIOMode; }
-			void SetIOMode(BaselineIOMode ioMode) { _baselineIOMode = ioMode; }
-
-			bool ReadUVW() const { return _readUVW; }
-			void SetReadUVW(bool readUVW) { _readUVW = readUVW; }
-
-			const std::string &DataColumnName() const { return _dataColumnName; }
-			void SetDataColumnName(const std::string &name) { _dataColumnName = name; }
-
-			bool SubtractModel() const { return _subtractModel; }
-			void SetSubtractModel(bool subtractModel) { _subtractModel = subtractModel; }
-
-			std::string CommandLineForHistory() const { return _commandLineForHistory; }
-			void SetCommandLineForHistory(const std::string cmd) { _commandLineForHistory = cmd; }
-			
-			bool SkipIfAlreadyProcessed() const { return _skipIfAlreadyProcessed; }
-			void SetSkipIfAlreadyProcessed(bool value) { _skipIfAlreadyProcessed = value; }
-		private:
-			std::vector<std::string> _filenames;
-			bool _readUVW;
-			std::string _dataColumnName;
-			bool _subtractModel;
-			std::string _commandLineForHistory;
-			bool _skipIfAlreadyProcessed;
-			BaselineIOMode _baselineIOMode;
-	};
-
-}
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/foreachpolarisationaction.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/foreachpolarisationaction.h
deleted file mode 100644
index af3a6d022272c20b4957c9677f8a09237c6131e5..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/foreachpolarisationaction.h
+++ /dev/null
@@ -1,280 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#ifndef RFI_FOREACHPOLARISATION_H
-#define RFI_FOREACHPOLARISATION_H 
-
-#include <AOFlagger/strategy/actions/action.h>
-
-#include <AOFlagger/strategy/control/actionblock.h>
-#include <AOFlagger/strategy/control/artifactset.h>
-
-#include <AOFlagger/msio/timefrequencydata.h>
-
-namespace rfiStrategy {
-
-	class ForEachPolarisationBlock : public ActionBlock
-	{
-		public:
-			ForEachPolarisationBlock() :
-				_onXX(true), _onXY(true), _onYX(true), _onYY(true),
-				_onStokesI(false), _onStokesQ(false), _onStokesU(false), _onStokesV(false),
-				_changeRevised(false)
-			{
-			}
-			virtual ~ForEachPolarisationBlock()
-			{
-			}
-			virtual std::string Description()
-			{
-				if(selectedPolarizationCount() == 1)
-				{
-					if(_onXX) return "On XX";
-					if(_onXY) return "On XY";
-					if(_onYX) return "On YX";
-					if(_onYY) return "On YY";
-					if(_onStokesI) return "On Stokes I";
-					if(_onStokesQ) return "On Stokes Q";
-					if(_onStokesU) return "On Stokes U";
-					if(_onStokesV) return "On Stokes V";
-				}
-				return "For each polarisation";
-			}
-			virtual void Initialize()
-			{
-			}
-			virtual ActionType Type() const { return ForEachPolarisationBlockType; }
-			virtual void Perform(ArtifactSet &artifacts, ProgressListener &progress)
-			{
-				TimeFrequencyData
-					oldContaminatedData = artifacts.ContaminatedData(),
-					oldRevisedData = artifacts.RevisedData(),
-					oldOriginalData = artifacts.OriginalData();
-
-				if(oldContaminatedData.Polarisation() != oldOriginalData.Polarisation())
-					throw BadUsageException("Contaminated and original do not have equal polarisation, in for each polarisation block");
-
-				if(oldContaminatedData.PolarisationCount() == 1)
-				{
-					// There is only one polarisation in the contaminated data; just run all childs
-					ActionBlock::Perform(artifacts, progress);
-				}
-				else if(isDecompositionSelected())
-				{
-					performStokesIteration(artifacts, progress);
-				}
-				else {
-					bool changeRevised = (oldRevisedData.Polarisation() == oldContaminatedData.Polarisation());
-					unsigned count = oldContaminatedData.PolarisationCount();
-
-					for(unsigned polarizationIndex = 0; polarizationIndex < count; ++polarizationIndex)
-					{
-						TimeFrequencyData *newContaminatedData =
-							oldContaminatedData.CreateTFDataFromPolarisationIndex(polarizationIndex);
-						if(isPolarizationSelected(newContaminatedData->Polarisation()))
-						{
-							TimeFrequencyData *newOriginalData =
-								oldOriginalData.CreateTFDataFromPolarisationIndex(polarizationIndex);
-
-							artifacts.SetContaminatedData(*newContaminatedData);
-							artifacts.SetOriginalData(*newOriginalData);
-			
-							progress.OnStartTask(*this, polarizationIndex, count, newContaminatedData->Description());
-			
-							delete newOriginalData;
-							
-							if(changeRevised)
-							{
-								TimeFrequencyData *newRevised = oldRevisedData.CreateTFDataFromPolarisationIndex(polarizationIndex);
-								artifacts.SetRevisedData(*newRevised);
-								delete newRevised;
-							}
-			
-							ActionBlock::Perform(artifacts, progress);
-
-							setPolarizationData(polarizationIndex, oldContaminatedData, artifacts.ContaminatedData());
-							setPolarizationData(polarizationIndex, oldOriginalData, artifacts.OriginalData());
-							if(changeRevised && _changeRevised)
-								setPolarizationData(polarizationIndex, oldRevisedData, artifacts.RevisedData());
-
-							progress.OnEndTask(*this);
-						}
-						delete newContaminatedData;
-					}
-
-					artifacts.SetContaminatedData(oldContaminatedData);
-					artifacts.SetRevisedData(oldRevisedData);
-					artifacts.SetOriginalData(oldOriginalData);
-				}
-			}
-
-			void SetIterateStokesValues(bool iterateStokesValues)
-			{
-				_onStokesI = iterateStokesValues;
-				_onStokesQ = iterateStokesValues;
-				_onStokesU = iterateStokesValues;
-				_onStokesV = iterateStokesValues;
-			}
-			
-			bool IterateStokesValues() const
-			{
-				return _onStokesI && _onStokesQ && _onStokesU && _onStokesV;
-			}
-			
-			void SetOnXX(bool onXX) { _onXX = onXX; }
-			void SetOnXY(bool onXY) { _onXY = onXY; }
-			void SetOnYX(bool onYX) { _onYX = onYX; }
-			void SetOnYY(bool onYY) { _onYY = onYY; }
-			void SetOnStokesI(bool onStokesI) { _onStokesI = onStokesI; }
-			void SetOnStokesQ(bool onStokesQ) { _onStokesQ = onStokesQ; }
-			void SetOnStokesU(bool onStokesU) { _onStokesU = onStokesU; }
-			void SetOnStokesV(bool onStokesV) { _onStokesV = onStokesV; }
-			
-			bool OnXX() const { return _onXX; }
-			bool OnXY() const { return _onXY; }
-			bool OnYX() const { return _onYX; }
-			bool OnYY() const { return _onYY; }
-			bool OnStokesI() const { return _onStokesI; }
-			bool OnStokesQ() const { return _onStokesQ; }
-			bool OnStokesU() const { return _onStokesU; }
-			bool OnStokesV() const { return _onStokesV; }
-		private:
-			bool _onXX, _onXY, _onYX, _onYY, _onStokesI, _onStokesQ, _onStokesU, _onStokesV;
-			bool _changeRevised;
-			
-			bool isPolarizationSelected(PolarisationType polarization)
-			{
-				switch(polarization)
-				{
-					case XXPolarisation: return _onXX;
-					case XYPolarisation: return _onXY;
-					case YXPolarisation: return _onYX;
-					case YYPolarisation: return _onYY;
-					case StokesIPolarisation: return _onStokesI;
-					case StokesQPolarisation: return _onStokesQ;
-					case StokesUPolarisation: return _onStokesU;
-					case StokesVPolarisation: return _onStokesV;
-					default: return false;
-				}
-			}
-			
-			bool isDecompositionSelected() const
-			{
-				return _onStokesI || _onStokesQ || _onStokesU || _onStokesV;
-			}
-			
-			int selectedPolarizationCount() const
-			{
-				int count = 0;
-				if(_onXX) ++count;
-				if(_onXY) ++count;
-				if(_onYX) ++count;
-				if(_onYY) ++count;
-				if(_onStokesI) ++count;
-				if(_onStokesQ) ++count;
-				if(_onStokesU) ++count;
-				if(_onStokesV) ++count;
-				return count;
-			}
-
-			void setPolarizationData(size_t polarizationIndex, TimeFrequencyData &oldData, TimeFrequencyData &newData)
-			{
-				try {
-					oldData.SetPolarizationData(polarizationIndex, newData);
-				} catch(std::exception &e)
-				{
-					TimeFrequencyData *data = oldData.CreateTFDataFromPolarisationIndex(polarizationIndex);
-					data->SetGlobalMask(newData.GetSingleMask());
-					oldData.SetPolarizationData(polarizationIndex, *data);
-					delete data;
-				}
-			}
-
-			void performStokesIteration(ArtifactSet &artifacts, ProgressListener &progress)
-			{
-				TimeFrequencyData
-					oldContaminatedData = artifacts.ContaminatedData(),
-					oldRevisedData = artifacts.RevisedData(),
-					oldOriginalData = artifacts.OriginalData();
-
-				bool changeRevised = (oldRevisedData.Polarisation() == oldContaminatedData.Polarisation());
-
-				Mask2DPtr mask = Mask2D::CreateSetMaskPtr<false>(oldContaminatedData.ImageWidth(), oldContaminatedData.ImageHeight());
-
-				if(_onStokesI)
-				{
-					performPolarisation(artifacts, progress, StokesIPolarisation, oldContaminatedData, oldOriginalData, oldRevisedData, changeRevised, 0, 4);
-					mask->Join(artifacts.ContaminatedData().GetSingleMask());
-				}
-
-				if(_onStokesQ)
-				{
-					performPolarisation(artifacts, progress, StokesQPolarisation, oldContaminatedData, oldOriginalData, oldRevisedData, changeRevised, 1, 4);
-					mask->Join(artifacts.ContaminatedData().GetSingleMask());
-				}
-
-				if(_onStokesU)
-				{
-					performPolarisation(artifacts, progress, StokesUPolarisation, oldContaminatedData, oldOriginalData, oldRevisedData, changeRevised, 2, 4);
-					mask->Join(artifacts.ContaminatedData().GetSingleMask());
-				}
-
-				if(_onStokesV)
-				{
-					performPolarisation(artifacts, progress, StokesVPolarisation, oldContaminatedData, oldOriginalData, oldRevisedData, changeRevised, 3, 4);
-					mask->Join(artifacts.ContaminatedData().GetSingleMask());
-				}
-				
-				oldContaminatedData.SetGlobalMask(mask);
-				artifacts.SetContaminatedData(oldContaminatedData);
-				artifacts.SetRevisedData(oldRevisedData);
-				artifacts.SetOriginalData(oldOriginalData);
-			}
-
-			void performPolarisation(ArtifactSet &artifacts, ProgressListener &progress, enum PolarisationType polarisation, const TimeFrequencyData &oldContaminatedData, const TimeFrequencyData &oldOriginalData, const TimeFrequencyData &oldRevisedData, bool changeRevised, size_t taskNr, size_t taskCount)
-			{
-				TimeFrequencyData *newContaminatedData =
-					oldContaminatedData.CreateTFData(polarisation);
-				artifacts.SetContaminatedData(*newContaminatedData);
-				progress.OnStartTask(*this, taskNr, taskCount, newContaminatedData->Description());
-				delete newContaminatedData;
-
-				TimeFrequencyData *newOriginalData =
-					oldOriginalData.CreateTFData(polarisation);
-				artifacts.SetOriginalData(*newOriginalData);
-				delete newOriginalData;
-
-
-				if(changeRevised)
-				{
-					TimeFrequencyData *newRevised = oldRevisedData.CreateTFData(polarisation);
-					artifacts.SetRevisedData(*newRevised);
-					delete newRevised;
-				}
-
-				ActionBlock::Perform(artifacts, progress);
-
-				progress.OnEndTask(*this);
-			}
-	};
-
-}
-
-#endif // RFI_FOREACHPOLARISATION_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/foreachsimulatedbaselineaction.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/foreachsimulatedbaselineaction.h
deleted file mode 100644
index f51e240cfd358169fb576a544c91ef959199c944..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/foreachsimulatedbaselineaction.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef RFI_FOR_EACH_SIMULATED_BASELINE_ACTION
-#define RFI_FOR_EACH_SIMULATED_BASELINE_ACTION
-
-#include <AOFlagger/imaging/observatorium.h>
-#include <AOFlagger/imaging/model.h>
-
-#include <AOFlagger/strategy/actions/action.h>
-
-#include <AOFlagger/imaging/defaultmodels.h>
-
-#include <AOFlagger/strategy/control/artifactset.h>
-#include <AOFlagger/strategy/control/actionblock.h>
-
-namespace rfiStrategy {
-
-	class ForEachSimulatedBaselineAction : public ActionBlock
-	{
-		public:
-			ForEachSimulatedBaselineAction() : ActionBlock()
-			{
-			}
-			virtual std::string Description()
-			{
-				return "For each sim. baseline";
-			}
-			virtual ActionType Type() const { return ForEachSimulatedBaselineActionType; }
-			virtual void Perform(ArtifactSet &artifacts, class ProgressListener &listener)
-			{
-				/*
-				double dec = 0.5*M_PI + 0.12800;
-				double ra = -0.03000;
-				double factor = 1.0;
-
-				struct Observatorium *observatorium = new WSRTObservatorium(16);
-				class Model *model = new Model();
-				model->loadUrsaMajor(dec, ra, factor);
-				model->loadUrsaMajorDistortingSource(dec, ra, factor);
-				
-				if(observatorium != 0 && model != 0)
-				{*/
-				ArtifactSet localArtifacts(artifacts);
-				size_t antennaCount = 14; //observatorium->AntennaCount();
-				size_t taskNr = 0;
-				for(size_t a1=0;a1<antennaCount;++a1)
-				{
-					for(size_t a2=a1+1;a2<antennaCount;++a2)
-					{
-						listener.OnStartTask(*this, taskNr, antennaCount*(antennaCount-1)/2, "Simulating baseline");
-						++taskNr;
-						
-						std::pair<TimeFrequencyData, TimeFrequencyMetaDataPtr> pair = DefaultModels::LoadSet(DefaultModels::EmptySet, DefaultModels::ConstantDistortion, 0.0, 64, 2500000.0*4.0, a1, a2);
-						TimeFrequencyData data = pair.first;
-						TimeFrequencyMetaDataCPtr metaData = pair.second;
-
-						localArtifacts.SetOriginalData(data);
-						localArtifacts.SetContaminatedData(data);
-						localArtifacts.SetMetaData(metaData);
-						
-						ActionBlock::Perform(localArtifacts, listener);
-						
-						listener.OnEndTask(*this);
-					}
-				}
-			}
-		private:
-	};
-
-} // namespace
-
-#endif // RFI_FOR_EACH_SIMULATED_BASELINE_ACTION
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/fouriertransformaction.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/fouriertransformaction.h
deleted file mode 100644
index 24be480f6308416ff45b8070461bcfd1672fccb0..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/fouriertransformaction.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef RFI_FOURIERTRANSFORM_ACTION_H
-#define RFI_FOURIERTRANSFORM_ACTION_H
-
-#include <iostream>
-
-#include <AOFlagger/util/ffttools.h>
-
-#include <AOFlagger/msio/timefrequencydata.h>
-
-#include <AOFlagger/strategy/actions/action.h>
-
-#include <AOFlagger/strategy/control/artifactset.h>
-#include <AOFlagger/strategy/control/actionblock.h>
-
-namespace rfiStrategy {
-
-	class FourierTransformAction : public Action
-	{
-		public:
-			FourierTransformAction() : Action(), _inverse(false), _dynamic(false), _sections(64)
-			{
-			}
-			virtual std::string Description()
-			{
-				if(_inverse)
-					return "Inv Fourier transform";
-				else
-					return "Fourier transform";
-			}
-			virtual ActionType Type() const { return FourierTransformActionType; }
-			virtual void Perform(ArtifactSet &artifacts, class ProgressListener &)
-			{
-				perform(artifacts.ContaminatedData(), artifacts.MetaData());
-			}
-			bool Inverse() const { return _inverse; }
-			void SetInverse(bool inverse) { _inverse = inverse; }
-		private:
-			void perform(TimeFrequencyData &data, TimeFrequencyMetaDataCPtr /*metaData*/)
-			{
-				if(data.PhaseRepresentation() != TimeFrequencyData::ComplexRepresentation || data.ImageCount() != 2)
-					throw std::runtime_error("Fourier transform action needs a single complex image as input");
-				Image2DPtr
-					real = Image2D::CreateCopy(data.GetImage(0)),
-					imaginary = Image2D::CreateCopy(data.GetImage(1));
-				if(_dynamic)
-				{
-					FFTTools::CreateDynamicHorizontalFFTImage(real, imaginary, _sections, _inverse);
-				} else {
-					FFTTools::CreateHorizontalFFTImage(*real, *imaginary, _inverse);
-				}
-				data.SetImage(0, real);
-				data.SetImage(1, imaginary);
-			}
-
-			bool _inverse;
-			bool _dynamic;
-			unsigned _sections;
-	};
-
-} // namespace
-
-#endif // RFI_FOURIERTRANSFORM_ACTION_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/frequencyconvolutionaction.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/frequencyconvolutionaction.h
deleted file mode 100644
index 3f2b6364df90bde1386a9e98d46c59760b0b2746..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/frequencyconvolutionaction.h
+++ /dev/null
@@ -1,208 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef RFI_FREQUENCY_CONVOLUTION_ACTION
-#define RFI_FREQUENCY_CONVOLUTION_ACTION
-
-#include <stdexcept>
-
-#include <AOFlagger/msio/samplerow.h>
-
-#include <AOFlagger/imaging/uvimager.h>
-
-#include <AOFlagger/util/aologger.h>
-#include <AOFlagger/util/progresslistener.h>
-
-#include <AOFlagger/strategy/actions/action.h>
-
-#include <AOFlagger/strategy/control/actionblock.h>
-#include <AOFlagger/strategy/control/artifactset.h>
-
-#include <AOFlagger/strategy/algorithms/thresholdtools.h>
-
-namespace rfiStrategy {
-
-	class FrequencyConvolutionAction : public Action
-	{
-		public:
-			enum KernelKind { RectangleKernel, SincKernel, TotalKernel };
-			
-			FrequencyConvolutionAction() : Action(), _kernelKind(SincKernel), _convolutionSize(4.0), _inSamples(false)
-			{
-			}
-			virtual std::string Description()
-			{
-				return "Frequency convolution";
-			}
-			virtual ActionType Type() const { return FrequencyConvolutionActionType; }
-			virtual void Perform(ArtifactSet &artifacts, class ProgressListener &listener)
-			{
-				TimeFrequencyData &data = artifacts.ContaminatedData();
-				if(_kernelKind == TotalKernel)
-				{
-					Image2DPtr
-						rImage = Image2D::CreateCopy(data.GetImage(0)),
-						iImage = Image2D::CreateCopy(data.GetImage(1));
-					Convolve(rImage, iImage, artifacts.MetaData(), listener);
-					data.SetImage(0, rImage);
-					data.SetImage(1, iImage);
-					artifacts.SetRevisedData(data);
-				}
-				else
-				{
-					if(data.ImageCount() != 1)
-						throw std::runtime_error("A frequency convolution can only be applied on single component data");
-
-					Image2DPtr newImage;
-					switch(_kernelKind)
-					{
-						default:
-						case RectangleKernel:
-						newImage = ThresholdTools::FrequencyRectangularConvolution(data.GetImage(0), (unsigned) roundn(_convolutionSize));
-						break;
-						case SincKernel:
-						newImage = sincConvolution(artifacts.MetaData(), data.GetImage(0));
-						break;
-					}
-					
-					data.SetImage(0, newImage);
-				}
-			}
-			
-			numl_t ConvolutionSize() const { return _convolutionSize; }
-			void SetConvolutionSize(numl_t size) { _convolutionSize = size; }
-			
-			enum KernelKind KernelKind() const { return _kernelKind; }
-			void SetKernelKind(enum KernelKind kind) { _kernelKind = kind; }
-			
-			bool InSamples() const { return _inSamples; }
-			void SetInSamples(bool inSamples) { _inSamples = inSamples; }
-		private:
-			Image2DPtr sincConvolution(TimeFrequencyMetaDataCPtr metaData, Image2DCPtr source)
-			{
-				numl_t uvDist = averageUVDist(metaData);
-				AOLogger::Debug << "Avg uv dist: " << uvDist << '\n';
-				numl_t convolutionSize = convolutionSizeInSamples(uvDist, source->Height());
-				AOLogger::Debug << "Convolution size: " << convolutionSize << '\n';
-				Image2DPtr destination = Image2D::CreateUnsetImagePtr(source->Width(), source->Height());
-				for(unsigned x=0;x<source->Width();++x)
-				{
-					SampleRowPtr row = SampleRow::CreateFromColumn(source, x);
-					row->ConvolveWithSinc(1.0 / convolutionSize);
-					row->SetVerticalImageValues(destination, x);
-				}
-				return destination;
-			}
-			
-			numl_t averageUVDist(TimeFrequencyMetaDataCPtr metaData)
-			{
-				numl_t sum = 0.0;
-				const numl_t
-					lowFreq = metaData->Band().channels.begin()->frequencyHz,
-					highFreq = metaData->Band().channels.rbegin()->frequencyHz;
-				const std::vector<UVW> &uvw = metaData->UVW();
-				for(std::vector<UVW>::const_iterator i=uvw.begin();i!=uvw.end();++i)
-				{
-					const numl_t
-						lowU = i->u * lowFreq,
-						lowV = i->v * lowFreq,
-						highU = i->u * highFreq,
-						highV = i->v * highFreq,
-						ud = lowU - highU,
-						vd = lowV - highV;
-					sum += sqrtnl(ud * ud + vd * vd);
-				}
-				return sum / ((numl_t) uvw.size() * UVImager::SpeedOfLight());
-			}
-			
-			numl_t convolutionSizeInSamples(numl_t uvDist, unsigned height)
-			{
-				if(_inSamples)
-					return _convolutionSize;
-				else
-					return _convolutionSize * height / uvDist;
-			}
-			
-			void Convolve(Image2DPtr rImage, Image2DPtr iImage, TimeFrequencyMetaDataCPtr metaData, ProgressListener &listener)
-			{
-				Image2DPtr copyReal = Image2D::CreateCopy(rImage);
-				Image2DPtr copyImag = Image2D::CreateCopy(iImage);
-				const size_t
-					width = rImage->Width(),
-					height = rImage->Height();
-				const std::vector<UVW> &uvws = metaData->UVW();
-				
-				const num_t factor = M_PIn / _convolutionSize;
-				
-				for(size_t y=0;y<height;++y)
-				{
-					for(size_t x=0;x<width;++x)
-					{
-						const UVW uvw = uvws[x];
-						const num_t sol = UVImager::SpeedOfLight();
-						const double freq1 = metaData->Band().channels[y].frequencyHz / sol;
-						const num_t
-							u1 = uvw.u * freq1,
-							v1 = uvw.v * freq1;
-						//	w1 = uvw.w * freq1;
-						num_t real = 0.0f, imaginary = 0.0f, weight = 1.0f;
-						
-						for(size_t yi=0;yi<height;++yi)
-						{
-							const double freq2 = metaData->Band().channels[yi].frequencyHz / sol;
-							for(size_t xi=0;xi<width;++xi)
-							{
-								if(xi == x && yi == y)
-								{
-									real += copyReal->Value(xi, yi);
-									imaginary += copyImag->Value(xi, yi);
-								} else {
-									const UVW uvwi = uvws[xi];
-									const num_t
-										du = uvwi.u * freq2 - u1,
-										dv = uvwi.v * freq2 - v1;
-										//dw = uvwi.w * freq2 - w1;
-									const num_t dist = sqrtn(du*du + dv*dv) * factor; // + dw*dw
-									const num_t sincVal = sinn(dist) / dist;
-									/*if(xi == 0)
-									{
-										AOLogger::Debug << dist << '*' << factor << " -> " << sincVal << '\n';
-									}*/
-									
-									real += sincVal * copyReal->Value(xi, yi);
-									imaginary += sincVal * copyImag->Value(xi, yi);
-									weight += sincVal;
-								}
-							}
-						}
-						rImage->SetValue(x, y, real / weight);
-						iImage->SetValue(x, y, imaginary / weight);
-					}
-					listener.OnProgress(*this, y+1, height);
-				}
-			}
-			
-			enum KernelKind _kernelKind;
-			numl_t _convolutionSize;
-			bool _inSamples;
-	};
-
-} // namespace
-
-#endif // RFI_FREQUENCY_CONVOLUTION_ACTION
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/frequencyselectionaction.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/frequencyselectionaction.h
deleted file mode 100644
index b529df3871c6374305f1925ab508b2597bfd094c..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/frequencyselectionaction.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef FREQUENCYSELECTIONACTION_H
-#define FREQUENCYSELECTIONACTION_H
-
-#include <AOFlagger/msio/types.h>
-
-#include <AOFlagger/strategy/actions/action.h>
-
-namespace rfiStrategy {
-	
-	/**
-		@author A.R. Offringa <offringa@astro.rug.nl>
-	*/
-	class FrequencySelectionAction : public Action {
-		public:
-			FrequencySelectionAction() : _threshold(3.0), _clipDown(true)
-			{
-			}
-			~FrequencySelectionAction()
-			{
-			}
-			virtual std::string Description()
-			{
-				return "Frequency selection";
-			}
-			virtual void Perform(ArtifactSet &artifacts, class ProgressListener &listener);
-			virtual ActionType Type() const { return FrequencySelectionActionType; }
-
-			num_t Threshold() const { return _threshold; }
-			void SetThreshold(num_t threshold) { _threshold = threshold; }
-		private:
-			double _threshold;
-			bool _clipDown;
-	};
-
-}
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/fringestopaction.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/fringestopaction.h
deleted file mode 100644
index bf4abb9b6412b5ad13ccb21b604557aae7438ecd..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/fringestopaction.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#ifndef FRINGESTOPACTION_H
-#define FRINGESTOPACTION_H 
-
-#include <AOFlagger/msio/types.h>
-
-#include <AOFlagger/strategy/actions/action.h>
-
-namespace rfiStrategy {
-
-	class FringeStopAction : public Action
-	{
-		public:
-			FringeStopAction() : _fringesToConsider(1.0L), _maxWindowSize(128), _fitChannelsIndividually(true), _onlyFringeStop(false), _newPhaseCentreRA(0.0), _newPhaseCentreDec(0.5 * M_PInl) { }
-			virtual ~FringeStopAction() { }
-			
-			virtual std::string Description()
-			{
-				return "Fringe stop recovery";
-			}
-			
-			virtual void Perform(class ArtifactSet &artifacts, class ProgressListener &listener);
-
-			long double FringesToConsider() const { return _fringesToConsider; }
-			void SetFringesToConsider(long double fringes) { _fringesToConsider = fringes; }
-
-			size_t MaxWindowSize() const { return _maxWindowSize; }
-			void SetMaxWindowSize(size_t windowSize) { _maxWindowSize = windowSize; }
-
-			size_t MinWindowSize() const { return _minWindowSize; }
-			void SetMinWindowSize(size_t windowSize) { _minWindowSize = windowSize; }
-
-			bool FitChannelsIndividually() const { return _fitChannelsIndividually; }
-			void SetFitChannelsIndividually(bool fitChannelsIndividually) throw() { _fitChannelsIndividually = fitChannelsIndividually; }
-			
-			bool OnlyFringeStop() const { return _onlyFringeStop; }
-			void SetOnlyFringeStop(bool onlyFringeStop) throw() {
-				_onlyFringeStop = onlyFringeStop; }
-				
-			virtual ActionType Type() const { return FringeStopActionType; }
-			
-			long double NewPhaseCentreRA() const { return _newPhaseCentreRA; }
-			void SetNewPhaseCentreRA(long double newPhaseCentreRA) { _newPhaseCentreRA = newPhaseCentreRA; }
-			
-			long double NewPhaseCentreDec() const { return _newPhaseCentreDec; }
-			void SetNewPhaseCentreDec(long double newPhaseCentreDec) { _newPhaseCentreDec = newPhaseCentreDec; }
-			
-		private:
-			long double _fringesToConsider;
-			size_t _minWindowSize, _maxWindowSize;
-			bool _fitChannelsIndividually;
-			bool _onlyFringeStop;
-			long double _newPhaseCentreRA, _newPhaseCentreDec;
-	};
-
-}
-
-#endif // FRINGESTOPACTION_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/highpassfilteraction.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/highpassfilteraction.h
deleted file mode 100644
index b26b6796f3b0600a923c5e578c2676e11dab350e..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/highpassfilteraction.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef HIGHPASSFILTERACTION_H
-#define HIGHPASSFILTERACTION_H
-
-#include <AOFlagger/strategy/actions/action.h>
-
-#include <AOFlagger/strategy/control/artifactset.h>
-
-namespace rfiStrategy {
-
-	/**
-		@author A.R. Offringa <offringa@astro.rug.nl>
-	*/
-	class HighPassFilterAction : public Action {
-		public:
-			enum Mode { StoreContaminated, StoreRevised };
-			HighPassFilterAction() :
-				_windowWidth(22),
-				_windowHeight(45),
-				_hKernelSigmaSq(7.5),
-				_vKernelSigmaSq(15.0),
-				_mode(StoreContaminated)
-			{
-			}
-			virtual ~HighPassFilterAction()
-			{
-			}
-			virtual std::string Description()
-			{
-				return "High-pass filter (Gaussian)";
-			}
-			virtual void Perform(ArtifactSet &artifacts, ProgressListener &progress);
-
-			virtual ActionType Type() const { return HighPassFilterActionType; }
-			
-			unsigned WindowWidth() const { return _windowWidth; }
-			unsigned WindowHeight() const { return _windowHeight; }
-			double HKernelSigmaSq() const { return _hKernelSigmaSq; }
-			double VKernelSigmaSq() const { return _vKernelSigmaSq; }
-			enum Mode Mode() const { return _mode; }
-			
-			void SetWindowWidth(unsigned width) { _windowWidth = width; }
-			void SetWindowHeight(unsigned height) { _windowHeight = height; }
-			void SetHKernelSigmaSq(double hSigmaSquared) { _hKernelSigmaSq = hSigmaSquared; }
-			void SetVKernelSigmaSq(double vSigmaSquared) { _vKernelSigmaSq = vSigmaSquared; }
-			void SetMode(enum Mode mode) { _mode = mode; }
-
-		private:
-			unsigned _windowWidth, _windowHeight;
-			double _hKernelSigmaSq, _vKernelSigmaSq;
-			enum Mode _mode;
-	};
-
-}
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/imageraction.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/imageraction.h
deleted file mode 100644
index b9c968e9ffc131de81d86b64bdb6fb9403969b22..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/imageraction.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef RFISTRATEGYIMAGERACTION_H
-#define RFISTRATEGYIMAGERACTION_H
-
-#include <boost/thread.hpp>
-
-#include <AOFlagger/strategy/actions/action.h>
-
-#include <AOFlagger/strategy/control/artifactset.h>
-
-namespace rfiStrategy {
-
-	/**
-		@author A.R. Offringa <offringa@astro.rug.nl>
-	*/
-	class ImagerAction : public Action {
-		public:
-			enum ImagingType {
-				Set, Add, Subtract
-			};
-
-			ImagerAction() : _type(Add)
-			{
-			}
-			virtual ~ImagerAction()
-			{
-			}
-			virtual std::string Description()
-			{
-				switch(_type)
-				{
-					case Set:
-					return "Image (set)";
-					case Add:
-					default:
-					return "Image (add)";
-					case Subtract:
-					return "Image (subtract)";
-				}
-			}
-			virtual void Perform(ArtifactSet &artifacts, ProgressListener &progress);
-
-			virtual ActionType Type() const { return ImagerActionType; }
-			enum ImagingType ImagingType() const { return _type; }
-			void SetImagingType(enum ImagingType type) throw() { _type = type; }
-
-		private:
-			enum ImagingType _type;
-			boost::mutex _imagerMutex;
-	};
-
-}
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/iterationaction.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/iterationaction.h
deleted file mode 100644
index 09dff1c32a0b5d51728daea39cc68f5f584c68a3..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/iterationaction.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#ifndef RFIITERATIONBLOCK_H
-#define RFIITERATIONBLOCK_H 
-
-#include <sstream>
-
-#include <AOFlagger/strategy/actions/action.h>
-
-#include <AOFlagger/strategy/control/artifactset.h>
-#include <AOFlagger/strategy/control/actionblock.h>
-
-#include <AOFlagger/util/progresslistener.h>
-
-namespace rfiStrategy {
-
-	class IterationBlock : public ActionBlock
-	{
-		public:
-			IterationBlock() : _iterationCount(4), _sensitivityStart(10.0L) { }
-			virtual ~IterationBlock() { }
-
-			virtual std::string Description()
-			{
-				std::stringstream s;
-				s << "Iterate " << _iterationCount << " times";
-				return s.str();
-			}
-			virtual void Perform(class ArtifactSet &artifacts, class ProgressListener &listener)
-			{
-				long double oldSensitivity = artifacts.Sensitivity();
-
-				long double sensitivityStep = powl(_sensitivityStart, 1.0L/_iterationCount);
-				long double sensitivity = _sensitivityStart;
-
-				for(size_t i=0;i<_iterationCount;++i)
-				{
-					artifacts.SetSensitivity(sensitivity * oldSensitivity);
-					listener.OnStartTask(*this, i, _iterationCount, "Iteration");
-					ActionBlock::Perform(artifacts, listener);
-					listener.OnEndTask(*this);
-					sensitivity /= sensitivityStep;
-				}
-				artifacts.SetSensitivity(oldSensitivity);
-			}
-			virtual ActionType Type() const { return IterationBlockType; }
-			virtual unsigned int Weight() const { return ActionBlock::Weight() * _iterationCount; }
-
-			size_t IterationCount() const throw() { return _iterationCount; }
-			void SetIterationCount(size_t newCount) throw() { _iterationCount = newCount; }
-			long double SensitivityStart() const throw() { return _sensitivityStart; }
-			void SetSensitivityStart(long double sensitivityStart) throw() { _sensitivityStart = sensitivityStart; }
-		private:
-			size_t _iterationCount;
-			long double _sensitivityStart;
-	};
-
-}
-
-#endif // RFIITERATIONBLOCK_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/normalizevarianceaction.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/normalizevarianceaction.h
deleted file mode 100644
index 63976ae26a62a69f57e83fdb938151bbd9eeb178..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/normalizevarianceaction.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef RFISTRATEGYNORMALIZEVARIANCEACTION_H
-#define RFISTRATEGYNORMALIZEVARIANCEACTION_H
-
-#include <map>
-
-#include <boost/thread/mutex.hpp>
-
-#include <AOFlagger/strategy/actions/action.h>
-
-#include <AOFlagger/strategy/control/artifactset.h>
-
-namespace rfiStrategy {
-
-	/**
-		@author A.R. Offringa <offringa@astro.rug.nl>
-	*/
-	class NormalizeVarianceAction : public Action {
-		public:
-			NormalizeVarianceAction() :
-				_medianFilterSizeInS(60.0*15.0), _isInitialized(false)
-			{
-			}
-			virtual ~NormalizeVarianceAction();
-			virtual std::string Description()
-			{
-				return "Normalize variance over time";
-			}
-			virtual void Perform(ArtifactSet &artifacts, ProgressListener &progress);
-
-			virtual void Initialize()
-			{
-				clean();
-			}
-			virtual void Finish()
-			{
-				clean();
-			}
-			virtual ActionType Type() const { return NormalizeVarianceActionType; }
-
-			double MedianFilterSizeInS() const { return _medianFilterSizeInS; }
-			void SetMedianFilterSizeInS(double filterSize) { _medianFilterSizeInS = filterSize; }
-		private:
-			double _medianFilterSizeInS;
-			boost::mutex _mutex;
-			bool _isInitialized;
-			std::map<double, double> _stddevs;
-			
-			void initializeStdDevs(ArtifactSet &artifacts);
-			void clean();
-			void correctData(std::vector<Image2DPtr> &data, size_t timeStep, double stddev);
-			void correctDataUpTo(std::vector<Image2DPtr> &data, size_t &dataTimeIndex, double time, const std::vector<double> &observationTimes, double stddev);
-	};
-}
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/plotaction.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/plotaction.h
deleted file mode 100644
index 780379a32995e95bbc65114d1b55b253c05551af..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/plotaction.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#ifndef PLOTACTION_H
-#define PLOTACTION_H 
-
-#include <AOFlagger/strategy/actions/action.h>
-
-namespace rfiStrategy {
-
-	class PlotAction : public Action
-	{
-		public:
-			enum PlotKind {
-				AntennaFlagCountPlot, FrequencyFlagCountPlot, FrequencyPowerPlot, TimeFlagCountPlot,
-				BaselineSpectrumPlot, PolarizationStatisticsPlot, BaselineRMSPlot, IterationsPlot
-			};
-
-			PlotAction() : _plotKind(FrequencyPowerPlot), _logYAxis(false) { }
-			virtual ~PlotAction() { }
-			virtual std::string Description()
-			{
-				switch(_plotKind)
-				{
-					case AntennaFlagCountPlot:
-					return "Plot antenna flag counts";
-					case FrequencyFlagCountPlot:
-					return "Plot frequency flag counts";
-					case FrequencyPowerPlot:
-					return "Plot frequency power";
-					case TimeFlagCountPlot:
-					return "Plot time flag counts";
-					case BaselineSpectrumPlot:
-					return "Plot spectrum per baseline";
-					case PolarizationStatisticsPlot:
-					return "Plot polarization flag counts";
-					case BaselineRMSPlot:
-					return "Plot baseline RMS";
-					case IterationsPlot:
-					return "Plot iteration convergence";
-					default:
-					return "Unknown plot action";
-				}
-			}
-			virtual void Perform(class ArtifactSet &artifacts, class ProgressListener &listener);
-			virtual ActionType Type() const { return PlotActionType; }
-
-			enum PlotKind PlotKind() const { return _plotKind; }
-			void SetPlotKind(enum PlotKind plotKind) { _plotKind = plotKind; }
-
-			bool LogarithmicYAxis() const { return _logYAxis; }
-			void SetLogarithmicYAxis(bool logYAxis) { _logYAxis = logYAxis; }
-		private:
-			enum PlotKind _plotKind;
-			bool _logYAxis;
-			boost::mutex _plotMutex;
-
-			void plotAntennaFlagCounts(class ArtifactSet &artifacts);
-			void plotFrequencyFlagCounts(class ArtifactSet &artifacts);
-			void plotFrequencyPower(class ArtifactSet &artifacts);
-			void plotTimeFlagCounts(class ArtifactSet &artifacts);
-			void plotSpectrumPerBaseline(class ArtifactSet &artifacts);
-			void plotPolarizationFlagCounts(class ArtifactSet &artifacts);
-			void plotBaselineRMS(class ArtifactSet &artifacts);
-			void plotIterations(class ArtifactSet &artifacts);
-	};
-
-}
-
-#endif // PLOTACTION_H
-
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/quickcalibrateaction.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/quickcalibrateaction.h
deleted file mode 100644
index 5be15757cee70cf4102a84a28586e87607a408a2..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/quickcalibrateaction.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#ifndef RFIQUICKCALIBRATEACTION_H
-#define RFIQUICKCALIBRATEACTION_H
-
-#include <AOFlagger/strategy/algorithms/thresholdtools.h>
-
-#include <AOFlagger/strategy/control/actioncontainer.h>
-
-#include <AOFlagger/util/progresslistener.h>
-
-namespace rfiStrategy {
-
-	class QuickCalibrateAction : public Action
-	{
-		public:
-			QuickCalibrateAction() { }
-
-			virtual std::string Description()
-			{
-				return "Quickly calibrate";
-			}
-			virtual void Perform(class ArtifactSet &artifacts, class ProgressListener &)
-			{
-				Image2DCPtr image = artifacts.ContaminatedData().GetSingleImage();
-				Mask2DCPtr mask = artifacts.ContaminatedData().GetSingleMask();
-				num_t mean, stddev;
-				ThresholdTools::WinsorizedMeanAndStdDev(image, mask, mean, stddev);
-				for(size_t i=0;i!=artifacts.ContaminatedData().ImageCount();++i)
-				{
-					Image2DCPtr image = artifacts.ContaminatedData().GetImage(i);
-					Image2DPtr normalized = Image2D::CreateCopy(image);
-					normalized->MultiplyValues(1.0/mean);
-					artifacts.ContaminatedData().SetImage(i, normalized);
-				}
-			}
-			virtual ActionType Type() const { return QuickCalibrateActionType; }
-		private:
-	};
-}
-
-#endif // RFIQUICKCALIBRATEACTION_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/rawappenderaction.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/rawappenderaction.h
deleted file mode 100644
index 94bc6f0a322e05becd3efbf9903db9e1560ed7bb..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/rawappenderaction.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#ifndef RAWAPPENDERACTION_H
-#define RAWAPPENDERACTION_H 
-
-#include <AOFlagger/strategy/actions/action.h>
-#include <AOFlagger/strategy/control/artifactset.h>
-
-#include <AOFlagger/msio/rawreader.h>
-
-#include <string>
-
-namespace rfiStrategy {
-
-	class RawAppenderAction : public Action
-	{
-		public:
-			RawAppenderAction() : _filename("output.1ch"), _rawWriter(0), _firstWrite(true)
-			{
-			}
-			virtual ~RawAppenderAction()
-			{
-				if(_rawWriter != 0)
-					delete _rawWriter;
-			}
-			virtual std::string Description()
-			{
-				return "Append to raw";
-			}
-			void Initialize()
-			{
-				if(_rawWriter != 0)
-					delete _rawWriter;
-				AOLogger::Debug << "Opening raw writer for filename " << _filename << ".\n";
-				_rawWriter = new RawReader(_filename);
-				_firstWrite = true;
-			}
-			virtual void Perform(class ArtifactSet &artifacts, class ProgressListener &listener)
-			{
-				TimeFrequencyData data = artifacts.ContaminatedData();
-				Image2DCPtr image = data.GetSingleImage();
-				if(_firstWrite)
-				{
-					_rawWriter->SetChannelCount(image->Height());
-					_rawWriter->StartWrite();
-					_firstWrite = false;
-				}
-				float buffer[image->Height()];
-				for(unsigned x=0;x<image->Width();++x)
-				{
-					for(unsigned y=0;y<image->Height();++y)
-						buffer[y] = image->Value(x, y);
-					_rawWriter->Write(buffer, 1);
-				}
-			}
-			virtual ActionType Type() const { return RawAppenderActionType; }
-		private:
-			std::string _filename;
-			RawReader *_rawWriter;
-			bool _firstWrite;
-	};
-
-}
-
-#endif // RAWAPPENDERACTION_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/resamplingaction.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/resamplingaction.h
deleted file mode 100644
index 7e50327be703294f49a056501ba5ea84cb392d74..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/resamplingaction.h
+++ /dev/null
@@ -1,132 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef RFI_RESAMPLING_ACTION
-#define RFI_RESAMPLING_ACTION
-
-#include <AOFlagger/strategy/actions/action.h>
-
-#include <AOFlagger/strategy/control/actionblock.h>
-#include <AOFlagger/strategy/control/artifactset.h>
-
-namespace rfiStrategy {
-
-	class ResamplingAction : public Action
-	{
-		public:
-			enum Operation { Average, NearestNeighbour };
-			
-			ResamplingAction() : Action(), _operation(Average), _sizeX(5), _sizeY(5)
-			{
-			}
-			virtual std::string Description()
-			{
-				switch(_operation)
-				{
-					case Average:
-						return "Resample by averaging";
-						break;
-					case NearestNeighbour:
-						return "Resample to nearest neighbour";
-						break;
-					default:
-						return "?";
-						break;
-				}
-			}
-			virtual ActionType Type() const { return ResamplingActionType; }
-			virtual void Perform(ArtifactSet &artifacts, class ProgressListener &)
-			{
-				TimeFrequencyData &contaminated = artifacts.ContaminatedData();
-				
-				for(unsigned i=0;i<contaminated.ImageCount();++i)
-				{
-					Image2DCPtr image = contaminated.GetImage(i);
-					Image2DCPtr newImage;
-					
-					switch(_operation)
-					{
-						case Average:
-							newImage = performAveraging(image);
-							break;
-						case NearestNeighbour:
-							newImage = performNN(image);
-							break;
-						default:
-							newImage = image;
-							break;
-					}
-					contaminated.SetImage(i, newImage);
-				}
-			}
-			
-			enum Operation Operation() const { return _operation; }
-			void SetOperation(enum Operation operation) { _operation = operation; }
-			
-			void SetSizeX(unsigned x) { _sizeX = x; }
-			unsigned SizeX() const { return _sizeX; }
-			
-			void SetSizeY(unsigned y) { _sizeY = y; }
-			unsigned SizeY() const { return _sizeY; }
-	private:
-		enum Operation _operation;
-		size_t _sizeX, _sizeY;
-		
-		Image2DPtr performAveraging(Image2DCPtr input)
-		{
-			Image2DPtr output = Image2D::CreateZeroImagePtr(input->Width(), input->Height());
-			const unsigned
-				displaceX = _sizeX / 2,
-				displaceY = _sizeY / 2;
-			for(unsigned y=0;y<input->Height();++y)
-			{
-				unsigned destY = (y / _sizeY)  *_sizeY + displaceY;
-				if(destY >= input->Height())
-					destY = input->Height()-1;
-				for(unsigned x=0;x<input->Width();++x)
-				{
-					unsigned destX = (x / _sizeX) * _sizeX + displaceX;
-					if(destX >= input->Width())
-						destX = input->Width()-1;
-					output->SetValue(destX, destY, output->Value(destX, destY) + input->Value(x, y));
-				}
-			}
-			return output;
-		}
-		
-		Image2DPtr performNN(Image2DCPtr input)
-		{
-			Image2DPtr output = Image2D::CreateZeroImagePtr(input->Width(), input->Height());
-			const unsigned
-				displaceX = _sizeX / 2,
-				displaceY = _sizeY / 2;
-			for(unsigned y=displaceY;y<input->Height();y+=_sizeY)
-			{
-				for(unsigned x=displaceX;x<input->Width();x+=_sizeX)
-				{
-					output->SetValue(x, y, input->Value(x, y) * (_sizeX * _sizeY));
-				}
-			}
-			return output;
-		}
-	};
-
-} // namespace
-
-#endif // RFI_TIME_CONVOLUTION_ACTION
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/setflaggingaction.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/setflaggingaction.h
deleted file mode 100644
index 9b7cbba6257f09b46601e469b7763fd4276ad9eb..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/setflaggingaction.h
+++ /dev/null
@@ -1,135 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#ifndef RFISETFLAGGINGACTION_H
-#define RFISETFLAGGINGACTION_H
-
-#include <AOFlagger/strategy/control/actioncontainer.h>
-#include <AOFlagger/strategy/control/artifactset.h>
-
-#include <AOFlagger/util/progresslistener.h>
-
-namespace rfiStrategy {
-
-	class SetFlaggingAction : public Action
-	{
-		public:
-			enum NewFlagging { None, Everything, FromOriginal, Invert, PolarisationsEqual, FlagZeros, OrOriginal, ToOriginal };
-
-			SetFlaggingAction() : _newFlagging(None) { }
-
-			virtual std::string Description()
-			{
-				switch(_newFlagging)
-				{
-					default:
-					case None:
-						return "Set no flags";
-					case Everything:
-						return "Set everything flagged";
-					case FromOriginal:
-						return "Restore original flags";
-					case ToOriginal:
-						return "Change original flags";
-					case Invert:
-						return "Set inverted flags";
-					case PolarisationsEqual:
-						return "Apply flags to all polarisations";
-					case FlagZeros:
-						return "Flag zeros";
-					case OrOriginal:
-						return "Or flags with original";
-				}
-			}
-			virtual void Perform(class ArtifactSet &artifacts, class ProgressListener &)
-			{
-				if(!artifacts.ContaminatedData().ContainsData())
-					throw std::runtime_error("No baseline is loaded! This might mean you forgot to put a For Each Baseline action in front of everything, or you might have forgotten to open an MS.");
-
-				switch(_newFlagging)
-				{
-					default:
-					case None:
-						artifacts.ContaminatedData().SetGlobalMask(Mask2D::CreateSetMaskPtr<false>(artifacts.ContaminatedData().ImageWidth(), artifacts.ContaminatedData().ImageHeight()));
-						break;
-					case Everything:
-						artifacts.ContaminatedData().SetGlobalMask(Mask2D::CreateSetMaskPtr<false>(artifacts.ContaminatedData().ImageWidth(), artifacts.ContaminatedData().ImageHeight()));
-						break;
-					case FromOriginal:
-						artifacts.ContaminatedData().SetGlobalMask(artifacts.OriginalData().GetSingleMask());
-						break;
-					case ToOriginal:
-						if(artifacts.OriginalData().MaskCount() == 1)
-							artifacts.OriginalData().SetGlobalMask(artifacts.ContaminatedData().GetSingleMask());
-						else {
-							if(artifacts.ContaminatedData().MaskCount() == 1) {
-								for(unsigned i=0;i<artifacts.OriginalData().MaskCount();++i)
-									artifacts.OriginalData().SetMask(i, artifacts.ContaminatedData().GetSingleMask());
-							} else if(artifacts.ContaminatedData().MaskCount() != artifacts.OriginalData().MaskCount()) {
-								throw BadUsageException("Error : can't set flagging to original when polarisations are incompatible");
-							} else {
-								for(unsigned i=0;i<artifacts.OriginalData().MaskCount();++i)
-									artifacts.OriginalData().SetMask(i, artifacts.ContaminatedData().GetMask(i));
-							}
-						}
-						break;
-					case Invert: {
-						Mask2DPtr mask = Mask2D::CreateCopy(artifacts.ContaminatedData().GetSingleMask());
-						mask->Invert();
-						artifacts.ContaminatedData().SetGlobalMask(mask);
-						break;
-					}
-					case PolarisationsEqual: {
-						Mask2DCPtr mask = artifacts.ContaminatedData().GetSingleMask();
-						artifacts.ContaminatedData().SetGlobalMask(mask);
-						break;
-					}
-					case FlagZeros: {
-						Mask2DPtr mask = Mask2D::CreateCopy(artifacts.ContaminatedData().GetSingleMask());
-						Image2DCPtr image = artifacts.ContaminatedData().GetSingleImage();
-						for(unsigned y=0;y<image->Height();++y) {
-							for(unsigned x=0;x<image->Width();++x) {
-								if(image->Value(x, y) == 0.0)
-									mask->SetValue(x, y, true);
-							}
-						}
-						artifacts.ContaminatedData().SetGlobalMask(mask);
-						break;
-					}
-					case OrOriginal: {
-						Mask2DPtr mask = Mask2D::CreateCopy(artifacts.ContaminatedData().GetSingleMask());
-						mask->Join(artifacts.OriginalData().GetSingleMask());
-						artifacts.ContaminatedData().SetGlobalMask(mask);
-						break;
-					}
-				}
-			}
-			void SetNewFlagging(enum NewFlagging newFlagging) throw()
-			{
-				_newFlagging = newFlagging;
-			}
-			enum NewFlagging NewFlagging() const throw() { return _newFlagging; }
-			virtual ActionType Type() const { return SetFlaggingActionType; }
-		private:
-			enum NewFlagging _newFlagging;
-	};
-}
-
-#endif // RFISETFLAGGINGACTION_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/setimageaction.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/setimageaction.h
deleted file mode 100644
index 1a827c761b123dd70d45d3f82d9e68aaa8ad1c2a..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/setimageaction.h
+++ /dev/null
@@ -1,239 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#ifndef RFISETIMAGEACTION_H
-#define RFISETIMAGEACTION_H
-
-#include <AOFlagger/util/progresslistener.h>
-
-#include <AOFlagger/strategy/algorithms/interpolatenansalgorithm.h>
-
-#include <AOFlagger/strategy/control/actioncontainer.h>
-#include <AOFlagger/strategy/control/artifactset.h>
-
-namespace rfiStrategy {
-
-	class SetImageAction : public Action
-	{
-		public:
-			enum NewImage { Zero, FromOriginal, SwapRevisedAndContaminated, ReplaceFlaggedValues, SetFlaggedValuesToZero, FromRevised, ContaminatedToOriginal, InterpolateNans };
-
-			SetImageAction() : _newImage(FromOriginal), _add(false) { }
-
-			virtual std::string Description()
-			{
-				if(_add)
-				{
-					switch(_newImage)
-					{
-						default:
-						case Zero:
-						case SwapRevisedAndContaminated:
-							return "Do nothing";
-						case FromOriginal:
-							return "Add original image";
-					}
-				} else {
-					switch(_newImage)
-					{
-						default:
-						case Zero:
-							return "Set contaminated = 0";
-						case FromOriginal:
-							return "Set contaminated = original";
-						case SwapRevisedAndContaminated:
-							return "Swap revised and contaminated";
-						case ReplaceFlaggedValues:
-							return "Revise flagged values";
-						case SetFlaggedValuesToZero:
-							return "Set flagged values to zero";
-						case FromRevised:
-							return "Set contaminated = revised";
-						case ContaminatedToOriginal:
-							return "Set original = contaminated";
-						case InterpolateNans:
-							return "Interpolate nans";
-					}
-				}
-			}
-			virtual void Perform(class ArtifactSet &artifacts, class ProgressListener &listener)
-			{
-				if(_add)
-					PerformAdd(artifacts, listener);
-				else
-					PerformSet(artifacts, listener);
-			}
-			enum NewImage NewImage() const throw() { return _newImage; }
-			void SetNewImage(enum NewImage newImage) throw()
-			{
-				_newImage = newImage;
-			}
-			bool Add() const throw() { return _add; }
-			void SetAdd(bool add) throw()
-			{
-				_add = add;
-			}
-			virtual ActionType Type() const { return SetImageActionType; }
-		private:
-			void PerformSet(class ArtifactSet &artifacts, class ProgressListener &)
-			{
-				switch(_newImage)
-				{
-					default:
-					case FromOriginal:
-						Set(artifacts.ContaminatedData(), artifacts.OriginalData());
-					break;
-					case FromRevised:
-						Set(artifacts.ContaminatedData(), artifacts.RevisedData());
-					break;
-					case ContaminatedToOriginal:
-						Set(artifacts.OriginalData(), artifacts.ContaminatedData());
-					break;
-					case Zero:
-					{
-						Image2DPtr zero =
-							Image2D::CreateZeroImagePtr(artifacts.ContaminatedData().ImageWidth(), artifacts.ContaminatedData().ImageHeight());
-						TimeFrequencyData data(artifacts.ContaminatedData());
-						for(unsigned i=0;i<data.ImageCount();++i)
-							data.SetImage(i, zero);
-						data.SetMask(artifacts.ContaminatedData());
-						artifacts.SetContaminatedData(data);
-						break;
-					}
-					case SwapRevisedAndContaminated:
-					{
-						TimeFrequencyData data = artifacts.ContaminatedData();
-						artifacts.SetContaminatedData(artifacts.RevisedData());
-						artifacts.SetRevisedData(data);
-						break;
-					}
-					case ReplaceFlaggedValues:
-					{
-						TimeFrequencyData contaminatedData = artifacts.ContaminatedData();
-						const TimeFrequencyData
-							revisedData = artifacts.RevisedData(),
-							originalData = artifacts.OriginalData();
-						if(contaminatedData.PolarisationCount() != 1)
-							throw BadUsageException("Can not replace flagged values for multiple polarizations: use a For Each Polarisation action");
-						if(revisedData.PolarisationCount() != 1 || originalData.PolarisationCount() != 1)
-							throw BadUsageException("Revised or original data has multiple polarisations");
-						if(contaminatedData.PhaseRepresentation() != revisedData.PhaseRepresentation() || contaminatedData.PhaseRepresentation() != originalData.PhaseRepresentation())
-							throw BadUsageException("Contaminated and Revised data do not have equal phase representations");
-						Mask2DCPtr mask = contaminatedData.GetSingleMask();
-						unsigned imageCount = contaminatedData.ImageCount();
-						for(unsigned i=0;i<imageCount;++i)
-						{
-							Image2DCPtr
-								revisedImage = revisedData.GetImage(i),
-								originalImage = originalData.GetImage(i);
-							Image2DPtr image = Image2D::CreateCopy(contaminatedData.GetImage(i));
-							for(size_t y=0;y<image->Height();++y)
-							{
-								for(size_t x=0;x<image->Width();++x)
-								{
-									if(mask->Value(x, y))
-										image->SetValue(x, y, revisedImage->Value(x, y));
-									else
-										image->SetValue(x, y, originalImage->Value(x, y));
-								}
-							}
-							artifacts.ContaminatedData().SetImage(i, image);
-						}
-						break;
-					}
-					case SetFlaggedValuesToZero:
-					{
-						TimeFrequencyData contaminatedData = artifacts.ContaminatedData();
-						Mask2DCPtr mask = contaminatedData.GetSingleMask();
-						unsigned imageCount = contaminatedData.ImageCount();
-						for(unsigned i=0;i<imageCount;++i)
-						{
-							Image2DPtr image = Image2D::CreateCopy(contaminatedData.GetImage(i));
-							for(size_t y=0;y<image->Height();++y)
-							{
-								for(size_t x=0;x<image->Width();++x)
-								{
-									if(mask->Value(x, y))
-										image->SetValue(x, y, 0.0);
-								}
-							}
-							artifacts.ContaminatedData().SetImage(i, image);
-						}
-						break;
-					}
-					case InterpolateNans:
-					{
-						TimeFrequencyData &contaminatedData = artifacts.ContaminatedData();
-						Mask2DCPtr mask = contaminatedData.GetSingleMask();
-						unsigned imageCount = contaminatedData.ImageCount();
-						for(unsigned i=0;i<imageCount;++i)
-						{
-							Image2DPtr image = Image2D::CreateCopy(contaminatedData.GetImage(i));
-							InterpolateNansAlgorithms::InterpolateFlags(image, mask);
-							contaminatedData.SetImage(i, image);
-						}
-						break;
-					}
-				}
-			}
-			void Set(TimeFrequencyData &dest, const TimeFrequencyData &source)
-			{
-				TimeFrequencyData *phaseData =
-					source.CreateTFData(dest.PhaseRepresentation());
-				TimeFrequencyData *phaseAndPolData =
-					phaseData->CreateTFData(dest.Polarisation());
-				delete phaseData;
-				phaseAndPolData->SetMask(dest);
-				dest = *phaseAndPolData;
-				delete phaseAndPolData;
-			}
-			void PerformAdd(class ArtifactSet &artifacts, class ProgressListener &)
-			{
-				switch(_newImage)
-				{
-					default:
-					case FromOriginal:
-					{
-						TimeFrequencyData *phaseData =
-							artifacts.OriginalData().CreateTFData(artifacts.RevisedData().PhaseRepresentation());
-						TimeFrequencyData *phaseAndPolData =
-							phaseData->CreateTFData(artifacts.RevisedData().Polarisation());
-						delete phaseData;
-						TimeFrequencyData *summedData =
-							TimeFrequencyData::CreateTFDataFromSum(*phaseAndPolData, artifacts.RevisedData());
-						delete phaseAndPolData;
-						summedData->SetMask(artifacts.RevisedData());
-						artifacts.SetRevisedData(*summedData);
-						delete summedData;
-					}
-					break;
-					case Zero:
-					case SwapRevisedAndContaminated:
-					case ReplaceFlaggedValues:
-					case SetFlaggedValuesToZero:
-					break;
-				}
-			}
-			enum NewImage _newImage;
-			bool _add;
-	};
-}
-
-#endif // RFISETIMAGEACTION_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/slidingwindowfitaction.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/slidingwindowfitaction.h
deleted file mode 100644
index 235acb63c41dfecf1950a21730720591e9859557..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/slidingwindowfitaction.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#ifndef RFISLIDINGWINDOWFITACTION_H
-#define RFISLIDINGWINDOWFITACTION_H 
-
-#include <AOFlagger/strategy/actions/action.h>
-
-#include <AOFlagger/strategy/actions/slidingwindowfitparameters.h>
-
-namespace rfiStrategy {
-
-	class SlidingWindowFitAction : public Action
-	{
-		public:
-			SlidingWindowFitAction() { LoadDefaults(); }
-			virtual ~SlidingWindowFitAction() { }
-			virtual std::string Description()
-			{
-				return "Sliding window fit";
-			}
-			virtual void Perform(class ArtifactSet &artifacts, class ProgressListener &listener);
-			virtual ActionType Type() const { return SlidingWindowFitActionType; }
-
-			const SlidingWindowFitParameters &Parameters() const throw() { return _parameters; }
-			SlidingWindowFitParameters &Parameters() throw() { return _parameters; }
-
-			void LoadDefaults();
-		private:
-			SlidingWindowFitParameters _parameters;
-	};
-
-}
-
-#endif // RFISLIDINGWINDOWFITACTION_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/slidingwindowfitparameters.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/slidingwindowfitparameters.h
deleted file mode 100644
index 9702f17e3d279c219093c9c2bed19365494e2669..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/slidingwindowfitparameters.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#include <AOFlagger/msio/types.h>
-
-#ifndef RFI_SLIDINGWINDOWFITPARAMETERS_H
-#define RFI_SLIDINGWINDOWFITPARAMETERS_H
-
-namespace rfiStrategy {
-
-	struct SlidingWindowFitParameters
-	{
-		enum Method { None, Average, GaussianWeightedAverage, Median, Minimum };
-
-		/**
-		 * The method used for fitting.
-		 */
-		enum Method method;
-
-		/**
-		 * The window size in the time direction.
-		 */
-		size_t timeDirectionWindowSize;
-
-		/**
-		 * The window size in the frequency direction.
-		 */
-		size_t frequencyDirectionWindowSize;
-		
-		/**
-		 * In the case of weighted average, the kernel size of the Gaussian function in the time direction.
-		 */
-		num_t timeDirectionKernelSize;
-
-		/**
-		 * In the case of weighted average, the kernel size of the Gaussian function in the frequency direction.
-		 */
-		num_t frequencyDirectionKernelSize;
-	};
-}
-
-#endif // RFI_SLIDINGWINDOWFITPARAMETERS_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/spatialcompositionaction.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/spatialcompositionaction.h
deleted file mode 100644
index 99838e4e84d24911f1569b962dc34228b48b2e99..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/spatialcompositionaction.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef SPATIALCOMPOSITIONACTION_H
-#define SPATIALCOMPOSITIONACTION_H
-
-#include <AOFlagger/strategy/actions/action.h>
-
-#include <AOFlagger/strategy/control/artifactset.h>
-
-namespace rfiStrategy {
-
-	/**
-		@author A.R. Offringa <offringa@astro.rug.nl>
-	*/
-	class SpatialCompositionAction : public Action {
-		public:
-			enum Operation { SumCrossCorrelationsOperation, SumAutoCorrelationsOperation, EigenvalueDecompositionOperation, EigenvalueRemovalOperation } ;
-
-			SpatialCompositionAction() : _operation(EigenvalueDecompositionOperation), _eigenValueIndex(0)
-			{
-			}
-			virtual ~SpatialCompositionAction()
-			{
-			}
-			virtual std::string Description()
-			{
-				switch(_operation)
-				{
-					default:
-					case SumCrossCorrelationsOperation:
-						return "Spatial composition (cross)";
-					case SumAutoCorrelationsOperation:
-						return "Spatial composition (auto)";
-					case EigenvalueDecompositionOperation:
-						return "Spatial composition (eigenvalue)";
-					case EigenvalueRemovalOperation:
-						return "Spatial composition (remove eigenvalue)";
-				}
-			}
-			virtual void Perform(ArtifactSet &artifacts, ProgressListener &progress);
-
-			virtual ActionType Type() const { return SpatialCompositionActionType; }
-
-			enum Operation Operation() const { return _operation; }
-			void SetOperation(enum Operation operation) { _operation = operation; }
-		private:
-			enum Operation _operation;
-			size_t _eigenValueIndex;
-
-			num_t sumCrossCorrelations(Image2DCPtr image) const;
-			num_t sumAutoCorrelations(Image2DCPtr image) const;
-			num_t eigenvalue(Image2DCPtr real, Image2DCPtr imaginary) const;
-			std::pair<num_t, num_t> removeEigenvalue(Image2DCPtr real, Image2DCPtr imaginary) const;
-	};
-
-}
-
-#endif // SPATIALCOMPOSITIONACTION_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/statisticalflagaction.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/statisticalflagaction.h
deleted file mode 100644
index 15e4ab2c91be2a9b259b6aaa88a2fda9af7b1dc9..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/statisticalflagaction.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#ifndef STATISTICALFLAGACTION_H
-#define STATISTICALFLAGACTION_H
-
-#include <AOFlagger/msio/types.h>
-
-#include <AOFlagger/strategy/actions/action.h>
-
-namespace rfiStrategy {
-
-	class StatisticalFlagAction : public Action
-	{
-		public:
-			StatisticalFlagAction()
-			: _enlargeTimeSize(0), _enlargeFrequencySize(0), _maxContaminatedTimesRatio(0.5), _maxContaminatedFrequenciesRatio(0.5),
-			_minimumGoodTimeRatio(0.2), _minimumGoodFrequencyRatio(0.2) { }
-			virtual ~StatisticalFlagAction() { }
-			virtual std::string Description()
-			{
-				return "Statistical flagging";
-			}
-			virtual void Perform(class ArtifactSet &artifacts, class ProgressListener &listener);
-			virtual ActionType Type() const { return StatisticalFlagActionType; }
-
-			size_t EnlargeTimeSize() const throw() { return _enlargeTimeSize; }
-			void SetEnlargeTimeSize(size_t size) throw() { _enlargeTimeSize = size; }
-			size_t EnlargeFrequencySize() const throw() { return _enlargeFrequencySize; }
-			void SetEnlargeFrequencySize(size_t size) throw() { _enlargeFrequencySize = size; }
-			
-			num_t MaxContaminatedTimesRatio() const throw() { return _maxContaminatedTimesRatio; }
-			void SetMaxContaminatedTimesRatio(num_t newValue) throw() { _maxContaminatedTimesRatio = newValue; }
-			num_t MaxContaminatedFrequenciesRatio() const throw() { return _maxContaminatedFrequenciesRatio; }
-			void SetMaxContaminatedFrequenciesRatio(num_t newValue) throw() { _maxContaminatedFrequenciesRatio = newValue; }
-			
-			num_t MinimumGoodTimeRatio() const throw() { return _minimumGoodTimeRatio; }
-			void SetMinimumGoodTimeRatio(num_t newValue) throw() { _minimumGoodTimeRatio = newValue; }
-			num_t MinimumGoodFrequencyRatio() const throw() { return _minimumGoodFrequencyRatio; }
-			void SetMinimumGoodFrequencyRatio(num_t newValue) throw() { _minimumGoodFrequencyRatio = newValue; }
-		private:
-			size_t _enlargeTimeSize;
-			size_t _enlargeFrequencySize;
-			num_t _maxContaminatedTimesRatio;
-			num_t _maxContaminatedFrequenciesRatio;
-			num_t _minimumGoodTimeRatio;
-			num_t _minimumGoodFrequencyRatio;
-	};
-
-}
-
-#endif // STATISTICALFLAGACTION_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/strategyaction.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/strategyaction.h
deleted file mode 100644
index ed9b5daa341f39894f6458a296ad78338164080a..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/strategyaction.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#ifndef RFISTRATEGY_H
-#define RFISTRATEGY_H 
-
-#include <string>
-#include <vector>
-
-#include <boost/thread.hpp>
-
-#include <AOFlagger/msio/timefrequencyimager.h>
-#include <AOFlagger/msio/timefrequencydata.h>
-
-#include <AOFlagger/strategy/actions/action.h>
-#include <AOFlagger/strategy/actions/foreachbaselineaction.h>
-
-#include <AOFlagger/strategy/control/actionblock.h>
-#include <AOFlagger/strategy/control/actionfactory.h>
-
-namespace rfiStrategy {
-
-	class Strategy : public ActionBlock
-	{
-		public:
-			Strategy() throw() : _thread(0) { }
-			virtual ~Strategy() { JoinThread(); }
-
-			virtual std::string Description() { return "Strategy"; }
-
-			static Strategy *CreateDefaultSingleStrategy();
-
-			static void SetThreadCount(Strategy &strategy, size_t threadCount);
-			static void SetDataColumnName(Strategy &strategy, const std::string &dataColumnName);
-			static void SetPolarisations(Strategy &strategy, enum PolarisationType type);
-			static void SetBaselines(Strategy &strategy, enum BaselineSelection baselineSelection);
-			static void SetTransientCompatibility(Strategy &strategy);
-			static void SetMultiplySensitivity(Strategy &strategy, num_t factor);
-			static void SetFittingWindowSize(Strategy &strategy, size_t windowWidth, size_t windowHeight);
-			static void SetFittingKernelSize(Strategy &strategy, num_t kernelWidth, num_t kernelHeight);
-			static void SetFlagStokes(Strategy &strategy, bool newValue);
-			static void DisableOptimizations(Strategy &strategy);
-			//static void SetIndirectReader(Strategy &strategy, bool newValue);
-			
-			void StartPerformThread(const class ArtifactSet &artifacts, class ProgressListener &progress);
-			ArtifactSet *JoinThread();
-
-			static void LoadDefaultSingleStrategy(ActionBlock &block, bool pedantic, bool pulsar);
-
-			void LoadDefaultSingleStrategy(bool pedantic = false, bool pulsar = false);
-			void LoadOldDefaultSingleStrategy();
-			void LoadDefaultStrategy();
-
-			void LoadFastStrategy(bool pedantic = false, bool pulsar = false);
-			void LoadAverageStrategy(bool pedantic = false, bool pulsar = false);
-			void LoadBestStrategy(bool pedantic = false, bool pulsar = false);
-
-			static void SyncAll(ActionContainer &root);
-
-			virtual void Perform(class ArtifactSet &artifacts, class ProgressListener &listener)
-			{
-				listener.OnStartTask(*this, 0, 1, "strategy");
-				try {
-					ActionBlock::Perform(artifacts, listener);
-				} catch(std::exception &e)
-				{
-					listener.OnException(*this, e);
-				}
-				listener.OnEndTask(*this);
-			}
-			virtual ActionType Type() const { return StrategyType; }
-		protected:
-		private:
-			/** Copying prohibited */
-			Strategy(const Strategy &) { }
-			Strategy &operator=(const Strategy &) { return *this; }
-			
-			struct PerformFunc {
-				PerformFunc(class Strategy *strategy, class ArtifactSet *artifacts, class ProgressListener *progress)
-				: _strategy(strategy), _artifacts(artifacts), _progress(progress)
-				{
-				}
-				class Strategy *_strategy;
-				class ArtifactSet *_artifacts;
-				class ProgressListener *_progress;
-
-				void operator()();
-			} *_threadFunc;
-
-			boost::thread *_thread;
-	};
-}
-
-#endif // RFISTRATEGY_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/sumthresholdaction.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/sumthresholdaction.h
deleted file mode 100644
index 19331c0497018828e37a8992164d57ec319fac1e..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/sumthresholdaction.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef RFI_THRESHOLDACTION
-#define RFI_THRESHOLDACTION
-
-#include <AOFlagger/strategy/algorithms/thresholdconfig.h>
-
-#include <AOFlagger/strategy/actions/action.h>
-#include <AOFlagger/strategy/control/artifactset.h>
-#include <AOFlagger/strategy/control/actionblock.h>
-
-namespace rfiStrategy {
-
-	class SumThresholdAction : public Action
-	{
-			public:
-				SumThresholdAction() : _baseSensitivity(1.0), _inTimeDirection(true), _inFrequencyDirection(true)
-				{
-				}
-				virtual std::string Description()
-				{
-					return "SumThreshold";
-				}
-				virtual void Perform(ArtifactSet &artifacts, class ProgressListener &)
-				{
-					ThresholdConfig thresholdConfig;
-					thresholdConfig.InitializeLengthsDefault();
-					thresholdConfig.InitializeThresholdsFromFirstThreshold(6.0L, ThresholdConfig::Rayleigh);
-					if(!_inTimeDirection)
-						thresholdConfig.RemoveHorizontalOperations();
-					if(!_inFrequencyDirection)
-						thresholdConfig.RemoveVerticalOperations();
-					
-					TimeFrequencyData &contaminated = artifacts.ContaminatedData();
-					Mask2DPtr mask = Mask2D::CreateCopy(contaminated.GetSingleMask());
-					Image2DCPtr image = contaminated.GetSingleImage();
-					thresholdConfig.Execute(image, mask, false, artifacts.Sensitivity() * _baseSensitivity);
-					contaminated.SetGlobalMask(mask);
-				}
-				num_t BaseSensitivity() const { return _baseSensitivity; }
-				void SetBaseSensitivity(num_t baseSensitivity)
-				{
-					_baseSensitivity = baseSensitivity;
-				}
-				virtual ActionType Type() const { return SumThresholdActionType; }
-				
-				bool TimeDirectionFlagging() const { return _inTimeDirection; }
-				void SetTimeDirectionFlagging(bool timeDirection) { _inTimeDirection = timeDirection; }
-				
-				bool FrequencyDirectionFlagging() const { return _inFrequencyDirection; }
-				void SetFrequencyDirectionFlagging(bool frequencyDirection) { _inFrequencyDirection = frequencyDirection; }
-			private:
-				num_t _baseSensitivity;
-				bool _inTimeDirection;
-				bool _inFrequencyDirection;
-	};
-
-} // namespace
-
-#endif // RFI_THRESHOLDACTION
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/svdaction.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/svdaction.h
deleted file mode 100644
index 55d4cb793a987cc75b4904d250813260d2dd4cce..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/svdaction.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#ifndef SVDACTION_H
-#define SVDACTION_H 
-
-#include <AOFlagger/strategy/actions/action.h>
-
-namespace rfiStrategy {
-
-	class SVDAction : public Action
-	{
-		public:
-			SVDAction() : _singularValueCount(1) { }
-			virtual ~SVDAction() { }
-			virtual std::string Description()
-			{
-				return "Singular value decomposition";
-			}
-			virtual void Perform(class ArtifactSet &artifacts, class ProgressListener &listener);
-			virtual ActionType Type() const { return SVDActionType; }
-
-			size_t SingularValueCount() const throw() { return _singularValueCount; }
-			void SetSingularValueCount(size_t svCount) throw() { _singularValueCount = svCount; }
-		private:
-			size_t _singularValueCount;
-	};
-
-}
-
-#endif // SVDACTION_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/timeconvolutionaction.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/timeconvolutionaction.h
deleted file mode 100644
index 10f6ff0963b8a99a8eed87dfb78e60803f199684..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/timeconvolutionaction.h
+++ /dev/null
@@ -1,878 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef RFI_TIME_CONVOLUTION_ACTION
-#define RFI_TIME_CONVOLUTION_ACTION
-
-#include <AOFlagger/strategy/algorithms/sinusfitter.h>
-#include <AOFlagger/strategy/algorithms/convolutions.h>
-#include <AOFlagger/strategy/algorithms/uvprojection.h>
-
-#include <AOFlagger/strategy/actions/action.h>
-
-#include <AOFlagger/strategy/control/actionblock.h>
-#include <AOFlagger/strategy/control/artifactset.h>
-
-#include <AOFlagger/imaging/uvimager.h>
-
-#include <AOFlagger/util/aologger.h>
-#include <AOFlagger/util/ffttools.h>
-#include <AOFlagger/util/progresslistener.h>
-
-#include <boost/concept_check.hpp>
-
-namespace rfiStrategy {
-
-	class TimeConvolutionAction : public Action
-	{
-		public:
-			enum Operation { SingleSincOperation, SincOperation, ProjectedSincOperation, ProjectedFTOperation, ExtrapolatedSincOperation, IterativeExtrapolatedSincOperation, FFTSincOperation };
-			
-			TimeConvolutionAction() : Action(), _operation(IterativeExtrapolatedSincOperation), _sincSize(32.0), _directionRad(M_PI*(-86.7/180.0)), _etaParameter(0.2), _autoAngle(true), _isSincScaleInSamples(false), _alwaysRemove(false), _useHammingWindow(false), _iterations(1), _channelAveragingSize(4)
-			{
-			}
-			virtual std::string Description()
-			{
-				switch(_operation)
-				{
-					case SingleSincOperation:
-						return "Time sinc convolution (once)";
-						break;
-					case SincOperation:
-						return "Time sinc convolution (round)";
-						break;
-					case ProjectedSincOperation:
-						return "Projected sinc convolution";
-						break;
-					case ProjectedFTOperation:
-						return "Projected Fourier transform";
-						break;
-					case ExtrapolatedSincOperation:
-						return "Projected extrapolated sinc";
-						break;
-					case IterativeExtrapolatedSincOperation:
-						return "Iterative projected extrapolated sinc";
-						break;
-					case FFTSincOperation:
-						return "FFT sinc";
-						break;
-					default:
-						return "?";
-						break;
-				}
-			}
-			virtual ActionType Type() const { return TimeConvolutionActionType; }
-			virtual void Perform(ArtifactSet &artifacts, class ProgressListener &listener)
-			{
-				Image2DCPtr newImage;
-				TimeFrequencyData newRevisedData;
-				switch(_operation)
-				{
-					case SingleSincOperation:
-						newImage = PerformSingleSincOperation(artifacts);
-						break;
-					case SincOperation:
-						newImage = PerformSincOperation(artifacts);
-						break;
-					case ProjectedSincOperation:
-						newImage = PerformProjectedSincOperation(artifacts, listener);
-						break;
-					case ProjectedFTOperation:
-					case ExtrapolatedSincOperation:
-					case IterativeExtrapolatedSincOperation:
-					{
-						if(_autoAngle)
-							_directionRad = FindStrongestSourceAngle(artifacts, artifacts.ContaminatedData());
-						TimeFrequencyData data = artifacts.ContaminatedData();
-						TimeFrequencyData *realData = data.CreateTFData(TimeFrequencyData::RealPart);
-						TimeFrequencyData *imagData = data.CreateTFData(TimeFrequencyData::ImaginaryPart);
-						Image2DPtr real = Image2D::CreateCopy(realData->GetSingleImage());
-						Image2DPtr imaginary = Image2D::CreateCopy(imagData->GetSingleImage());
-						delete realData;
-						delete imagData;
-						PerformExtrapolatedSincOperation(artifacts, real, imaginary, listener);
-						newRevisedData = TimeFrequencyData(data.Polarisation(), real, imaginary);
-					}
-					break;
-					case FFTSincOperation:
-						TimeFrequencyData data = artifacts.ContaminatedData();
-						TimeFrequencyData *realData = data.CreateTFData(TimeFrequencyData::RealPart);
-						TimeFrequencyData *imagData = data.CreateTFData(TimeFrequencyData::ImaginaryPart);
-						Image2DPtr real = Image2D::CreateCopy(realData->GetSingleImage());
-						Image2DPtr imaginary = Image2D::CreateCopy(imagData->GetSingleImage());
-						delete realData;
-						delete imagData;
-						PerformFFTSincOperation(artifacts, real, imaginary);
-						newRevisedData = TimeFrequencyData(data.Polarisation(), real, imaginary);
-						break;
-				}
-				
-				if(_operation == SingleSincOperation || _operation == SincOperation || _operation == ProjectedSincOperation)
-				{
-					newRevisedData = TimeFrequencyData(artifacts.ContaminatedData().PhaseRepresentation(), artifacts.ContaminatedData().Polarisation(), newImage);
-				}
-
-				newRevisedData.SetMask(artifacts.RevisedData());
-
-				TimeFrequencyData *contaminatedData =
-					TimeFrequencyData::CreateTFDataFromDiff(artifacts.ContaminatedData(), newRevisedData);
-				contaminatedData->SetMask(artifacts.ContaminatedData());
-				artifacts.SetRevisedData(newRevisedData);
-				artifacts.SetContaminatedData(*contaminatedData);
-				delete contaminatedData;
-			}
-			
-			enum Operation Operation() const { return _operation; }
-			void SetOperation(enum Operation operation) { _operation = operation; }
-
-			num_t DirectionRad() const { return _directionRad; }
-			void SetDirectionRad(num_t directionRad) { _directionRad = directionRad; }
-			
-			num_t SincScale() const { return _sincSize; }
-			void SetSincScale(num_t sincSize) { _sincSize = sincSize; }
-
-			num_t EtaParameter() const { return _etaParameter; }
-			void SetEtaParameter(num_t etaParameter) { _etaParameter = etaParameter; }
-
-			unsigned Iterations() const { return _iterations; }
-			void SetIterations(unsigned iterations) { _iterations = iterations; }
-
-			bool AutoAngle() const { return _autoAngle; }
-			void SetAutoAngle(bool autoAngle) { _autoAngle = autoAngle; }
-
-			bool IsSincScaleInSamples() const { return _isSincScaleInSamples; }
-			void SetIsSincScaleInSamples(bool inSamples) { _isSincScaleInSamples = inSamples; }
-
-			unsigned ChannelAveragingSize() const { return _channelAveragingSize; }
-			void SetChannelAveragingSize(unsigned size) { _channelAveragingSize = size; }
-			
-			bool AlwaysRemove() const { return _alwaysRemove; }
-			void SetAlwaysRemove(bool alwaysRemove) { _alwaysRemove = alwaysRemove; }
-			
-			bool UseHammingWindow() const { return _useHammingWindow; }
-			void SetUseHammingWindow(bool useHammingWindow) { _useHammingWindow = useHammingWindow; }
-private:
-			class IterationData
-			{
-                        public:
-				ArtifactSet
-					*artifacts;
-				size_t
-					width,
-					fourierWidth,
-					rangeStart,
-					rangeEnd,
-					vZeroPos,
-					startXf,
-					endXf;
-				numl_t
-					maxDist;
-				numl_t
-					*rowRValues,
-					*rowIValues,
-					*rowUPositions,
-					*rowVPositions,
-					*fourierValuesReal,
-					*fourierValuesImag,
-					*channelMaxDist;
-				numl_t
-					**fSinTable,
-					**fCosTable;
-					
-				IterationData() :
-					artifacts(0), width(0), fourierWidth(0), rangeStart(0), rangeEnd(0),
-					vZeroPos(0), startXf(0), endXf(0),
-					maxDist(0.0),
-					rowRValues(0), rowIValues(0), rowUPositions(0), rowVPositions(0),
-					fourierValuesReal(0), fourierValuesImag(0), channelMaxDist(0),
-					fSinTable(0), fCosTable(0)
-				{
-				}
-			};
-
-			Image2DPtr PerformSingleSincOperation(ArtifactSet &artifacts) const
-			{
-				TimeFrequencyData data = artifacts.ContaminatedData();
-				Image2DCPtr image = data.GetSingleImage();
-				num_t *row = new num_t[image->Width()];
-				Image2DPtr newImage = Image2D::CreateUnsetImagePtr(image->Width(), image->Height());
-				unsigned width = image->Width();
-
-				const BandInfo band = artifacts.MetaData()->Band();
-				for(unsigned y=0;y<image->Height();++y)
-				{
-					const num_t sincScale = ActualSincScaleInSamples(artifacts, band.channels[y].frequencyHz);
-					if(y == image->Height()/2)
-					{
-						AOLogger::Debug << "Horizontal sinc scale: " << sincScale << " (filter scale: " << Angle::ToString(ActualSincScaleAsRaDecDist(artifacts, band.channels[y].frequencyHz)) << ")\n";
-					}
-					if(sincScale > 1.0)
-					{
-						for(unsigned x=0;x<width;++x)
-							row[x] = image->Value(x, y);
-						if(_useHammingWindow)
-							Convolutions::OneDimensionalSincConvolutionHammingWindow(row, width, 1.0 / sincScale);
-						else
-							Convolutions::OneDimensionalSincConvolution(row, width, 1.0 / sincScale);
-						for(unsigned x=0;x<width;++x)
-							newImage->SetValue(x, y, row[x]);
-					} else {
-						for(unsigned x=0;x<width;++x)
-							newImage->SetValue(x, y, image->Value(x, y));
-					}
-				}
-				delete[] row;
-				
-				return newImage;
-			}
-			
-			void PerformFFTSincOperation(ArtifactSet &artifacts, Image2DPtr real, Image2DPtr imag) const;
-			
-			Image2DPtr PerformSincOperation(ArtifactSet &artifacts) const
-			{
-				TimeFrequencyData data = artifacts.ContaminatedData();
-				Image2DCPtr image = data.GetSingleImage();
-				num_t *row = new num_t[image->Width()*3];
-				Image2DPtr newImage = Image2D::CreateUnsetImagePtr(image->Width(), image->Height());
-				unsigned width = image->Width();
-				num_t sign;
-				if(data.IsImaginary())
-					sign = -1.0;
-				else
-					sign = 1.0;
-				const BandInfo band = artifacts.MetaData()->Band();
-				for(unsigned y=0;y<image->Height();++y)
-				{
-					const num_t sincScale = ActualSincScaleInSamples(artifacts, band.channels[y].frequencyHz);
-					if(y == image->Height()/2)
-					{
-						AOLogger::Debug << "Horizontal sinc scale: " << sincScale << " (filter scale: " << Angle::ToString(ActualSincScaleAsRaDecDist(artifacts, band.channels[y].frequencyHz)) << ")\n";
-					}
-					if(sincScale > 1.0)
-					{
-						for(unsigned x=0;x<width;++x) {
-							row[x] = sign * image->Value(x, y);
-							row[x+width] = image->Value(x, y);
-							row[x+2*width] = sign * image->Value(x, y);
-						}
-						if(_useHammingWindow)
-							Convolutions::OneDimensionalSincConvolutionHammingWindow(row, width*3, 1.0 / sincScale);
-						else
-							Convolutions::OneDimensionalSincConvolution(row, width*3, 1.0 / sincScale);
-						for(unsigned x=0;x<width;++x)
-							newImage->SetValue(x, y, row[x+width]);
-					} else {
-						for(unsigned x=0;x<width;++x)
-							newImage->SetValue(x, y, image->Value(x, y));
-					}
-				}
-				delete[] row;
-				
-				return newImage;
-			}
-			
-			Image2DPtr PerformProjectedSincOperation(ArtifactSet &artifacts, class ProgressListener &listener) const
-			{
-				TimeFrequencyData data = artifacts.ContaminatedData();
-				Image2DCPtr image = data.GetSingleImage();
-				Image2DPtr newImage = Image2D::CreateUnsetImagePtr(image->Width(), image->Height());
-				TimeFrequencyMetaDataCPtr metaData = artifacts.MetaData();
-
-				bool isImaginary = data.IsImaginary();
-				const size_t width = image->Width();
-				const BandInfo band = artifacts.MetaData()->Band();
-
-				for(size_t y=0;y<image->Height();++y)
-				{
-					const num_t sincScale = ActualSincScaleInLambda(artifacts, band.channels[y].frequencyHz);
-					listener.OnProgress(*this, y, image->Height());
-					
-					numl_t
-						*rowValues = new numl_t[width],
-						*rowUPositions = new numl_t[width],
-						*rowVPositions = new numl_t[width];
-
-					UVProjection::ProjectPositions(metaData, width, y, rowUPositions, rowVPositions, _directionRad);
-					
-					UVProjection::Project(image, y, rowValues, isImaginary);
-
-					// Perform the convolution
-					for(size_t t=0;t<width;++t)
-					{
-						const numl_t pos = rowUPositions[t];
-
-						numl_t valueSum = 0.0;
-						numl_t weightSum = 0.0;
-						
-						for(size_t x=0;x<width;++x)
-						{
-							// if this is exactly a point on the u axis, this point is ignored
-							// (it would have infinite weight)
-							const UVW &uvw = metaData->UVW()[x];
-							if(uvw.v != 0.0) 
-							{
-								//const numl_t weight = fabsnl(uvw.u / uvw.v);
-								const numl_t dist = (rowUPositions[x] - pos) / sincScale;
-								if(dist!=0.0)
-								{
-									const numl_t sincValue = sinnl(dist) / dist;
-									valueSum += sincValue * rowValues[x];// * weight;
-									weightSum += sincValue;
-								}
-								else
-								{
-									valueSum += rowValues[x];// * weight;
-									weightSum += 1.0;
-								}
-							}
-						}
-						newImage->SetValue(t, y, (num_t) (valueSum / weightSum));
-					}
-					
-					delete[] rowValues;
-					delete[] rowUPositions;
-					delete[] rowVPositions;
-				}
-				listener.OnProgress(*this, image->Height(), image->Height());
-				
-				return newImage;
-			}
-
-			void Project(class IterationData &iterData, Image2DCPtr real, Image2DCPtr imaginary, size_t yStart, size_t yEnd) const
-			{
-				const size_t width = iterData.width;
-				iterData.rowRValues = new numl_t[width];
-				iterData.rowIValues = new numl_t[width];
-				iterData.rowUPositions = new numl_t[width];
-				iterData.rowVPositions = new numl_t[width];
-
-				for(size_t x=0;x<width;++x)
-				{
-					iterData.rowRValues[x] = 0.0;
-					iterData.rowIValues[x] = 0.0;
-					iterData.rowUPositions[x] = 0.0;
-					iterData.rowVPositions[x] = 0.0;
-				}
-
-				iterData.maxDist = 0.0;
-
-				numl_t
-					rowRValues[width], rowIValues[width],
-					rowUPositions[width], rowVPositions[width],
-					yL = (yEnd - yStart);
-
-				// We average all values returned by Project() over yStart to yEnd
-				for(size_t y=yStart;y<yEnd;++y)
-				{
-					UVProjection::ProjectPositions(iterData.artifacts->MetaData(), width, y, rowUPositions, rowVPositions, _directionRad);
-					
-					UVProjection::Project(real, y, rowRValues, false);
-					UVProjection::Project(imaginary, y, rowIValues, true);
-
-					for(size_t x=0;x<width;++x)
-					{
-						iterData.rowRValues[x] += rowRValues[x] / yL;
-						iterData.rowIValues[x] += rowIValues[x] / yL;
-						iterData.rowUPositions[x] += rowUPositions[x] / yL;
-						iterData.rowVPositions[x] += rowVPositions[x] / yL;
-					}
-
-					// Find the point closest to v=0
-					numl_t vDist = fabsnl(rowVPositions[0]);
-					size_t vZeroPos = 0;
-					for(unsigned i=1;i<width;++i)
-					{
-						if(fabsnl(rowVPositions[i]) < vDist)
-						{
-							vDist = fabsnl(rowVPositions[i]);
-							vZeroPos = i;
-						}
-					}
-					iterData.vZeroPos = vZeroPos;
-					iterData.channelMaxDist[y] = fabsnl(rowUPositions[vZeroPos]);
-					iterData.maxDist += iterData.channelMaxDist[y] / yL;
-
-					//AOLogger::Debug << "v is min at t=" << vZeroPos << " (v=+-" << vDist << ", maxDist=" << iterData.channelMaxDist[y] << ")\n";
-				}
-			}
-
-			void FreeProjectedValues(class IterationData &iterData) const
-			{
-				delete[] iterData.rowRValues;
-				delete[] iterData.rowIValues;
-				delete[] iterData.rowUPositions;
-				delete[] iterData.rowVPositions;
-			}
-
-			void PrecalculateFTFactors(class IterationData &iterData) const
-			{
-				const size_t
-					width = iterData.width,
-					fourierWidth = iterData.fourierWidth,
-					rangeStart = iterData.rangeStart,
-					rangeEnd = iterData.rangeEnd;
-
-				iterData.fSinTable = new numl_t*[fourierWidth],
-				iterData.fCosTable = new numl_t*[fourierWidth];
-				for(size_t xF=0;xF<fourierWidth;++xF)
-				{
-					iterData.fSinTable[xF] = new numl_t[rangeEnd - rangeStart];
-					iterData.fCosTable[xF] = new numl_t[rangeEnd - rangeStart];
-					// F(xF) = \\int f(u) * e^(-i 2 \\pi * u_n * xF_n)
-					// xF \\in [0 : fourierWidth] -> xF_n = 2 xF / fourierWidth - 1 \\in [-1 : 1];
-					// u \\in [-maxDist : maxDist] -> u_n = u * width / maxDist \\in [ -width : width ]
-					// final frequenty domain covers [-maxDist : maxDist]
-					const numl_t
-						fourierPos = (numl_t) xF / fourierWidth - 0.5,
-						fourierFactor = -fourierPos * 2.0 * M_PInl * width * 0.5 / iterData.maxDist;
-					for(size_t tIndex=rangeStart;tIndex<rangeEnd;++tIndex)
-					{
-						size_t t = (tIndex + width - iterData.vZeroPos) % width;
-						const numl_t posU = iterData.rowUPositions[t];
-						iterData.fCosTable[xF][tIndex-rangeStart] = cosnl(fourierFactor * posU);
-						iterData.fSinTable[xF][tIndex-rangeStart] = sinnl(fourierFactor * posU);
-					}
-				}
-			}
-
-			void FreeFTFactors(class IterationData &iterData) const
-			{
-				for(size_t xF=0;xF<iterData.fourierWidth;++xF)
-				{
-					delete[] iterData.fSinTable[xF];
-					delete[] iterData.fCosTable[xF];
-				}
-				delete[] iterData.fSinTable;
-				delete[] iterData.fCosTable;
-			}
-
-			void PerformFourierTransform(class IterationData &iterData, Image2DPtr real, Image2DPtr imaginary, size_t yStart, size_t yEnd) const
-			{
-				const size_t
-					rangeStart = iterData.rangeStart,
-					rangeEnd = iterData.rangeEnd,
-					width = iterData.width,
-					vZeroPos = iterData.vZeroPos;
-
-				// Perform a 1d Fourier transform, ignoring eta part of the data
-				for(size_t xF=0;xF<iterData.fourierWidth;++xF)
-				{
-					numl_t
-						realVal = 0.0,
-						imagVal = 0.0,
-						weightSum = 0.0;
-					const numl_t
-						*fCosTable = iterData.fCosTable[xF],
-						*fSinTable = iterData.fSinTable[xF];
-					// compute F(xF) = \\int f(x) * exp( -2 * \\pi * i * x * xF )
-					for(size_t tIndex=rangeStart;tIndex<rangeEnd;++tIndex)
-					{
-						size_t t = (tIndex + width - vZeroPos) % width;
-						if(iterData.rowUPositions[t] != 0.0)
-						{
-							const numl_t weight = 1.0;//fabsnl(rowVPositions[t]/posU);
-							const numl_t weightSqrt = 1.0;//sqrtnl(weight);
-							realVal += (iterData.rowRValues[t] * fCosTable[tIndex-rangeStart] -
-													iterData.rowIValues[t] * fSinTable[tIndex-rangeStart]) * weightSqrt;
-							imagVal += (iterData.rowIValues[t] * fCosTable[tIndex-rangeStart] +
-													iterData.rowRValues[t] * fSinTable[tIndex-rangeStart]) * weightSqrt;
-							weightSum += weight;
-						}
-					}
-					iterData.fourierValuesReal[xF] = realVal / weightSum;
-					iterData.fourierValuesImag[xF] = imagVal / weightSum;
-					if(_operation == ProjectedFTOperation)
-					{
-						for(size_t y=yStart;y!=yEnd;++y)
-						{
-							real->SetValue(xF/2, y, (num_t) realVal / weightSum);
-							imaginary->SetValue(xF/2, y, (num_t) imagVal / weightSum);
-						}
-					}
-				}
-			}
-
-			void InvFourierTransform(class IterationData &iterData, Image2DPtr real, Image2DPtr imaginary, size_t y) const
-			{
-				const size_t
-					startXf = iterData.startXf,
-					endXf = iterData.endXf,
-					width = iterData.width,
-					fourierWidth = iterData.fourierWidth;
-
-				AOLogger::Debug << "Inv FT, using 0-" << startXf << " and " << endXf << "-" << fourierWidth << '\n';
-				
-				for(size_t t=0;t<width;++t)
-				{
-					const numl_t
-						posU = iterData.rowUPositions[t],
-						posV = iterData.rowVPositions[t],
-						posFactor = posU * 2.0 * M_PInl;
-					numl_t
-						realVal = 0.0,
-						imagVal = 0.0;
-					bool residual = false;
-
-					if(posV != 0.0)
-					{
-						const numl_t weightSum = 1.0; //(endXf - startXf); // * fabsnl(posV / posU);
-						// compute f(x) = \\int F(xF) * exp( 2 * \\pi * i * x * xF )
-						size_t xF, loopEnd;
-						if(residual)
-						{
-							loopEnd = startXf;
-							xF = 0;
-						}
-						else
-						{
-							loopEnd = endXf;
-							xF = startXf;
-						}
-						while(xF < loopEnd)
-						{
-							const numl_t
-								fourierPosL = (numl_t) xF / fourierWidth - 0.5,
-								fourierRealL = iterData.fourierValuesReal[xF],
-								fourierImagL = iterData.fourierValuesImag[xF];
-
-							const numl_t
-								cosValL = cosnl(fourierPosL * posFactor),
-								sinValL = sinnl(fourierPosL * posFactor);
-
-							realVal += fourierRealL * cosValL - fourierImagL * sinValL;
-							imagVal += fourierImagL * cosValL + fourierRealL * sinValL;
-
-							if(residual)
-							{
-								const numl_t
-									fourierPosR = (numl_t) (endXf + xF) / fourierWidth - 0.5,
-									fourierRealR = iterData.fourierValuesReal[endXf + xF],
-									fourierImagR = iterData.fourierValuesImag[endXf + xF];
-
-								const numl_t
-									cosValR = cosnl(fourierPosR * posFactor),
-									sinValR = sinnl(fourierPosR * posFactor);
-
-								realVal += fourierRealR * cosValR - fourierImagR * sinValR;
-								imagVal += fourierImagR * cosValR + fourierRealR * sinValR;
-							}
-							++xF;
-						}
-						real->SetValue(t, y, -realVal/weightSum);
-						imaginary->SetValue(t, y, -imagVal/weightSum);
-					}
-				}
-			}
-
-			size_t FindStrongestComponent(const class IterationData &iterData, bool withinBounds) const
-			{
-				const size_t
-					startXf = iterData.startXf,
-					endXf = iterData.endXf;
-				size_t xFRemoval = 0;
-				numl_t xFValue =
-					iterData.fourierValuesReal[0]*iterData.fourierValuesReal[0] + iterData.fourierValuesImag[0]*iterData.fourierValuesImag[0];
-				if(withinBounds)
-				{
-					AOLogger::Debug << "Limiting search to xF<" << startXf << " and xF>" << endXf << '\n'; 
-					for(size_t xF=0;xF<startXf;++xF)
-					{
-						numl_t
-							fReal = iterData.fourierValuesReal[xF],
-							fImag = iterData.fourierValuesImag[xF],
-							val = fReal*fReal + fImag*fImag;
-						if(val > xFValue)
-						{
-							xFRemoval = xF;
-							xFValue = val;
-						}
-						fReal = iterData.fourierValuesReal[xF+endXf];
-						fImag = iterData.fourierValuesImag[xF+endXf];
-						val = fReal*fReal + fImag*fImag;
-						if(val > xFValue)
-						{
-							xFRemoval = xF+endXf;
-							xFValue = val;
-						}
-					}
-				} else {
-					const size_t fourierWidth = iterData.fourierWidth;
-					const numl_t p = 0.1;
-
-					for(size_t xF=0;xF<fourierWidth;++xF)
-					{
-						const numl_t
-							fReal = iterData.fourierValuesReal[xF],
-							fImag = iterData.fourierValuesImag[xF];
-						numl_t
-							val = fReal*fReal + fImag*fImag;
-						if(xF >= startXf && xF <= endXf)
-							val *= p + (1.0 - p) * fabsnl(2.0*xF - (numl_t) fourierWidth)/((numl_t) (endXf-startXf));
-						if(val > xFValue)
-						{
-							xFRemoval = xF;
-							xFValue = val;
-						}
-					}
-				}
-
-				return xFRemoval;
-			}
-
-			void RemoveFourierComponent(class IterationData &iterData, Image2DPtr real, Image2DPtr imaginary, size_t y, numl_t fourierFactor, numl_t fReal, numl_t fImag, bool applyOnImages) const
-			{
-				const size_t
-					width = iterData.width;
-
-				for(size_t t=0;t<width;++t)
-				{
-					const numl_t
-						posU = iterData.rowUPositions[t],
-						weightSum = 1.0;
-						
-					const numl_t
-						cosValL = cosnl(-fourierFactor * posU),
-						sinValL = sinnl(-fourierFactor * posU);
-
-					numl_t realVal = (fReal * cosValL + fImag * sinValL) * 0.75 / weightSum;
-					numl_t imagVal = (fReal * sinValL + fImag * cosValL) * 0.75 / weightSum;
-					
-					if(applyOnImages)
-					{
-						real->SetValue(t, y, real->Value(t, y) - realVal);
-						imaginary->SetValue(t, y, imaginary->Value(t, y) - imagVal);
-					} else {
-						iterData.rowRValues[t] -= realVal;
-						iterData.rowIValues[t] -= imagVal;
-					}
-				}
-			}
-			
-			void PerformExtrapolatedSincOperation(ArtifactSet &artifacts, Image2DPtr real, Image2DPtr imaginary, class ProgressListener &listener) const
-			{
-				TimeFrequencyMetaDataCPtr metaData = artifacts.MetaData();
-
-				const size_t width = real->Width();
-				const BandInfo band = artifacts.MetaData()->Band();
-					
-				class IterationData iterData;
-
-				iterData.artifacts = &artifacts;
-
-				iterData.width = width;
-				iterData.fourierWidth = width * 2;
-				iterData.fourierValuesReal = new numl_t[iterData.fourierWidth];
-				iterData.fourierValuesImag = new numl_t[iterData.fourierWidth];
-				iterData.channelMaxDist = new numl_t[real->Height()];
-
-				iterData.rangeStart = (size_t) roundn(_etaParameter * (num_t) width / 2.0),
-				iterData.rangeEnd = width - iterData.rangeStart;
-
-				for(size_t y=0;y<real->Height();y+=_channelAveragingSize)
-				{
-					listener.OnProgress(*this, y, real->Height());
-
-					Project(iterData, real, imaginary, y, y+_channelAveragingSize);
-					
-					PrecalculateFTFactors(iterData);
-
-					for(unsigned iteration=0;iteration<_iterations;++iteration)
-					{
-						PerformFourierTransform(iterData, real, imaginary, y, y+_channelAveragingSize);
-					
-						numl_t sincScale = ActualSincScaleInLambda(artifacts, band.channels[y].frequencyHz);
-						numl_t clippingFrequency = 1.0/(sincScale * width / iterData.maxDist);
-						long fourierClippingIndex =
-							(long) ceilnl((numl_t) iterData.fourierWidth * 0.5 * clippingFrequency);
-						if(fourierClippingIndex*2 > (long) iterData.fourierWidth)
-							fourierClippingIndex = iterData.fourierWidth/2;
-						if(fourierClippingIndex < 0)
-							fourierClippingIndex = 0;
-						iterData.startXf = iterData.fourierWidth/2 - fourierClippingIndex,
-						iterData.endXf = iterData.fourierWidth/2 + fourierClippingIndex;
-
-						if(_operation == ExtrapolatedSincOperation)
-						{
-							InvFourierTransform(iterData, real, imaginary, y);
-						}
-						else if(_operation == IterativeExtrapolatedSincOperation)
-						{
-							const size_t xFRemoval = FindStrongestComponent(iterData, false);
-							const numl_t
-									fReal = iterData.fourierValuesReal[xFRemoval],
-									fImag = iterData.fourierValuesImag[xFRemoval],
-									xFValue = sqrtnl(fReal*fReal + fImag*fImag);
-							AOLogger::Debug << "Removing frequency at xF=" << xFRemoval << ", amp=" << xFValue << '\n';
-							AOLogger::Debug << "Amplitude = sigma x " << (xFValue / GetAverageAmplitude(iterData)) << '\n';
-
-							if(xFRemoval < iterData.startXf || xFRemoval > iterData.endXf || _alwaysRemove)
-							{
-								if(!_alwaysRemove)
-									AOLogger::Debug << "Within bounds 0-" << iterData.startXf << '/' << iterData.endXf << "-.. removing from image.\n";
-								// Now, remove the fringe from each channel 
-								for(size_t yI = y; yI != y+_channelAveragingSize; ++yI)
-								{
-									const numl_t
-										channelFactor = iterData.channelMaxDist[yI] / iterData.maxDist,
-										fourierPos = (numl_t) xFRemoval / iterData.fourierWidth - 0.5,
-										fourierFactor = fourierPos * 2.0 * M_PInl * width * 0.5 / iterData.maxDist * channelFactor;
-		
-									RemoveFourierComponent(iterData, real, imaginary, yI, fourierFactor, fReal, fImag, true);
-								}
-							}
-
-							// Subtract fringe from average value
-							const numl_t
-								fourierPos = (numl_t) xFRemoval / iterData.fourierWidth - 0.5,
-								fourierFactor = fourierPos * 2.0 * M_PInl * width * 0.5 / iterData.maxDist;
-							RemoveFourierComponent(iterData, real, imaginary, y, fourierFactor, fReal, fImag, false);
-						}
-					}
-					FreeFTFactors(iterData);
-					FreeProjectedValues(iterData);
-				}
-				listener.OnProgress(*this, real->Height(), real->Height());
-
-				delete[] iterData.fourierValuesReal;
-				delete[] iterData.fourierValuesImag;
-				delete[] iterData.channelMaxDist;
-			}
-
-			numl_t avgUVDistance(ArtifactSet &artifacts, const double frequencyHz) const
-			{
-				return UVImager::UVTrackLength(artifacts.MetaData(), frequencyHz);
-			}
-
-			numl_t ActualSincScaleInSamples(ArtifactSet &artifacts, const double frequencyHz) const
-			{
-				if(_isSincScaleInSamples)
-					return _sincSize;
-				else
-					return _sincSize / avgUVDistance(artifacts, frequencyHz) * (numl_t) artifacts.ContaminatedData().ImageWidth();
-			}
-
-			numl_t ActualSincScaleInLambda(ArtifactSet &artifacts, const double frequencyHz) const
-			{
-				if(_isSincScaleInSamples)
-					return _sincSize / ((numl_t) artifacts.ContaminatedData().ImageWidth()) * avgUVDistance(artifacts, frequencyHz);
-				else
-					return _sincSize;
-			}
-			
-			numl_t ActualSincScaleAsRaDecDist(ArtifactSet &artifacts, const double frequencyHz) const
-			{
-				return 1.0/ActualSincScaleInLambda(artifacts, frequencyHz);
-			}
-
-			numl_t GetAverageAmplitude(class IterationData &iterData) const
-			{
-				const size_t
-					startXf = iterData.startXf,
-					endXf = iterData.endXf;
-
-				numl_t sum = 0.0;
-				for(size_t xF=0;xF<startXf;++xF)
-				{
-					numl_t
-						fReal = iterData.fourierValuesReal[xF],
-						fImag = iterData.fourierValuesImag[xF];
-					sum += sqrtnl(fReal*fReal + fImag*fImag);
-
-					fReal = iterData.fourierValuesReal[xF+endXf];
-					fImag = iterData.fourierValuesImag[xF+endXf];
-					sum += sqrtnl(fReal*fReal + fImag*fImag);
-				}
-
-				return sum / (numl_t) (startXf * 2);
-			}
-
-			numl_t FindStrongestSourceAngle(ArtifactSet &artifacts, const TimeFrequencyData &data)
-			{
-				UVImager imager(1024*3, 1024*3);
-				imager.Image(data, artifacts.MetaData());
-				imager.PerformFFT();
-				Image2DPtr image(FFTTools::CreateAbsoluteImage(imager.FTReal(), imager.FTImaginary()));
-				const numl_t centralFreq = artifacts.MetaData()->Band().channels[data.ImageHeight()/2].frequencyHz;
-				AOLogger::Debug << "Central frequency: " << centralFreq << "\n";
-				AOLogger::Debug << "Baseline length: " << artifacts.MetaData()->Baseline().Distance() << '\n';
-				AOLogger::Debug << "Sinc scale in lambda: " << ActualSincScaleInLambda(artifacts, centralFreq) << '\n';
-				AOLogger::Debug << "Average distance: " << avgUVDistance(artifacts, centralFreq) << '\n';
-				const numl_t sincDist = ActualSincScaleAsRaDecDist(artifacts, centralFreq);
-				numl_t ignoreRadius = sincDist / imager.UVScaling();
-				AOLogger::Debug << "Ignoring radius=" << ignoreRadius << "\n";
-
-				long maxX = 0, maxY = 0;
-				num_t maxValue = image->Value(maxX, maxY);
-				for(unsigned y=0;y<image->Height();++y)
-				{
-					for(unsigned x=0;x<image->Width();++x)
-					{
-						if(image->Value(x, y) > maxValue)
-						{
-							int x_r = (x*2 - image->Width())/2;
-							int y_r = (image->Height() - y*2)/2;
-							numl_t distSqr = x_r*x_r + y_r*y_r;
-							if(distSqr > ignoreRadius * ignoreRadius)
-							{
-								maxValue = image->Value(x, y);
-								maxX = x;
-								maxY = y;
-							}
-						}
-					}
-				}
-				maxX = maxX*2-image->Width();
-				maxY = image->Height() - maxY*2;
-				numl_t angle = SinusFitter::Phase((numl_t) maxX, (numl_t) maxY);
- 				AOLogger::Debug << "Angle: " << angle/M_PInl*180.0 << ",maxX=" << maxX << ",maxY=" << maxY << '\n';
-				return angle;
-				/*
-				image = FFTTools::AngularTransform(image);
-				unsigned pixelDist = (unsigned) (ActualSincScaleAsRaDecDist()*image->Height()/2.0);
-				AOLogger::Debug << "Ignoring " << (image->Height()/2-pixelDist) << "-" << (image->Height()/2+pixelDist) << '\n';
-				numl_t highestSum = -1e10;
-				size_t highestIndex = 0;
-				for(size_t x=0;x<image->Width();++x)
-				{
-					numl_t sum = 0.0;
-					for(size_t y=0;y<pixelDist;++y)
-					{
-						sum += image->Value(x, y);
-						sum += image->Value(x, image->Height() - y - 1);
-					}
-					if(sum > highestSum)
-					{
-						highestSum = sum;
-						highestIndex = x;
-					}
-				}
-				numl_t angle = (numl_t) highestIndex * M_PInl / image->Width();
-				AOLogger::Debug << "Angle: " << angle/M_PInl*180.0 << '\n';
-				return angle;*/
-			}
-
-			enum Operation _operation;
-			num_t _sincSize, _directionRad, _etaParameter;
-			bool _autoAngle, _isSincScaleInSamples, _alwaysRemove, _useHammingWindow;
-			unsigned _iterations, _channelAveragingSize;
-	};
-
-} // namespace
-
-#endif // RFI_TIME_CONVOLUTION_ACTION
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/timeselectionaction.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/timeselectionaction.h
deleted file mode 100644
index 0a03be862363c35381d8398d0b1f54447bb01091..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/timeselectionaction.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef TIMESELECTIONACTION_H
-#define TIMESELECTIONACTION_H
-
-#include <AOFlagger/msio/types.h>
-
-#include <AOFlagger/strategy/actions/action.h>
-
-namespace rfiStrategy {
-	
-	/**
-		@author A.R. Offringa <offringa@astro.rug.nl>
-	*/
-	class TimeSelectionAction : public Action {
-		public:
-			TimeSelectionAction() : _threshold(3.5)
-			{
-			}
-			~TimeSelectionAction()
-			{
-			}
-			virtual std::string Description()
-			{
-				return "Time selection";
-			}
-			virtual void Perform(ArtifactSet &artifacts, class ProgressListener &)
-			{
-				AutomaticSelection(artifacts);
-			}
-			virtual ActionType Type() const { return TimeSelectionActionType; }
-
-			num_t Threshold() const { return _threshold; }
-			void SetThreshold(num_t threshold) { _threshold = threshold; }
-		private:
-			void AutomaticSelection(ArtifactSet &artifacts);
-
-			num_t _threshold;
-	};
-
-}
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/uvprojectaction.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/uvprojectaction.h
deleted file mode 100644
index 9d1379b415eccede3ed0e73ebd9aa24f6f2b25af..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/uvprojectaction.h
+++ /dev/null
@@ -1,105 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef RFI_UV_PROJECT_ACTION_H
-#define RFI_UV_PROJECT_ACTION_H
-
-#include <AOFlagger/strategy/actions/action.h>
-
-#include <AOFlagger/strategy/algorithms/uvprojection.h>
-
-#include <AOFlagger/strategy/control/artifactset.h>
-#include <AOFlagger/strategy/control/actionblock.h>
-
-#include <AOFlagger/msio/timefrequencydata.h>
-
-#include <iostream>
-
-namespace rfiStrategy {
-
-	class UVProjectAction : public Action
-	{
-		public:
-			UVProjectAction() : Action(), _directionRad(68.0/180.0*M_PI/*atann(600.0/(8.0*320.0))*/), _etaParameter(0.2), _reverse(false), _onRevised(false), _onContaminated(true)
-			{
-			}
-			virtual std::string Description()
-			{
-				if(_reverse)
-					return "Reverse UV-project";
-				else
-					return "UV-project";
-			}
-			virtual ActionType Type() const { return UVProjectActionType; }
-			virtual void Perform(ArtifactSet &artifacts, class ProgressListener &)
-			{
-				if(_onContaminated)
-					perform(artifacts.ContaminatedData(), artifacts.MetaData());
-				if(_onRevised)
-					perform(artifacts.RevisedData(), artifacts.MetaData());
-				artifacts.SetProjectedDirectionRad(_directionRad);
-			}
-			numl_t DirectionRad() const { return _directionRad; }
-			void SetDirectionRad(numl_t directionRad) { _directionRad = directionRad; }
-			
-			numl_t EtaParameter() const { return _etaParameter; }
-			void SetEtaParameter(numl_t etaParameter) { _etaParameter = etaParameter; }
-
-			num_t DestResolutionFactor() const { return _destResolutionFactor; }
-			void SetDestResolutionFactor(num_t destResolutionFactor) { _destResolutionFactor = destResolutionFactor; }
-			
-			bool Reverse() const { return _reverse; }
-			void SetReverse(bool reverse) { _reverse = reverse; }
-			
-			bool OnRevised() const { return _onRevised; }
-			void SetOnRevised(bool onRevised) { _onRevised = onRevised; }
-			
-			bool OnContaminated() const { return _onContaminated; }
-			void SetOnContaminated(bool onContaminated) { _onContaminated = onContaminated; }
-		private:
-			void perform(TimeFrequencyData &data, TimeFrequencyMetaDataCPtr metaData)
-			{
-				if(data.ImageCount()!=1)
-					throw std::runtime_error("UV Projection can be applied on single images only");
-				Image2DCPtr image = data.GetImage(0);
-
-				Image2DPtr destination = Image2D::CreateZeroImagePtr(image->Width(), image->Height());
-					
-				if(_reverse)
-				{
-					UVProjection::InverseProjectImage(image, destination, metaData, _directionRad, _etaParameter, data.IsImaginary());
-				} else
-				{
-					Image2DPtr weights = Image2D::CreateZeroImagePtr(image->Width(), image->Height());
-				
-					UVProjection::ProjectImage(image, destination, weights, metaData, _directionRad, _etaParameter, data.IsImaginary());
-				}
-				
-				data.SetImage(0, destination);
-			}
-			
-			numl_t _directionRad, _etaParameter;
-			num_t _destResolutionFactor;
-			bool _reverse;
-			bool _onRevised, _onContaminated;
-	};
-
-} // namespace
-
-#endif // RFI_UV_PROJECT_ACTION_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/writedataaction.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/writedataaction.h
deleted file mode 100644
index 9394e67aa8b147e940bb24694a4306e2927db1bd..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/writedataaction.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef WRITEDATAACTION_H
-#define WRITEDATAACTION_H
-
-#include <boost/thread/mutex.hpp>
-
-#include <AOFlagger/strategy/actions/action.h>
-
-#include <AOFlagger/strategy/control/artifactset.h>
-
-#include <AOFlagger/strategy/imagesets/imageset.h>
-
-namespace rfiStrategy {
-	/**
-		@author A.R. Offringa <offringa@astro.rug.nl>
-	*/
-	class WriteDataAction : public Action {
-		public:
-			WriteDataAction()
-			{
-			}
-
-			virtual ~WriteDataAction()
-			{
-			}
-
-			virtual std::string Description()
-			{
-				return "Write data to file";
-			}
-
-			virtual void Perform(class ArtifactSet &artifacts, ProgressListener &)
-			{
-				boost::mutex::scoped_lock lock(artifacts.IOMutex());
-				ImageSet &set = *artifacts.ImageSet();
-				set.PerformWriteDataTask(*artifacts.ImageSetIndex(), artifacts.RevisedData());
-			}
-
-			virtual ActionType Type() const
-			{
-				return WriteDataActionType;
-			}
-
-		private:
-	};
-}
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/writeflagsaction.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/writeflagsaction.h
deleted file mode 100644
index 4ac6ed3b45b7cc13d62ea3c7a299d7ba8762394e..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/writeflagsaction.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef WRITEFLAGSACTION_H
-#define WRITEFLAGSACTION_H
-
-#include <AOFlagger/strategy/actions/action.h>
-
-#include <AOFlagger/strategy/imagesets/imageset.h>
-
-#include <stack>
-
-#include <boost/thread/mutex.hpp>
-#include <boost/thread/condition.hpp>
-#include <boost/thread/thread.hpp>
-
-#include <AOFlagger/msio/mask2d.h>
-
-namespace rfiStrategy {
-	/**
-		@author A.R. Offringa <offringa@astro.rug.nl>
-	*/
-	class WriteFlagsAction : public Action {
-		public:
-			WriteFlagsAction();
-			virtual ~WriteFlagsAction();
-
-			virtual std::string Description()
-			{
-				return "Write flags to file";
-			}
-
-			virtual void Perform(class ArtifactSet &artifacts, ProgressListener &progress);
-			virtual ActionType Type() const { return WriteFlagsActionType; }
-			virtual void Finish();
-			virtual void Sync() { Finish(); Initialize(); }
-
-			void SetMaxBufferItems(size_t maxBufferItems) { _maxBufferItems = maxBufferItems; }
-			void SetMinBufferItemsForWriting(size_t minBufferItemsForWriting) { _minBufferItemsForWriting = minBufferItemsForWriting; }
-		private:
-			struct BufferItem {
-				BufferItem(const std::vector<Mask2DCPtr> &masks, const ImageSetIndex &index)
-					: _masks(masks), _index(index.Copy())
-				{
-				}
-				BufferItem(const BufferItem &source) : _masks(source._masks), _index(source._index->Copy())
-				{
-				}
-				~BufferItem()
-				{
-					delete _index;
-				}
-				void operator=(const BufferItem &source)
-				{
-					delete _index;
-					_masks = source._masks;
-					_index = source._index->Copy();
-				}
-				std::vector<Mask2DCPtr> _masks;
-				ImageSetIndex *_index;
-			};
-
-			struct FlushFunction
-			{
-				WriteFlagsAction *_parent;
-				void operator()();
-			};
-
-			void pushInBuffer(const BufferItem &newItem)
-			{
-				boost::mutex::scoped_lock lock(_mutex);
-				while(_buffer.size() >= _maxBufferItems)
-					_bufferChange.wait(lock);
-				_buffer.push(newItem);
-				_bufferChange.notify_all();
-			}
-
-			boost::mutex _mutex;
-			boost::mutex *_ioMutex;
-			boost::condition _bufferChange;
-			boost::thread *_flusher;
-			bool _isFinishing;
-
-			size_t _maxBufferItems;
-			size_t _minBufferItemsForWriting;
-
-			std::stack<BufferItem> _buffer;
-			ImageSet *_imageSet;
-	};
-}
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/baselineselector.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/baselineselector.h
deleted file mode 100644
index c6938e3447a4206d46dcabf4abddd743d7b3a42f..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/baselineselector.h
+++ /dev/null
@@ -1,122 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2011 by A.R. Offringa                                   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#ifndef BASELINE_SELECTOR_H
-#define BASELINE_SELECTOR_H
-
-#include <string>
-#include <set>
-#include <vector>
-
-#include <boost/thread/mutex.hpp>
-
-#include <AOFlagger/msio/timefrequencymetadata.h>
-#include <AOFlagger/msio/mask2d.h>
-
-class DefaultStatistics;
-
-namespace rfiStrategy {
-
-	class BaselineSelector
-	{
-		public:
-			struct SingleBaselineInfo
-			{
-				SingleBaselineInfo() : marked(false) { }
-
-				SingleBaselineInfo(const SingleBaselineInfo &source) :
-					antenna1(source.antenna1),
-					antenna2(source.antenna2),
-					antenna1Name(source.antenna1Name),
-					antenna2Name(source.antenna2Name),
-					band(source.band),
-					length(source.length),
-					rfiCount(source.rfiCount),
-					totalCount(source.totalCount),
-					marked(source.marked)
-				{
-				}
-				void operator=(const SingleBaselineInfo &source)
-				{
-					antenna1 = source.antenna1;
-					antenna2 = source.antenna2;
-					antenna1Name = source.antenna1Name;
-					antenna2Name = source.antenna2Name;
-					band = source.band;
-					length = source.length;
-					rfiCount = source.rfiCount;
-					totalCount = source.totalCount;
-					marked = source.marked;
-				}
-				bool operator<(const SingleBaselineInfo &rhs) const
-				{
-					return length < rhs.length;
-				}
-					
-				int antenna1, antenna2;
-				std::string antenna1Name, antenna2Name;
-				int band;
-				double length;
-				unsigned long rfiCount, totalCount;
-				bool marked;
-			};
-			
-			BaselineSelector() :
-			_threshold(8.0), _absThreshold(0.4), _smoothingSigma(0.6),
-			_makePlot(false), _useLog(true)
-			{
-			}
-
-			typedef std::vector<SingleBaselineInfo> BaselineVector;
-			void Search(std::vector<BaselineSelector::SingleBaselineInfo> &markedBaselines);
-			void ImplyStations(const std::vector<BaselineSelector::SingleBaselineInfo> &markedBaselines, double maxRatio, std::set<unsigned> &badStations) const;
-			void Add(Mask2DCPtr mask, TimeFrequencyMetaDataCPtr metaData);
-			void Add(class DefaultStatistics &baselineStat, class AntennaInfo &antenna1, class AntennaInfo &antenna2);
-			
-			boost::mutex &Mutex() { return _mutex; }
-			
-			double Threshold() const { return _threshold; }
-			double AbsThreshold() const { return _absThreshold; }
-			
-			void SetThreshold(double threshold) { _threshold = threshold; }
-			void SetAbsThreshold(double absThreshold) { _absThreshold = absThreshold; }
-			void SetSmoothingSigma(double smoothingSigma) { _smoothingSigma = smoothingSigma; }
-			void SetUseLog(bool useLog) { _useLog = useLog; }
-			
-			size_t BaselineCount() const { return _baselines.size(); }
-		private:
-			boost::mutex _mutex;
-			BaselineVector _baselines;
-			double _threshold, _absThreshold;
-			double _smoothingSigma;
-			bool _makePlot;
-			bool _useLog;
-			
-			double smoothedValue(double length) const;
-			double smoothedValue(const BaselineSelector::SingleBaselineInfo &baseline) const
-			{
-				return smoothedValue(baseline.length);
-			}
-
-	};
-
-} // end of namespace
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/baselinetimeplaneimager.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/baselinetimeplaneimager.h
deleted file mode 100644
index 1bb1713697300af4c0c99a1e3ce8b89e5e6acf59..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/baselinetimeplaneimager.h
+++ /dev/null
@@ -1,26 +0,0 @@
-#ifndef BASELINETIMEPLANEIMAGER_H
-#define BASELINETIMEPLANEIMAGER_H
-
-#include <complex>
-
-#include <AOFlagger/msio/image2d.h>
-
-template<typename NumType>
-class BaselineTimePlaneImager
-{
-	public:
-		void Image(NumType uTimesLambda, NumType vTimesLambda, NumType wTimesLambda, NumType lowestFrequency, NumType frequencyStep, size_t channelCount, const std::complex<NumType> *data, Image2D &output);
-		
-	private:
-		template<typename T>
-		static T frequencyToWavelength(const T frequency)
-		{
-			return speedOfLight() / frequency; 
-		}
-		static long double speedOfLight()
-		{
-			return 299792458.0L;
-		}
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/cnoisestatistics.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/cnoisestatistics.h
deleted file mode 100644
index 062d4af5f912776082ac1200bd1f5e7500e40cbd..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/cnoisestatistics.h
+++ /dev/null
@@ -1,150 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef CNOISESTATISTICS_H
-#define CNOISESTATISTICS_H
-
-#include "noisestatistics.h"
-
-#include <complex>
-
-class CNoiseStatistics
-{
-	public:
-		CNoiseStatistics() : real(), imaginary()
-		{
-		}
-		
-		CNoiseStatistics(const NoiseStatistics::Array &realValues, const NoiseStatistics::Array &imaginaryValues)
-		: real(realValues), imaginary(imaginaryValues)
-		{
-		}
-		
-		CNoiseStatistics(const CNoiseStatistics &source) : real(source.real), imaginary(source.imaginary)
-		{
-		}
-		
-		void operator=(const CNoiseStatistics &source)
-		{
-			real = source.real;
-			imaginary = source.imaginary;
-		}
-		
-		void operator+=(const CNoiseStatistics &rhs)
-		{
-			real.Add(rhs.real);
-			imaginary.Add(rhs.imaginary);
-		}
-		
-		long unsigned int Count() const
-		{
-			return real.Count();
-		}
-		
-		void SetCount(long unsigned int count)
-		{
-			real.SetCount(count);
-			imaginary.SetCount(count);
-		}
-		
-		void AddCount(long unsigned int count)
-		{
-			real.SetCount(real.Count() + count);
-			imaginary.SetCount(imaginary.Count() + count);
-		}
-		
-		std::complex<float> Sum() const
-		{
-			return std::complex<float>(real.Sum(), imaginary.Sum());
-		}
-		
-		void SetSum(std::complex<float> sum)
-		{
-			real.SetSum(sum.real());
-			imaginary.SetSum(sum.imag());
-		}
-		
-		void AddSum(std::complex<float> sum)
-		{
-			real.SetSum(real.Sum() + sum.real());
-			imaginary.SetSum(imaginary.Sum() + sum.imag());
-		}
-		
-		std::complex<float> Sum2() const
-		{
-			return std::complex<float>(real.Sum2(), imaginary.Sum2());
-		}
-		
-		void SetSum2(std::complex<float> sum2)
-		{
-			real.SetSum2(sum2.real());
-			imaginary.SetSum2(sum2.imag());
-		}
-		
-		void AddSum2(std::complex<float> sum2)
-		{
-			real.SetSum2(real.Sum2() + sum2.real());
-			imaginary.SetSum2(imaginary.Sum2() + sum2.imag());
-		}
-		
-		std::complex<float> Sum3() const
-		{
-			return std::complex<float>(real.Sum3(), imaginary.Sum3());
-		}
-		
-		std::complex<float> Sum4() const
-		{
-			return std::complex<float>(real.Sum4(), imaginary.Sum4());
-		}
-		
-		std::complex<float> Mean() const
-		{
-			return std::complex<float>(real.Mean(), imaginary.Mean());
-		}
-		
-		std::complex<float> StdDevEstimator() const
-		{
-			return std::complex<float>(real.StdDevEstimator(), imaginary.StdDevEstimator());
-		}
-		
-		std::complex<float> VarianceEstimator() const
-		{
-			return std::complex<float>(real.VarianceEstimator(), imaginary.VarianceEstimator());
-		}
-		
-		std::complex<float> SecondMoment() const
-		{
-			return std::complex<float>(real.SecondMoment(), imaginary.SecondMoment());
-		}
-		
-		std::complex<float> FourthMoment() const
-		{
-			return std::complex<float>(real.FourthMoment(), imaginary.FourthMoment());
-		}
-		
-		std::complex<float> VarianceOfVarianceEstimator() const
-		{
-			return std::complex<float>(real.VarianceOfVarianceEstimator(), imaginary.VarianceOfVarianceEstimator());
-		}
-		
-		NoiseStatistics real;
-		NoiseStatistics imaginary;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/convolutions.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/convolutions.h
deleted file mode 100644
index cb515e9c150a3c75b3bb2f77e130f1aa3de5764d..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/convolutions.h
+++ /dev/null
@@ -1,212 +0,0 @@
-#ifndef CONVOLUTIONS_H
-#define CONVOLUTIONS_H
-
-#include <AOFlagger/msio/types.h>
-
-#include <AOFlagger/util/rng.h>
-
-#include <cmath>
-
-class Convolutions
-{
-	public:
-		/**
-		* This function will convolve data with the specified kernel. It will
-		* place the element at position (kernelSize/2) of the kernel in the
-		* centre, i.e. data[0] := sum over i in kS : data[i - kS + _kS/2_] * kernel[i].
-		* Therefore, it makes most sense to specify an odd kernelSize if the
-		* kernel consists of a peak / symmetric function.
-		*
-		* This function assumes the function represented by @c data is zero outside
-		* its domain [0..dataSize}.
-		*
-		* This function does not reverse one of the input functions, therefore this function
-		* is not adhering to the strict definition of a convolution.
-		*
-		* This function does not use an FFT to calculate the convolution, and is therefore
-		* O(dataSize x kernelSize).
-		*
-		* @param data The data to be convolved (will also be the output)
-		* @param dataSize Number of samples in data
-		* @param kernel The kernel to be convolved, central sample = kernelSize/2
-		* @param kernelSize Number of samples in the kernel, probably desired to be
-		* odd if the kernel is symmetric.
-		*/
-		static void OneDimensionalConvolutionBorderZero(num_t *data, unsigned dataSize, const num_t *kernel, unsigned kernelSize)
-		{
-			num_t *tmp = new num_t[dataSize]; 
-			for(unsigned i=0;i<dataSize;++i)
-			{
-				unsigned kStart, kEnd;
-				const int offset = i - kernelSize/2;
-				// Make sure that kStart >= 0
-				if(offset < 0)
-					kStart = -offset;
-				else
-					kStart = 0;
-				// Make sure that kEnd + offset <= dataSize
-				if(offset + kernelSize > dataSize)
-					kEnd = dataSize - offset;
-				else
-					kEnd = kernelSize;
-				num_t sum = 0.0;
-				for(unsigned k=kStart;k<kEnd;++k)
-					sum += data[k + offset]*kernel[k];
-				tmp[i] = sum;
-			}
-			for(unsigned i=0;i<dataSize;++i)
-				data[i] = tmp[i];
-			delete[] tmp;
-		}
-		
-		/**
-		* This function will convolve data with the specified kernel. It will
-		* place the element at position (kernelSize/2) of the kernel in the
-		* centre, i.e. data[0] := sum over i in kS : data[i - kS + _kS/2_] * kernel[i].
-		* Therefore, it makes most sense to specify an odd kernelSize if the
-		* kernel consists of a peak / symmetric function.
-		*
-		* This function assumes the function represented by @c data is not zero outside
-		* its domain [0..dataSize}, but is "unknown". It assumes that the integral
-		* over @c kernel is one. If this is not the case, you have to multiply all output
-		* values with the kernels integral after convolution.
-		*
-		* This function does not reverse one of the input functions, therefore this function
-		* is not adhering to the strict definition of a convolution.
-		*
-		* This function does not use an FFT to calculate the convolution, and is therefore
-		* O(dataSize x kernelSize).
-		*
-		* @param data The data to be convolved (will also be the output)
-		* @param dataSize Number of samples in data
-		* @param kernel The kernel to be convolved, central sample = kernelSize/2
-		* @param kernelSize Number of samples in the kernel, probably desired to be
-		* odd if the kernel is symmetric.
-		*/
-		static void OneDimensionalConvolutionBorderInterp(num_t *data, unsigned dataSize, const num_t *kernel, unsigned kernelSize)
-		{
-			num_t *tmp = new num_t[dataSize]; 
-			for(unsigned i=0;i<dataSize;++i)
-			{
-				unsigned kStart, kEnd;
-				const int offset = i - kernelSize/2;
-				// Make sure that kStart >= 0
-				if(offset < 0)
-					kStart = -offset;
-				else
-					kStart = 0;
-				// Make sure that kEnd + offset <= dataSize
-				if(offset + kernelSize > dataSize)
-					kEnd = dataSize - offset;
-				else
-					kEnd = kernelSize;
-				num_t sum = 0.0;
-				num_t weight = 0.0;
-				for(unsigned k=kStart;k<kEnd;++k)
-				{
-					sum += data[k + offset]*kernel[k];
-					weight += kernel[k];
-				}
-				// Weighting is performed to correct for the "missing data" outside the domain of data.
-				// The actual correct value should be sum * (sumover kernel / sumover kernel-used ).
-				// We however assume "sumover kernel" to be 1. sumover kernel-used is the weight.
-				tmp[i] = sum / weight;
-			}
-			for(unsigned i=0;i<dataSize;++i)
-				data[i] = tmp[i];
-			delete[] tmp;
-		}
-		
-		static void OneDimensionalGausConvolution(num_t *data, unsigned dataSize, num_t sigma)
-		{
-			unsigned kernelSize = (unsigned) roundn(sigma*3.0L);
-			if(kernelSize%2 == 0) ++kernelSize;
-			if(kernelSize > dataSize*2)
-			{
-				if(dataSize == 0) return;
-				kernelSize = dataSize*2 - 1;
-			}
-			unsigned centreElement = kernelSize/2;
-			num_t *kernel = new num_t[kernelSize];
-			for(unsigned i=0;i<kernelSize;++i)
-			{
-				num_t x = ((num_t) i-(num_t) centreElement);
-				kernel[i] = RNG::EvaluateGaussian(x, sigma);
-			}
-			OneDimensionalConvolutionBorderInterp(data, dataSize, kernel, kernelSize);
-			delete[] kernel;
-		}
-		
-		/**
-		* Perform a sinc convolution. This is equivalent with a low-pass filter,
-		* where @c frequency specifies the frequency in index units.
-		*
-		* With frequency=1, the data will be convolved with the
-		* delta function and have no effect. With frequency = 0.25,
-		* all fringes faster than 0.25 fringes/index units will be
-		* filtered.
-		*
-		* The function is O(dataSize^2).
-		*/
-		static void OneDimensionalSincConvolution(num_t *data, unsigned dataSize, num_t frequency)
-		{
-			if(dataSize == 0) return;
-			const unsigned kernelSize = dataSize*2 - 1;
-			const unsigned centreElement = kernelSize/2;
-			num_t *kernel = new num_t[kernelSize];
-			const numl_t factor = 2.0 * frequency * M_PInl;
-			numl_t sum = 0.0;
-			for(unsigned i=0;i<kernelSize;++i)
-			{
-				const numl_t x = (((numl_t) i-(numl_t) centreElement) * factor);
-				if(x!=0.0)
-					kernel[i] = (num_t) (sinnl(x) / x);
-				else
-					kernel[i] = 1.0;
-				sum += kernel[i];
-			}
-			for(unsigned i=0;i<kernelSize;++i)
-			{
-				kernel[i] /= sum;
-			}
-			OneDimensionalConvolutionBorderZero(data, dataSize, kernel, kernelSize);
-			delete[] kernel;
-		}
-
-		/**
-		* Perform a sinc convolution, with a convolution kernel that has been Hamming windowed.
-		* Because of the hamming window, the filter has less of a steep cutting edge, but less ripples. 
-		*
-		* See OneDimensionalSincConvolution() for more info.
-		*
-		* The function is O(dataSize^2).
-		*/
-		static void OneDimensionalSincConvolutionHammingWindow(num_t *data, unsigned dataSize, num_t frequency)
-		{
-			if(dataSize == 0) return;
-			const unsigned kernelSize = dataSize*2 - 1;
-			const unsigned centreElement = kernelSize/2;
-			num_t *kernel = new num_t[kernelSize];
-			const numl_t sincFactor = 2.0 * frequency * M_PInl;
-			const numl_t hammingFactor = 2.0 * M_PInl * (numl_t) (kernelSize-1);
-			numl_t sum = 0.0;
-			for(unsigned i=0;i<kernelSize;++i)
-			{
-				const numl_t hamming = 0.54 - 0.46 * cosnl(hammingFactor * (numl_t) i);
-				const numl_t x = (((numl_t) i-(numl_t) centreElement) * sincFactor);
-				if(x!=0.0)
-					kernel[i] = (num_t) (sinnl(x) / x) * hamming;
-				else
-					kernel[i] = 1.0;
-				sum += kernel[i];
-			}
-			for(unsigned i=0;i<kernelSize;++i)
-			{
-				kernel[i] /= sum;
-			}
-			OneDimensionalConvolutionBorderZero(data, dataSize, kernel, kernelSize);
-			delete[] kernel;
-		}
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/eigenvalue.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/eigenvalue.h
deleted file mode 100644
index cf0b8bc4b14175eed3b0b29f8b00c82b4144e12e..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/eigenvalue.h
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef RFI_EIGENVALUE_H
-#define RFI_EIGENVALUE_H
-
-#include <AOFlagger/msio/image2d.h>
-
-class Eigenvalue
-{
-	public:
-		static double Compute(Image2DCPtr real, Image2DCPtr imaginary);
-		static void Remove(Image2DPtr real, Image2DPtr imaginary, bool debug=false);
-};
-
-#endif // RFI_EIGENVALUE_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/fringestoppingfitter.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/fringestoppingfitter.h
deleted file mode 100644
index ed71f34e4dacecbba06f8f13e323e2a4df749b1e..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/fringestoppingfitter.h
+++ /dev/null
@@ -1,141 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef FRINGESTOPPINGFITTER_H
-#define FRINGESTOPPINGFITTER_H
-
-#include <vector>
-
-#include <AOFlagger/strategy/algorithms/surfacefitmethod.h>
-
-#include <AOFlagger/msio/samplerow.h>
-#include <AOFlagger/msio/timefrequencymetadata.h>
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class FringeStoppingFitter : public SurfaceFitMethod {
-	public:
-		FringeStoppingFitter();
-		virtual ~FringeStoppingFitter();
-
-		virtual void SetMetaData(TimeFrequencyMetaDataCPtr metaData)
-		{
-			_metaData = metaData;
-			_fieldInfo = &metaData->Field();
-			_bandInfo = &metaData->Band();
-			_antenna1Info = &metaData->Antenna1();
-			_antenna2Info = &metaData->Antenna2();
-			_observationTimes = &metaData->ObservationTimes();
-		}
-		virtual void Initialize(const TimeFrequencyData &input) throw()
-		{
-			_originalData=&input;
-			_realBackground =
-				Image2D::CreateZeroImagePtr(_originalData->ImageWidth(), _originalData->ImageHeight());
-			_imaginaryBackground =
-				Image2D::CreateZeroImagePtr(_originalData->ImageWidth(), _originalData->ImageHeight());
-			_originalMask =
-				input.GetSingleMask();
-		}
-		virtual unsigned int TaskCount()
-		{
-			return _fringeFit ? _originalData->ImageHeight() : _originalData->ImageWidth();
-		}
-		virtual void PerformFit(unsigned taskNumber);
-		virtual void PerformStaticFrequencyFitOnOneChannel(unsigned y);
-		void PerformFringeStop();
-		virtual class TimeFrequencyData Background()
-		{
-			return TimeFrequencyData(SinglePolarisation, _realBackground, _imaginaryBackground);
-		}
-		virtual enum TimeFrequencyData::PhaseRepresentation PhaseRepresentation() const
-		{
-			return TimeFrequencyData::ComplexRepresentation;
-		}
-		void SetFringesToConsider(long double fringesToConsider)
-		{
-			_fringesToConsider = fringesToConsider;
-		}
-		void SetMinWindowSize(size_t minWindowSize)
-		{
-			_minWindowSize = minWindowSize;
-		}
-		void SetMaxWindowSize(size_t maxWindowSize)
-		{
-			_maxWindowSize = maxWindowSize;
-		}
-		void SetFitChannelsIndividually(bool fitChannelsIndividually)
-		{
-			_fitChannelsIndividually = fitChannelsIndividually;
-		}
-		void SetReturnFittedValue(bool returnFittedValue)
-		{
-			_returnFittedValue = returnFittedValue;
-		}
-		void SetReturnMeanValue(bool returnMeanValue)
-		{
-			_returnMeanValue = returnMeanValue;
-		}
-		void PerformDynamicFrequencyFit();
-		void PerformDynamicFrequencyFitOnOneChannel(unsigned y);
-		void PerformDynamicFrequencyFitOnOneChannel(unsigned y, unsigned windowSize);
-		void PerformDynamicFrequencyFit(unsigned yStart, unsigned yEnd);
-		void PerformDynamicFrequencyFit(unsigned yStart, unsigned yEnd, unsigned windowSize);
-		num_t GetAmplitude(unsigned yStart, unsigned yEnd);
-		
-		numl_t NewPhaseCentreRA() const { return _newPhaseCentreRA; }
-		void SetNewPhaseCentreRA(long double newPhaseCentreRA) { _newPhaseCentreRA = newPhaseCentreRA; }
-		
-		numl_t NewPhaseCentreDec() const { return _newPhaseCentreDec; }
-		void SetNewPhaseCentreDec(long double newPhaseCentreDec) { _newPhaseCentreDec = newPhaseCentreDec; }
-		
-	private:
-		num_t CalculateFitValue(const Image2D &image, size_t y);
-		inline num_t CalculateMaskedAverage(const Image2D &image, size_t x, size_t yFrom, size_t yLength);
-		inline num_t CalculateUnmaskedAverage(const Image2D &image, size_t x, size_t yFrom, size_t yLength);
-		void CalculateFitValue(const Image2D &real, const Image2D &imaginary, size_t x, size_t yFrom, size_t yLength,num_t  &rValue, num_t &iValue);
-		num_t GetFringeFrequency(size_t x, size_t y);
-
-		void GetRFIValue(num_t &r, num_t &i, int x, int y, num_t rfiPhase, num_t rfiStrength);
-		void GetMeanValue(num_t &rMean, num_t &iMean, num_t phase, num_t amplitude, SampleRowCPtr real, SampleRowCPtr imaginary, unsigned xStart, unsigned xEnd, unsigned y);
-		void MinimizeRFIFitError(num_t &phase, num_t &amplitude, SampleRowCPtr real, SampleRowCPtr imaginary, unsigned xStart, unsigned xEnd, unsigned y) const throw();
-		
-		void PerformDynamicFrequencyFitOnOneRow(SampleRowCPtr real, SampleRowCPtr imaginary, unsigned y);
-		void PerformDynamicFrequencyFitOnOneRow(SampleRowCPtr real, SampleRowCPtr imaginary, unsigned y, unsigned windowSize);
-
-		Mask2DCPtr _originalMask;
-		const class TimeFrequencyData *_originalData;
-
-		Image2DPtr _realBackground, _imaginaryBackground;
-
-		TimeFrequencyMetaDataCPtr _metaData;
-		const class FieldInfo *_fieldInfo;
-		const class BandInfo *_bandInfo;
-		const class AntennaInfo *_antenna1Info, *_antenna2Info;
-		const std::vector<double> *_observationTimes;
-		num_t _fringesToConsider;
-		size_t _minWindowSize, _maxWindowSize;
-		bool _fitChannelsIndividually;
-		bool _returnFittedValue, _returnMeanValue;
-		bool _fringeFit;
-		numl_t _newPhaseCentreDec, _newPhaseCentreRA;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/fringetestcreater.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/fringetestcreater.h
deleted file mode 100644
index ed8d29c5aaec1ca6971cdbd75d840d817ce1941d..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/fringetestcreater.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef FRINGETESTCREATER_H
-#define FRINGETESTCREATER_H
-
-#include <AOFlagger/msio/timefrequencymetadata.h>
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class FringeTestCreater {
-	public:
-		static void AddStaticFringe(class TimeFrequencyData &ftData, TimeFrequencyMetaDataCPtr metaData, long double strength);
-	private:
-		FringeTestCreater() { }
-		~FringeTestCreater() { }
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/highpassfilter.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/highpassfilter.h
deleted file mode 100644
index 73d13024a7f75f6f145da84b05f09ff3538f6ce8..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/highpassfilter.h
+++ /dev/null
@@ -1,190 +0,0 @@
-#ifndef HIGHPASS_FILTER_H
-#define HIGHPASS_FILTER_H
-
-#include <AOFlagger/msio/image2d.h>
-#include <AOFlagger/msio/mask2d.h>
-
-/**
- * This class is able to perform a Gaussian high pass filter on an
- * Image2D . 
- */
-class HighPassFilter
-{
-	public:
-		/**
-		 * Construct a new high pass filter with default parameters
-		 */
-		HighPassFilter() :
-		_hKernel(0),
-		_hWindowSize(22),
-		_hKernelSigmaSq(7.5),
-		_vKernel(0),
-		_vWindowSize(45),
-		_vKernelSigmaSq(15.0)
-		{
-		}
-		
-		~HighPassFilter();
-		
-		/**
-		 * Apply a Gaussian high pass filter on the given image.
-		 */
-		Image2DPtr ApplyHighPass(const Image2DCPtr &image)
-		{
-			initializeKernel();
-			Image2DPtr temp = Image2D::CreateCopy(image);
-			return Image2D::CreateFromDiff(image, temp);
-		}
-		
-		/**
-		 * Apply a Gaussian high-pass filter on the given image, ignoring
-		 * flagged samples.
-		 */
-		Image2DPtr ApplyHighPass(const Image2DCPtr &image, const Mask2DCPtr &mask);
-		
-		/**
-		 * Apply a Gaussian low-pass filter on the given image, ignoring
-		 * flagged samples.
-		 */
-		Image2DPtr ApplyLowPass(const Image2DCPtr &image, const Mask2DCPtr &mask);
-		
-		/**
-		 * Set the horizontal size of the sliding window in samples. Must be odd: if the given
-		 * parameter is not odd, it will be incremented by one.
-		 */
-		void SetHWindowSize(const unsigned hWindowSize)
-		{
-			delete[] _hKernel;
-			_hKernel = 0;
-			if((hWindowSize%2) == 0)
-				_hWindowSize = hWindowSize+1;
-			else
-				_hWindowSize = hWindowSize;
-		}
-		
-		/**
-		 * Horizontal size of the sliding window in samples.
-		 * @see SetHWindowSize()
-		 */
-		unsigned HWindowSize() const
-		{
-			return _hWindowSize;
-		}
-		
-		/**
-		 * Set the vertical size of the sliding window in samples. Must be odd: if the given
-		 * parameter is not odd, it will be incremented by one.
-		 */
-		void SetVWindowSize(const unsigned vWindowSize)
-		{
-			delete[] _vKernel;
-			_vKernel = 0;
-			if((vWindowSize%2) == 0)
-				_vWindowSize = vWindowSize+1;
-			else
-				_vWindowSize = vWindowSize;
-		}
-		
-		/**
-		 * Vertical size of the sliding window in samples.
-		 * @see SetVWindowSize()
-		 */
-		unsigned VWindowSize() const
-		{
-			return _vWindowSize;
-		}
-		
-		/**
-		 * Gaussian sigma parameter defining the horizontal shape of the convolution.
-		 * Given in units of samples. Note that the window has limited size as defined by
-		 * @ref HSquareSize and @ref VSquareSize. Byond those values, the kernel is
-		 * truncated.
-		 */
-		double HKernelSigmaSq() const
-		{
-			return _hKernelSigmaSq;
-		}
-		
-		/**
-		 * Set the horizontal sigma parameter of the kernel.
-		 * @see HKernelSigma()
-		 */
-		void SetHKernelSigmaSq(double newSigmaSquared)
-		{
-			delete[] _hKernel;
-			_hKernel = 0;
-		_hKernelSigmaSq = newSigmaSquared;
-		}
-		
-		/**
-		 * Gaussian sigma parameter defining the horizontal shape of the convolution.
-		 * Given in units of samples. Note that the window has limited size as defined by
-		 * @ref HSquareSize and @ref VSquareSize. Byond those values, the kernel is
-		 * truncated.
-		 */
-		double VKernelSigmaSq() const
-		{
-			return _vKernelSigmaSq;
-		}
-		
-		/**
-		 * Set the horizontal sigma parameter of the kernel.
-		 * @see VKernelSigma()
-		 */
-		void SetVKernelSigmaSq(double newSigmaSquared)
-		{
-			delete[] _vKernel;
-			_vKernel = 0;
-			_vKernelSigmaSq = newSigmaSquared;
-		}
-	private:
-		/**
-		 * Applies the low-pass convolution. Kernel has to be initialized
-		 * before calling.
-		 */
-		void applyLowPass(const Image2DPtr &image);
-		void applyLowPassSSE(const Image2DPtr &image);
-		
-		void initializeKernel();
-		
-		void setFlaggedValuesToZeroAndMakeWeights(const Image2DCPtr &inputImage, const Image2DPtr &outputImage, const Mask2DCPtr &inputMask, const Image2DPtr &weightsOutput);
-		void setFlaggedValuesToZeroAndMakeWeightsSSE(const Image2DCPtr &inputImage, const Image2DPtr &outputImage, const Mask2DCPtr &inputMask, const Image2DPtr &weightsOutput);
-		
-		void elementWiseDivide(const Image2DPtr &leftHand, const Image2DCPtr &rightHand);
-		void elementWiseDivideSSE(const Image2DPtr &leftHand, const Image2DCPtr &rightHand);
-		
-		/**
-		 * The values of the kernel used in the convolution. This kernel is applied horizontally.
-		 */
-		num_t *_hKernel;
-		
-		/**
-		 * The horizontal size of the sliding window in samples. Must be odd.
-		 */
-		unsigned _hWindowSize;
-		
-		/**
-		 * Gaussian sigma parameter defining the horizontal shape of the convolution.
-		 * Given in units of samples (squared). Note that the window has limited size as defined by
-		 * @ref _hSquareSize and @ref _vSquareSize.
-		 */
-		double _hKernelSigmaSq;
-		
-		/**
-		 * Vertical kernel values, see @ref _hKernel.
-		 */
-		num_t *_vKernel;
-		
-		/**
-		 * The vertical size of the window, see @ref _hSquareSize.
-		 */
-		unsigned _vWindowSize;
-				
-		/**
-		 * Gaussian sigma (squared) parameter defining the  vertical shape of the convolution, see
-		 * @ref _hKernelSize.
-		 */
-		double _vKernelSigmaSq;
-};
-
-#endif // HIGHPASS_FILTER_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/imagetile.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/imagetile.h
deleted file mode 100644
index c7b7fdda1977a166cbc07e97c525359dc60c9863..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/imagetile.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef IMAGETILE_H
-#define IMAGETILE_H
-
-#include <string>
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class ImageTile {
-	public:
-	ImageTile() {	}
-
-	void InitializeData(unsigned channelCount, unsigned scanCount, unsigned channelOffset, unsigned scanOffset, const class Image2D &image, int polynomialTimeOrder, int polynomialFequencyOrder);
-	void FirstWindowGuess(long double mean, long double variance);
-	void FitBackground();
-	void AddBaseline(Image2D &dest, double sign);
-	void SetWindows(long double variance, bool convolve);
-	long double EvaluateBaselineFunction(unsigned scan, unsigned channel) const;
-	void SaveBackgroundToPng(const std::string &filename);
-	unsigned WindowCount() const;
-	void SetTrigger(long double newTrigger) throw() { _trigger = newTrigger; }
-	long double Trigger() const throw() { return _trigger; } 
-	bool IsWindowed(unsigned scanIndex, unsigned frequencyIndex) const {
-		return _isWindowed[frequencyIndex - _channelOffset][scanIndex - _scanOffset];
-	}
-	void SetWindowed(unsigned scanIndex, unsigned frequencyIndex, bool newValue) const {
-		_isWindowed[frequencyIndex - _channelOffset][scanIndex - _scanOffset] = newValue;
-	}
-
-
-private:
-	unsigned _channelCount;
-	unsigned _scanCount;
-	bool **_isWindowed;
-	unsigned _channelOffset;
-	unsigned _scanOffset;
-	long double *_baselineConsts;
-	long double _trigger;
-	const class Image2D *_image;
-	bool _useMPF;
-
-	int _freqOrder, _timeOrder;
-
-	bool TriggeredRaise(unsigned channelA, unsigned scanA, unsigned channelB, unsigned scanB, long double variance) const;
-
-	long double GetValueAt(unsigned frequencyIndex, unsigned scanIndex) const;
-	void SetValueAt(Image2D &dest, unsigned frequencyIndex, unsigned scanIndex, long double newValue);
-	void ConvolveWindows();
-	void LineThreshold(bool evaluateBaseline, long double mean, long double variance, bool convolve);
-
-	void Window(unsigned scanIndex, unsigned frequencyIndex) {
-		_isWindowed[frequencyIndex][scanIndex] = true;
-	}
-	void WindowSquare(unsigned scanIndex, unsigned frequencyIndex);
-
-	// This function calculates the sum of the squared errors when the parameters in 'x' are used. 
-	//static int BaselineFunction(const gsl_vector * x, void *data, gsl_vector * f);
-
-	// This function calculates the sum of the squared errors when the parameters in 'x' are used. 
-	//static int BaselineFunctionMPF(const gsl_vector * x, void *data, gsl_vector * f);
-
-	// This function calculates the Jacobian matrix of "BaselineFunction()".
-	//static int BaselineDerivative(const gsl_vector * x, void *data, gsl_matrix * J);
-
-	// This function calculates the Jacobian matrix of "BaselineFunction()".
-	//static int BaselineDerivativeMPF(const gsl_vector * x, void *data, gsl_matrix * J);
-
-	/*static int BaselineCombined(const gsl_vector * x, void *data, gsl_vector * f, gsl_matrix * J)
-	{
-		BaselineFunction(x, data, f);
-		BaselineDerivative(x, data, J);
-		return GSL_SUCCESS;
-		}*/
-
-	/8static int BaselineCombinedMPF(const gsl_vector * x, void *data, gsl_vector * f, gsl_matrix * J)
-	{
-		BaselineFunctionMPF(x, data, f);
-		BaselineDerivativeMPF(x, data, J);
-		return GSL_SUCCESS;
-	}*/
-
-	//void PrintState(unsigned iter, gsl_multifit_fdfsolver *solver);
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/interpolatenansalgorithm.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/interpolatenansalgorithm.h
deleted file mode 100644
index 3e54724ef492bb1c4839440a5b90b01c9b1804cf..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/interpolatenansalgorithm.h
+++ /dev/null
@@ -1,99 +0,0 @@
-#ifndef INTERPOLATENANSALGORITHM_H
-#define INTERPOLATENANSALGORITHM_H
-
-#include <AOFlagger/util/aologger.h>
-
-#include <AOFlagger/msio/image2d.h>
-#include <AOFlagger/msio/mask2d.h>
-
-class InterpolateNansAlgorithms
-{
-	public:
-		static void CountNans(Image2DCPtr image)
-		{
-			size_t count = 0;
-			for(unsigned y=0;y<image->Height();++y)
-			{
-				for(unsigned x=0;x<image->Width();++x)
-				{
-					if(!std::isfinite(image->Value(x, y)))
-					{
-						++count;
-					}
-				}
-			}
-				AOLogger::Debug << "Number of flags: " << count << '\n';
-		}
-		
-		static double distFunc(int dist)
-		{
-			//return 1.0 / pown(2.0, dist);
-			return 1.0 / dist;
-		}
-		
-		static void InterpolateFlags(Image2DPtr image, Mask2DCPtr mask)
-		{
-			for(unsigned y=0;y<image->Height();++y)
-			{
-				for(unsigned x=0;x<image->Width();++x)
-				{
-					if(mask->Value(x, y))
-					{
-						// find in each direction the first sample which is not flagged
-						num_t weightLeft = 0.0, weightRight = 0.0, weightBottom = 0.0, weightTop = 0.0;
-						num_t valueLeft = 0.0, valueRight = 0.0, valueBottom = 0.0, valueTop = 0.0;
-						
-						for(unsigned xf=x+1;xf < image->Width(); ++xf)
-						{
-							if(!mask->Value(xf, y))
-							{
-								valueRight = image->Value(xf, y);
-								weightRight = distFunc(xf - x);
-								break;
-							}
-						}
-						
-						for(int xf=x-1;xf >= 0; --xf)
-						{
-							if(!mask->Value(xf, y))
-							{
-								valueLeft = image->Value(xf, y);
-								weightLeft = distFunc(x - xf);
-								break;
-							}
-						}
-						
-						for(unsigned yf=y+1;yf < image->Height(); ++yf)
-						{
-							if(!mask->Value(x, yf))
-							{
-								valueTop = image->Value(x, yf);
-								weightTop = distFunc(yf - y);
-								break;
-							}
-						}
-						
-						for(int yf=y-1;yf >= 0; --yf)
-						{
-							if(!mask->Value(x, yf))
-							{
-								valueBottom = image->Value(x, yf);
-								weightBottom = distFunc(y - yf);
-								break;
-							}
-						}
-						
-						num_t totalWeight = weightRight + weightLeft + weightTop + weightBottom;
-						num_t totalValue =
-							valueRight * weightRight +
-							valueLeft * weightLeft+
-							valueTop * weightTop +
-							valueBottom * weightBottom;
-						image->SetValue(x, y, totalValue / totalWeight);
-					}
-				}
-			}
-		}
-};
-
-#endif // INTERPOLATENANSALGORITHM_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/localfitmethod.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/localfitmethod.h
deleted file mode 100644
index 3bca5b14134a75a13bf60e725d6698834923f9d0..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/localfitmethod.h
+++ /dev/null
@@ -1,122 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef LocalFitMethod_H
-#define LocalFitMethod_H
-
-#include <string>
-
-#include <boost/thread/mutex.hpp>
-
-#include <AOFlagger/msio/image2d.h>
-#include <AOFlagger/msio/mask2d.h>
-#include <AOFlagger/msio/timefrequencydata.h>
-
-#include <AOFlagger/strategy/algorithms/surfacefitmethod.h>
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class LocalFitMethod : public SurfaceFitMethod {
-	public:
-		enum Method { None, Average, GaussianWeightedAverage, FastGaussianWeightedAverage, Median, Minimum };
-		LocalFitMethod();
-		~LocalFitMethod();
-		void SetToAverage(unsigned hSquareSize, unsigned vSquareSize)
-		{
-			ClearWeights();
-			_hSquareSize = hSquareSize;
-			_vSquareSize = vSquareSize;
-			_method = Average;
-		}
-		void SetToWeightedAverage(unsigned hSquareSize, unsigned vSquareSize, long double hKernelSize, long double vKernelSize)
-		{
-			ClearWeights();
-			_hSquareSize = hSquareSize;
-			_vSquareSize = vSquareSize;
-			_method = FastGaussianWeightedAverage;
-			_hKernelSize = hKernelSize;
-			_vKernelSize = vKernelSize;
-		}
-		void SetToMedianFilter(unsigned hSquareSize, unsigned vSquareSize)
-		{
-			ClearWeights();
-			_hSquareSize = hSquareSize;
-			_vSquareSize = vSquareSize;
-			_method = Median;
-		}
-		void SetToMinimumFilter(unsigned hSquareSize, unsigned vSquareSize)
-		{
-			ClearWeights();
-			_hSquareSize = hSquareSize;
-			_vSquareSize = vSquareSize;
-			_method = Minimum;
-		}
-		void SetToNone()
-		{
-			ClearWeights();
-			_method = None;
-		}
-		void SetParameters(unsigned hSquareSize, unsigned vSquareSize, enum Method method)
-		{
-			ClearWeights();
-			_hSquareSize = hSquareSize;
-			_vSquareSize = vSquareSize;
-			_method = method;
-		}
-		virtual void Initialize(const TimeFrequencyData &input);
-		virtual unsigned TaskCount();
-		virtual void PerformFit(unsigned taskNumber);
-		virtual TimeFrequencyData Background() { return *_background; }
-		virtual enum TimeFrequencyData::PhaseRepresentation PhaseRepresentation() const
-		{
-			return TimeFrequencyData::AmplitudePart;
-		}
-	private:
-		struct ThreadLocal {
-			LocalFitMethod *image;
-			unsigned currentX, currentY;
-			unsigned startX, startY, endX, endY;
-			size_t emptyWindows;
-		};
-		long double CalculateBackgroundValue(unsigned x, unsigned y);
-		long double FitBackground(unsigned x, unsigned y, ThreadLocal &local);
-		long double CalculateAverage(unsigned x, unsigned y, ThreadLocal &local);
-		long double CalculateMedian(unsigned x, unsigned y, ThreadLocal &local);
-		long double CalculateMinimum(unsigned x, unsigned y, ThreadLocal &local);
-		long double CalculateWeightedAverage(unsigned x, unsigned y, ThreadLocal &local);
-		void ClearWeights();
-		void InitializeGaussianWeights();
-		void PerformGaussianConvolution(Image2DPtr input);
-		void CalculateWeightedAverageFast();
-		Image2DPtr CreateFlagWeightsMatrix();
-		void ElementWiseDivide(Image2DPtr leftHand, Image2DCPtr rightHand);
-
-		Image2DCPtr _original;
-		class TimeFrequencyData *_background;
-		Image2DPtr _background2D;
-		Mask2DCPtr _mask;
-		unsigned _hSquareSize, _vSquareSize;
-		num_t **_weights;
-		long double _hKernelSize, _vKernelSize;
-		boost::mutex _mutex;
-		enum Method _method;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/medianwindow.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/medianwindow.h
deleted file mode 100644
index 1896f2233e29576e19ed5b18594f256666c1ad50..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/medianwindow.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef MEDIANWINDOW_H
-#define MEDIANWINDOW_H
-
-#include <set>
-
-#include <AOFlagger/msio/samplerow.h>
-
-template<typename NumType>
-class MedianWindow
-{
-	public:
-		void Add(NumType newSample)
-		{
-			_set.insert(newSample);
-		}
-		void Remove(NumType sample)
-		{
-			_set.erase(_set.find(sample));
-		}
-		NumType Median() const
-		{
-			if(_set.size() == 0)
-				return std::numeric_limits<NumType>::quiet_NaN();
-			if(_set.size() % 2 == 0)
-			{
-				unsigned m = _set.size() / 2 - 1;
-				typename std::multiset<NumType>::const_iterator i = _set.begin();
-				for(unsigned j=0;j<m;++j)
-					++i;
-				NumType lMid = *i;
-				++i;
-				NumType rMid = *i;
-				return (lMid + rMid) / 2.0;
-			} else {
-				unsigned m = _set.size() / 2;
-				typename std::multiset<NumType>::const_iterator i = _set.begin();
-				for(unsigned j=0;j<m;++j)
-					++i;
-				return *i;
-			}
-		}
-		static void SubtractMedian(SampleRowPtr sampleRow, unsigned windowSize)
-		{
-			if(windowSize > sampleRow->Size()*2)
-				windowSize = sampleRow->Size()*2;
-			SampleRowCPtr copy = SampleRow::CreateCopy(sampleRow);
-			MedianWindow<num_t> window;
-			unsigned rightPtr, leftPtr = 0;
-			for(rightPtr=0;rightPtr<windowSize/2;++rightPtr)
-			{
-				if(!copy->ValueIsMissing(rightPtr))
-					window.Add(copy->Value(rightPtr));
-			}
-			for(unsigned i=0;i<sampleRow->Size();++i)
-			{
-				if(rightPtr < sampleRow->Size())
-				{
-					if(!copy->ValueIsMissing(rightPtr))
-						window.Add(copy->Value(rightPtr));
-					++rightPtr;
-				}
-				if(rightPtr >= windowSize)
-				{
-					if(!copy->ValueIsMissing(leftPtr))
-						window.Remove(copy->Value(leftPtr));
-					++leftPtr;
-				}
-				sampleRow->SetValue(i, copy->Value(i) - window.Median());
-			}
-		}
-	private:
-		std::multiset<NumType> _set;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/methoditerator.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/methoditerator.h
deleted file mode 100644
index a6e56410bb9a41e5156ffbb408fcd2619a92ba74..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/methoditerator.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef METHODTESTER_H
-#define METHODTESTER_H
-
-#include <string>
-
-#include <AOFlagger/msio/image2d.h>
-#include <AOFlagger/msio/mask2d.h>
-#include <AOFlagger/msio/timefrequencydata.h>
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class MethodIterator{
-	public:
-		MethodIterator();
-		~MethodIterator();
-	
-		void ExecuteBackgroundFit(class SurfaceFitMethod &method, unsigned threadCount);
-	
-		void IterateBackgroundFit(class SurfaceFitMethod &method, unsigned threadCount, const std::string &name, unsigned iterationCount=10);
-	
-		void OutputMethodDetails(const class SurfaceFitMethod &method, const class Stopwatch &watch, class StatWriter &statWriter);
-	
-		static void SaveFlaggingToPng(Image2DCPtr image, Mask2DCPtr mask, const std::string &filename, const class BandInfo *bandInfo, bool showFlagging=true);
-		static void SaveFlaggingToPng(Image2DCPtr image, Mask2DCPtr mask, const std::string &filename, const class BandInfo *bandInfo, bool showFlagging, bool winsorizedStretch, bool useColor);
-
-		void SetInput(const class TimeFrequencyData &input) { _input = input; }
-		void SetOriginalFlag(Mask2DCPtr flagMask) { _originalFlagging = flagMask; }
-		void SetThresholdConfig(class ThresholdConfig &config) { _thresholdConfig = &config; }
-		ThresholdConfig &Config() const throw() { return *_thresholdConfig; }
-		Mask2DCPtr GetMask() const throw() { return _mask; }
-		unsigned GetMaskOverlap(Mask2DCPtr mask1, Mask2DCPtr mask2);
-
-		void SetWriteStats(bool newValue) { _writeStats = newValue; }
-		void SetSavePNGs(bool newValue) { _savePNGs = newValue; }
-		void SetVerbose(bool newValue) { _verbose = newValue; }
-		void SetBandInfo(const BandInfo *bandInfo) { _bandInfo = bandInfo; }
-	private:
-		void ExecuteThreshold(Image2DCPtr image, Image2DCPtr background, int imageIndex, long double sensitivity);
-		void OutputStatistics(Image2DCPtr image, Mask2DCPtr mask);
-
-		class TimeFrequencyData _input;
-		Mask2DCPtr _originalFlagging;
-		Mask2DPtr _mask;
-		bool _writeStats, _savePNGs;
-		class ThresholdConfig *_thresholdConfig;
-		bool _verbose;
-		const class BandInfo *_bandInfo;
-		StatWriter *_statWriter;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/mitigationtester.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/mitigationtester.h
deleted file mode 100644
index c81698133f6846780668aef54789335d3bf2d75f..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/mitigationtester.h
+++ /dev/null
@@ -1,151 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef MITIGATIONTESTER_H
-#define MITIGATIONTESTER_H
-
-#include <cstddef>
-#include <vector>
-#include <fstream>
-
-#include <AOFlagger/msio/image2d.h>
-#include <AOFlagger/msio/mask2d.h>
-
-#include <AOFlagger/util/rng.h>
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class MitigationTester{
-	public:
-		enum NoiseType { Gaussian, GaussianProduct, GaussianPartialProduct, Rayleigh };
-		enum BroadbandShape { UniformShape, GaussianShape, SinusoidalShape, BurstShape };
-	
-		void GenerateNoise(size_t scanCount, size_t frequencyCount, bool independentComplex = false, double sigma=1.0, enum NoiseType noiseType=GaussianPartialProduct);
-		
-		static double shapeLevel(enum BroadbandShape shape, double x)
-		{
-			switch(shape)
-			{
-				default:
-				case UniformShape:
-					return 1.0;
-				case GaussianShape:
-					return exp(-x*x*3.0*3.0);
-				case SinusoidalShape:
-					return (1.0 + cos(x*M_PI*2.0*1.5)) * 0.5;
-				case BurstShape:
-					return RNG::Gaussian() * 0.6;
-			}
-		}
-
-		static class Image2D *CreateRayleighData(unsigned width, unsigned height);
-		static class Image2D *CreateGaussianData(unsigned width, unsigned height);
-		static class Image2D *CreateNoise(unsigned width, unsigned height, int gaussian)
-		{
-			if(gaussian==1)
-				return CreateGaussianData(width, height);
-			else if(gaussian==0)
-				return CreateRayleighData(width, height);
-			else
-				return Image2D::CreateZeroImage(width, height);
-		}
-
-		static void AddBroadbandLine(Image2DPtr data, Mask2DPtr rfi, double lineStrength, size_t startTime, size_t duration)
-		{
-			AddBroadbandLine(data, rfi, lineStrength, startTime, duration, 1.0);
-		}
-		static void AddBroadbandLine(Image2DPtr data, Mask2DPtr rfi, double lineStrength, size_t startTime, size_t duration, double frequencyRatio)
-		{
-			AddBroadbandLine(data, rfi, lineStrength, startTime, duration, frequencyRatio, 0.5L - frequencyRatio/2.0L);
-		}
-		static void AddBroadbandLine(Image2DPtr data, Mask2DPtr rfi, double lineStrength, size_t startTime, size_t duration, double frequencyRatio, double frequencyOffsetRatio);
-		static void AddBroadbandLinePos(Image2DPtr data, Mask2DPtr rfi, double lineStrength, size_t startTime, size_t duration, unsigned frequencyStart, double frequencyEnd, enum BroadbandShape shape);
-		static void AddSlewedBroadbandLinePos(Image2DPtr data, Mask2DPtr rfi, double lineStrength, double slewrate, size_t startTime, size_t duration, unsigned frequencyStart, double frequencyEnd, enum BroadbandShape shape);
-		static void AddRfiPos(Image2DPtr data, Mask2DPtr rfi, double lineStrength, size_t startTime, size_t duration, unsigned frequencyPos);
-
-		void AddRFI(size_t &rfiCount);
-
-		static void CountResults(Mask2DCPtr thresholdedMask, Mask2DCPtr originalRFI, size_t &correct, size_t &notfound, size_t &error);
-		void CountCorrectRFI(Image2DCPtr tresholdedReal, Image2DCPtr tresholdedImaginary, size_t &correct, size_t &notfound, size_t &error);
-
-		void SetZero();
-
-		template<typename T1,typename T2>
-		static void SaveGraph(const std::string &filename, const std::vector<T1> &x, const std::vector<T2> &y) throw();
-
-		Image2DCPtr Real() const throw() { return _real; }
-
-		Image2DCPtr Imaginary() const throw() { return _imaginary; }
-
-		static std::string GetTestSetDescription(int number);
-		static Image2DPtr CreateTestSet(int number, Mask2DPtr rfi, unsigned width, unsigned height, int gaussianNoise = 1);
-		static void AddGaussianBroadbandToTestSet(Image2DPtr image, Mask2DPtr rfi)
-		{
-			AddBroadbandToTestSet(image, rfi, 1.0, 1.0, false, GaussianShape);
-		}
-		static void AddSinusoidalBroadbandToTestSet(Image2DPtr image, Mask2DPtr rfi)
-		{
-			AddBroadbandToTestSet(image, rfi, 1.0, 1.0, false, SinusoidalShape);
-		}
-		static void AddBurstBroadbandToTestSet(Image2DPtr image, Mask2DPtr rfi)
-		{
-			AddBroadbandToTestSet(image, rfi, 1.0, 1.0, false, BurstShape);
-		}
-		static void AddSlewedGaussianBroadbandToTestSet(Image2DPtr image, Mask2DPtr rfi)
-		{
-			AddSlewedBroadbandToTestSet(image, rfi, 1.0);
-		}
-		
-	private:
-		static void AddBroadbandToTestSet(Image2DPtr image, Mask2DPtr rfi, long double length, double strength=1.0, bool align=false, enum BroadbandShape shape=UniformShape);
-		static void AddSlewedBroadbandToTestSet(Image2DPtr image, Mask2DPtr rfi, long double length, double strength=1.0, double slewrate=0.02, enum BroadbandShape shape=GaussianShape);
-		static void AddVarBroadbandToTestSet(Image2DPtr image, Mask2DPtr rfi);
-		static void AddModelData(Image2DPtr image, unsigned sources);
-		static void SubtractBackground(Image2DPtr image);
-		static Image2DPtr sampleRFIDistribution(unsigned width, unsigned height, double ig_over_rsq);
-
-		static double Rand(enum NoiseType type) {
-			switch(type) {
-				case Gaussian: return RNG::Gaussian();
-				case GaussianProduct: return RNG::GaussianProduct();
-				case GaussianPartialProduct: return RNG::GaussianPartialProduct();
-				case Rayleigh: return RNG::Rayleigh();
-			}
-			throw std::exception();
-		}
-
-		Image2DPtr _real, _imaginary;
-		void Clear();
-		
-		MitigationTester();
-		~MitigationTester();
-};
-
-template<typename T1,typename T2>
-void MitigationTester::SaveGraph(const std::string &filename, const std::vector<T1> &x, const std::vector<T2> &y) throw()
-{
-	std::ofstream file(filename.c_str());
-	for(size_t i=0;i<x.size();++i) {
-		file << i << "\t" << x[i] << "\t" << y[i] << std::endl;
-	}
-	file.close();
-}
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/morphology.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/morphology.h
deleted file mode 100644
index 9e17c2d3fb40a3bf07e62fcaa88d2781624c7659..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/morphology.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef MORPHOLOGY_H
-#define MORPHOLOGY_H
-
-#include <vector>
-#include <map>
-
-#include <AOFlagger/msio/mask2d.h>
-#include <AOFlagger/msio/segmentedimage.h>
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class Morphology {
-	public:
-		Morphology() : _hLineEnlarging(1), _vLineEnlarging(1), _hDensityEnlargeRatio(0.5), _vDensityEnlargeRatio(0.5) { }
-		~Morphology() { }
-		
-		void SegmentByMaxLength(Mask2DCPtr mask, SegmentedImagePtr output);
-		void SegmentByLengthRatio(Mask2DCPtr mask, SegmentedImagePtr output);
-		void Cluster(SegmentedImagePtr segmentedImage);
-		void RemoveSmallSegments(SegmentedImagePtr segmentedImage, size_t thresholdLevel);
-		void Classify(SegmentedImagePtr segmentedImage);
-		
-		static size_t BROADBAND_SEGMENT, LINE_SEGMENT, BLOB_SEGMENT;
-	private:
-		struct SegmentInfo
-		{
-			SegmentInfo() : segment(0), top(0), left(0), bottom(0), right(0), count(0), width(0), height(0), xTotal(0), yTotal(0), mark(false)
-			{
-			}
-
-			size_t segment;
-			size_t top, left, bottom, right;
-			size_t count;
-			size_t width, height;
-			size_t xTotal, yTotal;
-			bool mark;
-
-			void AddPoint(size_t x, size_t y)
-			{
-				if(x < left) left = x;
-				if(x >= right) right = x + 1;
-				if(y < top) top = y;
-				if(y >= bottom) bottom = y + 1;
-				xTotal += x;
-				yTotal += y;
-				++count;
-			}
-			int HorizontalDistance(const SegmentInfo &other) const
-			{
-				if(other.left > right)
-					return (int) other.left - (int) right;
-				else if(left > other.right)
-					return (int) left - (int) other.right;
-				else return 0;
-			}
-			int VerticalDistance(const SegmentInfo &other) const
-			{
-				if(other.top > bottom)
-					return (int) other.top - (int) bottom;
-				else if(top > other.bottom)
-					return (int) top - (int) other.bottom;
-				else return 0;
-			}
-			bool Contains(size_t x, size_t y) const
-			{
-				return (x >= left && x < right && y >= top && y < bottom); 
-			}
-		};
-		
-		void calculateOpenings(Mask2DCPtr mask, int **values);
-		void calculateOpenings(Mask2DCPtr mask, Mask2DPtr *values, int **hCounts, int **vCounts);
-		void calculateVerticalCounts(Mask2DCPtr mask, int **values);
-		void calculateHorizontalCounts(Mask2DCPtr mask, int **values);
-		void floodFill(Mask2DCPtr mask, SegmentedImagePtr output, const int *const *lengthWidthValues, size_t x, size_t y, size_t value);
-		void floodFill(Mask2DCPtr mask, SegmentedImagePtr output, Mask2DPtr *matrices, size_t x, size_t y, size_t z, size_t value, int **hCounts, int **vCounts);
-		std::map<size_t,SegmentInfo> createSegmentMap(SegmentedImageCPtr segmentedImage) const;
-		
-		size_t _hLineEnlarging;
-		size_t _vLineEnlarging;
-		double _hDensityEnlargeRatio, _vDensityEnlargeRatio;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/noisestatistics.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/noisestatistics.h
deleted file mode 100644
index c893b1b6e1f99c341240bbb663dcee61d5aa01de..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/noisestatistics.h
+++ /dev/null
@@ -1,224 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef NOISESTATISTICS_H
-#define NOISESTATISTICS_H
-
-#include <string>
-#include <iostream>
-#include <vector>
-#include <cmath>
-
-#include <AOFlagger/msio/types.h>
-
-class NoiseStatistics {
-	public:
-
-		typedef numl_t stat_t;
-		typedef std::vector<stat_t> Array;
-	
-		NoiseStatistics()
-		: _sum(0.0), _sum2(0.0), _sum3(0.0), _sum4(0.0), _count(0)
-		{
-		}
-		
-		NoiseStatistics(const Array &samples)
-		: _sum(0.0), _sum2(0.0), _sum3(0.0), _sum4(0.0), _count(0)
-		{
-			Add(samples);
-		}
-		
-		void Set(const Array &samples)
-		{
-			_sum = 0.0;
-			_sum2 = 0.0;
-			_sum3 = 0.0;
-			_sum4 = 0.0;
-			_count = 0;
-			Add(samples);
-		}
-		
-		void Add(const Array &samples)
-		{
-			// Calculate sum & mean
-			for(Array::const_iterator i = samples.begin(); i != samples.end(); ++i)
-			{
-				const stat_t v = *i;
-				_sum += v;
-				_sum2 += (v * v);
-				_sum3 += (v * v * v);
-				_sum4 += (v * v * v * v);
-			}
-			_count += samples.size();
-		}
-		
-		void Add(const NoiseStatistics &statistics)
-		{
-			_count += statistics._count;
-			_sum += statistics._sum;
-			_sum2 += statistics._sum2;
-			_sum3 += statistics._sum3;
-			_sum4 += statistics._sum4;
-		}
-		
-		unsigned long Count() const
-		{
-			return _count;
-		}
-		
-		void SetCount(unsigned long count)
-		{
-			_count = count;
-		}
-		
-		stat_t Sum() const
-		{
-			return _sum;
-		}
-		
-		void SetSum(stat_t sum)
-		{
-			_sum = sum;
-		}
-		
-		stat_t Sum2() const
-		{
-			return _sum2;
-		}
-		
-		void SetSum2(stat_t sum2)
-		{
-			_sum2 = sum2;
-		}
-		
-		stat_t Sum3() const
-		{
-			return _sum3;
-		}
-		
-		stat_t Sum4() const
-		{
-			return _sum4;
-		}
-		
-		stat_t Mean() const
-		{
-			if(_count == 0)
-				return 0.0;
-			else
-				return _sum / (numl_t) _count;
-		}
-		
-		stat_t StdDevEstimator() const
-		{
-			return std::sqrt(VarianceEstimator());
-		}
-		
-		stat_t VarianceEstimator() const
-		{
-			if(_count <= 1)
-				return 0.0;
-			else
-			{
-				const stat_t n = _count;
-				const stat_t sumMeanSquared = (_sum * _sum) / n;
-				return (_sum2 + sumMeanSquared - (_sum * 2.0 * _sum / n)) / (n-1.0);
-			}
-		}
-		
-		stat_t SecondMoment() const
-		{
-			if(_count == 0)
-				return 0.0;
-			else
-			{
-				const stat_t n = _count;
-				const stat_t sumMeanSquared = (_sum * _sum) / n;
-				return (_sum2 + sumMeanSquared - (_sum * 2.0 * _sum / n)) / n;
-			}
-		}
-		
-		stat_t FourthMoment() const
-		{
-			if(_count == 0)
-				return 0.0;
-			else
-			{
-				const stat_t
-					n = _count,
-					mean = _sum / n,
-					mean2 = mean * mean;
-				return (_sum4
-					- 4.0 * (_sum3 * mean + _sum * mean2 * mean)
-					+ 6.0 * _sum2 * mean2) / n
-					+ mean2 * mean2;
-			}
-		}
-		
-		stat_t VarianceOfVarianceEstimator() const
-		{
-			const long double n = _count;
-			if(n <= 1)
-				return 0.0;
-			else
-			{
-				const long double moment2 = SecondMoment();
-				return ( FourthMoment() - moment2 * moment2 * (n-3.0)/(n-1.0) ) / n;
-			}
-		}
-		
-		static unsigned WriteColumnCount() { return 8; }
-		static unsigned VarianceColumn() { return 6; }
-		
-		static void WriteHeaders(const std::string &headerPrefix, std::ostream &stream)
-		{
-			stream <<
-				headerPrefix << "Count\t" << headerPrefix << "Sum\t" << headerPrefix << "Sum2\t" <<
-				headerPrefix << "Sum3\t" << headerPrefix << "Sum4\t" <<
-				headerPrefix << "Mean\t" << headerPrefix << "Variance\t" <<
-				headerPrefix << "VarianceOfVariance";
-		}
-		
-		void WriteValues(std::ostream &stream) const
-		{
-			stream
-				<< _count << '\t'
-				<< _sum << '\t'
-				<< _sum2 << '\t'
-				<< _sum3 << '\t'
-				<< _sum4 << '\t'
-				<< Mean() << '\t'
-				<< VarianceEstimator() << '\t'
-				<< VarianceOfVarianceEstimator();
-		}
-		
-		void ReadValues(std::istream &stream)
-		{
-			stat_t tmp;
-			stream >> _count >> _sum >> _sum2 >> _sum3 >> _sum4 >> tmp >> tmp >> tmp;
-		}
-	private:
-		stat_t _sum;
-		stat_t _sum2;
-		stat_t _sum3;
-		stat_t _sum4;
-		unsigned long _count;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/noisestatisticscollector.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/noisestatisticscollector.h
deleted file mode 100644
index 7bdf166fb0b9a806786c94deec3e4e895dbddef1..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/noisestatisticscollector.h
+++ /dev/null
@@ -1,381 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef NOISESTATISTICSCOLLECTOR_H
-#define NOISESTATISTICSCOLLECTOR_H
-
-#include <cstring>
-#include <map>
-#include <set>
-#include <complex>
-#include <fstream>
-#include <iomanip>
-
-#include <AOFlagger/msio/image2d.h>
-#include <AOFlagger/msio/timefrequencymetadata.h>
-#include <AOFlagger/msio/mask2d.h>
-
-#include <AOFlagger/strategy/algorithms/cnoisestatistics.h>
-#include <AOFlagger/strategy/algorithms/noisestatistics.h>
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class NoiseStatisticsCollector {
-	public:
-		typedef std::pair<double, double> TFIndex;
-		typedef std::pair<double, unsigned> TAIndex;
-		typedef std::pair<double, std::pair<unsigned, unsigned> > TBIndex;
-		typedef std::map<TFIndex, CNoiseStatistics> StatTFMap;
-		typedef std::map<TBIndex, CNoiseStatistics> StatTBMap;
-		
-		NoiseStatisticsCollector()
-		: _channelDistance(1), _tileWidth(200), _tileHeight(16)
-		{
-		}
-		
-		unsigned ChannelDistance() const { return _channelDistance; }
-		void SetChannelDistance(unsigned channelDistance) { _channelDistance = channelDistance; }
-		
-		unsigned TileWidth() const { return _tileWidth; }
-		void SetTileWidth(unsigned tileWidth) { _tileWidth = tileWidth; }
-		
-		unsigned TileHeight() const { return _tileHeight; }
-		void SetTileHeight(unsigned tileHeight) { _tileHeight = tileHeight; }
-		
-		bool Empty() const
-		{
-			return _valuesTB.empty() && _valuesTF.empty();
-		}
-		
-		void Add(Image2DCPtr real, Image2DCPtr imaginary, Mask2DCPtr mask, TimeFrequencyMetaDataCPtr metaData)
-		{
-			Image2DCPtr
-				realDiff = subtractChannels(real, _channelDistance),
-				imagDiff = subtractChannels(imaginary, _channelDistance);
-			Mask2DCPtr
-				maskDiff = createMaskForSubtracted(mask, _channelDistance);
-			
-			// The number of tiles per dimension is ceil(imageWidth / tileWidth):
-			const unsigned
-				tileXCount = (realDiff->Width() + _tileWidth - 1) / _tileWidth,
-				tileYCount = (realDiff->Height() + _tileHeight - 1) / _tileHeight;
-			
-			for(unsigned y=0;y<tileYCount;++y)
-			{
-				for(unsigned x=0;x<tileXCount;++x)
-				{
-					const unsigned
-						timeStart = realDiff->Width() * x / tileXCount,
-						timeEnd = realDiff->Width() * (x + 1) / tileXCount,
-						freqStart = realDiff->Height() * y / tileYCount,
-						freqEnd = realDiff->Height() * (y + 1) / tileYCount;
-					add(realDiff, imagDiff, mask, metaData, timeStart, timeEnd, freqStart, freqEnd);
-				}
-			}
-		}
-		
-		void SaveTF(const std::string &filename)
-		{
-			std::ofstream file(filename.c_str());
-			file
-				<< "CentralTime\tCentralFrequency\t";
-			NoiseStatistics::WriteHeaders("Real", file);
-			file << '\t';
-			NoiseStatistics::WriteHeaders("Imag", file);
-			file << '\n' << std::setprecision(14);
-			
-			for(StatTFMap::const_iterator i=_valuesTF.begin();i!=_valuesTF.end();++i)
-			{
-				const double
-					centralTime = i->first.first,
-					centralFrequency = i->first.second;
-				const NoiseStatistics
-					&realStat = i->second.real,
-					&imaginaryStat = i->second.imaginary;
-				file << centralTime << '\t' << centralFrequency << '\t';
-				realStat.WriteValues(file);
-				file << '\t';
-				imaginaryStat.WriteValues(file);
-				file << '\n';
-			}
-		}
-		
-		void SaveTA(const std::string &filename)
-		{
-			std::ofstream file(filename.c_str());
-			file <<
-				"CentralTime\tAntenna1\tAntenna2\t";
-			NoiseStatistics::WriteHeaders("Real", file);
-			file << '\t';
-			NoiseStatistics::WriteHeaders("Imag", file);
-			file << '\n' << std::setprecision(14);
-			
-			for(StatTBMap::const_iterator i=_valuesTB.begin();i!=_valuesTB.end();++i)
-			{
-				const double
-					centralTime = i->first.first;
-				const unsigned
-					antenna1 = i->first.second.first,
-					antenna2 = i->first.second.second;
-				const NoiseStatistics
-					&realStat = i->second.real,
-					&imaginaryStat = i->second.imaginary;
-				file << centralTime << '\t' << antenna1 << '\t' << antenna2 << '\t';
-				realStat.WriteValues(file);
-				file << '\t';
-				imaginaryStat.WriteValues(file);
-				file << '\n';
-			}
-		}
-		
-		void ReadTF(const std::string &filename)
-		{
-			std::ifstream file(filename.c_str());
-			std::string headers;
-			std::getline(file, headers);
-			
-			while(file.good())
-			{
-				double centralTime, centralFrequency;
-				CNoiseStatistics statistics;
-				file >> centralTime;
-				if(file.eof()) break;
-				file >> centralFrequency;
-				statistics.real.ReadValues(file);
-				statistics.imaginary.ReadValues(file);
-				
-				TFIndex index = TFIndex(centralTime, centralFrequency);
-				add(_valuesTF, index, statistics);
-			}
-		}
-		
-		void ReadTA(const std::string &filename)
-		{
-			std::ifstream file(filename.c_str());
-			std::string headers;
-			std::getline(file, headers);
-			
-			while(file.good())
-			{
-				double centralTime;
-				std::pair<unsigned, unsigned> baseline;
-				CNoiseStatistics statistics;
-				file >> centralTime;
-				if(file.eof()) break;
-				file >> baseline.first >> baseline.second;
-				statistics.real.ReadValues(file);
-				statistics.imaginary.ReadValues(file);
-				
-				TBIndex index = TBIndex(centralTime, baseline);
-				add(_valuesTB, index, statistics);
-			}
-		}
-		
-		void SaveTimeAntennaPlot(const std::string &dataName, const std::string &plotName)
-		{
-			std::map<TAIndex, CNoiseStatistics> taValues;
-			unsigned antennaCount = 0;
-			for(StatTBMap::const_iterator i=_valuesTB.begin();i!=_valuesTB.end();++i)
-			{
-				double time = i->first.first;
-				unsigned antenna1 = i->first.second.first;
-				unsigned antenna2 = i->first.second.second;
-				TAIndex index;
-				
-				index = TAIndex(time, antenna1);
-				add(taValues, index, i->second);
-				
-				index = TAIndex(time, antenna2);
-				add(taValues, index, i->second);
-				
-				if(antenna1 >= antennaCount)
-					antennaCount = antenna1 + 1;
-				if(antenna2 >= antennaCount)
-					antennaCount = antenna2 + 1;
-			}
-
-			std::ofstream dataFile(dataName.c_str());
-
-			// Write the headers
-			dataFile <<
-				"CentralTime";
-			for(unsigned i=0;i<antennaCount;++i)
-			{
-				std::stringstream realStr, imagStr;
-				dataFile << '\t';
-				realStr << "Real" << i;
-				NoiseStatistics::WriteHeaders(realStr.str(), dataFile);
-				dataFile << '\t';
-				imagStr << "Imag" << i;
-				NoiseStatistics::WriteHeaders(imagStr.str(), dataFile);
-			}
-			dataFile << std::setprecision(14);
-			
-			double centralTime = 0.0;
-			for(std::map<TAIndex, CNoiseStatistics>::const_iterator i=taValues.begin();
-				i!=taValues.end();++i)
-			{
-				if(centralTime != i->first.first)
-				{
-					centralTime = i->first.first;
-					dataFile << '\n' << centralTime;
-				}
-				const NoiseStatistics
-					&realStat = i->second.real,
-					&imaginaryStat = i->second.imaginary;
-				if(realStat.Count() > 0 && imaginaryStat.Count() > 0)
-				{
-					dataFile << '\t' ;
-					realStat.WriteValues(dataFile);
-					dataFile << '\t';
-					imaginaryStat.WriteValues(dataFile);
-				} else {
-					for(unsigned i=0;i<2 * NoiseStatistics::WriteColumnCount();++i)
-					{
-						dataFile << "\t?";
-					}
-				}
-			}
-			dataFile << '\n';
-			const unsigned
-				columnsPerAntenna = NoiseStatistics::WriteColumnCount(),
-				varianceColumn = NoiseStatistics::VarianceColumn();
-			
-			std::ofstream stationTimePlot(plotName.c_str());
-			double
-				startTime = taValues.begin()->first.first,
-				endTime = taValues.rbegin()->first.first;
-			stationTimePlot << std::setprecision(14) <<
-				"set term postscript enhanced color font \"Helvetica,12\"\n"
-				"set title \"Noise statistics over time and station\"\n"
-				"set xlabel \"Time (hrs)\"\n"
-				"set ylabel \"Variance\"\n"
-				"set output \"StationsTime-Var.ps\"\n"
-				"set key inside top\n"
-				"set log y\n"
-				"set xrange [" << 0 << ":" << ((endTime-startTime)/(60.0*60.0)) << "]\n"
-				"plot \\\n";
-			std::stringstream timeAxisStr;
-			timeAxisStr << std::setprecision(14) << "((column(1)-" << startTime << ")/(60.0*60.0))";
-			const std::string timeAxis = timeAxisStr.str();
-			for(unsigned x=0;x<antennaCount;++x)
-			{
-				if(x != 0)
-					stationTimePlot << ", \\\n";
-				stationTimePlot
-				<< "\"" << dataName << "\" using "
-				<< timeAxis
-				<< ":((column(" << ((2*x)*columnsPerAntenna+varianceColumn + 2)
-				<< ") + column(" << ((2*x+1)*columnsPerAntenna+varianceColumn + 2)
-				<< "))/2) title \"Station " << x << "\" with lines lw 2";
-			}
-			stationTimePlot << '\n';
-		}
-		
-		const StatTFMap &TBMap() const { return _valuesTF; }
-	private:
-		void add(Image2DCPtr real, Image2DCPtr imaginary, Mask2DCPtr mask, TimeFrequencyMetaDataCPtr metaData, unsigned timeStart, unsigned timeEnd, unsigned freqStart, unsigned freqEnd)
-		{
-			NoiseStatistics::Array realValues, imagValues;
-			
-			for(unsigned y=freqStart;y<freqEnd;++y)
-			{
-				for(unsigned x=timeStart;x<timeEnd;++x)
-				{
-					if(!mask->Value(x, y))
-					{
-						realValues.push_back(real->Value(x, y));
-						imagValues.push_back(imaginary->Value(x, y));
-					}
-				}
-			}
-			const CNoiseStatistics statistics(realValues, imagValues);
-			const std::vector<ChannelInfo> &channels = metaData->Band().channels;
-			const double
-				centralTime = (metaData->ObservationTimes()[timeStart] +
-					metaData->ObservationTimes()[timeEnd-1]) * 0.5,
-				centralFrequency = (channels[freqStart].frequencyHz + channels[freqEnd-1].frequencyHz) * 0.5;
-				
-			const TFIndex tfIndex = TFIndex(centralTime, centralFrequency);
-			add(_valuesTF, tfIndex, statistics);
-			
-			size_t a1, a2;
-			if(metaData->HasAntenna1())
-				a1 = metaData->Antenna1().id;
-			else
-				a1 = 0;
-			if(metaData->HasAntenna2())
-				a2 = metaData->Antenna2().id;
-			else
-				a2 = 0;
-			
-			const TBIndex tbIndex = TBIndex(centralTime, std::pair<unsigned, unsigned>(a1, a2));
-			add(_valuesTB, tbIndex, statistics);
-		}
-		
-		template<typename IndexType>
-		void add(std::map<IndexType, CNoiseStatistics> &map, const IndexType &index, const CNoiseStatistics &statistics)
-		{
-			typename std::map<IndexType, CNoiseStatistics>::iterator i = map.find(index);
-			if(i == map.end())
-			{
-				map.insert(std::pair<IndexType, CNoiseStatistics>(index, statistics));
-			} else {
-				i->second += statistics;
-			}
-		}
-		
-		Image2DPtr subtractChannels(Image2DCPtr image, unsigned channelDistance=1) const
-		{
-			Image2DPtr
-				subtracted = Image2D::CreateUnsetImagePtr(image->Width(), image->Height() - channelDistance);
-			
-			for(unsigned y=0;y<subtracted->Height();++y)
-			{
-				for(unsigned x=0;x<subtracted->Width();++x)
-				{
-					subtracted->SetValue(x, y, image->Value(x, y) - image->Value(x, y + channelDistance));
-				}
-			}
-			return subtracted;
-		}
-		
-		Mask2DPtr createMaskForSubtracted(Mask2DCPtr mask, unsigned channelDistance=1) const
-		{
-			Mask2DPtr
-				subMask = Mask2D::CreateUnsetMaskPtr(mask->Width(), mask->Height() - channelDistance);
-			
-			for(unsigned y=0;y<subMask->Height();++y)
-			{
-				for(unsigned x=0;x<subMask->Width();++x)
-				{
-					subMask->SetValue(x, y, mask->Value(x, y) || mask->Value(x, y + channelDistance));
-				}
-			}
-			return subMask;
-		}
-		
-		StatTFMap _valuesTF;
-		StatTBMap _valuesTB;
-		unsigned _channelDistance;
-		unsigned _tileWidth, _tileHeight;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/polarizationstatistics.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/polarizationstatistics.h
deleted file mode 100644
index 5b858e1ec993cf4c373d09a3aa1b2b6a0c32819c..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/polarizationstatistics.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef POLARIZATIONSTATISTICS_H
-#define POLARIZATIONSTATISTICS_H
-
-#include <vector>
-#include <stdexcept>
-#include <string>
-#include <sstream>
-
-#include <AOFlagger/msio/mask2d.h>
-#include <AOFlagger/msio/timefrequencydata.h>
-#include <AOFlagger/msio/timefrequencymetadata.h>
-
-#include <AOFlagger/util/aologger.h>
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class PolarizationStatistics {
-	public:
-		PolarizationStatistics() { }
-		~PolarizationStatistics() { }
-
-		void Add(class TimeFrequencyData &data)
-		{
-			unsigned polarizationCount = data.PolarisationCount();
-			if(_flaggedCounts.size() == 0)
-			{
-				_polarizationType = data.Polarisation();
-				for(unsigned i=0;i<polarizationCount;++i)
-				{
-					_flaggedCounts.push_back(0);
-					_totalCounts.push_back(0);
-					TimeFrequencyData *polData = data.CreateTFDataFromPolarisationIndex(i);
-					_names.push_back(TimeFrequencyData::GetPolarisationName(polData->Polarisation()));
-					delete polData;
-				}
-			} else if(_polarizationType != data.Polarisation())
-			{
-				throw std::runtime_error("Adding differently polarized data to statistics");
-			}
-			for(unsigned i=0;i<polarizationCount;++i)
-			{
-				TimeFrequencyData *polData = data.CreateTFDataFromPolarisationIndex(i);
-				Mask2DCPtr mask = polData->GetSingleMask();
-				delete polData;
-				_flaggedCounts[i] += mask->GetCount<true>();
-				_totalCounts[i] += mask->Width() * mask->Height();
-			}
-		}
-		bool HasData() { return !_flaggedCounts.empty(); }
-		void Report()
-		{
-			AOLogger::Info
-				<< "Polarization statistics: ";
-			for(unsigned i=0;i<_flaggedCounts.size();++i)
-			{
-				numl_t percentage = (numl_t) _flaggedCounts[i] * 100.0 / (numl_t) _totalCounts[i];
-				if(i!=0)
-					AOLogger::Info << ", ";
-				AOLogger::Info
-					<< _names[i] << ": " << formatPercentage(percentage) << '%';
-			}
-			AOLogger::Info << '\n';
-		}
-	private:
-		std::string formatPercentage(numl_t percentage)
-		{
-			std::ostringstream s;
-			if(percentage >= 1.0)
-				s << round(percentage*10.0)/10.0;
-			else if(percentage >= 0.1)
-				s << round(percentage*100.0)/100.0;
-			else
-				s << round(percentage*1000.0)/1000.0;
-			return s.str();
-		}
-
-		std::vector<long unsigned> _flaggedCounts, _totalCounts;
-		std::vector<std::string> _names;
-		enum PolarisationType _polarizationType;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/polfitmethod.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/polfitmethod.h
deleted file mode 100644
index ce81ec2dc5a5e0670decdd34ea4d17f6db1f2bea..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/polfitmethod.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef PolFitMethod_H
-#define PolFitMethod_H
-
-// This file is ORPHAN: it is not used or referenced, because it implements
-// a method which is not used, and I wanted to remove the GSL dependence.
-
-#include <gsl/gsl_vector.h>
-#include <gsl/gsl_matrix.h>
-#include <gsl/gsl_multifit_nlin.h>
-
-#include <AOFlagger/msio/image2d.h>
-#include <AOFlagger/msio/mask2d.h>
-#include <AOFlagger/msio/timefrequencydata.h>
-
-#include <AOFlagger/strategy/algorithms/surfacefitmethod.h>
-
-class PolFitMethod : public SurfaceFitMethod {
-	public:
-		enum Method { None, LeastSquare, LeastAbs };
-		PolFitMethod();
-		~PolFitMethod();
-		virtual void Initialize(const TimeFrequencyData &input);
-		virtual unsigned TaskCount();
-		virtual void PerformFit(unsigned taskNumber);
-		virtual TimeFrequencyData Background() { return *_background; }
-		virtual enum TimeFrequencyData::PhaseRepresentation PhaseRepresentation() const
-		{
-			return TimeFrequencyData::AmplitudePart;
-		}
-	private:
-		long double Evaluate(unsigned x, unsigned y, long double *coefficients);
-		static int SquareError(const gsl_vector * coefs, void *data, gsl_vector * f);
-		static int SquareErrorDiff(const gsl_vector * x, void *data, gsl_matrix * J);
-		static int SquareErrorComb(const gsl_vector * x, void *data, gsl_vector * f, gsl_matrix * J)
-		{
-			SquareError(x, data, f);
-			SquareErrorDiff(x, data, J);
-			return GSL_SUCCESS;
-		}
-		static int LinError(const gsl_vector * coefs, void *data, gsl_vector * f);
-		static int LinErrorDiff(const gsl_vector * x, void *data, gsl_matrix * J);
-		static int LinErrorComb(const gsl_vector * x, void *data, gsl_vector * f, gsl_matrix * J)
-		{
-			LinError(x, data, f);
-			LinErrorDiff(x, data, J);
-			return GSL_SUCCESS;
-		}
-		long double CalculateBackgroundValue(unsigned x, unsigned y);
-		long double FitBackground(unsigned x, unsigned y, ThreadLocal &local);
-
-		Image2DCPtr _original;
-		class TimeFrequencyData *_background;
-		Image2DPtr _background2D;
-		Mask2DCPtr _mask;
-		unsigned _hSquareSize, _vSquareSize;
-		long double _precision;
-		long double *_previousCoefficients;
-		long double _hKernelSize, _vKernelSize;
-		enum Method _method;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/rfistatistics.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/rfistatistics.h
deleted file mode 100644
index 8d7f6acab86a7f64a7871435da3c9149951bcd6e..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/rfistatistics.h
+++ /dev/null
@@ -1,591 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef RFISTATISTICS_H
-#define RFISTATISTICS_H
-
-#include <cstring>
-#include <map>
-#include <set>
-
-#include <boost/thread/mutex.hpp>
-
-#include <AOFlagger/msio/image2d.h>
-#include <AOFlagger/msio/timefrequencydata.h>
-#include <AOFlagger/msio/timefrequencymetadata.h>
-#include <AOFlagger/msio/mask2d.h>
-#include <AOFlagger/msio/segmentedimage.h>
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class RFIStatistics {
-	public:
-		class ChannelInfo {
-                public:
-			ChannelInfo() : frequencyHz(0), totalCount(0), totalAmplitude(0.0), rfiCount(0), rfiAmplitude(0.0), broadbandRfiCount(0), lineRfiCount(0), broadbandRfiAmplitude(0.0), lineRfiAmplitude(0.0), falsePositiveCount(0), falseNegativeCount(0), truePositiveCount(0), trueNegativeCount(0), falsePositiveAmplitude(0), falseNegativeAmplitude(0)
-			{
-			}
-			ChannelInfo(double _frequencyHz) : frequencyHz(_frequencyHz), totalCount(0), totalAmplitude(0.0), rfiCount(0), rfiAmplitude(0.0), broadbandRfiCount(0), lineRfiCount(0), broadbandRfiAmplitude(0.0), lineRfiAmplitude(0.0), falsePositiveCount(0), falseNegativeCount(0), truePositiveCount(0), trueNegativeCount(0), falsePositiveAmplitude(0), falseNegativeAmplitude(0)
-			{
-			}
-			double frequencyHz;
-			long unsigned totalCount;
-			long double totalAmplitude;
-			long unsigned rfiCount;
-			long double rfiAmplitude;
-			long unsigned broadbandRfiCount;
-			long unsigned lineRfiCount;
-			long double broadbandRfiAmplitude;
-			long double lineRfiAmplitude;
-			long unsigned falsePositiveCount;
-			long unsigned falseNegativeCount;
-			long unsigned truePositiveCount;
-			long unsigned trueNegativeCount;
-			long double falsePositiveAmplitude;
-			long double falseNegativeAmplitude;
-		};
-		class TimestepInfo {
-                public:
-			TimestepInfo() : time(0), totalCount(0), totalAmplitude(0.0), rfiCount(0), broadbandRfiCount(0), lineRfiCount(0), rfiAmplitude(0.0), broadbandRfiAmplitude(0.0), lineRfiAmplitude(0.0)
-			{
-			}
-			TimestepInfo(double _time) : time(_time), totalCount(0), totalAmplitude(0.0), rfiCount(0), broadbandRfiCount(0), lineRfiCount(0), rfiAmplitude(0.0), broadbandRfiAmplitude(0.0), lineRfiAmplitude(0.0)
-			{
-			}
-			double time;
-			long unsigned totalCount;
-			long double totalAmplitude;
-			long unsigned rfiCount;
-			long unsigned broadbandRfiCount;
-			long unsigned lineRfiCount;
-			long double rfiAmplitude;
-			long double broadbandRfiAmplitude;
-			long double lineRfiAmplitude;
-		};
-		class AmplitudeBin {
-                public:
-			AmplitudeBin() : centralAmplitude(0.0), count(0), rfiCount(0), broadbandRfiCount(0), lineRfiCount(0), featureAvgCount(0), featureMaxCount(0), featureIntCount(0), xxCount(0), xyCount(0), yxCount(0), yyCount(0), xxRfiCount(0), xyRfiCount(0), yxRfiCount(0), yyRfiCount(0), stokesQCount(0), stokesUCount(0), stokesVCount(0), falsePositiveCount(0), falseNegativeCount(0), truePositiveCount(0), trueNegativeCount(0)
-			{
-			}
-			double centralAmplitude;
-			long unsigned count;
-			long unsigned rfiCount;
-			long unsigned broadbandRfiCount;
-			long unsigned lineRfiCount;
-			long unsigned featureAvgCount;
-			long unsigned featureMaxCount;
-			long unsigned featureIntCount;
-			long unsigned xxCount;
-			long unsigned xyCount;
-			long unsigned yxCount;
-			long unsigned yyCount;
-			long unsigned xxRfiCount;
-			long unsigned xyRfiCount;
-			long unsigned yxRfiCount;
-			long unsigned yyRfiCount;
-			long unsigned stokesQCount;
-			long unsigned stokesUCount;
-			long unsigned stokesVCount;
-			long unsigned falsePositiveCount;
-			long unsigned falseNegativeCount;
-			long unsigned truePositiveCount;
-			long unsigned trueNegativeCount;
-		};
-
-		class IndexTriple
-		{
-                public:
-			IndexTriple() :
-			antenna1Index(0), antenna2Index(0), thirdIndex(0)
-			{
-			}
-			bool operator<(const IndexTriple &rhs) const
-			{
-				if(thirdIndex == rhs.thirdIndex)
-				{
-					if(antenna1Index == rhs.antenna1Index)
-					{
-						return antenna2Index < rhs.antenna2Index;
-					}
-					else return antenna1Index < rhs.antenna1Index;
-				}
-				else return thirdIndex < rhs.thirdIndex;
-			}
-			bool operator==(const IndexTriple &rhs) const
-			{
-				return thirdIndex == rhs.thirdIndex && antenna1Index == rhs.antenna1Index && antenna2Index == rhs.antenna2Index;
-			}
-			
-			unsigned antenna1Index, antenna2Index;
-			double thirdIndex;
-		};
-
-		class BaselineTimeInfo
-		{
-                public:
-			BaselineTimeInfo() :
-			antenna1Index(0), antenna2Index(0),
-				time(0), totalCount(0), rfiCount(0)
-			{
-			}
-			unsigned antenna1Index, antenna2Index;
-			double time;
-			long unsigned totalCount;
-			long unsigned rfiCount;
-		};
-		
-		class BaselineFrequencyInfo
-		{
-                public:
-		BaselineFrequencyInfo() :
-			antenna1Index(0), antenna2Index(0),
-				centralFrequency(0), totalCount(0),
-				rfiCount(0)
-			{
-			}
-			unsigned antenna1Index, antenna2Index;
-			double centralFrequency;
-			long unsigned totalCount;
-			long unsigned rfiCount;
-		};
-		
-		class TimeFrequencyInfo
-		{
-                public:
-			TimeFrequencyInfo() :
-				time(0.0), centralFrequency(0.0),
-				totalCount(0), rfiCount(0),
-				totalAmplitude(0.0), rfiAmplitude(0.0)
-			{ }
-			double time;
-			double centralFrequency;
-			long unsigned totalCount;
-			long unsigned rfiCount;
-			double totalAmplitude;
-			double rfiAmplitude;
-		};
-
-		class BaselineInfo {
-                public:
-			BaselineInfo() : antenna1(0), antenna2(0), antenna1Name(), antenna2Name(), baselineLength(0.0), baselineAngle(0.0), count(0), totalAmplitude(0.0), rfiCount(0), broadbandRfiCount(0), lineRfiCount(0), rfiAmplitude(0.0), broadbandRfiAmplitude(0.0), lineRfiAmplitude(0.0), baselineStatistics(0)
-			{
-			}
-			BaselineInfo(const BaselineInfo &source) : antenna1(source.antenna1), antenna2(source.antenna2), antenna1Name(source.antenna1Name), antenna2Name(source.antenna2Name), baselineLength(source.baselineLength), baselineAngle(source.baselineAngle), count(source.count), totalAmplitude(source.totalAmplitude), rfiCount(source.rfiCount), broadbandRfiCount(source.broadbandRfiCount), lineRfiCount(source.lineRfiCount), rfiAmplitude(source.rfiAmplitude), broadbandRfiAmplitude(source.broadbandRfiAmplitude), lineRfiAmplitude(source.lineRfiAmplitude), baselineStatistics(source.baselineStatistics)
-			{
-			}
-			void operator=(const BaselineInfo &rhs)
-			{
-				antenna1 = rhs.antenna1;
-				antenna2 = rhs.antenna2;
-				antenna1Name = rhs.antenna1Name;
-				antenna2Name = rhs.antenna2Name;
-				baselineLength = rhs.baselineLength;
-				baselineAngle = rhs.baselineAngle;
-				count = rhs.count;
-				totalAmplitude = rhs.totalAmplitude;
-				rfiCount = rhs.rfiCount;
-				broadbandRfiCount = rhs.broadbandRfiCount;
-				lineRfiCount = rhs.lineRfiCount;
-				rfiAmplitude = rhs.rfiAmplitude;
-				broadbandRfiAmplitude = rhs.broadbandRfiAmplitude;
-				lineRfiAmplitude = rhs.lineRfiAmplitude;
-				baselineStatistics = rhs.baselineStatistics;
-			}
-			bool operator<(const BaselineInfo &rhs) const
-			{
-				return baselineLength < rhs.baselineLength;
-			}
-
-			int antenna1, antenna2;
-			std::string antenna1Name, antenna2Name;
-			double baselineLength;
-			double baselineAngle;
-			long unsigned count;
-			double totalAmplitude;
-			long unsigned rfiCount;
-			long unsigned broadbandRfiCount;
-			long unsigned lineRfiCount;
-			long double rfiAmplitude;
-			long double broadbandRfiAmplitude;
-			long double lineRfiAmplitude;
-			RFIStatistics *baselineStatistics;
-		};
-
-		RFIStatistics() : _separateBaselineStatistics(false), _compareFlags(false), _polarizationAmplitudeStatistics(false), _filePrefix(""), _channelCountPerSubband(256), _ignoreFirstChannel(true), _performClassification(true), _writeImmediately(false) { }
-		~RFIStatistics() { }
-		
-		void Add(const TimeFrequencyData &data, TimeFrequencyMetaDataCPtr metaData);
-		void Add(const TimeFrequencyData &data, TimeFrequencyMetaDataCPtr metaData, Mask2DCPtr groundTruthFlagging)
-		{
-			Add(data, metaData);
-			if(metaData->Antenna1().id == metaData->Antenna2().id) {
-				boost::mutex::scoped_lock freqLock(_frequencyMapMutex);
-				addChannelComparison(_autoChannels, data, metaData, groundTruthFlagging);
-				saveChannels(_autoChannels, _filePrefix + "counts-channels-auto.txt");
-				freqLock.unlock();
-				
-				boost::mutex::scoped_lock genLock(_genericMutex);
-				addAmplitudeComparison(_autoAmplitudes, data, metaData, groundTruthFlagging);
-				saveAmplitudes(_autoAmplitudes, _filePrefix + "counts-amplitudes-auto.txt");
-				genLock.unlock();
-			} else {
-				boost::mutex::scoped_lock freqLock(_frequencyMapMutex);
-				addChannelComparison(_crossChannels, data, metaData, groundTruthFlagging);
-				saveChannels(_crossChannels, _filePrefix + "counts-channels-cross.txt");
-				freqLock.unlock();
-
-				boost::mutex::scoped_lock genLock(_genericMutex);
-				addAmplitudeComparison(_crossAmplitudes, data, metaData, groundTruthFlagging);
-				saveAmplitudes(_crossAmplitudes, _filePrefix + "counts-amplitudes-cross.txt");
-				genLock.unlock();
-			}
-		}
-		void Add(const ChannelInfo &channel, bool autocorrelation);
-		void Add(const TimestepInfo &timestep, bool autocorrelation);
-		void Add(const AmplitudeBin &amplitudeBin, bool autocorrelation);
-		void Add(const BaselineInfo &baseline);
-		void Add(const BaselineFrequencyInfo &entry);
-		void Add(const BaselineTimeInfo &entry);
-		void Add(const TimeFrequencyInfo &entry, bool autocorrelation);
-
-		static long double FitScore(const Image2D &image, const Image2D &fit, Mask2DCPtr mask);
-		static long double FitScore(Image2DCPtr image, Image2DCPtr fit, Mask2DCPtr mask);
-
-		static num_t DataQuality(Image2DCPtr image, Image2DCPtr model, Mask2DCPtr mask, unsigned startX, unsigned endX);
-
-		static num_t FrequencySNR(Image2DCPtr image, Image2DCPtr model, Mask2DCPtr mask, unsigned channel);
-		
-		void Save()
-		{
-			save(_filePrefix);
-		}
-		const std::map<double, class AmplitudeBin> &GetAutoAmplitudes() const
-		{
-			return _autoAmplitudes;
-		}
-		const std::map<double, class AmplitudeBin> &GetCrossAmplitudes() const
-		{
-			return _crossAmplitudes;
-		}
-		double RFIFractionInCrossChannels() const
-		{
-			return rfiFraction(_crossChannels);
-		}
-		double RFIFractionInAutoChannels() const
-		{
-			return rfiFraction(_autoChannels);
-		}
-		double RFIFractionInCrossTimeSteps() const
-		{
-			return rfiFraction(_crossTimesteps);
-		}
-		double RFIFractionInAutoTimeSteps() const
-		{
-			return rfiFraction(_autoTimesteps);
-		}
-		double AmplitudeCrossSlope(double startAmplitude, double endAmplitude) const
-		{
-			return amplitudeSlope(_crossAmplitudes, startAmplitude, endAmplitude);
-		}
-		long unsigned AmplitudeCrossCount(double startAmplitude, double endAmplitude)
-		{
-			return count(_crossAmplitudes, startAmplitude, endAmplitude);
-		}
-		void SetSeparateBaselineStatistics(bool haveSeparateBaselineStatistics)
-		{
-			_separateBaselineStatistics = haveSeparateBaselineStatistics;
-		}
-		bool SeparateBaselineStatistics() const { return _separateBaselineStatistics; }
-		void SetPerformClassification(bool performClassification)
-		{
-			_performClassification = performClassification;
-		}
-		bool PerformClassification() const { return _performClassification; }
-
-		const std::string &FilePrefix() const { return _filePrefix; }
-		void SetFilePrefix(const std::string &filePrefix) { _filePrefix = filePrefix; }
-
-		unsigned ChannelCountPerSubband() const { return _channelCountPerSubband; }
-		void SetChannelCountPerSubband(unsigned count) { _channelCountPerSubband = count; }
-
-		bool IgnoreFirstChannel() const { return _ignoreFirstChannel; }
-		void SetIgnoreFirstChannel(bool value) { _ignoreFirstChannel = value; }
-		
-		bool WriteImmediately() const { return _writeImmediately; }
-		void SetWriteImmediately(bool value) { _writeImmediately = value; }
-	private:
-		class FeatureInfo {
-                public:
-			long double amplitudeSum;
-			num_t amplitudeMax;
-			size_t sampleCount;
-		};
-		class StationInfo {
-                public:
-			StationInfo() : totalRfi(0.0), count(0) { };
-			StationInfo(const StationInfo &source) : index(source.index), name(source.name), totalRfi(source.totalRfi), count(source.count) { }
-			void operator=(const StationInfo &rhs) { index=rhs.index; name=rhs.name; totalRfi=rhs.totalRfi; count=rhs.count; }
-			size_t index;
-			std::string name;
-			double totalRfi;
-			size_t count;
-			bool operator<(const StationInfo &rhs) const
-			{
-				return (totalRfi / (double) count) < (rhs.totalRfi / (double) count);
-			}
-		};
-		typedef std::map<size_t, class FeatureInfo> FeatureMap;
-		typedef std::map<int, std::map<int, BaselineInfo> > BaselineMatrix;
-		typedef std::map<std::pair<double, double>, TimeFrequencyInfo > TimeFrequencyInfoMap;
-		typedef std::map<class IndexTriple, class BaselineFrequencyInfo> BaselineFrequencyInfoMap;
-		typedef std::map<class IndexTriple, class BaselineTimeInfo> BaselineTimeInfoMap;
-		
-		std::map<double, class ChannelInfo> _autoChannels, _crossChannels;
-		std::map<double, class TimestepInfo> _autoTimesteps, _crossTimesteps;
-		std::map<double, class AmplitudeBin> _autoAmplitudes, _crossAmplitudes;
-		TimeFrequencyInfoMap _autoTimeFrequencyInfo, _crossTimeFrequencyInfo;
-		BaselineMatrix _baselines;
-		BaselineFrequencyInfoMap _baselineFrequencyInfo;
-		BaselineTimeInfoMap _baselineTimeInfo;
-		bool _separateBaselineStatistics;
-		bool _compareFlags;
-		bool _polarizationAmplitudeStatistics;
-		std::string _filePrefix;
-		unsigned _channelCountPerSubband;
-		bool _ignoreFirstChannel, _performClassification;
-		bool _writeImmediately;
-		boost::mutex _genericMutex, _timeMapMutex, _baselineMapMutex, _frequencyMapMutex, _tfMapMutex, _taMapMutex, _afMapMutex;
-		
-		void addEverything(const TimeFrequencyData &data, TimeFrequencyMetaDataCPtr metaData, Image2DCPtr image, Mask2DCPtr mask, SegmentedImagePtr segmentedMask, SegmentedImagePtr classifiedMask);
-		void addSingleBaseline(const TimeFrequencyData &data, TimeFrequencyMetaDataCPtr metaData, Image2DCPtr image, Mask2DCPtr mask, SegmentedImagePtr segmentedMask, SegmentedImagePtr classifiedMask, bool save);
-		void save(const std::string &baseName)
-		{
-			saveWithoutBaselines(baseName);
-			boost::mutex::scoped_lock genLock(_genericMutex);
-			saveBaselines(baseName+"counts-baselines.txt");
-			saveBaselinesOrdered(baseName+"counts-obaselines.txt");
-			if(_crossChannels.size() > _channelCountPerSubband)
-			{
-				saveMetaData(baseName+"metadata.tex");
-				savePlots(baseName);
-			}
-			saveBaselineTimeInfo(baseName + "counts-baseltime.txt");
-			saveBaselineFrequencyInfo(baseName + "counts-baselfreq.txt");
-			saveStationTimeInfo(baseName + "counts-stationstime.txt", baseName + "StationsTime.plt");
-		}
-		void saveWithoutBaselines(const std::string &baseName)
-		{
-			boost::mutex::scoped_lock genLock(_genericMutex);
-			saveChannels(_autoChannels, baseName+"counts-channels-auto.txt");
-			saveTimesteps(_autoTimesteps, baseName+"counts-timesteps-auto.txt");
-			saveAmplitudes(_autoAmplitudes, baseName+"counts-amplitudes-auto.txt");
-			saveChannels(_crossChannels, baseName+"counts-channels-cross.txt");
-			saveTimesteps(_crossTimesteps, baseName+"counts-timesteps-cross.txt");
-			saveAmplitudes(_crossAmplitudes, baseName+"counts-amplitudes-cross.txt");
-			saveSubbands(_autoChannels, baseName+"counts-subbands-auto.txt");
-			saveSubbands(_crossChannels, baseName+"counts-subbands-cross.txt");
-			saveTimeIntegrated(_autoTimesteps, baseName+"counts-timeint-auto.txt");
-			saveTimeIntegrated(_crossTimesteps, baseName+"counts-timeint-cross.txt");
-			saveTimeFrequencyInfo(_autoTimeFrequencyInfo, baseName + "counts-timefreq-auto.txt");
-			saveTimeFrequencyInfo(_crossTimeFrequencyInfo, baseName + "counts-timefreq-cross.txt");
-		}
-
-		void addChannels(std::map<double, class ChannelInfo> &channels, Image2DCPtr image, Mask2DCPtr mask, TimeFrequencyMetaDataCPtr metaData, SegmentedImageCPtr segmentedImage);
-		void addTimesteps(std::map<double, class TimestepInfo> &timesteps, Image2DCPtr image, Mask2DCPtr mask, TimeFrequencyMetaDataCPtr metaData, SegmentedImageCPtr segmentedImage);
-		void addAmplitudes(std::map<double, class AmplitudeBin> &amplitudes, Image2DCPtr image, Mask2DCPtr mask, TimeFrequencyMetaDataCPtr metaData, SegmentedImageCPtr segmentedImage);
-		void addBaselines(const TimeFrequencyData &data, TimeFrequencyMetaDataCPtr metaData, Image2DCPtr image, Mask2DCPtr mask, SegmentedImagePtr segmentedMask, SegmentedImagePtr classifiedMask);
-
-		void addFeatures(std::map<double, class AmplitudeBin> &amplitudes, Image2DCPtr image, Mask2DCPtr mask, TimeFrequencyMetaDataCPtr metaData, SegmentedImageCPtr segmentedImage);
-		void addPolarisations(std::map<double, class AmplitudeBin> &amplitudes, const TimeFrequencyData &data, TimeFrequencyMetaDataCPtr metaData);
-		void addStokes(std::map<double, class AmplitudeBin> &amplitudes, const TimeFrequencyData &data, TimeFrequencyMetaDataCPtr metaData);
-
-		void addChannelComparison(std::map<double, class ChannelInfo> &channels, const TimeFrequencyData &data, TimeFrequencyMetaDataCPtr metaData, Mask2DCPtr groundTruthFlagging);
-		void addAmplitudeComparison(std::map<double, class AmplitudeBin> &amplitudes, const TimeFrequencyData &data, TimeFrequencyMetaDataCPtr metaData, Mask2DCPtr groundTruthFlagging);
-		
-		void addBaselineFrequencyInfo(TimeFrequencyMetaDataCPtr metaData, Image2DCPtr image, Mask2DCPtr mask);
-		void addBaselineTimeInfo(TimeFrequencyMetaDataCPtr metaData, Image2DCPtr image, Mask2DCPtr mask);
-		void addTimeFrequencyInfo(TimeFrequencyInfoMap &map, TimeFrequencyMetaDataCPtr metaData, Image2DCPtr image, Mask2DCPtr mask);
-
-		void saveChannels(const std::map<double, class ChannelInfo> &channels, const std::string &filename);
-		void saveTimesteps(const std::map<double, class TimestepInfo> &timesteps, const std::string &filename);
-		void saveAmplitudes(const std::map<double, class AmplitudeBin> &amplitudes, const std::string &filename);
-		void saveBaselines(const std::string &filename);
-		void saveBaselinesOrdered(const std::string &filename);
-		void saveStations(const std::string &filename);
-		void saveSubbands(const std::map<double, class ChannelInfo> &channels, const std::string &filename);
-		void saveTimeIntegrated(const std::map<double, class TimestepInfo> &timesteps, const std::string &filename);
-		void saveMetaData(const std::string &filename) const;
-		void savePlots(const std::string &basename) const;
-		void saveBaselineTimeInfo(const std::string &filename);
-		void saveBaselineFrequencyInfo(const std::string &filename);
-		void saveTimeFrequencyInfo(TimeFrequencyInfoMap &map, const std::string &filename);
-		void saveStationTimeInfo(const std::string &filename, const std::string &plotname);
-		void saveStationTimeInfoRow(std::ostream &stream, bool &firstRow, std::vector<unsigned long> &totals, std::vector<unsigned long> &rfis, double time);
-		void createStationData(std::vector<StationInfo> &stations) const;
-		
-		std::string getStationName(unsigned index) const
-		{
-			BaselineMatrix::const_iterator rowIter = _baselines.find(index);
-			if(rowIter != _baselines.end())
-			{
-				const std::map<int, BaselineInfo> &row = rowIter->second;
-				if(row.size() > 0)
-					return row.begin()->second.antenna1Name;
-			}
-			for(rowIter=_baselines.begin();rowIter!=_baselines.end();++rowIter)
-			{
-				const std::map<int, BaselineInfo> &row = rowIter->second;
-				std::map<int, BaselineInfo>::const_iterator elementIter = row.find(index);
-				if(elementIter != row.end())
-					return elementIter->second.antenna2Name;
-			}
-			std::stringstream s;
-			s << "Station " << index;
-			return s.str();
-		}
-	
-		double getCentralAmplitude(double amplitude)
-		{
-			//double decimals = pow(10.0, floor(log10(amplitude)));
-			//return round(100.0 * amplitude / decimals) / 100.0 * decimals;
-			if(amplitude>=0.0)
-				return pow(10.0, round(100.0*log10(amplitude))/100.0);
-			else
-				return -pow(10.0, round(100.0*log10(-amplitude))/100.0);
-		}
-		
-		double rfiFraction(const std::map<double, class ChannelInfo> &channels) const
-		{
-			unsigned long totalRFI = 0, total = 0;
-			for(std::map<double, class ChannelInfo>::const_iterator i=channels.begin();i!=channels.end();++i)
-			{
-				totalRFI += i->second.rfiCount;
-				total += i->second.totalCount;
-			}
-			return (long double) totalRFI / (long double) total;
-		}
-		double rfiFraction(const std::map<double, class TimestepInfo> &timesteps) const
-		{
-			unsigned long totalRFI = 0, total = 0;
-			for(std::map<double, class TimestepInfo>::const_iterator i=timesteps.begin();i!=timesteps.end();++i)
-			{
-				totalRFI += i->second.rfiCount;
-				total += i->second.totalCount;
-			}
-			return (long double) totalRFI / (long double) total;
-		}
-		double amplitudeSlope(const std::map<double, class AmplitudeBin> &amplitudes, double startAmplitude, double endAmplitude) const
-		{
-			unsigned long n = 0;
-			long double sumX = 0.0, sumXY = 0.0, sumY = 0.0, sumXSquare = 0.0;
-			for(std::map<double, class AmplitudeBin>::const_iterator i=amplitudes.begin();i!=amplitudes.end();++i)
-			{
-				if(i->first > startAmplitude && i->first<endAmplitude)
-				{
-					double x = log10(i->first);
-					double y = log10(i->second.count/i->first);
-					++n;
-					sumX += x;
-					sumXSquare += x * x;
-					sumY += y;
-					sumXY += x * y;
-				}
-			}
-			return (sumXY - sumX*sumY/n)/(sumXSquare - (sumX*sumX/n));
-		}
-		long unsigned count(const std::map<double, class AmplitudeBin> &amplitudes, double startAmplitude, double endAmplitude) const
-		{
-			unsigned long n = 0;
-			for(std::map<double, class AmplitudeBin>::const_iterator i=amplitudes.begin();i!=amplitudes.end();++i)
-			{
-				if(i->first > startAmplitude && i->first<endAmplitude)
-					n+=i->second.count;
-			}
-			return n;
-		}
-		double lowerQuartile(const std::multiset<double> &numbers)
-		{
-			double mid = round((double) numbers.size()/2.0);
-			size_t lq = (size_t) round(mid/2.0);
-			std::multiset<double>::const_iterator iter = numbers.begin();
-			for(size_t i=0;i<lq;++i)
-				++iter;
-			return *iter;
-		}
-		double upperQuartile(const std::multiset<double> &numbers)
-		{
-			double mid = round((double) numbers.size()/2.0);
-			size_t lq = (size_t) round(mid/2.0);
-			std::multiset<double>::const_reverse_iterator iter = numbers.rbegin();
-			for(size_t i=0;i<lq;++i)
-				++iter;
-			return *iter;
-		}
-		double median(const std::multiset<double> &numbers)
-		{
-			if(numbers.size()%2==0)
-			{
-				if(numbers.size()==0) return 0.0;
-				size_t midL = (numbers.size()/2)-1;
-				std::multiset<double>::const_reverse_iterator iter = numbers.rbegin();
-				for(size_t i=0;i<midL;++i)
-					++iter;
-				double leftValue = *iter;
-				++iter;
-				return (leftValue + *iter)/2.0;
-			} else {
-				size_t mid = (size_t) (numbers.size()/2);
-				std::multiset<double>::const_reverse_iterator iter = numbers.rbegin();
-				for(size_t i=0;i<mid;++i)
-					++iter;
-				return *iter;
-			}
-		}
-		double sum(const std::multiset<double> &numbers)
-		{
-			double sum = 0.0;
-			for(std::multiset<double>::const_iterator i=numbers.begin();i!=numbers.end();++i)
-				sum += *i;
-			return sum;
-		}
-		double avg(const std::multiset<double> &numbers)
-		{
-			return sum(numbers) / numbers.size();
-		}
-		std::string toTex(const std::string str) const
-		{
-			std::string copy = str;
-			for(unsigned i=0;i<str.size();++i)
-			{
-				if(copy[i] == '_') copy[i]=' ';
-				if(copy[i] == '\\') copy[i]=' ';
-			}
-			return copy;
-		}
-
-		unsigned startChannel(unsigned imageHeight) const {
-			if(imageHeight <= 16)
-				return 0;
-			else
-				return 1;
-		}		
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/sinusfitter.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/sinusfitter.h
deleted file mode 100644
index 31a779b399a08b38ac49f8da5e41f3aa9c483088..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/sinusfitter.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef SINUSFITTER_H
-#define SINUSFITTER_H
-
-#include <cstring>
-#include <cmath>
-
-#include <AOFlagger/msio/types.h>
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class SinusFitter {
-	public:
-		SinusFitter();
-		~SinusFitter();
-		void FindPhaseAndAmplitude(num_t &phase, num_t &amplitude, const num_t *dataX, const num_t *dataT, const size_t dataSize, const num_t frequency) const throw();
-		void FindPhaseAndAmplitudeComplex(num_t &phase, num_t &amplitude, const num_t *dataR, const num_t *dataI, const num_t *dataT, const size_t dataSize, const num_t frequency) const throw();
-
-
-		num_t FindMean(const num_t phase, const num_t amplitude, const num_t *dataX, const num_t *dataT, const size_t dataSize, const num_t frequency);
-
-		static num_t Value(const num_t phase, const num_t amplitude, const num_t t, const num_t frequency, num_t mean)
-		{
-			return cosn(phase + t * frequency) * amplitude + mean;
-		}
-
-		/*template<typename T> static T Phase(T real, T imaginary)
-		{
-			if(real==0.0L)
-			{
-				if(imaginary==0.0L)
-					return 0.0L;
-				else if(imaginary > 0.0L)
-					return M_PIn*0.5;
-				else
-					return -M_PIn*0.5;
-			}
-			else if(real>0.0L)
-			{
-				if(imaginary>=0.0L) // first 
-					return atannl(imaginary/real);
-				else // fourth
-					return atannl(imaginary/real)+2.0*M_PIn;
-			}
-			else
-			{
-				if(imaginary>=0.0L) // second
-					return atannl(imaginary/real) + 1.0*M_PIn;
-				else // third
-					return atannl(imaginary/real) + 1.0*M_PIn;
-			}
-		}*/
-		static num_t Phase(num_t real, num_t imaginary)
-		{
-			return atan2n(imaginary, real);
-		}
-		static numl_t Phase(numl_t real, numl_t imaginary)
-		{
-			return atan2nl(imaginary, real);
-		}
-	private:
-		
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/siroperator.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/siroperator.h
deleted file mode 100644
index 9df98b6a462718bff46ccc707df2683e81fa6745..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/siroperator.h
+++ /dev/null
@@ -1,262 +0,0 @@
-
-#ifndef SIROPERATOR_H
-#define SIROPERATOR_H
-
-#include <AOFlagger/msio/mask2d.h>
-#include <AOFlagger/msio/types.h>
-#include <AOFlagger/msio/xyswappedmask2d.h>
-
-/**
- * This class contains functions that implement an algorithm to dilate
- * a flag mask: the "scale-invariant rank (SIR) operator".
- * The amount of dilation is relative to the size of the flagged
- * areas in the input, hence it is scale invariant. This behaviour is very
- * effective for application after amplitude based RFI detection and is a step
- * in the default LOFAR flagging pipeline.
- * 
- * The rule for this scale invariant dilation is as follows:
- * Consider the sequence w(y) of size N, where w(y) = 0 if sample y is flagged and w(y) = 1
- * otherwise. If there exists a subsequence within w that
- * includes y and that has a flagged ratio of η or more, y will be flagged.
- * 
- * Thus:
- * if Y1 and Y2 exists, such that \\sum_{y=Y1}^{Y2-1} w(y)  <  η (Y2 - Y1), flag y.
- * 
- * The algorithm will be applied both in time and in frequency direction, thus w(y) can
- * contain a slice through the time-frequency image in either directions.
- * 
- * If you want to read more about the algorithm, read Offringa et al. 2010 (PoS RFI2010),
- * or the Dilate() function, which is the proof of concept, reference
- * O(N) algorithm and includes some comments within the algorithm.
- * 
- * Thanks to Jasper van de Gronde for the idea of an O(N) algorithm.
- * 
- * @author A.R. Offringa
- */
-class SIROperator
-{
-	public:
-		/**
-		 * This is the proof of concept, reference version of the O(N) algorithm. It is
-		 * fast, but OperateHorizontally() and OperateVertically() have been optimized
-		 * for operating on a mask directly, which is the common mode of operation.
-		 * 
-		 * It contains extra comments to explain the algorithm within the code.
-		 * 
-		 * @param [in,out] flags The input array of flags to be dilated that will be overwritten
-		 * by the dilatation of itself.
-		 * @param [in] flagsSize Size of the @c flags array.
-		 * @param [in] eta The η parameter that specifies the minimum number of good data
-		 * that any subsequence should have (see class description for the definition).
-		 */
-		static void Operate(bool *flags, const unsigned flagsSize, num_t eta)
-		{
-			// The test for a sample to become flagged can be rewritten as
-			//         \\sum_{y=Y1}^{Y2-1} ( η - w(y) ) >= 0.
-			// With w(y) =      flags[y] : 0
-			//                 !flags[y] : 1
-			
-			// Make an array in which flagged samples are η and unflagged samples are η-1,
-			// such that we can test for \\sum_{y=Y1}^{Y2-1} values[y] >= 0
-			num_t *values = new num_t[flagsSize];
-			for(unsigned i=0 ; i<flagsSize ; ++i)
-			{
-				if(flags[i])
-					values[i] = eta;
-				else
-					values[i] = eta - 1.0;
-			}
-			
-			// For each x, we will now search for the largest sum of sequantial values that contains x.
-			// If this sum is larger then 0, this value is part of a sequence that exceeds the test.
-			
-			// Define W(x) = \\sum_{y=0}^{x-1} values[y], such that the largest sequence containing x
-			// starts at the element after W(y) is minimal in the range 0 <= y <= x, and ends when
-			// W(y) is maximal in the range x < y < N.
-			
-			// Calculate these W's and minimum prefixes
-			const unsigned wSize = flagsSize+1;
-			num_t *w = new num_t[wSize];
-			w[0] = 0.0;
-			unsigned currentMinIndex = 0;
-			unsigned *minIndices = new unsigned[wSize];
-			minIndices[0] = 0;
-			for(unsigned i=1 ; i!=wSize ; ++i)
-			{
-				w[i] = w[i-1] + values[i-1];
-
-				if(w[i] < w[currentMinIndex])
-				{
-					currentMinIndex = i;
-				}
-				minIndices[i] = currentMinIndex;
-			}
-			
-			// Calculate the maximum suffixes
-			unsigned currentMaxIndex = wSize-1;
-			unsigned *maxIndices = new unsigned[wSize];
-			for(unsigned i=flagsSize-1 ; i!=0 ; --i)
-			{
-				// We directly assign maxIndices[i] to the max index over
-				// all indices *higher* than i, since maxIndices[i] is
-				// not allowed to be i (maxIndices[i] = max i: x < i < N).
-				maxIndices[i] = currentMaxIndex;
-				
-				if(w[i] > w[currentMaxIndex])
-				{
-					currentMaxIndex = i;
-				}
-			}
-			maxIndices[0] = currentMaxIndex;
-			
-			// See if max sequence exceeds limit.
-			for(unsigned i=0 ; i!=flagsSize ; ++i )
-			{
-				const num_t maxW = w[maxIndices[i]] - w[minIndices[i]];
-				flags[i] = (maxW >= 0.0);
-			}
-			
-			// Free our temporaries
-			delete[] maxIndices;
-			delete[] minIndices;
-			delete[] w;
-			delete[] values;
-		}
-		
-		/**
-		 * Performs a horizontal dilation directly on a mask. Algorithm is equal to Dilate().
-		 * This is the implementation.
-		 * 
-		 * @param [in,out] mask The input flag mask to be dilated.
-		 * @param [in] eta The η parameter that specifies the minimum number of good data
-		 * that any subsequence should have.
-		 */
-		static void OperateHorizontally(Mask2DPtr &mask, num_t eta)
-		{
-			operateHorizontally<Mask2D>(*mask, eta);
-		}
-		
-		/**
-		 * Performs a vertical dilation directly on a mask. Algorithm is equal to Dilate().
-		 * 
-		 * @param [in,out] mask The input flag mask to be dilated.
-		 * @param [in] eta The η parameter that specifies the minimum number of good data
-		 * that any subsequence should have.
-		 */
-		static void OperateVertically(Mask2DPtr mask, num_t eta)
-		{
-			XYSwappedMask2D swappedMask(*mask);
-			operateHorizontally<XYSwappedMask2D>(swappedMask, eta);
-		}
-		
-		/**
-		 * This is an experimental algorithm that might be slightly faster than
-		 * the original algorithm. Jasper van de Gronde is preparing an article about it.
-		 * @param [in,out] flags The input array of flags to be dilated that will be overwritten
-		 * by the dilatation of itself.
-		 * @param [in] flagsSize Size of the @c flags array.
-		 * @param [in] eta The η parameter that specifies the minimum number of good data
-		 * that any subsequence should have (see class description for the definition).
-		 */
-		static void Operate2PassAlgorithm(bool *flags, const size_t flagsSize, num_t eta)
-		{
-			bool temp[flagsSize];
-			num_t credit = 0.0;
-			for(size_t i=0; i<flagsSize; ++i)
-			{
-				// credit ← max(0, credit) + w(f [i])
-				const num_t w = flags[i] ? eta : eta-1.0;
-				const num_t maxcredit0 = credit > 0.0 ? credit : 0.0;
-				credit = maxcredit0 + w;
-				temp[i] = (credit >= 0.0);
-			}
-			
-			// The same iteration, but now backwards
-			credit = 0.0;
-			size_t i = flagsSize;
-			while(i > 0)
-			{
-				--i;
-				const num_t w = flags[i] ? eta : eta-1.0;
-				const num_t maxcredit0 = credit > 0.0 ? credit : 0.0;
-				credit = maxcredit0 + w;
-				flags[i] = (credit >= 0.0) || temp[i];
-			}
-		}
-	private:
-		SIROperator() { }
-
-		/**
-		 * Performs a horizontal dilation directly on a mask. Algorithm is equal to Dilate().
-		 * This is the implementation.
-		 * 
-		 * @param [in,out] mask The input flag mask to be dilated.
-		 * @param [in] eta The η parameter that specifies the minimum number of good data
-		 * that any subsequence should have.
-		 */
-		template<typename MaskLike>
-		static void operateHorizontally(MaskLike &mask, num_t eta)
-		{
-			const unsigned
-				width = mask.Width(),
-				wSize = width+1;
-			num_t
-				*values = new num_t[width],
-				*w = new num_t[wSize];
-			unsigned
-				*minIndices = new unsigned[wSize],
-				*maxIndices = new unsigned[wSize];
-			
-			for(unsigned row=0;row<mask.Height();++row)
-			{
-				for(unsigned i=0 ; i<width ; ++i)
-				{
-					if(mask.Value(i, row))
-						values[i] = eta;
-					else
-						values[i] = eta - 1.0;
-				}
-				
-				w[0] = 0.0;
-				unsigned currentMinIndex = 0;
-				minIndices[0] = 0;
-				for(unsigned i=1 ; i!=wSize ; ++i)
-				{
-					w[i] = w[i-1] + values[i-1];
-
-					if(w[i] < w[currentMinIndex])
-					{
-						currentMinIndex = i;
-					}
-					minIndices[i] = currentMinIndex;
-				}
-				
-				// Calculate the maximum suffixes
-				unsigned currentMaxIndex = wSize-1;
-				for(unsigned i=width-1 ; i!=0 ; --i)
-				{
-					maxIndices[i] = currentMaxIndex;
-					if(w[i] > w[currentMaxIndex])
-					{
-						currentMaxIndex = i;
-					}
-				}
-				maxIndices[0] = currentMaxIndex;
-				
-				// See if max sequence exceeds limit.
-				for(unsigned i=0 ; i!=width ; ++i )
-				{
-					const num_t maxW = w[maxIndices[i]] - w[minIndices[i]];
-					mask.SetValue(i, row, (maxW >= 0.0));
-				}
-			}
-			// Free our temporaries
-			delete[] maxIndices;
-			delete[] minIndices;
-			delete[] w;
-			delete[] values;
-		}
-};
-
-#endif
-
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/statisticalflagger.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/statisticalflagger.h
deleted file mode 100644
index a8684d149d14b1cfbc709dd9eea1882174028034..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/statisticalflagger.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef STATISTICALFLAGGER_H
-#define STATISTICALFLAGGER_H
-
-#include <string>
-
-#include <AOFlagger/msio/mask2d.h>
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class StatisticalFlagger{
-	public:
-		StatisticalFlagger();
-		~StatisticalFlagger();
-		
-		static inline bool SquareContainsFlag(Mask2DCPtr mask, size_t xLeft, size_t yTop, size_t xRight, size_t yBottom);
-		/**
-		 * @deprecated Very slow, use DilateFlags
-		 */
-		static void EnlargeFlags(Mask2DPtr mask, size_t timeSize, size_t frequencySize);
-		static void DilateFlags(Mask2DPtr mask, size_t timeSize, size_t frequencySize)
-		{
-			DilateFlagsHorizontally(mask, timeSize);
-			DilateFlagsVertically(mask, frequencySize);
-		}
-		static void DilateFlagsHorizontally(Mask2DPtr mask, size_t timeSize);
-		static void DilateFlagsVertically(Mask2DPtr mask, size_t frequencySize);
-		static void LineRemover(Mask2DPtr mask, size_t maxTimeContamination, size_t maxFreqContamination);
-		static void DensityTimeFlagger(Mask2DPtr mask, num_t minimumGoodDataRatio);
-		static void DensityFrequencyFlagger(Mask2DPtr mask, num_t minimumGoodDataRatio);
-		
-		/**
-		 * Performs an accurate scale invariant, but very slow. This algorithm is O(n^2),
-		 * and has been superseded by a much quicker O(n) algorithm. See 
-		 * ScaleInvariantDilation::Dilate().
-		 * @deprecated Not efficient, use ScaleInvariantDilation::Dilate().
-		 */
-		static void ScaleInvDilationFull(bool *flags, const unsigned n, num_t minimumGoodDataRatio);
-		
-		/**
-		 * Performs an inaccurate version of the scale invariant. This algorithm is O(n x log n),
-		 * and has been superseded by a much quicker O(n) algorithm. See 
-		 * ScaleInvariantDilation::Dilate().
-		 * @deprecated Not efficient, use ScaleInvariantDilation::Dilate().
-		 */
-		static void ScaleInvDilationQuick(bool *flags, const unsigned n, num_t minimumGoodDataRatio);
-	private:
-		static void FlagTime(Mask2DPtr mask, size_t x);
-		static void FlagFrequency(Mask2DPtr mask, size_t y);
-		static void MaskToInts(Mask2DCPtr mask, int **maskAsInt);
-		static void SumToLeft(Mask2DCPtr mask, int **sums, size_t width, size_t step, bool reverse);
-		static void SumToTop(Mask2DCPtr mask, int **sums, size_t width, size_t step, bool reverse);
-		static void ThresholdTime(Mask2DCPtr mask, int **flagMarks, int **sums, int thresholdLevel, int width);
-		static void ThresholdFrequency(Mask2DCPtr mask, int **flagMarks, int **sums, int thresholdLevel, int width);
-		static void ApplyMarksInTime(Mask2DPtr mask, int **flagMarks);
-		static void ApplyMarksInFrequency(Mask2DPtr mask, int **flagMarks);
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/surfacefitmethod.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/surfacefitmethod.h
deleted file mode 100644
index 5846bbbb76a24686b87f926d7922609c9af0b45d..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/surfacefitmethod.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#ifndef IMAGE_H
-#define IMAGE_H
-
-#include <AOFlagger/msio/image2d.h>
-#include <AOFlagger/msio/timefrequencydata.h>
-
-#include <AOFlagger/util/ffttools.h>
-
-class SurfaceFitMethod {
-	public:
-		virtual void Initialize(const TimeFrequencyData &input) = 0;
-		virtual unsigned TaskCount() = 0;
-		virtual void PerformFit(unsigned taskNumber) = 0;
-		virtual ~SurfaceFitMethod() { }
-		virtual TimeFrequencyData Background() = 0;
-		virtual enum TimeFrequencyData::PhaseRepresentation PhaseRepresentation() const = 0;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/svdmitigater.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/svdmitigater.h
deleted file mode 100644
index 15a075574f3e1c9a50d374de44ebda926973885c..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/svdmitigater.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef SVDMITIGATER_H
-#define SVDMITIGATER_H
-
-#include <iostream>
-
-#include <AOFlagger/msio/image2d.h>
-
-#include <AOFlagger/strategy/algorithms/surfacefitmethod.h>
-
-// Needs to be included LAST
-#include <AOFlagger/f2c.h>
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class SVDMitigater : public SurfaceFitMethod {
-	public:
-		SVDMitigater();
-		~SVDMitigater();
-
-		virtual void Initialize(const TimeFrequencyData &data) {
-			Clear();
-			_data = data;
-			_iteration = 0;
-		}
-		virtual unsigned TaskCount() { return 1; }
-		virtual void PerformFit(unsigned)
-		{
-			_iteration++;
-			RemoveSingularValues(_removeCount);
-		}
-
-		virtual void RemoveSingularValues(unsigned singularValueCount)
-		{
-			if(!IsDecomposed())
-				Decompose();
-			for(unsigned i=0;i<singularValueCount;++i)
-				SetSingularValue(i, 0.0);
-			Compose();
-		}
-
-		virtual TimeFrequencyData Background()
-		{
-			return *_background;
-		}
-
-		virtual enum TimeFrequencyData::PhaseRepresentation PhaseRepresentation() const
-		{
-			return TimeFrequencyData::ComplexRepresentation;
-		}
-
-		bool IsDecomposed() const throw() { return _singularValues != 0 ; }
-		double SingularValue(unsigned index) const throw() { return _singularValues[index]; }
-		void SetRemoveCount(unsigned removeCount) throw() { _removeCount = removeCount; }
-		void SetVerbose(bool verbose) throw() { _verbose = verbose; }
-		static void CreateSingularValueGraph(const TimeFrequencyData &data, class Plot2D &plot);
-	private:
-		void Clear();
-		void Decompose();
-		void Compose();
-		void SetSingularValue(unsigned index, double newValue) throw() { _singularValues[index] = newValue; }
-
-		TimeFrequencyData _data;
-		TimeFrequencyData *_background;
-		double *_singularValues;
-		doublecomplex *_leftSingularVectors;
-		doublecomplex *_rightSingularVectors;
-		long int _m, _n;
-		unsigned _iteration;
-		unsigned _removeCount;
-		bool _verbose;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/thresholdconfig.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/thresholdconfig.h
deleted file mode 100644
index 898751f5c3d992838f78fba18d723855aba22486..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/thresholdconfig.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef THRESHOLDCONFIG_H
-#define THRESHOLDCONFIG_H
-
-#include <vector>
-
-#include <AOFlagger/msio/image2d.h>
-#include <AOFlagger/msio/mask2d.h>
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class ThresholdConfig {
-	public:
-		enum Method { SumThreshold, VarThreshold };
-		enum Distribution { Uniform, Gaussian, Rayleigh };
-		ThresholdConfig();
-		~ThresholdConfig();
-		void InitializeLengthsDefault(unsigned count=0);
-		void InitializeLengthsFrom(unsigned count=0, unsigned startLength=0);
-		void InitializeLengthsSingleSample();
-		void InitializeThresholdsFromFirstThreshold(num_t firstThreshold, enum Distribution noiseDistribution);
-		void InitializeThresholdsWithFalseRate(size_t resolution, num_t falseAlarmRate, enum Distribution noiseDistribution);
-		num_t CalculateFalseAlarmRate(size_t resolution, enum Distribution noiseDistribution);
-		void Execute(Image2DCPtr image, Mask2DPtr mask, bool additive, num_t sensitivity) const;
-		void SetVerbose(bool verbose) { _verbose = verbose; }
-		void SetMethod(Method method) { _method = method; }
-		void SetExpThresholdFactor(num_t expFactor) { _expFactor=expFactor; }
-		void SetFitBackground(class SurfaceFitMethod *method) { _fitMethod = method; }
-		num_t GetHorizontalThreshold(unsigned index) const { return _horizontalOperations[index].threshold; }
-		num_t GetVerticalThreshold(unsigned index) const { return _verticalOperations[index].threshold; }
-		void SetHorizontalThreshold(unsigned index, num_t threshold) { _horizontalOperations[index].threshold = threshold; }
-		void SetVerticalThreshold(unsigned index, num_t threshold) { _verticalOperations[index].threshold = threshold; }
-		size_t GetHorizontalLength(unsigned index) const { return _horizontalOperations[index].length; }
-		size_t GetVerticalLength(unsigned index) const { return _verticalOperations[index].length; }
-		size_t GetHorizontalOperations() const { return _horizontalOperations.size(); }
-		size_t GetVerticalOperations() const { return _horizontalOperations.size(); }
-		void SetMinimumConnectedSamples(size_t val) { _minConnectedSamples = val; }
-		void RemoveHorizontalOperations() { _horizontalOperations.clear(); }
-		void RemoveVerticalOperations() { _verticalOperations.clear(); }
-	private:
-		void BinarySearch(num_t probability, num_t accuracy, size_t resolution);
-		struct ThresholdOperation {
-			size_t length;
-			num_t threshold;
-			num_t rate;
-		};
-		std::vector<ThresholdOperation> _horizontalOperations;
-		std::vector<ThresholdOperation> _verticalOperations;
-		Method _method;
-		Distribution _distribution;
-		bool _verbose;
-		num_t _expFactor;
-		class SurfaceFitMethod *_fitMethod;
-		size_t _minConnectedSamples;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/thresholdmitigater.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/thresholdmitigater.h
deleted file mode 100644
index b97e0271e09287800054fa50dcbbd54b86461984..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/thresholdmitigater.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef THRESHOLDMITIGATER_H
-#define THRESHOLDMITIGATER_H
-
-#include <cstddef>
-#include <cstring>
-
-#include <AOFlagger/msio/image2d.h>
-#include <AOFlagger/msio/mask2d.h>
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class ThresholdMitigater{
-	public:
-		//static void Threshold(class Image2D &image, num_t threshold);
-
-		template<size_t Length>
-		static void HorizontalSumThreshold(Image2DCPtr input, Mask2DPtr mask, num_t threshold);
-		
-		template<size_t Length>
-		static void VerticalSumThreshold(Image2DCPtr input, Mask2DPtr mask, num_t threshold);
-		
-		template<size_t Length>
-		static void HorizontalSumThresholdLarge(Image2DCPtr input, Mask2DPtr mask, num_t threshold);
-
-		template<size_t Length>
-		static void VerticalSumThresholdLargeSSE(Image2DCPtr input, Mask2DPtr mask, num_t threshold);
-		
-		static void VerticalSumThresholdLargeSSE(Image2DCPtr input, Mask2DPtr mask, size_t length, num_t threshold);
-
-		template<size_t Length>
-		static void HorizontalSumThresholdLargeSSE(Image2DCPtr input, Mask2DPtr mask, num_t threshold);
-		
-		static void HorizontalSumThresholdLargeSSE(Image2DCPtr input, Mask2DPtr mask, size_t length, num_t threshold);
-
-		template<size_t Length>
-		static void VerticalSumThresholdLargeCompare(Image2DCPtr input, Mask2DPtr mask, num_t threshold);
-
-		template<size_t Length>
-		static void VerticalSumThresholdLarge(Image2DCPtr input, Mask2DPtr mask, num_t threshold);
-		
-		template<size_t Length>
-		static void SumThresholdLarge(Image2DCPtr input, Mask2DPtr mask, num_t hThreshold, num_t vThreshold)
-		{
-			HorizontalSumThresholdLarge<Length>(input, mask, hThreshold);
-			VerticalSumThresholdLarge<Length>(input, mask, vThreshold);
-		}
-		
-		static void VerticalSumThresholdLarge(Image2DCPtr input, Mask2DPtr mask, size_t length, num_t threshold)
-		{
-			VerticalSumThresholdLargeSSE(input, mask, length, threshold);
-			
-			// We could/should check maybe availability of SSE here. If no SSE is
-			// available, we should call:
-			
-			// VerticalSumThresholdLargeReference(input, mask, length, threshold);
-		}
-		
-		static void VerticalSumThresholdLargeReference(Image2DCPtr input, Mask2DPtr mask, size_t length, num_t threshold);
-		
-		static void HorizontalSumThresholdLargeReference(Image2DCPtr input, Mask2DPtr mask, size_t length, num_t threshold);
-		
-		static void HorizontalSumThresholdLarge(Image2DCPtr input, Mask2DPtr mask, size_t length, num_t threshold)
-		{
-			HorizontalSumThresholdLargeSSE(input, mask, length, threshold);
-		}
-
-		static void VarThreshold(Image2DCPtr input, Mask2DPtr mask, size_t length, num_t threshold);
-		
-		static void HorizontalVarThreshold(Image2DCPtr input, Mask2DPtr mask, size_t length, num_t threshold);
-		
-		static void VerticalVarThreshold(Image2DCPtr input, Mask2DPtr mask, size_t length, num_t threshold);
-	private:
-		ThresholdMitigater() { }
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/thresholdtools.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/thresholdtools.h
deleted file mode 100644
index a8c3524ceeb0952c6d432ee10659b4b43e70952d..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/thresholdtools.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef THRESHOLDTOOLS_H
-#define THRESHOLDTOOLS_H
-
-#include <vector>
-#include <cmath>
-
-#include <AOFlagger/msio/image2d.h>
-#include <AOFlagger/msio/mask2d.h>
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class ThresholdTools {
-	public:
-		static void MeanAndStdDev(Image2DCPtr image, Mask2DCPtr mask, num_t &mean, num_t &stddev);
-		static numl_t Sum(Image2DCPtr image, Mask2DCPtr mask);
-		static numl_t RMS(Image2DCPtr image, Mask2DCPtr mask);
-		static num_t Mode(Image2DCPtr input, Mask2DCPtr mask);
-		static num_t WinsorizedMode(Image2DCPtr image, Mask2DCPtr mask);
-		static num_t WinsorizedMode(Image2DCPtr image);
-		template<typename T>
-		static void TrimmedMeanAndStdDev(const std::vector<T> input, T &mean, T &stddev);
-		template<typename T>
-		static void WinsorizedMeanAndStdDev(const std::vector<T> input, T &mean, T &stddev);
-		static void WinsorizedMeanAndStdDev(Image2DCPtr image, Mask2DCPtr mask, num_t &mean, num_t &variance);
-		static void WinsorizedMeanAndStdDev(Image2DCPtr image, num_t &mean, num_t &variance);
-		static num_t MinValue(Image2DCPtr image, Mask2DCPtr mask);
-		static num_t MaxValue(Image2DCPtr image, Mask2DCPtr mask);
-		static void SetFlaggedValuesToZero(Image2DPtr dest, Mask2DCPtr mask);
-		static void CountMaskLengths(Mask2DCPtr mask, int *lengths, size_t lengthsSize);
-		
-		static void FilterConnectedSamples(Mask2DPtr mask, size_t minConnectedSampleArea, bool eightConnected=true);
-		static void FilterConnectedSample(Mask2DPtr mask, size_t x, size_t y, size_t minConnectedSampleArea, bool eightConnected=true);
-		static void UnrollPhase(Image2DPtr image);
-		static Image2DPtr ShrinkHorizontally(size_t factor, Image2DCPtr input, Mask2DCPtr mask);
-
-		static Image2DPtr FrequencyRectangularConvolution(Image2DCPtr source, size_t convolutionSize)
-		{
-			Image2DPtr image = Image2D::CreateCopy(source);
-			const size_t upperWindowHalf = (convolutionSize+1) / 2;
-			for(size_t x=0;x<image->Width();++x)
-			{
-				num_t sum = 0.0;
-				for(size_t y=0;y<upperWindowHalf;++y)
-					sum += image->Value(x, y);
-				for(size_t y=upperWindowHalf;y<convolutionSize;++y)
-				{
-					image->SetValue(x, y-upperWindowHalf, sum/(num_t) y);
-					sum += image->Value(x, y);
-				}
-				size_t count = convolutionSize;
-				for(size_t y=convolutionSize;y!=image->Height();++y)
-				{
-					image->SetValue(x, y-upperWindowHalf, sum/(num_t) count);
-					sum += image->Value(x, y) - image->Value(x, y - convolutionSize);
-				}
-				for(size_t y=image->Height();y!=image->Height() + upperWindowHalf;++y)
-				{
-					image->SetValue(x, y-upperWindowHalf, sum/(num_t) count);
-					sum -= image->Value(x, y - convolutionSize);
-					--count;
-				}
-			}
-			return image;
-		}
-		
-		static Mask2DPtr Threshold(Image2DCPtr image, num_t threshold)
-		{
-			Mask2DPtr mask = Mask2D::CreateUnsetMaskPtr(image->Width(), image->Height());
-			for(size_t y=0;y<image->Height();++y)
-			{
-				for(size_t x=0;x<image->Width();++x)
-				{
-					mask->SetValue(x, y, image->Value(x, y) >= threshold);
-				}
-			}
-			return mask;
-		}
-	private:
-		ThresholdTools() { }
-
-		// We need this less than operator, because the normal operator
-		// does not enforce a strictly ordered set, because a<b != !(b<a) in the case
-		// of nans/infs.
-		static bool numLessThanOperator(const num_t &a, const num_t &b) {
-			if(std::isfinite(a)) {
-				if(std::isfinite(b))
-					return a < b;
-				else
-					return true;
-			}
-			return false;
-		}
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/tiledimage.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/tiledimage.h
deleted file mode 100644
index 9427a569186cd4b7a160eb33249863c831979e7e..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/tiledimage.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef TILEDIMAGE_H
-#define TILEDIMAGE_H
-
-#include <AOFlagger/strategy/algorithms/imagetile.h>
-#include <AOFlagger/strategy/algorithms/surfacefitmethod.h>
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class TiledImage : public SurfaceFitMethod {
-	public:
-		TiledImage();
-		~TiledImage();
-		void SetParameters(int polynomialTimeOrder, int polynomialFequencyOrder, size_t scanTileSize, size_t frequencyTileSize);
-		virtual void Initialize(const TimeFrequencyData &data);
-		virtual unsigned TaskCount() { return _vTileCount; }
-		virtual void FitBackground(unsigned taskNumber);
-		TimeFrequencyData Background();
-		Mask2DPtr CreateFlagImage();
-		//void SaveDistribution(const std::string &filename);
-		virtual enum TimeFrequencyData::PhaseRepresentation PhaseRepresentation() const
-		{
-			return TimeFrequencyData::AmplitudePart;
-		}
-	private:
-		void SetMask(Mask2DCPtr mask);
-		size_t StartScan(size_t hWindowIndex) const;
-		size_t EndScan(size_t hWindowIndex) const { return StartScan(hWindowIndex+1); }
-		size_t StartFrequency(size_t vWindowIndex) const;
-		size_t EndFrequency(size_t vWindowIndex) const { return StartFrequency(vWindowIndex+1); }
-		size_t HWindowIndex(size_t scan);
-		size_t VWindowIndex(size_t frequency);
-
-		ImageTile ***_tiles;
-		Image2DCPtr _original;
-		TimeFrequencyData _data;
-		Image2DPtr _background;
-		size_t _hTileCount, _vTileCount;
-		size_t _scanTileSize, _frequencyTileSize;
-		long double _mean, _variance;
-		bool _backgroundInitialized;
-		int _polynomialTimeOrder, _polynomialFequencyOrder;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/timefrequencystatistics.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/timefrequencystatistics.h
deleted file mode 100644
index 52e74f93e79da933f475a3bb90a4eb49cf0c6838..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/timefrequencystatistics.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008-2010 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef TIMEFREQUENCYSTATISTICS_H
-#define TIMEFREQUENCYSTATISTICS_H
-
-#include <string>
-
-#include <AOFlagger/msio/timefrequencydata.h>
-
-class TimeFrequencyStatistics
-{
-	public:
-		TimeFrequencyStatistics(const TimeFrequencyData &data);
-
-		num_t GetFlaggedRatio();
-
-		static std::string FormatRatio(num_t ratio);
-
-	private:
-		TimeFrequencyData _data;
-};
-
-#endif // TIMEFREQUENCYSTATISTICS_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/types.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/types.h
deleted file mode 100644
index 0d49260473b94739ceab66fb877df4fe44520f42..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/types.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#ifndef RFI_TYPES_H
-#define RFI_TYPES_H
-
-class AntennaFlagCountPlot;
-class FrequencyFlagCountPlot;
-class FrequencyPowerPlot;
-class PolarizationStatistics;
-class TimeFlagCountPlot;
-class IterationsPlot;
-
-#endif // RFI_TYPES_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/uvprojection.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/uvprojection.h
deleted file mode 100644
index cedaae1285b6e550a3a50da795cd7c0510e3862f..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/uvprojection.h
+++ /dev/null
@@ -1,303 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008-2010 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#ifndef RFI_UV_PROJECTION_H
-#define RFI_UV_PROJECTION_H
-
-#include <AOFlagger/msio/types.h>
-#include <AOFlagger/msio/image2d.h>
-#include <AOFlagger/msio/timefrequencymetadata.h>
-
-#include <AOFlagger/imaging/uvimager.h>
-
-#include <AOFlagger/util/aologger.h>
-
-class UVProjection
-{
-	public:
-		/**
-		* This function will project a uv-track onto a straight line that has an angle of directionRad.
-		*/
-		static void Project(Image2DCPtr image, const size_t y, numl_t *rowValues, const bool isImaginary)
-		{
-			const size_t width = image->Width();
-
-			// Change sign if necessary
-			if(isImaginary)
-			{
-				for(size_t t=0;t<width;++t)
-				{
-					rowValues[t] = -image->Value(t, y);
-				}
-			} else {
-				for(size_t t=0;t<width;++t)
-				{
-					rowValues[t] = image->Value(t, y);
-				}
-			}
-		}
-		
-		static void ProjectBack(Image2DPtr image, const size_t y, numl_t *rowValues, const bool isImaginary)
-		{
-			const size_t width = image->Width();
-
-			// Change sign if necessary
-			if(isImaginary)
-			{
-				for(size_t t=0;t<width;++t)
-				{
-					image->SetValue(t, y, -rowValues[t]);
-				}
-			} else {
-				for(size_t t=0;t<width;++t)
-				{
-					image->SetValue(t, y, rowValues[t]);
-				}
-			}
-		}
-		
-		/**
-		* This function will project a uv-track onto a straight line that has an angle of directionRad.
-		*/
-		static void ProjectPositions(TimeFrequencyMetaDataCPtr metaData, size_t width, size_t y, numl_t *rowUPositions, numl_t *rowVPositions, numl_t directionRad)
-		{
-			const numl_t cosRotate = cosnl(directionRad);
-			const numl_t sinRotate = sinnl(directionRad);
-			const numl_t frequency = metaData->Band().channels[y].frequencyHz;
-
-			// Calculate the projected positions and change sign if necessary
-			for(size_t t=0;t<width;++t)
-			{
-				const UVW &uvw = metaData->UVW()[t];
-				const numl_t vProject = uvw.u * sinRotate + uvw.v * cosRotate;
-				const numl_t uProject = uvw.u * cosRotate - uvw.v * sinRotate;
-				rowVPositions[t] = vProject * frequency / UVImager::SpeedOfLight();
-				rowUPositions[t] = uProject * frequency / UVImager::SpeedOfLight();
-			}
-		}
-		
-		static void MaximalUPositions(size_t width, const numl_t *uPositions, numl_t &leftPosition, numl_t &rightPosition)
-		{
-			leftPosition = 0.0,
-			rightPosition = 0.0;
-			for(size_t i=0;i<width;++i)
-			{
-				if(uPositions[i] < leftPosition)
-					leftPosition = uPositions[i];
-				if(uPositions[i] > rightPosition)
-					rightPosition = uPositions[i];
-			}
-		}
-	
-		static void ProjectImage(Image2DCPtr source, Image2DPtr destination, Image2DPtr weights, TimeFrequencyMetaDataCPtr metaData, numl_t directionRad, numl_t etaParameter, bool sourceIsImaginary)
-		{
-			const size_t
-				inputWidth = source->Width();
-			numl_t
-				*rowValues = new numl_t[inputWidth],
-				*rowUPositions = new numl_t[inputWidth],
-				*rowVPositions = new numl_t[inputWidth];
-				
-			for(size_t y=0;y<source->Height();++y)
-			{
-				ProjectPositions(metaData, inputWidth, y, rowUPositions, rowVPositions, directionRad);
-				
-				Project(source, y, rowValues, sourceIsImaginary);
-
-				numl_t leftDist, rightDist;
-				MaximalUPositions(inputWidth, rowUPositions, leftDist, rightDist);
-				numl_t maxDist = rightDist > -leftDist ? rightDist : -leftDist;
-
-				for(size_t t=0;t<inputWidth-1;++t)
-				{
-					size_t
-						t1 = t,
-						t2 = t+1;
-					double
-						u1 = rowUPositions[t],
-						u2 = rowUPositions[t+1];
-					if(u1 > u2)
-					{
-						u1 = rowUPositions[t+1];
-						u2 = rowUPositions[t];
-						t1 = t+1;
-						t2 = t;
-					}
-					if(u2 - u1 >= maxDist)
-					{
-						numl_t midValue = (rowValues[t1]+rowValues[t2])/2.0;
-						Interpolate(destination, weights, leftDist, rightDist, leftDist, u1, midValue, rowValues[t2], y);
-						Interpolate(destination, weights, leftDist, rightDist, u2, rightDist, rowValues[t1], midValue, y);
-					} else {
-						Interpolate(destination, weights, leftDist, rightDist, u1, u2, rowValues[t1], rowValues[t2], y);
-					}
-				}
-				const size_t
-					rangeStart = (size_t) roundnl(etaParameter * (num_t) inputWidth / 2.0),
-					rangeEnd = inputWidth - rangeStart;
-				for(size_t x=0;x<inputWidth;++x)
-				{
-					if(x > rangeStart && x < rangeEnd && weights->Value(x, y) != 0.0)
-						destination->SetValue(x, y, destination->Value(x, y) / weights->Value(x, y));
-					else
-						destination->SetValue(x, y, 0.0);
-				}
-			}
-			
-			delete[] rowValues;
-			delete[] rowUPositions;
-			delete[] rowVPositions;
-		}
-		
-		static void InverseProjectImage(Image2DCPtr source, Image2DPtr destination, TimeFrequencyMetaDataCPtr metaData, numl_t directionRad, numl_t etaParameter, bool sourceIsImaginary)
-		{
-			const size_t
-				inputWidth = source->Width();
-			numl_t
-				*rowValues = new numl_t[inputWidth],
-				*rowWeights = new numl_t[inputWidth],
-				*rowUPositions = new numl_t[inputWidth],
-				*rowVPositions = new numl_t[inputWidth];
-				
-			for(size_t y=0;y<source->Height();++y)
-			{
-				UVProjection::ProjectPositions(metaData, inputWidth, y, rowUPositions, rowVPositions, directionRad);
-				
-				for(size_t x=0;x<inputWidth;++x)
-				{
-					rowValues[x] = 0.0;
-					rowWeights[x] = 0.0;
-				}
-				
-				numl_t leftDist, rightDist;
-				MaximalUPositions(inputWidth, rowUPositions, leftDist, rightDist);
-				numl_t maxDist = rightDist > -leftDist ? rightDist : -leftDist;
-
-				for(size_t t=0;t<inputWidth-1;++t)
-				{
-					double
-						u1 = rowUPositions[t],
-						u2 = rowUPositions[t+1];
-					if(u1 > u2)
-					{
-						u1 = rowUPositions[t+1];
-						u2 = rowUPositions[t];
-						t = t+1;
-					}
-					if(u2 - u1 >= maxDist)
-					{
-						InterpolateBack(source, leftDist, rightDist, leftDist, u1, rowValues[t], rowWeights[t], y);
-						InterpolateBack(source, leftDist, rightDist, u2, rightDist, rowValues[t], rowWeights[t], y);
-					} else {
-						InterpolateBack(source, leftDist, rightDist, u1, u2, rowValues[t], rowWeights[t], y);
-					}
-					
-				}
-				const size_t
-					rangeStart = (size_t) roundnl(etaParameter * (num_t) inputWidth / 2.0),
-					rangeEnd = inputWidth - rangeStart;
-				for(size_t x=0;x<inputWidth;++x)
-				{
-					if(x > rangeStart && x < rangeEnd && rowWeights[x] != 0.0)
-						rowValues[x] = rowValues[x] / rowWeights[x];
-					else
-						rowValues[x] = 0.0;
-				}
-				
-				ProjectBack(destination, y, rowValues, sourceIsImaginary);
-			}
-			
-			delete[] rowValues;
-			delete[] rowWeights;
-			delete[] rowUPositions;
-			delete[] rowVPositions;
-		}
-		
-		/**
-		 * This function converts a distance from phase centre in radians of the sky towards an
-		 * index inside an image created by ProjectImage() that has been FFT'ed (hence it represents
-		 * an index into a frequency).
-		 */
-		static void GetIndicesInProjectedImage(numl_t distance, numl_t minU, numl_t maxU, size_t sourceWidth, size_t destWidth, unsigned &lowestIndex, unsigned &highestIndex)
-		{
-			numl_t sincScale = 1.0/distance;
-			numl_t clippingFrequency = 1.0/(sincScale * sourceWidth / (0.5*(maxU-minU)));
-			numl_t fourierClippingIndex = (numl_t) destWidth * clippingFrequency;
-			if(fourierClippingIndex*2.0 > destWidth)
-				fourierClippingIndex = (numl_t) destWidth/2.0;
-			if(fourierClippingIndex < 0.0)
-				fourierClippingIndex = 0.0;
-			lowestIndex = (unsigned) ceil(fourierClippingIndex),
-			highestIndex = (unsigned) floor(destWidth - fourierClippingIndex);
-		}
-		
-		/**
-		 * This function converts an
-		 * index inside an image created by ProjectImage() that has been FFT'ed (hence it represents
-		 * an index into a frequency) towards the frequency in U direction of the uv plane.
-		 */
-		static numl_t GetUFrequency(size_t fIndex, numl_t minU, numl_t maxU, size_t sourceWidth, size_t destWidth)
-		{
-			int normFIndex = fIndex;
-			if(normFIndex > (int) (destWidth/2)) normFIndex = destWidth - normFIndex;
-			numl_t frequencyInDest = (numl_t) normFIndex * sourceWidth / (0.5*(maxU-minU) * destWidth);
-			return frequencyInDest;
-		}
-	private:
-		
-		static void Interpolate(Image2DPtr destination, Image2DPtr weights, numl_t leftDist, numl_t rightDist, numl_t u1, numl_t u2, numl_t v1, numl_t v2, size_t y)
-		{
-			int
-				width = destination->Width(),
-				left = (int) ((u1 - leftDist) * (numl_t) width / (rightDist-leftDist)),
-				right = (int) ((u2 - leftDist) * (numl_t) width / (rightDist-leftDist));
-			if(left < 0) left = 0;
-			if(right >= width) right = width;
-			if(right - left < 1 && left+1 < width) right = left+1;
-			int count = right-left;
-			for(int x=left;x<right;++x)
-			{
-				numl_t value = v1 + ((v2-v1)*(numl_t) (x-left)/(numl_t) count);
-				destination->SetValue(x, y, destination->Value(x, y) + value);
-				weights->SetValue(x, y, weights->Value(x, y) + 1.0);
-			}
-		}
-
-		static void InterpolateBack(Image2DCPtr source, numl_t leftDist, numl_t rightDist, numl_t u1, numl_t u2, numl_t &v, numl_t &w, size_t y)
-		{
-			int
-				width = source->Width(),
-				left = (int) ((u1 - leftDist) * (numl_t) width / (rightDist-leftDist)),
-				right = (int) ((u2 - leftDist) * (numl_t) width / (rightDist-leftDist));
-			if(left < 0) left = 0;
-			if(right >= width) right = width;
-			if(right - left < 1 && left+1 < width) right = left+1;
-			int count = right-left;
-			numl_t weight = 1.0 / (numl_t) count;
-			for(int x=left;x<right;++x)
-			{
-				v += source->Value(x, y) * weight;
-				w += weight;
-			}
-		}
-
-};
-
-#endif // RFI_UV_PROJECTION_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/vertevd.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/vertevd.h
deleted file mode 100644
index 21b5f3687c693ce5356ced63d7cf5062159fc7b4..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/vertevd.h
+++ /dev/null
@@ -1,209 +0,0 @@
-#ifndef VERTEVD_H
-#define VERTEVD_H
-
-#include <cmath>
-
-#include <AOFlagger/msio/timefrequencydata.h>
-
-#include <AOFlagger/util/aologger.h>
-
-#include "eigenvalue.h"
-
-/**
- * This class performs a horizontal Eigenvalue Decomposition. Horizon
- */
-class VertEVD
-{
-	public:
-		static void Perform(TimeFrequencyData &data, bool timeIntegrated)
-		{
-			if(data.PolarisationCount() != 1)
-				throw std::runtime_error("Can not decompose multipolarization data");
-			if(data.PhaseRepresentation() != TimeFrequencyData::ComplexRepresentation)
-				throw std::runtime_error("Can only decompose complex data");
-			
-			Image2DCPtr
-				real = data.GetRealPart(),
-				imaginary = data.GetImaginaryPart();
-			Image2DPtr
-				outReal = Image2D::CreateZeroImagePtr(real->Width(), real->Height()),
-				outImaginary = Image2D::CreateZeroImagePtr(real->Width(), real->Height());
-				
-			// Since the number of vertical elements e = n(n-1)/2 , solving for e
-			// results in:
-			// e = n(n-1)/2
-			// e = 0.5n^2 - 0.5n
-			// 0 = 0.5n^2 - 0.5n - e
-			// n = -(-0.5) +- sqrt(0.25 - 4 x 0.5 x -e)
-			// n = 0.5 + sqrt(0.25 + 2e)
-			const size_t n = floor(0.5 + sqrt(0.25 + 2 * real->Height()));
-			const size_t skipped = real->Height()-((n * (n-1)) / 2);
-			if(n > 0)
-			{
-				AOLogger::Warn << "In vertical eigenvalue decomposition: height did not correspond with an exact triangle:\n"
-				<< skipped << " values of height " << (real->Height()) << " were skipped to create matrix size " << n << "\n.";
-			}
-			Image2DPtr
-				realMatrix = Image2D::CreateUnsetImagePtr(n, n),
-				imaginaryMatrix = Image2D::CreateUnsetImagePtr(n, n);
-			
-			if(timeIntegrated)
-			{
-				performIntegrated(n, real, imaginary, realMatrix, imaginaryMatrix, outReal, outImaginary);
-			} else {				
-				for(unsigned t=0;t<real->Width();++t)
-				{
-					performOnEachTimestep(n, t, real, imaginary, realMatrix, imaginaryMatrix, outReal, outImaginary);
-				}
-			}
-			
-			data.SetImage(0, outReal);
-			data.SetImage(1, outImaginary);
-		}
-	private:
-		static void performIntegrated(const unsigned n, Image2DCPtr real, Image2DCPtr imaginary, Image2DPtr realMatrix, Image2DPtr imaginaryMatrix, Image2DPtr outReal, Image2DPtr outImaginary)
-		{
-			double diagonal[n];
-			for(unsigned i=0;i<n;++i)
-				diagonal[i] = 0.0;
-
-			for(unsigned diagIteration=0;diagIteration<5;++diagIteration)
-			{
-				unsigned index = 0;
-				for(unsigned y=0;y<n;++y)
-				{
-					realMatrix->SetValue(y, y, diagonal[y]);
-					imaginaryMatrix->SetValue(y, y, 0.0);
-
-					for(unsigned x=y+1;x<n;++x)
-					{
-						realMatrix->SetValue(x, y, 0.0);
-						imaginaryMatrix->SetValue(x, y, 0.0);
-						realMatrix->SetValue(y, x, 0.0);
-						imaginaryMatrix->SetValue(y, x, 0.0);
-						
-						for(unsigned t=0;t<real->Width();++t)
-						{
-							realMatrix->SetValue(x, y, real->Value(t, index) + realMatrix->Value(x, y));
-							imaginaryMatrix->SetValue(x, y, imaginary->Value(t, index) + imaginaryMatrix->Value(x, y));
-
-							realMatrix->SetValue(y, x, real->Value(t, index) + realMatrix->Value(y, x));
-							imaginaryMatrix->SetValue(y, x, -imaginary->Value(t, index) + imaginaryMatrix->Value(y, x));
-						}
-						++index;
-					}
-				}
-				AOLogger::Debug << "Input to EVD:\n";
-				for(unsigned y=0;y<realMatrix->Height();++y) {
-					for(unsigned x=0;x<realMatrix->Width();++x) {
-						AOLogger::Debug << realMatrix->Value(x, y) << ' ';
-					}
-					AOLogger::Debug << '\n';
-				}
-				
-				Eigenvalue::Remove(realMatrix, imaginaryMatrix, true);
-				
-				AOLogger::Debug << "Output to EVD:\n";
-				for(unsigned y=0;y<realMatrix->Height();++y) {
-					for(unsigned x=0;x<realMatrix->Width();++x) {
-						AOLogger::Debug << realMatrix->Value(x, y) << ' ';
-					}
-					AOLogger::Debug << '\n';
-				}
-				
-				for(unsigned i=0;i<n;++i)
-					diagonal[i] = realMatrix->Value(i, i);
-			}						
-			
-			unsigned index = 0;
-			for(unsigned y=0;y<n;++y)
-			{
-				for(unsigned x=y+1;x<n;++x)
-				{
-					for(unsigned t=0;t<real->Width();++t)
-					{
-						outReal->SetValue(t, index, /*real->Value(t, index) -*/ realMatrix->Value(x, y)/(num_t) real->Width());
-						outImaginary->SetValue(t, index, /*imaginary->Value(t, index) -*/ imaginaryMatrix->Value(x, y)/(num_t) imaginary->Width());
-					}
-					++index;
-				}
-			}
-		}
-		
-		static void performOnEachTimestep(const unsigned n, const unsigned t, Image2DCPtr real, Image2DCPtr imaginary, Image2DPtr realMatrix, Image2DPtr imaginaryMatrix, Image2DPtr outReal, Image2DPtr outImaginary)
-		{
-			double diagonal[n];
-			for(unsigned i=0;i<n;++i)
-				diagonal[i] = 0.0;
-			
-			for(unsigned diagIteration=0;diagIteration<5;++diagIteration)
-			{
-				unsigned index = 0;
-				for(unsigned y=0;y<n;++y)
-				{
-					realMatrix->SetValue(y, y, diagonal[y]);
-					imaginaryMatrix->SetValue(y, y, 0.0);
-					
-					for(unsigned x=y+1;x<n;++x)
-					{
-						realMatrix->SetValue(x, y, real->Value(t, index));
-						imaginaryMatrix->SetValue(x, y, imaginary->Value(t, index));
-
-						realMatrix->SetValue(y, x, real->Value(t, index));
-						imaginaryMatrix->SetValue(y, x, -imaginary->Value(t, index));
-
-						++index;
-					}
-				}
-				
-				if(t == 262)
-				{
-					AOLogger::Debug << "Input to EVD:\n";
-					for(unsigned y=0;y<realMatrix->Height();++y) {
-						for(unsigned x=0;x<realMatrix->Width();++x) {
-							AOLogger::Debug << realMatrix->Value(x, y) << ' ';
-						}
-						AOLogger::Debug << '\n';
-					}
-				}
-				
-				Eigenvalue::Remove(realMatrix, imaginaryMatrix, t==262);
-				
-				if(t == 262)
-				{
-					AOLogger::Debug << "Output to EVD:\n";
-					for(unsigned y=0;y<realMatrix->Height();++y) {
-						for(unsigned x=0;x<realMatrix->Width();++x) {
-							AOLogger::Debug << realMatrix->Value(x, y) << ' ';
-						}
-						AOLogger::Debug << '\n';
-					}
-				}
-				
-				for(unsigned i=0;i<n;++i)
-					diagonal[i] = realMatrix->Value(i, i);
-			}
-
-			unsigned index = 0;
-			for(unsigned y=0;y<n;++y)
-			{
-				for(unsigned x=y+1;x<n;++x)
-				{
-					outReal->SetValue(t, index, realMatrix->Value(x, y));
-					outImaginary->SetValue(t, index, imaginaryMatrix->Value(x, y));
-					++index;
-				}
-			}
-			
-			while(index < real->Height())
-			{
-				outReal->SetValue(t, index, 0.0);
-				outImaginary->SetValue(t, index, 0.0);
-				++index;
-			}
-		}
-		
-		VertEVD() { }
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/control/actionblock.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/control/actionblock.h
deleted file mode 100644
index c18f538aa2f7534e5f830ec1ea5e3802dc405c23..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/control/actionblock.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#ifndef RFIACTIONBLOCK_H
-#define RFIACTIONBLOCK_H
-
-#include <AOFlagger/strategy/control/actioncontainer.h>
-
-#include <AOFlagger/util/types.h>
-
-namespace rfiStrategy {
-
-	class ActionBlock : public ActionContainer
-	{
-		public:
-			virtual std::string Description()
-			{
-				return "Block";
-			}
-			virtual void Perform(class ArtifactSet &artifacts, ProgressListener &listener);
-
-			virtual unsigned int Weight() const
-			{
-				unsigned int weight = 0;
-				for(const_iterator i=begin();i!=end();++i)
-				{
-					weight += (*i)->Weight();
-				}
-				return weight;
-			}
-	};
-}
-
-#endif // RFIACTIONBLOCK_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/control/actioncontainer.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/control/actioncontainer.h
deleted file mode 100644
index 52576f60b332651adbc74371a1e9d2297a827c72..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/control/actioncontainer.h
+++ /dev/null
@@ -1,140 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#include <AOFlagger/strategy/actions/action.h>
-
-#ifndef RFIACTIONCONTAINER_H
-#define RFIACTIONCONTAINER_H 
-
-#include <vector>
-
-namespace rfiStrategy {
-
-	class ActionContainer : public Action
-	{
-		public:
-			typedef std::vector<class Action*>::const_iterator const_iterator;
-			typedef std::vector<class Action*>::iterator iterator;
-
-			inline virtual ~ActionContainer();
-			inline void Add(class Action *newAction);
-			inline void RemoveAndDelete(class Action *action);
-			inline void RemoveWithoutDelete(class Action *action);
-			inline void RemoveAll();
-			size_t GetChildCount() const throw() { return _childActions.size(); }
-			Action &GetChild(size_t index) const { return *_childActions[index]; }
-			Action &GetFirstChild() const { return *_childActions.front(); }
-			Action &GetLastChild() const { return *_childActions.back(); }
-			void MoveChildUp(size_t childIndex)
-			{
-				if(childIndex > 0)
-				{
-					class Action *movedAction = _childActions[childIndex];
-					_childActions[childIndex] = _childActions[childIndex-1];
-					_childActions[childIndex-1] = movedAction;
-				}
-			}
-			void MoveChildDown(size_t childIndex)
-			{
-				if(childIndex < _childActions.size()-1)
-				{
-					class Action *movedAction = _childActions[childIndex];
-					_childActions[childIndex] = _childActions[childIndex+1];
-					_childActions[childIndex+1] = movedAction;
-				}
-			}
-			inline void InitializeAll();
-			inline void FinishAll();
-
-			iterator begin() { return _childActions.begin(); }
-			iterator end() { return _childActions.end(); }
-			const_iterator begin() const { return _childActions.begin(); }
-			const_iterator end() const { return _childActions.end(); }
-		private:
-			std::vector<class Action*> _childActions;
-	};
-}
-
-#include <AOFlagger/strategy/actions/action.h>
-
-#include <AOFlagger/strategy/control/strategyiterator.h>
-
-namespace rfiStrategy {
-
-	ActionContainer::~ActionContainer()
-	{
-		for(std::vector<class Action*>::iterator i=_childActions.begin();i!=_childActions.end();++i)
-			delete *i;
-	}
-
-	void ActionContainer::RemoveAll()
-	{
-		for(std::vector<class Action*>::iterator i=_childActions.begin();i!=_childActions.end();++i)
-			delete *i;
-		_childActions.clear();
-	}
-
-	void ActionContainer::Add(class Action *newAction)
-	{
-		_childActions.push_back(newAction);
-		newAction->_parent = this;
-	}
-
-	void ActionContainer::RemoveWithoutDelete(class Action *action)
-	{
-		for(std::vector<class Action*>::iterator i=_childActions.begin();i!=_childActions.end();++i)
-			if(*i == action) {
-				_childActions.erase(i);
-				break;
-			}
-	}
-
-	void ActionContainer::RemoveAndDelete(class Action *action)
-	{
-		for(std::vector<class Action*>::iterator i=_childActions.begin();i!=_childActions.end();++i)
-			if(*i == action) {
-				_childActions.erase(i);
-				delete action;
-				break;
-			}
-	}
-
-	void ActionContainer::InitializeAll()
-	{
-		StrategyIterator i = StrategyIterator::NewStartIterator(*this);
-		while(!i.PastEnd())
-		{
-			i->Initialize();
-			++i;
-		}
-	}
-	
-	void ActionContainer::FinishAll()
-	{
-		StrategyIterator i = StrategyIterator::NewStartIterator(*this);
-		while(!i.PastEnd())
-		{
-			i->Finish();
-			++i;
-		}
-	}
-}
-
-#endif // RFIACTIONCONTAINER_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/control/actionfactory.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/control/actionfactory.h
deleted file mode 100644
index dd93a51a0c269fe415d4846ee618c4cef755c192..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/control/actionfactory.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef RFISTRATEGYACTIONFACTORY_H
-#define RFISTRATEGYACTIONFACTORY_H
-
-#include <string>
-#include <vector>
-
-#include <AOFlagger/strategy/actions/action.h>
-
-namespace rfiStrategy {
-
-	/**
-		@author A.R. Offringa <offringa@astro.rug.nl>
-	*/
-	class ActionFactory {
-		public:
-			static const std::vector<std::string> GetActionList();
-			static class Action *CreateAction(const std::string &action);
-			static const char *GetDescription(ActionType actionType);
-		private:
-			ActionFactory();
-			~ActionFactory();
-	};
-}
-
-#endif // RFISTRATEGYACTIONFACTORY_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/control/artifactset.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/control/artifactset.h
deleted file mode 100644
index f8fa9ded3485e93086f1490f8506bd9d406604a4..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/control/artifactset.h
+++ /dev/null
@@ -1,272 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#ifndef RFI_RFISTRATEGY_H
-#define RFI_RFISTRATEGY_H 
-
-#include <vector>
-
-#include <AOFlagger/msio/types.h>
-#include <AOFlagger/msio/timefrequencydata.h>
-#include <AOFlagger/msio/timefrequencymetadata.h>
-
-#include <AOFlagger/types.h>
-
-#include <AOFlagger/strategy/algorithms/types.h>
-
-#include <AOFlagger/strategy/control/types.h>
-
-class UVImager;
-
-namespace rfiStrategy {
-	class	ArtifactSet
-	{
-		public:
-			ArtifactSet(boost::mutex *ioMutex) : _metaData(), _sensitivity(1.0L), _projectedDirectionRad(0.0L), _imageSet(0),
-			_imageSetIndex(0), _imager(0),
-			_ioMutex(ioMutex),
-			_antennaFlagCountPlot(0), _frequencyFlagCountPlot(0),
-			_frequencyPowerPlot(0), _timeFlagCountPlot(0), _iterationsPlot(0),
-			_polarizationStatistics(0), _baselineSelectionInfo(0), _observatorium(0),
-			_model(0),
-			_horizontalProfile(), _verticalProfile()
-			{
-			}
-
-			ArtifactSet(const ArtifactSet &source)
-				: _originalData(source._originalData), _contaminatedData(source._contaminatedData),
-				_revisedData(source._revisedData), _metaData(source._metaData), _sensitivity(source._sensitivity), _projectedDirectionRad(source._projectedDirectionRad),
-				_imageSet(source._imageSet), _imageSetIndex(source._imageSetIndex),
-				_imager(source._imager), _ioMutex(source._ioMutex),
-				_antennaFlagCountPlot(source._antennaFlagCountPlot), _frequencyFlagCountPlot(source._frequencyFlagCountPlot),
-				_frequencyPowerPlot(source._frequencyPowerPlot),
-				_timeFlagCountPlot(source._timeFlagCountPlot),
-				_iterationsPlot(source._iterationsPlot),
-				_polarizationStatistics(source._polarizationStatistics),
-				_baselineSelectionInfo(source._baselineSelectionInfo),
-				_observatorium(source._observatorium),
-				_model(source._model),
-				_horizontalProfile(source._horizontalProfile),
-				_verticalProfile(source._verticalProfile)
-			{
-			}
-
-			~ArtifactSet()
-			{
-			}
-
-			ArtifactSet &operator=(const ArtifactSet &source)
-			{
-				_originalData = source._originalData;
-				_contaminatedData = source._contaminatedData;
-				_revisedData = source._revisedData;
-				_metaData = source._metaData;
-				_sensitivity = source._sensitivity;
-				_projectedDirectionRad = source._projectedDirectionRad;
-				_imageSet = source._imageSet;
-				_imageSetIndex = source._imageSetIndex;
-				_imager = source._imager;
-				_ioMutex = source._ioMutex;
-				_antennaFlagCountPlot = source._antennaFlagCountPlot;
-				_frequencyFlagCountPlot = source._frequencyFlagCountPlot;
-				_frequencyPowerPlot = source._frequencyPowerPlot;
-				_timeFlagCountPlot = source._timeFlagCountPlot;
-				_iterationsPlot = source._iterationsPlot;
-				_polarizationStatistics = source._polarizationStatistics;
-				_baselineSelectionInfo = source._baselineSelectionInfo;
-				_observatorium = source._observatorium;
-				_model = source._model;
-				_horizontalProfile = source._horizontalProfile;
-				_verticalProfile = source._verticalProfile;
-				return *this;
-			}
-
-			void SetOriginalData(const TimeFrequencyData &data)
-			{
-				_originalData = data;
-			}
-
-			void SetRevisedData(const TimeFrequencyData &data)
-			{
-				_revisedData = data;
-			}
-
-			void SetContaminatedData(const TimeFrequencyData &data)
-			{
-				_contaminatedData = data;
-			}
-
-			void SetSensitivity(numl_t sensitivity)
-			{
-				_sensitivity = sensitivity;
-			}
-			numl_t Sensitivity() const { return _sensitivity; }
-
-			const TimeFrequencyData &OriginalData() const { return _originalData; }
-			TimeFrequencyData &OriginalData() { return _originalData; }
-
-			const TimeFrequencyData &RevisedData() const { return _revisedData; }
-			TimeFrequencyData &RevisedData() { return _revisedData; }
-
-			const TimeFrequencyData &ContaminatedData() const { return _contaminatedData; }
-			TimeFrequencyData &ContaminatedData() { return _contaminatedData; }
-
-			class ImageSet *ImageSet() const { return _imageSet; }
-			void SetImageSet(class ImageSet *imageSet) { _imageSet = imageSet; }
-			void SetNoImageSet() { _imageSet = 0; _imageSetIndex = 0; }
-			
-			class ImageSetIndex *ImageSetIndex() const { return _imageSetIndex; }
-			void SetImageSetIndex(class ImageSetIndex *imageSetIndex) { _imageSetIndex = imageSetIndex; }
-
-			class UVImager *Imager() const { return _imager; }
-			void SetImager(class UVImager *imager) { _imager = imager; }
-			
-			bool HasImageSet() const { return _imageSet != 0; }
-			bool HasImageSetIndex() const { return _imageSetIndex != 0; }
-			bool HasImager() const { return _imager != 0; }
-
-			bool HasMetaData() const { return _metaData != 0; }
-			TimeFrequencyMetaDataCPtr MetaData()
-			{
-				return _metaData;
-			}
-			void SetMetaData(TimeFrequencyMetaDataCPtr metaData)
-			{
-				_metaData = metaData;
-			}
-
-			boost::mutex &IOMutex()
-			{
-				return *_ioMutex;
-			}
-
-			class AntennaFlagCountPlot *AntennaFlagCountPlot()
-			{
-				return _antennaFlagCountPlot;
-			}
-			void SetAntennaFlagCountPlot(class AntennaFlagCountPlot *plot)
-			{
-				_antennaFlagCountPlot = plot;
-			}
-			class FrequencyFlagCountPlot *FrequencyFlagCountPlot()
-			{
-				return _frequencyFlagCountPlot;
-			}
-			void SetFrequencyFlagCountPlot(class FrequencyFlagCountPlot *plot)
-			{
-				_frequencyFlagCountPlot = plot;
-			}
-			class FrequencyPowerPlot *FrequencyPowerPlot()
-			{
-				return _frequencyPowerPlot;
-			}
-			void SetFrequencyPowerPlot(class FrequencyPowerPlot *plot)
-			{
-				_frequencyPowerPlot = plot;
-			}
-			class TimeFlagCountPlot *TimeFlagCountPlot()
-			{
-				return _timeFlagCountPlot;
-			}
-			void SetTimeFlagCountPlot(class TimeFlagCountPlot *plot)
-			{
-				_timeFlagCountPlot = plot;
-			}
-			class PolarizationStatistics *PolarizationStatistics()
-			{
-				return _polarizationStatistics;
-			}
-			void SetPolarizationStatistics(class PolarizationStatistics *statistics)
-			{
-				_polarizationStatistics = statistics;
-			}
-			class BaselineSelector *BaselineSelectionInfo()
-			{
-				return _baselineSelectionInfo;
-			}
-			void SetIterationsPlot(class IterationsPlot *iterationsPlot)
-			{
-				_iterationsPlot = iterationsPlot;
-			}
-			class IterationsPlot *IterationsPlot()
-			{
-				return _iterationsPlot;
-			}
-			void SetBaselineSelectionInfo(class BaselineSelector *baselineSelectionInfo)
-			{
-				_baselineSelectionInfo = baselineSelectionInfo;
-			}
-			void SetObservatorium(class Observatorium *observatorium)
-			{
-				_observatorium = observatorium;
-			}
-			class Observatorium *Observatorium() const
-			{
-				return _observatorium;
-			}
-			void SetModel(class Model *model)
-			{
-				_model = model;
-			}
-			class Model *Model() const
-			{
-				return _model;
-			}
-			void SetProjectedDirectionRad(numl_t projectedDirectionRad)
-			{
-				_projectedDirectionRad = projectedDirectionRad;
-			}
-			numl_t ProjectedDirectionRad() const
-			{
-				return _projectedDirectionRad;
-			}
-			const std::vector<num_t> &HorizontalProfile() const { return _horizontalProfile; }
-			std::vector<num_t> &HorizontalProfile() { return _horizontalProfile; }
-			
-			const std::vector<num_t> &VerticalProfile() const { return _verticalProfile; }
-			std::vector<num_t> &VerticalProfile() { return _verticalProfile; }
-		private:
-			TimeFrequencyData _originalData;
-			TimeFrequencyData _contaminatedData;
-			TimeFrequencyData _revisedData;
-			TimeFrequencyMetaDataCPtr _metaData;
-			numl_t _sensitivity;
-			numl_t _projectedDirectionRad;
-
-			class ImageSet *_imageSet;
-			class ImageSetIndex *_imageSetIndex;
-			class UVImager *_imager;
-
-			boost::mutex *_ioMutex;
-			class AntennaFlagCountPlot *_antennaFlagCountPlot;
-			class FrequencyFlagCountPlot *_frequencyFlagCountPlot;
-			class FrequencyPowerPlot *_frequencyPowerPlot;
-			class TimeFlagCountPlot *_timeFlagCountPlot;
-			class IterationsPlot *_iterationsPlot;
-			
-			class PolarizationStatistics *_polarizationStatistics;
-			class BaselineSelector *_baselineSelectionInfo;
-			class Observatorium *_observatorium;
-			class Model *_model;
-			std::vector<num_t> _horizontalProfile, _verticalProfile;
-	};
-}
-
-#endif //RFI_RFISTRATEGY_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/control/defaultstrategyset.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/control/defaultstrategyset.h
deleted file mode 100644
index 26d8a73d4e0328ff23837bd67b52db412355e4c0..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/control/defaultstrategyset.h
+++ /dev/null
@@ -1,55 +0,0 @@
-#ifndef DEFAULTSTRATEGYSET_H
-#define DEFAULTSTRATEGYSET_H
-
-#include <string>
-
-#include <AOFlagger/strategy/actions/strategyaction.h>
-
-namespace aotools {
-	
-	enum DefaultStrategyIdentifier {
-		GUI_DEFAULT_STRATEGY,
-		LOFAR_DEFAULT_STRATEGY,
-		NDPPP_DEFAULT_STRATEGY,
-		VLA_DEFAULT_STRATEGY,
-		WSRT_DEFAULT_STRATEGY
-	};
-
-	class DefaultStrategySet
-	{
-		public:
-			StrategyAction *CreateStrategy(enum DefaultStrategyIdentifier identifier);
-			
-			const DefaultStrategyGroup RootGroup() const
-			{
-				
-			}
-		private:
-	};
-
-	class DefaultStrategyGroupItem
-	{
-		public:
-			DefaultStrategyGroupItem(const::string &name, const std::string &identifierString)
-			: _name(name), _identifierString(identifierString)
-			{
-			}
-		private:
-			std::string _name;
-			std::string _identifierString;
-	};
-
-	class DefaultStrategyGroup
-	{
-		public:
-			DefaultStrategyGroup(const std::string &name) : _name(name)
-			{
-			}
-		private:
-			const std::string _name;
-			std::vector<DefaultStrategyGroupItem> _strategies;
-			std::vector<DefaultStrategyGroup> _subGroups;
-	};
-}
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/control/strategyiterator.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/control/strategyiterator.h
deleted file mode 100644
index 34f402670cf97b5aec357394c33d3a35a45696f9..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/control/strategyiterator.h
+++ /dev/null
@@ -1,112 +0,0 @@
-#ifndef STRATEGY_ITERATOR_H
-#define STRATEGY_ITERATOR_H
-
-#include <stack>
-
-#include <AOFlagger/strategy/control/actioncontainer.h>
-
-namespace rfiStrategy
-{
-	class StrategyIterator
-	{
-		public:
-			StrategyIterator(const StrategyIterator &source)
-				: _indices(source._indices), _currentAction(source._currentAction)
-			{
-			}
-
-			StrategyIterator &operator=(const StrategyIterator &source)
-			{
-				_indices = source._indices;
-				_currentAction = source._currentAction;
-				return *this;
-			}
-
-			StrategyIterator &operator++()
-			{
-				ActionContainer *container = dynamic_cast<ActionContainer*>(_currentAction);
-				if(container != 0 && container->GetChildCount()!=0)
-				{
-					_currentAction = &container->GetFirstChild();
-					_indices.push(0);
-				} else {
-					// Current action is not a container, so go back levels until a next action is available
-					ActionContainer *parent = _currentAction->Parent();
-					size_t index = _indices.top();
-					_indices.pop();
-					++index;
-
-					while(_indices.size() != 0 && index >= parent->GetChildCount())
-					{
-						index = _indices.top();
-						_indices.pop();
-						parent = parent->Parent();
-						++index;
-					}
-
-					_indices.push(index);
-					if(parent != 0 && index < parent->GetChildCount())
-					{
-						_currentAction = &parent->GetChild(index);
-					} else {
-						while(_currentAction->Parent() != 0)
-							_currentAction = _currentAction->Parent();
-					}
-				}
-				return *this;
-			}
-
-			Action &operator*() const
-			{
-				return *_currentAction;
-			}
-
-			Action *operator->() const
-			{
-				return _currentAction;
-			}
-
-			bool PastEnd() const
-			{
-				if(_indices.size() != 1)
-				{
-					return false;
-				} else
-				{
-					ActionContainer *container = static_cast<ActionContainer*>(_currentAction);
-					return _indices.top() >= container->GetChildCount();
-				}
-			}
-
-			static StrategyIterator NewStartIterator(ActionContainer &action)
-			{
-				return StrategyIterator(&action, 0);
-			}
-
-			static StrategyIterator NewEndIterator(ActionContainer &action)
-			{
-				return StrategyIterator(&action, action.GetChildCount());
-			}
-
-		private:
-			StrategyIterator(Action *rootAction, size_t rootIndex)
-			: _currentAction(rootAction)
-			{
-				_indices.push(rootIndex);
-			} 
-
-			// _indices contains the path that is followed to reach the _currentAction, starting from the root
-			// action. It contains always at least one value. It has one zero value if the iterator is
-			// pointing to the root strategy (without children)
-			// and contains one value ChildCount of root if the iterator is pointed past the root strategy.
-			std::stack<size_t> _indices;
-
-			// _currentAction is the action currently pointed at by the iterator, except if
-			// the iterator is pointed past the end. In that case, it points to the root
-			// action.
-			Action *_currentAction;
-	};
-
-}
-
-#endif // STRATEGY_ITERATOR_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/control/strategyreader.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/control/strategyreader.h
deleted file mode 100644
index 56a47204833b60d5d6f801ceee8e39d1a2f1e025..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/control/strategyreader.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2012 by A.R. Offringa                                   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef RFISTRATEGYREADER_H
-#define RFISTRATEGYREADER_H
-
-#include <stdexcept>
-#include <string>
-
-#include <libxml/parser.h>
-#include <libxml/tree.h>
-
-namespace rfiStrategy {
-
-	class StrategyReaderError : public std::runtime_error
-	{
-		public:
-			StrategyReaderError(const std::string &arg) : std::runtime_error(arg) { }
-	};
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class StrategyReader {
-	public:
-		StrategyReader();
-		~StrategyReader();
-
-		class Strategy *CreateStrategyFromFile(const std::string &filename);
-	private:
-		class Action *parseChild(xmlNode *node);
-		class Strategy *parseStrategy(xmlNode *node);
-		class Strategy *parseRootChildren(xmlNode *rootNode);
-		void parseChildren(xmlNode *node, class ActionContainer *parent);
-		class Action *parseAction(xmlNode *node);
-
-		xmlNode *getTextNode(xmlNode *node, const char *subNodeName, bool allowEmpty = false) const;
-		int getInt(xmlNode *node, const char *name) const;
-		double getDouble(xmlNode *node, const char *name) const;
-		std::string getString(xmlNode *node, const char *name) const;
-		bool getBool(xmlNode *node, const char *name) const { return getInt(node,name) != 0; }
-
-		class Action *parseAbsThresholdAction(xmlNode *node);
-		class Action *parseAdapter(xmlNode *node);
-		class Action *parseAddStatistics(xmlNode *node);
-		class Action *parseBaselineSelectionAction(xmlNode *node);
-		class Action *parseChangeResolutionAction(xmlNode *node);
-		class Action *parseCollectNoiseStatisticsAction(xmlNode *node);
-		class Action *parseCombineFlagResults(xmlNode *node);
-		class Action *parseCutAreaAction(xmlNode *node);
-		class Action *parseDirectionalCleanAction(xmlNode *node);
-		class Action *parseDirectionProfileAction(xmlNode *node);
-		class Action *parseEigenValueVerticalAction(xmlNode *node);
-		class Action *parseForEachBaselineAction(xmlNode *node);
-		class Action *parseForEachComplexComponentAction(xmlNode *node);
-		class Action *parseForEachMSAction(xmlNode *node);
-		class Action *parseForEachPolarisationBlock(xmlNode *node);
-		class Action *parseFourierTransformAction(xmlNode *node);
-		class Action *parseFrequencyConvolutionAction(xmlNode *node);
-		class Action *parseFrequencySelectionAction(xmlNode *node);
-		class Action *parseFringeStopAction(xmlNode *node);
-		class Action *parseHighPassFilterAction(xmlNode *node);
-		class Action *parseImagerAction(xmlNode *node);
-		class Action *parseIterationBlock(xmlNode *node);
-		class Action *parseNormalizeVarianceAction(xmlNode *node);
-		class Action *parsePlotAction(xmlNode *node);
-		class Action *parseQuickCalibrateAction(xmlNode *node);
-		class Action *parseRawAppenderAction(xmlNode *node);
-		class Action *parseSetFlaggingAction(xmlNode *node);
-		class Action *parseSetImageAction(xmlNode *node);
-		class Action *parseSlidingWindowFitAction(xmlNode *node);
-		class Action *parseStatisticalFlagAction(xmlNode *node);
-		class Action *parseSVDAction(xmlNode *node);
-		class Action *parseSumThresholdAction(xmlNode *node);
-		class Action *parseTimeConvolutionAction(xmlNode *node);
-		class Action *parseTimeSelectionAction(xmlNode *node);
-		class Action *parseUVProjectAction(xmlNode *node);
-		class Action *parseWriteDataAction(xmlNode *node);
-		class Action *parseWriteFlagsAction(xmlNode *node);
-
-		xmlDocPtr _xmlDocument;
-
-		static int useCount;
-};
-
-}
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/control/strategywriter.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/control/strategywriter.h
deleted file mode 100644
index d216cbf5d5222ad0ecf8a4483702c82fb7aca0ee..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/control/strategywriter.h
+++ /dev/null
@@ -1,121 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef RFISTRATEGYWRITER_H
-#define RFISTRATEGYWRITER_H
-
-#include <set>
-#include <sstream>
-#include <string>
-#include <stdexcept>
-
-#include <AOFlagger/util/xmlwriter.h>
-
-#include <AOFlagger/strategy/actions/action.h>
-
-namespace rfiStrategy {
-
-	class StrategyWriterError : public std::runtime_error
-	{
-		public:
-			StrategyWriterError(const std::string &arg) : std::runtime_error(arg) { }
-	};
-
-	/**
-		@author A.R. Offringa <offringa@astro.rug.nl>
-	*/
-	class StrategyWriter : private XmlWriter {
-		public:
-			StrategyWriter() : _writeDescriptions(false)
-			{
-			}
-			~StrategyWriter()
-			{
-			}
-
-			void WriteToFile(const class Strategy &strategy, const std::string &filename)
-			{
-				StartDocument(filename);
-				write(strategy);
-			}
-
-			void WriteToStream(const class Strategy &strategy, std::ostream &stream)
-			{
-				StartDocument(stream);
-				write(strategy);
-			}
-
-			void SetWriteComments(bool writeDescriptions)
-			{
-				_writeDescriptions = writeDescriptions;
-			}
-		private:
-			void write(const class Strategy &strategy);
-
-			void writeAction(const class Action &action);
-			void writeContainerItems(const class ActionContainer &actionContainer);
-
-			void writeAbsThresholdAction(const class AbsThresholdAction &action);
-			void writeAdapter(const class Adapter &action);
-			void writeAddStatisticsAction(const class AddStatisticsAction &action);
-			void writeBaselineSelectionAction(const class BaselineSelectionAction &action);
-			void writeChangeResolutionAction(const class ChangeResolutionAction &action);
-			void writeCollectNoiseStatisticsAction(const class CollectNoiseStatisticsAction &action);
-			void writeCombineFlagResults(const class CombineFlagResults &action);
-			void writeCutAreaAction(const class CutAreaAction &action);
-			void writeDirectionalCleanAction(const class DirectionalCleanAction &action);
-			void writeDirectionProfileAction(const class DirectionProfileAction &action);
-			void writeEigenValueVerticalAction(const class EigenValueVerticalAction &action);
-			void writeForEachBaselineAction(const class ForEachBaselineAction &action);
-			void writeForEachComplexComponentAction(const class ForEachComplexComponentAction &action);
-			void writeForEachMSAction(const class ForEachMSAction &action);
-			void writeForEachPolarisationBlock(const class ForEachPolarisationBlock &action);
-			void writeFourierTransformAction(const class FourierTransformAction &action);
-			void writeFrequencyConvolutionAction(const class FrequencyConvolutionAction &action);
-			void writeFrequencySelectionAction(const class FrequencySelectionAction &action);
-			void writeFringeStopAction(const class FringeStopAction &action);
-			void writeHighPassFilterAction(const class HighPassFilterAction &action);
-			void writeImagerAction(const class ImagerAction &action);
-			void writeIterationBlock(const class IterationBlock &action);
-			void writeNormalizeVarianceAction(const class NormalizeVarianceAction &action);
-			void writePlotAction(const class PlotAction &action);
-			void writeQuickCalibrateAction(const class QuickCalibrateAction &action);
-			void writeRawAppenderAction(const class RawAppenderAction &action);
-			void writeSetFlaggingAction(const class SetFlaggingAction &action);
-			void writeSetImageAction(const class SetImageAction &action);
-			void writeSlidingWindowFitAction(const class SlidingWindowFitAction &action);
-			void writeStatisticalFlagAction(const class StatisticalFlagAction &action);
-			void writeStrategy(const class Strategy &action);
-			void writeSVDAction(const class SVDAction &action);
-			void writeSumThresholdAction(const class SumThresholdAction &action);
-			void writeTimeConvolutionAction(const class TimeConvolutionAction &action);
-			void writeTimeSelectionAction(const class TimeSelectionAction &action);
-			void writeUVProjectAction(const class UVProjectAction &action);
-			void writeWriteDataAction(const class WriteDataAction &action);
-			void writeWriteFlagsAction(const class WriteFlagsAction &action);
-
-			std::string wrap(const std::string &input, size_t max) const;
-
-			bool _writeDescriptions;
-			std::set<enum ActionType> _describedActions;
-	};
-
-}
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/control/types.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/control/types.h
deleted file mode 100644
index 3ed997f48076d58b6373085b2a89c088397a4b32..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/control/types.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#ifndef RFI_STRATEGY_TYPES
-#define RFI_STRATEGY_TYPES
-
-namespace rfiStrategy
-{
-	class Action;
-	class ActionBlock;
-	class ActionContainer;
-	class ActionFactory;
-	class ArtifactSet;
-	class CombineFlagResults;
-	class ForEachPolarisationBlock;
-	class ImageSet;
-	class ImageSetIndex;
-	class IterationBlock;
-	class MSImageSet;
-	class Strategy;
-
-	enum BaselineSelection
-	{
-		All, CrossCorrelations, AutoCorrelations, EqualToCurrent, AutoCorrelationsOfCurrentAntennae, Current
-	};
-}
-
-class Model;
-class Observatorium;
-
-// The current file format version
-// 1.0 : start
-// 1.1 : add AddStatisticsAction
-// 1.2 : add restore-originals property to Adapter
-// 1.3 : removed LoadFlags en LoadImage actions.
-// 1.4 : changed the ChangeResolutionAction to contain frequency res changing in addition to
-//       time res changing (parameters were renamed).
-// 1.5 : added the CutAreaAction and added "file-prefix" parameter of AddStatistics action.
-// 1.6 : added the BaselineSelectionAction
-// 1.7 : added "abs-threshold" and "smoothing-sigma" parameters to the BaselineSelectionAction 
-// 1.8 : added "compare-original-and-alternative" parameter to AddStatisticsAction, added the enum
-//       value ToOriginal in enum NewFlagging, pamarameter of SetFlaggingAction.
-// 1.9 : allow formatting of the xml file by white space
-// 2.0 : added the TimeconvolutionAction and the ForEachComplexComponentAction (to replace the Adapter)
-// 2.1 : added min-window-size to FringeStopAction
-// 2.2 : removed iterate-stokes-values parameter of ForEachBaselineAction, replaced width individual
-//       on-xx, on-xy, ..., on-stokes-v & added enumeration value "SetFlaggedValuesToZero"
-//       in SetImageAction.
-// 2.3 : option "separate-baseline-statistics" added for AddStatisticsAction.
-// 2.4 : added DirectionCleanAction, FourierTransformAction and UVProjectAction
-// 2.5 : added enumeration value FromRevised in SetImageAction
-// 2.6 : added "data-column-name", "subtract-model" and removed "data-kind" from ForEachBaselineAction, changed
-//       some filter parameters.
-// 2.7 : moved data-column-name etc. to the ForEachMSAction.
-// 2.8 : added interpolate nans task
-// 2.9 : removed precision parameter in SlidingWindowFit action.
-// 2.10 : added perform-classification in AddToStatistics action.
-//        at present, it seems the reader does not support a version of 2.10, as it treats it as a float
-//        hence version renamed to:
-// 3.0 : as 2.10
-// 3.1 : added the CollectNoiseStatisticsAction.
-// 3.2 : added parameter "write-immediately" to the Add Statistics Action.
-// 3.3 : the meaning of statisticalflagaction::_minimumGoodTime- en FrequencyRatio was fixed, so that
-//       higher values represent a more strengent requirement as one would expect. The default value was
-//       changed to accomodate the change (used to be 0.8, now approx 0.2).
-// 3.4 : Renamed ThresholdAction to SumThresholdAction
-// 3.5 : Added the AbsThresholdAction
-// 3.6 : Added the DirectionProfileAction and the EigenValueVerticalAction.
-// 3.7 : Added the NormalizeVarianceAction
-#define STRATEGY_FILE_FORMAT_VERSION 3.7
-
-// The earliest format version which can be read by this version of the software
-#define STRATEGY_FILE_FORMAT_VERSION_REQUIRED 3.4
-
-// The earliest software version which is required to read the written files
-#define STRATEGY_FILE_READER_VERSION_REQUIRED 3.4
-
-#endif // RFI_STRATEGY_TYPES
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/imagesets/fitsimageset.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/imagesets/fitsimageset.h
deleted file mode 100644
index 092e1046c3eff5025b6cce08b99c7880ebec4370..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/imagesets/fitsimageset.h
+++ /dev/null
@@ -1,142 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef FITSIMAGESET_H
-#define FITSIMAGESET_H
-
-#include <vector>
-#include <set>
-#include <stack>
-
-#include <AOFlagger/strategy/imagesets/imageset.h>
-
-#include <AOFlagger/baseexception.h>
-
-#include <AOFlagger/msio/antennainfo.h>
-#include <AOFlagger/msio/types.h>
-
-namespace rfiStrategy {
-	
-	class FitsImageSetIndex : public ImageSetIndex {
-		friend class FitsImageSet;
-		
-		FitsImageSetIndex(class rfiStrategy::ImageSet &set) : ImageSetIndex(set), _baselineIndex(0), _band(0), _field(0), _isValid(true) { }
-		
-		virtual void Previous();
-		virtual void Next();
-		virtual void LargeStepPrevious();
-		virtual void LargeStepNext();
-		virtual std::string Description() const;
-		virtual bool IsValid() const throw() { return _isValid; }
-		virtual FitsImageSetIndex *Copy() const
-		{
-			FitsImageSetIndex *index = new FitsImageSetIndex(imageSet());
-			index->_baselineIndex = _baselineIndex;
-			index->_band = _band;
-			index->_field = _field;
-			index->_isValid = _isValid;
-			return index;
-		}
-		private:
-			size_t _baselineIndex, _band, _field;
-			bool _isValid;
-	};
-
-	/**
-		@author A.R. Offringa <offringa@astro.rug.nl>
-	*/
-	class FitsImageSet : public ImageSet
-	{
-		public:
-			FitsImageSet(const std::string &file);
-			~FitsImageSet();
-			virtual void Initialize();
-
-			virtual FitsImageSet *Copy();
-
-			virtual ImageSetIndex *StartIndex()
-			{
-				return new FitsImageSetIndex(*this);
-			}
-			virtual std::string Name()
-			{
-				return "Fits file";
-			}
-			virtual std::string File();
-			const std::vector<std::pair<size_t,size_t> > &Baselines() const throw() { return _baselines; }
-			size_t BandCount() { return _bandCount; }
-			class AntennaInfo GetAntennaInfo(unsigned antennaIndex) { return _antennaInfos[antennaIndex]; }
-			virtual void WriteFlags(const ImageSetIndex &, TimeFrequencyData &)
-			{
-				throw BadUsageException("Fits format is not supported for writing flags yet");
-			}
-			virtual void AddReadRequest(const ImageSetIndex &index)
-			{
-				_baselineData.push(loadData(index));
-			}
-			virtual void PerformReadRequests()
-			{
-			}
-			virtual BaselineData *GetNextRequested()
-			{
-				BaselineData *data = new BaselineData(_baselineData.top());
-				_baselineData.pop();
-				return data;
-			}
-			virtual void AddWriteFlagsTask(const ImageSetIndex &index, std::vector<Mask2DCPtr> &flags);
-			virtual void PerformWriteFlagsTask();
-			virtual void PerformWriteDataTask(const ImageSetIndex &, std::vector<Image2DCPtr>, std::vector<Image2DCPtr>)
-			{
-				throw BadUsageException("Not implemented");
-			}
-			
-		private:
-			BaselineData loadData(const ImageSetIndex &index);
-			
-			size_t getAntenna1(const ImageSetIndex &index) {
-				return _baselines[static_cast<const FitsImageSetIndex&>(index)._baselineIndex].first;
-			}
-			size_t getAntenna2(const ImageSetIndex &index) {
-				return _baselines[static_cast<const FitsImageSetIndex&>(index)._baselineIndex].second;
-			}
-			
-			void ReadPrimarySingleTable(TimeFrequencyData &data, TimeFrequencyMetaData &metaData);
-			void ReadTable(TimeFrequencyData &data, TimeFrequencyMetaData &metaData, size_t bandIndex);
-			void ReadAntennaTable(TimeFrequencyMetaData &metaData);
-			void ReadFrequencyTable(TimeFrequencyData &data, TimeFrequencyMetaData &metaData);
-			void ReadCalibrationTable();
-			void ReadSingleDishTable(TimeFrequencyData &data, TimeFrequencyMetaData &metaData, size_t ifIndex);
-			TimeFrequencyData ReadPrimaryGroupTable(size_t baselineIndex, int band, int stokes, TimeFrequencyMetaData &metaData);
-			
-			void saveSingleDishFlags(std::vector<Mask2DCPtr> &flags);
-			
-			class FitsFile *_file;
-			std::vector<std::pair<size_t,size_t> > _baselines;
-			size_t _bandCount;
-			std::vector<AntennaInfo> _antennaInfos;
-			std::vector<BandInfo> _bandInfos;
-			size_t _currentBaselineIndex, _currentBandIndex;
-			double _frequencyOffset;
-			
-			std::stack<BaselineData> _baselineData;
-	};
-
-}
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/imagesets/harishreader.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/imagesets/harishreader.h
deleted file mode 100644
index 74defb33059e745554029b6f0b18ab816c1d13a1..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/imagesets/harishreader.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#ifndef HARISHREADER_H
-#define HARISHREADER_H
-
-#include <string>
-#include <fstream>
-#include <set>
-#include <map>
-#include <cmath>
-
-#include <AOFlagger/msio/types.h>
-
-#include <AOFlagger/strategy/imagesets/singleimageset.h>
-
-#include <AOFlagger/util/aologger.h>
-
-namespace rfiStrategy {
-
-	class HarishReader : public SingleImageSet {
-		public:
-			HarishReader(const std::string &path) : SingleImageSet(), _path(path)
-			{
-			}
-
-			virtual ImageSet *Copy()
-			{
-				return 0;
-			}
-
-			virtual void Initialize()
-			{
-			}
-
-			virtual std::string Name()
-			{
-				return "Harish format";
-			}
-			
-			virtual std::string File()
-			{
-				return _path;
-			}
-			
-			virtual BaselineData *Read()
-			{
-				size_t timeStepCount = 176190;
-				Image2DPtr image = Image2D::CreateZeroImagePtr(timeStepCount, 80);
-				std::ifstream file(_path.c_str());
-				for(size_t f=0;f<80;++f)
-				{
-					double buffer[timeStepCount];
-					file.read(reinterpret_cast<char *>(buffer), timeStepCount * sizeof(double));
-					for(size_t t=0;t<timeStepCount;++t)
-					{
-						image->SetValue(t, f, buffer[t]);
-					}
-				}
-				
-				TimeFrequencyData tfData(TimeFrequencyData::AmplitudePart,
-					SinglePolarisation,
-					image);
-				return new BaselineData(tfData, TimeFrequencyMetaDataCPtr());
-			}
-
-		private:
-			std::string _path;
-	};
-	
-}
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/imagesets/imageset.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/imagesets/imageset.h
deleted file mode 100644
index 34242bc400271a7942fd22bf706e82a8776e335f..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/imagesets/imageset.h
+++ /dev/null
@@ -1,185 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#ifndef GUI_IMAGESET_H
-#define GUI_IMAGESET_H
-
-#include <string>
-#include <cstring>
-#include <vector>
-
-#include <AOFlagger/msio/types.h>
-#include <AOFlagger/msio/timefrequencydata.h>
-#include <AOFlagger/msio/timefrequencymetadata.h>
-
-namespace rfiStrategy {
-
-	class ImageSet;
-	
-	class ImageSetIndex {
-		public:
-			ImageSetIndex(ImageSet &set) : _set(&set) { }
-			virtual ~ImageSetIndex() { }
-			virtual void Previous() = 0;
-			virtual void Next() = 0;
-			virtual void LargeStepPrevious() = 0;
-			virtual void LargeStepNext() = 0;
-			virtual std::string Description() const = 0;
-			virtual bool IsValid() const = 0;
-			virtual ImageSetIndex *Copy() const = 0;
-			void Reattach(ImageSet &imageSet) { _set = &imageSet; }
-		protected:
-			ImageSet &imageSet() const { return *_set; }
-		private:
-			class ImageSet *_set;
-	};
-	
-	class BaselineData {
-		public:
-			BaselineData(TimeFrequencyData data, TimeFrequencyMetaDataCPtr metaData, const ImageSetIndex &index)
-			: _data(data), _metaData(metaData), _index(index.Copy())
-			{
-			}
-			BaselineData(const ImageSetIndex &index)
-			: _data(), _metaData(), _index(index.Copy())
-			{
-			}
-			BaselineData(TimeFrequencyData data, TimeFrequencyMetaDataCPtr metaData)
-			: _data(data), _metaData(metaData), _index(0)
-			{
-			}
-			BaselineData(TimeFrequencyMetaDataCPtr metaData)
-			: _data(), _metaData(metaData), _index(0)
-			{
-			}
-			BaselineData()
-			: _data(), _metaData(), _index(0)
-			{
-			}
-			BaselineData(const BaselineData &source)
-			: _data(source._data), _metaData(source._metaData), _index(0)
-			{
-				if(source._index != 0) _index = source._index->Copy();
-			}
-			~BaselineData()
-			{
-				if(_index != 0)
-					delete _index;
-			}
-			void operator=(const BaselineData &source)
-			{
-				if(_index != 0)
-					delete _index;
-				_data = source._data;
-				_metaData = source._metaData;
-				_index = source._index->Copy();
-			}
-			const TimeFrequencyData &Data() const { return _data; }
-			void SetData(const TimeFrequencyData &data) { _data = data; }
-			
-			TimeFrequencyMetaDataCPtr MetaData() const { return _metaData; }
-			void SetMetaData(TimeFrequencyMetaDataCPtr metaData) { _metaData = metaData; }
-
-			const ImageSetIndex &Index() const { return *_index; }
-			ImageSetIndex &Index() { return *_index; }
-			void SetIndex(const ImageSetIndex &newIndex)
-			{
-				if(_index != 0)
-					delete _index;
-				_index = newIndex.Copy();
-			}
-		
-		private:
-			TimeFrequencyData _data;
-			TimeFrequencyMetaDataCPtr _metaData;
-			ImageSetIndex *_index;
-	};
-	
-	class ImageSet {
-		public:
-			virtual ~ImageSet() { };
-			virtual ImageSet *Copy() = 0;
-
-			virtual ImageSetIndex *StartIndex() = 0;
-			
-			/**
-			 * Initialize is used to initialize the image set after it has been created and
-			 * after all possible options have been set that might influence initialization
-			 * (such as number of parts to read).
-			 */
-			virtual void Initialize() = 0;
-			virtual std::string Name() = 0;
-			virtual std::string File() = 0;
-			virtual void WriteFlags(const ImageSetIndex &/*index*/, TimeFrequencyData &/*data*/)
-			{
-				throw std::runtime_error("Not implemented");
-			}
-			static class ImageSet *Create(const std::string &file, BaselineIOMode ioMode, bool readUVW=false);
-			static bool IsFitsFile(const std::string &file);
-			static bool IsRCPRawFile(const std::string &file);
-			static bool IsTKPRawFile(const std::string &file);
-			static bool IsRawDescFile(const std::string &file);
-			static bool IsParmFile(const std::string &file);
-			static bool IsTimeFrequencyStatFile(const std::string &file);
-			static bool IsMSFile(const std::string &file);
-			static bool IsNoiseStatFile(const std::string &file);
-			static bool IsHarishFile(const std::string &file);
-
-			virtual void AddReadRequest(const ImageSetIndex &index) = 0;
-			virtual void PerformReadRequests() = 0;
-			virtual BaselineData *GetNextRequested() = 0;
-			
-			void AddWriteFlagsTask(const ImageSetIndex &index, const TimeFrequencyData &data)
-			{
-				std::vector<Mask2DCPtr> flags;
-				for(size_t i=0;i!=data.MaskCount();++i)
-					flags.push_back(data.GetMask(i));
-				AddWriteFlagsTask(index, flags);
-			}
-			virtual void AddWriteFlagsTask(const ImageSetIndex &/*index*/, std::vector<Mask2DCPtr> &/*flags*/)
-			{
-				throw std::runtime_error("Not implemented");
-			}
-			virtual void PerformWriteFlagsTask()
-			{
-				throw std::runtime_error("Not implemented");
-			}
-
-			void PerformWriteDataTask(const ImageSetIndex &index, const TimeFrequencyData &data)
-			{
-				std::vector<Image2DCPtr> realImages, imaginaryImages;
-				for(size_t i=0;i!=data.PolarisationCount();++i)
-				{
-					TimeFrequencyData *polData = data.CreateTFDataFromPolarisationIndex(i);
-					realImages.push_back(polData->GetRealPart());
-					imaginaryImages.push_back(polData->GetImaginaryPart());
-					delete polData;
-				}
-				PerformWriteDataTask(index, realImages, imaginaryImages);
-			}
-			virtual void PerformWriteDataTask(const ImageSetIndex &/*index*/, std::vector<Image2DCPtr> /*_realImages*/, std::vector<Image2DCPtr> /*_imaginaryImages*/)
-			{
-				throw std::runtime_error("Not implemented");
-			}
-	};
-
-}
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/imagesets/msimageset.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/imagesets/msimageset.h
deleted file mode 100644
index c6bbaefbaf9c7d085d62a07793036ed0207232d9..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/imagesets/msimageset.h
+++ /dev/null
@@ -1,263 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef MSIMAGESET_H
-#define MSIMAGESET_H
-
-#include <set>
-#include <string>
-#include <stdexcept>
-
-#include <AOFlagger/msio/antennainfo.h>
-#include <AOFlagger/msio/timefrequencydata.h>
-#include <AOFlagger/msio/timefrequencymetadata.h>
-#include <AOFlagger/msio/baselinereader.h>
-#include <AOFlagger/msio/measurementset.h>
-
-#include <AOFlagger/strategy/imagesets/imageset.h>
-
-#include <AOFlagger/util/aologger.h>
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-
-namespace rfiStrategy {
-
-	class MSImageSetIndex : public ImageSetIndex {
-		public:
-			friend class MSImageSet;
-			
-			MSImageSetIndex(class rfiStrategy::ImageSet &set) : ImageSetIndex(set), _baselineIndex(0), _band(0), _field(0), _partIndex(0), _isValid(true) { }
-			
-			virtual void Previous();
-			virtual void Next();
-			virtual void LargeStepPrevious();
-			virtual void LargeStepNext();
-			virtual std::string Description() const;
-			virtual bool IsValid() const { return _isValid; }
-			virtual MSImageSetIndex *Copy() const
-			{
-				MSImageSetIndex *index = new MSImageSetIndex(imageSet());
-				index->_baselineIndex = _baselineIndex;
-				index->_band = _band;
-				index->_field = _field;
-				index->_partIndex = _partIndex;
-				index->_isValid = _isValid;
-				return index;
-			}
-		private:
-			size_t _baselineIndex, _band, _field, _partIndex;
-			bool _isValid;
-	};
-	
-	class MSImageSet : public ImageSet {
-		public:
-			MSImageSet(const std::string &location, BaselineIOMode ioMode) :
-				_msFile(location),
-				_set(location),
-				_reader(),
-				_dataColumnName("DATA"), _subtractModel(false),
-				_readDipoleAutoPolarisations(true),
-				_readDipoleCrossPolarisations(true),
-				_readStokesI(false),
-				_maxScanCounts(0),
-				_scanCountPartOverlap(100),
-				_readFlags(true),
-				_readUVW(false),
-				_ioMode(ioMode)
-			{
-			}
-			
-			~MSImageSet()
-			{
-			}
-
-			virtual MSImageSet *Copy()
-			{
-				MSImageSet *newSet = new MSImageSet(_set.Location(), _ioMode);
-				newSet->_reader = _reader;
-				newSet->_dataColumnName = _dataColumnName;
-				newSet->_subtractModel = _subtractModel;
-				newSet->_readDipoleAutoPolarisations = _readDipoleAutoPolarisations;
-				newSet->_readDipoleCrossPolarisations = _readDipoleCrossPolarisations;
-				newSet->_readStokesI = _readStokesI;
-				newSet->_readFlags = _readFlags;
-				newSet->_baselines = _baselines;
-				newSet->_bandCount = _bandCount;
-				newSet->_maxScanCounts = _maxScanCounts;
-				newSet->_partCount = _partCount;
-				newSet->_timeScanCount = _timeScanCount;
-				newSet->_scanCountPartOverlap = _scanCountPartOverlap;
-				newSet->_ioMode = _ioMode;
-				newSet->_readUVW = _readUVW;
-				return newSet;
-			}
-	
-			virtual std::string Name() { return _set.Location(); }
-			virtual std::string File() { return _set.Location(); }
-			virtual TimeFrequencyData *LoadData(const ImageSetIndex &index);
-			
-			virtual void AddReadRequest(const ImageSetIndex &index);
-			virtual void PerformReadRequests();
-			virtual BaselineData *GetNextRequested();
-
-			virtual void AddWriteFlagsTask(const ImageSetIndex &index, std::vector<Mask2DCPtr> &flags);
-			virtual void PerformWriteFlagsTask();
-
-			virtual void Initialize();
-	
-			virtual size_t GetAntenna1(const ImageSetIndex &index) {
-				return _baselines[static_cast<const MSImageSetIndex&>(index)._baselineIndex].first;
-			}
-			virtual size_t GetAntenna2(const ImageSetIndex &index) {
-				return _baselines[static_cast<const MSImageSetIndex&>(index)._baselineIndex].second;
-			}
-			size_t GetBand(const ImageSetIndex &index) {
-				return static_cast<const MSImageSetIndex&>(index)._band;
-			}
-			virtual size_t GetPart(const ImageSetIndex &index) {
-				return static_cast<const MSImageSetIndex&>(index)._partIndex;
-			}
-
-	
-			virtual ImageSetIndex *StartIndex() { return new MSImageSetIndex(*this); }
-
-			MSImageSetIndex *Index(size_t a1, size_t a2, size_t b)
-			{
-				MSImageSetIndex *index = new MSImageSetIndex(*this);
-				index->_baselineIndex = FindBaselineIndex(a1, a2);
-				index->_band = b;
-				return index;
-			}
-			
-			const std::string &DataColumnName() const { return _dataColumnName; }
-			void SetDataColumnName(const std::string &name) {
-				if(_reader != 0)
-					throw std::runtime_error("Trying to set data column after creating the reader!");
-				_dataColumnName = name;
-			}
-
-			bool SubtractModel() const { return _subtractModel; }
-			void SetSubtractModel(bool subtractModel) {
-				if(_reader != 0)
-					throw std::runtime_error("Trying to set model subtraction after creating the reader!");
-				_subtractModel = subtractModel;
-			}
-
-			void SetReadAllPolarisations() throw()
-			{
-				if(_reader != 0)
-					throw std::runtime_error("Trying to set polarization to read after creating the reader!");
-				_readDipoleAutoPolarisations = true;
-				_readDipoleCrossPolarisations = true;
-				_readStokesI = false;
-			}
-			void SetReadDipoleAutoPolarisations() throw()
-			{
-				if(_reader != 0)
-					throw std::runtime_error("Trying to set polarization to read after creating the reader!");
-				_readDipoleAutoPolarisations = true;
-				_readDipoleCrossPolarisations = false;
-				_readStokesI = false;
-			}
-			void SetReadStokesI() throw()
-			{
-				if(_reader != 0)
-					throw std::runtime_error("Trying to set polarization to read after creating the reader!");
-				_readStokesI = true;
-				_readDipoleAutoPolarisations = false;
-				_readDipoleCrossPolarisations = false;
-			}
-			void SetMaxScanCounts(size_t maxScanCounts) throw()
-			{
-				_maxScanCounts = maxScanCounts;
-			}
-
-			size_t AntennaCount() { return _set.AntennaCount(); }
-			class ::AntennaInfo GetAntennaInfo(unsigned antennaIndex) { return _set.GetAntennaInfo(antennaIndex); }
-			class ::BandInfo GetBandInfo(unsigned bandIndex)
-			{
-				return _set.GetBandInfo(bandIndex);
-			}
-			/*const std::set<double> &GetObservationTimesSet(const ImageSetIndex &index)
-			{
-				const MSImageSetIndex &msIndex = static_cast<const MSImageSetIndex &>(index);
-				return _reader->ObservationTimes(StartIndex(index), EndIndex(index));
-			}*/
-			std::vector<double> ObservationTimesVector(const ImageSetIndex &index)
-			{
-				const MSImageSetIndex &msIndex = static_cast<const MSImageSetIndex &>(index);
-				return _reader->ObservationTimes(StartIndex(msIndex), EndIndex(msIndex));
-			}
-			const std::vector<std::pair<size_t,size_t> > &Baselines() const { return _baselines; }
-			size_t BandCount() const { return _bandCount; }
-			virtual void WriteFlags(const ImageSetIndex &index, TimeFrequencyData &data);
-			size_t PartCount() const { return _partCount; }
-			void SetReadFlags(bool readFlags) { _readFlags = readFlags; }
-			BaselineReaderPtr Reader() { return _reader; }
-			virtual void PerformWriteDataTask(const ImageSetIndex &index, std::vector<Image2DCPtr> realImages, std::vector<Image2DCPtr> imaginaryImages)
-			{
-				const MSImageSetIndex &msIndex = static_cast<const MSImageSetIndex&>(index);
-				_reader->PerformDataWriteTask(realImages, imaginaryImages, GetAntenna1(msIndex), GetAntenna2(msIndex), msIndex._band);
-			}
-			void SetReadUVW(bool readUVW)
-			{
-				_readUVW = readUVW;
-			}
-		private:
-			MSImageSet(const std::string &location, BaselineReaderPtr reader) :
-				_msFile(location), _set(location), _reader(reader),
-				_dataColumnName("DATA"), _subtractModel(false),
-				_readDipoleAutoPolarisations(true),
-				_readDipoleCrossPolarisations(true),
-				_readStokesI(false),
-				_maxScanCounts(0),
-				_scanCountPartOverlap(100),
-				_readFlags(true),
-				_readUVW(false),
-				_ioMode(AutoReadMode)
-			{ }
-			size_t StartIndex(const MSImageSetIndex &index);
-			size_t EndIndex(const MSImageSetIndex &index);
-			size_t LeftBorder(const MSImageSetIndex &index);
-			size_t RightBorder(const MSImageSetIndex &index);
-			void initReader();
-			size_t FindBaselineIndex(size_t a1, size_t a2);
-			TimeFrequencyMetaDataCPtr createMetaData(const ImageSetIndex &index, std::vector<UVW> &uvw);
-
-			const std::string _msFile;
-			MeasurementSet _set;
-			BaselineReaderPtr _reader;
-			std::string _dataColumnName;
-			bool _subtractModel;
-			bool _readDipoleAutoPolarisations, _readDipoleCrossPolarisations, _readStokesI;
-			std::vector<std::pair<size_t,size_t> > _baselines;
-			size_t _bandCount;
-			size_t _maxScanCounts;
-			size_t _partCount, _timeScanCount;
-			size_t _scanCountPartOverlap;
-			bool _readFlags, _readUVW;
-			BaselineIOMode _ioMode;
-			std::vector<BaselineData> _baselineData;
-	};
-
-}
-	
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/imagesets/noisestatimageset.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/imagesets/noisestatimageset.h
deleted file mode 100644
index e6914e3bda529fe3fd7dcf283f85a5a7aa76efe0..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/imagesets/noisestatimageset.h
+++ /dev/null
@@ -1,360 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#ifndef NOISESTATIMAGESET_H
-#define NOISESTATIMAGESET_H
-
-#include <string>
-#include <fstream>
-#include <set>
-#include <map>
-#include <cmath>
-
-#include <AOFlagger/msio/types.h>
-
-#include <AOFlagger/strategy/algorithms/noisestatistics.h>
-#include <AOFlagger/strategy/algorithms/noisestatisticscollector.h>
-
-#include <AOFlagger/strategy/imagesets/singleimageset.h>
-
-#include <AOFlagger/util/aologger.h>
-
-namespace rfiStrategy {
-
-	class NoiseStatImageSet : public SingleImageSet {
-		public:
-			enum Mode { Mean, StdDev, Variance, VarianceOfVariance };
-			
-			NoiseStatImageSet(const std::string &path) : SingleImageSet(), _path(path), _mode(StdDev)
-			{
-			}
-
-			virtual ImageSet *Copy()
-			{
-				return new NoiseStatImageSet(_path);
-			}
-
-			virtual void Initialize()
-			{
-			}
-
-			virtual std::string Name()
-			{
-				return "Noise statistics";
-			}
-			
-			virtual std::string File()
-			{
-				return _path;
-			}
-			
-			void SetMode(enum Mode mode)
-			{
-				_mode = mode;
-			}
-			
-			enum Mode Mode() const
-			{
-				return _mode;
-			}
-			
-			virtual BaselineData *Read()
-			{
-				NoiseStatisticsCollector collector;
-				collector.ReadTF(_path);
-				const NoiseStatisticsCollector::StatTFMap &map = collector.TBMap();
-				
-				// Scan map for width (time steps) and height (frequency channels)
-				std::set<double> times, frequencies;
-				for(NoiseStatisticsCollector::StatTFMap::const_iterator i=map.begin();
-				i!=map.end();++i)
-				{
-					times.insert(i->first.first);
-					frequencies.insert(i->first.second);
-				}
-				
-				std::map<double, unsigned> timeIndices, frequencyIndices;
-				std::vector<double> observationTimes;
-				BandInfo bandInfo;
-				
-				/*if(times.size() > 0)
-				{
-					// Calculate average time step
-					double avgTimeDistance = 0.0;
-					double lastValue = *times.begin();
-					std::set<double>::const_iterator i=times.begin();
-					++i;
-					while(i!=times.end())
-					{
-						avgTimeDistance += (*i) - lastValue;
-						lastValue = *i;
-						++i;
-					}
-					avgTimeDistance /= times.size()-1;
-						AOLogger::Debug << "Average time step size: " << avgTimeDistance << '\n';
-
-					// Create the times map
-					
-					i=times.begin();
-					lastValue = fabs(*i) - avgTimeDistance;
-					double beforeLastValue = fabs(*i) - 2.0*avgTimeDistance;
-					timeIndices.insert(std::pair<double, unsigned>(*i, 0));
-					unsigned index = 1, skippedIndices = 0;
-					++i;
-					while(i!=times.end())
-					{
-						if(fabs((*i) - lastValue - avgTimeDistance) < avgTimeDistance*9.0/10.0)
-						{
-							timeIndices.insert(std::pair<double, unsigned>(*i, index));
-							observationTimes.push_back(*i);
-							AOLogger::Debug << "Accepted index " << index << ", deviation=" << fabs((*i) - lastValue - avgTimeDistance) << '\n';
-							++index;
-						} else {
-							++skippedIndices;
-							AOLogger::Debug << "Skipped index " << index << ", deviation=" << fabs((*i) - lastValue - avgTimeDistance) << '\n';
-						}
-						lastValue = *i;
-						++i;
-					}
-					AOLogger::Debug << "Number of time indices skipped: " << skippedIndices << '\n';
-				} */
-				
-				unsigned index = 0;
-				for(std::set<double>::const_iterator i=times.begin();i!=times.end();++i)
-				{
-					timeIndices.insert(std::pair<double, unsigned>(*i, index));
-					observationTimes.push_back(*i);
-					++index;
-				}
-				
-				unsigned width = timeIndices.size(), height = frequencies.size();
-				AOLogger::Debug << "Image size: " << width << 'x' << height << '\n';
-				Image2DPtr
-					imageReal = Image2D::CreateZeroImagePtr(width, height),
-					imageImag = Image2D::CreateZeroImagePtr(width, height);
-				Mask2DPtr mask = Mask2D::CreateSetMaskPtr<true>(width, height);
-				index = 0;
-				
-				for(std::set<double>::const_iterator i=frequencies.begin();i!=frequencies.end();++i)
-				{
-					frequencyIndices.insert(std::pair<double, unsigned>(*i, index));
-					ChannelInfo channel;
-					channel.frequencyHz = *i;
-					channel.frequencyIndex = index;
-					bandInfo.channels.push_back(channel);
-					++index;
-				}
-				bandInfo.windowIndex = 0;
-				
-				// Rescan map and fill image
-				for(NoiseStatisticsCollector::StatTFMap::const_iterator i=map.begin();
-				i!=map.end();++i)
-				{
-					const double
-						time = i->first.first,
-						centralFrequency = i->first.second;
-					const CNoiseStatistics
-						&stats = i->second;
-					std::map<double, unsigned>::iterator timeElement = timeIndices.upper_bound(time);
-					if(timeElement != timeIndices.begin())
-						--timeElement;
-					const unsigned
-						x = timeElement->second,
-						y = frequencyIndices.find(centralFrequency)->second;
-					
-					if(stats.real.Count() > 25 && stats.imaginary.Count() > 25)
-					{
-						mask->SetValue(x, y, false);
-					}
-					switch(_mode)
-					{
-						case Mean:
-							imageReal->SetValue(x, y, stats.real.Mean());
-							imageImag->SetValue(x, y, stats.imaginary.Mean());
-							break;
-						case StdDev:
-							imageReal->SetValue(x, y, stats.real.StdDevEstimator());
-							imageImag->SetValue(x, y, stats.imaginary.StdDevEstimator());
-							break;
-						case Variance:
-							imageReal->SetValue(x, y, stats.real.VarianceEstimator());
-							imageImag->SetValue(x, y, stats.imaginary.VarianceEstimator());
-							break;
-						case VarianceOfVariance:
-							imageReal->SetValue(x, y, stats.real.VarianceOfVarianceEstimator());
-							imageImag->SetValue(x, y, stats.imaginary.VarianceOfVarianceEstimator());
-							break;
-					}
-				}
-				
-				// Fill metadata
-				TimeFrequencyMetaDataPtr metaData = TimeFrequencyMetaDataPtr(new TimeFrequencyMetaData());
-				metaData->SetObservationTimes(observationTimes);
-				metaData->SetBand(bandInfo);
-				switch(_mode)
-				{
-					case Mean:
-						metaData->SetDataDescription("Mean visibility difference");
-						metaData->SetDataUnits("Jy");
-						break;
-					case StdDev:
-						metaData->SetDataDescription("Stddev of visibility difference");
-						metaData->SetDataUnits("Jy");
-						break;
-					case Variance:
-						metaData->SetDataDescription("Variance of visibility difference");
-						metaData->SetDataUnits("Jy^2");
-						break;
-					case VarianceOfVariance:
-						metaData->SetDataDescription("Variance of visibility difference");
-						metaData->SetDataUnits("Jy^4");
-						break;
-				}
-				
-				// Return it structured.
-				TimeFrequencyData data(TimeFrequencyData::ComplexRepresentation, StokesIPolarisation, imageReal, imageImag);
-				data.SetGlobalMask(mask);
-				BaselineData *baselineData = new BaselineData(data, metaData);
-				return baselineData;
-			}
-			
-			static void MergeInTime(TimeFrequencyData &data, TimeFrequencyMetaDataPtr metaData)
-			{
-				Mask2DPtr mask = Mask2D::CreateCopy(data.GetSingleMask());
-                                std::vector<Image2DPtr> images(data.ImageCount());
-				for(unsigned i=0;i<data.ImageCount();++i)
-					images[i] = Image2D::CreateCopy(data.GetImage(i));
-				bool hasObsTimes = metaData != 0;
-				
-				std::vector<double> observationTimes;
-				if(hasObsTimes) observationTimes = metaData->ObservationTimes();
-				
-				unsigned x=0;
-				std::vector<unsigned> removedColumns;
-				while(x<mask->Width()-1)
-				{
-					unsigned checkSize = 1;
-					bool rowIsMergable = true;
-					
-					while(x + checkSize < mask->Width() && rowIsMergable)
-					{
-						++checkSize;
-						// check if the range [ x ; x+checkSize > can be merged
-						for(unsigned y=0;y<mask->Height();++y)
-						{
-							unsigned valuesSet = 0;
-							for(unsigned checkX = x; checkX != x + checkSize; ++checkX)
-							{
-								if(!mask->Value(checkX, y)) ++valuesSet;
-							}
-							if(valuesSet > 1) {
-								rowIsMergable = false;
-								break;
-							}
-						}
-					}
-					
-					if(!rowIsMergable) checkSize--;
-					if(checkSize > 1)
-					{
-						// merge all timesteps in the interval [ x ; x+checkSize >
-						AOLogger::Debug << "Merging timesteps " << x << " - " << (x+checkSize-1) << "\n";
-						for(unsigned y=0;y<mask->Height();++y)
-						{
-							double timeAvg = 0.0;
-							unsigned timeCount = 0;
-							for(unsigned mergeX=x;mergeX!=x+checkSize;++mergeX)
-							{
-								if(!mask->Value(mergeX, y))
-								{
-									mask->SetValue(mergeX, y, true);
-									mask->SetValue(x, y, false);
-									for(unsigned i=0;i<data.ImageCount();++i)
-									{
-										const num_t val = images[i]->Value(mergeX, y);
-										images[i]->SetValue(x, y, val);
-									}
-									if(hasObsTimes)
-									{
-										timeAvg += observationTimes[mergeX];
-										timeCount++;
-									}
-								}
-							}
-							if(hasObsTimes && timeCount > 0)
-								observationTimes[x] = timeAvg / (double) timeCount;
-						}
-						for(unsigned removeX=x+1;removeX!=x+checkSize;++removeX)
-							removedColumns.push_back(removeX);
-					}
-					x += checkSize;
-				}
-				
-				AOLogger::Debug << "Removed " << removedColumns.size() << " time steps.\n";
-				
-				// Remove the timesteps
-				unsigned newWidth = data.ImageWidth() - removedColumns.size();
-                                std::vector<Image2DPtr> resizedImages(data.ImageCount());
-				for(unsigned i=0;i<data.ImageCount();++i)
-				{
-					resizedImages[i] = Image2D::CreateUnsetImagePtr(newWidth, data.ImageHeight());
-				}
-				Mask2DPtr resizedMask = Mask2D::CreateUnsetMaskPtr(newWidth, data.ImageHeight());
-				
-				std::vector<unsigned>::const_iterator nextRemovedCol = removedColumns.begin();
-				
-				if(nextRemovedCol != removedColumns.begin())
-				{
-					unsigned xOfResized=0;
-					for(unsigned xOfOld=0;xOfOld<mask->Width();++xOfOld)
-					{
-						if(xOfOld == *nextRemovedCol)
-						{
-							++nextRemovedCol;
-							if(hasObsTimes)
-								observationTimes.erase(observationTimes.begin()+xOfResized);
-						} else {
-							for(unsigned y=0;y<mask->Height();++y)
-							{
-								resizedMask->SetValue(xOfResized, y, mask->Value(xOfOld, y));
-								for(unsigned i=0;i<data.ImageCount();++i)
-									resizedImages[i]->SetValue(xOfResized, y, images[i]->Value(xOfOld, y));
-							}
-							++xOfResized;
-						}
-					}
-					
-					for(unsigned i=0;i<data.ImageCount();++i)
-						data.SetImage(i, resizedImages[i]);
-					data.SetGlobalMask(resizedMask);
-					
-					if(hasObsTimes)
-						metaData->SetObservationTimes(observationTimes);
-				}
-			}
-
-		private:
-			std::string _path;
-			enum Mode _mode;
-	};
-	
-}
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/imagesets/parmimageset.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/imagesets/parmimageset.h
deleted file mode 100644
index 7f9dbcab322b951e21b451c800d032e8201c450b..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/imagesets/parmimageset.h
+++ /dev/null
@@ -1,159 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#ifndef PARM_IMAGE_H
-#define PARM_IMAGE_H
-
-#include <string>
-#include <cstring>
-#include <vector>
-#include <deque>
-
-#include <AOFlagger/msio/types.h>
-#include <AOFlagger/msio/timefrequencydata.h>
-#include <AOFlagger/msio/timefrequencymetadata.h>
-
-#include <AOFlagger/strategy/imagesets/imageset.h>
-
-namespace rfiStrategy {
-
-	class ParmImageSet;
-	
-	class ParmImageSetIndex : public ImageSetIndex {
-		public:
-			ParmImageSetIndex(ImageSet &set) : ImageSetIndex(set), _valid(true), _antennaIndex(0)
-			{
-			}
-			virtual ~ParmImageSetIndex()
-			{
-			}
-			inline virtual void Previous();
-			
-			inline virtual void Next();
-			
-			virtual void LargeStepPrevious()
-			{
-			}
-			virtual void LargeStepNext()
-			{
-			}
-			inline virtual std::string Description() const;
-			
-			virtual bool IsValid() const { return _valid; }
-			
-			virtual ParmImageSetIndex *Copy() const
-			{
-				ParmImageSetIndex *index = new ParmImageSetIndex(imageSet());
-				index->_antennaIndex = _antennaIndex;
-				return index;
-			}
-			
-			unsigned AntennaIndex() const { return _antennaIndex; }
-		private:
-			inline ParmImageSet &ParmSet() const;
-			bool _valid;
-			unsigned _antennaIndex;
-	};
-	
-	class ParmImageSet : public ImageSet {
-		public:
-			ParmImageSet(const std::string &path) : _path(path), _parmTable(0)
-			{
-			}
-			virtual ~ParmImageSet();
-			virtual ParmImageSet *Copy()
-			{
-				throw std::runtime_error("Can not copy set");
-			}
-			virtual ParmImageSetIndex *StartIndex()
-			{
-				return new ParmImageSetIndex(*this);
-			}
-			virtual void Initialize();
-			
-			virtual std::string Name() { return "Parmdb"; }
-			
-			virtual std::string File() { return _path; }
-			
-			virtual TimeFrequencyData *LoadData(const ImageSetIndex &index);
-			
-			virtual void AddReadRequest(const ImageSetIndex &index)
-			{
-				TimeFrequencyData *data = LoadData(index);
-				BaselineData *baseline = new BaselineData(*data, TimeFrequencyMetaDataCPtr(), index);
-				delete data;
-				_baselineBuffer.push_back(baseline);
-			}
-			virtual void PerformReadRequests()
-			{
-			}
-			
-			virtual BaselineData *GetNextRequested()
-			{
-				BaselineData *baseline = _baselineBuffer.front();
-				_baselineBuffer.pop_front();
-				return baseline;
-			}
-
-			unsigned AntennaCount() const
-			{
-				return _antennas.size();
-			}
-			std::string AntennaName(unsigned index) const { return _antennas[index]; }
-		private:
-			const std::string _path;
-			std::vector<std::string> _antennas;
-			class ParmTable *_parmTable;
-			std::deque<BaselineData*> _baselineBuffer;
-	};
-
-	void ParmImageSetIndex::Previous()
-	{
-		++_antennaIndex;
-		if(_antennaIndex >= ParmSet().AntennaCount())
-		{
-			_antennaIndex = 0;
-			_valid = false;
-		}
-	}
-	
-	void ParmImageSetIndex::Next()
-	{
-		if(_antennaIndex > 0)
-			--_antennaIndex;
-		else
-		{
-			_antennaIndex = ParmSet().AntennaCount() - 1;
-			_valid = false;
-		}
-	}
-	
-	ParmImageSet &ParmImageSetIndex::ParmSet() const
-	{
-		return static_cast<ParmImageSet&>(imageSet());
-	}
-
-	std::string ParmImageSetIndex::Description() const
-	{
-		return ParmSet().AntennaName(_antennaIndex);
-	}
-}
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/imagesets/rawdescimageset.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/imagesets/rawdescimageset.h
deleted file mode 100644
index 7bb30d3f6834984fb8d25fa557b4b362bb6101de..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/imagesets/rawdescimageset.h
+++ /dev/null
@@ -1,241 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef RAWDESCIMAGESET_H
-#define RAWDESCIMAGESET_H
-
-#include <deque>
-#include <set>
-#include <vector>
-
-#include <AOFlagger/msio/image2d.h>
-#include <AOFlagger/msio/rawdescfile.h>
-
-#include <AOFlagger/strategy/imagesets/imageset.h>
-
-#include <AOFlagger/msio/rawreader.h>
-
-namespace rfiStrategy {
-	
-	class RawDescImageSetIndex : public ImageSetIndex {
-		public:
-			RawDescImageSetIndex(class rfiStrategy::ImageSet &set) : ImageSetIndex(set), _isValid(true), _timeBlockIndex(0)
-			{
-			}
-			
-			inline virtual void Previous();
-			inline virtual void Next();
-			inline virtual void LargeStepPrevious();
-			inline virtual void LargeStepNext();
-			
-			virtual std::string Description() const
-			{
-				std::stringstream s;
-				s << "Raw file";
-				return s.str();
-			}
-			virtual bool IsValid() const
-			{
-				return _isValid;
-			}
-			virtual RawDescImageSetIndex *Copy() const
-			{
-				RawDescImageSetIndex *index = new RawDescImageSetIndex(imageSet());
-				index->_isValid = _isValid;
-				index->_timeBlockIndex = _timeBlockIndex;
-				return index;
-			}
-		private:
-			friend class RawDescImageSet;
-
-			inline class RawDescImageSet &RawDescSet() const;
-			
-			bool _isValid;
-			size_t _timeBlockIndex;
-	};
-
-	/**
-		@author A.R. Offringa <offringa@astro.rug.nl>
-	*/
-	class RawDescImageSet : public ImageSet
-	{
-		public:
-			RawDescImageSet(const std::string &file) : _rawDescFile(file), _totalTimesteps(0), _imageWidth(0)
-			{
-				AOLogger::Debug
-					<< "Opening rawdescfile, beams=" << _rawDescFile.BeamCount()
-					<< "(" << _rawDescFile.SelectedBeam() << ")"
-					<< ", subbands=" << _rawDescFile.SubbandCount()
-					<< ", channels=" << _rawDescFile.ChannelsPerSubbandCount()
-					<< ", timesteps=" << _rawDescFile.TimestepsPerBlockCount() << '\n';
-				_imageWidth = (size_t) round(_rawDescFile.DisplayedTimeDuration() / _rawDescFile.TimeResolution());
-				_readers = new RawReader*[_rawDescFile.GetCount()];
-				
-				for(size_t i=0;i!=_rawDescFile.GetCount();++i)
-				{
-					_readers[i] = new RawReader(_rawDescFile.GetSet(i));
-					_readers[i]->SetSubbandCount(_rawDescFile.SubbandCount());
-					_readers[i]->SetChannelCount(_rawDescFile.ChannelsPerSubbandCount());
-					_readers[i]->SetBeamCount(_rawDescFile.BeamCount());
-					_readers[i]->SetTimestepsPerBlockCount(_rawDescFile.TimestepsPerBlockCount());
-					_readers[i]->SetBlockHeaderSize(_rawDescFile.BlockHeaderSize());
-					_readers[i]->SetBlockFooterSize(_rawDescFile.BlockFooterSize());
-					if(i == 0)
-						_totalTimesteps = _readers[i]->TimestepCount();
-					else if(_readers[i]->TimestepCount() < _totalTimesteps)
-						_totalTimesteps = _readers[i]->TimestepCount();
-				}
-			}
-			
-			~RawDescImageSet()
-			{
-				for(size_t i=0;i!=_rawDescFile.GetCount();++i)
-				{
-					delete _readers[i];
-				}
-				delete[] _readers;
-			}
-			
-			virtual void Initialize()
-			{
-			}
-
-			virtual RawDescImageSet *Copy()
-			{
-				return new RawDescImageSet(_rawDescFile.Filename());
-			}
-
-			virtual ImageSetIndex *StartIndex()
-			{
-				return new RawDescImageSetIndex(*this);
-			}
-			virtual std::string Name()
-			{
-				return "Raw file";
-			}
-			virtual std::string File()
-			{
-				return _rawDescFile.Filename();
-			}
-			virtual void AddReadRequest(const ImageSetIndex &index)
-			{
-				const RawDescImageSetIndex &rawIndex = static_cast<const RawDescImageSetIndex&>(index);
-				size_t readStart = _imageWidth * rawIndex._timeBlockIndex;
-				const size_t samplesPerTimestep = _rawDescFile.BeamCount() * _rawDescFile.ChannelsPerSubbandCount() * _rawDescFile.SubbandCount();
-				const size_t totalChannels =  _rawDescFile.GetCount() * _rawDescFile.ChannelsPerSubbandCount() * _rawDescFile.SubbandCount();
-				
-				Image2DPtr image = Image2D::CreateUnsetImagePtr(_imageWidth, totalChannels);
-				float *data = new float[_imageWidth * samplesPerTimestep];
-				for(size_t setIndex=0;setIndex<_rawDescFile.GetCount();++setIndex)
-				{
-					_readers[setIndex]->Read(readStart, readStart + _imageWidth, data);
-					for(size_t x=0;x<_imageWidth;++x)
-					{
-						size_t pos = x * _rawDescFile.BeamCount() * _rawDescFile.ChannelsPerSubbandCount() * _rawDescFile.SubbandCount()
-							+ _rawDescFile.SelectedBeam() * _rawDescFile.ChannelsPerSubbandCount() * _rawDescFile.SubbandCount();
-						size_t y = setIndex * _rawDescFile.ChannelsPerSubbandCount() * _rawDescFile.SubbandCount();
-						for(size_t subbandIndex=0;subbandIndex < _rawDescFile.SubbandCount();++subbandIndex)
-						{
-							for(size_t channelIndex=0;channelIndex < _rawDescFile.ChannelsPerSubbandCount();++channelIndex)
-							{
-								image->SetValue(x, y, (num_t) data[pos]);
-								++y;
-								++pos;
-							}
-						}
-					}
-				}
-				delete[] data;
-				TimeFrequencyData tfData(TimeFrequencyData::AmplitudePart, SinglePolarisation, image);
-				TimeFrequencyMetaDataPtr metaData(new TimeFrequencyMetaData());
-				
-				std::vector<double> observationTimes;
-				for(unsigned t=0;t<_imageWidth;++t)
-				{
-					observationTimes.push_back((t + readStart) * _rawDescFile.TimeResolution());
-				}
-				metaData->SetObservationTimes(observationTimes);
-				
-				BandInfo bandInfo;
-				for(unsigned i=0;i<totalChannels;++i)
-				{
-					ChannelInfo channel;
-					channel.frequencyHz = _rawDescFile.FrequencyStart() + _rawDescFile.FrequencyResolution() * i;
-					channel.frequencyIndex = i;
-					bandInfo.channels.push_back(channel);
-				}
-				metaData->SetBand(bandInfo);
-				
-				BaselineData *baseline = new BaselineData(tfData, metaData, index);
-				_baselineBuffer.push_back(baseline);
-			}
-			virtual void PerformReadRequests()
-			{
-			}
-			virtual BaselineData *GetNextRequested()
-			{
-				BaselineData *baseline = _baselineBuffer.front();
-				_baselineBuffer.pop_front();
-				return baseline;
-			}
-			size_t TotalTimesteps() const { return _totalTimesteps; }
-			size_t ImageWidth() const { return _imageWidth; }
-		private:
-			RawDescFile _rawDescFile;
-			RawReader **_readers;
-			std::deque<BaselineData*> _baselineBuffer;
-			size_t _totalTimesteps, _imageWidth;
-	};
-
-	void RawDescImageSetIndex::Previous()
-	{
-		if(_timeBlockIndex > 0)
-		{
-			--_timeBlockIndex;
-		} else {
-			_timeBlockIndex = (RawDescSet().TotalTimesteps()-1) / RawDescSet().ImageWidth();
-		}
-	}
-	
-	void RawDescImageSetIndex::Next()
-	{
-		++_timeBlockIndex;
-		if(_timeBlockIndex > (RawDescSet().TotalTimesteps()-1) / RawDescSet().ImageWidth())
-		{
-			_timeBlockIndex = 0;
-			_isValid = false;
-		}
-	}
-	
-	void RawDescImageSetIndex::LargeStepPrevious()
-	{
-	}
-	
-	void RawDescImageSetIndex::LargeStepNext()
-	{
-		_isValid = false;
-	}
-	
-	RawDescImageSet &RawDescImageSetIndex::RawDescSet() const
-	{
-		return static_cast<RawDescImageSet&>(imageSet());
-	}
-}
-
-#endif // RAWDESCIMAGESET_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/imagesets/rawimageset.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/imagesets/rawimageset.h
deleted file mode 100644
index d97ae501a76c58c32309bdffc986002a1b109eea..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/imagesets/rawimageset.h
+++ /dev/null
@@ -1,157 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef RAWIMAGESET_H
-#define RAWIMAGESET_H
-
-#include <deque>
-#include <set>
-#include <vector>
-
-#include <AOFlagger/msio/image2d.h>
-
-#include <AOFlagger/strategy/imagesets/imageset.h>
-
-#include <AOFlagger/msio/rawreader.h>
-
-namespace rfiStrategy {
-	
-	class RawImageSetIndex : public ImageSetIndex {
-		public:
-			RawImageSetIndex(class rfiStrategy::ImageSet &set) : ImageSetIndex(set), _isValid(true)
-			{
-			}
-			
-			inline virtual void Previous();
-			inline virtual void Next();
-			inline virtual void LargeStepPrevious();
-			inline virtual void LargeStepNext();
-			
-			virtual std::string Description() const
-			{
-				std::stringstream s;
-				s << "Raw file";
-				return s.str();
-			}
-			virtual bool IsValid() const
-			{
-				return _isValid;
-			}
-			virtual RawImageSetIndex *Copy() const
-			{
-				RawImageSetIndex *index = new RawImageSetIndex(imageSet());
-				index->_isValid = _isValid;
-				return index;
-			}
-		private:
-			friend class RawImageSet;
-
-			inline class RawImageSet &RawSet() const;
-			
-			unsigned long _beamlet, _timeBlock;
-			bool _isValid;
-	};
-
-	/**
-		@author A.R. Offringa <offringa@astro.rug.nl>
-	*/
-	class RawImageSet : public ImageSet
-	{
-		public:
-			RawImageSet(const std::string &file) : _reader(file)
-			{
-			}
-			~RawImageSet()
-			{
-			}
-			virtual void Initialize()
-			{
-			}
-
-			virtual RawImageSet *Copy()
-			{
-				return 0;
-			}
-
-			virtual ImageSetIndex *StartIndex()
-			{
-				return new RawImageSetIndex(*this);
-			}
-			virtual std::string Name()
-			{
-				return "Raw file";
-			}
-			virtual std::string File()
-			{
-				return _reader.Filename();
-			}
-			virtual void AddReadRequest(const ImageSetIndex &index)
-			{
-				float data[122100];
-				_reader.Read(0, 122100, data);
-				Image2DPtr image = Image2D::CreateUnsetImagePtr(122100, 1);
-				for(unsigned i=0;i<122100;++i)
-				{
-					image->SetValue(i, 0, (num_t) data[i]);
-				}
-				TimeFrequencyData tfData(TimeFrequencyData::AmplitudePart, SinglePolarisation, image);
-				
-				BaselineData *baseline = new BaselineData(tfData, TimeFrequencyMetaDataPtr(), index);
-				_baselineBuffer.push_back(baseline);
-			}
-			virtual void PerformReadRequests()
-			{
-			}
-			virtual BaselineData *GetNextRequested()
-			{
-				BaselineData *baseline = _baselineBuffer.front();
-				_baselineBuffer.pop_front();
-				return baseline;
-			}
-		private:
-			RawReader _reader;
-			std::deque<BaselineData*> _baselineBuffer;
-	};
-
-	void RawImageSetIndex::Previous()
-	{
-		LargeStepPrevious();
-	}
-	
-	void RawImageSetIndex::Next()
-	{
-		LargeStepNext();
-	}
-	
-	void RawImageSetIndex::LargeStepPrevious()
-	{
-	}
-	
-	void RawImageSetIndex::LargeStepNext()
-	{
-		_isValid = false;
-	}
-	
-	RawImageSet &RawImageSetIndex::RawSet() const
-	{
-		return static_cast<RawImageSet&>(imageSet());
-	}
-}
-
-#endif // RAWIMAGESET_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/imagesets/rspimageset.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/imagesets/rspimageset.h
deleted file mode 100644
index 6232ed5829c9e0df289f53d1122ec9dffff8da35..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/imagesets/rspimageset.h
+++ /dev/null
@@ -1,250 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef RSPIMAGESET_H
-#define RSPIMAGESET_H
-
-#include <deque>
-#include <set>
-#include <vector>
-
-#include <AOFlagger/baseexception.h>
-
-#include <AOFlagger/strategy/imagesets/imageset.h>
-
-#include <AOFlagger/msio/rspreader.h>
-
-namespace rfiStrategy {
-	
-	class RSPImageSetIndex : public ImageSetIndex {
-		public:
-			RSPImageSetIndex(class rfiStrategy::ImageSet &set) : ImageSetIndex(set), _beamlet(0), _timeBlock(0), _isValid(true) { }
-			
-			inline virtual void Previous();
-			inline virtual void Next();
-			inline virtual void LargeStepPrevious();
-			inline virtual void LargeStepNext();
-			
-			virtual std::string Description() const
-			{
-				std::stringstream s;
-				s << "Raw file, time block " << _timeBlock <<", beamlet " << _beamlet;
-				return s.str();
-			}
-			virtual bool IsValid() const
-			{
-				return _isValid;
-			}
-			virtual RSPImageSetIndex *Copy() const
-			{
-				RSPImageSetIndex *index = new RSPImageSetIndex(imageSet());
-				index->_beamlet = _beamlet;
-				index->_timeBlock = _timeBlock;
-				index->_isValid = _isValid;
-				return index;
-			}
-		private:
-			friend class RSPImageSet;
-
-			inline class RSPImageSet &RSPSet() const;
-			
-			unsigned long _beamlet, _timeBlock;
-			bool _isValid;
-	};
-
-	/**
-		@author A.R. Offringa <offringa@astro.rug.nl>
-	*/
-	class RSPImageSet : public ImageSet
-	{
-		public:
-			enum Mode { AllBeamletsMode, SingleBeamletMode, BeamletChannelMode, StatisticsMode };
-			
-			RSPImageSet(const std::string &file) : _reader(file), _mode(BeamletChannelMode), _timeBlockSize(2048), _beamletsInSet(5)
-			{
-			}
-			~RSPImageSet()
-			{
-			}
-			virtual void Initialize()
-			{
-				_timestepCount = _reader.TimeStepCount(_beamletsInSet);
-				if(_mode == BeamletChannelMode) _timestepCount /= (unsigned long) 256;
-			}
-
-			virtual RSPImageSet *Copy()
-			{
-				return 0;
-			}
-
-			virtual ImageSetIndex *StartIndex()
-			{
-				return new RSPImageSetIndex(*this);
-			}
-			virtual std::string Name()
-			{
-				return "Raw RSP file";
-			}
-			virtual std::string File()
-			{
-				return _reader.File();
-			}
-			virtual TimeFrequencyData *LoadData(const ImageSetIndex &)
-			{
-				return 0;
-			}
-			virtual size_t GetPart(const ImageSetIndex &)
-			{
-				return 0;
-			}
-			virtual size_t GetAntenna1(const ImageSetIndex &)
-			{
-				return 0;
-			}
-			virtual size_t GetAntenna2(const ImageSetIndex &)
-			{
-				return 0;
-			}
-			virtual void AddReadRequest(const ImageSetIndex &index)
-			{
-				const RSPImageSetIndex &rspIndex = static_cast<const RSPImageSetIndex&>(index);
-				std::pair<TimeFrequencyData,TimeFrequencyMetaDataPtr> data;
-				switch(_mode)
-				{
-					case AllBeamletsMode:
-						data = _reader.ReadAllBeamlets(rspIndex._timeBlock * TimeBlockSize(), (rspIndex._timeBlock+1ul) * TimeBlockSize(), _beamletsInSet);
-						break;
-					case SingleBeamletMode:
-						data = _reader.ReadSingleBeamlet(rspIndex._timeBlock * TimeBlockSize(), (rspIndex._timeBlock+1ul) * TimeBlockSize(), _beamletsInSet, rspIndex._beamlet);
-						break;
-					case BeamletChannelMode:
-						data = _reader.ReadChannelBeamlet(rspIndex._timeBlock * TimeBlockSize(), (rspIndex._timeBlock+1ul) * TimeBlockSize(), _beamletsInSet, rspIndex._beamlet);
-						break;
-					case StatisticsMode:
-						_reader.ReadForStatistics(_beamletsInSet);
-						data = _reader.ReadChannelBeamlet(rspIndex._timeBlock * TimeBlockSize(), (rspIndex._timeBlock+1ul) * TimeBlockSize(), _beamletsInSet, rspIndex._beamlet);
-						break;
-				}
-				BaselineData *baseline = new BaselineData(data.first, data.second, index);
-				_baselineBuffer.push_back(baseline);
-			}
-			virtual void PerformReadRequests()
-			{
-			}
-			virtual BaselineData *GetNextRequested()
-			{
-				BaselineData *baseline = _baselineBuffer.front();
-				_baselineBuffer.pop_front();
-				return baseline;
-			}
-			unsigned long TimestepCount() const
-			{
-				return _timestepCount;
-			}
-			unsigned long BeamletCount() const
-			{
-				switch(_mode)
-				{
-					default:
-					case AllBeamletsMode:
-						return 1;
-					case SingleBeamletMode:
-						return _beamletsInSet;
-					case BeamletChannelMode:
-						return _beamletsInSet;
-				}
-			}
-			unsigned long TimeBlockSize() const
-			{
-				return _timeBlockSize;
-			}
-			void SetTimeBlockSize(unsigned long timeBlockSize)
-			{
-				_timeBlockSize = timeBlockSize;
-			}
-			enum Mode Mode() const
-			{
-				return _mode;
-			}
-			void SetMode(enum Mode mode)
-			{
-				_mode = mode;
-			}
-			unsigned int BeamletsInSet() const
-			{
-				return _beamletsInSet;
-			}
-			void SetBeamletsInSet(unsigned int beamletsInSet)
-			{
-				_beamletsInSet = beamletsInSet;
-			}
-		private:
-			RSPReader _reader;
-			std::deque<BaselineData*> _baselineBuffer;
-			enum Mode _mode;
-			unsigned long _timestepCount;
-			unsigned long _timeBlockSize;
-			unsigned int _beamletsInSet;
-	};
-
-	void RSPImageSetIndex::Previous()
-	{
-		if(_beamlet > 0)
-		{
-			--_beamlet;
-		} else {
-			_beamlet = RSPSet().BeamletCount()-1;
-			LargeStepPrevious();
-		}
-	}
-	
-	void RSPImageSetIndex::Next()
-	{
-		++_beamlet;
-		if(_beamlet >= RSPSet().BeamletCount())
-		{
-			_beamlet = 0;
-			LargeStepNext();
-		}
-	}
-	
-	void RSPImageSetIndex::LargeStepPrevious()
-	{
-		const unsigned long modulo = (RSPSet().TimestepCount()+RSPSet().TimeBlockSize()-1)/RSPSet().TimeBlockSize();
-		_timeBlock = (_timeBlock + modulo - 1) % modulo;
-	}
-	
-	void RSPImageSetIndex::LargeStepNext()
-	{
-		++_timeBlock;
-		const unsigned long modulo = (RSPSet().TimestepCount()+RSPSet().TimeBlockSize()-1)/RSPSet().TimeBlockSize();
-		if(_timeBlock >= modulo)
-		{
-			_timeBlock = 0;
-			_isValid = false;
-		}
-	}
-	
-	RSPImageSet &RSPImageSetIndex::RSPSet() const
-	{
-		return static_cast<RSPImageSet&>(imageSet());
-	}
-}
-
-#endif // RSPIMAGESET_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/imagesets/singleimageset.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/imagesets/singleimageset.h
deleted file mode 100644
index 5e8e79e5eb1ee08abba6f4610f64ded431aea3a8..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/imagesets/singleimageset.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#ifndef SINGLEIMAGESET_H
-#define SINGLEIMAGESET_H
-
-#include <string>
-#include <stdexcept>
-
-#include <AOFlagger/msio/types.h>
-
-#include <AOFlagger/strategy/imagesets/imageset.h>
-
-namespace rfiStrategy {
-
-	class SingleImageSetIndex : public ImageSetIndex {
-		public:
-			SingleImageSetIndex(ImageSet &set, std::string description) : ImageSetIndex(set), _valid(true), _description(description) { }
-			virtual ~SingleImageSetIndex() { }
-			virtual void Previous() { _valid = false; }
-			virtual void Next() { _valid = false; }
-			virtual void LargeStepPrevious() { _valid = false; }
-			virtual void LargeStepNext() { _valid = false; }
-			virtual std::string Description() const { return _description; }
-			virtual bool IsValid() const { return _valid; }
-			virtual ImageSetIndex *Copy() const
-			{
-				SingleImageSetIndex *index = new SingleImageSetIndex(imageSet(), _description);
-				index->_valid = _valid;
-				return index;
-			}
-		private:
-			bool _valid;
-			std::string _description;
-	};
-	
-	class SingleImageSet : public ImageSet {
-		public:
-			SingleImageSet() : ImageSet(), _readCount(0), _lastRead(0)
-			{
-			}
-			
-			virtual ~SingleImageSet()
-			{
-			}
-
-			virtual ImageSetIndex *StartIndex()
-			{
-				return new SingleImageSetIndex(*this, Name());
-			}
-			
-			virtual std::string Name() = 0;
-			virtual std::string File() = 0;
-			
-			virtual void AddReadRequest(const ImageSetIndex &)
-			{
-				if(_lastRead != 0)
-				{
-					delete _lastRead;
-					_lastRead = 0;
-					_readCount = 1;
-				} else {
-					++_readCount;
-				}
-			}
-			virtual void PerformReadRequests()
-			{
-				_lastRead = Read();
-			}
-			virtual BaselineData *GetNextRequested()
-			{
-				if(_readCount == 0)
-					throw std::runtime_error("All data reads have already been requested");
-				if(_lastRead == 0)
-					throw std::runtime_error("GetNextRequested() was called before PerformReadRequests()");
-				return _lastRead;
-			}
-			
-			virtual BaselineData *Read() = 0;
-		private:
-			int _readCount;
-			BaselineData *_lastRead;
-	};
-
-}
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/imagesets/spatialmsimageset.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/imagesets/spatialmsimageset.h
deleted file mode 100644
index c2d0494fbc915c6ad325bc600685b84e024daf8c..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/imagesets/spatialmsimageset.h
+++ /dev/null
@@ -1,216 +0,0 @@
-#ifndef SPATIALMSIMAGESET_H
-#define SPATIALMSIMAGESET_H
-
-#include <string>
-#include <cstring>
-#include <sstream>
-#include <stack>
-#include <stdexcept>
-
-#include <AOFlagger/strategy/imagesets/imageset.h>
-
-#include <AOFlagger/msio/spatialmatrixmetadata.h>
-#include <AOFlagger/msio/measurementset.h>
-#include <AOFlagger/msio/baselinematrixloader.h>
-
-namespace rfiStrategy {
-
-	class SpatialMSImageSetIndex : public ImageSetIndex {
-		public:
-			friend class SpatialMSImageSet;
-
-			SpatialMSImageSetIndex(ImageSet &set) : ImageSetIndex(set), _timeIndex(0), _channelIndex(0), _isValid(true)
-			{
-			}
-			inline virtual void Previous();
-			inline virtual void Next();
-			inline virtual void LargeStepPrevious();
-			inline virtual void LargeStepNext();
-			virtual std::string Description() const
-			{
-				std::stringstream s;
-				s << "Time index " << _timeIndex << ", channel " << _channelIndex;
-				return s.str();
-			}
-			virtual bool IsValid() const
-			{
-				return _isValid;
-			}
-			virtual ImageSetIndex *Copy() const
-			{
-				SpatialMSImageSetIndex *newIndex = new SpatialMSImageSetIndex(imageSet());
-				newIndex->_timeIndex = _timeIndex;
-				newIndex->_channelIndex = _channelIndex;
-				newIndex->_isValid = _isValid;
-				return newIndex;
-			}
-		private:
-			inline class SpatialMSImageSet &SMSSet() const;
-			size_t _timeIndex;
-			size_t _channelIndex;
-			bool _isValid;
-	};
-	
-	class SpatialMSImageSet : public ImageSet {
-		public:
-			SpatialMSImageSet(const std::string &location) : _set(location), _loader(_set), _cachedTimeIndex(GetTimeIndexCount())
-			{
-			}
-			virtual ~SpatialMSImageSet()
-			{
-			}
-			virtual ImageSet *Copy()
-			{
-				return 0;
-			}
-
-			virtual ImageSetIndex *StartIndex()
-			{
-				return new SpatialMSImageSetIndex(*this);
-			}
-			virtual void Initialize()
-			{
-			}
-			virtual std::string Name()
-			{
-				return "Spatial correlation matrix"; 
-			}
-			virtual std::string File()
-			{
-				return _set.Location(); 
-			}
-			virtual TimeFrequencyData *LoadData(const ImageSetIndex &index)
-			{
-				const SpatialMSImageSetIndex &sIndex = static_cast<const SpatialMSImageSetIndex&>(index);
-				if(sIndex._timeIndex != _cachedTimeIndex)
-				{
-					_loader.LoadPerChannel(sIndex._timeIndex, _timeIndexMatrices);
-					_cachedTimeIndex = sIndex._timeIndex;
-				}
-				TimeFrequencyData *result = new TimeFrequencyData(_timeIndexMatrices[sIndex._channelIndex]);
-				return result;
-			}
-			virtual void LoadFlags(const ImageSetIndex &/*index*/, TimeFrequencyData &/*destination*/)
-			{
-			}
-			virtual TimeFrequencyMetaDataCPtr LoadMetaData(const ImageSetIndex &/*index*/)
-			{
-				return TimeFrequencyMetaDataCPtr();
-			}
-			SpatialMatrixMetaData SpatialMetaData(const ImageSetIndex &index)
-			{
-				const SpatialMSImageSetIndex &sIndex = static_cast<const SpatialMSImageSetIndex&>(index);
-				SpatialMatrixMetaData metaData(_loader.MetaData());
-				metaData.SetChannelIndex(sIndex._channelIndex);
-				metaData.SetTimeIndex(sIndex._timeIndex);
-				return metaData;
-			}
-			virtual void WriteFlags(const ImageSetIndex &/*index*/, TimeFrequencyData &/*data*/)
-			{
-			}
-			virtual size_t GetPart(const ImageSetIndex &/*index*/)
-			{
-				return 0;
-			}
-			virtual size_t GetAntenna1(const ImageSetIndex &/*index*/)
-			{
-				return 0;
-			}
-			virtual size_t GetAntenna2(const ImageSetIndex &/*index*/)
-			{
-				return 0;
-			}
-			size_t GetTimeIndexCount()
-			{
-				return _loader.TimeIndexCount();
-			}
-			size_t GetFrequencyCount()
-			{
-				return _loader.FrequencyCount();
-			}
-			virtual void AddReadRequest(const ImageSetIndex &index)
-			{
-				_baseline.push(BaselineData(index));
-			}
-			virtual void PerformReadRequests()
-			{
-				TimeFrequencyData *data = LoadData(_baseline.top().Index());
-				_baseline.top().SetData(*data);
-				_baseline.top().SetMetaData(TimeFrequencyMetaDataPtr());
-				delete data;
-			}
-			virtual BaselineData *GetNextRequested()
-			{
-				BaselineData data = _baseline.top();
-				_baseline.pop();
-				return new BaselineData(data);
-			}
-			virtual void AddWriteFlagsTask(const ImageSetIndex &, std::vector<Mask2DCPtr> &)
-			{
-				throw std::runtime_error("Not implemented");
-			}
-			virtual void PerformWriteFlagsTask()
-			{
-				throw std::runtime_error("Not implemented");
-			}
-			virtual void PerformWriteDataTask(const ImageSetIndex &, std::vector<Image2DCPtr>, std::vector<Image2DCPtr>)
-			{
-				throw std::runtime_error("Not implemented");
-			}
-		private:
-			MeasurementSet _set;
-			BaselineMatrixLoader _loader;
-			std::stack<BaselineData> _baseline;
-			std::vector<TimeFrequencyData> _timeIndexMatrices;
-			size_t _cachedTimeIndex;
-	};
-
-	void SpatialMSImageSetIndex::LargeStepPrevious()
-	{
-		if(_timeIndex > 0)
-			--_timeIndex;
-		else
-		{
-			_timeIndex = SMSSet().GetTimeIndexCount()-1;
-			_isValid = false;
-		}
-	}
-
-	void SpatialMSImageSetIndex::LargeStepNext()
-	{
-		++_timeIndex;
-		if(_timeIndex == SMSSet().GetTimeIndexCount())
-		{
-			_timeIndex = 0;
-			_isValid = false;
-		}
-	}
-
-	void SpatialMSImageSetIndex::Previous()
-	{
-		if(_channelIndex > 0)
-			--_channelIndex;
-		else
-		{
-			_channelIndex = SMSSet().GetFrequencyCount()-1;
-			LargeStepPrevious();
-		}
-	}
-
-	void SpatialMSImageSetIndex::Next()
-	{
-		++_channelIndex;
-		if(_channelIndex == SMSSet().GetFrequencyCount())
-		{
-			_channelIndex = 0;
-			LargeStepNext();
-		}
-	}
-
-	class SpatialMSImageSet &SpatialMSImageSetIndex::SMSSet() const
-	{
-		return static_cast<SpatialMSImageSet&>(imageSet());
-	}
-}
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/imagesets/spatialtimeimageset.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/imagesets/spatialtimeimageset.h
deleted file mode 100644
index 5f99eaccc275e94c3b41aca0f4327e4c5e8d2e2a..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/imagesets/spatialtimeimageset.h
+++ /dev/null
@@ -1,188 +0,0 @@
-#ifndef SPATIALTIMEIMAGESET_H
-#define SPATIALTIMEIMAGESET_H
-
-#include <string>
-#include <cstring>
-#include <sstream>
-#include <stack>
-#include <stdexcept>
-
-#include <AOFlagger/strategy/imagesets/imageset.h>
-
-#include <AOFlagger/msio/measurementset.h>
-#include <AOFlagger/msio/spatialtimeloader.h>
-
-namespace rfiStrategy {
-
-	class SpatialTimeImageSetIndex : public ImageSetIndex {
-		public:
-			friend class SpatialTimeImageSet;
-
-			SpatialTimeImageSetIndex(ImageSet &set) : ImageSetIndex(set), _channelIndex(0), _isValid(true)
-			{
-			}
-			inline virtual void Previous();
-			inline virtual void Next();
-			inline virtual void LargeStepPrevious();
-			inline virtual void LargeStepNext();
-			virtual std::string Description() const
-			{
-				std::stringstream s;
-				s << "Channel " << _channelIndex;
-				return s.str();
-			}
-			virtual bool IsValid() const
-			{
-				return _isValid;
-			}
-			virtual ImageSetIndex *Copy() const
-			{
-				SpatialTimeImageSetIndex *newIndex = new SpatialTimeImageSetIndex(imageSet());
-				newIndex->_channelIndex = _channelIndex;
-				newIndex->_isValid = _isValid;
-				return newIndex;
-			}
-		private:
-			inline class SpatialTimeImageSet &STMSSet() const;
-			size_t _channelIndex;
-			bool _isValid;
-	};
-	
-	class SpatialTimeImageSet : public ImageSet {
-		public:
-			SpatialTimeImageSet(const std::string &location) : _set(location), _loader(_set)
-			{
-			}
-			virtual ~SpatialTimeImageSet()
-			{
-			}
-			virtual ImageSet *Copy()
-			{
-				return 0;
-			}
-
-			virtual ImageSetIndex *StartIndex()
-			{
-				return new SpatialTimeImageSetIndex(*this);
-			}
-			virtual void Initialize()
-			{
-			}
-			virtual std::string Name()
-			{
-				return "Spatial time matrix";
-			}
-			virtual std::string File()
-			{
-				return _set.Location(); 
-			}
-			virtual TimeFrequencyData *LoadData(const ImageSetIndex &index)
-			{
-				const SpatialTimeImageSetIndex &sIndex = static_cast<const SpatialTimeImageSetIndex&>(index);
-				TimeFrequencyData *result = new TimeFrequencyData(_loader.Load(sIndex._channelIndex));
-				return result;
-			}
-			virtual void LoadFlags(const ImageSetIndex &/*index*/, TimeFrequencyData &/*destination*/)
-			{
-			}
-			virtual TimeFrequencyMetaDataCPtr LoadMetaData(const ImageSetIndex &/*index*/)
-			{
-				return TimeFrequencyMetaDataCPtr();
-			}
-			virtual void WriteFlags(const ImageSetIndex &/*index*/, TimeFrequencyData &/*data*/)
-			{
-			}
-			virtual size_t GetPart(const ImageSetIndex &/*index*/)
-			{
-				return 0;
-			}
-			virtual size_t GetAntenna1(const ImageSetIndex &/*index*/)
-			{
-				return 0;
-			}
-			virtual size_t GetAntenna2(const ImageSetIndex &/*index*/)
-			{
-				return 0;
-			}
-			size_t GetTimeIndexCount()
-			{
-				return _loader.TimestepsCount();
-			}
-			size_t GetFrequencyCount()
-			{
-				return _loader.ChannelCount();
-			}
-			virtual void AddReadRequest(const ImageSetIndex &index)
-			{
-				_baseline.push(BaselineData(index));
-			}
-			virtual void PerformReadRequests()
-			{
-				TimeFrequencyData *data = LoadData(_baseline.top().Index());
-				_baseline.top().SetData(*data);
-				_baseline.top().SetMetaData(TimeFrequencyMetaDataPtr());
-				delete data;
-			}
-			virtual BaselineData *GetNextRequested()
-			{
-				BaselineData data = _baseline.top();
-				_baseline.pop();
-				return new BaselineData(data);
-			}
-			virtual void AddWriteFlagsTask(const ImageSetIndex &, std::vector<Mask2DCPtr> &)
-			{
-				throw std::runtime_error("Not implemented");
-			}
-			virtual void PerformWriteFlagsTask()
-			{
-				throw std::runtime_error("Not implemented");
-			}
-			virtual void PerformWriteDataTask(const ImageSetIndex &, std::vector<Image2DCPtr>, std::vector<Image2DCPtr>)
-			{
-				throw std::runtime_error("Not implemented");
-			}
-		private:
-			MeasurementSet _set;
-			SpatialTimeLoader _loader;
-			std::stack<BaselineData> _baseline;
-			size_t _cachedTimeIndex;
-	};
-
-	void SpatialTimeImageSetIndex::LargeStepPrevious()
-	{
-		_isValid = false;
-	}
-
-	void SpatialTimeImageSetIndex::LargeStepNext()
-	{
-		_isValid = false;
-	}
-
-	void SpatialTimeImageSetIndex::Previous()
-	{
-		if(_channelIndex > 0)
-			--_channelIndex;
-		else
-		{
-			_channelIndex = STMSSet().GetFrequencyCount()-1;
-			_isValid = false;
-		}
-	}
-
-	void SpatialTimeImageSetIndex::Next()
-	{
-		++_channelIndex;
-		if(_channelIndex == STMSSet().GetFrequencyCount())
-		{
-			_channelIndex = 0;
-			_isValid = false;
-		}
-	}
-
-	class SpatialTimeImageSet &SpatialTimeImageSetIndex::STMSSet() const
-	{
-		return static_cast<SpatialTimeImageSet&>(imageSet());
-	}
-}
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/imagesets/timefrequencystatimageset.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/imagesets/timefrequencystatimageset.h
deleted file mode 100644
index f6e7f2a9505c5af61eeaec214848e266276ec97a..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/imagesets/timefrequencystatimageset.h
+++ /dev/null
@@ -1,238 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#ifndef TIMEFREQUENCYSTATIMAGESET_H
-#define TIMEFREQUENCYSTATIMAGESET_H
-
-#include <string>
-#include <fstream>
-#include <set>
-#include <map>
-
-#include <AOFlagger/msio/types.h>
-
-#include <AOFlagger/strategy/imagesets/singleimageset.h>
-#include <AOFlagger/util/aologger.h>
-
-namespace rfiStrategy {
-
-	class TimeFrequencyStatImageSet : public SingleImageSet {
-		public:
-			enum Mode { RFIPercentages, TotalAmplitude, RFIAmplitude, NonRFIAmplitude };
-			
-			TimeFrequencyStatImageSet(const std::string &path) : SingleImageSet(), _path(path), _mode(RFIPercentages)
-			{
-			}
-
-			virtual ImageSet *Copy()
-			{
-				TimeFrequencyStatImageSet *newSet = new TimeFrequencyStatImageSet(_path);
-				newSet->_mode = _mode;
-				return newSet;
-			}
-
-			virtual void Initialize()
-			{
-			}
-
-			virtual std::string Name()
-			{
-				switch(_mode)
-				{
-					default:
-					case RFIPercentages:
-						return "TF Statistics: RFI percentages";
-					case TotalAmplitude:
-						return "TF Statistics: Total amplitudes";
-					case RFIAmplitude:
-						return "TF Statistics: RFI amplitudes";
-					case NonRFIAmplitude:
-						return "TF Statistics: Non-RFI amplitudes";
-				}
-			}
-			
-			virtual std::string File()
-			{
-				return _path;
-			}
-			
-			void SetMode(enum Mode mode)
-			{
-				_mode = mode;
-			}
-			
-			enum Mode Mode() const
-			{
-				return _mode;
-			}
-			
-			virtual BaselineData *Read()
-			{
-				// Scan file for width (time steps) and height (frequency bands)
-				std::ifstream f(_path.c_str());
-				std::string headers;
-				std::getline(f, headers);
-				std::set<double> times, frequencies;
-				while(!f.eof())
-				{
-					double time, centralFrequency;
-					unsigned long totalCount, rfiCount;
-					double totalAmplitude, rfiAmplitude;
-					f >> time;
-					if(f.eof()) break;
-					f
-					>> centralFrequency
-					>> totalCount
-					>> rfiCount
-					>> totalAmplitude
-					>> rfiAmplitude;
-					times.insert(time);
-					frequencies.insert(centralFrequency);
-				}
-				unsigned width = times.size(), height = frequencies.size();
-				AOLogger::Debug << "Image size: " << width << 'x' << height << '\n';
-				Image2DPtr image = Image2D::CreateZeroImagePtr(width, height);
-				Mask2DPtr mask = Mask2D::CreateSetMaskPtr<true>(width, height);
-				
-				std::map<double, unsigned> timeIndices, frequencyIndices;
-				std::vector<double> observationTimes;
-				BandInfo bandInfo;
-				
-				unsigned index = 0;
-				for(std::set<double>::const_iterator i=times.begin();i!=times.end();++i)
-				{
-					timeIndices.insert(std::pair<double, unsigned>(*i, index));
-					observationTimes.push_back(*i);
-					++index;
-				}
-				
-				index = 0;
-				for(std::set<double>::const_iterator i=frequencies.begin();i!=frequencies.end();++i)
-				{
-					frequencyIndices.insert(std::pair<double, unsigned>(*i, index));
-					ChannelInfo channel;
-					channel.frequencyHz = *i;
-					channel.frequencyIndex = index;
-					bandInfo.channels.push_back(channel);
-					++index;
-				}
-				bandInfo.windowIndex = 0;
-				
-				// Rescan file, now actually store data
-				f.close();
-				f.open(_path.c_str());
-				std::getline(f, headers);
-				while(!f.eof())
-				{
-					double time, centralFrequency;
-					unsigned long totalCount, rfiCount;
-					double totalAmplitude, rfiAmplitude;
-					f >> time;
-					if(f.eof()) break;
-					f
-					>> centralFrequency
-					>> totalCount
-					>> rfiCount
-					>> totalAmplitude
-					>> rfiAmplitude;
-					
-					//AOLogger::Debug << "Time: " << time << " freq: " << centralFrequency << '\n';
-					unsigned
-						x = timeIndices.find(time)->second,
-						y = frequencyIndices.find(centralFrequency)->second;
-					//AOLogger::Debug << '(' << x << ',' << y << ")\n";
-					
-					if(totalCount > 0)
-					{
-						switch(_mode)
-						{
-							case RFIPercentages:
-								image->SetValue(x, y, 100.0L * (long double) rfiCount / (long double) totalCount);
-								mask->SetValue(x, y, false);
-								break;
-							case TotalAmplitude:
-								image->SetValue(x, y, (long double) totalAmplitude / (long double) totalCount);
-								mask->SetValue(x, y, false);
-								break;
-							case RFIAmplitude:
-								if(rfiCount > 0) {
-									image->SetValue(x, y, (long double) rfiAmplitude / (long double) rfiCount);
-									mask->SetValue(x, y, false);
-								}
-								break;
-							case NonRFIAmplitude:
-								if(totalCount - rfiCount > 0) {
-									image->SetValue(x, y, (long double) (totalAmplitude-rfiAmplitude) / (long double) (totalCount - rfiCount));
-									mask->SetValue(x, y, false);
-								}
-								break;
-						}
-					}
-				}
-				
-				// Fill metadata
-				TimeFrequencyMetaDataPtr metaData = TimeFrequencyMetaDataPtr(new TimeFrequencyMetaData());
-				metaData->SetObservationTimes(observationTimes);
-				metaData->SetBand(bandInfo);
-				metaData->SetDataDescription(dataDescription());
-				metaData->SetDataUnits(units());
-				
-				// Return it structured.
-				TimeFrequencyData data(TimeFrequencyData::AmplitudePart, StokesIPolarisation, image);
-				data.SetGlobalMask(mask);
-				BaselineData *baselineData = new BaselineData(data, metaData);
-				return baselineData;
-			}
-		private:
-			virtual std::string units()
-			{
-				switch(_mode)
-				{
-					default:
-					case RFIPercentages:
-						return "%";
-					case TotalAmplitude:
-					case RFIAmplitude:
-					case NonRFIAmplitude:
-						return "";
-				}
-			}
-
-			virtual std::string dataDescription()
-			{
-				switch(_mode)
-				{
-					default:
-					case RFIPercentages:
-						return "RFI fraction";
-					case TotalAmplitude:
-					case RFIAmplitude:
-					case NonRFIAmplitude:
-						return "Amplitude";
-				}
-			}
-
-			std::string _path;
-			enum Mode _mode;
-	};
-
-}
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/plots/antennaflagcountplot.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/plots/antennaflagcountplot.h
deleted file mode 100644
index 2c388a2fccca0c38f8dbef01b54c132036de3070..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/plots/antennaflagcountplot.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef ANTENNAFLAGCOUNTPLOT_H
-#define ANTENNAFLAGCOUNTPLOT_H
-
-#include <string>
-#include <map>
-
-#include <AOFlagger/msio/timefrequencymetadata.h>
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class AntennaFlagCountPlot {
-	public:
-		AntennaFlagCountPlot() { }
-		~AntennaFlagCountPlot() { }
-
-		void Add(class TimeFrequencyData &data, TimeFrequencyMetaDataCPtr meta);
-		void MakePlot();
-		bool HasData() { return !_counts.empty(); }
-		void Report();
-	private:
-		void WriteCounts();
-		std::string formatPercentage(double percentage);
-
-		struct MapItem {
-			MapItem() : name(), autoCount(0), autoTotal(0), crossCount(0), crossTotal(0)
-			{
-			}
-			MapItem(const MapItem &source) : name(source.name), autoCount(source.autoCount), autoTotal(source.autoTotal), crossCount(source.crossCount), crossTotal(source.crossTotal)
-			{
-			}
-			MapItem &operator=(const MapItem &source)
-			{
-				name = source.name;
-				autoCount = source.autoCount;
-				autoTotal = source.autoTotal;
-				crossCount = source.crossCount;
-				crossTotal = source.crossTotal;
-				return *this;
-			}
-			std::string name;
-			long long autoCount, autoTotal, crossCount, crossTotal;
-		};
-		std::map<int, MapItem> _counts;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/plots/frequencyflagcountplot.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/plots/frequencyflagcountplot.h
deleted file mode 100644
index 232bd5aed561cbf499ee980725b56fbff3d05339..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/plots/frequencyflagcountplot.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef FREQUENCYFLAGCOUNTPLOT_H
-#define FREQUENCYFLAGCOUNTPLOT_H
-
-#include <map>
-
-#include <AOFlagger/msio/timefrequencymetadata.h>
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class FrequencyFlagCountPlot{
-	public:
-		FrequencyFlagCountPlot() : _ignoreFirstChannel(true) { }
-		~FrequencyFlagCountPlot() { }
-
-		void Add(class TimeFrequencyData &data, TimeFrequencyMetaDataCPtr meta);
-		void WriteCounts();
-		bool HasData() { return !_counts.empty(); }
-		void MakePlot();
-		void Report();
-	private:
-		struct MapItem {
-			MapItem() : count(0), total(0) { }
-			long long count, total;
-		};
-		std::string formatPercentage(double percentage);
-		std::string formatFrequency(double frequencyHz);
-		void formatToThreeDigits(std::stringstream &stream, int number)
-		{
-			if(number < 100) stream << '0';
-			if(number < 10) stream << '0';
-			stream << number;
-		}
-		std::string formatIndex(int index)
-		{
-			std::stringstream s;
-			if(index < 100) s << ' ';
-			if(index < 10) s << ' ';
-			s << index;
-			return s.str();
-		}
-		// In lofar, the first channel of every subband is flagged, because it overlaps with
-		// the previous subband. 
-		bool _ignoreFirstChannel;
-
-		std::map<double, struct MapItem> _counts;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/plots/frequencypowerplot.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/plots/frequencypowerplot.h
deleted file mode 100644
index e9dea456ba472903284d51f690079b7bf3e7a16c..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/plots/frequencypowerplot.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef FREQUENCYPOWERPLOT_H
-#define FREQUENCYPOWERPLOT_H
-
-#include <map>
-#include <string>
-
-#include <AOFlagger/msio/timefrequencymetadata.h>
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class FrequencyPowerPlot {
-	public:
-		FrequencyPowerPlot() : _plot(0), _logYAxis(false) { }
-		~FrequencyPowerPlot();
-
-		void Add(class TimeFrequencyData &data, TimeFrequencyMetaDataCPtr meta);
-		void WriteToText();
-		bool HasData() { return !_values.empty(); }
-		void MakePlot();
-		void StartNewLine(const std::string &lineTitle);
-		void SetLogYAxis(bool logYAxis) { _logYAxis = logYAxis; }
-	private:
-		void AddCurrentLine(class Plot &plot);
-
-		struct MapItem {
-			MapItem() : count(0), total(0.0L) { }
-			long long count;
-			long double total;
-		};
-		std::map<double, struct MapItem> _values;
-		std::string _currentLineText;
-		class Plot *_plot;
-		bool _logYAxis;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/plots/iterationsplot.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/plots/iterationsplot.h
deleted file mode 100644
index 76f3151c912b76ac48433d4c8f2758154b2ba16c..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/plots/iterationsplot.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef ITERATIONSPLOT_H
-#define ITERATIONSPLOT_H
-
-#include <string>
-#include <map>
-
-#include <AOFlagger/msio/mask2d.h>
-#include <AOFlagger/msio/timefrequencymetadata.h>
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class IterationsPlot
-{
-public:
-	IterationsPlot() { }
-	~IterationsPlot() { }
-
-	void Add(class TimeFrequencyData &data, TimeFrequencyMetaDataCPtr meta );
-	void MakePlot();
-	bool HasData() { return !_stats.empty(); }
-private:
-	struct Item
-	{
-		Item() : flaggedRatio(0.0), mode(0.0), winsorizedMode(0.0)
-		{
-		}
-		double flaggedRatio;
-		num_t mode, winsorizedMode;
-	};
-	std::vector<Item> _stats;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/plots/rfiplots.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/plots/rfiplots.h
deleted file mode 100644
index d8be9ef65e0f1f803f1051e113ab842071193fa7..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/plots/rfiplots.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef RFIPLOTS_H
-#define RFIPLOTS_H
-
-#include <vector>
-
-#include <AOFlagger/msio/image2d.h>
-#include <AOFlagger/msio/mask2d.h>
-#include <AOFlagger/msio/samplerow.h>
-#include <AOFlagger/msio/timefrequencymetadata.h>
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class RFIPlots{
-	public:
-		static void MakeDistPlot(class Plot2DPointSet &pointSet, Image2DCPtr image, Mask2DCPtr mask);
-		template <bool Weight>
-		static void MakeMeanSpectrumPlot(class Plot2DPointSet &pointSet, const TimeFrequencyData &data, const Mask2DCPtr &mask, const TimeFrequencyMetaDataCPtr &metaData);
-		static void MakePowerSpectrumPlot(class Plot2DPointSet &pointSet, Image2DCPtr image, Mask2DCPtr mask, TimeFrequencyMetaDataCPtr metaData);
-		static void MakeRMSSpectrumPlot(class Plot2DPointSet &plot, Image2DCPtr image, Mask2DCPtr mask);
-		static void MakeSNRSpectrumPlot(class Plot2DPointSet &plot, Image2DCPtr image, Image2DCPtr model, Mask2DCPtr mask);
-		static void MakePowerTimePlot(class Plot2DPointSet &plot, Image2DCPtr image, Mask2DCPtr mask, TimeFrequencyMetaDataCPtr metaData);
-		static void MakeComplexPlanePlot(class Plot2DPointSet &plot, const class TimeFrequencyData &data, size_t xStart, size_t length, size_t y, size_t yAvgSize, Mask2DCPtr mask, bool realVersusImaginary, bool imaginary);
-		static void MakeFittedComplexPlot(class Plot2DPointSet &plot, const TimeFrequencyData &data, size_t xStart, size_t length, size_t y, size_t yAvgSize, Mask2DCPtr mask, num_t sampleFringeFrequency, bool realVersusImaginary, bool imaginary);
-		static void MakeScatterPlot(class MultiPlot &plot, size_t plotIndex, Image2DCPtr image, Mask2DCPtr mask, TimeFrequencyMetaDataCPtr metaData);
-		static void MakeScatterPlot(class MultiPlot &plot, const TimeFrequencyData &data, TimeFrequencyMetaDataCPtr metaData, unsigned startIndex = 0);
-		static void MakeScatterPlot(class MultiPlot &plot, size_t plotIndex, SampleRowCPtr row);
-		static void MakeQualityPlot(class Plot2DPointSet &plot, const TimeFrequencyData &original, const TimeFrequencyData &model, size_t partCount);
-	private:
-		/**
-		 * Make a distribution curve for the provided image, ignoring masked values.
-		 * @param image The image to make a distribution curve for, by binning
-		 * @param mask Mask belonging to the image
-		 * @param valuesOutput The number of pixels in the image that are in this bin
-		 * @param binsOutput The ranges of the bins; the value in valuesOutput[i] is closer to value binsOutput[i] then
-		 * it is to binsOutput[i-1] or binsOutput[i+1], i.e., valuesOutput[i] is about the average value in the bin.
-		 * @param binCount The number of bins to make
-		 * @param start Value that should be the limit for the lowest bin, start==end means use min
-		 * @param end Value that should be the limit for the highest bin, start==end means use max
-		 * @param factor A factor to scale the output (note that the outputs are integers)
-		 * @param stretch A factor that is applied to all pixel-values before binning
-		 */
-		static void Bin(Image2DCPtr image, Mask2DCPtr mask, std::vector<size_t> &valuesOutput, std::vector<long double> &binsOutput, size_t binCount, long double start=0.0, long double end=0.0, long double factor=1.0, long double stretch=1.0) throw();
-
-		RFIPlots() { }
-		~RFIPlots() { }
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/plots/timeflagcountplot.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/plots/timeflagcountplot.h
deleted file mode 100644
index 7e346278323492b44addfd78df36053392acc8ec..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/plots/timeflagcountplot.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef TIMEFLAGCOUNTPLOT_H
-#define TIMEFLAGCOUNTPLOT_H
-
-#include <map>
-
-#include <AOFlagger/msio/timefrequencymetadata.h>
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class TimeFlagCountPlot {
-	public:
-		TimeFlagCountPlot() : _startTime(0) { };
-		~TimeFlagCountPlot() { }
-
-		void Add(class TimeFrequencyData &data, TimeFrequencyMetaDataCPtr meta);
-		bool HasData() { return !_counts.empty(); }
-		void MakePlot();
-	private:
-		void WriteCounts();
-		struct MapItem {
-			MapItem() : count(0), total(0) { }
-			long long count, total;
-		};
-
-		std::map<double, struct MapItem> _counts;
-		double _startTime;
-};
-
-#endif // TIMEFLAGCOUNTPLOT_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/test/experiments/defaultstrategyspeedtest.h b/CEP/DP3/AOFlagger/include/AOFlagger/test/experiments/defaultstrategyspeedtest.h
deleted file mode 100644
index 04e19669573ace01a2fbe299147276caab1b0ab0..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/test/experiments/defaultstrategyspeedtest.h
+++ /dev/null
@@ -1,511 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef AOFLAGGER_DEFAULTSTRATEGYSPEEDTEST_H
-#define AOFLAGGER_DEFAULTSTRATEGYSPEEDTEST_H
-
-#include <AOFlagger/test/testingtools/asserter.h>
-#include <AOFlagger/test/testingtools/unittest.h>
-
-#include <AOFlagger/strategy/algorithms/mitigationtester.h>
-#include <AOFlagger/strategy/algorithms/siroperator.h>
-#include <AOFlagger/strategy/algorithms/thresholdmitigater.h>
-
-#include <AOFlagger/strategy/actions/baselineselectionaction.h>
-#include <AOFlagger/strategy/actions/changeresolutionaction.h>
-#include <AOFlagger/strategy/actions/combineflagresultsaction.h>
-#include <AOFlagger/strategy/actions/foreachcomplexcomponentaction.h>
-#include <AOFlagger/strategy/actions/foreachpolarisationaction.h>
-#include <AOFlagger/strategy/actions/frequencyselectionaction.h>
-#include <AOFlagger/strategy/actions/highpassfilteraction.h>
-#include <AOFlagger/strategy/actions/iterationaction.h>
-#include <AOFlagger/strategy/actions/plotaction.h>
-#include <AOFlagger/strategy/actions/setflaggingaction.h>
-#include <AOFlagger/strategy/actions/setimageaction.h>
-#include <AOFlagger/strategy/actions/slidingwindowfitaction.h>
-#include <AOFlagger/strategy/actions/statisticalflagaction.h>
-#include <AOFlagger/strategy/actions/strategyaction.h>
-#include <AOFlagger/strategy/actions/sumthresholdaction.h>
-#include <AOFlagger/strategy/actions/timeselectionaction.h>
-
-#include <AOFlagger/strategy/control/artifactset.h>
-
-#include <AOFlagger/msio/timefrequencydata.h>
-
-#include <AOFlagger/util/aologger.h>
-
-class DefaultStrategySpeedTest : public UnitTest {
-	public:
-		DefaultStrategySpeedTest() : UnitTest("Default strategy speed test")
-		{
-			if(false)
-			{
-				AddTest(TimeLoopUntilAmplitude(), "Timing loop until amplitude");
-				AddTest(TimeLoop(), "Timing loop");
-				AddTest(TimeSumThreshold(), "Timing SumThreshold method");
-				AddTest(TimeRankOperator(), "Timing scale-invariant rank operator");
-				//AddTest(TimeSumThresholdN(), "Timing varying SumThreshold method");
-			}
-			AddTest(TimeSlidingWindowFit(), "Timing sliding window fit");
-			AddTest(TimeHighPassFilter(), "Timing high-pass filter");
-			AddTest(TimeStrategy(), "Timing strategy");
-			AddTest(TimeSSEHighPassFilterStrategy(), "Timing SSE high-pass filter strategy");
-		}
-		
-		DefaultStrategySpeedTest(const std::string &) : UnitTest("Default strategy speed test")
-		{
-			AddTest(TimeSumThresholdN(), "Timing varying SumThreshold method");
-		}
-		
-	private:
-		struct TimeStrategy : public Asserter
-		{
-			void operator()();
-		};
-		struct TimeSlidingWindowFit : public Asserter
-		{
-			void operator()();
-		};
-		struct TimeHighPassFilter : public Asserter
-		{
-			void operator()();
-		};
-		struct TimeLoop : public Asserter
-		{
-			void operator()();
-		};
-		struct TimeLoopUntilAmplitude : public Asserter
-		{
-			void operator()();
-		};
-		struct TimeSumThreshold : public Asserter
-		{
-			void operator()();
-		};
-		struct TimeSumThresholdN : public Asserter
-		{
-			void operator()();
-		};
-		struct TimeRankOperator : public Asserter
-		{
-			void operator()();
-		};
-		struct TimeSSEHighPassFilterStrategy : public Asserter
-		{
-			void operator()();
-		};
-		
-		static void prepareStrategy(rfiStrategy::ArtifactSet &artifacts);
-};
-
-inline void DefaultStrategySpeedTest::prepareStrategy(rfiStrategy::ArtifactSet &artifacts)
-{
-	const unsigned
-		width = 10000,
-		height = 256;
-	Mask2DPtr rfi = Mask2D::CreateUnsetMaskPtr(width, height);
-	Image2DPtr
-		xxReal = MitigationTester::CreateTestSet(26, rfi, width, height),
-		xxImag = MitigationTester::CreateTestSet(26, rfi, width, height),
-		xyReal = MitigationTester::CreateTestSet(26, rfi, width, height),
-		xyImag = MitigationTester::CreateTestSet(26, rfi, width, height),
-		yxReal = MitigationTester::CreateTestSet(26, rfi, width, height),
-		yxImag = MitigationTester::CreateTestSet(26, rfi, width, height),
-		yyReal = MitigationTester::CreateTestSet(26, rfi, width, height),
-		yyImag = MitigationTester::CreateTestSet(26, rfi, width, height);
-	TimeFrequencyData data(
-		xxReal, xxImag, xyReal, xyImag,
-		yxReal, yxImag, yyReal, yyImag);
-	artifacts.SetOriginalData(data);
-	artifacts.SetContaminatedData(data);
-	data.SetImagesToZero();
-	artifacts.SetRevisedData(data);
-}
-
-inline void DefaultStrategySpeedTest::TimeStrategy::operator()()
-{
-	rfiStrategy::ArtifactSet artifacts(0);
-	rfiStrategy::Strategy *strategy = rfiStrategy::Strategy::CreateDefaultSingleStrategy();
-	prepareStrategy(artifacts);
-	DummyProgressListener progressListener;
-	Stopwatch watch(true);
-	strategy->Perform(artifacts, progressListener);
-	AOLogger::Info << "Default strategy took: " << watch.ToString() << '\n';
-	delete strategy;
-}
-
-inline void DefaultStrategySpeedTest::TimeSlidingWindowFit::operator()()
-{
-	rfiStrategy::ArtifactSet artifacts(0);
-	rfiStrategy::ActionBlock *current;
-
-	rfiStrategy::Strategy strategy;
-	
-	rfiStrategy::ForEachPolarisationBlock *fepBlock = new rfiStrategy::ForEachPolarisationBlock();
-	strategy.Add(fepBlock);
-	current = fepBlock;
-
-	rfiStrategy::ForEachComplexComponentAction *focAction = new rfiStrategy::ForEachComplexComponentAction();
-	focAction->SetOnAmplitude(true);
-	focAction->SetOnImaginary(false);
-	focAction->SetOnReal(false);
-	focAction->SetOnPhase(false);
-	focAction->SetRestoreFromAmplitude(false);
-	current->Add(focAction);
-	current = focAction;
-
-	rfiStrategy::IterationBlock *iteration = new rfiStrategy::IterationBlock();
-	iteration->SetIterationCount(2);
-	iteration->SetSensitivityStart(4.0);
-	current->Add(iteration);
-	current = iteration;
-	
-	rfiStrategy::ChangeResolutionAction *changeResAction2 = new rfiStrategy::ChangeResolutionAction();
-	changeResAction2->SetTimeDecreaseFactor(3);
-	changeResAction2->SetFrequencyDecreaseFactor(3);
-
-	rfiStrategy::SlidingWindowFitAction *swfAction2 = new rfiStrategy::SlidingWindowFitAction();
-	swfAction2->Parameters().timeDirectionKernelSize = 2.5;
-	swfAction2->Parameters().timeDirectionWindowSize = 10;
-	swfAction2->Parameters().frequencyDirectionKernelSize = 5.0;
-	swfAction2->Parameters().frequencyDirectionWindowSize = 15;
-	changeResAction2->Add(swfAction2);
-
-	current->Add(changeResAction2);
-	
-	prepareStrategy(artifacts);
-	DummyProgressListener progressListener;
-	Stopwatch watch(true);
-	strategy.Perform(artifacts, progressListener);
-	AOLogger::Info << "Sliding window fit took (loop + fit): " << watch.ToString() << '\n';
-}
-
-inline void DefaultStrategySpeedTest::TimeHighPassFilter::operator()()
-{
-	rfiStrategy::ArtifactSet artifacts(0);
-	rfiStrategy::ActionBlock *current;
-
-	rfiStrategy::Strategy strategy;
-	
-	rfiStrategy::ForEachPolarisationBlock *fepBlock = new rfiStrategy::ForEachPolarisationBlock();
-	strategy.Add(fepBlock);
-	current = fepBlock;
-
-	rfiStrategy::ForEachComplexComponentAction *focAction = new rfiStrategy::ForEachComplexComponentAction();
-	focAction->SetOnAmplitude(true);
-	focAction->SetOnImaginary(false);
-	focAction->SetOnReal(false);
-	focAction->SetOnPhase(false);
-	focAction->SetRestoreFromAmplitude(false);
-	current->Add(focAction);
-	current = focAction;
-
-	rfiStrategy::IterationBlock *iteration = new rfiStrategy::IterationBlock();
-	iteration->SetIterationCount(2);
-	iteration->SetSensitivityStart(4.0);
-	current->Add(iteration);
-	current = iteration;
-	
-	rfiStrategy::ChangeResolutionAction *changeResAction2 = new rfiStrategy::ChangeResolutionAction();
-	changeResAction2->SetTimeDecreaseFactor(3);
-	changeResAction2->SetFrequencyDecreaseFactor(3);
-
-	rfiStrategy::HighPassFilterAction *hpAction = new rfiStrategy::HighPassFilterAction();
-	hpAction->SetHKernelSigmaSq(2.5);
-	hpAction->SetWindowWidth(10);
-	hpAction->SetVKernelSigmaSq(5.0);
-	hpAction->SetWindowHeight(15);
-	hpAction->SetMode(rfiStrategy::HighPassFilterAction::StoreRevised);
-	changeResAction2->Add(hpAction);
-
-	current->Add(changeResAction2);
-	
-	prepareStrategy(artifacts);
-	DummyProgressListener progressListener;
-	Stopwatch watch(true);
-	strategy.Perform(artifacts, progressListener);
-	AOLogger::Info << "High-pass filter took (loop + fit): " << watch.ToString() << '\n';
-}
-
-inline void DefaultStrategySpeedTest::TimeLoop::operator()()
-{
-	rfiStrategy::ArtifactSet artifacts(0);
-	rfiStrategy::ActionBlock *current;
-
-	rfiStrategy::Strategy strategy;
-	
-	rfiStrategy::ForEachPolarisationBlock *fepBlock = new rfiStrategy::ForEachPolarisationBlock();
-	strategy.Add(fepBlock);
-	current = fepBlock;
-
-	rfiStrategy::ForEachComplexComponentAction *focAction = new rfiStrategy::ForEachComplexComponentAction();
-	focAction->SetOnAmplitude(true);
-	focAction->SetOnImaginary(false);
-	focAction->SetOnReal(false);
-	focAction->SetOnPhase(false);
-	focAction->SetRestoreFromAmplitude(false);
-	current->Add(focAction);
-	current = focAction;
-
-	rfiStrategy::IterationBlock *iteration = new rfiStrategy::IterationBlock();
-	iteration->SetIterationCount(2);
-	iteration->SetSensitivityStart(4.0);
-	current->Add(iteration);
-	current = iteration;
-	
-	rfiStrategy::ChangeResolutionAction *changeResAction2 = new rfiStrategy::ChangeResolutionAction();
-	changeResAction2->SetTimeDecreaseFactor(3);
-	changeResAction2->SetFrequencyDecreaseFactor(3);
-	current->Add(changeResAction2);
-	
-	prepareStrategy(artifacts);
-	DummyProgressListener progressListener;
-	Stopwatch watch(true);
-	strategy.Perform(artifacts, progressListener);
-	AOLogger::Info << "Loop took: " << watch.ToString() << '\n';
-}
-
-inline void DefaultStrategySpeedTest::TimeLoopUntilAmplitude::operator()()
-{
-	rfiStrategy::ArtifactSet artifacts(0);
-	rfiStrategy::ActionBlock *current;
-
-	rfiStrategy::Strategy strategy;
-	
-	rfiStrategy::ForEachPolarisationBlock *fepBlock = new rfiStrategy::ForEachPolarisationBlock();
-	strategy.Add(fepBlock);
-	current = fepBlock;
-
-	rfiStrategy::ForEachComplexComponentAction *focAction = new rfiStrategy::ForEachComplexComponentAction();
-	focAction->SetOnAmplitude(true);
-	focAction->SetOnImaginary(false);
-	focAction->SetOnReal(false);
-	focAction->SetOnPhase(false);
-	focAction->SetRestoreFromAmplitude(false);
-	current->Add(focAction);
-
-	prepareStrategy(artifacts);
-	DummyProgressListener progressListener;
-	Stopwatch watch(true);
-	strategy.Perform(artifacts, progressListener);
-	AOLogger::Info << "Loop took: " << watch.ToString() << '\n';
-}
-
-inline void DefaultStrategySpeedTest::TimeSumThreshold::operator()()
-{
-	rfiStrategy::ArtifactSet artifacts(0);
-	rfiStrategy::ActionBlock *current;
-
-	rfiStrategy::Strategy strategy;
-	
-	rfiStrategy::ForEachPolarisationBlock *fepBlock = new rfiStrategy::ForEachPolarisationBlock();
-	strategy.Add(fepBlock);
-	current = fepBlock;
-
-	rfiStrategy::ForEachComplexComponentAction *focAction = new rfiStrategy::ForEachComplexComponentAction();
-	focAction->SetOnAmplitude(true);
-	focAction->SetOnImaginary(false);
-	focAction->SetOnReal(false);
-	focAction->SetOnPhase(false);
-	focAction->SetRestoreFromAmplitude(false);
-	current->Add(focAction);
-	current = focAction;
-
-	rfiStrategy::IterationBlock *iteration = new rfiStrategy::IterationBlock();
-	iteration->SetIterationCount(2);
-	iteration->SetSensitivityStart(4.0);
-	current->Add(iteration);
-	current = iteration;
-	
-	rfiStrategy::SumThresholdAction *t2 = new rfiStrategy::SumThresholdAction();
-	t2->SetBaseSensitivity(1.0);
-	current->Add(t2);
-		
-	rfiStrategy::ChangeResolutionAction *changeResAction2 = new rfiStrategy::ChangeResolutionAction();
-	changeResAction2->SetTimeDecreaseFactor(3);
-	changeResAction2->SetFrequencyDecreaseFactor(3);
-	current->Add(changeResAction2);
-	
-	current = focAction;
-	rfiStrategy::SumThresholdAction *t3 = new rfiStrategy::SumThresholdAction();
-	current->Add(t3);
-		
-	prepareStrategy(artifacts);
-	DummyProgressListener progressListener;
-	Stopwatch watch(true);
-	strategy.Perform(artifacts, progressListener);
-	AOLogger::Info << "Sum threshold took (loop + threshold): " << watch.ToString() << '\n';
-}
-
-inline void DefaultStrategySpeedTest::TimeSumThresholdN::operator()()
-{
-	rfiStrategy::ArtifactSet artifacts(0);
-	prepareStrategy(artifacts);
-
-	ThresholdConfig config;
-	config.InitializeLengthsDefault(9);
-	num_t stddev = artifacts.OriginalData().GetSingleImage()->GetStdDev();
-	num_t mode = artifacts.OriginalData().GetSingleImage()->GetMode();
-	AOLogger::Info << "Stddev: " << stddev << '\n';
-	AOLogger::Info << "Mode: " << mode << '\n';
-	config.InitializeThresholdsFromFirstThreshold(6.0 * stddev, ThresholdConfig::Rayleigh);
-	for(unsigned i=0;i<9;++i)
-	{
-		const unsigned length = config.GetHorizontalLength(i);
-		const double threshold = config.GetHorizontalThreshold(i);
-		Image2DCPtr input = artifacts.OriginalData().GetSingleImage();
-		
-		Mask2DPtr maskA = Mask2D::CreateCopy(artifacts.OriginalData().GetSingleMask());
-		Stopwatch watchA(true);
-		ThresholdMitigater::HorizontalSumThresholdLargeReference(input, maskA, length, threshold);
-		AOLogger::Info << "Horizontal, length " << length << ": " << watchA.ToString() << '\n';
-		
-		Mask2DPtr maskC = Mask2D::CreateCopy(artifacts.OriginalData().GetSingleMask());
-		Stopwatch watchC(true);
-		ThresholdMitigater::HorizontalSumThresholdLargeSSE(input, maskC, length, threshold);
-		AOLogger::Info << "Horizontal SSE, length " << length << ": " << watchC.ToString() << '\n';
-		
-		Mask2DPtr maskB = Mask2D::CreateCopy(artifacts.OriginalData().GetSingleMask());
-		Stopwatch watchB(true);
-		ThresholdMitigater::VerticalSumThresholdLargeReference(input, maskB, length, threshold);
-		AOLogger::Info << "Vertical, length " << length << ": " << watchB.ToString() << '\n';
-		
-		Mask2DPtr maskD = Mask2D::CreateCopy(artifacts.OriginalData().GetSingleMask());
-		Stopwatch watchD(true);
-		ThresholdMitigater::VerticalSumThresholdLargeSSE(input, maskD, length, threshold);
-		AOLogger::Info << "SSE Vertical, length " << length << ": " << watchD.ToString() << '\n';
-	}
-}
-
-inline void DefaultStrategySpeedTest::TimeRankOperator::operator()()
-{
-	rfiStrategy::ArtifactSet artifacts(0);
-
-	rfiStrategy::Strategy *strategy = rfiStrategy::Strategy::CreateDefaultSingleStrategy();
-	prepareStrategy(artifacts);
-	DummyProgressListener progressListener;
-	Stopwatch watch(true);
-	strategy->Perform(artifacts, progressListener);
-	watch.Pause();
-	delete strategy;
-	
-	Mask2DPtr input = Mask2D::CreateCopy(artifacts.ContaminatedData().GetSingleMask());
-	
-	Stopwatch operatorTimer(true);
-	SIROperator::OperateHorizontally(input, 0.2);
-	SIROperator::OperateVertically(input, 0.2);
-	operatorTimer.Pause();
-	
-	long double operatorTime = operatorTimer.Seconds();
-	long double totalTime = watch.Seconds();
-	
-	AOLogger::Info
-		<< "Rank operator took " << operatorTimer.ToShortString() << " (" << operatorTime << ")"
-		<< " of " << watch.ToShortString() << " (" << totalTime << ")"
-		<< ", " << ( operatorTime * 100.0 / totalTime) << "%\n";
-}
-
-inline void DefaultStrategySpeedTest::TimeSSEHighPassFilterStrategy::operator()()
-{
-	rfiStrategy::Strategy *strategy = new rfiStrategy::Strategy();
-	rfiStrategy::ActionBlock &block = *strategy;
-	rfiStrategy::ActionBlock *current;
-
-	block.Add(new rfiStrategy::SetFlaggingAction());
-
-	rfiStrategy::ForEachPolarisationBlock *fepBlock = new rfiStrategy::ForEachPolarisationBlock();
-	block.Add(fepBlock);
-	current = fepBlock;
-
-	rfiStrategy::ForEachComplexComponentAction *focAction = new rfiStrategy::ForEachComplexComponentAction();
-	focAction->SetOnAmplitude(true);
-	focAction->SetOnImaginary(false);
-	focAction->SetOnReal(false);
-	focAction->SetOnPhase(false);
-	focAction->SetRestoreFromAmplitude(false);
-	current->Add(focAction);
-	current = focAction;
-
-	rfiStrategy::IterationBlock *iteration = new rfiStrategy::IterationBlock();
-	iteration->SetIterationCount(2);
-	iteration->SetSensitivityStart(4.0);
-	current->Add(iteration);
-	current = iteration;
-	
-	rfiStrategy::SumThresholdAction *t2 = new rfiStrategy::SumThresholdAction();
-	t2->SetBaseSensitivity(1.0);
-	current->Add(t2);
-
-	rfiStrategy::CombineFlagResults *cfr2 = new rfiStrategy::CombineFlagResults();
-	current->Add(cfr2);
-
-	cfr2->Add(new rfiStrategy::FrequencySelectionAction());
-	cfr2->Add(new rfiStrategy::TimeSelectionAction());
-
-	current->Add(new rfiStrategy::SetImageAction());
-	rfiStrategy::ChangeResolutionAction
-		*changeResAction2 = new rfiStrategy::ChangeResolutionAction();
-	changeResAction2->SetTimeDecreaseFactor(3);
-	changeResAction2->SetFrequencyDecreaseFactor(3);
-
-	rfiStrategy::HighPassFilterAction *hpAction = new rfiStrategy::HighPassFilterAction();
-	hpAction->SetHKernelSigmaSq(2.5);
-	hpAction->SetWindowWidth(10*2+1);
-	hpAction->SetVKernelSigmaSq(5.0);
-	hpAction->SetWindowHeight(15*2+1);
-	hpAction->SetMode(rfiStrategy::HighPassFilterAction::StoreRevised);
-	changeResAction2->Add(hpAction);
-
-	current->Add(changeResAction2);
-
-	current = focAction;
-	rfiStrategy::SumThresholdAction *t3 = new rfiStrategy::SumThresholdAction();
-	current->Add(t3);
-	
-	rfiStrategy::PlotAction *plotPolarizationStatistics = new rfiStrategy::PlotAction();
-	plotPolarizationStatistics->SetPlotKind(rfiStrategy::PlotAction::PolarizationStatisticsPlot);
-	block.Add(plotPolarizationStatistics);
-	
-	rfiStrategy::SetFlaggingAction
-		*setFlagsInAllPolarizations = new rfiStrategy::SetFlaggingAction();
-	setFlagsInAllPolarizations->SetNewFlagging(rfiStrategy::SetFlaggingAction::PolarisationsEqual);
-	
-	block.Add(setFlagsInAllPolarizations);
-	block.Add(new rfiStrategy::StatisticalFlagAction());
-	block.Add(new rfiStrategy::TimeSelectionAction());
-
-	rfiStrategy::BaselineSelectionAction
-		*baselineSelection = new rfiStrategy::BaselineSelectionAction();
-	baselineSelection->SetPreparationStep(true);
-	block.Add(baselineSelection);
-
-	rfiStrategy::SetFlaggingAction *orWithOriginals = new rfiStrategy::SetFlaggingAction();
-	orWithOriginals->SetNewFlagging(rfiStrategy::SetFlaggingAction::OrOriginal);
-	block.Add(orWithOriginals);
-
-	rfiStrategy::ArtifactSet artifacts(0);
-	prepareStrategy(artifacts);
-	DummyProgressListener progressListener;
-	Stopwatch watch(true);
-	strategy->Perform(artifacts, progressListener);
-	AOLogger::Info << "Default strategy took: " << watch.ToString() << '\n';
-	delete strategy;
-}
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/test/experiments/experimentstestgroup.h b/CEP/DP3/AOFlagger/include/AOFlagger/test/experiments/experimentstestgroup.h
deleted file mode 100644
index 607cc7bba072aceb5f83f45b3e7902e993847104..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/test/experiments/experimentstestgroup.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef AOFLAGGER_EXPERIMENTSTESTGROUP_H
-#define AOFLAGGER_EXPERIMENTSTESTGROUP_H
-
-#include <AOFlagger/test/testingtools/testgroup.h>
-
-#include <AOFlagger/test/experiments/defaultstrategyspeedtest.h>
-//#include <AOFlagger/test/experiments/filterresultstest.h>
-#include <AOFlagger/test/experiments/highpassfilterexperiment.h>
-//#include <AOFlagger/test/experiments/scaleinvariantdilationexperiment.h>
-//#include <AOFlagger/test/experiments/rankoperatorrocexperiment.h>
-
-class ExperimentsTestGroup : public TestGroup {
-	public:
-		ExperimentsTestGroup() : TestGroup("Experiments") { }
-		
-		virtual void Initialize()
-		{
-			Add(new HighPassFilterExperiment());
-			//Add(new RankOperatorROCExperiment());
-			Add(new DefaultStrategySpeedTest());
-			//Add(new FilterResultsTest());
-			//Add(new ScaleInvariantDilationExperiment());
-		}
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/test/experiments/filterresultstest.h b/CEP/DP3/AOFlagger/include/AOFlagger/test/experiments/filterresultstest.h
deleted file mode 100644
index 8bd2e1237a3ac04c907d7bbd404d16eefca0ebff..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/test/experiments/filterresultstest.h
+++ /dev/null
@@ -1,360 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef AOFLAGGER_FILTERRESULTSTEST_H
-#define AOFLAGGER_FILTERRESULTSTEST_H
-
-#include <complex>
-#include <fstream>
-
-#include <AOFlagger/test/testingtools/asserter.h>
-#include <AOFlagger/test/testingtools/unittest.h>
-
-#include <AOFlagger/msio/pngfile.h>
-
-#include <AOFlagger/util/ffttools.h>
-
-#include <AOFlagger/imaging/defaultmodels.h>
-
-#include <AOFlagger/strategy/actions/directionalcleanaction.h>
-#include <AOFlagger/strategy/actions/foreachcomplexcomponentaction.h>
-#include <AOFlagger/strategy/actions/fouriertransformaction.h>
-#include <AOFlagger/strategy/actions/frequencyconvolutionaction.h>
-#include <AOFlagger/strategy/actions/fringestopaction.h>
-#include <AOFlagger/strategy/actions/iterationaction.h>
-#include <AOFlagger/strategy/actions/setimageaction.h>
-#include <AOFlagger/strategy/actions/strategyaction.h>
-#include <AOFlagger/strategy/actions/timeconvolutionaction.h>
-#include <AOFlagger/strategy/actions/uvprojectaction.h>
-
-class FilterResultsTest : public UnitTest {
-	public:
-		FilterResultsTest() : UnitTest("Filter results")
-		{
-			std::ofstream("filter-stats.txt", std::ios_base::out | std::ios_base::trunc);
-			AddTest(TestNoSource(), "No source");
-			AddTest(TestConstantSource(), "Constant source");
-			AddTest(TestVariableSource(), "Variable source");
-			AddTest(TestFaintSource(), "Faint source");
-			AddTest(TestMissedSource(), "Misslocated source");
-		}
-		
-	private:
-		const static unsigned CHANNEL_COUNT;
-		const static double BANDWIDTH;
-		
-		struct TestNoSource : public Asserter
-		{
-			void operator()();
-		};
-		struct TestConstantSource : public Asserter
-		{
-			void operator()();
-		};
-		struct TestVariableSource : public Asserter
-		{
-			void operator()();
-		};
-		struct TestFaintSource : public Asserter
-		{
-			void operator()();
-		};
-		struct TestMissedSource : public Asserter
-		{
-			void operator()();
-		};
-		
-		static rfiStrategy::Strategy *createStrategy(bool withFringeFilter, bool withTimeConv, bool withFrequencyConv, bool withTimeClean)
-		{
-			rfiStrategy::Strategy *strategy = new rfiStrategy::Strategy();
-			
-			if(withFringeFilter)
-			{
-				rfiStrategy::FringeStopAction *fsAction = new rfiStrategy::FringeStopAction();
-				fsAction->SetNewPhaseCentreRA(DefaultModels::DistortionRA());
-				fsAction->SetNewPhaseCentreDec(DefaultModels::DistortionDec());
-				fsAction->SetFringesToConsider(3.0);
-				fsAction->SetMinWindowSize(500);
-				fsAction->SetMaxWindowSize(500);
-				strategy->Add(fsAction);
-
-				rfiStrategy::SetImageAction *setAction = new rfiStrategy::SetImageAction();
-				setAction->SetNewImage(rfiStrategy::SetImageAction::SwapRevisedAndContaminated);
-				strategy->Add(setAction);
-			}
-			
-			if(withFrequencyConv || withTimeConv)
-			{
-				rfiStrategy::ForEachComplexComponentAction *foccAction = new rfiStrategy::ForEachComplexComponentAction();
-				strategy->Add(foccAction);
-
-				if(withFrequencyConv)
-				{
-					rfiStrategy::FrequencyConvolutionAction *fcAction = new rfiStrategy::FrequencyConvolutionAction();
-					fcAction->SetConvolutionSize(5.0);
-					fcAction->SetKernelKind(rfiStrategy::FrequencyConvolutionAction::SincKernel);
-					foccAction->Add(fcAction);
-				}
-				
-				if(withTimeConv)
-				{
-					rfiStrategy::TimeConvolutionAction *tcAction = new rfiStrategy::TimeConvolutionAction();
-					tcAction->SetSincScale(6.0);
-					tcAction->SetIsSincScaleInSamples(false);
-					tcAction->SetOperation(rfiStrategy::TimeConvolutionAction::SingleSincOperation);
-					foccAction->Add(tcAction);
-					
-					rfiStrategy::SetImageAction *setAction = new rfiStrategy::SetImageAction();
-					setAction->SetNewImage(rfiStrategy::SetImageAction::SwapRevisedAndContaminated);
-					foccAction->Add(setAction);
-				}
-			}
-			
-			if(withTimeClean)
-			{
-				rfiStrategy::SetImageAction *set1Action = new rfiStrategy::SetImageAction();
-				set1Action->SetNewImage(rfiStrategy::SetImageAction::SwapRevisedAndContaminated);
-				strategy->Add(set1Action);
-				
-				rfiStrategy::IterationBlock *iterAction = new rfiStrategy::IterationBlock();
-				iterAction->SetIterationCount(50);
-				strategy->Add(iterAction);
-
-				rfiStrategy::SetImageAction *set2Action = new rfiStrategy::SetImageAction();
-				set2Action->SetNewImage(rfiStrategy::SetImageAction::FromRevised);
-				iterAction->Add(set2Action);
-				
-				rfiStrategy::ForEachComplexComponentAction *feccAction = new rfiStrategy::ForEachComplexComponentAction();
-				feccAction->SetOnAmplitude(false);
-				feccAction->SetOnReal(true);
-				feccAction->SetOnImaginary(true);
-				iterAction->Add(feccAction);
-				
-				rfiStrategy::UVProjectAction *projAction = new rfiStrategy::UVProjectAction();
-				projAction->SetDirectionRad(103.54 * (M_PI / 180.0));
-				projAction->SetReverse(false);
-				feccAction->Add(projAction);
-
-				rfiStrategy::FourierTransformAction *ftAction = new rfiStrategy::FourierTransformAction();
-				iterAction->Add(ftAction);
-				
-				rfiStrategy::DirectionalCleanAction *dcAction = new rfiStrategy::DirectionalCleanAction();
-				dcAction->SetLimitingDistance(1.0/2.0);
-				dcAction->SetChannelConvolutionSize(1);
-				dcAction->SetMakePlot(false);
-				dcAction->SetRemoveRatio(0.8);
-				iterAction->Add(dcAction);
-				
-				rfiStrategy::SetImageAction *set3Action = new rfiStrategy::SetImageAction();
-				set3Action->SetNewImage(rfiStrategy::SetImageAction::FromOriginal);
-				strategy->Add(set3Action);
-				
-				//rfiStrategy::SetImageAction *set4Action = new rfiStrategy::SetImageAction();
-				//set4Action->SetNewImage(rfiStrategy::SetImageAction::SwapRevisedAndContaminated);
-				//strategy->Add(set4Action);
-			}
-			
-			return strategy;
-		}
-		
-		static double SquaredValue(const UVImager &imager, unsigned x, unsigned y)
-		{
-			double a = imager.FTReal().Value(x, y), b = imager.FTImaginary().Value(x, y);
-			return a*a + b*b;
-		}
-		
-		static void AddStatistics(const UVImager &imager, const std::string filename, double centerPower, double sidelobePower, double onAxisPower)
-		{
-			std::ofstream statFile("filter-stats.txt", std::ios_base::out | std::ios_base::app);
-			double sourceSum =
-				SquaredValue(imager, 625, 172) +
-				SquaredValue(imager, 625, 173) +
-				SquaredValue(imager, 625, 174) +
-				SquaredValue(imager, 625, 175) +
-				SquaredValue(imager, 626, 173) +
-				SquaredValue(imager, 626, 174);
-			statFile << filename << '\t' << sqrt(sourceSum/6.0);
-			
-			double sourceSidelobeRMS = 0.0;
-			unsigned countSource = 0;
-			for(unsigned y=0; y<346; ++y)
-			{
-				for(unsigned x=510; x<740; ++x)
-				{
-					sourceSidelobeRMS += SquaredValue(imager, x, y);
-					++countSource;
-				}
-			}
-			statFile << '\t' << sqrt(sourceSidelobeRMS/countSource);
-			
-			double onAxisRMS = 0.0;
-			unsigned countOnAxis = 0;
-			for(unsigned y=650; y<1000; ++y)
-			{
-				for(unsigned x=700; x<850; ++x)
-				{
-					onAxisRMS += SquaredValue(imager, x, y);
-					++countOnAxis;
-				}
-			}
-			statFile << '\t' << sqrt(onAxisRMS/countOnAxis);
-			
-			statFile << '\t' << 10.0*log10((centerPower - 1172.84) / (sqrt(sourceSum/6.0) - 1172.84));
-			statFile << '\t' << 10.0*log10((sidelobePower - 2018.02) / (sqrt(sourceSidelobeRMS/countSource) - 2018.02));
-			statFile << '\t' << 100.0*(1.0-(sqrt(onAxisRMS/countOnAxis)) / (onAxisPower)) << '%';
-			statFile << '\n';
-		}
-		
-		static void SaveImaged(const TimeFrequencyData &original, rfiStrategy::ArtifactSet &artifacts, const std::string &filename, bool difference, double centerPower, double sidelobePower, double onAxisPower)
-		{
-			UVImager imager(1024*1.5, 1024*1.5);
-			
-			TimeFrequencyData *data;
-			if(difference)
-			{
-				data =
-					TimeFrequencyData::CreateTFDataFromDiff(original, artifacts.ContaminatedData());
-			} else {
-				data =
-					new TimeFrequencyData(artifacts.ContaminatedData());
-			}
-			
-			imager.SetUVScaling(0.0012);
-			imager.Image(*data, artifacts.MetaData());
-			imager.PerformFFT();
-			
-			if(!difference)
-				AddStatistics(imager, filename, centerPower, sidelobePower, onAxisPower);
-
-			InvPositiveMap colorMap;
-			//const Image2DPtr uvImage = Image2D::CreateCopyPtr(imager.RealUVImage());
-			//PngFile::Save(*uvImage, std::string("UV-") + filename, colorMap);
-			
-			const Image2DPtr image = Image2D::CreateCopyPtr(imager.FTReal());
-			
-			image->SetTrim(400, 0, 1000, 1200);
-			FFTTools::SignedSqrt(*image);
-			image->SetToAbs();
-			
-			PngFile::Save(*image, filename, colorMap, 0.01);
-			
-			delete data;
-		}
-		
-		static void Run(rfiStrategy::Strategy *strategy, std::pair<TimeFrequencyData, TimeFrequencyMetaDataPtr> data, const std::string &appliedName, const std::string &differenceName, double centerPower, double sidelobePower, double onAxisPower)
-		{
-			rfiStrategy::ArtifactSet artifacts(0);
-			DummyProgressListener listener;
-			
-			artifacts.SetOriginalData(data.first);
-			artifacts.SetContaminatedData(data.first);
-			TimeFrequencyData zero(data.first);
-			zero.SetImagesToZero();
-			artifacts.SetRevisedData(zero);
-			artifacts.SetMetaData(data.second);
-			
-			strategy->Perform(artifacts, listener);
-			
-			SaveImaged(data.first, artifacts, appliedName, false, centerPower, sidelobePower, onAxisPower);
-			SaveImaged(data.first, artifacts, differenceName, true, centerPower, sidelobePower, onAxisPower);
-		}
-		
-		static void RunAllMethods(std::pair<TimeFrequencyData, TimeFrequencyMetaDataPtr> data, const std::string &setPrefix, const std::string &setName, double centerPower, double sidelobePower, double onAxisPower)
-		{
-			rfiStrategy::Strategy *strategy = new rfiStrategy::Strategy();
-			Run(strategy, data, setPrefix + "0-" + setName + "-Original.png", "Empty.png", centerPower, sidelobePower, onAxisPower);
-			delete strategy;
-
-			strategy = createStrategy(true, false, false, false);
-			Run(strategy, data, setPrefix + "1-" + setName + "-FringeFilter-Applied.png", setPrefix + "1-" + setName + "-FringeFilter-Difference.png", centerPower, sidelobePower, onAxisPower);
-			delete strategy;
-			
-			strategy = createStrategy(false, true, false, false);
-			Run(strategy, data, setPrefix + "2-" + setName + "-TimeFilter-Applied.png", setPrefix + "2-" + setName + "-TimeFilter-Difference.png", centerPower, sidelobePower, onAxisPower);
-			delete strategy;
-			
-			strategy = createStrategy(false, false, true, false);
-			Run(strategy, data, setPrefix + "3-" + setName + "-FreqFilter-Applied.png", setPrefix + "3-" + setName + "-FreqFilter-Difference.png", centerPower, sidelobePower, onAxisPower);
-			delete strategy;
-
-			strategy = createStrategy(false, false, false, true);
-			Run(strategy, data, setPrefix + "4-" + setName + "-TimeClean-Applied.png", setPrefix + "4-" + setName + "-TimeClean-Difference.png", centerPower, sidelobePower, onAxisPower);
-			delete strategy;
-
-			strategy = createStrategy(false, true, true, false);
-			Run(strategy, data, setPrefix + "5-" + setName + "-TimeFreq-Applied.png", setPrefix + "5-" + setName + "-TimeFreq-Difference.png", centerPower, sidelobePower, onAxisPower);
-			delete strategy;
-		}
-};
-
-const unsigned FilterResultsTest::CHANNEL_COUNT = 64;
-const double FilterResultsTest::BANDWIDTH = 2500000.0;
-
-
-inline void FilterResultsTest::TestNoSource::operator()()
-{
-	std::pair<TimeFrequencyData, TimeFrequencyMetaDataPtr> data
-		= DefaultModels::LoadSet(DefaultModels::B1834Set, DefaultModels::NoDistortion, 0.0, CHANNEL_COUNT, BANDWIDTH);
- 	RunAllMethods(data, "N", "NoSource", 1172.84, 2018.02, 34340.5);
-
-	data = DefaultModels::LoadSet(DefaultModels::EmptySet, DefaultModels::NoDistortion, 0.0, CHANNEL_COUNT, BANDWIDTH);
- 	RunAllMethods(data, "O", "NoSource", 0.0, 0.0, 0.0);
-}
-
-inline void FilterResultsTest::TestConstantSource::operator()()
-{
-	std::pair<TimeFrequencyData, TimeFrequencyMetaDataPtr> data
-		= DefaultModels::LoadSet(DefaultModels::B1834Set, DefaultModels::ConstantDistortion, 0.0, CHANNEL_COUNT, BANDWIDTH);
- 	RunAllMethods(data, "A", "ConstantSource", 541855.0, 36144.3, 47121.4);
-
-	data = DefaultModels::LoadSet(DefaultModels::EmptySet, DefaultModels::ConstantDistortion, 0.0, CHANNEL_COUNT, BANDWIDTH);
- 	RunAllMethods(data, "P", "ConstantSource", 6627.86, 959.102, 1172.99);
-}
-
-inline void FilterResultsTest::TestVariableSource::operator()()
-{
-	std::pair<TimeFrequencyData, TimeFrequencyMetaDataPtr> data
-		= DefaultModels::LoadSet(DefaultModels::B1834Set, DefaultModels::VariableDistortion, 0.0, CHANNEL_COUNT, BANDWIDTH);
- 	RunAllMethods(data, "B", "VariableSource", 1.36159e+06, 99793.8, 56885.0);
-
-	data = DefaultModels::LoadSet(DefaultModels::EmptySet, DefaultModels::VariableDistortion, 0.0, CHANNEL_COUNT, BANDWIDTH);
- 	RunAllMethods(data, "Q", "VariableSource", 629649.0, 50508.9, 2456.41);
-}
-
-inline void FilterResultsTest::TestFaintSource::operator()()
-{
-	std::pair<TimeFrequencyData, TimeFrequencyMetaDataPtr> data
-		= DefaultModels::LoadSet(DefaultModels::B1834Set, DefaultModels::FaintDistortion, 0.0, CHANNEL_COUNT, BANDWIDTH);
- 	RunAllMethods(data, "C", "FaintSource", 79725.9, 5972.41, 36504.8);
-
-	data = DefaultModels::LoadSet(DefaultModels::EmptySet, DefaultModels::FaintDistortion, 0.0, CHANNEL_COUNT, BANDWIDTH);
- 	RunAllMethods(data, "R", "FaintSource", 6031.9, 584.827, 335.651);
-}
-
-inline void FilterResultsTest::TestMissedSource::operator()()
-{
-	std::pair<TimeFrequencyData, TimeFrequencyMetaDataPtr> data
-		= DefaultModels::LoadSet(DefaultModels::B1834Set, DefaultModels::MislocatedDistortion, 0.0, CHANNEL_COUNT, BANDWIDTH);
- 	RunAllMethods(data, "D", "MissedSource", 232796.0, 100212.6, 57039.4);
-
-	data = DefaultModels::LoadSet(DefaultModels::EmptySet, DefaultModels::MislocatedDistortion, 0.0, CHANNEL_COUNT, BANDWIDTH);
- 	RunAllMethods(data, "S", "MissedSource", 95403.1, 50750.5, 2526.13);
-}
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/test/experiments/highpassfilterexperiment.h b/CEP/DP3/AOFlagger/include/AOFlagger/test/experiments/highpassfilterexperiment.h
deleted file mode 100644
index 01aae16c25491b2e401d1c8cbefe945949a31c2b..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/test/experiments/highpassfilterexperiment.h
+++ /dev/null
@@ -1,158 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef AOFLAGGER_HIGHPASSFILTEREXPERIMENT_H
-#define AOFLAGGER_HIGHPASSFILTEREXPERIMENT_H
-
-#include <AOFlagger/test/testingtools/asserter.h>
-#include <AOFlagger/test/testingtools/unittest.h>
-
-#include <AOFlagger/strategy/algorithms/highpassfilter.h>
-#include <AOFlagger/strategy/algorithms/localfitmethod.h>
-
-#include <AOFlagger/util/rng.h>
-
-class HighPassFilterExperiment : public UnitTest {
-	public:
-		HighPassFilterExperiment() : UnitTest("High-pass filter experiments")
-		{
-			AddTest(TimeFitting(), "Timing 'Fitting' algorithm");
-			AddTest(TimeHighPassFilter(), "Timing 'high-pass filter' algorithm");
-			AddTest(TimeFlaggedFitting(), "Timing 'Fitting' algorithm with 50% flags");
-			AddTest(TimeFlaggedHighPassFilter(), "Timing 'high-pass filter' algorithm with 50% flags");
-		}
-		
-	private:
-		static void Initialize(Image2DPtr &image, Mask2DPtr &mask)
-		{
-			const size_t width = 10000, height=256;
-			image = Image2D::CreateUnsetImagePtr(width, height);
-			mask = Mask2D::CreateUnsetMaskPtr(width, height);
-			size_t i=0;
-			for(size_t y=0;y<height;++y)
-			{
-				for(size_t x=0;x<width;++x)
-				{
-					image->SetValue(x, y, i);
-					mask->SetValue(x, y, (i%25==0) || (y==5));
-					++i;
-				}
-			}
-		}
-		
-		static void InitializeFlagged(Image2DPtr &image, Mask2DPtr &mask)
-		{
-			const size_t width = 10000/3, height=256/3;
-			image = Image2D::CreateUnsetImagePtr(width, height);
-			mask = Mask2D::CreateUnsetMaskPtr(width, height);
-			size_t i=0;
-			for(size_t y=0;y<height;++y)
-			{
-				for(size_t x=0;x<width;++x)
-				{
-					image->SetValue(x, y, i);
-					mask->SetValue(x, y, (i%2==0) || (y==5));
-					++i;
-				}
-			}
-		}
-		
-		struct TimeFitting : public Asserter
-		{
-			void operator()();
-		};
-		struct TimeHighPassFilter : public Asserter
-		{
-			void operator()();
-		};
-		struct TimeFlaggedFitting : public Asserter
-		{
-			void operator()();
-		};
-		struct TimeFlaggedHighPassFilter : public Asserter
-		{
-			void operator()();
-		};
-};
-
-inline void HighPassFilterExperiment::TimeFitting::operator()()
-{
-	Image2DPtr image;
-	Mask2DPtr mask;
-	Initialize(image, mask);
-	
-	LocalFitMethod fitMethod;
-	TimeFrequencyData data(TimeFrequencyData::AmplitudePart, StokesIPolarisation, image);
-	fitMethod.SetToWeightedAverage(10, 20, 2.5, 5.0);
-	fitMethod.Initialize(data);
-	Stopwatch watch(true);
-	for(size_t i=0;i<fitMethod.TaskCount();++i)
-		fitMethod.PerformFit(i);
-	std::cout << " time token: " << watch.ToString() << ' ';
-}
-
-inline void HighPassFilterExperiment::TimeHighPassFilter::operator()()
-{
-	Image2DPtr image;
-	Mask2DPtr mask;
-	Initialize(image, mask);
-	
-	HighPassFilter filter;
-	filter.SetHWindowSize(21);
-	filter.SetVWindowSize(41);
-	filter.SetHKernelSigmaSq(2.5);
-	filter.SetVKernelSigmaSq(5.0);
-	Stopwatch watch(true);
-	filter.ApplyHighPass(image, mask);
-	std::cout << " time token: " << watch.ToString() << ' ';
-}
-
-inline void HighPassFilterExperiment::TimeFlaggedFitting::operator()()
-{
-	Image2DPtr image;
-	Mask2DPtr mask;
-	InitializeFlagged(image, mask);
-	
-	LocalFitMethod fitMethod;
-	TimeFrequencyData data(TimeFrequencyData::AmplitudePart, StokesIPolarisation, image);
-	fitMethod.SetToWeightedAverage(10, 20, 2.5, 5.0);
-	fitMethod.Initialize(data);
-	Stopwatch watch(true);
-	for(size_t i=0;i<fitMethod.TaskCount();++i)
-		fitMethod.PerformFit(i);
-	std::cout << " time token: " << watch.ToString() << ' ';
-}
-
-inline void HighPassFilterExperiment::TimeFlaggedHighPassFilter::operator()()
-{
-	Image2DPtr image;
-	Mask2DPtr mask;
-	InitializeFlagged(image, mask);
-	
-	HighPassFilter filter;
-	filter.SetHWindowSize(21);
-	filter.SetVWindowSize(41);
-	filter.SetHKernelSigmaSq(2.5);
-	filter.SetVKernelSigmaSq(5.0);
-	Stopwatch watch(true);
-	filter.ApplyHighPass(image, mask);
-	std::cout << " time token: " << watch.ToString() << ' ';
-}
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/test/experiments/rankoperatorrocexperiment.h b/CEP/DP3/AOFlagger/include/AOFlagger/test/experiments/rankoperatorrocexperiment.h
deleted file mode 100644
index aadbc3dc711dea146a9c0c4cdc7e21a573531617..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/test/experiments/rankoperatorrocexperiment.h
+++ /dev/null
@@ -1,518 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef AOFLAGGER_RANKOPERATORROCEXPERIMENT_H
-#define AOFLAGGER_RANKOPERATORROCEXPERIMENT_H
-
-#include <iostream>
-
-#include <AOFlagger/test/testingtools/asserter.h>
-#include <AOFlagger/test/testingtools/unittest.h>
-
-#include <AOFlagger/strategy/algorithms/mitigationtester.h>
-#include <AOFlagger/strategy/algorithms/siroperator.h>
-#include <AOFlagger/strategy/algorithms/statisticalflagger.h>
-#include <AOFlagger/strategy/algorithms/thresholdtools.h>
-
-#include <AOFlagger/msio/pngfile.h>
-
-#include <AOFlagger/util/rng.h>
-
-#include <AOFlagger/strategy/actions/changeresolutionaction.h>
-#include <AOFlagger/strategy/actions/foreachcomplexcomponentaction.h>
-#include <AOFlagger/strategy/actions/iterationaction.h>
-#include <AOFlagger/strategy/actions/setflaggingaction.h>
-#include <AOFlagger/strategy/actions/setimageaction.h>
-#include <AOFlagger/strategy/actions/strategyaction.h>
-#include <AOFlagger/strategy/actions/sumthresholdaction.h>
-#include <AOFlagger/strategy/actions/slidingwindowfitaction.h>
-
-class RankOperatorROCExperiment : public UnitTest {
-	public:
-		RankOperatorROCExperiment() : UnitTest("Rank operator ROC experiments")
-		{
-			AddTest(RankOperatorROCGaussian(), "Constructing rank operator & dilation ROC curve for Gaussian broadband RFI");
-			AddTest(RankOperatorROCSinusoidal(), "Constructing rank operator & dilation ROC curve for sinusoidal broadband RFI");
-			AddTest(RankOperatorROCSGaussian(), "Constructing rank operator & dilation ROC curve for slewed Gaussian RFI");
-			AddTest(RankOperatorROCSBurst(), "Constructing rank operator & dilation ROC curve for burst RFI");
-		}
-		
-	private:
-		struct EvaluationResult
-		{
-			EvaluationResult() :
-				tpRatio(0.0), fpRatio(0.0),
-				tpFuzzy(0.0), fpFuzzy(0.0),
-				tpFuzzySq(0.0), fpFuzzySq(0.0)
-			{
-			}
-			
-			double tpRatio, fpRatio;
-			double tpFuzzy, fpFuzzy;
-			double tpFuzzySq, fpFuzzySq; // to calculate std dev
-			std::vector<double> tpRefTP, tpRefFP;
-		};
-
-		struct RankOperatorROCGaussian : public Asserter
-		{
-			void operator()() { executeTest(GaussianBroadband); }
-		};
-		struct RankOperatorROCSinusoidal : public Asserter
-		{
-			void operator()() { executeTest(SinusoidalBroadband); }
-		};
-		struct RankOperatorROCSGaussian : public Asserter
-		{
-			void operator()() { executeTest(SlewedGaussianBroadband); }
-		};
-		struct RankOperatorROCSBurst : public Asserter
-		{
-			void operator()() { executeTest(BurstBroadband); }
-		};
-		
-		static const unsigned _repeatCount;
-		
-		enum TestType { GaussianBroadband, SinusoidalBroadband, SlewedGaussianBroadband, BurstBroadband };
-		
-		static void TestNoisePerformance(size_t totalRFI, double totalRFISum, const std::string &testname);
-		static void evaluateIterationResults(Mask2DPtr result, Mask2DPtr maskGroundTruth, Image2DPtr fuzzyGroundTruth, const size_t totalRFI, struct EvaluationResult &evaluationResult);
-		static double stddev(double sum, double sumSq, unsigned n)
-		{
-			const double sumMeanSquared = sum * sum / n;
-			return sqrt((sumSq - sumMeanSquared) / n);
-		}
-		
-		static rfiStrategy::Strategy *createThresholdStrategy();
-		static void executeTest(enum TestType testType);
-		
-		static num_t getRatio(Image2DPtr groundTruth, Mask2DCPtr resultMask, bool inverseTruth, bool invertMask)
-		{
-			num_t totalTruth = groundTruth->Sum();
-			if(inverseTruth)
-			{
-				totalTruth = groundTruth->Width() * groundTruth->Height() - totalTruth;
-			}
-			num_t sum = 0.0;
-			for(size_t y=0;y<groundTruth->Height();++y)
-			{
-				for(size_t x=0;x<groundTruth->Width();++x)
-				{
-					num_t truth = inverseTruth ? (1.0 - groundTruth->Value(x, y)) : groundTruth->Value(x, y);
-					if(resultMask->Value(x, y) != invertMask)
-					{
-						sum += truth;
-					}
-				}
-			}
-			return sum / totalTruth;
-		}
-};
-
-const unsigned RankOperatorROCExperiment::_repeatCount = 100;
-
-inline rfiStrategy::Strategy *RankOperatorROCExperiment::createThresholdStrategy()
-{
-	rfiStrategy::Strategy *strategy = new rfiStrategy::Strategy();
-	
-	rfiStrategy::ActionBlock *current = strategy;
-
-	current->Add(new rfiStrategy::SetFlaggingAction());
-
-	rfiStrategy::ForEachComplexComponentAction *focAction = new rfiStrategy::ForEachComplexComponentAction();
-	focAction->SetOnAmplitude(true);
-	focAction->SetOnImaginary(false);
-	focAction->SetOnReal(false);
-	focAction->SetOnPhase(false);
-	focAction->SetRestoreFromAmplitude(false);
-	current->Add(focAction);
-	current = focAction;
-
-	rfiStrategy::IterationBlock *iteration = new rfiStrategy::IterationBlock();
-	iteration->SetIterationCount(2);
-	iteration->SetSensitivityStart(4.0);
-	current->Add(iteration);
-	current = iteration;
-	
-	rfiStrategy::SumThresholdAction *t2 = new rfiStrategy::SumThresholdAction();
-	t2->SetBaseSensitivity(1.0);
-	current->Add(t2);
-
-	current->Add(new rfiStrategy::SetImageAction());
-	rfiStrategy::ChangeResolutionAction *changeResAction2 = new rfiStrategy::ChangeResolutionAction();
-	changeResAction2->SetTimeDecreaseFactor(3);
-	changeResAction2->SetFrequencyDecreaseFactor(3);
-
-	rfiStrategy::SlidingWindowFitAction *swfAction2 = new rfiStrategy::SlidingWindowFitAction();
-	swfAction2->Parameters().timeDirectionKernelSize = 2.5;
-	swfAction2->Parameters().timeDirectionWindowSize = 10;
-	swfAction2->Parameters().frequencyDirectionKernelSize = 5.0;
-	swfAction2->Parameters().frequencyDirectionWindowSize = 15;
-	changeResAction2->Add(swfAction2);
-
-	current->Add(changeResAction2);
-	
-	current = focAction;
-	rfiStrategy::SumThresholdAction *t3 = new rfiStrategy::SumThresholdAction();
-	current->Add(t3);
-	
-	return strategy;
-}
-
-void RankOperatorROCExperiment::evaluateIterationResults(Mask2DPtr result, Mask2DPtr maskGroundTruth, Image2DPtr fuzzyGroundTruth, const size_t totalRFI, EvaluationResult &evaluationResult)
-{
-	size_t totalPositives = result->GetCount<true>();
-	double tpFuzzyRatio = getRatio(fuzzyGroundTruth, result, false, false);
-	double fpFuzzyRatio = getRatio(fuzzyGroundTruth, result, true, false);
-	
-	Mask2DCPtr originalResult = Mask2D::CreateCopy(result);
-	result->Intersect(maskGroundTruth);
-	size_t truePositives = result->GetCount<true>();
-	size_t falsePositives = totalPositives - truePositives;
-	
-	double tpR = (double) truePositives / totalRFI;
-	double fpR = (double) falsePositives / totalRFI;
-	
-	evaluationResult.tpRatio += tpR;
-	evaluationResult.fpRatio += fpR;
-	evaluationResult.tpFuzzy += tpFuzzyRatio;
-	evaluationResult.fpFuzzy += fpFuzzyRatio;
-	evaluationResult.tpFuzzySq += tpFuzzyRatio*tpFuzzyRatio;
-	evaluationResult.fpFuzzySq += fpFuzzyRatio*fpFuzzyRatio;
-	
-	/*for(size_t i=1;i<=10;++i)
-	{
-		double groundTruthThreshold = (double) i / 20;
-		Mask2DPtr thrGroundTruth = ThresholdTools::Threshold(fuzzyGroundTruth, groundTruthThreshold);
-		Mask2DPtr intersectResult = Mask2D::CreateCopy(originalResult);
-		size_t refTotalRFI = thrGroundTruth->GetCount<true>();
-		intersectResult->Intersect(thrGroundTruth);
-		size_t refTruePositives = intersectResult->GetCount<true>();
-		size_t refFalsePositives = totalPositives - refTruePositives;
-		
-		evaluationResult.tpRefTP.push_back((double) refTruePositives / refTotalRFI);
-		evaluationResult.tpRefFP.push_back((double) refFalsePositives / refTotalRFI);
-	}*/
-}
-
-void RankOperatorROCExperiment::executeTest(enum TestType testType)
-{
-	const size_t ETA_STEPS = 400, DIL_STEPS = 512;
-	const size_t width = 1024, height = 1024;
-	const double MAX_DILATION = 1024;
-	
-	std::string testname;
-	switch(testType)
-	{
-		case GaussianBroadband:
-			testname = "gaussian";
-			break;
-		case SinusoidalBroadband:
-			testname = "sinusoidal";
-			break;
-		case SlewedGaussianBroadband:
-			testname = "slewed_gaussian";
-			break;
-		case BurstBroadband:
-			testname = "burst";
-			break;
-	}
-	
-	EvaluationResult rocResults[ETA_STEPS+1], dilResults[DIL_STEPS+1];
-	
-	for(unsigned repeatIndex=0 ; repeatIndex<_repeatCount ; ++repeatIndex)
-	{
-		Mask2DPtr mask = Mask2D::CreateSetMaskPtr<false>(width, height);
-		Image2DPtr
-			groundTruth = Image2D::CreateZeroImagePtr(width, height);
-		Image2DPtr realImage, imagImage;
-		Image2DCPtr rfiLessImage;
-		TimeFrequencyData rfiLessData, data;
-		switch(testType)
-		{
-			case GaussianBroadband:
-			{
-				Image2DPtr
-					realTruth  = Image2D::CreateZeroImagePtr(width, height),
-					imagTruth  = Image2D::CreateZeroImagePtr(width, height);
-				realImage = MitigationTester::CreateTestSet(2, mask, width, height),
-				imagImage = MitigationTester::CreateTestSet(2, mask, width, height);
-				//realImage->MultiplyValues(0.5); //for different SNR
-				//imagImage->MultiplyValues(0.5);
-				rfiLessData = TimeFrequencyData(SinglePolarisation, realImage, imagImage);
-				rfiLessData.Trim(0, 0, 180, height);
-				rfiLessImage = rfiLessData.GetSingleImage();
-				MitigationTester::AddGaussianBroadbandToTestSet(realImage, mask);
-				MitigationTester::AddGaussianBroadbandToTestSet(imagImage, mask);
-				MitigationTester::AddGaussianBroadbandToTestSet(realTruth, mask);
-				MitigationTester::AddGaussianBroadbandToTestSet(imagTruth, mask);
-				groundTruth = Image2D::CreateCopy(TimeFrequencyData(SinglePolarisation, realTruth, imagTruth).GetSingleImage());
-				data = TimeFrequencyData(SinglePolarisation, realImage, imagImage);
-			} break;
-			case SlewedGaussianBroadband:
-			{
-				Image2DPtr
-					realTruth  = Image2D::CreateZeroImagePtr(width, height),
-					imagTruth  = Image2D::CreateZeroImagePtr(width, height);
-				realImage = MitigationTester::CreateTestSet(2, mask, width, height),
-				imagImage = MitigationTester::CreateTestSet(2, mask, width, height);
-				rfiLessData = TimeFrequencyData(SinglePolarisation, realImage, imagImage);
-				rfiLessData.Trim(0, 0, 180, height);
-				rfiLessImage = rfiLessData.GetSingleImage();
-				MitigationTester::AddSlewedGaussianBroadbandToTestSet(realImage, mask);
-				MitigationTester::AddSlewedGaussianBroadbandToTestSet(imagImage, mask);
-				MitigationTester::AddSlewedGaussianBroadbandToTestSet(realTruth, mask);
-				MitigationTester::AddSlewedGaussianBroadbandToTestSet(imagTruth, mask);
-				groundTruth = Image2D::CreateCopy(TimeFrequencyData(SinglePolarisation, realTruth, imagTruth).GetSingleImage());
-				data = TimeFrequencyData(SinglePolarisation, realImage, imagImage);
-			} break;
-			case SinusoidalBroadband:
-			{
-				Image2DPtr
-					realTruth  = Image2D::CreateZeroImagePtr(width, height),
-					imagTruth  = Image2D::CreateZeroImagePtr(width, height);
-				realImage = MitigationTester::CreateTestSet(2, mask, width, height),
-				imagImage = MitigationTester::CreateTestSet(2, mask, width, height);
-				//realImage->MultiplyValues(0.5); //for different SNR
-				//imagImage->MultiplyValues(0.5);
-				rfiLessData = TimeFrequencyData(SinglePolarisation, realImage, imagImage);
-				rfiLessData.Trim(0, 0, 180, height);
-				rfiLessImage = rfiLessData.GetSingleImage();
-				MitigationTester::AddSinusoidalBroadbandToTestSet(realImage, mask);
-				MitigationTester::AddSinusoidalBroadbandToTestSet(imagImage, mask);
-				MitigationTester::AddSinusoidalBroadbandToTestSet(realTruth, mask);
-				MitigationTester::AddSinusoidalBroadbandToTestSet(imagTruth, mask);
-				groundTruth = Image2D::CreateCopy(TimeFrequencyData(SinglePolarisation, realTruth, imagTruth).GetSingleImage());
-				data = TimeFrequencyData(SinglePolarisation, realImage, imagImage);
-			} break;
-			case BurstBroadband:
-			{
-				Image2DPtr
-					realTruth  = Image2D::CreateZeroImagePtr(width, height),
-					imagTruth  = Image2D::CreateZeroImagePtr(width, height);
-				realImage = MitigationTester::CreateTestSet(2, mask, width, height),
-				imagImage = MitigationTester::CreateTestSet(2, mask, width, height);
-				//realImage->MultiplyValues(0.5); //for different SNR
-				//imagImage->MultiplyValues(0.5);
-				rfiLessData = TimeFrequencyData(SinglePolarisation, realImage, imagImage);
-				rfiLessData.Trim(0, 0, 180, height);
-				rfiLessImage = rfiLessData.GetSingleImage();
-				MitigationTester::AddBurstBroadbandToTestSet(realImage, mask);
-				MitigationTester::AddBurstBroadbandToTestSet(imagImage, mask);
-				MitigationTester::AddBurstBroadbandToTestSet(realTruth, mask);
-				MitigationTester::AddBurstBroadbandToTestSet(imagTruth, mask);
-				groundTruth = Image2D::CreateCopy(TimeFrequencyData(SinglePolarisation, realTruth, imagTruth).GetSingleImage());
-				data = TimeFrequencyData(SinglePolarisation, realImage, imagImage);
-			} break;
-		}
-		std::cout << '_' << std::flush;
-		
-		data.Trim(0, 0, 180, height);
-		groundTruth->SetTrim(0, 0, 180, height);
-		groundTruth->MultiplyValues(1.0/groundTruth->GetMaximum());
-		Image2DCPtr inputImage = data.GetSingleImage();
-		
-		rfiStrategy::ArtifactSet artifacts(0);
-		
-		artifacts.SetOriginalData(data);
-		artifacts.SetContaminatedData(data);
-		data.SetImagesToZero();
-		artifacts.SetRevisedData(data);
-
-		rfiStrategy::Strategy *strategy = createThresholdStrategy();
-		DummyProgressListener listener;
-		strategy->Perform(artifacts, listener);
-		delete strategy;
-		
-		const size_t totalRFI = mask->GetCount<true>();
-		
-		Mask2DCPtr input = artifacts.ContaminatedData().GetSingleMask();
-		for(unsigned i=0;i<ETA_STEPS+1;++i)
-		{
-			const num_t eta = (num_t) i / (num_t) ETA_STEPS;
-			Mask2DPtr resultMask = Mask2D::CreateCopy(input);
-			SIROperator::OperateVertically(resultMask, eta);
-			
-			evaluateIterationResults(resultMask, mask, groundTruth, totalRFI, rocResults[i]);
-		}
-			
-		std::cout << '.' << std::flush;
-		
-		for(size_t i=0;i<DIL_STEPS;++i)
-		{
-			const size_t dilSize = i * MAX_DILATION / DIL_STEPS;
-			
-			Mask2DPtr resultMask = Mask2D::CreateCopy(input);
-			StatisticalFlagger::DilateFlagsVertically(resultMask, dilSize);
-			
-			evaluateIterationResults(resultMask, mask, groundTruth, totalRFI, dilResults[i]);
-		}
-		
-		//grTotalRFI += totalRFI;
-		//grTotalRFISum += totalRFISum;
-		
-		std::cout << '.' << std::flush;
-	} // next repetition
-	
-	const std::string rankOperatorFilename(std::string("rank-operator-roc-") + testname + ".txt");
-	std::ofstream rankOperatorFile(rankOperatorFilename.c_str());
-	for(unsigned i=0;i<ETA_STEPS+1;++i)
-	{
-		const num_t eta = (num_t) i / (num_t) ETA_STEPS;
-			rankOperatorFile
-			<< "eta\t" << eta
-			<< "\tTP\t" << rocResults[i].tpRatio / _repeatCount
-			<< "\tFP\t" << rocResults[i].fpRatio / _repeatCount
-			<< "\ttpSum\t" << rocResults[i].tpFuzzy / _repeatCount
-			<< "\tfpSum\t" << rocResults[i].fpFuzzy / _repeatCount;
-			for(size_t j=0;j<rocResults[i].tpRefTP.size();++j)
-			{
-				rankOperatorFile << "\t" << rocResults[i].tpRefTP[j] << "\t" << rocResults[i].tpRefFP[j];
-			}
-			rankOperatorFile
-			<< "\ttpSumStdDev\t" << stddev(rocResults[i].tpFuzzy, rocResults[i].tpFuzzySq, _repeatCount)
-			<< "\tfpSumStdDev\t" << stddev(rocResults[i].fpFuzzy, rocResults[i].fpFuzzySq, _repeatCount);
-			rankOperatorFile << '\n';
-	}
-	const std::string dilationFilename(std::string("dilation-roc-") + testname + ".txt");
-	std::ofstream dilationFile(dilationFilename.c_str());
-	for(size_t i=0;i<DIL_STEPS;++i)
-	{
-		const size_t dilSize = i * MAX_DILATION / DIL_STEPS;
-		dilationFile
-		<< "size\t" << dilSize
-		<< "\tTP\t" << dilResults[i].tpRatio / _repeatCount
-		<< "\tFP\t" << dilResults[i].fpRatio / _repeatCount
-		<< "\ttpSum\t" << dilResults[i].tpFuzzy / _repeatCount
-		<< "\tfpSum\t" << dilResults[i].fpFuzzy / _repeatCount;
-			for(size_t j=0;j<dilResults[i].tpRefTP.size();++j)
-			{
-				dilationFile << "\t" << dilResults[i].tpRefTP[j] << "\t" << dilResults[i].tpRefFP[j];
-			}
-			dilationFile
-			<< "\ttpSumStdDev\t" << stddev(dilResults[i].tpFuzzy, dilResults[i].tpFuzzySq, _repeatCount)
-			<< "\tfpSumStdDev\t" << stddev(dilResults[i].fpFuzzy, dilResults[i].fpFuzzySq, _repeatCount);
-			dilationFile << '\n';
-	}
-	
-	//TestNoisePerformance(grTotalRFI / _repeatCount, grTotalRFISum / _repeatCount, testname);
-}
-
-inline void RankOperatorROCExperiment::TestNoisePerformance(size_t totalRFI, double totalRFISum, const std::string &testname)
-{
-	const size_t ETA_STEPS = 100, DIL_STEPS = 128;
-	const size_t width = 1024, height = 1024;
-	numl_t
-		grRankFpRatio[ETA_STEPS+1], grRankFpSum[ETA_STEPS+1],
-		grDilFpRatio[DIL_STEPS+1], grDilFpSum[DIL_STEPS+1];
-		
-	for(unsigned i=0;i<ETA_STEPS+1;++i)
-	{
-		grRankFpRatio[i] = 0.0;
-		grRankFpSum[i] = 0.0;
-	}
-	for(unsigned i=0;i<DIL_STEPS+1;++i)
-	{
-		grDilFpRatio[i] = 0.0;
-		grDilFpSum[i] = 0.0;
-	}
-	
-	for(unsigned repeatIndex=0; repeatIndex<_repeatCount; ++repeatIndex)
-	{
-		Mask2DPtr mask = Mask2D::CreateSetMaskPtr<false>(width, height);
-		Image2DPtr
-			realImage = MitigationTester::CreateTestSet(2, mask, width, height),
-			imagImage = MitigationTester::CreateTestSet(2, mask, width, height);
-			
-		TimeFrequencyData data(SinglePolarisation, realImage, imagImage);
-		data.Trim(0, 0, 180, height);
-		Image2DCPtr inputImage = data.GetSingleImage();
-		
-		rfiStrategy::ArtifactSet artifacts(0);
-		
-		artifacts.SetOriginalData(data);
-		artifacts.SetContaminatedData(data);
-		data.SetImagesToZero();
-		artifacts.SetRevisedData(data);
-
-		rfiStrategy::Strategy *strategy = createThresholdStrategy();
-		DummyProgressListener listener;
-		strategy->Perform(artifacts, listener);
-		delete strategy;
-		
-		Mask2DCPtr input = artifacts.ContaminatedData().GetSingleMask();
-		for(unsigned i=0;i<101;++i)
-		{
-			Mask2DPtr tempMask = Mask2D::CreateCopy(input);
-			const num_t eta = i/100.0;
-			SIROperator::OperateVertically(tempMask, eta);
-			size_t falsePositives = tempMask->GetCount<true>();
-			tempMask->Invert();
-			num_t fpSum = ThresholdTools::Sum(inputImage, tempMask);
-			double fpRatio = (double) falsePositives / totalRFI;
-			
-			grRankFpRatio[i] += fpRatio;
-			grRankFpSum[i] += fpSum/totalRFISum;
-		}
-		
-		for(size_t i=0;i<DIL_STEPS;++i)
-		{
-			const size_t dilSize = i * height / (4 * DIL_STEPS);
-			Mask2DPtr tempMask = Mask2D::CreateCopy(input);
-			StatisticalFlagger::EnlargeFlags(tempMask, 0, dilSize);
-			size_t falsePositives = tempMask->GetCount<true>();
-			tempMask->Invert();
-			num_t fpSum = ThresholdTools::Sum(inputImage, tempMask);
-			double fpRatio = (double) falsePositives / totalRFI;
-			
-			grDilFpRatio[i] += fpRatio;
-			grDilFpSum[i] += fpSum/totalRFISum;
-		}
-		
-		std::cout << '.' << std::flush;
-	}
-	
-	const std::string rankOperatorFilename(std::string("rank-operator-noise-") + testname + ".txt");
-	std::ofstream rankOperatorFile(rankOperatorFilename.c_str());
-	for(unsigned i=0;i<ETA_STEPS+1;++i)
-	{
-		const num_t eta = (num_t) i / (num_t) ETA_STEPS;
-			rankOperatorFile
-			<< "eta\t" << eta
-			<< "\tTP\t" << 0
-			<< "\tFP\t" << grRankFpRatio[i] / _repeatCount
-			<< "\ttpSum\t" << 0.0
-			<< "\tfpSum\t" << grRankFpSum[i] / _repeatCount
-			<< '\n';
-	}
-	const std::string dilationFilename(std::string("dilation-noise-") + testname + ".txt");
-	std::ofstream dilationFile(dilationFilename.c_str());
-	for(size_t i=0;i<DIL_STEPS;++i)
-	{
-		const size_t dilSize = i * height / (4 * DIL_STEPS);
-		dilationFile
-		<< "size\t" << dilSize
-		<< "\tTP\t" << 0
-		<< "\tFP\t" << grDilFpRatio[i] / _repeatCount
-		<< "\ttpSum\t" << 0.0
-		<< "\tfpSum\t" << grDilFpSum[i] / _repeatCount
-		<< '\n';
-	}
-}
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/test/experiments/scaleinvariantdilationexperiment.h b/CEP/DP3/AOFlagger/include/AOFlagger/test/experiments/scaleinvariantdilationexperiment.h
deleted file mode 100644
index 479cc2bb711745856b057e6de6983c64097a89b9..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/test/experiments/scaleinvariantdilationexperiment.h
+++ /dev/null
@@ -1,147 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef AOFLAGGER_SCALEINVARIANTDILATIONEXPERIMENT_H
-#define AOFLAGGER_SCALEINVARIANTDILATIONEXPERIMENT_H
-
-#include <fstream>
-
-#include <AOFlagger/test/testingtools/asserter.h>
-#include <AOFlagger/test/testingtools/unittest.h>
-
-#include <AOFlagger/strategy/algorithms/siroperator.h>
-#include <AOFlagger/strategy/algorithms/statisticalflagger.h>
-
-#include <AOFlagger/util/rng.h>
-
-class ScaleInvariantDilationExperiment : public UnitTest {
-	public:
-		ScaleInvariantDilationExperiment() : UnitTest("Scale invariant dilation experiments")
-		{
-			AddTest(TestTimingN(), "Timing O(N) algorithm");
-			AddTest(TestTimingNlogN(), "Timing O(N x log N) algorithm");
-			AddTest(TestTimingNsq(), "Timing O(N^2) algorithm");
-		}
-		
-	private:
-		static const unsigned _repeatCount;
-		
-		struct TestTimingN : public Asserter
-		{
-			void operator()();
-		};
-		struct TestTimingNlogN : public Asserter
-		{
-			void operator()();
-		};
-		struct TestTimingNsq : public Asserter
-		{
-			void operator()();
-		};
-};
-
-const unsigned ScaleInvariantDilationExperiment::_repeatCount = 100;
-
-inline void ScaleInvariantDilationExperiment::TestTimingN::operator()()
-{
-	const double maxX = 7;
-	bool *prototypeFlags = new bool[(unsigned) round(exp10(maxX))];
-	for(unsigned i=0;i<(unsigned) round(exp10(maxX));++i)
-	{
-		prototypeFlags[i] = RNG::Uniform() > 0.9;
-	}
-	for(unsigned e=0;e<6;++e)
-	{
-		std::stringstream s;
-		s << "scale-invariant-dilation-timing" << e << ".txt";
-		std::ofstream file(s.str().c_str());
-		const double eta = e * 0.2;
-		
-		for(double x=3.0;x<=maxX;x+=0.05)
-		{
-			const unsigned n = (unsigned) round(exp10(x));
-			bool *flags = new bool[n];
-			Stopwatch watch(true);
-			for(unsigned repeat=0;repeat<_repeatCount;++repeat)
-			{
-				for(unsigned i=0;i<n;++i) flags[i] = prototypeFlags[i];
-				SIROperator::Operate(flags, n, eta);
-			}
-			file << n << '\t' << (watch.Seconds()/(double) _repeatCount) << '\t' << x << std::endl;
-			delete[] flags;
-		}
-	}
-	delete[] prototypeFlags;
-}
-
-inline void ScaleInvariantDilationExperiment::TestTimingNlogN::operator()()
-{
-	const double maxX = 6.5;
-	bool *prototypeFlags = new bool[(unsigned) round(exp10(maxX))];
-	for(unsigned i=0;i<(unsigned) round(exp10(maxX));++i)
-	{
-		prototypeFlags[i] = RNG::Uniform() > 0.9;
-	}
-	std::ofstream file("scale-invariant-dilation-timing-nlogn.txt");
-	const double eta = 0.2;
-	
-	for(double x=0.0;x<=maxX;x+=0.05)
-	{
-		const unsigned n = (unsigned) round(exp10(x));
-		bool *flags = new bool[n];
-		Stopwatch watch(true);
-		for(unsigned repeat=0;repeat<_repeatCount;++repeat)
-		{
-			for(unsigned i=0;i<n;++i) flags[i] = prototypeFlags[i];
-			StatisticalFlagger::ScaleInvDilationQuick(flags, n, eta);
-		}
-		file << n << '\t' << (watch.Seconds()/(double) _repeatCount) << '\t' << x << std::endl;
-		delete[] flags;
-	}
-	delete[] prototypeFlags;
-}
-
-inline void ScaleInvariantDilationExperiment::TestTimingNsq::operator()()
-{
-	const double maxX = 5;
-	bool *prototypeFlags = new bool[(unsigned) round(exp10(maxX))];
-	for(unsigned i=0;i<(unsigned) round(exp10(maxX));++i)
-	{
-		prototypeFlags[i] = RNG::Uniform() > 0.9;
-	}
-	std::ofstream file("scale-invariant-dilation-timing-nsq.txt");
-	const double eta = 0.2;
-	
-	for(double x=0.0;x<=maxX;x+=0.05)
-	{
-		const unsigned n = (unsigned) round(exp10(x));
-		bool *flags = new bool[n];
-		Stopwatch watch(true);
-		for(unsigned repeat=0;repeat<_repeatCount;++repeat)
-		{
-			for(unsigned i=0;i<n;++i) flags[i] = prototypeFlags[i];
-			StatisticalFlagger::ScaleInvDilationFull(flags, n, eta);
-		}
-		file << n << '\t' << (watch.Seconds()/(double) _repeatCount) << '\t' << x << std::endl;
-		delete[] flags;
-	}
-	delete[] prototypeFlags;
-}
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/test/msio/msiotestgroup.h b/CEP/DP3/AOFlagger/include/AOFlagger/test/msio/msiotestgroup.h
deleted file mode 100644
index dc25a9ae6108b1b203dcd8c24d2ce5f93ab3a625..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/test/msio/msiotestgroup.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef AOFLAGGER_MSIOTESTGROUP_H
-#define AOFLAGGER_MSIOTESTGROUP_H
-
-#include <AOFlagger/test/testingtools/testgroup.h>
-
-class MSIOTestGroup : public TestGroup {
-	public:
-		MSIOTestGroup() : TestGroup("Measurement set input/output") { }
-		
-		virtual void Initialize()
-		{
-		}
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/test/quality/qualitytablesformattertest.h b/CEP/DP3/AOFlagger/include/AOFlagger/test/quality/qualitytablesformattertest.h
deleted file mode 100644
index 2790c6e6df918afcb26252903c32ca3894ff770b..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/test/quality/qualitytablesformattertest.h
+++ /dev/null
@@ -1,223 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef AOFLAGGER_QUALITYTABLESFORMATTERTEST_H
-#define AOFLAGGER_QUALITYTABLESFORMATTERTEST_H
-
-#include <AOFlagger/test/testingtools/asserter.h>
-#include <AOFlagger/test/testingtools/unittest.h>
-
-#include <AOFlagger/quality/qualitytablesformatter.h>
-#include <AOFlagger/quality/statisticalvalue.h>
-
-#include <tables/Tables/Table.h>
-#include <tables/Tables/SetupNewTab.h>
-#include <tables/Tables/ScaColDesc.h>
-
-class QualityTablesFormatterTest : public UnitTest {
-	public:
-    QualityTablesFormatterTest() : UnitTest("Quality data")
-		{
-			createTable();
-			AddTest(TestConstructor(), "Class constructor");
-			AddTest(TestTableExists(), "Query table existance");
-			AddTest(TestTableInitialization(), "Initialize tables");
-			AddTest(TestKindOperations(), "Statistic kind operations");
-			AddTest(TestKindNames(), "Statistic kind names");
-			AddTest(TestStoreStatistics(), "Storing statistics");
-		}
-    virtual ~QualityTablesFormatterTest()
-		{
-			removeTable();
-		}
-	private:
-		void createTable()
-		{
-			casa::TableDesc tableDesc("MAIN_TABLE", "1.0", casa::TableDesc::Scratch);
-			tableDesc.addColumn(casa::ScalarColumnDesc<int>("TEST"));
-			casa::SetupNewTable mainTableSetup("QualityTest.MS", tableDesc, casa::Table::New);
-			casa::Table mainOutputTable(mainTableSetup);
-		}
-		void removeTable()
-		{
-			casa::Table::deleteTable("QualityTest.MS");
-		}
-		struct TestConstructor : public Asserter
-		{
-			void operator()();
-		};
-		struct TestTableExists : public Asserter
-		{
-			void operator()();
-		};
-		struct TestTableInitialization : public Asserter
-		{
-			void operator()();
-		};
-		struct TestKindOperations : public Asserter
-		{
-			void operator()();
-		};
-		struct TestKindNames : public Asserter
-		{
-			void operator()();
-		};
-		struct TestStoreStatistics : public Asserter
-		{
-			void operator()();
-		};
-};
-
-void QualityTablesFormatterTest::TestConstructor::operator()()
-{
-	QualityTablesFormatter *qd = new QualityTablesFormatter("QualityTest.MS");
-	delete qd;
-}
-
-void QualityTablesFormatterTest::TestTableExists::operator()()
-{
-	QualityTablesFormatter qd("QualityTest.MS");
-	// undefined answer, but should not crash.
-	qd.TableExists(QualityTablesFormatter::KindNameTable);
-	qd.TableExists(QualityTablesFormatter::TimeStatisticTable);
-	qd.TableExists(QualityTablesFormatter::FrequencyStatisticTable);
-	qd.TableExists(QualityTablesFormatter::BaselineStatisticTable);
-	qd.TableExists(QualityTablesFormatter::BaselineTimeStatisticTable);
-	
-	qd.RemoveAllQualityTables();
-	AssertFalse(qd.TableExists(QualityTablesFormatter::KindNameTable));
-	AssertFalse(qd.TableExists(QualityTablesFormatter::TimeStatisticTable));
-	AssertFalse(qd.TableExists(QualityTablesFormatter::FrequencyStatisticTable));
-	AssertFalse(qd.TableExists(QualityTablesFormatter::BaselineStatisticTable));
-	AssertFalse(qd.TableExists(QualityTablesFormatter::BaselineTimeStatisticTable));
-}
-
-void QualityTablesFormatterTest::TestTableInitialization::operator()()
-{
-	QualityTablesFormatter qd("QualityTest.MS");
-	
-	qd.RemoveAllQualityTables();
-	
-	enum QualityTablesFormatter::QualityTable tables[5] =
-	{
-		QualityTablesFormatter::KindNameTable,
-		QualityTablesFormatter::TimeStatisticTable,
-		QualityTablesFormatter::FrequencyStatisticTable,
-		QualityTablesFormatter::BaselineStatisticTable,
-		QualityTablesFormatter::BaselineTimeStatisticTable
-	};
-	for(unsigned i=0;i<5;++i)
-	{
-		qd.InitializeEmptyTable(tables[i], 8);
-		AssertTrue(qd.TableExists(tables[i]), "Table exists after initialization");
-	}
-	
-	for(unsigned i=0;i<5;++i)
-	{
-		qd.RemoveTable(tables[i]);
-		for(unsigned j=0;j<=i;++j)
-			AssertFalse(qd.TableExists(tables[j]), "Table removed and no longer exists");
-		for(unsigned j=i+1;j<5;++j)
-			AssertTrue(qd.TableExists(tables[j]), "Table initialized and not yet removed, thus exists");
-	}
-}
-
-void QualityTablesFormatterTest::TestKindOperations::operator()()
-{
-	QualityTablesFormatter qd("QualityTest.MS");
-	
-	qd.RemoveAllQualityTables();
-	qd.InitializeEmptyTable(QualityTablesFormatter::KindNameTable, 4);
-	AssertTrue(qd.TableExists(QualityTablesFormatter::KindNameTable));
-	
-	unsigned kindIndex;
-	AssertFalse(qd.QueryKindIndex(QualityTablesFormatter::MeanStatistic, kindIndex), "Empty table contains no index");
-	
-	unsigned originalKindIndex = qd.StoreKindName(QualityTablesFormatter::MeanStatistic);
-	AssertTrue(qd.QueryKindIndex(QualityTablesFormatter::MeanStatistic, kindIndex), "Stored index is queried");
-	AssertEquals(kindIndex, originalKindIndex, "Index returned by QueryKindIndex(Statistic, int)");
-	AssertEquals(qd.QueryKindIndex(QualityTablesFormatter::MeanStatistic), originalKindIndex, "Index returned by QueryKindIndex(Statistic)");
-	
-	unsigned secondKindIndex = qd.StoreKindName(QualityTablesFormatter::VarianceStatistic);
-	AssertNotEqual(originalKindIndex, secondKindIndex, "Store two kinds");
-	AssertEquals(qd.QueryKindIndex(QualityTablesFormatter::MeanStatistic), originalKindIndex);
-	AssertEquals(qd.QueryKindIndex(QualityTablesFormatter::VarianceStatistic), secondKindIndex);
-	
-	qd.InitializeEmptyTable(QualityTablesFormatter::KindNameTable, 4);
-	AssertFalse(qd.QueryKindIndex(QualityTablesFormatter::MeanStatistic, kindIndex), "Empty table contains no index after re-init");
-}
-
-void QualityTablesFormatterTest::TestStoreStatistics::operator()()
-{
-	QualityTablesFormatter qd("QualityTest.MS");
-	
-	qd.RemoveAllQualityTables();
-	AssertFalse(qd.IsStatisticAvailable(QualityTablesFormatter::TimeDimension, QualityTablesFormatter::MeanStatistic), "Statistic not available when table not exists");
-	
-	qd.InitializeEmptyTable(QualityTablesFormatter::KindNameTable, 4);
-	AssertFalse(qd.IsStatisticAvailable(QualityTablesFormatter::TimeDimension, QualityTablesFormatter::MeanStatistic), "Statistic not available when only kind-name table exists");
-	
-	qd.InitializeEmptyTable(QualityTablesFormatter::TimeStatisticTable, 4);
-	AssertFalse(qd.IsStatisticAvailable(QualityTablesFormatter::TimeDimension, QualityTablesFormatter::MeanStatistic), "Statistic not available when empty tables exist");
-	
-	unsigned meanStatIndex = qd.StoreKindName(QualityTablesFormatter::MeanStatistic);
-	AssertFalse(qd.IsStatisticAvailable(QualityTablesFormatter::TimeDimension, QualityTablesFormatter::MeanStatistic), "Statistic not available when no entries in stat table");
-	AssertEquals(qd.QueryStatisticEntryCount(QualityTablesFormatter::TimeDimension, meanStatIndex), 0u, "QueryStatisticEntryCount with zero entries");
-
-	StatisticalValue value(4);
-	value.SetKindIndex(meanStatIndex);
-	value.SetValue(0, std::complex<float>(0.0, 1.0));
-	value.SetValue(1, std::complex<float>(2.0, -2.0));
-	value.SetValue(2, std::complex<float>(-3.0, 3.0));
-	value.SetValue(3, std::complex<float>(-4.0, -4.0));
-	qd.StoreTimeValue(60.0, 107000000.0, value);
-	AssertTrue(qd.IsStatisticAvailable(QualityTablesFormatter::TimeDimension, QualityTablesFormatter::MeanStatistic), "Statistic available");
-	AssertEquals(qd.QueryStatisticEntryCount(QualityTablesFormatter::TimeDimension, meanStatIndex), 1u, "QueryStatisticEntryCount with one entries");
-	
-	std::vector<std::pair<QualityTablesFormatter::TimePosition, StatisticalValue> > entries;
-	qd.QueryTimeStatistic(meanStatIndex, entries);
-	AssertEquals(entries.size(), (size_t) 1, "entries.size()");
-	std::pair<QualityTablesFormatter::TimePosition, StatisticalValue> entry = entries[0];
-	AssertEquals(entry.first.frequency, 107000000.0f, "frequency");
-	AssertEquals(entry.first.time, 60.0f, "time");
-	AssertEquals(entry.second.PolarizationCount(), 4u, "PolarizationCount()");
-	AssertEquals(entry.second.KindIndex(), meanStatIndex, "KindIndex()");
-	AssertEquals(entry.second.Value(0), std::complex<float>(0.0, 1.0), "Value(0)");
-	AssertEquals(entry.second.Value(1), std::complex<float>(2.0, -2.0), "Value(1)");
-	AssertEquals(entry.second.Value(2), std::complex<float>(-3.0, 3.0), "Value(2)");
-	AssertEquals(entry.second.Value(3), std::complex<float>(-4.0, -4.0), "Value(3)");
-	
-	qd.RemoveTable(QualityTablesFormatter::KindNameTable);
-	qd.RemoveTable(QualityTablesFormatter::TimeStatisticTable);
-}
-
-void QualityTablesFormatterTest::TestKindNames::operator()()
-{
-	AssertEquals(QualityTablesFormatter::KindToName(QualityTablesFormatter::MeanStatistic), "Mean");
-	AssertEquals(QualityTablesFormatter::KindToName(QualityTablesFormatter::VarianceStatistic), "Variance");
-	AssertEquals(QualityTablesFormatter::KindToName(QualityTablesFormatter::SumStatistic), "Sum");
-	AssertEquals(QualityTablesFormatter::KindToName(QualityTablesFormatter::SumP2Statistic), "SumP2");
-	AssertEquals(QualityTablesFormatter::KindToName(QualityTablesFormatter::DMeanStatistic), "DMean");
-	AssertEquals(QualityTablesFormatter::KindToName(QualityTablesFormatter::DVarianceStatistic), "DVariance");
-	AssertEquals(QualityTablesFormatter::KindToName(QualityTablesFormatter::DSumStatistic), "DSum");
-	AssertEquals(QualityTablesFormatter::KindToName(QualityTablesFormatter::DSumP2Statistic), "DSumP2");
-	AssertEquals(QualityTablesFormatter::KindToName(QualityTablesFormatter::FTSumP2Statistic), "FTSumP2");
-}
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/test/quality/qualitytestgroup.h b/CEP/DP3/AOFlagger/include/AOFlagger/test/quality/qualitytestgroup.h
deleted file mode 100644
index 80ac960d6bb85eb11be88f1bd289965e09231783..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/test/quality/qualitytestgroup.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef AOFLAGGER_QUALITYTESTGROUP_H
-#define AOFLAGGER_QUALITYTESTGROUP_H
-
-#include <AOFlagger/test/testingtools/testgroup.h>
-
-#include <AOFlagger/test/quality/qualitytablesformattertest.h>
-#include <AOFlagger/test/quality/statisticscollectiontest.h>
-#include <AOFlagger/test/quality/statisticsderivatortest.h>
-
-class QualityTestGroup : public TestGroup {
-	public:
-		QualityTestGroup() : TestGroup("Quality statistic tools") { }
-		
-		virtual void Initialize()
-		{
-			Add(new QualityTablesFormatterTest());
-			Add(new StatisticsCollectionTest());
-			Add(new StatisticsDerivatorTest());
-		}
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/test/quality/statisticscollectiontest.h b/CEP/DP3/AOFlagger/include/AOFlagger/test/quality/statisticscollectiontest.h
deleted file mode 100644
index 6d64fa2212edfbe1c34846dce83335b471ab0687..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/test/quality/statisticscollectiontest.h
+++ /dev/null
@@ -1,177 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef AOFLAGGER_STATISTICSCOLLECTIONTEST_H
-#define AOFLAGGER_STATISTICSCOLLECTIONTEST_H
-
-#include <cmath>
-
-#include <AOFlagger/test/testingtools/asserter.h>
-#include <AOFlagger/test/testingtools/unittest.h>
-
-#include <AOFlagger/quality/statisticscollection.h>
-#include <AOFlagger/quality/qualitytablesformatter.h>
-
-class StatisticsCollectionTest : public UnitTest {
-	public:
-    StatisticsCollectionTest() : UnitTest("Statistics collection")
-		{
-			AddTest(TestConstructor(), "Class constructor");
-			AddTest(TestStatisticsCollecting(), "Collecting statistics");
-			AddTest(TestStatisticsCollectingSpeed(), "Speed of collecting");
-		}
-	private:
-		static void AssertZero(const DefaultStatistics &statistics, Asserter &asserter, const char *description)
-		{
-			for(size_t i=0;i<statistics.PolarizationCount();++i)
-			{
-				asserter.AssertEquals(statistics.count[i], 0ul, description);
-				asserter.AssertEquals(statistics.sum[i].real(), 0.0, description);
-				asserter.AssertEquals(statistics.sum[i].imag(), 0.0, description);
-				asserter.AssertEquals(statistics.sumP2[i].real(), 0.0, description);
-				asserter.AssertEquals(statistics.sumP2[i].imag(), 0.0, description);
-				asserter.AssertEquals(statistics.dCount[i], 0ul, description);
-				asserter.AssertEquals(statistics.dSum[i].real(), 0.0, description);
-				asserter.AssertEquals(statistics.dSum[i].imag(), 0.0, description);
-				asserter.AssertEquals(statistics.dSumP2[i].real(), 0.0, description);
-				asserter.AssertEquals(statistics.dSumP2[i].imag(), 0.0, description);
-				asserter.AssertEquals(statistics.rfiCount[i], 0ul, description);
-			}
-		}
-		
-		static void AssertBasicExample(const DefaultStatistics &statistics, Asserter &asserter, const std::string &description)
-		{
-			asserter.AssertEquals(statistics.count[0], 3ul, description + " (count)");
-			asserter.AssertEquals(statistics.sum->real(), 6.0, description + " (real sum)");
-			asserter.AssertEquals(statistics.sum->imag(), 18.0, description + " (imag sum)");
-			asserter.AssertEquals(statistics.sumP2->real(), 14.0, description + " (real sum^2)");
-			asserter.AssertEquals(statistics.sumP2->imag(), 116.0, description + " (imag sum^2)");
-			asserter.AssertEquals(statistics.dCount[0], 2ul, description + " (dCount)");
-			asserter.AssertAlmostEqual(statistics.dSum->real(), 2.0 * M_SQRT1_2, description + " (real dSum)");
-			asserter.AssertAlmostEqual(statistics.dSum->imag(), 4.0 * M_SQRT1_2, description + " (imag dSum)");
-			// The correct values are calculated e.g. as in:
-			// (2.0 * M_SQRT1_2 - 1.0 * M_SQRT1_2) ^ 2 + (3.0 * M_SQRT1_2 - 2.0 * M_SQRT1_2) ^ 2 (= 1/2 + 1/2 )
-			asserter.AssertAlmostEqual(statistics.dSumP2->real(), 1.0, description + " (real dSum^2)");
-			// (6.0 * M_SQRT1_2 - 4.0 * M_SQRT1_2) ^ 2 + (8.0 * M_SQRT1_2 - 6.0 * M_SQRT1_2) ^ 2 (= 2 + 2 )
-			asserter.AssertAlmostEqual(statistics.dSumP2->imag(), 4.0, description + " (imag dSum^2)");
-			asserter.AssertEquals(statistics.rfiCount[0], 0ul, description + " (rfiCount)");
-		}
-		
-		struct TestConstructor : public Asserter
-		{
-			void operator()();
-		};
-		struct TestStatisticsCollecting : public Asserter
-		{
-			void operator()();
-		};
-		struct TestStatisticsCollectingSpeed : public Asserter
-		{
-			void operator()();
-		};
-};
-
-void StatisticsCollectionTest::TestConstructor::operator()()
-{
-	StatisticsCollection *collection = new StatisticsCollection();
-	collection->SetPolarizationCount(1);
-	AssertEquals(collection->PolarizationCount(), 1u, "Polarization count after init");
-	DefaultStatistics statistics(1);
-	collection->GetGlobalCrossBaselineStatistics(statistics);
-	AssertZero(statistics, *this, "GetGlobalCrossBaselineStatistics() is zero after construct A");
-	delete collection;
-	
-	collection = new StatisticsCollection(1);
-	AssertEquals(collection->PolarizationCount(), 1u, "Polarization count after construct");
-	collection->GetGlobalCrossBaselineStatistics(statistics);
-	AssertZero(statistics, *this, "GetGlobalCrossBaselineStatistics() is zero after construct B");
-	
-	StatisticsCollection *copy = new StatisticsCollection(*collection);
-	AssertEquals(collection->PolarizationCount(), 1u, "Polarization count after copy construct");
-	copy->GetGlobalCrossBaselineStatistics(statistics);
-	AssertZero(statistics, *this, "GetGlobalCrossBaselineStatistics() is zero after copy");
-	delete copy;
-	delete collection;
-}
-
-void StatisticsCollectionTest::TestStatisticsCollecting::operator()()
-{
-	StatisticsCollection collection(1);
-	double frequencies[3] = {100, 101, 102};
-	collection.InitializeBand(0, frequencies, 3);
-	float
-		reals[3] = { 1.0, 2.0, 3.0 },
-		imags[3] = { 4.0, 6.0, 8.0 };
-	bool isRFI[3] = { false, false, false };
-	bool isPreFlagged[3] = { false, false, false };
-	collection.Add(0, 0, 0.0, 0, 0, reals, imags, isRFI, isPreFlagged, 3, 1, 1, 1);
-	
-	DefaultStatistics statistics(1);
-	collection.GetGlobalCrossBaselineStatistics(statistics);
-	AssertZero(statistics, *this, "GetGlobalCrossBaselineStatistics() is zero");
-	
-	collection.GetGlobalFrequencyStatistics(statistics);
-	AssertZero(statistics, *this, "GetGlobalFrequencyStatistics() is zero");
-	
-	collection.GetGlobalTimeStatistics(statistics);
-	AssertZero(statistics, *this, "GetGlobalTimeStatistics() is zero");
-	
-	collection.GetGlobalAutoBaselineStatistics(statistics);
-	AssertBasicExample(statistics, *this, "GetGlobalAutoBaselineStatistics()");
-	
-	collection.Add(0, 1, 0.0, 0, 0, reals, imags, isRFI, isPreFlagged, 3, 1, 1, 1);
-	collection.GetGlobalCrossBaselineStatistics(statistics);
-	AssertBasicExample(statistics, *this, "GetGlobalCrossBaselineStatistics()");
-	
-	collection.GetGlobalTimeStatistics(statistics);
-	AssertBasicExample(statistics, *this, "GetGlobalTimeStatistics()");
-	
-	collection.GetGlobalFrequencyStatistics(statistics);
-	AssertEquals(statistics.count[0], 3ul, "count");
-	AssertEquals(statistics.sum->real(), 6.0, "real sum");
-	AssertEquals(statistics.sum->imag(), 18.0, "imag sum");
-	AssertEquals(statistics.sumP2->real(), 14.0, "real sum^2");
-	AssertEquals(statistics.sumP2->imag(), 116.0, "imag sum^2");
-	AssertEquals(statistics.dCount[0], 4ul, "dCount");
-	AssertAlmostEqual(statistics.dSum->real(), 4.0 * M_SQRT1_2, "real dSum");
-	AssertAlmostEqual(statistics.dSum->imag(), 8.0 * M_SQRT1_2, "imag dSum");
-	AssertAlmostEqual(statistics.dSumP2->real(), 2.0, "real dSum^2");
-	AssertAlmostEqual(statistics.dSumP2->imag(), 8.0, "imag dSum^2");
-	AssertEquals(statistics.rfiCount[0], 0ul, "rfi count");
-	
-	bool flagged[3] = { true, true, true };
-	collection.Add(0, 1, 0.0, 0, 0, reals, imags, flagged, isPreFlagged, 3, 1, 1, 1);
-	collection.GetGlobalTimeStatistics(statistics);
-	AssertEquals(statistics.count[0], 3ul, "count");
-	AssertEquals(statistics.rfiCount[0], 3ul, "rfi count");
-	AssertEquals(statistics.sum->real(), 6.0, "real sum");
-
-	collection.Add(0, 1, 0.0, 0, 0, reals, imags, flagged, flagged, 3, 1, 1, 1);
-	collection.GetGlobalTimeStatistics(statistics);
-	AssertEquals(statistics.count[0], 3ul, "count");
-	AssertEquals(statistics.rfiCount[0], 3ul, "rfi count");
-	AssertEquals(statistics.sum->real(), 6.0, "real sum");
-}
-
-void StatisticsCollectionTest::TestStatisticsCollectingSpeed::operator()()
-{
-}
-
-#endif
-
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/test/quality/statisticsderivatortest.h b/CEP/DP3/AOFlagger/include/AOFlagger/test/quality/statisticsderivatortest.h
deleted file mode 100644
index 52f72b69f7233da4bb78fd692d8a2f8918b7ccd8..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/test/quality/statisticsderivatortest.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef AOFLAGGER_STATISTICSDERIVATORTEST_H
-#define AOFLAGGER_STATISTICSDERIVATORTEST_H
-
-#include <cmath>
-
-#include <AOFlagger/test/testingtools/asserter.h>
-#include <AOFlagger/test/testingtools/unittest.h>
-
-#include <AOFlagger/quality/statisticsderivator.h>
-#include <AOFlagger/quality/defaultstatistics.h>
-
-class StatisticsDerivatorTest : public UnitTest {
-	public:
-    StatisticsDerivatorTest() : UnitTest("Statistics derivator")
-		{
-			AddTest(TestStatistics(), "Deriving statistics");
-		}
-	private:
-		struct TestStatistics : public Asserter
-		{
-			void operator()();
-		};
-};
-
-void StatisticsDerivatorTest::TestStatistics::operator()()
-{
-	// Our sequence: 0.0 0.0 0.0
-	std::complex<long double> val = StatisticsDerivator::Variance(3, 0.0, 0.0);
-	AssertEquals(val, std::complex<long double>(0.0, 0.0));
-	
-	// Our sequence: 1.0 2.0 3.0
-	val = StatisticsDerivator::Variance(3, 6.0, 14.0);
-	AssertAlmostEqual(val.real(), 1.0); // (1 + 0 + 1) / (n-1) = 1.0
-	
-	// Our sequence: 1.0+4.0i 2.0+6.0i 3.0+8.0i
-	DefaultStatistics statistics(1);
-	statistics.count[0] = 3;
-	statistics.sum[0] = std::complex<long double>(6.0, 18.0);
-	statistics.sumP2[0] = std::complex<long double>(14.0, 116.0);
-	val = StatisticsDerivator::GetComplexStatistic(QualityTablesFormatter::CountStatistic, statistics, 0);
-	AssertEquals(val.real(), 3.0);
-	val = StatisticsDerivator::GetComplexStatistic(QualityTablesFormatter::SumStatistic, statistics, 0);
-	AssertEquals(val.real(), 6.0);
-	AssertEquals(val.imag(), 18.0);
-	val = StatisticsDerivator::GetComplexStatistic(QualityTablesFormatter::SumP2Statistic, statistics, 0);
-	AssertEquals(val.real(), 14.0);
-	AssertEquals(val.imag(), 116.0);
-	val = StatisticsDerivator::GetComplexStatistic(QualityTablesFormatter::MeanStatistic, statistics, 0);
-	AssertEquals(val.real(), 6.0 / 3.0);
-	AssertEquals(val.imag(), 18.0 / 3.0);
-	val = StatisticsDerivator::GetComplexStatistic(QualityTablesFormatter::VarianceStatistic, statistics, 0);
-	AssertEquals(val.real(), 1.0); // (1 + 0 + 1) / (n-1) = 1.0
-	AssertEquals(val.imag(), 4.0); // (4 + 0 + 4) / (n-1) = 4.0
-	val = StatisticsDerivator::GetComplexStatistic(QualityTablesFormatter::StandardDeviationStatistic, statistics, 0);
-	AssertEquals(val.real(), sqrt(2.0/3.0)); // sqrt((1 + 0 + 1) / n) = sqrt(2/3)
-	AssertEquals(val.imag(), sqrt(8.0/3.0)); // sqrt((4 + 0 + 4) / n) = sqrt(8/3)
-	
-	statistics.dCount[0] = statistics.count[0];
-	statistics.dSum[0] = statistics.sum[0];
-	statistics.dSumP2[0] = statistics.sumP2[0];
-	val = StatisticsDerivator::GetComplexStatistic(QualityTablesFormatter::SignalToNoiseStatistic, statistics, 0);
-	AssertAlmostEqual(val.real(), 2.0 / sqrt(2.0/3.0), "Real SNR");
-	AssertAlmostEqual(val.imag(), 6.0 / sqrt(8.0/3.0), "Imag SNR");
-}
-
-#endif
-
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/test/strategy/algorithms/algorithmstestgroup.h b/CEP/DP3/AOFlagger/include/AOFlagger/test/strategy/algorithms/algorithmstestgroup.h
deleted file mode 100644
index 5a107accd90dc67801b53bf392ed8ef8d27d53f8..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/test/strategy/algorithms/algorithmstestgroup.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef AOFLAGGER_ALGORITHMSTESTGROUP_H
-#define AOFLAGGER_ALGORITHMSTESTGROUP_H
-
-#include <AOFlagger/test/testingtools/testgroup.h>
-
-#include <AOFlagger/test/strategy/algorithms/convolutionstest.h>
-#include <AOFlagger/test/strategy/algorithms/dilationtest.h>
-#include <AOFlagger/test/strategy/algorithms/eigenvaluetest.h>
-#include <AOFlagger/test/strategy/algorithms/highpassfiltertest.h>
-#include <AOFlagger/test/strategy/algorithms/noisestatisticstest.h>
-#include <AOFlagger/test/strategy/algorithms/noisestatisticscollectortest.h>
-#include <AOFlagger/test/strategy/algorithms/siroperatortest.h>
-#include <AOFlagger/test/strategy/algorithms/statisticalflaggertest.h>
-#include <AOFlagger/test/strategy/algorithms/sumthresholdtest.h>
-#include <AOFlagger/test/strategy/algorithms/thresholdtoolstest.h>
-
-class AlgorithmsTestGroup : public TestGroup {
-	public:
-		AlgorithmsTestGroup() : TestGroup("Algorithms") { }
-		
-		virtual void Initialize()
-		{
-			Add(new ConvolutionsTest());
-			Add(new DilationTest());
-			Add(new EigenvalueTest());
-			Add(new HighPassFilterTest());
-			Add(new NoiseStatisticsTest());
-			Add(new NoiseStatisticsCollectorTest());
-			Add(new SIROperatorTest());
-			Add(new StatisticalFlaggerTest());
-			Add(new SumThresholdTest());
-			Add(new ThresholdToolsTest());
-		}
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/test/strategy/algorithms/convolutionstest.h b/CEP/DP3/AOFlagger/include/AOFlagger/test/strategy/algorithms/convolutionstest.h
deleted file mode 100644
index 731b77d146cfe2a2e26085c593633df0f5295df6..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/test/strategy/algorithms/convolutionstest.h
+++ /dev/null
@@ -1,235 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef AOFLAGGER_CONVOLUTIONSTEST_H
-#define AOFLAGGER_CONVOLUTIONSTEST_H
-
-#include <AOFlagger/test/testingtools/asserter.h>
-#include <AOFlagger/test/testingtools/unittest.h>
-
-#include <AOFlagger/strategy/algorithms/convolutions.h>
-
-#include <cmath>
-
-class ConvolutionsTest : public UnitTest {
-	public:
-		ConvolutionsTest() : UnitTest("Convolutions")
-		{
-			AddTest(TestOneDimensionalConvolution(), "One dimensional convolution");
-			AddTest(TestOneDimensionalSincConvolution(), "One dimensional sinc convolution");
-		}
-		
-	private:
-		struct TestOneDimensionalConvolution : public Asserter
-		{
-			void operator()();
-		};
-		
-		struct TestOneDimensionalSincConvolution : public Asserter
-		{
-			void operator()();
-		};
-		
-		static std::string ToString(const num_t *values, unsigned count)
-		{
-			std::stringstream s;
-			s << '{' << values[0];
-			for(unsigned i=1;i<count;++i)
-			{
-				s << ", " << values[i];
-			}
-			s << '}';
-			return s.str();
-		}
-		
-		static void AssertValues(Asserter *asserter, const num_t *values, const num_t *expected, unsigned count)
-		{
-			asserter->AssertEquals(ToString(values, count), ToString(expected, count));
-			for(unsigned i=0;i<count;++i)
-			{
-				std::stringstream s;
-				s << "Value " << i;
-				asserter->AssertAlmostEqual(values[i], expected[i], s.str());
-			}
-		}
-};
-
-inline void ConvolutionsTest::TestOneDimensionalConvolution::operator()()
-{
-	// Remember that OneDimensionalConvolutionBorderInterp assumes that sumover kernel == 1,
-	// otherwise we have to multiply the output with sumover kernel.
-	num_t data1[3] = { 0.0, 1.0, 2.0 };
-	num_t kernel1[1] = { 1.0 };
-	Convolutions::OneDimensionalConvolutionBorderInterp(data1, 3, kernel1, 1);
-	AssertAlmostEqual(data1[0], 0.0);
-	AssertAlmostEqual(data1[1], 1.0);
-	AssertAlmostEqual(data1[2], 2.0);
-	
-	num_t kernel2[1] = { 0.0 };
-	Convolutions::OneDimensionalConvolutionBorderInterp(data1, 3, kernel2, 1);
-
-	num_t data3[4] = { 0.0, 1.0, 2.0, 3.0 };
-	num_t kernel3[1] = { 2.0 };
-	Convolutions::OneDimensionalConvolutionBorderInterp(data3, 4, kernel3, 1);
-	AssertAlmostEqual(data3[0], 0.0);
-	AssertAlmostEqual(data3[1], 1.0);
-	AssertAlmostEqual(data3[2], 2.0);
-	AssertAlmostEqual(data3[3], 3.0);
-	
-	num_t kernel4[2] = {0.0, 1.0};
-	Convolutions::OneDimensionalConvolutionBorderInterp(data3, 4, kernel4, 2);
-	AssertAlmostEqual(data3[0], 0.0);
-	AssertAlmostEqual(data3[1], 1.0);
-	AssertAlmostEqual(data3[2], 2.0);
-	AssertAlmostEqual(data3[3], 3.0);
-	
-	num_t kernel5[2] = {1.0, 1.0};
-	Convolutions::OneDimensionalConvolutionBorderInterp(data3, 4, kernel5, 2);
-	AssertAlmostEqual(data3[0], 0.0);
-	AssertAlmostEqual(data3[1], 0.5);
-	AssertAlmostEqual(data3[2], 1.5);
-	AssertAlmostEqual(data3[3], 2.5);
-	
-	num_t data6[4] = { 0.0, 1.0, 2.0, 3.0 };
-	num_t kernel6[3] = {1.0, 1.0, 1.0};
-	Convolutions::OneDimensionalConvolutionBorderInterp(data6, 4, kernel6, 3);
-	num_t expected6[4] = {0.5, 1.0, 2.0, 2.5};
-	AssertValues(this, data6, expected6, 4);
-
-	num_t data7[6] = { 0.0, 0.0, 1.0, 2.0, 3.0, 0.0 };
-	num_t kernel7[3] = {1.0, 1.0, 1.0};
-	Convolutions::OneDimensionalConvolutionBorderInterp(data7, 6, kernel7, 3);
-	num_t expected7[6] = {0.0, 1.0/3.0, 1.0, 2.0, 5.0/3.0, 1.5};
-	AssertValues(this, data7, expected7, 6);
-}
-
-inline void ConvolutionsTest::TestOneDimensionalSincConvolution::operator()()
-{
-	num_t data1[1] = { 1.0 };
-	Convolutions::OneDimensionalSincConvolution(data1, 1, 1.0);
-	const num_t expected1[1] = { 1.0 };
-	AssertValues(this, data1, expected1, 1);
-
-	Convolutions::OneDimensionalSincConvolution(data1, 0, 1.0);
-
-	num_t data2[2] = { 1.0, 1.0 };
-	Convolutions::OneDimensionalSincConvolution(data2, 2, 0.25);
-	//const num_t expected2[2] = { 1.0, 1.0 };
-	//AssertValues(this, data2, expected2, 2);
-	AssertEquals(data2[0], data2[1], "Symmetry test with 2 elements");
-
-	num_t data3[3] = { 1.0, 1.0, 1.0 };
-	Convolutions::OneDimensionalSincConvolution(data3, 3, 0.25);
-	AssertAlmostEqual(data3[0], data3[2], "Symmetry test with 3 elements");
-
-	num_t data4[4] = { 1.0, 1.0, 1.0, 1.0 };
-	Convolutions::OneDimensionalSincConvolution(data4, 4, 0.25);
-	AssertAlmostEqual(data4[0], data4[3], "Symmetry test with 4 elements, outer");
-	AssertAlmostEqual(data4[1], data4[2], "Symmetry test with 4 elements, inner");
-
-	const num_t sizes5[6] = { 0.01, 0.1, 1.0, 3.14, 10.0/3.0, 100.0 };
-	for(unsigned i=0;i<6;++i)
-	{
-		num_t data5[5] = { 0.0, 0.0, 1.0, 0.0, 0.0 };
-		Convolutions::OneDimensionalSincConvolution(data5, 5, sizes5[i]);
-		AssertAlmostEqual(data5[0], data5[4], "Symmetry test with 5 elements, outer");
-		AssertAlmostEqual(data5[1], data5[3], "Symmetry test with 5 elements, inner");
-	}
-
-	num_t data6[100];
-	data6[0]=1;
-	for(unsigned i=1;i<100;++i)
-		data6[i] = 0;
-	// Convolution with sinc frequency 0.25 will produce a low-pass filter
-	// that filters any frequency > 0.25 Hz. The sinc will therefore have
-	// maxima on index 1, 5, 9, ..., minima on index 3, 7, 11, .. and zero's
-	// on 2, 4, 6, 8, ... .
-	Convolutions::OneDimensionalSincConvolution(data6, 100, 0.25);
-	
-	// Check whether maxima decrease
-	for(unsigned i=1; i<96; i+=4)
-	{
-		std::stringstream s;
-		s << "Decreasing maxima of sinc, element " << i;
-		AssertLessThan(data6[i+4], data6[i], s.str());
-	}
-
-	// Check whether minima increase. The border value (i=95) is not tested, because of
-	// the normalization it is actually larger, which is ok.
-	for(unsigned i=3; i<94; i+=4)
-	{
-		std::stringstream s;
-		s << "Increasing minima of sin, element " << i;
-		AssertGreaterThan(data6[i+4], data6[i], s.str());
-	}
-	
-	// Check zero points
-	for(unsigned i=2; i<100; i+=2)
-	{
-		AssertAlmostEqual(data6[i], 0.0, "Zero points of sinc");
-	}
-
-	// Test whether a low-pass filter attenuates a 10.000 sample
-	// high-frequency chirp signal with various levels.
-	num_t data7[10000];
-	for(unsigned i=0;i<10000;i+=2)
-	{
-		data7[i] = -1;
-		data7[i+1] = 1;
-	}
-	Convolutions::OneDimensionalSincConvolution(data7, 10000, 0.25);
-	for(unsigned i=10;i<9990;++i)
-	{
-		AssertLessThan(std::abs(data7[i]), 0.1, "10 db attenuation in 99.9% center of filtered data");
-	}
-	for(unsigned i=100;i<9900;++i)
-	{
-		AssertLessThan(std::abs(data7[i]), 0.01, "20 db attenuation in 99% center of filtered data");
-	}
-	for(unsigned i=1000;i<9000;++i)
-	{
-		AssertLessThan(std::abs(data7[i]), 0.001, "30 db attenuation in 90% center of filtered data");
-	}
-
-	// Test whether a low-pass filter does not attenuate a 10.000 sample
-	// low-frequency chirp signal with various levels.
-	num_t data8[10000];
-	for(unsigned i=0;i<10000;++i)
-	{
-		data8[i] = sin((num_t) i/(10.0 * 2 * M_PIn));
-	}
-	Convolutions::OneDimensionalSincConvolution(data8, 10000, 0.25);
-	for(unsigned i=10;i<9950;++i)
-	{
-		num_t val = sin((num_t) i/(10.0 * 2 * M_PIn));
-		AssertLessThan(std::abs(data8[i] - val), 0.5, "95% consistency in 99.5% center of filtered data");
-	}
-	for(unsigned i=100;i<9900;++i)
-	{
-		num_t val = sin((num_t) i/(10.0 * 2 * M_PIn));
-		AssertLessThan(std::abs(data8[i] - val), 0.1, "99% consistency in 99% center of filtered data");
-	}
-	for(unsigned i=1000;i<9000;++i)
-	{
-		num_t val = sin((num_t) i/(10.0 * 2 * M_PIn));
-		AssertLessThan(std::abs(data8[i] - val), 0.01, "99.9% consistency in 90% center of filtered data");
-	}
-}
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/test/strategy/algorithms/dilationtest.h b/CEP/DP3/AOFlagger/include/AOFlagger/test/strategy/algorithms/dilationtest.h
deleted file mode 100644
index ec9a7805b0d58d425d33372d49801b9dd233d6b6..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/test/strategy/algorithms/dilationtest.h
+++ /dev/null
@@ -1,242 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef AOFLAGGER_DILATIONTEST_H
-#define AOFLAGGER_DILATIONTEST_H
-
-#include <AOFlagger/test/testingtools/asserter.h>
-#include <AOFlagger/test/testingtools/unittest.h>
-
-#include <AOFlagger/msio/mask2d.h>
-
-#include <AOFlagger/strategy/algorithms/statisticalflagger.h>
-
-class DilationTest : public UnitTest {
-	public:
-		DilationTest() : UnitTest("Dilation algorithm")
-		{
-			AddTest(TestHorizontalDilation(), "Horizontal dilation");
-			AddTest(TestVerticalDilation(), "Vertical dilation");
-		}
-		
-	private:
-		struct TestSingleDilation : public Asserter
-		{
-			template<bool Flip, typename DilateFunction>
-			void testDilation(DilateFunction dilate);
-		};
-		struct TestHorizontalDilation : public DilationTest::TestSingleDilation
-		{
-			void operator()();
-		};
-		struct TestVerticalDilation : public DilationTest::TestSingleDilation
-		{
-			void operator()();
-		};
-		
-		static std::string maskToString(Mask2DCPtr mask, bool flip)
-		{
-			std::stringstream s;
-			if(flip)
-			{
-				for(unsigned x=0;x<mask->Width();++x)
-				{
-					for(unsigned y=0;y<mask->Height();++y)
-						s << (mask->Value(x, y) ? 'x' : ' ');
-					s << '\n';
-				}
-			} else
-			{
-				for(unsigned y=0;y<mask->Height();++y)
-				{
-					for(unsigned x=0;x<mask->Width();++x)
-						s << (mask->Value(x, y) ? 'x' : ' ');
-					s << '\n';
-				}
-			}
-			return s.str();
-		}
-		
-		static void setMask(Mask2DPtr mask, bool flip, const std::string &str)
-		{
-			std::string::const_iterator i = str.begin();
-			if(flip)
-			{
-				for(unsigned x=0;x<mask->Width();++x)
-				{
-					for(unsigned y=0;y<mask->Height();++y)
-					{
-						mask->SetValue(x, y, (*i) == 'x');
-						++i;
-					}
-					++i; // newline
-				}
-			} else
-			{
-				for(unsigned y=0;y<mask->Height();++y)
-				{
-					for(unsigned x=0;x<mask->Width();++x)
-					{
-						mask->SetValue(x, y, (*i) == 'x');
-						++i;
-					}
-					++i; // newline
-				}
-			}
-		}
-};
-
-inline void DilationTest::TestHorizontalDilation::operator()()
-{
-	TestSingleDilation::testDilation<false>(StatisticalFlagger::DilateFlagsHorizontally);
-}
-
-inline void DilationTest::TestVerticalDilation::operator()()
-{
-	TestSingleDilation::testDilation<true>(StatisticalFlagger::DilateFlagsVertically);
-}
-
-template<bool Flip, typename DilateFunction>
-inline void DilationTest::TestSingleDilation::testDilation(DilateFunction dilate)
-{
-	std::string expected;
-	Mask2DPtr mask = Mask2D::CreateSetMaskPtr<false>(5, 5);
-	dilate(mask, 0);
-	expected =
-		"     \n"
-		"     \n"
-		"     \n"
-		"     \n"
-		"     \n";
-	AssertEquals(maskToString(mask, Flip), expected, "Empty dilation with size=0");
-	dilate(mask, 1);
-	AssertEquals(maskToString(mask, Flip), expected, "Empty dilation with size=1");
-	dilate(mask, 2);
-	AssertEquals(maskToString(mask, Flip), expected, "Empty dilation with size=2");
-	dilate(mask, 3);
-	AssertEquals(maskToString(mask, Flip), expected, "Empty dilation with size=3");
-	dilate(mask, 4);
-	AssertEquals(maskToString(mask, Flip), expected, "Empty dilation with size=4");
-	dilate(mask, 5);
-	AssertEquals(maskToString(mask, Flip), expected, "Empty dilation with size=5");
-	dilate(mask, 6);
-	AssertEquals(maskToString(mask, Flip), expected, "Empty dilation with size=6");
-	
-	expected =
-		"     \n"
-		"     \n"
-		"  x  \n"
-		"     \n"
-		"     \n";
-	setMask(mask, Flip, expected);
-	dilate(mask, 0);
-	AssertEquals(maskToString(mask, Flip), expected, "Empty dilation with single flag");
-
-	dilate(mask, 1);
-	expected =
-		"     \n"
-		"     \n"
-		" xxx \n"
-		"     \n"
-		"     \n";
-	AssertEquals(maskToString(mask, Flip), expected, "Dilation with single flag, size=1");
-
-	dilate(mask, 1);
-	expected =
-		"     \n"
-		"     \n"
-		"xxxxx\n"
-		"     \n"
-		"     \n";
-	AssertEquals(maskToString(mask, Flip), expected, "Dilation with three flags, size=1");
-	dilate(mask, 1);
-	AssertEquals(maskToString(mask, Flip), expected, "Dilation with five flags at the borders, size=1");
-	dilate(mask, 100);
-	AssertEquals(maskToString(mask, Flip), expected, "Dilation with five flags at the borders, size=100");
-
-	setMask(mask, Flip,
-		" x   \n"
-		"   x \n"
-		"x    \n"
-		"    x\n"
-		" x x \n");
-	dilate(mask, 2);
-	expected =
-		"xxxx \n"
-		" xxxx\n"
-		"xxx  \n"
-		"  xxx\n"
-		"xxxxx\n";
-	AssertEquals(maskToString(mask, Flip), expected, "Somewhat random input");
-	
-	setMask(mask, Flip,
-		"x    \n"
-		" x   \n"
-		"  x  \n"
-		"   x \n"
-		"    x\n");
-	dilate(mask, 6);
-	expected =
-		"xxxxx\n"
-		"xxxxx\n"
-		"xxxxx\n"
-		"xxxxx\n"
-		"xxxxx\n";
-	AssertEquals(maskToString(mask, Flip), expected, "Fully flagged");
-	
-	if(Flip)
-		mask = Mask2D::CreateSetMaskPtr<false>(4, 6);
-	else
-		mask = Mask2D::CreateSetMaskPtr<false>(6, 4);
-	dilate(mask, 0);
-	expected =
-		"      \n"
-		"      \n"
-		"      \n"
-		"      \n";
-	AssertEquals(maskToString(mask, Flip), expected, "(6,4) empty");
-	
-	setMask(mask, Flip,
-		"x     \n"
-		"  x   \n"
-		"    x \n"
-		"     x\n");
-	dilate(mask, 4);
-	expected =
-		"xxxxx \n"
-		"xxxxxx\n"
-		"xxxxxx\n"
-		" xxxxx\n";
-	AssertEquals(maskToString(mask, Flip), expected, "(6,4) large size");
-
-	setMask(mask, Flip,
-		"x     \n"
-		"      \n"
-		"    x \n"
-		"     x\n");
-	dilate(mask, 7);
-	expected =
-		"xxxxxx\n"
-		"      \n"
-		"xxxxxx\n"
-		"xxxxxx\n";
-	AssertEquals(maskToString(mask, Flip), expected, "(6,4) full size");
-}
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/test/strategy/algorithms/eigenvaluetest.h b/CEP/DP3/AOFlagger/include/AOFlagger/test/strategy/algorithms/eigenvaluetest.h
deleted file mode 100644
index 04f4a4549f87353504fd53cac953589c0f36cd02..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/test/strategy/algorithms/eigenvaluetest.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef AOFLAGGER_EIGENVALUETEST_H
-#define AOFLAGGER_EIGENVALUETEST_H
-
-#include <AOFlagger/test/testingtools/asserter.h>
-#include <AOFlagger/test/testingtools/unittest.h>
-
-#include <AOFlagger/strategy/algorithms/eigenvalue.h>
-
-class EigenvalueTest : public UnitTest {
-	public:
-    EigenvalueTest() : UnitTest("Eigenvalue")
-		{
-			AddTest(TestRemove(), "Remove");
-		}
-		
-	private:
-		struct TestRemove : public Asserter
-		{
-			void operator()();
-		};
-		
-	static std::string ToString(Image2DCPtr real, Image2DCPtr imag)
-	{
-		std::stringstream s;
-		s << "{";
-		for(unsigned y=0;y<real->Height();++y)
-		{
-			for(unsigned x=0;x<real->Width();++x)
-			{
-				if(x!=0 || y!=0) s << ",";
-				s << real->Value(x, y);
-			}
-		}
-		s << "} {";
-		for(unsigned y=0;y<imag->Height();++y)
-		{
-			for(unsigned x=0;x<imag->Width();++x)
-			{
-				if(x!=0 || y!=0) s << ",";
-				s << imag->Value(x, y);
-			}
-		}
-		s << "}";
-		return s.str();
-	}
-};
-
-void EigenvalueTest::TestRemove::operator()()
-{
-	Image2DPtr
-		real1 = Image2D::CreateZeroImagePtr(2, 2),
-		imag1 = Image2D::CreateZeroImagePtr(2, 2);
-	
-	Eigenvalue::Remove(real1, imag1);
-
-	const std::string real1Str("Real values of zero image");
-	AssertAlmostEqual(real1->Value(0,0), 0.0, real1Str);
-	AssertAlmostEqual(real1->Value(0,1), 0.0, real1Str);
-	AssertAlmostEqual(real1->Value(1,0), 0.0, real1Str);
-	AssertAlmostEqual(real1->Value(1,1), 0.0, real1Str);
-
-	const std::string imag1Str("Imaginary values of zero image");
-	AssertAlmostEqual(imag1->Value(0,0), 0.0, imag1Str);
-	AssertAlmostEqual(imag1->Value(0,1), 0.0, imag1Str);
-	AssertAlmostEqual(imag1->Value(1,0), 0.0, imag1Str);
-	AssertAlmostEqual(imag1->Value(1,1), 0.0, imag1Str);
-
-	real1->SetValue(0, 0, 13.0);
-	real1->SetValue(0, 1, -4.0);
-	real1->SetValue(1, 0, -4.0);
-	real1->SetValue(1, 1, 7.0);
-	Eigenvalue::Remove(real1, imag1);
-	AssertEquals(ToString(real1, imag1), "{12,-6,-6,3} {0,0,0,0}");
-}
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/test/strategy/algorithms/highpassfiltertest.h b/CEP/DP3/AOFlagger/include/AOFlagger/test/strategy/algorithms/highpassfiltertest.h
deleted file mode 100644
index 0122127a6a90b25328c01c5c883804151d66dd19..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/test/strategy/algorithms/highpassfiltertest.h
+++ /dev/null
@@ -1,183 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef AOFLAGGER_HIGHPASSFILTERTEST_H
-#define AOFLAGGER_HIGHPASSFILTERTEST_H
-
-#include <AOFlagger/test/testingtools/asserter.h>
-#include <AOFlagger/test/testingtools/unittest.h>
-#include <AOFlagger/test/testingtools/imageasserter.h>
-
-#include <AOFlagger/msio/mask2d.h>
-#include <AOFlagger/msio/image2d.h>
-
-#include <AOFlagger/strategy/algorithms/localfitmethod.h>
-#include <AOFlagger/strategy/algorithms/highpassfilter.h>
-
-class HighPassFilterTest : public UnitTest {
-	public:
-		HighPassFilterTest() : UnitTest("High-pass filter algorithm")
-		{
-			AddTest(TestSmallImageFilter(), "High-pass filter with small image");
-			AddTest(TestFilter(), "High-pass filter algorithm");
-			AddTest(TestFilterWithMask(), "Low-pass filter algorithm with mask");
-			AddTest(TestCompletelyMaskedImage(), "Low-pass filter algorithm with completely set mask");
-			AddTest(TestNaNImage(), "Low-pass filter algorithm with NaNs");
-		}
-		
-	private:
-		struct TestFilter : public Asserter
-		{
-			void operator()();
-		};
-		struct TestSmallImageFilter : public Asserter
-		{
-			void operator()();
-		};
-		struct TestFilterWithMask : public Asserter
-		{
-			void operator()();
-		};
-		struct TestCompletelyMaskedImage : public Asserter
-		{
-			void operator()();
-		};
-		struct TestNaNImage : public Asserter
-		{
-			void operator()();
-		};
-		
-};
-
-inline void HighPassFilterTest::TestFilter::operator()()
-{
-	const size_t width = 99, height = 99;
-	Image2DPtr testImage = Image2D::CreateZeroImagePtr(width, height);
-	testImage->SetValue(10,10,1.0);
-	testImage->SetValue(15,15,2.0);
-	testImage->SetValue(20,20,0.5);
-	
-	// Fitting
-	LocalFitMethod fitMethod;
-	TimeFrequencyData data(TimeFrequencyData::AmplitudePart, StokesIPolarisation, Image2D::CreateCopy(testImage));
-	fitMethod.SetToWeightedAverage(10, 20, 2.5, 5.0);
-	fitMethod.Initialize(data);
-	for(size_t i=0;i<fitMethod.TaskCount();++i)
-		fitMethod.PerformFit(i);
-	Image2DCPtr fitResult = Image2D::CreateFromDiff(testImage, fitMethod.Background().GetSingleImage());
-	
-	// High-pass filter
-	HighPassFilter filter;
-	Image2DPtr filterResult = Image2D::CreateCopy(testImage);
-	filter.SetHWindowSize(21);
-	filter.SetVWindowSize(41);
-	filter.SetHKernelSigmaSq(2.5);
-	filter.SetVKernelSigmaSq(5.0);
-	filterResult = filter.ApplyHighPass(filterResult, Mask2D::CreateSetMaskPtr<false>(width, height));
-	
-	ImageAsserter::AssertEqual(filterResult, fitResult, "Simple convolution with three high values");
-}
-
-inline void HighPassFilterTest::TestSmallImageFilter::operator()()
-{
-	const size_t width = 8, height = 8;
-	Image2DPtr testImage = Image2D::CreateZeroImagePtr(width, height);
-	testImage->SetValue(1, 1, 1.0);
-	
-	// Fitting
-	LocalFitMethod fitMethod;
-	TimeFrequencyData data(TimeFrequencyData::AmplitudePart, StokesIPolarisation, Image2D::CreateCopy(testImage));
-	fitMethod.SetToWeightedAverage(10, 20, 2.5, 5.0);
-	fitMethod.Initialize(data);
-	for(size_t i=0;i<fitMethod.TaskCount();++i)
-		fitMethod.PerformFit(i);
-	Image2DCPtr fitResult = Image2D::CreateFromDiff(testImage, fitMethod.Background().GetSingleImage());
-	
-	// High-pass filter
-	HighPassFilter filter;
-	Image2DPtr filterResult = Image2D::CreateCopy(testImage);
-	filter.SetHWindowSize(21);
-	filter.SetVWindowSize(41);
-	filter.SetHKernelSigmaSq(2.5);
-	filter.SetVKernelSigmaSq(5.0);
-	filterResult = filter.ApplyHighPass(filterResult, Mask2D::CreateSetMaskPtr<false>(width, height));
-	
-	// This test will fail, but the high-pass filter is actually slightly better than the older
-	// "fitter" -- it will keep the kernel as large as possible, while the sliding window fit can
-	// be one off. The test is still good to guard for out of bounds errors.
-	//ImageAsserter::AssertEqual(filterResult, fitResult, "Convolution with kernel that is larger than the image");
-}
-
-inline void HighPassFilterTest::TestFilterWithMask::operator()()
-{
-	const size_t width = 8, height = 8;
-	Image2DPtr image = Image2D::CreateZeroImagePtr(width, height);
-	image->SetValue(1, 1, 1.0);
-	Mask2DPtr mask = Mask2D::CreateSetMaskPtr<false>(width, height);
-	mask->SetValue(1, 1, true);
-	
-	// High-pass filter
-	HighPassFilter filter;
-	filter.SetHWindowSize(4);
-	filter.SetVWindowSize(4);
-	filter.SetHKernelSigmaSq(4.0);
-	filter.SetVKernelSigmaSq(4.0);
-	image = filter.ApplyLowPass(image, mask);
-	
-	ImageAsserter::AssertConstant(image, 0.0, "Low-pass convolution with one masked value");
-}
-
-inline void HighPassFilterTest::TestCompletelyMaskedImage::operator()()
-{
-	const size_t width = 9, height = 9;
-	Image2DPtr image = Image2D::CreateZeroImagePtr(width, height);
-	image->SetValue(1, 1, 1.0);
-	image->SetValue(8, 8, 10.0);
-	Mask2DPtr mask = Mask2D::CreateSetMaskPtr<true>(width, height);
-	
-	// High-pass filter
-	HighPassFilter filter;
-	filter.SetHWindowSize(4);
-	filter.SetVWindowSize(4);
-	filter.SetHKernelSigmaSq(4.0);
-	filter.SetVKernelSigmaSq(4.0);
-	image = filter.ApplyLowPass(image, mask);
-	
-	ImageAsserter::AssertConstant(image, 0.0, "Low-pass convolution with fully masked image");
-}
-
-inline void HighPassFilterTest::TestNaNImage::operator()()
-{
-	const size_t width = 7, height = 7;
-	Image2DPtr image = Image2D::CreateZeroImagePtr(width, height);
-	image->SetValue(1, 1, std::numeric_limits<float>::quiet_NaN());
-	image->SetValue(7, 7, 10.0);
-	
-	// High-pass filter
-	HighPassFilter filter;
-	filter.SetHWindowSize(4);
-	filter.SetVWindowSize(4);
-	filter.SetHKernelSigmaSq(4.0);
-	filter.SetVKernelSigmaSq(4.0);
-	image = filter.ApplyLowPass(image, Mask2D::CreateSetMaskPtr<false>(width, height));
-	
-	ImageAsserter::AssertFinite(image, "Low-pass convolution with NaNs");
-}
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/test/strategy/algorithms/noisestatisticscollectortest.h b/CEP/DP3/AOFlagger/include/AOFlagger/test/strategy/algorithms/noisestatisticscollectortest.h
deleted file mode 100644
index 5a9a413210e863e9538eb4c17cceceae570ea7fa..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/test/strategy/algorithms/noisestatisticscollectortest.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef AOFLAGGER_NOISESTATISTICSCOLLECTORTEST_H
-#define AOFLAGGER_NOISESTATISTICSCOLLECTORTEST_H
-
-#include <AOFlagger/test/testingtools/asserter.h>
-#include <AOFlagger/test/testingtools/unittest.h>
-
-#include <AOFlagger/msio/mask2d.h>
-
-#include <AOFlagger/strategy/algorithms/noisestatisticscollector.h>
-
-class NoiseStatisticsCollectorTest : public UnitTest {
-	public:
-		NoiseStatisticsCollectorTest() : UnitTest("Noise statistics collector")
-		{
-			AddTest(InitializationTest(), "Initialization");
-		}
-		
-	private:
-		struct InitializationTest : public Asserter
-		{
-			void operator()();
-		};
-};
-
-
-void NoiseStatisticsCollectorTest::InitializationTest::operator()()
-{
-	NoiseStatisticsCollector collector;
-	AssertTrue(collector.Empty(), "Empty()");
-
-	AssertEquals(collector.TBMap().size(), (size_t) 0, "TBMap().size()");
-}
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/test/strategy/algorithms/noisestatisticstest.h b/CEP/DP3/AOFlagger/include/AOFlagger/test/strategy/algorithms/noisestatisticstest.h
deleted file mode 100644
index a0b8d0b25010d1615df72241fdb28b94f0dda1ec..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/test/strategy/algorithms/noisestatisticstest.h
+++ /dev/null
@@ -1,227 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef AOFLAGGER_NOISESTATISTICSTEST_H
-#define AOFLAGGER_NOISESTATISTICSTEST_H
-
-#include <AOFlagger/test/testingtools/asserter.h>
-#include <AOFlagger/test/testingtools/unittest.h>
-
-#include <AOFlagger/msio/mask2d.h>
-
-#include <AOFlagger/strategy/algorithms/noisestatistics.h>
-
-class NoiseStatisticsTest : public UnitTest {
-	public:
-		NoiseStatisticsTest() : UnitTest("Noise statistics")
-		{
-			AddTest(TestInitialization(), "Initialization");
-			AddTest(TestCalculations(), "Calculations");
-			AddTest(TestAddValues(), "Adding values");
-		}
-		
-	private:
-		struct TestInitialization : public Asserter
-		{
-			void operator()();
-		};
-		
-		struct TestCalculations : public Asserter
-		{
-			void operator()();
-		};
-		
-		struct TestAddValues : public Asserter
-		{
-			void operator()();
-		};
-		
-		static void AssertValues(
-			const NoiseStatistics &statistics,
-			const Asserter *asserter,
-			long unsigned count,
-			NoiseStatistics::stat_t sum,
-			NoiseStatistics::stat_t sum2,
-			NoiseStatistics::stat_t sum3,
-			NoiseStatistics::stat_t sum4)
-		{
-			asserter->AssertEquals(statistics.Count(), count, "Count()");
-			asserter->AssertAlmostEqual(statistics.Sum(), sum, "Sum()");
-			asserter->AssertAlmostEqual(statistics.Sum2(), sum2, "Sum2()");
-			asserter->AssertAlmostEqual(statistics.Sum3(), sum3, "Sum3()");
-			asserter->AssertAlmostEqual(statistics.Sum4(), sum4, "Sum4()");
-		}
-
-		static void AssertValues(
-			const NoiseStatistics &statistics,
-			const Asserter *asserter,
-			long unsigned count,
-			NoiseStatistics::stat_t sum,
-			NoiseStatistics::stat_t sum2,
-			NoiseStatistics::stat_t sum3,
-			NoiseStatistics::stat_t sum4,
-			NoiseStatistics::stat_t mean,
-			NoiseStatistics::stat_t moment2,
-			NoiseStatistics::stat_t moment4,
-			NoiseStatistics::stat_t stdDevEst,
-			NoiseStatistics::stat_t varianceEst,
-			NoiseStatistics::stat_t varianceOfVarianceEst)
-		{
-			AssertValues(statistics, asserter, count, sum, sum2, sum3, sum4);
-			asserter->AssertAlmostEqual(statistics.Mean(), mean, "Mean()");
-			asserter->AssertAlmostEqual(statistics.SecondMoment(), moment2, "SecondMoment()");
-			asserter->AssertAlmostEqual(statistics.FourthMoment(), moment4, "FourthMoment()");
-			asserter->AssertAlmostEqual(statistics.StdDevEstimator(), stdDevEst, "StdDevEstimator()");
-			asserter->AssertAlmostEqual(statistics.VarianceEstimator(), varianceEst, "VarianceEstimator()");
-			asserter->AssertAlmostEqual(statistics.VarianceOfVarianceEstimator(), varianceOfVarianceEst, "VarianceOfVarianceEstimator()");
-		}
-		
-	static void AssertRunnable(const NoiseStatistics &statistics)
-	{
-		statistics.Count();
-		statistics.Sum();
-		statistics.Sum2();
-		statistics.Sum3();
-		statistics.Sum4();
-		statistics.Mean();
-		statistics.SecondMoment();
-		statistics.FourthMoment();
-		statistics.StdDevEstimator();
-		statistics.VarianceEstimator();
-		statistics.VarianceOfVarianceEstimator();
-	}
-};
-
-inline void NoiseStatisticsTest::TestInitialization::operator()()
-{
-	// Test without initialization
-	NoiseStatistics statistics;
-	AssertValues(statistics, this, 0, 0.0, 0.0, 0.0, 0.0);
-	// Some values are undefined, but should not throw an exception:
-	AssertRunnable(statistics);
-	
-	// Test assignment + initialization with an array
-	NoiseStatistics::Array array;
-	array.push_back(1.0);
-	statistics = NoiseStatistics(array);
-	AssertValues(statistics, this, 1, 1.0, 1.0, 1.0, 1.0);
-	AssertRunnable(statistics);
-	
-	// Test copy constructor
-	NoiseStatistics copy(statistics);
-	AssertValues(statistics, this, 1, 1.0, 1.0, 1.0, 1.0);
-	AssertRunnable(statistics);
-}
-
-inline void NoiseStatisticsTest::TestCalculations::operator()()
-{
-	NoiseStatistics::Array array;
-	array.push_back(1.0);
-	array.push_back(2.0);
-	array.push_back(3.0);
-	NoiseStatistics statistics(array);
-	AssertValues(statistics, this, 3, 6.0, 14.0, 36.0, 98.0);
-	AssertAlmostEqual(statistics.Mean(), 2.0, "Mean()");
-	AssertAlmostEqual(statistics.SecondMoment(), 2.0/3.0, "SecondMoment()");
-	AssertAlmostEqual(statistics.FourthMoment(), 2.0/3.0, "FourthMoment()");
-	AssertAlmostEqual(statistics.StdDevEstimator(), 1.0, "StdDevEstimator()");
-	AssertAlmostEqual(statistics.VarianceEstimator(), 1.0, "VarianceEstimator()");
-	AssertRunnable(statistics);
-	
-	array.clear();
-	array.push_back(5.0);
-	array.push_back(5.0);
-	array.push_back(5.0);
-	array.push_back(5.0);
-	array.push_back(5.0);
-	statistics = NoiseStatistics(array);
-	AssertValues(statistics, this, 5, 25.0, 125.0, 625.0, 3125.0, 5.0, 0.0, 0.0, 0.0, 0.0, 0.0);
-
-	array.clear();
-	array.push_back(1.0);
-	array.push_back(1.0);
-	array.push_back(1.0);
-	array.push_back(2.0);
-	array.push_back(3.0);
-	statistics = NoiseStatistics(array);
-	AssertValues(statistics, this, 5, 8.0, 16.0, 38.0, 100.0, 1.6, 0.64, 0.8512, sqrt(0.8), 0.8, 0.12928);
-
-	array.clear();
-	array.push_back(3.0);
-	array.push_back(1.0);
-	array.push_back(3.0);
-	array.push_back(1.0);
-	array.push_back(3.0);
-	array.push_back(1.0);
-	statistics = NoiseStatistics(array);
-	AssertValues(statistics, this, 6, 12.0, 30.0, 84.0, 246.0, 2.0, 1.0, 1.0, sqrt(1.2), 1.2, 2.0/30.0);
-}
-
-void NoiseStatisticsTest::TestAddValues::operator()()
-{
-	NoiseStatistics statistics;
-
-	NoiseStatistics::Array array;
-	array.push_back(1.0);
-	array.push_back(2.0);
-	array.push_back(3.0);
-	statistics.Add(array);
-	AssertValues(statistics, this, 3, 6.0, 14.0, 36.0, 98.0);
-	AssertAlmostEqual(statistics.Mean(), 2.0, "Mean()");
-	AssertAlmostEqual(statistics.SecondMoment(), 2.0/3.0, "SecondMoment()");
-	AssertAlmostEqual(statistics.FourthMoment(), 2.0/3.0, "FourthMoment()");
-	AssertAlmostEqual(statistics.VarianceEstimator(), 1.0, "VarianceEstimator()");
-	AssertRunnable(statistics);
-	
-	array.clear();
-	array.push_back(1.0);
-	array.push_back(1.0);
-	statistics.Add(array);
-	AssertValues(statistics, this, 5, 8.0, 16.0, 38.0, 100.0, 1.6, 0.64, 0.8512, sqrt(0.8), 0.8, 0.12928);
-
-	array.clear();
-	array.push_back(5.0);
-	NoiseStatistics numberFive = NoiseStatistics(array);
-	
-	statistics = NoiseStatistics();
-	statistics.Add(numberFive);
-	statistics.Add(numberFive);
-	statistics.Add(numberFive);
-	statistics.Add(numberFive);
-	statistics.Add(numberFive);
-	AssertValues(statistics, this, 5, 25.0, 125.0, 625.0, 3125.0, 5.0, 0.0, 0.0, 0.0, 0.0, 0.0);
-
-	array.clear();
-	array.push_back(3.0);
-	array.push_back(3.0);
-	array.push_back(3.0);
-	NoiseStatistics partA = NoiseStatistics(array);
-	
-	array.clear();
-	array.push_back(1.0);
-	array.push_back(1.0);
-	array.push_back(1.0);
-	NoiseStatistics partB = NoiseStatistics(array);
-	statistics = NoiseStatistics();
-	statistics.Add(partA);
-	statistics.Add(partB);
-	AssertValues(statistics, this, 6, 12.0, 30.0, 84.0, 246.0, 2.0, 1.0, 1.0, sqrt(1.2), 1.2, 2.0/30.0);
-}
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/test/strategy/algorithms/siroperatortest.h b/CEP/DP3/AOFlagger/include/AOFlagger/test/strategy/algorithms/siroperatortest.h
deleted file mode 100644
index aa582bd7337f23cd89fbe35e164aa4289f7b5930..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/test/strategy/algorithms/siroperatortest.h
+++ /dev/null
@@ -1,369 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef AOFLAGGER_SIROPERATORTEST_H
-#define AOFLAGGER_SIROPERATORTEST_H
-
-#include <AOFlagger/test/testingtools/asserter.h>
-#include <AOFlagger/test/testingtools/unittest.h>
-
-#include <AOFlagger/msio/mask2d.h>
-
-#include <AOFlagger/strategy/algorithms/siroperator.h>
-
-#include <AOFlagger/util/rng.h>
-
-class SIROperatorTest : public UnitTest {
-	public:
-		SIROperatorTest() : UnitTest("Scale-invariant rank operator")
-		{
-			AddTest(TestThreePassAlgorithm(), "Three pass algorithm");
-			//AddTest(TestTwoPassAlgorithm(), "Two pass algorithm");
-			AddTest(TestSpeed(), "SIR operator speed");
-			AddTest(TestTimeApplication(), "Time application");
-			AddTest(TestFrequencyApplication(), "Frequency application");
-			AddTest(TestTimeApplicationSpeed(), "Time application speed");
-		}
-		
-	private:
-		struct TestSingleApplication : public Asserter
-		{
-			template<typename Functor>
-			inline void TestImplementation(Functor operate);
-		};
-		struct TestThreePassAlgorithm : public TestSingleApplication
-		{
-			void operator()();
-		};
-		struct TestTwoPassAlgorithm : public TestSingleApplication
-		{
-			void operator()();
-		};
-		struct TestSpeed : public Asserter
-		{
-			void operator()();
-		};
-		struct TestTimeApplication : public Asserter
-		{
-			void operator()();
-		};
-		struct TestFrequencyApplication : public Asserter
-		{
-			void operator()();
-		};
-		struct TestTimeApplicationSpeed : public Asserter
-		{
-			void operator()();
-		};
-		
-		static std::string flagsToString(const bool *flags, unsigned size)
-		{
-			std::stringstream s;
-			for(unsigned i=0;i<size;++i)
-			{
-				s << (flags[i] ? 'x' : ' ');
-			}
-			return s.str();
-		}
-		
-		static void setFlags(bool *flags, const std::string &str)
-		{
-			unsigned index = 0;
-			for(std::string::const_iterator i = str.begin(); i!=str.end(); ++i)
-			{
-				flags[index] = ((*i) == 'x');
-				++index;
-			}
-		}
-
-		static std::string maskToString(Mask2DCPtr mask)
-		{
-			std::stringstream s;
-			for(unsigned y=0;y<mask->Height();++y)
-			{
-				for(unsigned x=0;x<mask->Width();++x)
-				{
-					s << (mask->Value(x, y) ? 'x' : ' ');
-				}
-			}
-			return s.str();
-		}
-		
-		static void setMask(Mask2DPtr mask, const std::string &str)
-		{
-			std::string::const_iterator i = str.begin();
-			for(unsigned y=0;y<mask->Height();++y)
-			{
-				for(unsigned x=0;x<mask->Width();++x)
-				{
-					mask->SetValue(x, y, (*i) == 'x');
-					++i;
-				}
-			}
-		}
-
-};
-
-inline void SIROperatorTest::TestThreePassAlgorithm::operator()()
-{
-	TestImplementation(SIROperator::Operate);
-}
-
-inline void SIROperatorTest::TestTwoPassAlgorithm::operator()()
-{
-	TestImplementation(SIROperator::Operate2PassAlgorithm);
-}
-
-template<typename Functor>
-inline void SIROperatorTest::TestSingleApplication::TestImplementation(Functor operate)
-{
-	bool *flags = new bool[40];
-	setFlags(flags, "     x    ");
-	
-	operate(flags, 10, 0.0);
-	AssertEquals(flagsToString(flags, 10), "     x    ", "Eta=0.0, single center flagged, no enlarge");
-	
-	operate(flags, 10, 0.4);
-	AssertEquals(flagsToString(flags, 10), "     x    ", "Eta=0.4, single center flagged");
-	
-	operate(flags, 10, 0.5);
-	AssertEquals(flagsToString(flags, 10), "    xxx   ", "Eta=0.5, from one to three samples");
-
-	operate(flags, 10, 0.0);
-	AssertEquals(flagsToString(flags, 10), "    xxx   ", "Eta=0.0, three samples flagged");
-	
-	operate(flags, 10, 0.25);
-	AssertEquals(flagsToString(flags, 10), "   xxxxx  ");
-
-	operate(flags, 10, 0.16);
-	AssertEquals(flagsToString(flags, 10), "   xxxxx  ");
-
-	operate(flags, 10, 0.17);
-	AssertEquals(flagsToString(flags, 10), "  xxxxxxx ");
-
-	operate(flags, 10, 1.0);
-	AssertEquals(flagsToString(flags, 10), "xxxxxxxxxx");
-	
-	setFlags(flags, "xx xx     ");
-
-	operate(flags, 10, 0.0);
-	AssertEquals(flagsToString(flags, 10), "xx xx     ");
-
-	operate(flags, 10, 0.19);
-	AssertEquals(flagsToString(flags, 10), "xx xx     ", "Did not fill hole (eta=0.19)");
-
-	setFlags(flags, "xx xx     ");
-	operate(flags, 10, 0.2);
-	AssertEquals(flagsToString(flags, 10), "xxxxx     ", "Fills hole (eta=0.2)");
-	
-	setFlags(flags, "x         ");
-	operate(flags, 10, 0.5);
-	AssertEquals(flagsToString(flags, 10), "xx        ", "Left border, isolated");
-	operate(flags, 10, 0.4);
-	AssertEquals(flagsToString(flags, 10), "xxx       ", "Left border, combined");
-	
-	setFlags(flags, "         x");
-	operate(flags, 10, 0.5);
-	AssertEquals(flagsToString(flags, 10), "        xx", "Right border, isolated");
-	operate(flags, 10, 0.4);
-	AssertEquals(flagsToString(flags, 10), "       xxx", "Right border, combined");
-	
-	setFlags(flags, " x        ");
-	operate(flags, 10, 0.4);
-	AssertEquals(flagsToString(flags, 10), " x        ", "Left border empty");
-	
-	setFlags(flags, "        x ");
-	operate(flags, 10, 0.4);
-	AssertEquals(flagsToString(flags, 10), "        x ", "Right border empty");
-	
-	//               0    5    0    5    0    5    0    5    
-	setFlags(flags, "     xxxxxx xx xx x x xxx xxxxx         ");
-	operate(flags, 40, 0.2);
-	AssertEquals(flagsToString(flags, 40), "    xxxxxxxxxxxxx x xxxxxxxxxxxx        ", "Input: '     xxxxxx xx xx x x xxx xxxxx         '");
-
-	setFlags(flags, "     xxxxxx xx xx x x xxx xxxxx         ");
-	operate(flags, 40, 0.3);
-	AssertEquals(flagsToString(flags, 40), "   xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx       ", "Input: '     xxxxxx xx xx x x xxx xxxxx         '");
-
-	setFlags(flags, "     xxxxxx xx xx x x xxx xxxxx         ");
-	operate(flags, 40, 0.4);
-	AssertEquals(flagsToString(flags, 40), "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx  ");
-
-	setFlags(flags, "xxxxxxxxxxxxxxx       xxxxxxxxxxxxxxxxxx");
-	operate(flags, 40, 0.3);
-	AssertEquals(flagsToString(flags, 40), "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
-	
-	setFlags(flags, "      x   x  x xx xxx    ");
-	operate(flags, 25, 0.5);
-	AssertEquals(flagsToString(flags, 25), "     xxxxxxxxxxxxxxxxxxxx");
-	
-	delete[] flags;
-}
-
-inline void SIROperatorTest::TestSpeed::operator()()
-{
-	const unsigned flagsSize = 100000;
-	bool flags[flagsSize];
-	for(unsigned i=0;i<flagsSize; ++i)
-	{
-		flags[i] = (RNG::Uniform() >= 0.2);
-	}
-	SIROperator::Operate(flags, flagsSize, 0.1);
-}
-
-inline void SIROperatorTest::TestTimeApplication::operator()()
-{
-	Mask2DPtr mask = Mask2D::CreateSetMaskPtr<false>(10, 1);
-	setMask(mask, "     x    ");
-	
-	SIROperator::OperateHorizontally(mask, 0.0);
-	AssertEquals(maskToString(mask), "     x    ", "Eta=0.0, single center flagged, no enlarge");
-	
-	SIROperator::OperateHorizontally(mask, 0.4);
-	AssertEquals(maskToString(mask), "     x    ", "Eta=0.4, single center flagged");
-	
-	SIROperator::OperateHorizontally(mask, 0.5);
-	AssertEquals(maskToString(mask), "    xxx   ", "Eta=0.5, from one to three samples");
-
-	SIROperator::OperateHorizontally(mask, 0.0);
-	AssertEquals(maskToString(mask), "    xxx   ");
-	
-	SIROperator::OperateHorizontally(mask, 0.25);
-	AssertEquals(maskToString(mask), "   xxxxx  ");
-
-	SIROperator::OperateHorizontally(mask, 0.16);
-	AssertEquals(maskToString(mask), "   xxxxx  ");
-
-	SIROperator::OperateHorizontally(mask, 0.17);
-	AssertEquals(maskToString(mask), "  xxxxxxx ");
-
-	SIROperator::OperateHorizontally(mask, 0.6);
-	AssertEquals(maskToString(mask), "xxxxxxxxxx");
-
-	SIROperator::OperateHorizontally(mask, 1.0);
-	AssertEquals(maskToString(mask), "xxxxxxxxxx");
-	
-	setMask(mask, "xx xx     ");
-
-	SIROperator::OperateHorizontally(mask, 0.0);
-	AssertEquals(maskToString(mask), "xx xx     ");
-
-	SIROperator::OperateHorizontally(mask, 0.19);
-	AssertEquals(maskToString(mask), "xx xx     ", "Did not fill hole");
-	
-	SIROperator::OperateHorizontally(mask, 0.2);
-	AssertEquals(maskToString(mask), "xxxxx     ", "Fill hole");
-	
-	mask = Mask2D::CreateSetMaskPtr<false>(40, 1);
-	//             0    5    0    5    0    5    0    5    
-	setMask(mask, "     xxxxxx xx xx x x xxx xxxxx         ");
-	SIROperator::OperateHorizontally(mask, 0.2);
-	AssertEquals(maskToString(mask), "    xxxxxxxxxxxxx x xxxxxxxxxxxx        ");
-
-	setMask(mask, "     xxxxxx xx xx x x xxx xxxxx         ");
-	SIROperator::OperateHorizontally(mask, 0.3);
-	AssertEquals(maskToString(mask), "   xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx       ");
-
-	setMask(mask, "     xxxxxx xx xx x x xxx xxxxx         ");
-	SIROperator::OperateHorizontally(mask, 0.4);
-	AssertEquals(maskToString(mask), "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx  ");
-
-	setMask(mask, "xxxxxxxxxxxxxxx       xxxxxxxxxxxxxxxxxx");
-	SIROperator::OperateHorizontally(mask, 0.3);
-	AssertEquals(maskToString(mask), "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
-}
-
-inline void SIROperatorTest::TestFrequencyApplication::operator()()
-{
-	Mask2DPtr mask = Mask2D::CreateSetMaskPtr<false>(1, 10);
-	setMask(mask, "     x    ");
-	
-	SIROperator::OperateVertically(mask, 0.0);
-	AssertEquals(maskToString(mask), "     x    ", "Eta=0.0, single center flagged, no enlarge");
-	
-	SIROperator::OperateVertically(mask, 0.4);
-	AssertEquals(maskToString(mask), "     x    ", "Eta=0.4, single center flagged, eta 0.4");
-	
-	SIROperator::OperateVertically(mask, 0.5);
-	AssertEquals(maskToString(mask), "    xxx   ", "Eta=0.5, from one to three samples");
-
-	SIROperator::OperateVertically(mask, 0.0);
-	AssertEquals(maskToString(mask), "    xxx   ");
-	
-	SIROperator::OperateVertically(mask, 0.25);
-	AssertEquals(maskToString(mask), "   xxxxx  ");
-	
-	SIROperator::OperateVertically(mask, 0.16);
-	AssertEquals(maskToString(mask), "   xxxxx  ");
-
-	SIROperator::OperateVertically(mask, 0.17);
-	AssertEquals(maskToString(mask), "  xxxxxxx ");
-
-	SIROperator::OperateVertically(mask, 0.6);
-	AssertEquals(maskToString(mask), "xxxxxxxxxx");
-
-	SIROperator::OperateVertically(mask, 1.0);
-	AssertEquals(maskToString(mask), "xxxxxxxxxx");
-	
-	setMask(mask, "xx xx     ");
-
-	SIROperator::OperateVertically(mask, 0.0);
-	AssertEquals(maskToString(mask), "xx xx     ");
-
-	SIROperator::OperateVertically(mask, 0.19);
-	AssertEquals(maskToString(mask), "xx xx     ", "Did not fill hole");
-	
-	SIROperator::OperateVertically(mask, 0.2);
-	AssertEquals(maskToString(mask), "xxxxx     ", "Fill hole");
-	
-	mask = Mask2D::CreateSetMaskPtr<false>(1, 40);
-	//             0    5    0    5    0    5    0    5    
-	setMask(mask, "     xxxxxx xx xx x x xxx xxxxx         ");
-	SIROperator::OperateVertically(mask, 0.2);
-	AssertEquals(maskToString(mask), "    xxxxxxxxxxxxx x xxxxxxxxxxxx        ");
-
-	setMask(mask, "     xxxxxx xx xx x x xxx xxxxx         ");
-	SIROperator::OperateVertically(mask, 0.3);
-	AssertEquals(maskToString(mask), "   xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx       ");
-
-	setMask(mask, "     xxxxxx xx xx x x xxx xxxxx         ");
-	SIROperator::OperateVertically(mask, 0.4);
-	AssertEquals(maskToString(mask), "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx  ");
-
-	setMask(mask, "xxxxxxxxxxxxxxx       xxxxxxxxxxxxxxxxxx");
-	SIROperator::OperateVertically(mask, 0.3);
-	AssertEquals(maskToString(mask), "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
-}
-
-inline void SIROperatorTest::TestTimeApplicationSpeed::operator()()
-{
-	const unsigned flagsSize = 10000;
-	const unsigned channels = 256;
-	Mask2DPtr mask = Mask2D::CreateSetMaskPtr<false>(flagsSize, channels);
-	for(unsigned y=0;y<channels;++y)
-	{
-		for(unsigned i=0;i<flagsSize; ++i)
-		{
-			mask->SetValue(i, 0, (RNG::Uniform() >= 0.2));
-		}
-	}
-	SIROperator::OperateHorizontally(mask, 0.1);
-}
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/test/strategy/algorithms/statisticalflaggertest.h b/CEP/DP3/AOFlagger/include/AOFlagger/test/strategy/algorithms/statisticalflaggertest.h
deleted file mode 100644
index 9bf769332c402fc9dec1fd87b4263bce79334edb..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/test/strategy/algorithms/statisticalflaggertest.h
+++ /dev/null
@@ -1,201 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef AOFLAGGER_STATISTICALFLAGGERTEST_H
-#define AOFLAGGER_STATISTICALFLAGGERTEST_H
-
-#include <AOFlagger/test/testingtools/asserter.h>
-#include <AOFlagger/test/testingtools/unittest.h>
-
-#include <AOFlagger/msio/mask2d.h>
-
-#include <AOFlagger/strategy/algorithms/statisticalflagger.h>
-
-class StatisticalFlaggerTest : public UnitTest {
-	public:
-		StatisticalFlaggerTest() : UnitTest("Statistical flagger")
-		{
-			AddTest(TestTimeDilation(), "Time dilation");
-			AddTest(TestFrequencyDilation(), "Frequency dilation");
-			AddTest(TestTimeDilationSpeed(), "Time dilation speed");
-		}
-		
-	private:
-		struct TestTimeDilation : public Asserter
-		{
-			void operator()();
-		};
-		struct TestFrequencyDilation : public Asserter
-		{
-			void operator()();
-		};
-		struct TestTimeDilationSpeed : public Asserter
-		{
-			void operator()();
-		};
-		
-		static std::string maskToString(Mask2DCPtr mask)
-		{
-			std::stringstream s;
-			for(unsigned y=0;y<mask->Height();++y)
-			{
-				for(unsigned x=0;x<mask->Width();++x)
-				{
-					s << (mask->Value(x, y) ? 'x' : ' ');
-				}
-			}
-			return s.str();
-		}
-		
-		static void setMask(Mask2DPtr mask, const std::string &str)
-		{
-			std::string::const_iterator i = str.begin();
-			for(unsigned y=0;y<mask->Height();++y)
-			{
-				for(unsigned x=0;x<mask->Width();++x)
-				{
-					mask->SetValue(x, y, (*i) == 'x');
-					++i;
-				}
-			}
-		}
-};
-
-inline void StatisticalFlaggerTest::TestTimeDilation::operator()()
-{
-	Mask2DPtr mask = Mask2D::CreateSetMaskPtr<false>(10, 1);
-	setMask(mask, "     x    ");
-	
-	StatisticalFlagger::DensityTimeFlagger(mask, 0.0);
-	AssertEquals(maskToString(mask), "     x    ", "Min=0.0, single center flagged, no enlarge");
-	
-	StatisticalFlagger::DensityTimeFlagger(mask, 0.5);
-	AssertEquals(maskToString(mask), "     x    ", "Min=0.5, single center flagged, no enlarge");
-	
-	StatisticalFlagger::DensityTimeFlagger(mask, 0.6);
-	AssertEquals(maskToString(mask), "    xx    ", "Min=0.6, from one to two samples");
-
-	StatisticalFlagger::DensityTimeFlagger(mask, 0.0);
-	AssertEquals(maskToString(mask), "    xx    ");
-	
-	StatisticalFlagger::DensityTimeFlagger(mask, 0.5);
-	AssertEquals(maskToString(mask), "   xxxx   ");
-
-	StatisticalFlagger::DensityTimeFlagger(mask, 0.6);
-	AssertEquals(maskToString(mask), "xxxxxxxxxx");
-
-	StatisticalFlagger::DensityTimeFlagger(mask, 1.0);
-	AssertEquals(maskToString(mask), "xxxxxxxxxx");
-	
-	setMask(mask, "xx xx     ");
-
-	StatisticalFlagger::DensityTimeFlagger(mask, 0.0);
-	AssertEquals(maskToString(mask), "xx xx     ");
-
-	StatisticalFlagger::DensityTimeFlagger(mask, 0.5);
-	AssertTrue(mask->Value(2,0), "Fill hole");
-	
-	mask = Mask2D::CreateSetMaskPtr<false>(40, 1);
-	//             0    5    0    5    0    5    0    5    
-	setMask(mask, "     xxxxxx xx xx x x xxx xxxxx         ");
-	StatisticalFlagger::DensityTimeFlagger(mask, 0.2);
-	AssertEquals(maskToString(mask), "    xxxxxxxxxxxxx x xxxxxxxxxxxx        ");
-
-	setMask(mask, "     xxxxxx xx xx x x xxx xxxxx         ");
-	StatisticalFlagger::DensityTimeFlagger(mask, 0.3);
-	AssertEquals(maskToString(mask), "   xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx       ");
-
-	setMask(mask, "     xxxxxx xx xx x x xxx xxxxx         ");
-	StatisticalFlagger::DensityTimeFlagger(mask, 0.5);
-	AssertEquals(maskToString(mask), "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx  ");
-
-	setMask(mask, "xxxxxxxxxxxxxxx       xxxxxxxxxxxxxxxxxx");
-	StatisticalFlagger::DensityTimeFlagger(mask, 0.3);
-	AssertEquals(maskToString(mask), "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
-}
-
-inline void StatisticalFlaggerTest::TestFrequencyDilation::operator()()
-{
-	Mask2DPtr mask = Mask2D::CreateSetMaskPtr<false>(1, 10);
-	setMask(mask, "     x    ");
-	
-	StatisticalFlagger::DensityFrequencyFlagger(mask, 0.0);
-	AssertEquals(maskToString(mask), "     x    ", "Min=0.0, single center flagged, no enlarge");
-	
-	StatisticalFlagger::DensityFrequencyFlagger(mask, 0.5);
-	AssertEquals(maskToString(mask), "     x    ", "Min=0.5, single center flagged, no enlarge");
-	
-	StatisticalFlagger::DensityFrequencyFlagger(mask, 0.6);
-	AssertEquals(maskToString(mask), "    xx    ", "Min=0.6, from one to two samples");
-
-	StatisticalFlagger::DensityFrequencyFlagger(mask, 0.0);
-	AssertEquals(maskToString(mask), "    xx    ");
-	
-	StatisticalFlagger::DensityFrequencyFlagger(mask, 0.5);
-	AssertEquals(maskToString(mask), "   xxxx   ");
-
-	StatisticalFlagger::DensityFrequencyFlagger(mask, 0.6);
-	AssertEquals(maskToString(mask), "xxxxxxxxxx");
-
-	StatisticalFlagger::DensityFrequencyFlagger(mask, 1.0);
-	AssertEquals(maskToString(mask), "xxxxxxxxxx");
-	
-	setMask(mask, "xx xx     ");
-
-	StatisticalFlagger::DensityFrequencyFlagger(mask, 0.0);
-	AssertEquals(maskToString(mask), "xx xx     ");
-
-	StatisticalFlagger::DensityFrequencyFlagger(mask, 0.5);
-	AssertTrue(mask->Value(0,2), "Fill hole");
-	
-	mask = Mask2D::CreateSetMaskPtr<false>(1, 40);
-	//             0    5    0    5    0    5    0    5    
-	setMask(mask, "     xxxxxx xx xx x x xxx xxxxx         ");
-	StatisticalFlagger::DensityFrequencyFlagger(mask, 0.2);
-	AssertEquals(maskToString(mask), "    xxxxxxxxxxxxx x xxxxxxxxxxxx        ");
-
-	setMask(mask, "     xxxxxx xx xx x x xxx xxxxx         ");
-	StatisticalFlagger::DensityFrequencyFlagger(mask, 0.3);
-	AssertEquals(maskToString(mask), "   xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx       ");
-
-	setMask(mask, "     xxxxxx xx xx x x xxx xxxxx         ");
-	StatisticalFlagger::DensityFrequencyFlagger(mask, 0.5);
-	AssertEquals(maskToString(mask), "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx  ");
-
-	setMask(mask, "xxxxxxxxxxxxxxx       xxxxxxxxxxxxxxxxxx");
-	StatisticalFlagger::DensityFrequencyFlagger(mask, 0.3);
-	AssertEquals(maskToString(mask), "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
-}
-
-inline void StatisticalFlaggerTest::TestTimeDilationSpeed::operator()()
-{
-	const unsigned flagsSize = 10000;
-	const unsigned channels = 256;
-	Mask2DPtr mask = Mask2D::CreateSetMaskPtr<false>(flagsSize, channels);
-	for(unsigned y=0;y<channels;++y)
-	{
-		for(unsigned i=0;i<flagsSize; ++i)
-		{
-			mask->SetValue(i, 0, (RNG::Uniform() >= 0.2));
-		}
-	}
-	StatisticalFlagger::DensityTimeFlagger(mask, 0.1);
-}
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/test/strategy/algorithms/sumthresholdtest.h b/CEP/DP3/AOFlagger/include/AOFlagger/test/strategy/algorithms/sumthresholdtest.h
deleted file mode 100644
index 387f47a56d09da5178d24d00c92de89518c0c9b7..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/test/strategy/algorithms/sumthresholdtest.h
+++ /dev/null
@@ -1,165 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef AOFLAGGER_SUMTHRESHOLDTEST_H
-#define AOFLAGGER_SUMTHRESHOLDTEST_H
-
-#include <AOFlagger/msio/image2d.h>
-#include <AOFlagger/msio/mask2d.h>
-#include <AOFlagger/msio/timefrequencydata.h>
-
-#include <AOFlagger/strategy/algorithms/mitigationtester.h>
-#include <AOFlagger/strategy/algorithms/thresholdconfig.h>
-#include <AOFlagger/strategy/algorithms/thresholdmitigater.h>
-
-#include <AOFlagger/test/testingtools/asserter.h>
-#include <AOFlagger/test/testingtools/maskasserter.h>
-#include <AOFlagger/test/testingtools/unittest.h>
-
-class SumThresholdTest : public UnitTest {
-	public:
-		SumThresholdTest() : UnitTest("Sumthreshold")
-		{
-			AddTest(VerticalSumThresholdSSE(), "SumThreshold optimized SSE version (vertical)");
-			AddTest(HorizontalSumThresholdSSE(), "SumThreshold optimized SSE version (horizontal)");
-			AddTest(Stability(), "SumThreshold stability");
-		}
-		
-	private:
-		struct VerticalSumThresholdSSE : public Asserter
-		{
-			void operator()();
-		};
-		struct HorizontalSumThresholdSSE : public Asserter
-		{
-			void operator()();
-		};
-		struct Stability : public Asserter
-		{
-			void operator()();
-		};
-};
-
-void SumThresholdTest::VerticalSumThresholdSSE::operator()()
-{
-	const unsigned
-		width = 2048,
-		height = 256;
-	Mask2DPtr
-		mask1 = Mask2D::CreateUnsetMaskPtr(width, height),
-		mask2 = Mask2D::CreateUnsetMaskPtr(width, height);
-	Image2DPtr
-		real = MitigationTester::CreateTestSet(26, mask1, width, height),
-		imag = MitigationTester::CreateTestSet(26, mask2, width, height);
-	TimeFrequencyData data(XXPolarisation, real, imag);
-	Image2DCPtr image = data.GetSingleImage();
-	
-	ThresholdConfig config;
-	config.InitializeLengthsDefault(9);
-	num_t mode = image->GetMode();
-	config.InitializeThresholdsFromFirstThreshold(6.0 * mode, ThresholdConfig::Rayleigh);
-	for(unsigned i=0;i<9;++i)
-	{
-		mask1->SetAll<false>();
-		mask2->SetAll<false>();
-		
-		const unsigned length = config.GetHorizontalLength(i);
-		const double threshold = config.GetHorizontalThreshold(i);
-		
-		ThresholdMitigater::VerticalSumThresholdLargeReference(image, mask1, length, threshold);
-		ThresholdMitigater::VerticalSumThresholdLargeSSE(image, mask2, length, threshold);
-		
-		std::stringstream s;
-		s << "Equal SSE and reference masks produced by SumThreshold length " << length;
-		AssertTrue(mask1->Equals(mask2), s.str());
-	}
-}
-
-void SumThresholdTest::HorizontalSumThresholdSSE::operator()()
-{
-	const unsigned
-		width = 2048,
-		height = 256;
-	Mask2DPtr
-		mask1 = Mask2D::CreateUnsetMaskPtr(width, height),
-		mask2 = Mask2D::CreateUnsetMaskPtr(width, height);
-	Image2DPtr
-		real = MitigationTester::CreateTestSet(26, mask1, width, height),
-		imag = MitigationTester::CreateTestSet(26, mask2, width, height);
-		
-	mask1->SwapXY();
-	mask2->SwapXY();
-	real->SwapXY();
-	imag->SwapXY();
-		
-	TimeFrequencyData data(XXPolarisation, real, imag);
-	Image2DCPtr image = data.GetSingleImage();
-
-	ThresholdConfig config;
-	config.InitializeLengthsDefault(9);
-	num_t mode = image->GetMode();
-	config.InitializeThresholdsFromFirstThreshold(6.0 * mode, ThresholdConfig::Rayleigh);
-	for(unsigned i=0;i<9;++i)
-	{
-		mask1->SetAll<false>();
-		mask2->SetAll<false>();
-		
-		const unsigned length = config.GetHorizontalLength(i);
-		const double threshold = config.GetHorizontalThreshold(i);
-		
-		ThresholdMitigater::HorizontalSumThresholdLargeReference(image, mask1, length, threshold);
-		ThresholdMitigater::HorizontalSumThresholdLargeSSE(image, mask2, length, threshold);
-		
-		std::stringstream s;
-		s << "Equal SSE and reference masks produced by SumThreshold length " << length << ", threshold " << threshold;
-		MaskAsserter::AssertEqualMasks(mask2, mask1, s.str());
-	}
-}
-
-void SumThresholdTest::Stability::operator()()
-{
-	Mask2DPtr
-		maskA = Mask2D::CreateSetMaskPtr<false>(1, 1),
-		maskB = Mask2D::CreateSetMaskPtr<false>(2, 2),
-		maskC = Mask2D::CreateSetMaskPtr<false>(3, 3),
-		maskD = Mask2D::CreateSetMaskPtr<false>(4, 4);
-	Image2DPtr
-		realA = Image2D::CreateZeroImagePtr(1, 1),
-		realB = Image2D::CreateZeroImagePtr(2, 2),
-		realC = Image2D::CreateZeroImagePtr(3, 3),
-		realD = Image2D::CreateZeroImagePtr(4, 4);
-		
-	ThresholdConfig config;
-	config.InitializeLengthsDefault(9);
-	config.InitializeThresholdsFromFirstThreshold(6.0, ThresholdConfig::Rayleigh);
-	for(unsigned i=0;i<9;++i)
-	{
-		const unsigned length = config.GetHorizontalLength(i);
-		ThresholdMitigater::HorizontalSumThresholdLargeSSE(realA, maskA, length, 1.0);
-		ThresholdMitigater::VerticalSumThresholdLargeSSE(realA, maskA, length, 1.0);
-		ThresholdMitigater::HorizontalSumThresholdLargeSSE(realA, maskB, length, 1.0);
-		ThresholdMitigater::VerticalSumThresholdLargeSSE(realA, maskB, length, 1.0);
-		ThresholdMitigater::HorizontalSumThresholdLargeSSE(realA, maskC, length, 1.0);
-		ThresholdMitigater::VerticalSumThresholdLargeSSE(realA, maskC, length, 1.0);
-		ThresholdMitigater::HorizontalSumThresholdLargeSSE(realA, maskD, length, 1.0);
-		ThresholdMitigater::VerticalSumThresholdLargeSSE(realA, maskD, length, 1.0);
-	}
-}
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/test/strategy/algorithms/thresholdtoolstest.h b/CEP/DP3/AOFlagger/include/AOFlagger/test/strategy/algorithms/thresholdtoolstest.h
deleted file mode 100644
index 52d7ecf40045e39f0e31befa7c836d1e9cf3b28f..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/test/strategy/algorithms/thresholdtoolstest.h
+++ /dev/null
@@ -1,139 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef AOFLAGGER_THRESHOLDTOOLSTEST_H
-#define AOFLAGGER_THRESHOLDTOOLSTEST_H
-
-#include <AOFlagger/msio/mask2d.h>
-
-#include <AOFlagger/strategy/algorithms/thresholdtools.h>
-
-#include <AOFlagger/test/testingtools/asserter.h>
-#include <AOFlagger/test/testingtools/unittest.h>
-
-class ThresholdToolsTest : public UnitTest {
-	public:
-		ThresholdToolsTest() : UnitTest("Threshold tools")
-		{
-			AddTest(WinsorizedMaskedMeanVar(), "Winsorized, masked mean and variance");
-			AddTest(WinsorizedMaskedMode(), "Winsorized, masked mode");
-		}
-		
-	private:
-		struct WinsorizedMaskedMeanVar : public Asserter
-		{
-			void operator()();
-		};
-		struct WinsorizedMaskedMode : public Asserter
-		{
-			void operator()();
-		};
-};
-
-void ThresholdToolsTest::WinsorizedMaskedMeanVar::operator()()
-{
-	num_t mean, variance;
-
-	Mask2DCPtr fullMask = Mask2D::CreateSetMaskPtr<true>(100, 1);
-	Image2DPtr image1 = Image2D::CreateZeroImagePtr(100, 1);
-	// we just don't want it to crash
-	ThresholdTools::WinsorizedMeanAndStdDev(image1, fullMask, mean, variance);
-	
-	Mask2DCPtr emptyMask = Mask2D::CreateSetMaskPtr<false>(100, 1);
-	
-	ThresholdTools::WinsorizedMeanAndStdDev(image1, emptyMask, mean, variance);
-	Asserter::AssertAlmostEqual(mean, 0.0, "Mean of empty image");
-	Asserter::AssertAlmostEqual(variance, 0.0, "Variance of empty image");
-	
-	image1->SetValue(0, 0, 1.0);
-	ThresholdTools::WinsorizedMeanAndStdDev(image1, emptyMask, mean, variance);
-	Asserter::AssertAlmostEqual(mean, 0.0, "Mean of almost empty image");
-	Asserter::AssertAlmostEqual(variance, 0.0, "Variance of almost empty image");
-
-	image1->SetValue(1, 0, -2.0);
-	ThresholdTools::WinsorizedMeanAndStdDev(image1, emptyMask, mean, variance);
-	Asserter::AssertAlmostEqual(mean, 0.0, "Mean of almost empty image");
-	Asserter::AssertAlmostEqual(variance, 0.0, "Variance of almost empty image");
-	
-	Mask2DPtr mask1 = Mask2D::CreateSetMaskPtr<false>(100, 1);
-	for(unsigned x=50;x<100;++x)
-		mask1->SetValue(x, 0, true);
-	ThresholdTools::WinsorizedMeanAndStdDev(image1, mask1, mean, variance);
-	Asserter::AssertAlmostEqual(mean, 0.0, "Mean of 50% flagged image");
-	Asserter::AssertAlmostEqual(variance, 0.0, "Variance of 50% flagged image");
-	
-	for(unsigned x=0;x<50;++x)
-		image1->SetValue(x, 0, 1.0);
-	ThresholdTools::WinsorizedMeanAndStdDev(image1, mask1, mean, variance);
-	Asserter::AssertAlmostEqual(mean, 1.0, "Mean of 50% flagged image");
-	Asserter::AssertAlmostEqual(variance, 0.0, "Variance of 50% flagged image");
-
-	for(unsigned x=0;x<25;++x)
-		image1->SetValue(x, 0, -1.0);
-	ThresholdTools::WinsorizedMeanAndStdDev(image1, mask1, mean, variance);
-	Asserter::AssertAlmostEqual(mean, 0.0, "Mean of 50% flagged image");
-	// Remember: since the distribution is not Gaussian, the variance does not correspond with
-	// the Winsorized variance. The sqrtn(1.54) should be the correction term.
-	Asserter::AssertAlmostEqual(variance, 1.0 * sqrtn(1.54), "Mean of 50% flagged image");
-
-	for(unsigned x=0;x<100;++x)
-		image1->SetValue(x, 0, x+1.0);
-	ThresholdTools::WinsorizedMeanAndStdDev(image1, mask1, mean, variance);
-	Asserter::AssertAlmostEqual(mean, 25.5, "Mean of 50% flagged sequencial image");
-	// Since the distribution is not Gaussian, the variance does not correspond with
-	// the Winsorized variance. Therefore, don't test it here. TODO
-}
-
-
-void ThresholdToolsTest::WinsorizedMaskedMode::operator()()
-{
-	num_t mode;
-	Mask2DCPtr fullMask = Mask2D::CreateSetMaskPtr<true>(100, 1);
-	Image2DPtr image1 = Image2D::CreateZeroImagePtr(100, 1);
-	// we just don't want it to crash
-	ThresholdTools::WinsorizedMode(image1, fullMask);
-
-	Mask2DCPtr emptyMask = Mask2D::CreateSetMaskPtr<false>(100, 1);
-  mode = ThresholdTools::WinsorizedMode(image1, emptyMask);
-	Asserter::AssertAlmostEqual(mode, 0.0, "Mean of zero image");
-
-	image1->SetValue(0, 0, 1.0);
-	mode = ThresholdTools::WinsorizedMode(image1, emptyMask);
-	Asserter::AssertAlmostEqual(mode, 0.0, "Mode of almost empty image");
-
-	Mask2DPtr mask1 = Mask2D::CreateSetMaskPtr<false>(100, 1);
-	for(unsigned x=50;x<100;++x)
-		mask1->SetValue(x, 0, true);
-	mode = ThresholdTools::WinsorizedMode(image1, mask1);
-	Asserter::AssertAlmostEqual(mode, 0.0, "Mode of 50% flagged image with only zeros");
-	
-	for(unsigned x=0;x<50;++x)
-		image1->SetValue(x, 0, 1.0);
-	mode = ThresholdTools::WinsorizedMode(image1, mask1);
-	Asserter::AssertAlmostEqual(mode, sqrt(0.5) * 1.0541, "Mode of non-zero 50% flagged image");
-
-	//for(unsigned x=0;x<100;++x)
-	//	image1->SetValue(x, 0, x+1.0);
-	//mode = ThresholdTools::WinsorizedMeanAndStdDev(image1, mask1, mean, variance);
-	//Asserter::AssertAlmostEqual(mean, 25.5, "Mean of 50% flagged sequencial image");
-	// Since the distribution is not Gaussian, the variance does not correspond with
-	// the Winsorized variance. Therefore, don't test it here. TODO
-}
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/test/testingtools/asserter.h b/CEP/DP3/AOFlagger/include/AOFlagger/test/testingtools/asserter.h
deleted file mode 100644
index 5a82dd3243ab4f198c20fbc362dac66dbb561894..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/test/testingtools/asserter.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef AOFLAGGER_ASSERTER_H
-#define AOFLAGGER_ASSERTER_H
-
-#include <AOFlagger/test/testingtools/equalsasserter.h>
-#include <AOFlagger/test/testingtools/lessthanasserter.h>
-
-class Asserter : public EqualsAsserter, public LessThanAsserter {
-	public:
-		Asserter()
-		{
-		}
-		
-		~Asserter()
-		{
-		}
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/test/testingtools/equalsasserter.h b/CEP/DP3/AOFlagger/include/AOFlagger/test/testingtools/equalsasserter.h
deleted file mode 100644
index 9e9f68ca2360ef5eea777a5b475213e0bfaea244..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/test/testingtools/equalsasserter.h
+++ /dev/null
@@ -1,347 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef AOFLAGGER_EQUALS_ASSERTER_H
-#define AOFLAGGER_EQUALS_ASSERTER_H
-
-#include <string>
-#include <stdexcept>
-#include <sstream>
-#include <typeinfo>
-#include <cmath>
-
-class EqualsAsserter {
-	public:
-		EqualsAsserter()
-		{
-		}
-		
-		~EqualsAsserter()
-		{
-		}
-		
-		template<typename T>
-		void AssertEquals(bool, T) const
-		{
-			std::stringstream s;
-			s <<
-				"AssertEquals(): Trying to compare a boolean with some other type is not allowed for safety "
-				"(first parameter to AssertEquals was a bool, second was " << typeid(T).name() << ")";
-			throw std::runtime_error(s.str());
-		}
-		
-		template<typename T>
-		void AssertEquals(T, bool) const
-		{
-			std::stringstream s;
-			s <<
-				"AssertEquals(): Trying to compare a boolean with some other type is not allowed for safety "
-				"(second parameter to AssertEquals was a bool, first was " << typeid(T).name() << ")";
-			throw std::runtime_error(s.str());
-		}
-		
-		template<typename T>
-		void AssertEquals(bool, T, const std::string &description) const
-		{
-			std::stringstream s;
-			s <<
-				"AssertEquals() on test \"" << description << "\": "
-				"Trying to compare a boolean with some other type is not allowed for safety "
-				"(first parameter to AssertEquals was a bool, second was " << typeid(T).name() << ")";
-			throw std::runtime_error(s.str());
-		}
-		
-		template<typename T>
-		void AssertEquals(T, bool, const std::string &description) const
-		{
-			std::stringstream s;
-			s <<
-				"AssertEquals() on test \"" << description << "\": "
-				"Trying to compare a boolean with some other type is not allowed for safety "
-				"(second parameter to AssertEquals was a bool, first was " << typeid(T).name() << ")";
-		}
-		
-		void AssertEquals(const std::string &actual, const std::string &expected) const
-		{
-			if(!(actual == expected))
-			{
-				throwComparisonError(std::string("'") + actual + "'", std::string("'") + expected + "'", typeid(const std::string &));
-			}
-		}
-		
-		void AssertEquals(const std::string &actual, const char *expected) const
-		{ AssertEquals(actual, std::string(expected)); }
-		
-		void AssertEquals(const char *actual, const std::string &expected) const
-		{ AssertEquals(std::string(actual), expected); }
-		
-		void AssertEquals(const std::string &actual, const std::string &expected, const std::string &description) const
-		{
-			if(!(actual == expected))
-			{
-				throwComparisonError(std::string("'") + actual + "'", std::string("'") + expected + "'", typeid(const std::string &), description);
-			}
-		}
-		
-		void AssertEquals(const std::string &actual, const char *expected, const std::string &description) const
-		{
-			AssertEquals(actual, std::string(expected), description);
-		}
-		
-		void AssertEquals(const char *actual, const std::string &expected, const std::string &description) const
-		{
-			AssertEquals(std::string(actual), expected, description);
-		}
-		
-		template<typename T>
-		void AssertEquals(T actual, T expected) const
-		{
-			if(!(actual == expected))
-			{
-				throwComparisonError(actual, expected, typeid(T));
-			}
-		}
-		
-		template<typename T>
-		void AssertEquals(T actual, T expected, const std::string &description) const
-		{
-			if(!(actual == expected))
-			{
-				throwComparisonError(actual, expected, typeid(T), description);
-			}
-		}
-		
-		void AssertEquals(float actual, double expected) const
-		{ AssertEquals<float>((float) actual, (float) expected); }
-		
-		void AssertEquals(double actual, float expected) const
-		{ AssertEquals<float>((float) actual, (float) expected); }
-		
-		void AssertEquals(float actual, long double expected) const
-		{ AssertEquals<float>((float) actual, (float) expected); }
-		
-		void AssertEquals(long double actual, float expected) const
-		{ AssertEquals<float>((float) actual, (float) expected); }
-		
-		void AssertEquals(double actual, long double expected) const
-		{ AssertEquals<double>((double) actual, (double) expected); }
-		
-		void AssertEquals(long double actual, double expected) const
-		{ AssertEquals<double>((double) actual, (double) expected); }
-		
-		void AssertEquals(float actual, double expected, const std::string&description) const
-		{ AssertEquals<float>((float) actual, (float) expected, description); }
-		
-		void AssertEquals(double actual, float expected, const std::string &description) const
-		{ AssertEquals<float>((float) actual, (float) expected, description); }
-		
-		void AssertEquals(float actual, long double expected, const std::string &description) const
-		{ AssertEquals<float>((float) actual, (float) expected, description); }
-		
-		void AssertEquals(long double actual, float expected, const std::string &description) const
-		{ AssertEquals<float>((float) actual, (float) expected, description); }
-		
-		void AssertEquals(double actual, long double expected, const std::string &description) const
-		{ AssertEquals<double>((double) actual, (double) expected, description); }
-		
-		void AssertEquals(long double actual, double expected, const std::string &description) const
-		{ AssertEquals<double>((double) actual, (double) expected, description); }
-		
-		void AssertAlmostEqual(float actual, float expected) const
-		{
-			assertAlmostEqual(actual, expected, 24, "float");
-		}
-		
-		void AssertAlmostEqual(double actual, double expected) const
-		{
-			assertAlmostEqual<double>(actual, expected, 40, "double");
-		}
-
-		void AssertAlmostEqual(long double actual, long double expected) const
-		{
-			assertAlmostEqual<long double>(actual, expected, 40, "long double");
-		}
-		
-		void AssertAlmostEqual(float actual, float expected, const std::string &description) const
-		{
-			assertAlmostEqual<float>(actual, expected, 12, "float", description);
-		}
-		
-		void AssertAlmostEqual(double actual, double expected, const std::string &description) const
-		{
-			assertAlmostEqual<double>(actual, expected, 24, "double", description);
-		}
-
-		void AssertAlmostEqual(long double actual, long double expected, const std::string &description) const
-		{
-			assertAlmostEqual<long double>(actual, expected, 32, "long double", description);
-		}
-		
-		void AssertAlmostEqual(float actual, double expected) const
-		{ AssertAlmostEqual((float) actual, (float) expected); }
-
-		void AssertAlmostEqual(float actual, long double expected) const
-		{ AssertAlmostEqual((float) actual, (float) expected); }
-		
-		void AssertAlmostEqual(double actual, float expected) const
-		{ AssertAlmostEqual((float) actual, (float) expected); }
-
-		void AssertAlmostEqual(long double actual, float expected) const
-		{ AssertAlmostEqual((float) actual, (float) expected); }
-		
-		void AssertAlmostEqual(double actual, long double expected) const
-		{ AssertAlmostEqual((double) actual, (double) expected); }
-		
-		void AssertAlmostEqual(long double actual, double expected) const
-		{ AssertAlmostEqual((double) actual, (double) expected); }
-		
-		void AssertAlmostEqual(float actual, double expected, const std::string &description) const
-		{ AssertAlmostEqual((float) actual, (float) expected, description); }
-
-		void AssertAlmostEqual(float actual, long double expected, const std::string &description) const
-		{ AssertAlmostEqual((float) actual, (float) expected, description); }
-		
-		void AssertAlmostEqual(double actual, float expected, const std::string &description) const
-		{ AssertAlmostEqual((float) actual, (float) expected, description); }
-
-		void AssertAlmostEqual(long double actual, float expected, const std::string &description) const
-		{ AssertAlmostEqual((float) actual, (float) expected, description); }
-		
-		void AssertAlmostEqual(double actual, long double expected, const std::string &description) const
-		{ AssertAlmostEqual((double) actual, (double) expected, description); }
-		
-		void AssertAlmostEqual(long double actual, double expected, const std::string &description) const
-		{ AssertAlmostEqual((double) actual, (double) expected, description); }
-		
-		void AssertTrue(bool actual) const
-		{ assertEqualsBool(actual, true); }
-
-		void AssertTrue(bool actual, const std::string &description) const
-		{ assertEqualsBool(actual, true, description); }
-
-		void AssertFalse(bool actual) const
-		{ assertEqualsBool(actual, false); }
-
-		void AssertFalse(bool actual, const std::string &description) const
-		{ assertEqualsBool(actual, false, description); }
-
-		static bool IsAlmostEqual(float first, float second)
-		{
-			return isAlmostEqual<float>(first, second, 12);
-		}
-	private:
-		void assertEqualsBool(bool actual, bool expected) const
-		{
-			if(!(actual == expected))
-			{
-				throwComparisonError(boolToString(actual), boolToString(expected), typeid(bool));
-			}
-		}
-		
-		void assertEqualsBool(bool actual, bool expected, const std::string &description) const
-		{
-			if(!(actual == expected))
-			{
-				throwComparisonError(boolToString(actual), boolToString(expected), typeid(bool), description);
-			}
-		}
-		
-		template <typename T>
-		void throwComparisonError(T actual, T expected, const std::type_info &type) const
-		{
-			std::stringstream s;
-			s << "AssertEquals failed: " << actual << " == " << expected << " was false" << "\n("
-			<< expected << " was expected, " << actual << " was the actual value, type = '" << type.name() << "')";
-			throw std::runtime_error(s.str());
-		}
-		
-		template <typename T>
-		void throwComparisonError(T actual, T expected, const std::type_info &type, const std::string &description) const
-		{
-			std::stringstream s;
-			s << "AssertEquals failed on test '" << description << "': " << actual << " == " << expected << " was false" << "\n("
-			<< expected << " was expected, " << actual << " was the actual value, type = '" << type.name() << "')";
-			throw std::runtime_error(s.str());
-		}
-		
-		template <typename T>
-		void assertAlmostEqual(T actual, T expected, unsigned precision, const char *typeStr) const
-		{
-			if(!std::isfinite(actual) || !std::isfinite(expected))
-			{
-				std::stringstream s;
-				s << "AssertAlmostEqual was called with nonfinite value: " << actual << " == " << expected << "\n("
-				<< expected << " was expected, " << actual << " was the actual value, type = " << typeStr << ")";
-				throw std::runtime_error(s.str());
-			}
-			T maxArgument = std::max(std::max(std::abs(actual), std::abs(expected)), (T) 1.0);
-			T maxDistance = maxArgument/(T) powl((T) 2.0, precision);
-			T distance = std::abs(actual - expected);
-			if(distance > maxDistance)
-			{
-				std::stringstream s;
-				s << "AssertAlmostEqual failed: |" << actual << " - " << expected << "| = " << std::abs(actual - expected)
-				<< " > " << maxDistance << "\n("
-				<< expected << " was expected, " << actual << " was the actual value, type = " << typeStr << ")";
-				throw std::runtime_error(s.str());
-			}
-		}
-		
-		template <typename T>
-		void assertAlmostEqual(T actual, T expected, unsigned precision, const char *typeStr, const std::string &description) const
-		{
-			if(!std::isfinite(actual) || !std::isfinite(expected))
-			{
-				std::stringstream s;
-				s << "AssertAlmostEqual in test '" << description << "' was called with nonfinite value: " << actual << " == " << expected << "\n("
-				<< expected << " was expected, " << actual << " was the actual value, type = " << typeStr << ")";
-				throw std::runtime_error(s.str());
-			}
-		T maxArgument = std::max(std::max(std::abs(actual), std::abs(expected)), (T) 1.0);
-			T maxDistance = maxArgument/(T) powl((T) 2.0, precision);
-			T distance = std::abs(actual - expected);
-			if(distance > maxDistance)
-			{
-				std::stringstream s;
-				s << "AssertAlmostEqual failed on test '" << description << "': |" << actual << " - " << expected << "| = " << std::abs(actual - expected)
-				<< " > " << maxDistance << "\n("
-				<< expected << " was expected, " << actual << " was the actual value, type = " << typeStr << ")";
-				throw std::runtime_error(s.str());
-			}
-		}
-		
-		template<typename T>
-		static bool isAlmostEqual(T first, T second, unsigned precision)
-		{
-			T maxArgument = std::max(std::max(std::abs(first), std::abs(second)), (T) 1.0);
-			T maxDistance = maxArgument/(T) powl((T) 2.0, precision);
-			T distance = std::abs(first - second);
-			return distance <= maxDistance;
-		}
-		
-		const char *boolToString(bool value) const
-		{
-			if(value)
-				return "true";
-			else
-				return "false";
-		}
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/test/testingtools/imageasserter.h b/CEP/DP3/AOFlagger/include/AOFlagger/test/testingtools/imageasserter.h
deleted file mode 100644
index 58a5c869f196c2e56b04be40b975f8bbdc3d7af3..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/test/testingtools/imageasserter.h
+++ /dev/null
@@ -1,135 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef AOFLAGGER_IMAGE_ASSERTER_H
-#define AOFLAGGER_IMAGE_ASSERTER_H
-
-#include <string>
-#include <stdexcept>
-#include <sstream>
-
-#include <AOFlagger/msio/image2d.h>
-#include "equalsasserter.h"
-
-class ImageAsserter {
-	public:
-		static void AssertEqual(const Image2DCPtr &actual, const Image2DCPtr &expected, const std::string &str)
-		{
-			if(actual->Width() != expected->Width())
-				throw std::runtime_error("Width of images do not match");
-			if(actual->Height() != expected->Height())
-				throw std::runtime_error("Height of images do not match");
-			
-			std::stringstream s;
-			s << "ImageAsserter::AssertEqual failed for test '" << str << "': ";
-			
-			size_t errCount = 0;
-			for(size_t y=0;y<actual->Height();++y)
-			{
-				for(size_t x=0;x<actual->Width();++x)
-				{
-					if(!EqualsAsserter::IsAlmostEqual(actual->Value(x, y), expected->Value(x, y)))
-					{
-						if(errCount < 25)
-						{
-							if(errCount != 0) s << ", ";
-							s
-							<< "sample (" << x << ',' << y << "), expected " << expected->Value(x,y)
-							<< ", actual " << actual->Value(x,y);
-						} else if(errCount == 25)
-						{
-							s << ", ...";
-						}
-						++errCount;
-					}
-				}
-			}
-			if(errCount != 0)
-			{
-				s << ". " << errCount << " errors.";
-				throw std::runtime_error(s.str());
-			}
-		}
-		
-		static void AssertConstant(const Image2DCPtr &actual, const num_t &expected, const std::string &str)
-		{
-			std::stringstream s;
-			s << "ImageAsserter::AssertConstant failed for test '" << str << "': ";
-			
-			size_t errCount = 0;
-			for(size_t y=0;y<actual->Height();++y)
-			{
-				for(size_t x=0;x<actual->Width();++x)
-				{
-					if(!EqualsAsserter::IsAlmostEqual(actual->Value(x, y), expected))
-					{
-						if(errCount < 25)
-						{
-							if(errCount != 0) s << ", ";
-							s
-							<< "sample (" << x << ',' << y << "), expected " << expected
-							<< ", actual " << actual->Value(x,y);
-						} else if(errCount == 25)
-						{
-							s << ", ...";
-						}
-						++errCount;
-					}
-				}
-			}
-			if(errCount != 0)
-			{
-				s << ". " << errCount << " errors.";
-				throw std::runtime_error(s.str());
-			}
-		}
-		
-		static void AssertFinite(const Image2DCPtr &actual, const std::string &str)
-		{
-			std::stringstream s;
-			s << "ImageAsserter::AssertFinite failed for test '" << str << "': ";
-			
-			size_t errCount = 0;
-			for(size_t y=0;y<actual->Height();++y)
-			{
-				for(size_t x=0;x<actual->Width();++x)
-				{
-					if(!std::isfinite(actual->Value(x, y)))
-					{
-						if(errCount < 25)
-						{
-							if(errCount != 0) s << ", ";
-							s << "sample (" << x << ',' << y << ") was not finite (" << actual->Value(x,y) << ")";
-						} else if(errCount == 25)
-						{
-							s << ", ...";
-						}
-						++errCount;
-					}
-				}
-			}
-			if(errCount != 0)
-			{
-				s << ". " << errCount << " errors.";
-				throw std::runtime_error(s.str());
-			}
-		}
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/test/testingtools/lessthanasserter.h b/CEP/DP3/AOFlagger/include/AOFlagger/test/testingtools/lessthanasserter.h
deleted file mode 100644
index 8940f61cf4e169a34900388b7844a7e779bb1cb9..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/test/testingtools/lessthanasserter.h
+++ /dev/null
@@ -1,164 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef AOFLAGGER_LESS_THAN_ASSERTER_H
-#define AOFLAGGER_LESS_THAN_ASSERTER_H
-
-#include <stdexcept>
-#include <sstream>
-#include <string>
-#include <typeinfo>
-
-class LessThanAsserter {
-	public:
-		LessThanAsserter()
-		{
-		}
-		
-		~LessThanAsserter()
-		{
-		}
-		
-		template<typename T, typename S>
-		void AssertLessThan(T actual, S limit) const
-		{
-			if(!(actual < limit))
-			{
-				throwLessThanComparisonError(actual, limit);
-			}
-		}
-
-		template<typename T, typename S>
-		void AssertLessThan(T actual, S limit, const std::string &description) const
-		{
-			if(!(actual < limit))
-			{
-				throwLessThanComparisonError(actual, limit, description);
-			}
-		}
-
-		template<typename T, typename S>
-		void AssertGreaterThan(T actual, S limit) const
-		{
-			if(!(actual > limit))
-			{
-				throwGreaterThanComparisonError(actual, limit);
-			}
-		}
-
-		template<typename T, typename S>
-		void AssertGreaterThan(T actual, S limit, const std::string &description) const
-		{
-			if(!(actual > limit))
-			{
-				throwGreaterThanComparisonError(actual, limit, description);
-			}
-		}
-
-		template<typename T, typename S>
-		void AssertNotEqual(T first, S second) const
-		{
-			if(!(first != second))
-			{
-				throwNotEqualsError(first, second);
-			}
-		}
-
-		template<typename T, typename S>
-		void AssertNotEqual(T first, S second, const std::string &description) const
-		{
-			if(!(first != second))
-			{
-				throwNotEqualsError(first, second, description);
-			}
-		}
-	private:
-		template <typename T, typename S>
-		void throwLessThanComparisonError(T actual, S limit) const
-		{
-			std::stringstream s;
-			s << "AssertLessThan failed: " << actual << " < " << limit << " was false" << "\n("
-			<< limit << " was the limit, " << actual << " was the actual value, ";
-			addTypes(s, typeid(actual), typeid(limit));
-			throw std::runtime_error(s.str());
-		}
-
-		template <typename T, typename S>
-		void throwLessThanComparisonError(T actual, S limit, const std::string &description) const
-		{
-			std::stringstream s;
-			s << "AssertLessThan failed on test '" << description
-			<< "': " << actual << " < " << limit << " was false" << "\n("
-			<< limit << " was the limit, " << actual << " was the actual value, ";
-			addTypes(s, typeid(actual), typeid(limit));
-			throw std::runtime_error(s.str());
-		}
-
-		template <typename T, typename S>
-		void throwGreaterThanComparisonError(T actual, S limit) const
-		{
-			std::stringstream s;
-			s << "AssertGreaterThan failed: " << actual << " > " << limit << " was false" << "\n("
-			<< limit << " was the limit, " << actual << " was the actual value, ";
-			addTypes(s, typeid(actual), typeid(limit));
-			throw std::runtime_error(s.str());
-		}
-
-		template <typename T, typename S>
-		void throwGreaterThanComparisonError(T actual, S limit, const std::string &description) const
-		{
-			std::stringstream s;
-			s << "AssertGreaterThan failed on test '" << description
-			<< "': " << actual << " > " << limit << " was false" << "\n("
-			<< limit << " was the limit, " << actual << " was the actual value, ";
-			addTypes(s, typeid(actual), typeid(limit));
-			throw std::runtime_error(s.str());
-		}
-		
-		template <typename T, typename S>
-		void throwNotEqualsError(T first, S second) const
-		{
-			std::stringstream s;
-			s << "AssertNotEqual failed: " << first << " != " << second << " was false" << "\n(";
-			addTypes(s, typeid(first), typeid(second));
-			throw std::runtime_error(s.str());
-		}
-
-		template <typename T, typename S>
-		void throwNotEqualsError(T first, S second, const std::string &description) const
-		{
-			std::stringstream s;
-			s << "AssertNotEqual failed on test '" << description
-			<< "': " << first << " != " << second << " was false" << "\n(";
-			addTypes(s, typeid(first), typeid(second));
-			throw std::runtime_error(s.str());
-		}
-
-		void addTypes(std::stringstream &s, const std::type_info &leftHandType, const std::type_info &rightHandType) const
-		{
-			if(leftHandType == rightHandType)
-			{
-				s << "type = '" << leftHandType.name() << "')";
-			} else {
-				s << "compared different types: " << leftHandType.name() << ", " << rightHandType.name() << ')';
-			}
-		}
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/test/testingtools/maskasserter.h b/CEP/DP3/AOFlagger/include/AOFlagger/test/testingtools/maskasserter.h
deleted file mode 100644
index b2055cf6a6d5cda34ed6fbb7084756a94f2d0342..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/test/testingtools/maskasserter.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef AOFLAGGER_MASK_ASSERTER_H
-#define AOFLAGGER_MASK_ASSERTER_H
-
-#include <string>
-#include <stdexcept>
-#include <sstream>
-
-#include <AOFlagger/msio/mask2d.h>
-
-class MaskAsserter {
-	public:
-		MaskAsserter()
-		{
-		}
-		
-		~MaskAsserter()
-		{
-		}
-		
-		static void AssertEqualMasks(Mask2DPtr actual, Mask2DPtr expected, const std::string &str)
-		{
-			if(actual->Width() != expected->Width())
-				throw std::runtime_error("Width of masks do not match");
-			if(actual->Height() != expected->Height())
-				throw std::runtime_error("Height of masks do not match");
-			
-			std::stringstream s;
-			s << "AssertEqualMasks failed for test '" << str << "': ";
-			
-			size_t errCount = 0, falseMatches = 0, trueMatches = 0;
-			for(size_t y=0;y<actual->Height();++y)
-			{
-				for(size_t x=0;x<actual->Width();++x)
-				{
-					if(actual->Value(x, y) != expected->Value(x, y))
-					{
-						if(errCount < 25)
-						{
-							if(errCount != 0) s << ", ";
-							s << "sample (" << x << ',' << y << "), expected ";
-							if(expected->Value(x,y)) s << "true"; else s << "false";
-							s << ", actual ";
-							if(actual->Value(x,y)) s << "true"; else s << "false";
-						} else if(errCount == 25)
-						{
-							s << ", ...";
-						}
-						++errCount;
-					} else if(actual->Value(x,y))
-						trueMatches++;
-					else falseMatches++;
-				}
-			}
-			if(errCount != 0)
-			{
-				s << ". " << falseMatches << " matching false values, " << trueMatches << " matching true values, " << errCount << " errors.";
-				throw std::runtime_error(s.str());
-			}
-		}
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/test/testingtools/testgroup.h b/CEP/DP3/AOFlagger/include/AOFlagger/test/testingtools/testgroup.h
deleted file mode 100644
index ccc68c1d9e43a9cb0afd51eda1b993dc91a45cda..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/test/testingtools/testgroup.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef AOFLAGGER_TESTGROUP_H
-#define AOFLAGGER_TESTGROUP_H
-
-#include <stdexcept>
-
-#include <AOFlagger/test/testingtools/testitem.h>
-#include <AOFlagger/test/testingtools/unittest.h>
-
-class TestGroup : public TestItem {
-	public:
-		TestGroup(const std::string &name) : _name(name), _successes(0), _failures(0)
-		{
-		}
-		
-		virtual ~TestGroup()
-		{
-			for(std::vector<TestItem *>::iterator i=_tests.begin();i!=_tests.end();++i)
-			{
-				delete *i;
-			}
-		}
-		
-		virtual void Initialize() = 0;
-		
-		void Add(UnitTest *test)
-		{
-			_tests.push_back(test);
-		}
-		
-		void Add(TestGroup *group)
-		{
-			_tests.push_back(group);
-		}
-		
-		void Run()
-		{
-			std::cout << "\n=== Group " << Name() << " ===\n\n";
-			Initialize();
-			for(std::vector<TestItem *>::iterator i=_tests.begin();i!=_tests.end();++i)
-			{
-				TestItem *item = *i;
-				
-				TestGroup *group = dynamic_cast<TestGroup*>(item);
-				UnitTest *unitTest = dynamic_cast<UnitTest*>(item);
-				if(group != 0)
-				{
-					std::cout << "=== Group " << group->Name() << " ===\n";
-					group->Run();
-				} else if(unitTest != 0)
-				{
-					std::cout << "Unit test '" << unitTest->Name() << "':\n";
-					unitTest->Run();
-					_successes += unitTest->Successes();
-					_failures += unitTest->Failures();
-				} else
-				{
-					throw std::runtime_error("Invalid item in test group");
-				}
-				std::cout << '\n';
-			}
-		}
-		
-		const std::string &Name() const
-		{
-			return _name;
-		}
-		
-		unsigned Successes() const { return _successes; }
-		unsigned Failures() const { return _failures; }
-	private:
-		std::vector<TestItem *> _tests;
-		std::string _name;
-		unsigned _successes, _failures;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/test/testingtools/testitem.h b/CEP/DP3/AOFlagger/include/AOFlagger/test/testingtools/testitem.h
deleted file mode 100644
index 94e3552d5f63c5383694fe4f55e77e42547c175d..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/test/testingtools/testitem.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef AOFLAGGER_TESTITEM_H
-#define AOFLAGGER_TESTITEM_H
-
-class TestItem {
-	public:
-		TestItem() { }
-		
-		virtual ~TestItem() { }
-		
-	private:
-		
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/test/testingtools/unittest.h b/CEP/DP3/AOFlagger/include/AOFlagger/test/testingtools/unittest.h
deleted file mode 100644
index 893a601c9143d9d941e94eb77bd445737d3ac71d..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/test/testingtools/unittest.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef AOFLAGGER_UNITTEST_H
-#define AOFLAGGER_UNITTEST_H
-
-#include <string>
-#include <vector>
-#include <iostream>
-
-#include <AOFlagger/util/stopwatch.h>
-
-#include <AOFlagger/test/testingtools/testitem.h>
-
-class UnitTest : public TestItem {
-	public:
-		UnitTest(const std::string &name) : _name(name), _successes(0), _failures(0)
-		{
-		}
-		
-		virtual ~UnitTest()
-		{
-			for(std::vector<RunnableTest*>::iterator i=_tests.begin();i!=_tests.end();++i)
-			{
-				delete *i;
-			}
-		}
-		
-		template<typename Functor>
-		void AddTest(Functor testFunctor, const std::string &name)
-		{
-			_tests.push_back(new SpecificTest<Functor>(testFunctor, name));
-		}
-		
-		void Run()
-		{
-			for(std::vector<RunnableTest*>::iterator i=_tests.begin();i!=_tests.end();++i)
-			{
-				std::cout << "* Running subtest '" << (*i)->_name << "'... " << std::flush;
-				try {
-					Stopwatch watch(true);
-					(*i)->Run();
-					if(watch.Seconds()>0.0)
-						std::cout << "SUCCESS (" << watch.ToShortString() << ")\n";
-					else
-						std::cout << "SUCCESS\n";
-					++_successes;
-				} catch(std::exception &exception)
-				{
-					std::cout << "FAIL\n\nDetails of failure:\n" << exception.what() << "\n\n";
-					++_failures;
-				}
-			}
-		}
-		
-		const std::string &Name() const { return _name; }
-		unsigned Successes() const { return _successes; }
-		unsigned Failures() const { return _failures; }
-	private:
-		struct RunnableTest {
-			public:
-				RunnableTest(const std::string &name) : _name(name) { }
-				virtual ~RunnableTest() { }
-				virtual void Run() = 0;
-				std::string _name;
-			private:
-				RunnableTest(const RunnableTest &) { }
-				void operator=(const RunnableTest &) { }
-		};
-		
-		template<typename Functor>
-		struct SpecificTest : public RunnableTest {
-			SpecificTest(Functor functor, const std::string &name) : RunnableTest(name), _functor(functor)
-			{
-			}
-			virtual void Run()
-			{
-				_functor();
-			}
-			Functor _functor;
-		};
-
-		std::vector<RunnableTest*> _tests;
-		std::string _name;
-		unsigned _successes, _failures;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/test/util/numberparsertest.h b/CEP/DP3/AOFlagger/include/AOFlagger/test/util/numberparsertest.h
deleted file mode 100644
index 6dc17cf96d26b9a9704fb41594959cffbe41d184..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/test/util/numberparsertest.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef AOFLAGGER_NUMBERPARSERTEST_H
-#define AOFLAGGER_NUMBERPARSERTEST_H
-
-#include <AOFlagger/test/testingtools/asserter.h>
-#include <AOFlagger/test/testingtools/unittest.h>
-
-#include <AOFlagger/util/numberparser.h>
-
-class NumberParserTest : public UnitTest {
-	public:
-		NumberParserTest() : UnitTest("Number parser")
-		{
-			AddTest(TestToDouble(), "Parsing double");
-		}
-		
-	private:
-		struct TestToDouble : public Asserter
-		{
-			void operator()();
-		};
-};
-
-inline void NumberParserTest::TestToDouble::operator()()
-{
-	AssertEquals<double>(NumberParser::ToDouble("1"), 1.0);
-	AssertEquals<double>(NumberParser::ToDouble("1."), 1.0);
-	AssertEquals<double>(NumberParser::ToDouble("1.000000"), 1.0);
-	AssertEquals<double>(NumberParser::ToDouble("-1"), -1.0);
-	AssertEquals<double>(NumberParser::ToDouble("-1.00000"), -1.0);
-	
-	AssertEquals<double>(NumberParser::ToDouble("3.14159265"), 3.14159265);
-	AssertEquals<double>(NumberParser::ToDouble("0.00002"), 0.00002);
-	AssertEquals<double>(NumberParser::ToDouble("234567"), 234567.0);
-	AssertEquals<double>(NumberParser::ToDouble("234.567"), 234.567);
-	
-	AssertEquals<double>(NumberParser::ToDouble("0"), 0.0);
-	AssertEquals<double>(NumberParser::ToDouble("0.0"), 0.0);
-	AssertEquals<double>(NumberParser::ToDouble("-0.0"), 0.0);
-	
-	AssertEquals<double>(NumberParser::ToDouble("0.0e5"), 0.0);
-	AssertEquals<double>(NumberParser::ToDouble("0.0e100"), 0.0);
-	AssertEquals<double>(NumberParser::ToDouble("0.0e-100"), 0.0);
-	AssertEquals<double>(NumberParser::ToDouble("0.0E5"), 0.0);
-	AssertEquals<double>(NumberParser::ToDouble("0.0E100"), 0.0);
-	AssertEquals<double>(NumberParser::ToDouble("0.0E-100"), 0.0);
-	
-	AssertAlmostEqual(NumberParser::ToDouble("1.0e5"), 1.0e5);
-	AssertAlmostEqual(NumberParser::ToDouble("1.0e-5"), 1.0e-5);
-	AssertAlmostEqual(NumberParser::ToDouble("0.3e0"), 0.3);
-	AssertAlmostEqual(NumberParser::ToDouble("642.135e8"), 642.135e8);
-}
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/test/util/utiltestgroup.h b/CEP/DP3/AOFlagger/include/AOFlagger/test/util/utiltestgroup.h
deleted file mode 100644
index 3fad2e5debbe542b79a82727dd0f7d52a447f18d..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/test/util/utiltestgroup.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef AOFLAGGER_UTILTESTGROUP_H
-#define AOFLAGGER_UTILTESTGROUP_H
-
-#include <AOFlagger/test/testingtools/testgroup.h>
-
-#include <AOFlagger/test/util/numberparsertest.h>
-
-class UtilTestGroup : public TestGroup {
-	public:
-		UtilTestGroup() : TestGroup("Common utilities") { }
-		
-		virtual void Initialize()
-		{
-			Add(new NumberParserTest());
-		}
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/types.h b/CEP/DP3/AOFlagger/include/AOFlagger/types.h
deleted file mode 100644
index cf12d44b4d23387ff417973a2b5093bafe38c18a..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/types.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#ifndef TYPES_H
-#define TYPES_H
-
-enum Type { ShortType, IntType, FloatType, DoubleType, ComplexType, BoolType };
-
-namespace boost
-{
-  namespace posix_time
-	{
-		class ptime;
-	}
-
-	class mutex;
-}
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/util/aologger.h b/CEP/DP3/AOFlagger/include/AOFlagger/util/aologger.h
deleted file mode 100644
index 7e09c2680b8f899e6663afcf209c1b4978d3e24d..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/util/aologger.h
+++ /dev/null
@@ -1,152 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef AOFLAGGER
-#define AOFLAGGER
-
-#include <lofar_config.h>
-#include <Common/LofarLogger.h>
-
-#include <sstream>
-#include <iostream>
-
-#include <boost/thread/mutex.hpp>
-
-class AOLogger
-{
-	public:
-		enum AOLoggerLevel { NoLevel=5, FatalLevel=4, ErrorLevel=3, WarningLevel=2, InfoLevel=1, DebugLevel=0 };
-
-		template<enum AOLoggerLevel Level, bool ToStdErr=false>
-		class LogWriter
-		{
-			public:
-				LogWriter() : _useLogger(false) { }
-				~LogWriter()
-				{
-					if(_useLogger && _buffer.str().size() != 0)
-						Log(_buffer.str());
-				}
-				LogWriter &operator<<(const std::string &str)
-				{
-					boost::mutex::scoped_lock lock(_mutex);
-					if(_useLogger)
-					{
-						size_t start = 0, end;
-						while(std::string::npos != (end = str.find('\n', start)))
-						{
-							_buffer << str.substr(start, end - start);
-							start = end+1;
-							Log(_buffer.str());
-							_buffer.str(std::string());
-						}
-						_buffer << str.substr(start, str.size() - start);
-					}
-					ToStdOut(str);
-					return *this;
-				}
-				LogWriter &operator<<(const char *str)
-				{
-					(*this) << std::string(str);
-					return *this;
-				}
-				LogWriter &operator<<(const char c)
-				{
-					boost::mutex::scoped_lock lock(_mutex);
-					if(_useLogger)
-					{
-						if(c == '\n')
-						{
-							Log(_buffer.str());
-							_buffer.str(std::string());
-						} else {
-							_buffer << c;
-						}
-					}
-					ToStdOut(c);
-					return *this;
-				}
-				template<typename S>
-				LogWriter &operator<<(const S &str)
-				{
-					boost::mutex::scoped_lock lock(_mutex);
-					if(_useLogger)
-					{
-						_buffer << str;
-					}
-					ToStdOut(str);
-					return *this;
-				}
-				void Flush()
-				{
-					boost::mutex::scoped_lock lock(_mutex);
-					std::cout.flush();
-				}
-				void SetUseLogger(bool useLogger)
-				{
-					boost::mutex::scoped_lock lock(_mutex);
-					_useLogger = useLogger;
-				}
-			private:
-				bool _useLogger;
-				std::stringstream _buffer;
-				boost::mutex _mutex;
-
-				void Log(const std::string &str)
-				{
-					switch(Level)
-					{
-						case NoLevel: break;
-						case DebugLevel:   LOG_DEBUG(str); break;
-						case InfoLevel:    LOG_INFO(str); break;
-						case WarningLevel: LOG_WARN(str); break;
-						case ErrorLevel:   LOG_ERROR(str); break;
-						case FatalLevel:   LOG_FATAL(str); break;
-					}
-				}
-				template<typename S>
-				void ToStdOut(const S &str)
-				{
-					if((int) _coutLevel <= (int) Level)
-					{
-						if(ToStdErr)
-							std::cerr << str;
-						else
-							std::cout << str;
-					}
-				}
-		};
-
-		static void Init(const std::string &name, bool useLogger, bool verbose=false);
-
-		static class LogWriter<DebugLevel> Debug;
-		static class LogWriter<InfoLevel> Info;
-		static class LogWriter<WarningLevel> Warn;
-		static class LogWriter<ErrorLevel> Error;
-		static class LogWriter<FatalLevel> Fatal;
-		static class LogWriter<NoLevel, true> Progress;
-	private:
-		AOLogger()
-		{
-		}
-
-		static enum AOLoggerLevel _coutLevel;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/util/autoarray.h b/CEP/DP3/AOFlagger/include/AOFlagger/util/autoarray.h
deleted file mode 100644
index a7644d3f62c05edfb4d3c78ce7c46a95ba673046..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/util/autoarray.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef AUTO_ARRAY_H
-#define AUTO_ARRAY_H
-
-template<typename T>
-class AutoArray
-{
-	public:
-		AutoArray(T *arrayObject) :
-			_arr(arrayObject)
-		{
-		}
-		
-		~AutoArray()
-		{
-			delete[] _arr;
-		}
-	
-		T *operator->() const
-		{
-			return _arr;
-		}
-		
-		T &operator*() const
-		{
-			return *_arr;
-		}
-	private:
-		T *_arr;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/util/compress.h b/CEP/DP3/AOFlagger/include/AOFlagger/util/compress.h
deleted file mode 100644
index cc188ca5c3b3f5018a21d0285f07469e8d941944..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/util/compress.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef COMPRESS_H
-#define COMPRESS_H
-
-#include <fstream>
-
-#include <AOFlagger/msio/timefrequencydata.h>
-
-class Compress
-{
-	public:
-		Compress(const TimeFrequencyData &data) : _data(data), _isInitialized(false)
-		{
-		}
-		~Compress()
-		{
-			Deinitialize();
-		}
-		void Initialize();
-		void Deinitialize();
-		
-		unsigned long RawSize();
-		unsigned long FlacSize();
-		unsigned long ZipSize();
-		unsigned long GzSize();
-		unsigned long Bz2Size();
-		void AllToStdOut()
-		{
-			RawSize();
-			FlacSize();
-			ZipSize();
-			GzSize();
-			Bz2Size();
-		}
-	private:
-		void ExecuteCmd(const std::string &str);
-
-		const TimeFrequencyData _data;
-		bool _isInitialized;
-
-		unsigned long Size(const std::string &file);
-		void Write(std::ofstream &stream, Image2DCPtr image, Mask2DCPtr mask);
-		void WriteSubtractFrequencies(std::ofstream &stream, Image2DCPtr image, Mask2DCPtr mask);
-		Image2DPtr Read(std::ifstream &stream, Image2DPtr image, Mask2DCPtr mask);
-};
-
-#endif // COMPRESS_H
-
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/util/ffttools.h b/CEP/DP3/AOFlagger/include/AOFlagger/util/ffttools.h
deleted file mode 100644
index 0a918ffcbf0a223f93e3f9d505c8f26a81a3c99e..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/util/ffttools.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2007 by Andre Offringa   *
- *   offringa@gmail.com   *
- *                                                                         *
- *   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.             *
- ***************************************************************************/
-/** @file
- * This is the header file for the FFTTools class.
- * @author André Offringa <offringa@gmail.com>
- */
-#ifndef FFTTOOLS_H
-#define FFTTOOLS_H
-
-#include <AOFlagger/msio/image2d.h>
-#include <AOFlagger/msio/samplerow.h>
-
-/**
- * This is a wrapper around the fftw3 library that is able to calculate fast Fourier transformations.
- */
-class FFTTools{
-	public:
-		/**
-		 * What will be outputted by the FFT method.
-		 */
-		enum FFTOutputMethod {
-			/**
-			 * The transformation to real data.
-			 */
-			Real,
-			/**
-			 * The transformation to imaginary data.
-			 */
-			Imaginary,
-			/**
-			 * The transformation to the absolute value of real and imaginary.
-			 */
-			Absolute,
-			/**
-			 * The transformation to the real and the imaginary data.
-			 */
-			Both
-		};
-		/**
-		 * Create the FFT of an image.
-		 * @param original The original image.
-		 * @param method Which method to use.
-		 * @return A new image that contains the FFT. The caller should @c delete the image when
-		 * it is no longer required.
-		 */
-		static Image2D *CreateFFTImage(const Image2D &original, FFTOutputMethod method);
-		static Image2DPtr CreateFFTImagePtr(Image2DCPtr original, FFTOutputMethod method)
-		{
-			return Image2DPtr(CreateFFTImage(*original, method));
-		}
-		static void CreateFFTImage(const Image2D &real, const Image2D &imaginary, Image2D &realOut, Image2D &imaginaryOut, bool centerAfter=true, bool negate=false);
-		static Image2D *CreateFullImageFromFFT(const Image2D &fft);
-		static Image2D *CreateShiftedImageFromFFT(const Image2D &fft);
-		static Image2D *CreateAbsoluteImage(const Image2D &real, const Image2D &imaginary);
-		static Image2DPtr CreateAbsoluteImage(Image2DCPtr real, Image2DCPtr imaginary)
-		{
-			return Image2DPtr(CreateAbsoluteImage(*real, *imaginary));
-		}
-		static Image2DPtr CreatePhaseImage(Image2DCPtr real, Image2DCPtr imaginary);
-		static void FFTConvolve(const Image2D &realIn, const Image2D &imaginaryIn, const Image2D &realKernel, const Image2D &imaginaryKernel, Image2D &outReal, Image2D &outImaginary);
-		static void FFTConvolveFFTKernel(const Image2D &realIn, const Image2D &imaginaryIn, const Image2D &realFFTKernel, const Image2D &imaginaryFFTKernel, Image2D &outReal, Image2D &outImaginary);
-		static void Multiply(Image2D &left, const Image2D &right); 
-		static void Divide(Image2D &left, const Image2D &right); 
-		static void Multiply(Image2D &leftReal, Image2D &leftImaginary, const Image2D &rightReal, const Image2D &rightImaginary);
-
-		static void Sqrt(Image2D &image);
-		static void Sqrt(Image2DPtr image) { Sqrt(*image); }
-		static void SignedSqrt(Image2D &image);
-		static void SignedSqrt(Image2DPtr image) { SignedSqrt(*image); }
-		
-		static void CreateHorizontalFFTImage(Image2D &real, Image2D &imaginary, bool inverse=false);
-		static void CreateDynamicHorizontalFFTImage(Image2DPtr real, Image2DPtr imaginary, unsigned sections, bool inverse=false);
-		static Image2DPtr AngularTransform(Image2DCPtr input);
-		static void FFT(SampleRowPtr realRow, SampleRowPtr imaginaryRow);
-		//static void FFTConvolve(num_t *realValues, num_t *imagValues, num_t *realKernel, num_t *imagKernel, size_t count);
-	private:
-		FFTTools() { }
-		~FFTTools() { };
-
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/util/integerdomain.h b/CEP/DP3/AOFlagger/include/AOFlagger/util/integerdomain.h
deleted file mode 100644
index f574115accdc028920032953c734ae82e6d12c27..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/util/integerdomain.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef INTEGERDOMAIN_H
-#define INTEGERDOMAIN_H
-
-#include <vector>
-#include <string>
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class IntegerDomain {
-	public:
-		IntegerDomain(const IntegerDomain &source);
-		IntegerDomain(int singleValue);
-		IntegerDomain(const int *values, unsigned count);
-		IntegerDomain(int first, unsigned count);
-		IntegerDomain(int first, unsigned step, unsigned count);
-		explicit IntegerDomain(const std::string &str);
-		~IntegerDomain() { }
-		unsigned ValueCount() const throw() { return _values.size(); }
-		int GetValue(unsigned index) const throw() { return _values[index]; }
-		void Join(const IntegerDomain &other) throw();
-		bool IsIn(int number) const throw() {
-			for(std::vector<int>::const_iterator i=_values.begin();	i!=_values.end();++i) {
-				if(*i == number) return true;
-			}
-			return false;
-		}
-		IntegerDomain Split(unsigned partCount, unsigned partIndex) const;
-		unsigned Index(int number) const throw() {
-			for(unsigned i=0;	i!=_values.size();++i) {
-				if(_values[i] == number) return i;
-			}
-			return -1;
-		}
-	private:
-		std::vector<int> _values;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/util/lane.h b/CEP/DP3/AOFlagger/include/AOFlagger/util/lane.h
deleted file mode 100644
index effa9ef4ddda42bc8bc05a14b1c40baa411f6d96..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/util/lane.h
+++ /dev/null
@@ -1,201 +0,0 @@
-#ifndef LANE_H
-#define LANE_H
-
-#include <cstring>
-#include <deque>
-
-#include <boost/thread/mutex.hpp>
-#include <boost/thread/condition.hpp>
-
-template<typename T>
-class lane : public boost::noncopyable
-{
-	public:
-		typedef T data_type;
-		
-		lane(size_t capacity)
-		:
-			_capacity(capacity),
-			_buffer(new T[capacity]),
-			_write_position(0),
-			_free_write_space(_capacity),
-			_status(status_normal)
-		{
-		}
-		
-		~lane()
-		{
-			delete[] _buffer;
-		}
-		
-		void write(const data_type &element)
-		{
-			write(&element, 1);
-		}
-		
-		void write(const data_type *elements, size_t n)
-		{
-			boost::mutex::scoped_lock lock(_mutex);
-			
-			if(_status == status_normal)
-			{
-				size_t write_size = _free_write_space > n ? n : _free_write_space;
-				immediate_write(elements, write_size);
-				n -= write_size;
-				
-				while(n != 0) {
-					elements += write_size;
-				
-					do {
-						_has_work_condition.wait(lock);
-					} while(_free_write_space == 0 && _status == status_normal);
-					
-					write_size = _free_write_space > n ? n : _free_write_space;
-					immediate_write(elements, write_size);
-					n -= write_size;
-				} while(n != 0);
-			}
-		}
-		
-		bool read(data_type &destination)
-		{
-			return read(&destination, 1) == 1;
-		}
-		
-		size_t read(data_type *destinations, size_t n)
-		{
-			size_t n_left = n;
-			
-			boost::mutex::scoped_lock lock(_mutex);
-			
-			size_t free_space = free_read_space();
-			size_t read_size = free_space > n ? n : free_space;
-			immediate_read(destinations, read_size);
-			n_left -= read_size;
-			
-			while(n_left != 0 && _status == status_normal)
-			{
-				destinations += read_size;
-				
-				do {
-					_has_work_condition.wait(lock);
-				} while(free_read_space() == 0 && _status == status_normal);
-				
-				free_space = free_read_space();
-				read_size = free_space > n_left ? n_left : free_space;
-				immediate_read(destinations, read_size);
-				n_left -= read_size;
-			}
-			return n - n_left;
-		}
-		
-		void write_end()
-		{
-			_status = status_end;
-			_has_work_condition.notify_all();
-		}
-		
-		size_t capacity() const
-		{
-			return _capacity;
-		}
-		
-		size_t size() const
-		{
-			boost::mutex::scoped_lock lock(_mutex);
-			return _capacity - _free_write_space;
-		}
-	private:
-		const size_t _capacity;
-		
-		T *_buffer;
-		
-		mutable boost::mutex _mutex;
-		
-		boost::condition _has_work_condition;
-		
-		size_t _write_position;
-		
-		size_t _free_write_space;
-		
-		enum { status_normal, status_end } _status;
-		
-		size_t read_position() const
-		{
-			return (_write_position + _free_write_space) % _capacity;
-		}
-		
-		size_t free_read_space() const
-		{
-			return _capacity - _free_write_space;
-		}
-		
-		void immediate_write(const data_type *elements, size_t n)
-		{
-			// Split the writing in two ranges if needed. The first range fits in
-			// [_write_position, _capacity), the second range in [0, end). By doing
-			// so, we only have to calculate the modulo in the write position once.
-			if(n > 0)
-			{
-				size_t nPart;
-				if(_write_position + n > _capacity)
-				{
-					nPart = _capacity - _write_position;
-				} else {
-					nPart = n;
-				}
-				for(size_t i = 0; i < nPart ; ++i, ++_write_position)
-				{
-					_buffer[_write_position] = elements[i];
-				}
-				
-				_write_position = _write_position % _capacity;
-				
-				for(size_t i = nPart; i < n ; ++i, ++_write_position)
-				{
-					_buffer[_write_position] = elements[i];
-				}
-				
-				_free_write_space -= n;
-				
-				// Now that there is less free write space, there is more free read
-				// space and thus readers can possibly continue.
-				_has_work_condition.notify_all();
-			}
-		}
-		
-		void immediate_read(data_type *elements, size_t n)
-		{
-			// As with write, split in two ranges if needed. The first range fits in
-			// [read_position(), _capacity), the second range in [0, end).
-			if(n > 0)
-			{
-				size_t nPart;
-				size_t position = read_position();
-				if(position + n > _capacity)
-				{
-					nPart = _capacity - position;
-				} else {
-					nPart = n;
-				}
-				for(size_t i = 0; i < nPart ; ++i, ++position)
-				{
-					elements[i] = _buffer[position];
-				}
-				
-				position = position % _capacity;
-				
-				for(size_t i = nPart; i < n ; ++i, ++position)
-				{
-					elements[i] = _buffer[position];
-				}
-				
-				_free_write_space += n;
-				
-				// Now that there is more free write space, writers can possibly continue.
-				_has_work_condition.notify_all();
-			}
-		}
-};
-
-#endif // LANE_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/util/multiplot.h b/CEP/DP3/AOFlagger/include/AOFlagger/util/multiplot.h
deleted file mode 100644
index db50d4cdce07feae75ca5ce12ba49d40be144614..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/util/multiplot.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef MULTIPLOT_H
-#define MULTIPLOT_H
-
-#include "plot.h"
-
-#include "../msio/types.h"
-
-#include <vector>
-
-#include <AOFlagger/gui/plot/plotmanager.h>
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class MultiPlot {
-	public:
-		MultiPlot(Plot2D &plot, size_t plotCount);
-		~MultiPlot();
-
-		void AddPoint(size_t plotIndex, num_t x, num_t y)
-		{
-			_points[plotIndex]->push_back(Point(x, y));
-		}
-		void SetLegend(int index, const std::string &title)
-		{
-			_legends[index] = title;
-		}
-		void Finish();
-		Plot2D &Plot() { return _plot; }
-		void SetXAxisText(const std::string text)
-		{
-			_xAxisText = text;
-		}
-		void SetYAxisText(const std::string text)
-		{
-			_yAxisText = text;
-		}
-	private:
-		struct Point {
-			Point(num_t _x, num_t _y) : x(_x), y(_y) { } 
-			num_t x, y;
-		};
-		typedef std::vector<struct Point> PointList;
-		std::string *_legends;
-		PointList **_points;
-		size_t _plotCount;
-		Plot2D &_plot;
-		std::string _xAxisText, _yAxisText;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/util/numberparser.h b/CEP/DP3/AOFlagger/include/AOFlagger/util/numberparser.h
deleted file mode 100644
index 14d7ef5d1be217b079e1baa86fab416cfc686ec6..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/util/numberparser.h
+++ /dev/null
@@ -1,197 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2012 by A.R. Offringa                                   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#include <stdexcept>
-
-#include <cmath>
-
-//# pow10 seems to be undefined on OS-X
-#ifdef __APPLE__
-# define pow10(x) pow(10., (x))
-#endif
-
-
-class NumberParsingException : public std::runtime_error
-{
-	public:
-  explicit NumberParsingException(const std::string &str)
-	: std::runtime_error(std::string("Failed to parse number: ") + str)
-	{
-	}
-};
-
-/**
- * This class implements functions that copy the behaviour of atof and strtod, etc.
- * Unfortunately, atof are locale-dependent and e.g. a Dutch machine will interpret
- * a decimal point differently. This is undesirable, hence the reimplementation here.
- */
-class NumberParser
-{
-	public:
-		/**
-		 * @throws NumberParsingException when @c str can not be parsed.
-		 */
-		static double ToDouble(const char *str)
-		{
-			return toNumber<double>(str);
-		}
-		
-		/**
-		 * @throws NumberParsingException when @c str can not be parsed.
-		 */
-		static short ToShort(const char *str)
-		{
-			return toSignedInteger<short>(str);
-		}
-	private:
-		/**
-		 * @throws NumberParsingException when @c str can not be parsed.
-		 */
-		template<typename T>
-		static T toNumber(const char *str)
-		{
-			if(*str == 0)
-				throw NumberParsingException("Supplied string is empty");
-			
-			// Read optional sign
-			bool isNegative;
-			if(isNegativeSymbol(*str)) { isNegative = true; ++str; }
-			else if(isPositiveSymbol(*str)) { isNegative = false; ++str; }
-			else isNegative = false;
-			
-			// Read everything before decimal point
-			if(!isDigit(*str))
-				throw NumberParsingException("Number did not start with digits after optional sign symbol");
-			T val = (T) ((*str) - '0');
-			++str;
-			
-			while(isDigit(*str))
-			{
-				val = val*10.0 + (T) ((*str) - '0');
-				++str;
-			}
-			
-			// Skip decimal point if given
-			if(isDecimalPoint(*str)) ++str;
-			
-			// Read decimals
-			T currentValue = 0.1;
-			while(isDigit(*str))
-			{
-				val += currentValue * (T) ((*str) - '0');
-				currentValue /= 10.0;
-				++str;
-			}
-			
-			// Read optional exponent
-			if(isExponentSymbol(*str))
-			{
-				++str;
-				
-				try {
-					short e = ToShort(str);
-					val = val * intPow10(e);
-				} catch(NumberParsingException &e)
-				{
-					throw NumberParsingException("Could not parse exponent");
-				}
-			}
-			// If there was an exponent, ToShort has checked for garbage at the end and
-			// str is not updated, otherwise we still need to check that...
-			else if(*str != 0)
-				throw NumberParsingException("The number contains invalid characters after its digits");
-			
-			if(isNegative)
-				return -val;
-			else
-				return val;
-		}
-		
-		/**
-		 * @throws NumberParsingException when @c str can not be parsed.
-		 */
-		template<typename T>
-		static T toSignedInteger(const char *str)
-		{
-			if(*str == 0)
-				throw NumberParsingException("Supplied string is empty");
-			
-			// Read optional sign
-			bool isNegative;
-			if(isNegativeSymbol(*str)) { isNegative = true; ++str; }
-			else if(isPositiveSymbol(*str)) { isNegative = false; ++str; }
-			else isNegative = false;
-			
-			// Read digits
-			if(!isDigit(*str))
-				throw NumberParsingException("Integer did not start with digits after optional sign symbol");
-			T val = (T) ((*str) - '0');
-			++str;
-			
-			while(isDigit(*str))
-			{
-				val = val*10 + (T) ((*str) - '0');
-				++str;
-			}
-			
-			// Check if str is completely read.
-			if(*str == 0)
-			{
-				if(isNegative)
-					return -val;
-				else
-					return val;
-			}
-			else
-				throw NumberParsingException("The integer contains invalid characters after its digits");
-		}
-		
-		static double intPow10(int par)
-		{
-			// TODO this can be done a lot faster and more accurate with knowledge that
-			// par = int.
-			return pow10((double) par);
-		}
-		
-		static bool isDigit(char c)
-		{
-			return c >= '0' && c <= '9';
-		}
-		
-		static bool isPositiveSymbol(char c)
-		{
-			return c == '+';
-		}
-		
-		static bool isNegativeSymbol(char c)
-		{
-			return c == '-';
-		}
-		
-		static bool isDecimalPoint(char c)
-		{
-			return c == '.';
-		}
-		
-		static bool isExponentSymbol(char c)
-		{
-			return c == 'e' || c == 'E';
-		}
-};
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/util/parameter.h b/CEP/DP3/AOFlagger/include/AOFlagger/util/parameter.h
deleted file mode 100644
index 495971c8706bde5ae0e3b5f052875f2483f6e9ca..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/util/parameter.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#ifndef PARAMETER_H
-#define PARAMETER_H
-
-#include <stdexcept>
-
-template<typename T>
-class Parameter {
-	public:
-		Parameter() : _isSet(false), _value() { }
-		Parameter(const T val) : _isSet(true), _value(val) { }
-		Parameter(const Parameter<T> &source)
-			: _isSet(source._isSet), _value(source._value) { }
-
-		Parameter &operator=(const Parameter<T> &source)
-		{
-			_isSet = source._isSet;
-			_value = source._value;
-		}
-
-		Parameter &operator=(T val)
-		{
-			_isSet = true;
-			_value = val;
-			return *this;
-		}
-		bool IsSet() const { return _isSet; }
-
-		operator T() const
-		{
-			return Value();
-		}
-
-		T Value() const
-		{
-			if(_isSet)
-				return _value;
-			else
-				throw std::runtime_error("Trying to access unset parameter");
-		}
-
-		T Value(T defaultValue) const
-		{
-			if(_isSet)
-				return _value;
-			else
-				return defaultValue;
-		}
-	private:
-		bool _isSet;
-		T _value;
-};
-
-#endif //PARAMETER_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/util/plot.h b/CEP/DP3/AOFlagger/include/AOFlagger/util/plot.h
deleted file mode 100644
index 76fccefc8f5e165d02c397978562fddc55738e9c..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/util/plot.h
+++ /dev/null
@@ -1,146 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef PLOT_H
-#define PLOT_H
-
-#include <unistd.h>
-
-#include <stdexcept>
-#include <string>
-#include <vector>
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class Plot {
-	public:
-		Plot(const std::string &pdfFile);
-		~Plot();
-		void StartLine() { StartLine(""); }
-		void StartLine(const std::string &lineTitle);
-		void StartScatter() { StartScatter(""); }
-		void StartScatter(const std::string &lineTitle);
-		void StartBoxes() { StartScatter(""); }
-		void StartBoxes(const std::string &lineTitle);
-		void StartGrid() { StartGrid(""); }
-		void StartGrid(const std::string &gridTitle);
-		void PushDataPoint(long double x, long double y);
-		void PushDataPoint(long double x, long double y, long double z);
-		void PushUnknownDataPoint(long double x, long double y);
-		void PushDataBlockEnd();
-		void Close();
-		void AddRectangle(long double x1, double y1, double x2, double y2);
-		void SetTitle(const std::string &title) throw() { _title = title; }
-		void SetXAxisText(const std::string &text) throw() { _xAxisText = text; }
-		void SetYAxisText(const std::string &text) throw() { _yAxisText = text; }
-		void SetZAxisText(const std::string &text) throw() { _zAxisText = text; }
-		void SetXRange(long double min, long double max) throw() {
-			_xRangeHasMin = true; _xRangeHasMax = true;
-			_xRangeMin = min; _xRangeMax = max;
-		}
-		void SetXRangeAutoMax(long double min) throw() {
-			_xRangeHasMin = true; _xRangeHasMax = false;
-			_xRangeMin = min;
-		}
-		void SetXRangeAutoMin(long double max) throw() {
-			_xRangeHasMin = false; _xRangeHasMax = true;
-			_xRangeMax = max;
-		}
-		void SetXRangeAuto() throw() {
-			_xRangeHasMin = false; _xRangeHasMax = false;
-		}
-		void SetYRange(long double min, long double max) throw() {
-			if(_yRangeHasMin) {
-				if(min < _yRangeMin) _yRangeMin = min; 
-			} else {
-			_yRangeHasMin = true;
-			_yRangeMin = min;
-			}
-			if(_yRangeHasMax) {
-				if(max > _yRangeMax) _yRangeMax = max; 
-			} else {
-				_yRangeHasMax = true;
-				_yRangeMax = max;
-			}
-		}
-		void SetYRangeAutoMax(long double min) throw() {
-			_yRangeHasMin = true; _yRangeHasMax = false;
-			_yRangeMin = min;
-		}
-		void SetYRangeAutoMin(long double max) throw() {
-			_yRangeHasMin = false; _yRangeHasMax = true;
-			_yRangeMax = max;
-		}
-		void SetYRangeAuto() throw() {
-			_yRangeHasMin = false; _yRangeHasMax = false;
-		}
-		void SetZRange(long double min, long double max) throw() {
-			_zRangeHasMin = true; _zRangeHasMax = true;
-			_zRangeMin = min; _zRangeMax = max;
-		}
-		void SetCBRange(long double min, long double max) throw() {
-			_cbRangeHasMin = true; _cbRangeHasMax = true;
-			_cbRangeMin = min; _cbRangeMax = max;
-		}
-		void SetLogScale(bool x, bool y, bool z=false)
-		{
-			_logX = x;
-			_logY = y;
-			_logZ = z;
-		}
-		void SetFontSize(size_t newSize)
-		{
-			_fontSize = newSize;
-		}
-		void Show();
-	private:
-		enum Type { Line, Scatter, Boxes, Grid } _curType;
-		void RunGnuplot();
-		char _tmpPlotFile[16];
-		void Write(int fd, const std::string &str)
-		{
-			if(write(fd, str.c_str(), str.length()) != (int) str.length())
-				throw std::runtime_error("write() reported an error");
-		}
-		void CloseCurFd();
-		void ExecuteCmd(const std::string &cmd) const;
-		std::vector<std::string> _lineFiles, _lineTitles;
-		std::vector<Type> _lineTypes;
-
-		int _curLineFd;
-		const std::string _pdfFile;
-		bool _open;
-		std::string _title, _xAxisText, _yAxisText, _zAxisText;
-		bool _xRangeHasMin, _xRangeHasMax;
-		bool _yRangeHasMin, _yRangeHasMax;
-		bool _zRangeHasMin, _zRangeHasMax;
-		bool _cbRangeHasMin, _cbRangeHasMax;
-		long double _xRangeMin, _xRangeMax;
-		long double _yRangeMin, _yRangeMax;
-		long double _zRangeMin, _zRangeMax;
-		long double _cbRangeMin, _cbRangeMax;
-		bool _clipZ;
-		std::vector<std::string> _extraHeaders;
-		
-		bool _logX, _logY, _logZ;
-		bool _hasBoxes;
-		size_t _fontSize;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/util/progresslistener.h b/CEP/DP3/AOFlagger/include/AOFlagger/util/progresslistener.h
deleted file mode 100644
index db1c7cc433458ed85afa1310458a4b53305a2046..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/util/progresslistener.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef PROGRESSLISTENER_H
-#define PROGRESSLISTENER_H
-
-#include <string>
-#include <vector>
-
-#include <AOFlagger/strategy/control/types.h>
-
-class ProgressListener
-{
-	private:
-		std::vector<size_t> _totals, _progresses, _weights;
-		double _taskProgress;
-	protected:
-		double TotalProgress()
-		{
-			double part = 1.0, total = 0.0;
-			for(size_t i=0;i<_totals.size();++i)
-			{
-				total += part * (double) _weights[i] * (double) _progresses[i] / (double) _totals[i];
-				
-				part *= (double) _weights[i] / (double) _totals[i];
-			}
-			total += part * _taskProgress;
-			if(total < 0.0)
-				return 0.0;
-			else if(total > 1.0)
-				return 1.0;
-			else
-				return total;
-		}
-		size_t Depth() const { return _totals.size(); }
-	public:
-		ProgressListener() { }
-		virtual ~ProgressListener() { }
-
-		inline virtual void OnStartTask(const rfiStrategy::Action &action, size_t taskNo, size_t taskCount, const std::string &/*description*/, size_t weight = 1);
-		
-		/**
-		 * Signifies the end of the current task. It's not allowed to call OnProgress() after a call
-		 * to OnEndTask() until a new task has been started with OnStartTask().
-		 */
-		inline virtual void OnEndTask(const rfiStrategy::Action &action);
-
-		inline virtual void OnProgress(const rfiStrategy::Action &action, size_t progress, size_t maxProgress);
-
-		virtual void OnException(const rfiStrategy::Action &action, std::exception &thrownException) = 0;
-};
-
-class DummyProgressListener : public ProgressListener {
-  virtual void OnStartTask(const rfiStrategy::Action &, size_t, size_t, const std::string &, size_t = 1)
-    {}
-  virtual void OnEndTask(const rfiStrategy::Action &)
-    {}
-  virtual void OnProgress(const rfiStrategy::Action &, size_t, size_t)
-    {}
-  virtual void OnException(const rfiStrategy::Action &, std::exception &)
-    {}
-};
-
-#include <AOFlagger/strategy/actions/action.h>
-
-void ProgressListener::OnStartTask(const rfiStrategy::Action &, size_t taskNo, size_t taskCount, const std::string &/*description*/, size_t weight)
-{
-	_totals.push_back(taskCount);
-	_progresses.push_back(taskNo);
-	_weights.push_back(weight);
-	_taskProgress = 0.0;
-}
-
-void ProgressListener::OnEndTask(const rfiStrategy::Action &)
-{
-	_totals.pop_back();
-	_progresses.pop_back();
-	_weights.pop_back();
-	_taskProgress = 1.0;
-}
-
-void ProgressListener::OnProgress(const rfiStrategy::Action &, size_t progress, size_t maxProgress)
-{
-	_taskProgress = (double) progress / maxProgress;
-}
-
-#endif // PROGRESSLISTENER_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/util/rng.h b/CEP/DP3/AOFlagger/include/AOFlagger/util/rng.h
deleted file mode 100644
index 755182bcb7c43e6c115df06283ea7a3b06ea1593..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/util/rng.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef RNG_H
-#define RNG_H
-
-#include <AOFlagger/msio/types.h>
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class RNG{
-	public:
-		static double Gaussian();
-		static double GaussianProduct();
-		static double GaussianPartialProduct();
-		static double GaussianComplex();
-		static double Rayleigh();
-		static double Uniform();
-		static double EvaluateRayleigh(double x, double sigmaSquared);
-		static long double EvaluateGaussian(long double x, long double sigmaSquared);
-		static double EvaluateUnnormalizedGaussian(double x, double sigmaSquared);
-		static double EvaluateGaussian(double x, double sigmaSquared);
-		static double EvaluateGaussian2D(long double x1, long double x2, long double sigmaX1, long double sigmaX2);
-		static double IntegrateGaussian(long double upperLimit);
-		static void DoubleGaussian(long double &a, long double &b);
-		static void ComplexGaussianAmplitude(num_t &r, num_t &i);
-	private: 
-		RNG();
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/util/roctree.h b/CEP/DP3/AOFlagger/include/AOFlagger/util/roctree.h
deleted file mode 100644
index bc64d96f7b5ecf161b7a959381ab3faa786c7f4c..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/util/roctree.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef ROCTREE_H
-#define ROCTREE_H
-
-#include <fstream>
-#include <string>
-
-class ROCTreeClassifier {
-public:
-	virtual void Perform(long double &falseRatio, long double &trueRatio, long double parameter) = 0;
-	virtual ~ROCTreeClassifier() { }
-};
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class ROCTree {
-	public:
-		ROCTree(long double parameterRootValue, ROCTreeClassifier &classifier);
-		~ROCTree();
-		void Find(long double falseRatioValue, long double falseRatioPrecision, long double &actualFalseRatioValue, long double &trueRatioValue)
-		{
-			ROCTreeNode *node = Find(falseRatioValue, falseRatioPrecision);
-			actualFalseRatioValue = node->falseRatio;
-			trueRatioValue = node->trueRatio;
-		}
-		void Save(const std::string &filename); 
-	private:
-		struct ROCTreeNode {
-			long double falseRatio, trueRatio, parameter;
-			ROCTreeNode *left, *right;
-		} *_tree;
-		long double _parameterRootValue;
-		ROCTreeClassifier &_classifier;
-
-		ROCTreeNode *Find(long double falseRatioValue, long double falseRatioPrecision)
-		{
-			return Find(&_tree, _parameterRootValue, _parameterRootValue/2.0L, falseRatioValue, falseRatioPrecision, 0);
-		}
-		ROCTreeNode *Find(ROCTreeNode **node, long double parameter, long double stepSize, long double falseRatioValue, long double falseRatioPrecision, int depth);
-
-		void SaveNode(std::ofstream &file, ROCTreeNode &node);
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/util/serializable.h b/CEP/DP3/AOFlagger/include/AOFlagger/util/serializable.h
deleted file mode 100644
index 5ba215cfbe14016b6df5d80902b086e762fcd339..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/util/serializable.h
+++ /dev/null
@@ -1,125 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef SERIALIZABLE_H
-#define SERIALIZABLE_H
-
-#include <iostream>
-#include <complex>
-
-#include <stdint.h>
-
-class Serializable
-{
-	public:
-		virtual ~Serializable()
-		{
-		}
-		virtual void Serialize(std::ostream &stream) const = 0;
-		virtual void Unserialize(std::istream &stream) = 0;
-		
-		template<typename T>
-		static void SerializeToUInt64(std::ostream &stream, T value)
-		{
-			uint64_t val64t = value;
-			stream.write(reinterpret_cast<char *>(&val64t), sizeof(val64t));
-		}
-		
-		template<typename T>
-		static void SerializeToUInt32(std::ostream &stream, T value)
-		{
-			uint32_t val32t = value;
-			stream.write(reinterpret_cast<char *>(&val32t), sizeof(val32t));
-		}
-		
-		static void SerializeToFloat(std::ostream &stream, float value)
-		{
-			stream.write(reinterpret_cast<char *>(&value), sizeof(value));
-		}
-		
-		static void SerializeToDouble(std::ostream &stream, double value)
-		{
-			stream.write(reinterpret_cast<char *>(&value), sizeof(value));
-		}
-		
-		static void SerializeToLDouble(std::ostream &stream, long double value)
-		{
-			stream.write(reinterpret_cast<char *>(&value), sizeof(value));
-		}
-		
-		static void SerializeToLDoubleC(std::ostream &stream, std::complex<long double> value)
-		{
-			stream.write(reinterpret_cast<char *>(&value), sizeof(value));
-		}
-		
-		static void SerializeToString(std::ostream &stream, const std::string &str)
-		{
-			SerializeToUInt64(stream, str.size());
-			stream.write(str.c_str(), str.size());
-		}
-		
-		static uint64_t UnserializeUInt64(std::istream &stream)
-		{
-			return Unserialize<uint64_t>(stream);
-		}
-		
-		static uint32_t UnserializeUInt32(std::istream &stream)
-		{
-			return Unserialize<uint32_t>(stream);
-		}
-		
-		static double UnserializeFloat(std::istream &stream)
-		{
-			return Unserialize<float>(stream);
-		}
-
-		static double UnserializeDouble(std::istream &stream)
-		{
-			return Unserialize<double>(stream);
-		}
-
-		static long double UnserializeLDouble(std::istream &stream)
-		{
-			return Unserialize<long double>(stream);
-		}
-		
-		static std::complex<long double> UnserializeLDoubleC(std::istream &stream)
-		{
-			return Unserialize<std::complex<long double> >(stream);
-		}
-		
-		static void UnserializeString(std::istream &stream, std::string &destStr)
-		{
-			size_t size = UnserializeUInt64(stream);
-			char *str = new char[size];
-			stream.read(str, size);
-			destStr = std::string(str, size);
-			delete[] str;
-		}
-	private:
-		template<typename T>
-		static T Unserialize(std::istream &stream)
-		{
-			T val;
-			stream.read(reinterpret_cast<char *>(&val), sizeof(val));
-			return val;
-		}
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/util/statwriter.h b/CEP/DP3/AOFlagger/include/AOFlagger/util/statwriter.h
deleted file mode 100644
index 6e039f48f95a64694cd33722c606bd9431d5b0c6..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/util/statwriter.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef STATWRITER_H
-#define STATWRITER_H
-
-#include <vector>
-#include <string>
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class StatWriter {
-	public:
-		StatWriter(const std::string &baseName);
-		~StatWriter();
-
-		void SetValue(long double value);
-		void SetValue(long double value, unsigned significantDigits)
-		{
-			SetValue(Format(value, significantDigits));
-		}
-
-		void NewMethod(const std::string &name) {
-			if(!_lastActionWasNewMethod) {
-				_newMethodsStart = _methods.size();
-				_activeColumn = _methods.size();
-				_activeRow = 0;
-				_lastActionWasNewMethod = true;
-			}
-			_methods.push_back(name);
-			AddColumn();
-		}
-
-		void NextMethod() throw() {
-			_activeColumn++;
-			_lastActionWasNewMethod = false;
-			if(_activeColumn >= _methods.size())
-			{
-				_activeColumn = _newMethodsStart;
-				_activeRow++;
-			}
-		}
-		void NextMeasurement() throw() { _activeRow++; _activeRow=_newMethodsStart; }
-		void Save();
-		void SetValueInc(long double value) { SetValue(value); NextMethod(); }
-		void SetValueInc(long double value, unsigned significantDigits) { SetValue(value, significantDigits); NextMethod(); }
-	private:
-		void MakeAccessable(unsigned /*column*/, unsigned row)
-		{
-			//while(column >= _width)
-			//	AddColumn();
-			while(row >= _height)
-				AddRow();
-		}
-		void AddColumn();
-		void AddRow();
-		long double Format(long double value, unsigned significantDigits);
-
-		const std::string _baseFilename;
-		std::vector<std::string> _methods;
-		std::vector<std::vector<long double> *> _table;
-		unsigned _activeColumn;
-		unsigned _activeRow;
-		unsigned _width, _height;
-		unsigned _writeCount;
-		unsigned _lazyWriteWait;
-		unsigned _newMethodsStart;
-		bool _lastActionWasNewMethod;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/util/stopwatch.h b/CEP/DP3/AOFlagger/include/AOFlagger/util/stopwatch.h
deleted file mode 100644
index 2fede8fbbf5a7ac3f760419740d17585feebd01e..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/util/stopwatch.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef STOPWATCH_H
-#define STOPWATCH_H
-
-#include <boost/date_time/posix_time/posix_time_types.hpp>
-
-#include <string>
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class Stopwatch{
-	public:
-		Stopwatch();
-		Stopwatch(bool start);
-		~Stopwatch();
-		void Start();
-		void Pause();
-		void Reset();
-
-		std::string ToString() const;
-		std::string ToShortString() const;
-		long double Seconds() const;
-		
-		std::string ToDaysString() const;
-		std::string ToHoursString() const;
-		std::string ToMinutesString() const;
-		std::string ToSecondsString() const;
-		std::string ToMilliSecondsString() const;
-		std::string ToMicroSecondsString() const;
-		std::string ToNanoSecondsString() const;
-	private:
-		bool _running;
-		boost::posix_time::ptime _startTime;
-		boost::posix_time::time_duration _sum;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/util/types.h b/CEP/DP3/AOFlagger/include/AOFlagger/util/types.h
deleted file mode 100644
index 21ccf07921b6d499933e2be92dacfe6a165d25b1..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/util/types.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#ifndef UTIL_TYPES_H
-#define UTIL_TYPES_H
-
-class ProgressListener;
-
-#endif // UTIL_TYPES_H
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/util/xmlwriter.h b/CEP/DP3/AOFlagger/include/AOFlagger/util/xmlwriter.h
deleted file mode 100644
index 3eca5b86c3c2f53498c2b8dcc679785872941a2d..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/util/xmlwriter.h
+++ /dev/null
@@ -1,164 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#ifndef XMLWRITER_H
-#define XMLWRITER_H
-
-#include <fstream>
-#include <string>
-#include <stack>
-
-/**
-	@author A.R. Offringa <offringa@astro.rug.nl>
-*/
-class XmlWriter {
-	public:
-		XmlWriter() : _file(0), _stream(0)
-		{
-		}
-
-		~XmlWriter()
-		{
-			Close();
-		}
-
-		void Close()
-		{
-			if(_file != 0)
-			{
-				while(_openedElements.size() != 0)
-					Close();
-				delete _file;
-				_file = 0;
-			}
-		}
-
-		void StartDocument(const std::string &filename)
-		{
-			Close();
-			_file = new std::ofstream(filename.c_str());
-			_stream = _file;
-			startDocument();
-		}
-
-		void StartDocument(std::ostream &stream)
-		{
-			Close();
-			_stream = &stream;
-			startDocument();
-		}
-
-		void Comment(const char *comment)
-		{
-			startNewTag();
-
-			(*_stream) << "<!-- " << comment << "-->";
-		}
-
-		void Start(const char *element)
-		{
-			startNewTag();
-
-			(*_stream) << '<' << element;
-			_inTag = true;
-			_tagHasData = false;
-			_openedElements.push(element);
-		}
-
-		void End()
-		{
-			if(_openedElements.size() == 0)
-				throw std::runtime_error("End() called without open element");
-			if(_inTag)
-				(*_stream) << " />";
-			else {
-				(*_stream) << '\n';
-				indent(_openedElements.size()-1);
-				(*_stream) << "</" << _openedElements.top() << '>';
-			}
-			_openedElements.pop();
-			_inTag = false;
-		}
-
-		void Attribute(const char *attributeName, const char *value)
-		{ 
-			if(!_inTag)
-				throw std::runtime_error("Attribute() called incorrectly");
-			(*_stream) << ' ' << attributeName << "=\"" << value << "\"";
-		}
-
-		template<typename ValueType>
-		void Attribute(const char *attributeName, ValueType value)
-		{ 
-			std::stringstream s;
-			s << value;
-			Attribute(attributeName, s.str().c_str());
-		}
-
-		void Write(const char *element, const char *value)
-		{
-			startNewTag();
-
-			(*_stream) << '<' << element << '>' << value << "</" << element << '>';
-		}
-
-		template<typename ValueType>
-		void Write(const char *element, ValueType value)
-		{
-			std::stringstream s;
-			s << value;
-			Write(element, s.str().c_str());
-		}
-
-	private:
-		void startDocument()
-		{
-			(*_stream) << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
-			_inTag = false;
-		}
-		void closeTag()
-		{
-			if(_inTag)
-			{
-				(*_stream) << '>';
-				_inTag = false;
-			}
-		}
-		void startNewTag()
-		{
-			closeTag();
-			(*_stream) << '\n';
-			indent(_openedElements.size());
-		}
-
-		void indent(unsigned depth)
-		{
-			for(unsigned i=0;i<depth;++i)
-				(*_stream) << ' ' << ' ';
-		}
-
-		std::stack<std::string> _openedElements;
-
-		std::ofstream *_file;
-		std::ostream *_stream;
-		bool _inTag;
-		bool _tagHasData;
-};
-
-#endif
diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/vectortypes.h b/CEP/DP3/AOFlagger/include/AOFlagger/vectortypes.h
deleted file mode 100644
index c216afe36fda86549984286a46a7910f802181ff..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/include/AOFlagger/vectortypes.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#include "types.h"
-
-#include <vector>
-
-typedef std::vector<Type> TypeVector;
-typedef std::vector< std::string > StringVector;
-typedef std::vector<class Value*> ValueVector;
diff --git a/CEP/DP3/AOFlagger/package.dox b/CEP/DP3/AOFlagger/package.dox
deleted file mode 100644
index 64aa22a7128f82a263c31d9eb1348387d729710d..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/package.dox
+++ /dev/null
@@ -1,20 +0,0 @@
-// \ingroup DP3
-//
-// \defgroup AOFlagger AOFlagger
-//
-// The AOFlagger is a flagger framework that implements several
-// methods to deal with RFI, amongst which the SumThreshold method,
-// background fitting techniques (smoothing, sliding window, median)
-// filters and dilations.
-//
-// The package contains several programs related to flagging,
-// most important the programs "rficonsole" and "rfigui". The
-// @ref NDPPP package depends on the AOFlagger package, so that
-// it can use the AOFlagger before averaging.
-// 
-// See the <a href="http://www.astron.nl/radio-observatory/lofar/lofar-imaging-cookbook">LOFAR cookbook</a>
-// for general info about running the flagger.
-// 
-// @{
-//   \defgroup AOFlagger AOFlagger
-// @}
diff --git a/CEP/DP3/AOFlagger/scripts/CMakeLists-AOFlagger-without-lofarstman.txt b/CEP/DP3/AOFlagger/scripts/CMakeLists-AOFlagger-without-lofarstman.txt
deleted file mode 100644
index de316aebeb35d1273bc12b6cd067d0daf9f7a6d1..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/scripts/CMakeLists-AOFlagger-without-lofarstman.txt
+++ /dev/null
@@ -1,18 +0,0 @@
-# $Id$
-
-lofar_package(AOFlagger 1.0 DEPENDS Common)
-
-find_package(PkgConfig)
-pkg_check_modules(GTKMM gtkmm-2.4)
-
-include(LofarFindPackage)
-lofar_find_package(LibXml2 REQUIRED)
-lofar_find_package(PNG REQUIRED)
-lofar_find_package(Casacore REQUIRED COMPONENTS ms tables)
-lofar_find_package(Boost REQUIRED COMPONENTS date_time thread filesystem)
-lofar_find_package(FFTW3 REQUIRED)
-lofar_find_package(GSL REQUIRED)
-lofar_find_package(CFITSIO REQUIRED)
-
-add_subdirectory(include/AOFlagger)
-add_subdirectory(src)
diff --git a/CEP/DP3/AOFlagger/scripts/CMakeLists-CEP.txt b/CEP/DP3/AOFlagger/scripts/CMakeLists-CEP.txt
deleted file mode 100644
index ad1423898d840f9aaeb18617d7be431acaa4ddbb..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/scripts/CMakeLists-CEP.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-# $Id: CMakeLists.txt 14274 2009-10-16 12:14:19Z loose $
-
-lofar_add_package(DP3)
-lofar_add_package(LMWCommon)
diff --git a/CEP/DP3/AOFlagger/scripts/CMakeLists-Common-src-without-lofarstman.txt b/CEP/DP3/AOFlagger/scripts/CMakeLists-Common-src-without-lofarstman.txt
deleted file mode 100644
index 4326335452c48a900805a888aaa83f5fbd89d784..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/scripts/CMakeLists-Common-src-without-lofarstman.txt
+++ /dev/null
@@ -1,35 +0,0 @@
-# $Id: CMakeLists.txt 15528 2010-04-22 14:08:39Z romein $
-
-include(LofarPackageVersion)
-
-set(common_LIB_SRCS
-  Package__Version.cc
-  Allocator.cc
-  DataConvert.cc
-  Exception.cc
-  FileLocator.cc
-  hexdump.cc
-  KVpair.cc
-  lofar_bitset.cc
-  LofarLogCout.cc
-  LofarLogger.cc
-  Numeric.cc
-  ParameterSet.cc
-  ParameterSetImpl.cc
-  ParameterValue.cc
-  PrettyUnits.cc
-  Process.cc
-  ReadLine.cc
-  RunOnNode.cc
-  Stopwatch.cc
-  StreamUtil.cc
-  StringUtil.cc
-  SystemCallException.cc
-  SystemUtil.cc
-  Timer.cc
-  TypeNames.cc
-  Version.cc
-  Net/FdSet.cc
-  Net/Socket.cc)
-
-lofar_add_library(common ${common_LIB_SRCS})
diff --git a/CEP/DP3/AOFlagger/scripts/CMakeLists-Common-without-lofarstman.txt b/CEP/DP3/AOFlagger/scripts/CMakeLists-Common-without-lofarstman.txt
deleted file mode 100644
index d6906790fe03453d932e44959e9aac5c69706828..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/scripts/CMakeLists-Common-without-lofarstman.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-# $Id: CMakeLists.txt 14773 2010-01-09 14:42:06Z loose $
-
-lofar_package(Common 3.3)
-
-include(LofarFindPackage)
-lofar_find_package(Boost REQUIRED)
-lofar_find_package(Readline)
-
-add_subdirectory(include/Common)
-add_subdirectory(src)
diff --git a/CEP/DP3/AOFlagger/scripts/CMakeLists-DP3.txt b/CEP/DP3/AOFlagger/scripts/CMakeLists-DP3.txt
deleted file mode 100644
index d2902a96d260e6741a29d39768d6256635d7d12e..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/scripts/CMakeLists-DP3.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-# $Id: CMakeLists.txt 15495 2010-04-20 11:17:00Z schoenmakers $
-
-lofar_add_package(AOFlagger)
diff --git a/CEP/DP3/AOFlagger/scripts/CMakeLists-LCS.txt b/CEP/DP3/AOFlagger/scripts/CMakeLists-LCS.txt
deleted file mode 100644
index e9c1e0fe368e6b11c546b152c30d1ae0c29d8589..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/scripts/CMakeLists-LCS.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-# $Id: CMakeLists.txt 15531 2010-04-23 09:08:18Z romein $
-
-lofar_add_package(Common)         # Common stuff
-lofar_add_package(Blob)           # Binary Large Objects
diff --git a/CEP/DP3/AOFlagger/scripts/CMakeLists-RTCP.txt b/CEP/DP3/AOFlagger/scripts/CMakeLists-RTCP.txt
deleted file mode 100644
index 1d4031f036c81f888e694a99eb9e33f7fbb6d18e..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/scripts/CMakeLists-RTCP.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-# $Id: CMakeLists.txt 14312 2009-10-22 11:46:32Z mol $
-
-lofar_add_package(LofarStMan)# Storage Manager for the main table of a LOFAR MS
diff --git a/CEP/DP3/AOFlagger/scripts/CMakeLists-root-without-lofarstman.txt b/CEP/DP3/AOFlagger/scripts/CMakeLists-root-without-lofarstman.txt
deleted file mode 100644
index d9353b6c2157271daaeaed207cee8a87633c83c6..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/scripts/CMakeLists-root-without-lofarstman.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-# $Id: CMakeLists.txt 15331 2010-03-29 14:22:10Z loose $
-
-cmake_minimum_required(VERSION 2.6)
-
-## ---------------------------------------------------------------------------
-## Preamble: set compilers
-## ---------------------------------------------------------------------------
-include(CMake/LofarInit.cmake)
-
-## ---------------------------------------------------------------------------
-## Project characteristics
-## ---------------------------------------------------------------------------
-project(LOFAR)
-include(LofarGeneral)
-
-## ---------------------------------------------------------------------------
-## LOFAR packages: build all, unless BUILD_PACKAGES was specified
-## ---------------------------------------------------------------------------
-include(LofarPackage)
-if(NOT DEFINED BUILD_PACKAGES)
-  lofar_add_package(CEP)
-else(NOT DEFINED BUILD_PACKAGES)
-  separate_arguments(BUILD_PACKAGES)
-  foreach(pkg ${BUILD_PACKAGES})
-    lofar_add_package(${pkg} REQUIRED)
-  endforeach(pkg ${BUILD_PACKAGES})
-endif(NOT DEFINED BUILD_PACKAGES)
-
-## ---------------------------------------------------------------------------
-## Check if Doxygen is present; if so, generate doxygen configuration file.
-## ---------------------------------------------------------------------------
-include(LofarDoxygen)
-
-## ---------------------------------------------------------------------------
-## Generate configuration header file.
-## ---------------------------------------------------------------------------
-include(LofarConfig)
diff --git a/CEP/DP3/AOFlagger/scripts/CMakeLists-root.txt b/CEP/DP3/AOFlagger/scripts/CMakeLists-root.txt
deleted file mode 100644
index de311d978dcd50efa1a2b64e5a21c4ecc1d15ad8..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/scripts/CMakeLists-root.txt
+++ /dev/null
@@ -1,39 +0,0 @@
-# $Id: CMakeLists.txt 15331 2010-03-29 14:22:10Z loose $
-
-cmake_minimum_required(VERSION 2.6)
-
-## ---------------------------------------------------------------------------
-## Preamble: set compilers
-## ---------------------------------------------------------------------------
-include(CMake/LofarInit.cmake)
-
-## ---------------------------------------------------------------------------
-## Project characteristics
-## ---------------------------------------------------------------------------
-project(LOFAR)
-include(LofarGeneral)
-
-## ---------------------------------------------------------------------------
-## LOFAR packages: build all, unless BUILD_PACKAGES was specified
-## ---------------------------------------------------------------------------
-include(LofarPackage)
-if(NOT DEFINED BUILD_PACKAGES)
-  lofar_add_package(LCS)
-  lofar_add_package(CEP)
-  lofar_add_package(RTCP)
-else(NOT DEFINED BUILD_PACKAGES)
-  separate_arguments(BUILD_PACKAGES)
-  foreach(pkg ${BUILD_PACKAGES})
-    lofar_add_package(${pkg} REQUIRED)
-  endforeach(pkg ${BUILD_PACKAGES})
-endif(NOT DEFINED BUILD_PACKAGES)
-
-## ---------------------------------------------------------------------------
-## Check if Doxygen is present; if so, generate doxygen configuration file.
-## ---------------------------------------------------------------------------
-include(LofarDoxygen)
-
-## ---------------------------------------------------------------------------
-## Generate configuration header file.
-## ---------------------------------------------------------------------------
-include(LofarConfig)
diff --git a/CEP/DP3/AOFlagger/scripts/distributed/async.sh b/CEP/DP3/AOFlagger/scripts/distributed/async.sh
deleted file mode 100755
index e82837edb2f8fa78484d812e5f463df1aee2b21e..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/scripts/distributed/async.sh
+++ /dev/null
@@ -1,43 +0,0 @@
-echo Killing existing rficonsoles...
-./killall.sh
-rm out -rvf
-mkdir -p out
-# how many ms per node?
-declare -i CPN=20
-declare -i i=1
-declare -i totalms=0
-sets="`cat sets.txt`"
-declare -i nodecount=`cat nodes.txt|wc -l`
-echo Node count: ${nodecount}
-declare -i thisnodei=0
-for setname in ${sets} ; do
-    thisnodei=${thisnodei}+1
-    if (( ${thisnodei} > ${CPN} )) ; then
-	i=$i+1
-	thisnodei=1
-	if (( $i > ${nodecount} )) ; then
-	    echo Not enough nodes to process \(${CPN} sets per node requested\)
-		exit;
-	fi
-    fi
-    totalms=${totalms}+1
-    A[${i}]="${A[${i}]} ${setname}"
-done
-echo Starting to process $totalms measurement sets...
-nodes="`cat nodes.txt`"
-i=0
-rm -f /tmp/shuffle.txt /tmp/cmds.txt
-for node in ${nodes} ; do
-    i=$i+1
-    echo ssh ${node} "-C" ~/stats/single.sh ${A[i]} >> /tmp/cmds.txt
-done
-i=0
-cat /tmp/cmds.txt|sort -R>/tmp/shuffled.txt
-exec</tmp/shuffled.txt
-while read line
-do
-    i=$i+1
-    ${line} &
-    echo Started \#$i: ${line}
-    sleep 120
-done
diff --git a/CEP/DP3/AOFlagger/scripts/distributed/baseline-slopes.sh b/CEP/DP3/AOFlagger/scripts/distributed/baseline-slopes.sh
deleted file mode 100755
index 701fbed53254a4bd307ff3c6d94384ec37b2dc36..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/scripts/distributed/baseline-slopes.sh
+++ /dev/null
@@ -1,13 +0,0 @@
-#! /bin/bash
-rm -f baseline-slopes.txt
-rm -fr out-*x* -rf
-for (( a1=0 ; ${a1} < 27 ; a1++ )) ; do
-    for (( a2=${a1}+1 ; ${a2} < 27 ; a2++ )) ; do
-	echo Baseline ${a1}x${a2}...
-	./collect-baseline.sh ${a1}x${a2} 2> /dev/null
-	echo Baseline ${a1}x${a2} >> baseline-slopes.txt
-	./process.sh ${a1}x${a2}|grep slope >> baseline-slopes.txt
-	tail -n 2 baseline-slopes.txt
-	rm out-${a1}x${a2} -rf
-    done
-done
diff --git a/CEP/DP3/AOFlagger/scripts/distributed/collect-baseline.sh b/CEP/DP3/AOFlagger/scripts/distributed/collect-baseline.sh
deleted file mode 100755
index 0f6062b90c062d18f347a24f26836fce0991ae43..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/scripts/distributed/collect-baseline.sh
+++ /dev/null
@@ -1,19 +0,0 @@
-#! /bin/bash
-nodes="`cat nodes.txt`"
-baseline=$1
-if [[ "${baseline}" == "" ]] ; then
-    echo Syntax: collect-baseline.sh \<baseline\>
-    echo \<baseline\> has format like 5x7.
-else
-    echo Collecting baseline ${baseline}
-    for n in ${nodes} ; do
-	echo -n -e "${n}... "
-	mkdir -p "out-${baseline}/${n}"
-	nodeprocs=`ssh ${n} -C "ls -1 /data/scratch/${USER}/stats/out/${n}/|grep -v txt"`
-	for p in ${nodeprocs} ; do
-	    mkdir -p "out-${baseline}/${n}/${p}"
-	    scp -rq "${n}:/data/scratch/${USER}/stats/out/${n}/${p}/baseline-${baseline}*.txt" "out-${baseline}/${n}/${p}/" &
-	done
-    done
-    wait
-fi
diff --git a/CEP/DP3/AOFlagger/scripts/distributed/collect-eor.sh b/CEP/DP3/AOFlagger/scripts/distributed/collect-eor.sh
deleted file mode 100755
index f5c5271c0fea252c1125072aa482e16e8d879bf5..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/scripts/distributed/collect-eor.sh
+++ /dev/null
@@ -1,34 +0,0 @@
-#! /bin/bash
-nodes="`cat nodes.txt`"
-mkdir -p out
-declare -i runningcount=0
-declare -i copyingcount=0
-declare -i notrunningcount=0
-for n in ${nodes} ; do
-    runningrfi="`ssh $n -C \"ps aux\"|grep rficonsole|grep ${USER}|grep -v grep|grep -v defun`"
-    if [[ "${runningrfi}" != "" ]] ; then
-	echo -n -e "$n: running "
-	runningcount=${runningcount}+1
-    else
-	runningscp="`ssh $n -C \"ps aux\"|grep scp|grep ${USER}|grep -v grep|grep -v defun`"
-	if [[ "${runningscp}" != "" ]] ; then
-	    copyingcount=${copyingcount}+1
-	    echo -n -e "$n: copying "
-	else
-	    notrunningcount=${notrunningcount}+1
-#	    echo -n -e "$n: NOT running! "
-	fi
-    fi
-    mkdir -p "out/${n}"
-    scp -q "${n}:/data1/users/lofareor/${USER}/stats/out/${n}/*.txt" "out/${n}/"
-    nodeprocs=`ssh ${n} -C "ls -1 /data1/users/lofareor/${USER}/stats/out/${n}/|grep -v txt"`
-    for p in ${nodeprocs} ; do
-	mkdir -p "out/${n}/${p}"
-	scp -rq "${n}:/data1/users/lofareor/${USER}/stats/out/${n}/${p}/*count*.txt" "out/${n}/${p}/"
-	scp -rq "${n}:/data1/users/lofareor/${USER}/stats/out/${n}/${p}/stdout.txt" "out/${n}/${p}/"
-	scp -rq "${n}:/data1/users/lofareor/${USER}/stats/out/${n}/${p}/stderr.txt" "out/${n}/${p}/"
-    done
-    echo -e -n .
-done
-wait
-echo -n -e "\nRunning: ${runningcount} Copying: ${copyingcount} Stopped: ${notrunningcount}\n"
diff --git a/CEP/DP3/AOFlagger/scripts/distributed/collect.sh b/CEP/DP3/AOFlagger/scripts/distributed/collect.sh
deleted file mode 100755
index 87bd107e129bb068aa1bd7b577b14a707bcfdee1..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/scripts/distributed/collect.sh
+++ /dev/null
@@ -1,33 +0,0 @@
-#! /bin/bash
-nodes="`cat nodes.txt`"
-mkdir -p out
-declare -i runningcount=0
-declare -i copyingcount=0
-declare -i notrunningcount=0
-for n in ${nodes} ; do
-    runningrfi="`ssh $n -C \"ps aux\"|grep rficonsole|grep ${USER}|grep -v grep`"
-    if [[ "${runningrfi}" != "" ]] ; then
-	runningcount=${runningcount}+1
-    else
-	runningscp="`ssh $n -C \"ps aux\"|grep scp|grep ${USER}|grep -v grep`"
-	if [[ "${runningscp}" != "" ]] ; then
-	    copyingcount=${copyingcount}+1
-	    echo -n -e "$n: copying "
-	else
-	    notrunningcount=${notrunningcount}+1
-	    echo -n -e "$n: NOT running! "
-	fi
-    fi
-    mkdir -p "out/${n}"
-    scp -q "${n}:/data/scratch/${USER}/stats/out/${n}/*.txt" "out/${n}/"
-    nodeprocs=`ssh ${n} -C "ls -1 /data/scratch/offringa/stats/out/${n}/|grep -v txt"`
-    for p in ${nodeprocs} ; do
-	mkdir -p "out/${n}/${p}"
-	scp -rq "${n}:/data/scratch/${USER}/stats/out/${n}/${p}/*count*.txt" "out/${n}/${p}/"
-	scp -rq "${n}:/data/scratch/${USER}/stats/out/${n}/${p}/stdout.txt" "out/${n}/${p}/"
-	scp -rq "${n}:/data/scratch/${USER}/stats/out/${n}/${p}/stderr.txt" "out/${n}/${p}/"
-    done
-    echo -e -n .
-done
-wait
-echo -n -e "\nRunning: ${runningcount} Copying: ${copyingcount} Stopped: ${notrunningcount}\n"
diff --git a/CEP/DP3/AOFlagger/scripts/distributed/dist-eor.sh b/CEP/DP3/AOFlagger/scripts/distributed/dist-eor.sh
deleted file mode 100755
index 430c6cf3c7a1f5693e113d531ad57e5af9f72fb1..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/scripts/distributed/dist-eor.sh
+++ /dev/null
@@ -1,42 +0,0 @@
-echo Killing existing rficonsoles...
-rm out -rvf
-mkdir -p out
-# how many ms per node?
-declare -i CPN=4
-declare -i i=1
-declare -i totalms=0
-sets="`cat sets.txt`"
-declare -i nodecount=`cat nodes.txt|wc -l`
-echo Node count: ${nodecount}
-declare -i thisnodei=0
-for setname in ${sets} ; do
-    thisnodei=${thisnodei}+1
-    if (( ${thisnodei} > ${CPN} )) ; then
-	i=$i+1
-	thisnodei=1
-	if (( $i > ${nodecount} )) ; then
-	    echo Not enough nodes to process \(${CPN} sets per node requested\)
-		exit;
-	fi
-    fi
-    totalms=${totalms}+1
-    A[${i}]="${A[${i}]} ${setname}"
-done
-echo Starting to process $totalms measurement sets...
-nodes="`cat nodes.txt`"
-i=0
-rm -f /tmp/shuffle.txt /tmp/cmds.txt
-for node in ${nodes} ; do
-    i=$i+1
-    echo ssh ${node} "-C" ~/distributed/single-eor.sh ${A[i]} >> /tmp/cmds.txt
-done
-i=0
-cat /tmp/cmds.txt|sort >/tmp/shuffled.txt
-exec</tmp/shuffled.txt
-while read line
-do
-    i=$i+1
-    ${line} &
-    echo Started \#$i: ${line}
-    sleep 60
-done
diff --git a/CEP/DP3/AOFlagger/scripts/distributed/killall.sh b/CEP/DP3/AOFlagger/scripts/distributed/killall.sh
deleted file mode 100755
index 1f14b76bf8944f8bec24063dcde240f1222218f2..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/scripts/distributed/killall.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-nodes="`cat nodes.txt`"
-for node in ${nodes} ; do
-    ssh ${node} -C "killall -u ${USER}" &
-done
-sleep 2
diff --git a/CEP/DP3/AOFlagger/scripts/distributed/list-nodes.sh b/CEP/DP3/AOFlagger/scripts/distributed/list-nodes.sh
deleted file mode 100755
index ae005329b0f344383d459eda759acc71ea741437..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/scripts/distributed/list-nodes.sh
+++ /dev/null
@@ -1,17 +0,0 @@
-if [[ "$1" == "" ]] ; then
-    echo Syntax: $0 \<ms\>
-else
-    for (( a=1 ; $a<81 ; a++ )) ; do
-	if (( $a<10 )) ; then
-	    node="node00$a"
-	else
-	    node="node0$a"
-	fi
-	if [[ "`ssh ${node} -C ls /data?/users/lofareor/|grep $1`" != "" ]] ; then
-	    nodesubs="`ssh ${node} -C \"find /data?/users/lofareor/$1/\"|grep SB|grep \\\.MS\/ -v`"
-	    for n in ${nodesubs} ; do
-		echo /net/${node}$n
-	    done
-	fi
-    done
-fi
diff --git a/CEP/DP3/AOFlagger/scripts/distributed/list.sh b/CEP/DP3/AOFlagger/scripts/distributed/list.sh
deleted file mode 100755
index 9037cd45d747f190e7f5c4946bd2c120c9228bf6..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/scripts/distributed/list.sh
+++ /dev/null
@@ -1,19 +0,0 @@
-if [[ "$1" == "" ]] ; then
-    MS="L2010_20981"
-#MS="L2010_08450"
-else
-    MS="$1"
-fi
-for (( a=1 ; $a<23 ; a++ )) ; do
-    if (( $a<10 )) ; then
-	lse="lse00$a"
-    else
-	lse="lse0$a"
-    fi
-    if [[ "`ssh ${lse} -C ls /data3/|grep ${MS}`" != "" ]] ; then
-	lsesubs="`ssh ${lse} -C \"find /data3/${MS}/\"|grep SB|grep \\\.MS\/ -v`"
-	for n in ${lsesubs} ; do
-	    echo ${lse}\:$n
-	done
-    fi
-done
diff --git a/CEP/DP3/AOFlagger/scripts/distributed/nodes.txt b/CEP/DP3/AOFlagger/scripts/distributed/nodes.txt
deleted file mode 100644
index 6dc7864118eeeb7f0033cd7b61cabe8e1d08c895..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/scripts/distributed/nodes.txt
+++ /dev/null
@@ -1,69 +0,0 @@
-node071
-node002
-node003
-node004
-node005
-node006
-node007
-node008
-node009
-node010
-node011
-node012
-node013
-node014
-node015
-node016
-node017
-node070
-node019
-node020
-node021
-node022
-node023
-node024
-node025
-node026
-node027
-node028
-node029
-node030
-node031
-node032
-node033
-node034
-node035
-node036
-node037
-node038
-node039
-node040
-node041
-node042
-node043
-node044
-node045
-node046
-node047
-node048
-node049
-node050
-node072
-node052
-node053
-node054
-node055
-node056
-node057
-node058
-node059
-node060
-node061
-node062
-node063
-node064
-node065
-node066
-node067
-node068
-node069
diff --git a/CEP/DP3/AOFlagger/scripts/distributed/process.sh b/CEP/DP3/AOFlagger/scripts/distributed/process.sh
deleted file mode 100755
index 08b54f0bfffea754c795992576203647c685c06e..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/scripts/distributed/process.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-#! /bin/bash
-if [[ "$1" == "" ]] ; then
-    cd out
-    ~/LOFAR/build/gnu_opt/CEP/DP3/AOFlagger/src/rfistatcollect `ls -1 */*/*counts*.txt|grep -v lce056/2|grep -v lce056/1|grep -v lce056/0`
-else
-    echo Processing stats for prefix $1...
-    cd out
-    ~/LOFAR/build/gnu_opt/CEP/DP3/AOFlagger/src/rfistatcollect `ls -1 */*/$1*counts*.txt|grep -v lce056/2|grep -v lce056/1|grep -v lce056/0`
-fi
diff --git a/CEP/DP3/AOFlagger/scripts/distributed/progress.sh b/CEP/DP3/AOFlagger/scripts/distributed/progress.sh
deleted file mode 100755
index 272297bb0267f1a9c436e3b58e8d0080728e6f2d..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/scripts/distributed/progress.sh
+++ /dev/null
@@ -1,25 +0,0 @@
-#! /bin/bash
-declare -i iteration=0
-if [[ ! -d out ]] ; then
-    ./collect.sh
-fi
-while true ; do
-    clear
-    iteration=${iteration}+1
-    for l in `ls -1 out|grep node` ; do
-	if [[ -f out/$l/progress.txt ]] ; then
-	    cd out/$l
-	    last=`ls -1|sort -g|tail -n 1`
-	    cd ../..
-	    if [[ -f out/$l/${last}/stdout.txt ]] ; then
-		echo $l: `cat out/$l/progress.txt` `cat out/$l/${last}/stderr.txt|grep \%|tail -n 1`
-	    else
-		echo $l: `cat out/$l/progress.txt` -
-	    fi
-	fi
-    done
-    echo End of iteration.
-    sleep 60
-    collect.sh
-    sleep 1
-done
diff --git a/CEP/DP3/AOFlagger/scripts/distributed/sets.txt b/CEP/DP3/AOFlagger/scripts/distributed/sets.txt
deleted file mode 100644
index 81dd7ed2ed9f679c12d812820ecee3a7aebbeecf..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/scripts/distributed/sets.txt
+++ /dev/null
@@ -1,248 +0,0 @@
-/net/node001/data2/users/lofareor/L2010_21479/L21479_SB000_uv.MS
-/net/node001/data2/users/lofareor/L2010_21479/L21479_SB001_uv.MS
-/net/node001/data2/users/lofareor/L2010_21479/L21479_SB002_uv.MS
-/net/node001/data2/users/lofareor/L2010_21479/L21479_SB003_uv.MS
-/net/node001/data2/users/lofareor/L2010_21479/L21479_SB004_uv.MS
-/net/node001/data2/users/lofareor/L2010_21479/L21479_SB005_uv.MS
-/net/node001/data2/users/lofareor/L2010_21479/L21479_SB006_uv.MS
-/net/node001/data2/users/lofareor/L2010_21479/L21479_SB007_uv.MS
-/net/node001/data2/users/lofareor/L2010_21479/L21479_SB008_uv.MS
-/net/node001/data2/users/lofareor/L2010_21479/L21479_SB009_uv.MS
-/net/node001/data2/users/lofareor/L2010_21479/L21479_SB010_uv.MS
-/net/node001/data2/users/lofareor/L2010_21479/L21479_SB011_uv.MS
-/net/node001/data2/users/lofareor/L2010_21479/L21479_SB012_uv.MS
-/net/node001/data2/users/lofareor/L2010_21479/L21479_SB013_uv.MS
-/net/node002/data2/users/lofareor/L2010_21479/L21479_SB014_uv.MS
-/net/node002/data2/users/lofareor/L2010_21479/L21479_SB015_uv.MS
-/net/node002/data2/users/lofareor/L2010_21479/L21479_SB016_uv.MS
-/net/node002/data2/users/lofareor/L2010_21479/L21479_SB017_uv.MS
-/net/node002/data2/users/lofareor/L2010_21479/L21479_SB018_uv.MS
-/net/node002/data2/users/lofareor/L2010_21479/L21479_SB019_uv.MS
-/net/node002/data2/users/lofareor/L2010_21479/L21479_SB020_uv.MS
-/net/node002/data2/users/lofareor/L2010_21479/L21479_SB021_uv.MS
-/net/node002/data2/users/lofareor/L2010_21479/L21479_SB022_uv.MS
-/net/node002/data2/users/lofareor/L2010_21479/L21479_SB023_uv.MS
-/net/node002/data2/users/lofareor/L2010_21479/L21479_SB024_uv.MS
-/net/node002/data2/users/lofareor/L2010_21479/L21479_SB025_uv.MS
-/net/node002/data2/users/lofareor/L2010_21479/L21479_SB026_uv.MS
-/net/node002/data2/users/lofareor/L2010_21479/L21479_SB027_uv.MS
-/net/node003/data2/users/lofareor/L2010_21479/L21479_SB028_uv.MS
-/net/node003/data2/users/lofareor/L2010_21479/L21479_SB029_uv.MS
-/net/node003/data2/users/lofareor/L2010_21479/L21479_SB030_uv.MS
-/net/node003/data2/users/lofareor/L2010_21479/L21479_SB031_uv.MS
-/net/node003/data2/users/lofareor/L2010_21479/L21479_SB032_uv.MS
-/net/node003/data2/users/lofareor/L2010_21479/L21479_SB033_uv.MS
-/net/node003/data2/users/lofareor/L2010_21479/L21479_SB034_uv.MS
-/net/node003/data2/users/lofareor/L2010_21479/L21479_SB035_uv.MS
-/net/node003/data2/users/lofareor/L2010_21479/L21479_SB036_uv.MS
-/net/node003/data2/users/lofareor/L2010_21479/L21479_SB037_uv.MS
-/net/node003/data2/users/lofareor/L2010_21479/L21479_SB038_uv.MS
-/net/node003/data2/users/lofareor/L2010_21479/L21479_SB039_uv.MS
-/net/node003/data2/users/lofareor/L2010_21479/L21479_SB040_uv.MS
-/net/node003/data2/users/lofareor/L2010_21479/L21479_SB041_uv.MS
-/net/node004/data2/users/lofareor/L2010_21479/L21479_SB042_uv.MS
-/net/node004/data2/users/lofareor/L2010_21479/L21479_SB043_uv.MS
-/net/node004/data2/users/lofareor/L2010_21479/L21479_SB044_uv.MS
-/net/node004/data2/users/lofareor/L2010_21479/L21479_SB045_uv.MS
-/net/node004/data2/users/lofareor/L2010_21479/L21479_SB046_uv.MS
-/net/node004/data2/users/lofareor/L2010_21479/L21479_SB047_uv.MS
-/net/node004/data2/users/lofareor/L2010_21479/L21479_SB048_uv.MS
-/net/node004/data2/users/lofareor/L2010_21479/L21479_SB049_uv.MS
-/net/node004/data2/users/lofareor/L2010_21479/L21479_SB050_uv.MS
-/net/node004/data2/users/lofareor/L2010_21479/L21479_SB051_uv.MS
-/net/node004/data2/users/lofareor/L2010_21479/L21479_SB052_uv.MS
-/net/node004/data2/users/lofareor/L2010_21479/L21479_SB053_uv.MS
-/net/node004/data2/users/lofareor/L2010_21479/L21479_SB054_uv.MS
-/net/node004/data2/users/lofareor/L2010_21479/L21479_SB055_uv.MS
-/net/node005/data2/users/lofareor/L2010_21479/L21479_SB056_uv.MS
-/net/node005/data2/users/lofareor/L2010_21479/L21479_SB057_uv.MS
-/net/node005/data2/users/lofareor/L2010_21479/L21479_SB058_uv.MS
-/net/node005/data2/users/lofareor/L2010_21479/L21479_SB059_uv.MS
-/net/node005/data2/users/lofareor/L2010_21479/L21479_SB060_uv.MS
-/net/node005/data2/users/lofareor/L2010_21479/L21479_SB061_uv.MS
-/net/node005/data2/users/lofareor/L2010_21479/L21479_SB062_uv.MS
-/net/node005/data2/users/lofareor/L2010_21479/L21479_SB063_uv.MS
-/net/node005/data2/users/lofareor/L2010_21479/L21479_SB064_uv.MS
-/net/node005/data2/users/lofareor/L2010_21479/L21479_SB065_uv.MS
-/net/node005/data2/users/lofareor/L2010_21479/L21479_SB066_uv.MS
-/net/node005/data2/users/lofareor/L2010_21479/L21479_SB067_uv.MS
-/net/node005/data2/users/lofareor/L2010_21479/L21479_SB068_uv.MS
-/net/node005/data2/users/lofareor/L2010_21479/L21479_SB069_uv.MS
-/net/node006/data2/users/lofareor/L2010_21479/L21479_SB070_uv.MS
-/net/node006/data2/users/lofareor/L2010_21479/L21479_SB071_uv.MS
-/net/node006/data2/users/lofareor/L2010_21479/L21479_SB072_uv.MS
-/net/node006/data2/users/lofareor/L2010_21479/L21479_SB073_uv.MS
-/net/node006/data2/users/lofareor/L2010_21479/L21479_SB074_uv.MS
-/net/node006/data2/users/lofareor/L2010_21479/L21479_SB075_uv.MS
-/net/node006/data2/users/lofareor/L2010_21479/L21479_SB076_uv.MS
-/net/node006/data2/users/lofareor/L2010_21479/L21479_SB077_uv.MS
-/net/node006/data2/users/lofareor/L2010_21479/L21479_SB078_uv.MS
-/net/node006/data2/users/lofareor/L2010_21479/L21479_SB079_uv.MS
-/net/node006/data2/users/lofareor/L2010_21479/L21479_SB080_uv.MS
-/net/node006/data2/users/lofareor/L2010_21479/L21479_SB081_uv.MS
-/net/node006/data2/users/lofareor/L2010_21479/L21479_SB082_uv.MS
-/net/node006/data2/users/lofareor/L2010_21479/L21479_SB083_uv.MS
-/net/node007/data2/users/lofareor/L2010_21479/L21479_SB084_uv.MS
-/net/node007/data2/users/lofareor/L2010_21479/L21479_SB085_uv.MS
-/net/node007/data2/users/lofareor/L2010_21479/L21479_SB086_uv.MS
-/net/node007/data2/users/lofareor/L2010_21479/L21479_SB087_uv.MS
-/net/node007/data2/users/lofareor/L2010_21479/L21479_SB088_uv.MS
-/net/node007/data2/users/lofareor/L2010_21479/L21479_SB089_uv.MS
-/net/node007/data2/users/lofareor/L2010_21479/L21479_SB090_uv.MS
-/net/node007/data2/users/lofareor/L2010_21479/L21479_SB091_uv.MS
-/net/node007/data2/users/lofareor/L2010_21479/L21479_SB092_uv.MS
-/net/node007/data2/users/lofareor/L2010_21479/L21479_SB093_uv.MS
-/net/node007/data2/users/lofareor/L2010_21479/L21479_SB094_uv.MS
-/net/node007/data2/users/lofareor/L2010_21479/L21479_SB095_uv.MS
-/net/node007/data2/users/lofareor/L2010_21479/L21479_SB096_uv.MS
-/net/node007/data2/users/lofareor/L2010_21479/L21479_SB097_uv.MS
-/net/node008/data2/users/lofareor/L2010_21479/L21479_SB098_uv.MS
-/net/node008/data2/users/lofareor/L2010_21479/L21479_SB099_uv.MS
-/net/node008/data2/users/lofareor/L2010_21479/L21479_SB100_uv.MS
-/net/node008/data2/users/lofareor/L2010_21479/L21479_SB101_uv.MS
-/net/node008/data2/users/lofareor/L2010_21479/L21479_SB102_uv.MS
-/net/node008/data2/users/lofareor/L2010_21479/L21479_SB103_uv.MS
-/net/node008/data2/users/lofareor/L2010_21479/L21479_SB104_uv.MS
-/net/node008/data2/users/lofareor/L2010_21479/L21479_SB105_uv.MS
-/net/node008/data2/users/lofareor/L2010_21479/L21479_SB106_uv.MS
-/net/node008/data2/users/lofareor/L2010_21479/L21479_SB107_uv.MS
-/net/node008/data2/users/lofareor/L2010_21479/L21479_SB108_uv.MS
-/net/node008/data2/users/lofareor/L2010_21479/L21479_SB109_uv.MS
-/net/node008/data2/users/lofareor/L2010_21479/L21479_SB110_uv.MS
-/net/node008/data2/users/lofareor/L2010_21479/L21479_SB111_uv.MS
-/net/node009/data2/users/lofareor/L2010_21479/L21479_SB112_uv.MS
-/net/node009/data2/users/lofareor/L2010_21479/L21479_SB113_uv.MS
-/net/node009/data2/users/lofareor/L2010_21479/L21479_SB114_uv.MS
-/net/node009/data2/users/lofareor/L2010_21479/L21479_SB115_uv.MS
-/net/node009/data2/users/lofareor/L2010_21479/L21479_SB116_uv.MS
-/net/node009/data2/users/lofareor/L2010_21479/L21479_SB117_uv.MS
-/net/node009/data2/users/lofareor/L2010_21479/L21479_SB118_uv.MS
-/net/node009/data2/users/lofareor/L2010_21479/L21479_SB119_uv.MS
-/net/node009/data2/users/lofareor/L2010_21479/L21479_SB120_uv.MS
-/net/node009/data2/users/lofareor/L2010_21479/L21479_SB121_uv.MS
-/net/node009/data2/users/lofareor/L2010_21479/L21479_SB122_uv.MS
-/net/node009/data2/users/lofareor/L2010_21479/L21479_SB123_uv.MS
-/net/node009/data2/users/lofareor/L2010_21479/L21479_SB124_uv.MS
-/net/node009/data2/users/lofareor/L2010_21479/L21479_SB125_uv.MS
-/net/node010/data2/users/lofareor/L2010_21479/L21479_SB126_uv.MS
-/net/node010/data2/users/lofareor/L2010_21479/L21479_SB127_uv.MS
-/net/node010/data2/users/lofareor/L2010_21479/L21479_SB128_uv.MS
-/net/node010/data2/users/lofareor/L2010_21479/L21479_SB129_uv.MS
-/net/node010/data2/users/lofareor/L2010_21479/L21479_SB130_uv.MS
-/net/node010/data2/users/lofareor/L2010_21479/L21479_SB131_uv.MS
-/net/node010/data2/users/lofareor/L2010_21479/L21479_SB132_uv.MS
-/net/node010/data2/users/lofareor/L2010_21479/L21479_SB133_uv.MS
-/net/node010/data2/users/lofareor/L2010_21479/L21479_SB134_uv.MS
-/net/node010/data2/users/lofareor/L2010_21479/L21479_SB135_uv.MS
-/net/node010/data2/users/lofareor/L2010_21479/L21479_SB136_uv.MS
-/net/node010/data2/users/lofareor/L2010_21479/L21479_SB137_uv.MS
-/net/node010/data2/users/lofareor/L2010_21479/L21479_SB138_uv.MS
-/net/node010/data2/users/lofareor/L2010_21479/L21479_SB139_uv.MS
-/net/node011/data2/users/lofareor/L2010_21479/L21479_SB140_uv.MS
-/net/node011/data2/users/lofareor/L2010_21479/L21479_SB141_uv.MS
-/net/node011/data2/users/lofareor/L2010_21479/L21479_SB142_uv.MS
-/net/node011/data2/users/lofareor/L2010_21479/L21479_SB143_uv.MS
-/net/node011/data2/users/lofareor/L2010_21479/L21479_SB144_uv.MS
-/net/node011/data2/users/lofareor/L2010_21479/L21479_SB145_uv.MS
-/net/node011/data2/users/lofareor/L2010_21479/L21479_SB146_uv.MS
-/net/node011/data2/users/lofareor/L2010_21479/L21479_SB147_uv.MS
-/net/node011/data2/users/lofareor/L2010_21479/L21479_SB148_uv.MS
-/net/node011/data2/users/lofareor/L2010_21479/L21479_SB149_uv.MS
-/net/node011/data2/users/lofareor/L2010_21479/L21479_SB150_uv.MS
-/net/node011/data2/users/lofareor/L2010_21479/L21479_SB151_uv.MS
-/net/node011/data2/users/lofareor/L2010_21479/L21479_SB152_uv.MS
-/net/node011/data2/users/lofareor/L2010_21479/L21479_SB153_uv.MS
-/net/node012/data2/users/lofareor/L2010_21479/L21479_SB154_uv.MS
-/net/node012/data2/users/lofareor/L2010_21479/L21479_SB155_uv.MS
-/net/node012/data2/users/lofareor/L2010_21479/L21479_SB156_uv.MS
-/net/node012/data2/users/lofareor/L2010_21479/L21479_SB157_uv.MS
-/net/node012/data2/users/lofareor/L2010_21479/L21479_SB158_uv.MS
-/net/node012/data2/users/lofareor/L2010_21479/L21479_SB159_uv.MS
-/net/node012/data2/users/lofareor/L2010_21479/L21479_SB160_uv.MS
-/net/node012/data2/users/lofareor/L2010_21479/L21479_SB161_uv.MS
-/net/node012/data2/users/lofareor/L2010_21479/L21479_SB162_uv.MS
-/net/node012/data2/users/lofareor/L2010_21479/L21479_SB163_uv.MS
-/net/node012/data2/users/lofareor/L2010_21479/L21479_SB164_uv.MS
-/net/node012/data2/users/lofareor/L2010_21479/L21479_SB165_uv.MS
-/net/node012/data2/users/lofareor/L2010_21479/L21479_SB166_uv.MS
-/net/node012/data2/users/lofareor/L2010_21479/L21479_SB167_uv.MS
-/net/node013/data2/users/lofareor/L2010_21479/L21479_SB168_uv.MS
-/net/node013/data2/users/lofareor/L2010_21479/L21479_SB169_uv.MS
-/net/node013/data2/users/lofareor/L2010_21479/L21479_SB170_uv.MS
-/net/node013/data2/users/lofareor/L2010_21479/L21479_SB171_uv.MS
-/net/node013/data2/users/lofareor/L2010_21479/L21479_SB172_uv.MS
-/net/node013/data2/users/lofareor/L2010_21479/L21479_SB173_uv.MS
-/net/node013/data2/users/lofareor/L2010_21479/L21479_SB174_uv.MS
-/net/node013/data2/users/lofareor/L2010_21479/L21479_SB175_uv.MS
-/net/node013/data2/users/lofareor/L2010_21479/L21479_SB176_uv.MS
-/net/node013/data2/users/lofareor/L2010_21479/L21479_SB177_uv.MS
-/net/node013/data2/users/lofareor/L2010_21479/L21479_SB178_uv.MS
-/net/node013/data2/users/lofareor/L2010_21479/L21479_SB179_uv.MS
-/net/node013/data2/users/lofareor/L2010_21479/L21479_SB180_uv.MS
-/net/node013/data2/users/lofareor/L2010_21479/L21479_SB181_uv.MS
-/net/node014/data2/users/lofareor/L2010_21479/L21479_SB182_uv.MS
-/net/node014/data2/users/lofareor/L2010_21479/L21479_SB183_uv.MS
-/net/node014/data2/users/lofareor/L2010_21479/L21479_SB184_uv.MS
-/net/node014/data2/users/lofareor/L2010_21479/L21479_SB185_uv.MS
-/net/node014/data2/users/lofareor/L2010_21479/L21479_SB186_uv.MS
-/net/node014/data2/users/lofareor/L2010_21479/L21479_SB187_uv.MS
-/net/node014/data2/users/lofareor/L2010_21479/L21479_SB188_uv.MS
-/net/node014/data2/users/lofareor/L2010_21479/L21479_SB189_uv.MS
-/net/node014/data2/users/lofareor/L2010_21479/L21479_SB190_uv.MS
-/net/node014/data2/users/lofareor/L2010_21479/L21479_SB191_uv.MS
-/net/node014/data2/users/lofareor/L2010_21479/L21479_SB192_uv.MS
-/net/node014/data2/users/lofareor/L2010_21479/L21479_SB193_uv.MS
-/net/node014/data2/users/lofareor/L2010_21479/L21479_SB194_uv.MS
-/net/node014/data2/users/lofareor/L2010_21479/L21479_SB195_uv.MS
-/net/node015/data2/users/lofareor/L2010_21479/L21479_SB196_uv.MS
-/net/node015/data2/users/lofareor/L2010_21479/L21479_SB197_uv.MS
-/net/node015/data2/users/lofareor/L2010_21479/L21479_SB198_uv.MS
-/net/node015/data2/users/lofareor/L2010_21479/L21479_SB199_uv.MS
-/net/node015/data2/users/lofareor/L2010_21479/L21479_SB200_uv.MS
-/net/node015/data2/users/lofareor/L2010_21479/L21479_SB201_uv.MS
-/net/node015/data2/users/lofareor/L2010_21479/L21479_SB202_uv.MS
-/net/node015/data2/users/lofareor/L2010_21479/L21479_SB203_uv.MS
-/net/node015/data2/users/lofareor/L2010_21479/L21479_SB204_uv.MS
-/net/node015/data2/users/lofareor/L2010_21479/L21479_SB205_uv.MS
-/net/node015/data2/users/lofareor/L2010_21479/L21479_SB206_uv.MS
-/net/node015/data2/users/lofareor/L2010_21479/L21479_SB207_uv.MS
-/net/node015/data2/users/lofareor/L2010_21479/L21479_SB208_uv.MS
-/net/node015/data2/users/lofareor/L2010_21479/L21479_SB209_uv.MS
-/net/node016/data2/users/lofareor/L2010_21479/L21479_SB210_uv.MS
-/net/node016/data2/users/lofareor/L2010_21479/L21479_SB211_uv.MS
-/net/node016/data2/users/lofareor/L2010_21479/L21479_SB212_uv.MS
-/net/node016/data2/users/lofareor/L2010_21479/L21479_SB213_uv.MS
-/net/node016/data2/users/lofareor/L2010_21479/L21479_SB214_uv.MS
-/net/node016/data2/users/lofareor/L2010_21479/L21479_SB215_uv.MS
-/net/node016/data2/users/lofareor/L2010_21479/L21479_SB216_uv.MS
-/net/node016/data2/users/lofareor/L2010_21479/L21479_SB217_uv.MS
-/net/node016/data2/users/lofareor/L2010_21479/L21479_SB218_uv.MS
-/net/node016/data2/users/lofareor/L2010_21479/L21479_SB219_uv.MS
-/net/node016/data2/users/lofareor/L2010_21479/L21479_SB220_uv.MS
-/net/node016/data2/users/lofareor/L2010_21479/L21479_SB221_uv.MS
-/net/node016/data2/users/lofareor/L2010_21479/L21479_SB222_uv.MS
-/net/node016/data2/users/lofareor/L2010_21479/L21479_SB223_uv.MS
-/net/node017/data2/users/lofareor/L2010_21479/L21479_SB224_uv.MS
-/net/node017/data2/users/lofareor/L2010_21479/L21479_SB225_uv.MS
-/net/node017/data2/users/lofareor/L2010_21479/L21479_SB226_uv.MS
-/net/node017/data2/users/lofareor/L2010_21479/L21479_SB227_uv.MS
-/net/node017/data2/users/lofareor/L2010_21479/L21479_SB228_uv.MS
-/net/node017/data2/users/lofareor/L2010_21479/L21479_SB229_uv.MS
-/net/node017/data2/users/lofareor/L2010_21479/L21479_SB230_uv.MS
-/net/node017/data2/users/lofareor/L2010_21479/L21479_SB231_uv.MS
-/net/node017/data2/users/lofareor/L2010_21479/L21479_SB232_uv.MS
-/net/node017/data2/users/lofareor/L2010_21479/L21479_SB233_uv.MS
-/net/node017/data2/users/lofareor/L2010_21479/L21479_SB234_uv.MS
-/net/node017/data2/users/lofareor/L2010_21479/L21479_SB235_uv.MS
-/net/node017/data2/users/lofareor/L2010_21479/L21479_SB236_uv.MS
-/net/node017/data2/users/lofareor/L2010_21479/L21479_SB237_uv.MS
-/net/node018/data2/users/lofareor/L2010_21479/L21479_SB238_uv.MS
-/net/node018/data2/users/lofareor/L2010_21479/L21479_SB239_uv.MS
-/net/node018/data2/users/lofareor/L2010_21479/L21479_SB240_uv.MS
-/net/node018/data2/users/lofareor/L2010_21479/L21479_SB241_uv.MS
-/net/node018/data2/users/lofareor/L2010_21479/L21479_SB242_uv.MS
-/net/node018/data2/users/lofareor/L2010_21479/L21479_SB243_uv.MS
-/net/node018/data2/users/lofareor/L2010_21479/L21479_SB244_uv.MS
-/net/node018/data2/users/lofareor/L2010_21479/L21479_SB245_uv.MS
-/net/node018/data2/users/lofareor/L2010_21479/L21479_SB246_uv.MS
-/net/node018/data2/users/lofareor/L2010_21479/L21479_SB247_uv.MS
diff --git a/CEP/DP3/AOFlagger/scripts/distributed/single-eor.sh b/CEP/DP3/AOFlagger/scripts/distributed/single-eor.sh
deleted file mode 100755
index 86444e0537c6b9712d41d10c311254d4db7df3b3..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/scripts/distributed/single-eor.sh
+++ /dev/null
@@ -1,22 +0,0 @@
-#! /bin/bash
-source /software/users/lofareor/eor-init.sh
-outdir="/data1/users/lofareor/${USER}/stats/out/`hostname`"
-strategy="/home/users/offringa/distributed/statistics.rfis"
-declare -i index=0
-rm -fr ${outdir}
-mkdir -p ${outdir}
-echo single.sh $* > ${outdir}/command.txt
-for f in $* ; do
-    echo ${index} > ${outdir}/progress.txt
-    cdir=${outdir}/${index}
-    rm -fr "${cdir}"
-    mkdir -p ${cdir}
-    cd ${cdir}
-    echo \# "$f" > ${cdir}/command.txt 2>> ${cdir}/stderr.txt
-    echo makeFLAGwritable "$f" >> ${cdir}/command.txt
-    makeFLAGwritable "$f" > ${cdir}/stdout.txt 2>> ${cdir}/stderr.txt
-    echo rficonsole -indirect-read -v -nolog -strategy ${strategy} -j 9 "$f" >> ${cdir}/command.txt
-    rficonsole -indirect-read -v -nolog -strategy ${strategy} -j 9 "$f" >> ${cdir}/stdout.txt 2>> ${cdir}/stderr.txt
-    index=${index}+1
-    rm -fr "${localms}" 2>> ${cdir}/stderr.txt
-done
diff --git a/CEP/DP3/AOFlagger/scripts/distributed/single.sh b/CEP/DP3/AOFlagger/scripts/distributed/single.sh
deleted file mode 100755
index 7e488879e9b4f121b688b0fd0f753751d88ec01f..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/scripts/distributed/single.sh
+++ /dev/null
@@ -1,26 +0,0 @@
-#! /bin/bash
-source /opt/login/loadpackage.bash LofIm Mon
-#source /opt/login/loadpackage.bash LofIm
-outdir="/data/scratch/${USER}/stats/out/`hostname`"
-strategy="/home/offringa/stats/resolution-test.rfis"
-#strategy="~/stats/countflag.rfis"
-declare -i index=0
-rm -fr ${outdir}
-mkdir -p ${outdir}
-echo single.sh $* > ${outdir}/command.txt
-for f in $* ; do
-    echo ${index} > ${outdir}/progress.txt
-    cdir=${outdir}/${index}
-    rm -fr "${cdir}"
-    mkdir -p ${cdir}
-    cd ${cdir}
-    echo \# "$f" > ${cdir}/command.txt 2>> ${cdir}/stderr.txt
-    echo ~/LOFAR/build/gnu_opt/CEP/DP3/AOFlagger/src/rficonsole -strategy ${strategy} -j 7 "$f" >> ${cdir}/command.txt
-    localms="/data/scratch/${USER}/SCRIPTED.MS"
-    rm -fr "${localms}" 2>> ${cdir}/stderr.txt
-    scp -rq "$f" "${localms}" 2>> ${cdir}/stderr.txt
-    ~/LOFAR/build/gnu_opt/CEP/DP3/AOFlagger/src/rficonsole -strategy ${strategy} -j 7 "${localms}" > ${cdir}/stdout.txt 2>> ${cdir}/stderr.txt
-
-    index=${index}+1
-    rm -fr "${localms}" 2>> ${cdir}/stderr.txt
-done
diff --git a/CEP/DP3/AOFlagger/scripts/distributed/statistics.rfis b/CEP/DP3/AOFlagger/scripts/distributed/statistics.rfis
deleted file mode 100644
index e702475dcc98f274dbb99473d3796fbd927299b9..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/scripts/distributed/statistics.rfis
+++ /dev/null
@@ -1,136 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- This is a Strategy configuration file for the
-rfi detector by André Offringa (offringa@astro.rug.nl).
--->
-<rfi-strategy format-version="2.3" reader-version-required="2.2">
-  <action type="Strategy">
-    <children>
-      <action type="ForEachBaselineAction">
-        <selection>1</selection>
-        <thread-count>4</thread-count>
-        <data-kind>0</data-kind>
-        <children>
-          <action type="SetFlaggingAction">
-            <new-flagging>0</new-flagging>
-          </action>
-          <action type="ForEachPolarisationBlock">
-            <on-xx>1</on-xx>
-            <on-xy>1</on-xy>
-            <on-yx>1</on-yx>
-            <on-yy>1</on-yy>
-            <on-stokes-i>0</on-stokes-i>
-            <on-stokes-q>0</on-stokes-q>
-            <on-stokes-u>0</on-stokes-u>
-            <on-stokes-v>0</on-stokes-v>
-            <children>
-              <action type="ForEachComplexComponentAction">
-                <on-amplitude>1</on-amplitude>
-                <on-phase>0</on-phase>
-                <on-real>0</on-real>
-                <on-imaginary>0</on-imaginary>
-                <restore-from-amplitude>0</restore-from-amplitude>
-                <children>
-                  <action type="IterationBlock">
-                    <iteration-count>2</iteration-count>
-                    <sensitivity-start>4</sensitivity-start>
-                    <children>
-                      <action type="ThresholdAction">
-                        <base-sensitivity>1</base-sensitivity>
-                        <time-direction-flagging>1</time-direction-flagging>
-                        <frequency-direction-flagging>1</frequency-direction-flagging>
-                      </action>
-                      <action type="CombineFlagResults">
-                        <children>
-                          <action type="FrequencySelectionAction">
-                            <threshold>3</threshold>
-                          </action>
-                          <action type="TimeSelectionAction">
-                            <threshold>3.5</threshold>
-                          </action>
-                        </children>
-                      </action>
-                      <action type="SetImageAction">
-                        <new-image>1</new-image>
-                      </action>
-                      <action type="ChangeResolutionAction">
-                        <time-decrease-factor>3</time-decrease-factor>
-                        <frequency-decrease-factor>3</frequency-decrease-factor>
-                        <restore-revised>1</restore-revised>
-                        <restore-masks>0</restore-masks>
-                        <children>
-                          <action type="SlidingWindowFitAction">
-                            <fit-precision>1e-06</fit-precision>
-                            <frequency-direction-kernel-size>5</frequency-direction-kernel-size>
-                            <frequency-direction-window-size>15</frequency-direction-window-size>
-                            <method>4</method>
-                            <time-direction-kernel-size>2.5</time-direction-kernel-size>
-                            <time-direction-window-size>10</time-direction-window-size>
-                          </action>
-                        </children>
-                      </action>
-                      <action type="SetFlaggingAction">
-                        <new-flagging>0</new-flagging>
-                      </action>
-                    </children>
-                  </action>
-                  <action type="ThresholdAction">
-                    <base-sensitivity>1</base-sensitivity>
-                    <time-direction-flagging>1</time-direction-flagging>
-                    <frequency-direction-flagging>1</frequency-direction-flagging>
-                  </action>
-                </children>
-              </action>
-            </children>
-          </action>
-          <action type="SetFlaggingAction">
-            <new-flagging>4</new-flagging>
-          </action>
-          <action type="StatisticalFlagAction">
-            <enlarge-frequency-size>0</enlarge-frequency-size>
-            <enlarge-time-size>0</enlarge-time-size>
-            <max-contaminated-frequencies-ratio>0.5</max-contaminated-frequencies-ratio>
-            <max-contaminated-times-ratio>0.5</max-contaminated-times-ratio>
-            <minimum-good-frequency-ratio>0.8</minimum-good-frequency-ratio>
-            <minimum-good-time-ratio>0.8</minimum-good-time-ratio>
-          </action>
-          <action type="TimeSelectionAction">
-            <threshold>3.5</threshold>
-          </action>
-          <action type="BaselineSelectionAction">
-            <preparation-step>1</preparation-step>
-            <flag-bad-baselines>0</flag-bad-baselines>
-            <threshold>8</threshold>
-            <smoothing-sigma>0.6</smoothing-sigma>
-            <abs-threshold>0.4</abs-threshold>
-            <make-plot>0</make-plot>
-          </action>
-          <action type="SetFlaggingAction">
-            <new-flagging>6</new-flagging>
-          </action>
-          <action type="WriteFlagsAction" />
-          <action type="PlotAction">
-            <plot-kind>0</plot-kind>
-            <logarithmic-y-axis>0</logarithmic-y-axis>
-          </action>
-          <action type="PlotAction">
-            <plot-kind>1</plot-kind>
-            <logarithmic-y-axis>0</logarithmic-y-axis>
-          </action>
-	  <action type="AddStatisticsAction" >
-            <file-prefix></file-prefix>
-            <compare-original-and-alternative>0</compare-original-and-alternative>
-            <separate-baseline-statistics>0</separate-baseline-statistics>
-          </action>
-        </children>
-      </action>
-      <action type="BaselineSelectionAction">
-        <preparation-step>0</preparation-step>
-        <flag-bad-baselines>1</flag-bad-baselines>
-        <threshold>8</threshold>
-        <smoothing-sigma>0.6</smoothing-sigma>
-        <abs-threshold>0.4</abs-threshold>
-        <make-plot>0</make-plot>
-      </action>
-    </children>
-  </action>
-</rfi-strategy>
diff --git a/CEP/DP3/AOFlagger/scripts/package-without-lofarstman.sh b/CEP/DP3/AOFlagger/scripts/package-without-lofarstman.sh
deleted file mode 100755
index 6b974266bd9bd4e873906690e59ca73a28494f52..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/scripts/package-without-lofarstman.sh
+++ /dev/null
@@ -1,34 +0,0 @@
-#! /bin/bash
-if [[ "$1" == "" ]] ; then
-    echo usage: $0 \<version-name\>
-else
-    cd /tmp
-    rm -rf aoexport
-    mkdir -p aoexport/LOFAR/CEP/DP3
-    mkdir -p aoexport/LOFAR/LCS/Common
-    cd aoexport
-    svn export https://svn.astron.nl/LOFAR/trunk/CEP/DP3/AOFlagger/ LOFAR/CEP/DP3/AOFlagger
-    svn export https://svn.astron.nl/LOFAR/trunk/LCS/Common/include LOFAR/LCS/Common/include
-    svn export https://svn.astron.nl/LOFAR/trunk/LCS/Common/src LOFAR/LCS/Common/src
-    svn export https://svn.astron.nl/LOFAR/trunk/CMake LOFAR/CMake
-    svn export https://svn.astron.nl/LOFAR/trunk/lofar_config.h.cmake LOFAR/lofar_config.h.cmake
-    svn export https://svn.astron.nl/LOFAR/trunk/lofarinit.sh.in LOFAR/lofarinit.sh.in
-    svn export https://svn.astron.nl/LOFAR/trunk/lofarinit.csh.in LOFAR/lofarinit.csh.in
-    cp LOFAR/CEP/DP3/AOFlagger/scripts/CMakeLists-root-without-lofarstman.txt LOFAR/CMakeLists.txt
-    cp LOFAR/CEP/DP3/AOFlagger/scripts/CMakeLists-CEP.txt LOFAR/CEP/CMakeLists.txt
-    cp LOFAR/CEP/DP3/AOFlagger/scripts/CMakeLists-DP3.txt LOFAR/CEP/DP3/CMakeLists.txt
-    cp LOFAR/CEP/DP3/AOFlagger/scripts/CMakeLists-AOFlagger-without-lofarstman.txt LOFAR/CEP/DP3/AOFlagger/CMakeLists.txt
-    cp LOFAR/CEP/DP3/AOFlagger/scripts/CMakeLists-LCS.txt LOFAR/LCS/CMakeLists.txt
-    cp LOFAR/CEP/DP3/AOFlagger/scripts/CMakeLists-Common-without-lofarstman.txt LOFAR/LCS/Common/CMakeLists.txt
-    cp LOFAR/CEP/DP3/AOFlagger/scripts/CMakeLists-Common-src-without-lofarstman.txt LOFAR/LCS/Common/src/CMakeLists.txt
-    cp LOFAR/CEP/DP3/AOFlagger/README LOFAR/README
-    CONF_FILE="LOFAR/CEP/DP3/AOFlagger/include/AOFlagger/configuration.h"
-    echo \#ifndef CONFIGURATION_H > ${CONF_FILE}
-    echo \#define CONFIGURATION_H >> ${CONF_FILE}
-    echo \#define NO_LOFARSTMAN >> ${CONF_FILE}
-    echo \#endif >> ${CONF_FILE}
-    rm -f AOFlagger-without-lofarstman-$1.tar.bz2
-    tar -cjvf AOFlagger-without-lofarstman-$1.tar.bz2 LOFAR/
-    rm -rf LOFAR/
-    ls -alh AOFlagger-without-lofarstman-$1.tar.bz2
-fi
diff --git a/CEP/DP3/AOFlagger/scripts/package.sh b/CEP/DP3/AOFlagger/scripts/package.sh
deleted file mode 100644
index 8b1cbd2a0f7ba32369231ac031d9166353709009..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/scripts/package.sh
+++ /dev/null
@@ -1,38 +0,0 @@
-#! /bin/bash
-if [[ "$1" == "" ]] ; then
-    echo usage: $0 \<version-name\>
-else
-		scriptdir=`pwd`
-    cd /tmp
-    rm -rf aoexport
-    mkdir -p aoexport/LOFAR/CEP/DP3
-    mkdir -p aoexport/LOFAR/LCS
-    cd aoexport
-    svn export https://svn.astron.nl/LOFAR/trunk/CEP/DP3/AOFlagger/ LOFAR/CEP/DP3/AOFlagger
-    svn export https://svn.astron.nl/LOFAR/trunk/CEP/LMWCommon LOFAR/CEP/LMWCommon
-    svn export https://svn.astron.nl/LOFAR/trunk/LCS/Common LOFAR/LCS/Common
-    svn export https://svn.astron.nl/LOFAR/trunk/LCS/Blob LOFAR/LCS/Blob
-    svn export https://svn.astron.nl/LOFAR/trunk/CMake LOFAR/CMake
-    svn export https://svn.astron.nl/LOFAR/trunk/RTCP/LofarStMan LOFAR/RTCP/LofarStMan
-    svn export https://svn.astron.nl/LOFAR/trunk/lofar_config.h.cmake LOFAR/lofar_config.h.cmake
-    svn export https://svn.astron.nl/LOFAR/trunk/lofarinit.sh.in LOFAR/lofarinit.sh.in
-    svn export https://svn.astron.nl/LOFAR/trunk/lofarinit.csh.in LOFAR/lofarinit.csh.in
-    cp LOFAR/CEP/DP3/AOFlagger/scripts/CMakeLists-root.txt LOFAR/CMakeLists.txt
-    cp LOFAR/CEP/DP3/AOFlagger/scripts/CMakeLists-CEP.txt LOFAR/CEP/CMakeLists.txt
-    cp LOFAR/CEP/DP3/AOFlagger/scripts/CMakeLists-DP3.txt LOFAR/CEP/DP3/CMakeLists.txt
-    cp LOFAR/CEP/DP3/AOFlagger/scripts/CMakeLists-LCS.txt LOFAR/LCS/CMakeLists.txt
-    cp LOFAR/CEP/DP3/AOFlagger/scripts/CMakeLists-RTCP.txt LOFAR/RTCP/CMakeLists.txt
-    cp LOFAR/CEP/DP3/AOFlagger/ LOFAR/README
-    rm -v LOFAR/CEP/DP3/AOFlagger/doc/site/*.tar.bz2
-    rm -f AOFlagger-$1.tar.bz2
-    tar -cjvf AOFlagger-$1.tar.bz2 LOFAR/
-    rm -rf LOFAR/
-    ls -alh AOFlagger-$1.tar.bz2
-		mkdir test
-		cd test/
-		tar -xjvf ../AOFlagger-$1.tar.bz2
-		mkdir -p LOFAR/build/gnu_opt
-		cd LOFAR/build/gnu_opt/
-		cp ${scriptdir}/../../../../build/gnu_opt/cmakestrap.sh ./
-		exec ./cmakestrap.sh
-fi
diff --git a/CEP/DP3/AOFlagger/src/CMakeLists.txt b/CEP/DP3/AOFlagger/src/CMakeLists.txt
deleted file mode 100644
index 831daed3c8f99ff83a77d310f307d13d7cba399d..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/CMakeLists.txt
+++ /dev/null
@@ -1,270 +0,0 @@
-# $Id$
-
-include(LofarPackageVersion)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -DNDEBUG -funroll-loops")
-
-include(CheckCXXCompilerFlag)
-
-CHECK_CXX_COMPILER_FLAG("-march=native" COMPILER_SUPPORTS_MARCH_NATIVE)
-
-# -march=native speeds up the flagger with about 6% - 7%, but is not supported prior gcc 4.2.
-# Hence, only enable it if it is supported.
-# Disabled setting of -march=native, because it breaks binary compatibility between CEP-I and CEP-II hardware.
-#if(COMPILER_SUPPORTS_MARCH_NATIVE)
-#  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native")
-#else()
-#  message(STATUS " CXX compiler does not support -march=native : your code will not be optimized with -march=native.")
-#  message(STATUS " This probably means your gcc is old ( < 4.2).")
-#endif(COMPILER_SUPPORTS_MARCH_NATIVE)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse2")
-
-include(CheckIncludeFileCXX)
-
-FIND_PATH(BOOST_ASIO_H_FOUND "boost/asio.hpp" HINTS ${BOOST_ROOT_DIR} PATH_SUFFIXES include)
-if(BOOST_ASIO_H_FOUND)
-  message(STATUS "Boost ASIO library found.")
-else()
-  message(STATUS "Boost ASIO library not found, remote access of measurement sets disabled.")
-endif(BOOST_ASIO_H_FOUND)
-
-# To enable assembly .s files:
-#enable_language(ASM-ATT)
-
-if(GTKMM_FOUND)
-  add_definitions(-DHAVE_GTKMM)
-endif(GTKMM_FOUND)
-
-if(GSL_FOUND)
-  add_definitions(-DHAVE_GSL)
-  link_libraries(${GSL_LIBRARIES})
-endif(GSL_FOUND)
-
-if(SIGCXX_FOUND)
-  include_directories(${SIGCXX_INCLUDE_DIRS})
-endif(SIGCXX_FOUND)
-
-lofar_add_bin_program(rfihistory rfihistory.cpp)
-
-lofar_add_bin_program(aorefscript aorefscript.cpp)
-
-set(GUI_PLOT_FILES
-  gui/plot/colorscale.cpp
-  gui/plot/horizontalplotscale.cpp
-  gui/plot/plot2d.cpp
-  gui/plot/plotpropertieswindow.cpp
-  gui/plot/plotwidget.cpp
-  gui/plot/verticalplotscale.cpp)
-
-set(GUI_FILES
-  gui/antennamap/antenna.cpp
-  gui/antennamap/antennamap.cpp
-  gui/application.cpp
-  gui/complexplaneplotwindow.cpp
-  gui/editstrategywindow.cpp
-  gui/gotowindow
-  gui/highlightwindow.cpp
-  gui/imagecomparisonwidget.cpp
-  gui/imageplanewindow
-  gui/imagepropertieswindow.cpp
-  gui/imagewidget.cpp
-  gui/msoptionwindow.cpp
-  gui/mswindow.cpp
-  gui/noisestatoptionwindow.cpp
-  gui/plotframe.cpp
-  gui/progresswindow.cpp
-  gui/rawoptionwindow.cpp
-  gui/tfstatoptionwindow.cpp
-  gui/quality/datawindow.cpp
-  gui/quality/histogrampage.cpp
-  ${GUI_PLOT_FILES})
-
-set(MSIO_FILES
-  msio/baselinematrixloader.cpp
-  msio/baselinereader.cpp
-  msio/colormap.cpp
-  msio/directbaselinereader.cpp
-  msio/fitsfile.cpp
-  msio/image2d.cpp
-  msio/indirectbaselinereader.cpp
-  msio/mask2d.cpp
-  msio/measurementset.cpp
-  msio/memorybaselinereader.cpp
-  msio/pngfile.cpp
-  msio/rspreader.cpp
-  msio/samplerow.cpp
-  msio/segmentedimage.cpp
-  msio/sortedtimestepaccessor.cpp
-  msio/spatialtimeloader.cpp
-  msio/stokesimager.cpp
-  msio/timefrequencydata.cpp
-  msio/timefrequencyimager.cpp
-  msio/timestepaccessor.cpp)
-  
-set(QUALITY_FILES
-  quality/histogramcollection.cpp
-  quality/histogramtablesformatter.cpp
-  quality/rayleighfitter.cpp
-  quality/qualitytablesformatter.cpp)
-
-set(REMOTEAO_FILES
-  remote/server.cpp)
-
-set(STRATEGY_ACTION_FILES
-  strategy/actions/baselineselectionaction.cpp
-  strategy/actions/changeresolutionaction.cpp
-  strategy/actions/foreachbaselineaction.cpp
-  strategy/actions/foreachmsaction.cpp
-  strategy/actions/frequencyselectionaction.cpp
-  strategy/actions/fringestopaction.cpp
-	strategy/actions/highpassfilteraction.cpp
-  strategy/actions/imageraction.cpp
-  strategy/actions/normalizevarianceaction.cpp
-  strategy/actions/plotaction.cpp
-  strategy/actions/slidingwindowfitaction.cpp
-  strategy/actions/spatialcompositionaction.cpp
-  strategy/actions/statisticalflagaction.cpp
-  strategy/actions/strategyaction.cpp
-  strategy/actions/svdaction.cpp
-  strategy/actions/timeconvolutionaction.cpp
-  strategy/actions/timeselectionaction.cpp
-  strategy/actions/writeflagsaction.cpp)
-
-set(STRATEGY_ALGORITHMS_FILES
-  strategy/algorithms/baselineselector.cpp
-	strategy/algorithms/baselinetimeplaneimager.cpp
-  strategy/algorithms/eigenvalue.cpp
-  strategy/algorithms/fringestoppingfitter.cpp
-  strategy/algorithms/fringetestcreater.cpp
-	strategy/algorithms/highpassfilter.cpp
-  strategy/algorithms/localfitmethod.cpp
-  strategy/algorithms/methoditerator.cpp
-  strategy/algorithms/mitigationtester.cpp
-  strategy/algorithms/morphology.cpp
-  strategy/algorithms/rfistatistics.cpp
-  strategy/algorithms/sinusfitter.cpp
-  strategy/algorithms/statisticalflagger.cpp
-  strategy/algorithms/sumthreshold.cpp
-  strategy/algorithms/svdmitigater.cpp
-  strategy/algorithms/thresholdconfig.cpp
-  strategy/algorithms/thresholdmitigater.cpp
-  strategy/algorithms/thresholdtools.cpp
-  strategy/algorithms/timefrequencystatistics.cpp
-  strategy/plots/antennaflagcountplot.cpp
-  strategy/plots/frequencyflagcountplot.cpp)
-
-if(GTKMM_FOUND)
-set(STRATEGY_PLOTS_FILES
-  strategy/plots/frequencypowerplot.cpp
-  strategy/plots/iterationsplot.cpp
-  strategy/plots/rfiplots.cpp
-  strategy/plots/timeflagcountplot.cpp
-  util/multiplot.cpp)
-else()
- set(STRATEGY_PLOTS_FILES)
-endif(GTKMM_FOUND)
-
-set(STRATEGY_CONTROL_FILES
-  strategy/control/actionblock.cpp
-  strategy/control/actionfactory.cpp
-  strategy/control/strategyreader.cpp
-  strategy/control/strategywriter.cpp)
-
-set(STRATEGY_IMAGESETS_FILES
-  strategy/imagesets/fitsimageset.cpp
-  strategy/imagesets/imageset.cpp
-  strategy/imagesets/msimageset.cpp
-  strategy/imagesets/parmimageset.cpp)
-
-set(STRATEGY_FILES
-  ${STRATEGY_ACTION_FILES}
-  ${STRATEGY_ALGORITHMS_FILES}
-  ${STRATEGY_CONTROL_FILES}
-  ${STRATEGY_IMAGESETS_FILES}
-  ${STRATEGY_PLOTS_FILES})
-
-set(IMAGING_FILES
-  imaging/uvimager.cpp
-  imaging/model.cpp
-  imaging/fourproductcorrelatortester.cpp)
-
-set(UTIL_FILES
-  util/aologger.cpp
-  util/compress.cpp
-  util/ffttools.cpp
-  util/integerdomain.cpp
-  util/plot.cpp
-  util/rng.cpp
-  util/statwriter.cpp
-  util/stopwatch.cpp)
-
-if(BOOST_ASIO_H_FOUND AND SIGCXX_FOUND)
-	set(REMOTE_FILES
-		remote/client.cpp
-		remote/server.cpp
-		remote/serverconnection.cpp
-		remote/processcommander.cpp
-		remote/clusteredobservation.cpp)
-else()
-	set(REMOTE_FILES
-		remote/clusteredobservation.cpp)
-endif(BOOST_ASIO_H_FOUND AND SIGCXX_FOUND)
-
-lofar_add_library(rfiengine
-  Package__Version.cc
-  ${IMAGING_FILES} ${MSIO_FILES} ${QUALITY_FILES} ${STRATEGY_FILES} ${UTIL_FILES})
-
-if(GTKMM_FOUND)
-  include_directories(${GTKMM_INCLUDE_DIRS})
-  link_directories(${GTKMM_LIBDIR})
-  
-  lofar_add_bin_program(rfigui rfigui.cpp ${GUI_FILES})
-  target_link_libraries(rfigui ${GTKMM_LIBRARIES})
-  
-	if(BOOST_ASIO_H_FOUND AND SIGCXX_FOUND)
-		lofar_add_bin_program(aoqplot aoqplot.cpp
-		${REMOTE_FILES}
-		gui/plot/colorscale.cpp
-		gui/plot/horizontalplotscale.cpp
-		gui/plot/verticalplotscale.cpp
-		gui/plot/plot2d.cpp
-		gui/plot/plotpropertieswindow.cpp
-		gui/quality/aoqplotwindow.cpp
-		gui/quality/baselineplotpage.cpp
-		gui/quality/datawindow.cpp
-		gui/quality/grayscaleplotpage.cpp
-		gui/quality/histogrampage.cpp
-		gui/quality/timefrequencyplotpage.cpp
-		gui/quality/twodimensionalplotpage.cpp
-		gui/imagewidget.cpp
-		gui/imagepropertieswindow.cpp
-		)
-		target_link_libraries(aoqplot ${GTKMM_LIBRARIES})
-		lofar_add_bin_program(badstations badstations.cpp ${REMOTE_FILES})
-		target_link_libraries(badstations ${GTKMM_LIBRARIES})
-		lofar_add_bin_program(aofrequencyfilter aofrequencyfilter.cpp ${REMOTE_FILES})
-		target_link_libraries(aofrequencyfilter ${GTKMM_LIBRARIES})
-	endif(BOOST_ASIO_H_FOUND AND SIGCXX_FOUND)
-else()
-  message(WARNING " The graphical user interface library GTKMM was not found; rfigui and aoqplot will not be compiled.")
-endif(GTKMM_FOUND)
-
-#lofar_add_bin_program(rficonsole rficonsole.cpp)
-lofar_add_bin_program(rfistrategy rfistrategy.cpp)
-lofar_add_bin_program(rfistatcollect rfistatcollect.cpp)
-lofar_add_bin_program(aostats aostats.cpp)
-lofar_add_bin_program(msinfo msinfo.cpp)
-lofar_add_bin_program(ns2bbs ns2bbs.cpp)
-lofar_add_bin_program(colormapper colormapper.cpp)
-#lofar_add_bin_program(versionaoflagger versionaoflagger.cc Package__Version.cc)
-lofar_add_bin_program(imgzenith imgzenith.cpp imaging/zenithimager.cpp)
-
-if(BOOST_ASIO_H_FOUND AND SIGCXX_FOUND)
-  lofar_add_bin_program(aoquality aoquality.cpp ${REMOTE_FILES})
-  target_link_libraries(aoquality ${SIGCXX_LIBRARIES})
-
-	lofar_add_bin_program(aoremoteclient aoremoteclient.cpp
-  ${REMOTE_FILES} )
-  target_link_libraries(aoremoteclient ${SIGCXX_LIBRARIES})
-endif(BOOST_ASIO_H_FOUND AND SIGCXX_FOUND)
diff --git a/CEP/DP3/AOFlagger/src/aofrequencyfilter-old.cpp b/CEP/DP3/AOFlagger/src/aofrequencyfilter-old.cpp
deleted file mode 100644
index a5b2d79d4a47f3e544225405d3622b80538b6606..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/aofrequencyfilter-old.cpp
+++ /dev/null
@@ -1,276 +0,0 @@
-#include <iostream>
-#include <string>
-#include <deque>
-
-#include <boost/thread.hpp>
-#include <boost/thread/mutex.hpp>
-#include <boost/thread/condition.hpp>
-
-#include <AOFlagger/strategy/algorithms/convolutions.h>
-
-#include <AOFlagger/imaging/uvimager.h>
-
-#include <AOFlagger/msio/system.h>
-#include <AOFlagger/msio/timestepaccessor.h>
-
-using namespace std;
-
-double uvDist(double u, double v, double firstFrequency, double lastFrequency)
-{
-	const double
-		lowU = u * firstFrequency,
-		lowV = v * firstFrequency,
-		highU = u * lastFrequency,
-		highV = v * lastFrequency,
-		ud = lowU - highU,
-		vd = lowV - highV;
-	return sqrt(ud * ud + vd * vd) / UVImager::SpeedOfLight();
-}
-
-// This represents the data that is specific for a single thread
-struct TaskInfo
-{
-	TaskInfo() : length(0), convolutionSize(0.0), index(0), data() { }
-	TaskInfo(const TaskInfo &source) :
-	 length(source.length),
-	 convolutionSize(source.convolutionSize),
-	 index(source.index),
-	 data(source.data)
-	{
-	}
-	void operator=(const TaskInfo &source)
-	{
-		length = source.length;
-		convolutionSize = source.convolutionSize;
-		index = source.index;
-		data = source.data;
-	}
-	
-	unsigned length;
-	double convolutionSize;
-	TimestepAccessor::TimestepIndex *index;
-	TimestepAccessor::TimestepData data;
-};
-
-void performAndWriteConvolution(TimestepAccessor &accessor, TaskInfo task, boost::mutex &mutex)
-{
-	unsigned polarizationCount = accessor.PolarizationCount();
-	if(task.convolutionSize > 1.0)
-	{
-		// Convolve the data
-		for(unsigned p=0;p<polarizationCount;++p)
-		{
-			Convolutions::OneDimensionalSincConvolution(task.data.realData[p], task.length, 1.0/task.convolutionSize);
-			Convolutions::OneDimensionalSincConvolution(task.data.imagData[p], task.length, 1.0/task.convolutionSize);
-		}
-
-		// Copy data back to tables
-		boost::mutex::scoped_lock lock(mutex);
-		accessor.Write(*task.index, task.data);
-		lock.unlock();
-	}
-
-	task.data.Free(polarizationCount);
-	delete task.index;
-}
-
-struct ThreadFunction
-{
-	void operator()();
-	class ThreadControl *threadControl;
-	int number;
-};
-
-class ThreadControl
-{
-	public:
-		ThreadControl(unsigned threadCount, TimestepAccessor &accessor)
-			: _accessor(accessor), _threadCount(threadCount), _isFinishing(false)
-		{
-			for(unsigned i=0;i<threadCount;++i)
-			{
-				ThreadFunction function;
-				function.number = i;
-				function.threadControl = this;
-				_threadGroup.create_thread(function);
-			}
-		}
-		void PushTask(const TaskInfo &taskInfo)
-		{
-			boost::mutex::scoped_lock lock(_mutex);
-			while(_tasks.size() > _threadCount * 10)
-			{
-				_queueFullCondition.wait(lock);
-			}
-
-			_tasks.push_back(taskInfo);
-			_dataAvailableCondition.notify_one();
-		}
-		bool WaitForTask(TaskInfo &taskInfo)
-		{
-			boost::mutex::scoped_lock lock(_mutex);
-			while(_tasks.empty() && !_isFinishing)
-			{
-				_dataAvailableCondition.wait(lock);
-			}
-			if(_isFinishing && _tasks.empty())
-				return false;
-			else
-			{
-				taskInfo = _tasks.front();
-				_tasks.pop_front();
-				_queueFullCondition.notify_one();
-				return true;
-			}
-		}
-		void Finish()
-		{
-			boost::mutex::scoped_lock lock(_mutex);
-			_isFinishing = true;
-			lock.unlock();
-			_dataAvailableCondition.notify_all();
-			_threadGroup.join_all();
-		}
-		boost::mutex &WriteMutex() { return _writeMutex; }
-		TimestepAccessor &Accessor() { return _accessor; }
-		unsigned QueueSize()
-		{
-			boost::mutex::scoped_lock lock(_mutex);
-			return _tasks.size();
-		}
-	private:
-		TimestepAccessor &_accessor;
-		boost::thread_group _threadGroup;
-		unsigned _threadCount;
-		bool _isFinishing;
-		boost::mutex _mutex;
-		boost::condition _dataAvailableCondition;
-		boost::condition _queueFullCondition;
-		std::deque<TaskInfo> _tasks;
-		boost::mutex _writeMutex;
-};
-
-void ThreadFunction::operator()()
-{
-	cout << "Thread " << number << " started\n";
-	TaskInfo task;
-	bool hasTask = threadControl->WaitForTask(task);
-	while(hasTask)
-	{
-		performAndWriteConvolution(threadControl->Accessor(), task, threadControl->WriteMutex());
-		hasTask = threadControl->WaitForTask(task);
-	}
-	cout << "Thread " << number << " finished\n";
-}
-
-int main(int argc, char *argv[])
-{
-	if(argc < 3)
-	{
-		cerr << "Syntax: " << argv[0] << " <fringe size> <taskIndex> <taskCount> <column-name> <locking> <MS1> [<MS2> [..]]\n";
-		cerr << " fringe size is a double and should be given in units of wavelength / fringe.\n";
-	} else {
-		const double fringeSize = atof(argv[1]);
-		cout << "Fringe size: " << fringeSize << '\n';
-
-		const int taskIndex = atoi(argv[2]), taskCount = atoi(argv[3]);
-		cout << "Task index " << taskIndex << " out of " << taskCount << '\n';
-		const std::string columnName = argv[4];
-		const bool performLocking(atoi(argv[5])!=0);
-		if(performLocking)
-			cout << "Locking WILL be performed.\n";
-		else
-			cout << "NO locking will be performend.\n";
-
-		TimestepAccessor accessor(performLocking);
-		for(int i=6;i<argc;++i)
-			accessor.AddMS(argv[i]);
-
-		accessor.SetColumnName(columnName);
-		accessor.Open();
-
-		unsigned long rows = accessor.TotalRowCount();
-		unsigned long start = rows * taskIndex / taskCount;
-		unsigned long end = rows * (taskIndex+1) / taskCount;
-		cout << "Filtering rows " << start << '-' << end << ".\n";
-		accessor.SetStartRow(start);
-		accessor.SetEndRow(end);
-
-		cout << "Number of polarizations: " << accessor.PolarizationCount() << '\n';
-		cout
-			<< "Number of channels: " << accessor.TotalChannelCount()
-			<< " (" << round(accessor.LowestFrequency()/1e6) << " MHz - "
-			<< round(accessor.HighestFrequency()/1e6) << " MHz)\n";
-
-		const unsigned long totalIterations = end - start;
-		cout << "Total iterations: " << totalIterations << '\n';
-		
-		const unsigned processorCount = System::ProcessorCount();
-		cout << "CPUs: " << processorCount << '\n';
-		ThreadControl threads(processorCount, accessor);
-
-		double maxFringeChannels = 0.0, minFringeChannels = 1e100;
-		const unsigned totalChannels = accessor.TotalChannelCount();
-
-		TimestepAccessor::TimestepIndex *index = new TimestepAccessor::TimestepIndex();
-		TimestepAccessor::TimestepData data;
-
-		data.Allocate(accessor.PolarizationCount(), totalChannels);
-		
-		unsigned iterSteps = 0;
-
-		boost::mutex::scoped_lock lock(threads.WriteMutex());
-		while(accessor.ReadNext(*index, data)) {
-			lock.unlock();
-
-			TaskInfo task;
-			task.index = index;
-			task.data = data;
-			
-			// Skip autocorrelations
-			if(data.antenna1 == data.antenna2)
-			{
-				data.Free(accessor.PolarizationCount());
-				delete index;
-			} else
-			{
-				// Calculate the convolution size
-				double u = data.u, v = data.v;
-				task.length = totalChannels;
-				task.convolutionSize = fringeSize * (double) totalChannels / uvDist(u, v, accessor.LowestFrequency(), accessor.HighestFrequency());
-				if(task.convolutionSize > maxFringeChannels) maxFringeChannels = task.convolutionSize;
-				if(task.convolutionSize < minFringeChannels) minFringeChannels = task.convolutionSize;
-				task.data = data;
-
-				// Add task
-				threads.PushTask(task);
-			}
-
-			index = new TimestepAccessor::TimestepIndex();
-			data.Allocate(accessor.PolarizationCount(), totalChannels);
-
-			lock.lock();
-			++iterSteps;
-
-			if(iterSteps%100==0)
-			{
-				cout << threads.QueueSize();
-				cout << '.' << flush;
-			}
-		}
-		lock.unlock();
-
-		data.Free(accessor.PolarizationCount());
-		delete index;
-
-		cout << "\nWaiting for threads to finish..." << endl;
-		threads.Finish();
-		cout << "Closing time accessor..." << endl;
-		accessor.Close();
-		cout
-			<< "Done. " << iterSteps << " steps taken.\n"
-			<< "Write action count: " << accessor.WriteActionCount() << '\n'
-			<< "Maximum filtering fringe size = " << maxFringeChannels << " channels, "
-			   "minimum = " << minFringeChannels << " channels. \n";
-	}
-}
diff --git a/CEP/DP3/AOFlagger/src/aofrequencyfilter.cpp b/CEP/DP3/AOFlagger/src/aofrequencyfilter.cpp
deleted file mode 100644
index 6f1932dfe37d403fa5f82105f1c4dfcbd2130c04..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/aofrequencyfilter.cpp
+++ /dev/null
@@ -1,278 +0,0 @@
-#include <iostream>
-
-#include <fftw3.h>
-
-#include <AOFlagger/remote/clusteredobservation.h>
-#include <AOFlagger/remote/observationtimerange.h>
-#include <AOFlagger/remote/processcommander.h>
-
-#include <AOFlagger/msio/system.h>
-
-#include <AOFlagger/util/lane.h>
-
-#include <AOFlagger/imaging/uvimager.h>
-
-#include <AOFlagger/strategy/algorithms/convolutions.h>
-
-using namespace std;
-using namespace aoRemote;
-
-lane<ObservationTimerange*> *readLane;
-lane<ObservationTimerange*> *writeLane;
-
-boost::mutex commanderMutex;
-ProcessCommander *commander;
-
-fftw_plan fftPlanForward, fftPlanBackward;
-const size_t rowCountPerRequest = 128;
-
-// fringe size is given in units of wavelength / fringe. Fringes smaller than that will be filtered.
-double filterFringeSize;
-
-bool isFilterSizeInChannels;
-
-/**
- * This function returns the distance between the u,v points of the highest and lowest frequencies.
- * The returned distance is in wavelengths.
- */
-double uvDist(double u, double v, double frequencyWidth)
-{
-	const double
-		ud = frequencyWidth * u,
-		vd = frequencyWidth * v;
-	return sqrt(ud * ud + vd * vd) / UVImager::SpeedOfLight();
-}
-
-void workThread()
-{
-	ObservationTimerange *timerange;
-	
-	// These are for diagnostic info
-	double maxFilterSizeInChannels = 0.0, minFilterSizeInChannels = 1e100;
-	
-	if(readLane->read(timerange))
-	{
-		const size_t channelCount = timerange->ChannelCount();
-		const unsigned polarizationCount = timerange->PolarizationCount();
-		fftw_complex
-			*fftIn = (fftw_complex*) fftw_malloc(sizeof(fftw_complex) * channelCount),
-			*fftOut = (fftw_complex*) fftw_malloc(sizeof(fftw_complex) * channelCount);
-		do
-		{
-			for(size_t t=0;t<timerange->TimestepCount();++t)
-			{
-				if(timerange->Antenna1(t) != timerange->Antenna2(t))
-				{
-					// Calculate the frequencies to filter
-					double u = timerange->U(t), v = timerange->V(t);
-					double limitFrequency = isFilterSizeInChannels ?
-						(channelCount / filterFringeSize) :
-						(uvDist(u, v, timerange->FrequencyWidth()) / filterFringeSize);
-					
-					if(limitFrequency*2 <= channelCount) // otherwise no frequencies had to be removed
-					{
-						if(limitFrequency > maxFilterSizeInChannels) maxFilterSizeInChannels = limitFrequency;
-						if(limitFrequency < minFilterSizeInChannels) minFilterSizeInChannels = limitFrequency;
-						for(unsigned p=0;p<polarizationCount;++p)
-						{
-							// Copy data in buffer
-							num_t *realPtr = timerange->RealData(t) + p;
-							num_t *imagPtr = timerange->ImagData(t) + p;
-							
-							for(size_t c=0;c<channelCount;++c)
-							{
-								fftIn[c][0] = *realPtr;
-								fftIn[c][1] = *imagPtr;
-								realPtr += polarizationCount;
-								imagPtr += polarizationCount;
-							}
-							
-							fftw_execute_dft(fftPlanForward, fftIn, fftOut);
-							size_t filterIndexSize = (limitFrequency > 1.0) ? (size_t) ceil(limitFrequency/2.0) : 1;
-							// Remove the high frequencies [filterIndexSize : n-filterIndexSize]
-							for(size_t f=filterIndexSize;f<channelCount - filterIndexSize;++f)
-							{
-								fftOut[f][0] = 0.0;
-								fftOut[f][1] = 0.0;
-							}
-							fftw_execute_dft(fftPlanBackward, fftOut, fftIn);
-
-							// Copy data back; fftw multiplies data with n, so divide by n.
-							double factor = 1.0 / (double) channelCount;
-							realPtr = timerange->RealData(t) + p;
-							imagPtr = timerange->ImagData(t) + p;
-							for(size_t c=0;c<channelCount;++c)
-							{
-								*realPtr = fftIn[c][0] * factor;
-								*imagPtr = fftIn[c][1] * factor;
-								realPtr += polarizationCount;
-								imagPtr += polarizationCount;
-							}
-						}
-					}
-				}
-			}
-			writeLane->write(timerange);
-		} while(readLane->read(timerange));
-		fftw_free(fftIn);
-		fftw_free(fftOut);
-	}
-	std::cout << "Worker finished. Filtersize range in channel: " << minFilterSizeInChannels << "-" << maxFilterSizeInChannels << '\n';
-}
-
-void readThreadFunction(ObservationTimerange &timerange, const size_t &totalRows)
-{
-	MSRowDataExt *rowBuffer[commander->Observation().Size()];
-	for(size_t i=0;i<commander->Observation().Size();++i)
-		rowBuffer[i] = new MSRowDataExt[rowCountPerRequest];
-
-	size_t currentRow = 0;
-	while(currentRow < totalRows)
-	{
-		size_t currentRowCount = rowCountPerRequest;
-		if(currentRow + currentRowCount > totalRows)
-			currentRowCount = totalRows - currentRow;
-		timerange.SetZero();
-		
-		boost::mutex::scoped_lock lock(commanderMutex);
-		std::cout << "Reading... " << std::flush;
-		commander->PushReadDataRowsTask(timerange, currentRow, currentRowCount, rowBuffer);
-		commander->Run(false);
-		commander->CheckErrors();
-		std::cout << "Done.\n" << std::flush;
-		lock.unlock();
-		
-		currentRow += currentRowCount;
-		cout << "Read " << currentRow << '/' << totalRows << '\n';
-		readLane->write(new ObservationTimerange(timerange));
-	}
-	for(size_t i=0;i<commander->Observation().Size();++i)
-		delete[] rowBuffer[i];
-}
-
-void writeThreadFunction()
-{
-	const ClusteredObservation &obs = commander->Observation();
-	MSRowDataExt *rowBuffer[obs.Size()];
-	for(size_t i=0;i<obs.Size();++i)
-		rowBuffer[i] = new MSRowDataExt[rowCountPerRequest];
-		
-	ObservationTimerange *timerange;
-	if(writeLane->read(timerange))
-	{
-		for(size_t i=0;i<obs.Size();++i)
-		{
-			for(size_t row=0;row<rowCountPerRequest;++row)
-				rowBuffer[i][row] = MSRowDataExt(timerange->PolarizationCount(), timerange->Band(i).channels.size());
-		}
-		do {
-			boost::mutex::scoped_lock lock(commanderMutex);
-			std::cout << "Writing... " << std::flush;
-			commander->PushWriteDataRowsTask(*timerange, rowBuffer);
-			commander->Run(false);
-			commander->CheckErrors();
-			std::cout << "Done.\n" << std::flush;
-			lock.unlock();
-			
-			delete timerange;
-		} while(writeLane->read(timerange));
-	}
-	std::cout << "Writer thread finished.\n";
-}
-
-void initializeFFTW(size_t channelCount)
-{
-	fftw_complex *fftIn, *fftOut;
-	
-	fftIn = (fftw_complex*) fftw_malloc(sizeof(fftw_complex) * channelCount);
-	fftOut = (fftw_complex*) fftw_malloc(sizeof(fftw_complex) * channelCount);
-	fftPlanForward = fftw_plan_dft_1d(channelCount, fftIn, fftOut, FFTW_FORWARD, FFTW_MEASURE);
-	fftPlanBackward = fftw_plan_dft_1d(channelCount, fftIn, fftOut, FFTW_BACKWARD, FFTW_MEASURE);
-
-	fftw_free(fftIn);
-	fftw_free(fftOut);
-}
-
-void deinitializeFFTW()
-{
-	fftw_destroy_plan(fftPlanForward);
-	fftw_destroy_plan(fftPlanBackward);
-}
-
-int main(int argc, char *argv[])
-{
-	if(argc != 4)
-	{
-		cerr << "Usage: aofrequencyfilter <reffile> <mode> <filterfringesize>\n"
-		"\tmode can be 'inChannels' (CH) or in uv wavelengths (UV)\n";
-	}
-	else {
-		string modeStr(argv[2]);
-		if(modeStr == "CH")
-			isFilterSizeInChannels = true;
-		else if(modeStr == "UV")
-			isFilterSizeInChannels = false;
-		else throw std::runtime_error("Bad mode");
-		
-		filterFringeSize = atof(argv[3]);
-		ClusteredObservation *obs = ClusteredObservation::Load(argv[1]);
-		commander = new ProcessCommander(*obs);
-		commander->PushReadAntennaTablesTask();
-		commander->PushReadBandTablesTask();
-		commander->Run(false);
-		commander->CheckErrors();
-		
-		ObservationTimerange timerange(*obs);
-		const std::vector<BandInfo> &bands = commander->Bands();
-		for(size_t i=0; i!=bands.size(); ++i)
-			timerange.SetBandInfo(i, bands[i]);
-		
-		const unsigned processorCount = System::ProcessorCount();
-		cout << "CPUs: " << processorCount << '\n';
-		unsigned polarizationCount = commander->PolarizationCount();
-		cout << "Polarization count: " << polarizationCount << '\n';
-		
-		timerange.Initialize(polarizationCount, rowCountPerRequest);
-		
-		cout << "Initializing FFTW..." << std::flush;
-		initializeFFTW(timerange.ChannelCount());
-		cout << " Done.\n";
-		
-		// We ask for "0" rows, which means we will ask for the total number of rows
-		commander->PushReadDataRowsTask(timerange, 0, 0, 0);
-		commander->Run(false);
-		commander->CheckErrors();
-		const size_t totalRows = commander->RowsTotal();
-		cout << "Total rows to filter: " << totalRows << '\n';
-		
-		readLane = new lane<ObservationTimerange*>(processorCount);
-		writeLane = new lane<ObservationTimerange*>(processorCount);
-		
-		// Start worker threads
-		boost::thread *threads[processorCount];
-		for(size_t i=0; i<processorCount; ++i)
-		{
-			threads[i] = new boost::thread(&workThread);
-		}
-		boost::thread writeThread(&writeThreadFunction);
-		
-		readThreadFunction(timerange, totalRows);
-		
-		// Shut down read workers
-		readLane->write_end();
-		for(size_t i=0; i<processorCount; ++i)
-		{
-			threads[i]->join();
-		}
-		delete readLane;
-		
-		// Shut down write worker
-		writeLane->write_end();
-		writeThread.join();
-		delete writeLane;
-		
-		// Clean
-		delete commander;
-		delete obs;
-	}
-}
diff --git a/CEP/DP3/AOFlagger/src/aoqplot.cpp b/CEP/DP3/AOFlagger/src/aoqplot.cpp
deleted file mode 100644
index 5f909a78d44399286135dce4f9385097f5601d24..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/aoqplot.cpp
+++ /dev/null
@@ -1,33 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2011 by A.R. Offringa                                   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#include <AOFlagger/gui/quality/aoqplotwindow.h>
-
-#include <gtkmm.h>
-
-int main(int argc, char *argv[])
-{
-	Gtk::Main kit(argc, argv);
-	AOQPlotWindow window;
-	if(argc>1)
-		window.Open(argv[1]);
-	kit.run();
-	return 0;
-}
diff --git a/CEP/DP3/AOFlagger/src/aoquality.cpp b/CEP/DP3/AOFlagger/src/aoquality.cpp
deleted file mode 100644
index 3fa1ca758de2bfa276fda6c625ae372a5f0c46b8..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/aoquality.cpp
+++ /dev/null
@@ -1,807 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2011 by A.R. Offringa                                   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#include <iostream>
-
-#include <tables/Tables/SetupNewTab.h>
-#include <tables/Tables/TableCopy.h>
-
-#include <AOFlagger/msio/measurementset.h>
-
-#include <AOFlagger/quality/defaultstatistics.h>
-#include <AOFlagger/quality/histogramcollection.h>
-#include <AOFlagger/quality/qualitytablesformatter.h>
-#include <AOFlagger/quality/statisticscollection.h>
-#include <AOFlagger/quality/statisticsderivator.h>
-
-#include <AOFlagger/remote/clusteredobservation.h>
-#include <AOFlagger/remote/processcommander.h>
-#include <AOFlagger/util/plot.h>
-
-#include <AOFlagger/configuration.h>
-
-#ifdef HAS_LOFARSTMAN
-#include <LofarStMan/Register.h>
-#include <AOFlagger/quality/histogramtablesformatter.h>
-#endif // HAS_LOFARSTMAN                                                       
-
-void reportProgress(unsigned step, unsigned totalSteps)
-{
-	const unsigned twoPercent = (totalSteps+49)/50;
-	if((step%twoPercent)==0)
-	{
-		if(((step/twoPercent)%5)==0)
-			std::cout << (100*step/totalSteps) << std::flush;
-		else
-			std::cout << '.' << std::flush;
-	}
-}
-
-enum CollectingMode
-{
-	CollectDefault,
-	CollectHistograms
-};
-
-void actionCollect(const std::string &filename, enum CollectingMode mode, StatisticsCollection &statisticsCollection, HistogramCollection &histogramCollection, bool mwaChannels, size_t flaggedTimesteps, const std::set<size_t> &flaggedAntennae)
-{
-	MeasurementSet *ms = new MeasurementSet(filename);
-	const unsigned polarizationCount = ms->GetPolarizationCount();
-	const unsigned bandCount = ms->BandCount();
-	const bool ignoreChannelZero = ms->ChannelZeroIsRubish();
-	const std::string stationName = ms->GetStationName();
-	BandInfo *bands = new BandInfo[bandCount];
-	double **frequencies = new double*[bandCount];
-	unsigned totalChannels = 0;
-	for(unsigned b=0;b<bandCount;++b)
-	{
-		bands[b] = ms->GetBandInfo(b);
-		frequencies[b] = new double[bands[b].channels.size()];
-		totalChannels += bands[b].channels.size();
-		for(unsigned c=0;c<bands[b].channels.size();++c)
-		{
-			frequencies[b][c] = bands[b].channels[c].frequencyHz;
-		}
-	}
-	delete ms;
-	
-	std::cout
-		<< "Polarizations: " << polarizationCount << '\n'
-		<< "Bands: " << bandCount << '\n'
-		<< "Channels/band: " << (totalChannels / bandCount) << '\n';
-	if(ignoreChannelZero)
-		std::cout << "Channel zero will be ignored, as this looks like a LOFAR data set with bad channel 0.\n";
-	else
-		std::cout << "Channel zero will be included in the statistics, as it seems that channel 0 is okay.\n";
-	
-	// Initialize statisticscollection
-	statisticsCollection.SetPolarizationCount(polarizationCount);
-	if(mode == CollectDefault)
-	{
-		for(unsigned b=0;b<bandCount;++b)
-		{
-			if(ignoreChannelZero)
-				statisticsCollection.InitializeBand(b, (frequencies[b]+1), bands[b].channels.size()-1);
-			else
-				statisticsCollection.InitializeBand(b, frequencies[b], bands[b].channels.size());
-		}
-	}
-	// Initialize Histograms collection
-	histogramCollection.SetPolarizationCount(polarizationCount);
-
-	// get columns
-	casa::Table table(filename, casa::Table::Update);
-	const char *dataColumnName = "DATA";
-	casa::ROArrayColumn<casa::Complex> dataColumn(table, dataColumnName);
-	casa::ROArrayColumn<bool> flagColumn(table, "FLAG");
-	casa::ROScalarColumn<double> timeColumn(table, "TIME");
-	casa::ROScalarColumn<int> antenna1Column(table, "ANTENNA1"); 
-	casa::ROScalarColumn<int> antenna2Column(table, "ANTENNA2");
-	casa::ROScalarColumn<int> windowColumn(table, "DATA_DESC_ID");
-	
-	std::cout << "Collecting statistics..." << std::endl;
-	
-	size_t channelCount = bands[0].channels.size();
-	bool correlatorFlags[channelCount], correlatorFlagsForBadAntenna[channelCount];
-	for(size_t ch=0; ch!=channelCount; ++ch)
-	{
-		correlatorFlags[ch] = false;
-		correlatorFlagsForBadAntenna[ch] = true;
-	}
-	
-	if(mwaChannels)
-	{
-		if(channelCount%24 != 0)
-			std::cout << "MWA channels requested, but nr of channels not a multiply of 24. Ignoring.\n";
-		else {
-			size_t chanPerSb = channelCount/24;
-			for(size_t x=0;x!=24;++x)
-			{
-				correlatorFlags[x*chanPerSb] = true;
-				correlatorFlags[x*chanPerSb + chanPerSb/2] = true;
-				correlatorFlags[x*chanPerSb + chanPerSb-1] = true;
-			}
-		}
-	}
-	
-	const unsigned nrow = table.nrow();
-	size_t timestepIndex = (size_t) -1;
-	double prevtime = -1.0;
-	for(unsigned row = 0; row!=nrow; ++row)
-	{
-		const double time = timeColumn(row);
-		const unsigned antenna1Index = antenna1Column(row);
-		const unsigned antenna2Index = antenna2Column(row);
-		const unsigned bandIndex = windowColumn(row);
-		
-		if(time != prevtime)
-		{
-			++timestepIndex;
-			prevtime = time;
-		}
-		
-		const BandInfo &band = bands[bandIndex];
-		
-		const casa::Array<casa::Complex> dataArray = dataColumn(row);
-		const casa::Array<bool> flagArray = flagColumn(row);
-		
-		std::complex<float> *samples[polarizationCount];
-		bool *isRFI[polarizationCount];
-		for(unsigned p = 0; p < polarizationCount; ++p)
-		{
-			isRFI[p] = new bool[band.channels.size()];
-			samples[p] = new std::complex<float>[band.channels.size()];
-		}
-		const bool antennaIsFlagged =
-			flaggedAntennae.find(antenna1Index) != flaggedAntennae.end() ||
-			flaggedAntennae.find(antenna2Index) != flaggedAntennae.end();
-		
-		casa::Array<casa::Complex>::const_iterator dataIter = dataArray.begin();
-		casa::Array<bool>::const_iterator flagIter = flagArray.begin();
-		const unsigned startChannel = ignoreChannelZero ? 1 : 0;
-		if(ignoreChannelZero)
-		{
-			for(unsigned p = 0; p < polarizationCount; ++p)
-			{
-				++dataIter;
-				++flagIter;
-			}
-		}
-		for(unsigned channel = startChannel ; channel<band.channels.size(); ++channel)
-		{
-			for(unsigned p = 0; p < polarizationCount; ++p)
-			{
-				samples[p][channel - startChannel] = *dataIter;
-				isRFI[p][channel - startChannel] = *flagIter;
-				
-				++dataIter;
-				++flagIter;
-			}
-		}
-		
-		for(unsigned p = 0; p < polarizationCount; ++p)
-		{
-			switch(mode)
-			{
-				case CollectDefault:
-					if(antennaIsFlagged || timestepIndex < flaggedTimesteps)
-						statisticsCollection.Add(antenna1Index, antenna2Index, time, bandIndex, p, &reinterpret_cast<float*>(samples[p])[0], &reinterpret_cast<float*>(samples[p])[1], isRFI[p], correlatorFlagsForBadAntenna, band.channels.size() - startChannel, 2, 1, 1);
-					else
-						statisticsCollection.Add(antenna1Index, antenna2Index, time, bandIndex, p, &reinterpret_cast<float*>(samples[p])[0], &reinterpret_cast<float*>(samples[p])[1], isRFI[p], correlatorFlags, band.channels.size() - startChannel, 2, 1, 1);
-					break;
-				case CollectHistograms:
-					histogramCollection.Add(antenna1Index, antenna2Index, p, samples[p], isRFI[p], band.channels.size() - startChannel);
-					break;
-			}
-		}
-
-		for(unsigned p = 0; p < polarizationCount; ++p)
-		{
-			delete[] isRFI[p];
-			delete[] samples[p];
-		}
-		
-		reportProgress(row, nrow);
-	}
-	
-	for(unsigned b=0;b<bandCount;++b)
-		delete[] frequencies[b];
-	delete[] frequencies;
-	delete[] bands;
-	std::cout << "100\n";
-}
-
-void actionCollect(const std::string &filename, enum CollectingMode mode, bool mwaChannels, size_t flaggedTimesteps, const std::set<size_t> &flaggedAntennae)
-{
-	StatisticsCollection statisticsCollection;
-	HistogramCollection histogramCollection;
-	
-	actionCollect(filename, mode, statisticsCollection, histogramCollection, mwaChannels, flaggedTimesteps, flaggedAntennae);
-	
-	switch(mode)
-	{
-		case CollectDefault:
-			{
-				std::cout << "Writing quality tables..." << std::endl;
-				
-				QualityTablesFormatter qualityData(filename);
-				statisticsCollection.Save(qualityData);
-			}
-			break;
-		case CollectHistograms:
-			{
-				std::cout << "Writing histogram tables..." << std::endl;
-				
-				HistogramTablesFormatter histograms(filename);
-				histogramCollection.Save(histograms);
-			}
-			break;
-	}
-	
-	std::cout << "Done.\n";
-}
-
-void actionCollectHistogram(const std::string &filename, HistogramCollection &histogramCollection, bool mwaChannels, size_t flaggedTimesteps, const std::set<size_t> &flaggedAntennae)
-{
-	StatisticsCollection tempCollection;
-	actionCollect(filename, CollectHistograms, tempCollection, histogramCollection, mwaChannels, flaggedTimesteps, flaggedAntennae);
-}
-
-void printStatistics(std::complex<long double> *complexStat, unsigned count)
-{
-	if(count != 1)
-		std::cout << '[';
-	if(count > 0)
-		std::cout << complexStat[0].real() << " + " << complexStat[0].imag() << 'i';
-	for(unsigned p=1;p<count;++p)
-	{
-		std::cout << ", " << complexStat[p].real() << " + " << complexStat[p].imag() << 'i';
-	}
-	if(count != 1)
-		std::cout << ']';
-}
-
-void printStatistics(unsigned long *stat, unsigned count)
-{
-	if(count != 1)
-		std::cout << '[';
-	if(count > 0)
-		std::cout << stat[0];
-	for(unsigned p=1;p<count;++p)
-	{
-		std::cout << ", " << stat[p];
-	}
-	if(count != 1)
-		std::cout << ']';
-}
-
-void printStatistics(const DefaultStatistics &statistics)
-{
-	std::cout << "Count=";
-	printStatistics(statistics.count, statistics.PolarizationCount());
-	std::cout << "\nSum=";
-	printStatistics(statistics.sum, statistics.PolarizationCount());
-	std::cout << "\nSumP2=";
-	printStatistics(statistics.sumP2, statistics.PolarizationCount());
-	std::cout << "\nDCount=";
-	printStatistics(statistics.dCount, statistics.PolarizationCount());
-	std::cout << "\nDSum=";
-	printStatistics(statistics.dSum, statistics.PolarizationCount());
-	std::cout << "\nDSumP2=";
-	printStatistics(statistics.dSumP2, statistics.PolarizationCount());
-	std::cout << "\nRFICount=";
-	printStatistics(statistics.rfiCount, statistics.PolarizationCount());
-	std::cout << '\n';
-}
-
-void actionQueryGlobalStat(const std::string &kindName, const std::string &filename)
-{
-	MeasurementSet *ms = new MeasurementSet(filename);
-	const unsigned polarizationCount = ms->GetPolarizationCount();
-	const BandInfo band = ms->GetBandInfo(0);
-	delete ms;
-	
-	const QualityTablesFormatter::StatisticKind kind = QualityTablesFormatter::NameToKind(kindName);
-	
-	QualityTablesFormatter formatter(filename);
-	StatisticsCollection collection(polarizationCount);
-	collection.Load(formatter);
-	DefaultStatistics statistics(polarizationCount);
-	collection.GetGlobalCrossBaselineStatistics(statistics);
-	StatisticsDerivator derivator(collection);
-	
-	double start = band.channels.begin()->frequencyHz;
-	double end = band.channels.rbegin()->frequencyHz;
-	std::cout << round(start/10000.0)/100.0 << '\t' << round(end/10000.0)/100.0;
-	for(unsigned p=0;p<polarizationCount;++p)
-	{
-		long double val = derivator.GetStatisticAmplitude(kind, statistics, p);
-		std::cout << '\t' << val;
-	}
-	std::cout << '\n';
-}
-
-void actionQueryBaselines(const std::string &kindName, const std::string &filename)
-{
-	MeasurementSet *ms = new MeasurementSet(filename);
-	const unsigned polarizationCount = ms->GetPolarizationCount();
-	delete ms;
-	
-	const QualityTablesFormatter::StatisticKind kind = QualityTablesFormatter::NameToKind(kindName);
-	
-	QualityTablesFormatter formatter(filename);
-	StatisticsCollection collection(polarizationCount);
-	collection.Load(formatter);
-	const std::vector<std::pair<unsigned, unsigned> > &baselines = collection.BaselineStatistics().BaselineList();
-	StatisticsDerivator derivator(collection);
-
-	std::cout << "ANTENNA1\tANTENNA2";
-	for(unsigned p=0;p<polarizationCount;++p)
-		std::cout << '\t' << kindName << "_POL" << p << "_R\t" << kindName << "_POL" << p << "_I" ;
-	std::cout << '\n';
-	for(std::vector<std::pair<unsigned, unsigned> >::const_iterator i=baselines.begin();i!=baselines.end();++i)
-	{
-		const unsigned antenna1 = i->first, antenna2 = i->second;
-		std::cout << antenna1 << '\t' << antenna2;
-		for(unsigned p=0;p<polarizationCount;++p)
-		{
-			const std::complex<long double> val = derivator.GetComplexBaselineStatistic(kind, antenna1, antenna2, p);
-			std::cout << '\t' << val.real() << '\t' << val.imag();
-		}
-		std::cout << '\n';
-	}
-}
-
-void actionQueryTime(const std::string &kindName, const std::string &filename)
-{
-	const unsigned polarizationCount = MeasurementSet::GetPolarizationCount(filename);
-	const QualityTablesFormatter::StatisticKind kind = QualityTablesFormatter::NameToKind(kindName);
-	
-	QualityTablesFormatter formatter(filename);
-	StatisticsCollection collection(polarizationCount);
-	collection.Load(formatter);
-	const std::map<double, DefaultStatistics> &timeStats = collection.TimeStatistics();
-	StatisticsDerivator derivator(collection);
-
-	std::cout << "TIME";
-	for(unsigned p=0;p<polarizationCount;++p)
-		std::cout << '\t' << kindName << "_POL" << p << "_R\t" << kindName << "_POL" << p << "_I" ;
-	std::cout << '\n';
-	for(std::map<double, DefaultStatistics>::const_iterator i=timeStats.begin();i!=timeStats.end();++i)
-	{
-		const double time = i->first;
-		std::cout << time;
-		for(unsigned p=0;p<polarizationCount;++p)
-		{
-			const std::complex<long double> val = derivator.GetComplexStatistic(kind, i->second, p);
-			std::cout << '\t' << val.real() << '\t' << val.imag();
-		}
-		std::cout << '\n';
-	}
-}
-
-void actionSummarize(const std::string &filename)
-{
-	bool remote = aoRemote::ClusteredObservation::IsClusteredFilename(filename);
-	StatisticsCollection statisticsCollection;
-	HistogramCollection histogramCollection;
-	if(remote)
-	{
-		aoRemote::ClusteredObservation *observation = aoRemote::ClusteredObservation::Load(filename);
-		aoRemote::ProcessCommander commander(*observation);
-		commander.PushReadQualityTablesTask(&statisticsCollection, &histogramCollection);
-		commander.Run();
-		delete observation;
-	}
-	else {
-		MeasurementSet *ms = new MeasurementSet(filename);
-		const unsigned polarizationCount = ms->GetPolarizationCount();
-		delete ms;
-		
-		statisticsCollection.SetPolarizationCount(polarizationCount);
-		QualityTablesFormatter qualityData(filename);
-		statisticsCollection.Load(qualityData);
-	}
-	
-	DefaultStatistics statistics(statisticsCollection.PolarizationCount());
-	
-	statisticsCollection.GetGlobalTimeStatistics(statistics);
-	std::cout << "Time statistics: \n";
-	printStatistics(statistics);
-	
-	statisticsCollection.GetGlobalFrequencyStatistics(statistics);
-	std::cout << "\nFrequency statistics: \n";
-	printStatistics(statistics);
-
-	statisticsCollection.GetGlobalCrossBaselineStatistics(statistics);
-	std::cout << "\nCross-correlated baseline statistics: \n";
-	printStatistics(statistics);
-	
-	DefaultStatistics singlePolStat = statistics.ToSinglePolarization();
-	std::cout << "RFIPercentange: " << StatisticsDerivator::GetStatisticAmplitude(QualityTablesFormatter::RFIPercentageStatistic, singlePolStat, 0) << '\n';
-
-	statisticsCollection.GetGlobalAutoBaselineStatistics(statistics);
-	std::cout << "\nAuto-correlated baseline: \n";
-	printStatistics(statistics);
-}
-
-void actionSummarizeRFI(const std::string &filename)
-{
-	MeasurementSet *ms = new MeasurementSet(filename);
-	const unsigned polarizationCount = ms->GetPolarizationCount();
-	const BandInfo band = ms->GetBandInfo(0);
-	delete ms;
-	
-	StatisticsCollection statisticsCollection;
-	statisticsCollection.SetPolarizationCount(polarizationCount);
-	QualityTablesFormatter qualityData(filename);
-	statisticsCollection.Load(qualityData);
-	DefaultStatistics statistics(statisticsCollection.PolarizationCount());
-	statisticsCollection.GetGlobalCrossBaselineStatistics(statistics);
-	DefaultStatistics singlePolStat = statistics.ToSinglePolarization();
-	
-	double start = band.channels.begin()->frequencyHz;
-	double end = band.channels.rbegin()->frequencyHz;
-	std::cout << "Start:\t" << round(start/10000.0)/100.0 << "\tEnd:\t" << round(end/10000.0)/100.0
-		<<  "\tRFIPercentange:\t"
-		<< StatisticsDerivator::GetStatisticAmplitude(QualityTablesFormatter::RFIPercentageStatistic, singlePolStat, 0) << '\n';
-}
-
-void actionCombine(const std::string outFilename, const std::vector<std::string> inFilenames)
-{
-	if(!inFilenames.empty())
-	{
-		const std::string &firstInFilename = *inFilenames.begin();
-		bool remote = aoRemote::ClusteredObservation::IsClusteredFilename(firstInFilename);
-		
-		if(remote && inFilenames.size() != 1)
-			throw std::runtime_error("Can only open one remote observation file at a time");
-		
-		if(!casa::Table::isReadable(outFilename))
-		{
-			if(remote)
-			{
-				/*aoRemote::ClusteredObservation *observation = aoRemote::ClusteredObservation::Load(firstInFilename);
-				aoRemote::ProcessCommander commander(*observation);
-				commander.PushReadAntennaTablesTask();
-				commander.PushReadQualityTablesTask();
-				commander.Run();
-				QualityTablesFormatter formatter(outFilename);
-				commander.Statistics().Save(formatter);
-				delete observation;*/
-			} else {
-				// TODO read antenna tables from "firstInFilename"
-				// TODO read quality tables from all inFilenames
-			}
-			// TODO: create main table
-			//casa::SetupNewTable mainTableSetup(outFilename, templateSet.tableDesc(), casa::Table::New);
-			//casa::Table mainOutputTable(mainTableSetup);
-			
-			// TODO: create antenna table			
-			//casa::SetupNewTable antennaTableSetup(outFilename + "/ANTENNA", templateAntennaTable.tableDesc(), casa::Table::New);
-			//casa::Table antennaOutputTable(antennaTableSetup);
-			//mainOutputTable.rwKeywordSet().defineTable("ANTENNA", antennaOutputTable);
-			
-			// TODO fill antenna table
-			
-			// TODO fill quality table
-		}
-	}
-}
-
-void actionRemove(const std::string &filename)
-{
-	QualityTablesFormatter formatter(filename);
-	formatter.RemoveAllQualityTables();
-}
-
-void printRFISlopeForHistogram(const std::map<HistogramCollection::AntennaPair, LogHistogram*> &histogramMap, char polarizationSymbol, const AntennaInfo *antennae)
-{
-	for(std::map<HistogramCollection::AntennaPair, LogHistogram*>::const_iterator i=histogramMap.begin(); i!=histogramMap.end();++i)
-	{
-		const unsigned a1 = i->first.first, a2 = i->first.second;
-		Baseline baseline(antennae[a1], antennae[a2]);
-		double length = baseline.Distance();
-		const LogHistogram &histogram = *i->second;
-		double start, end;
-		histogram.GetRFIRegion(start, end);
-		double slope = histogram.NormalizedSlope(start, end);
-		double stddev = histogram.NormalizedSlopeStdError(start, end, slope);
-		std::cout << polarizationSymbol << '\t' << a1 << '\t' << a2 << '\t' << length << '\t' << slope << '\t' << stddev << '\n';
-	}
-}
-
-void actionHistogram(const std::string &filename, const std::string &query, bool mwaChannels)
-{
-	HistogramTablesFormatter histogramFormatter(filename);
-	const unsigned polarizationCount = MeasurementSet::GetPolarizationCount(filename);
-	if(query == "rfislope")
-	{
-		HistogramCollection collection(polarizationCount);
-		collection.Load(histogramFormatter);
-		MeasurementSet set(filename);
-		std::cout << set.GetBandInfo(0).CenterFrequencyHz();
-		for(unsigned p=0;p<polarizationCount;++p)
-		{
-			LogHistogram histogram;
-			collection.GetRFIHistogramForCrossCorrelations(p, histogram);
-			std::cout <<  '\t' << histogram.NormalizedSlopeInRFIRegion();
-		}
-		std::cout << '\n';
-	} else if(query == "rfislope-per-baseline")
-	{
-		HistogramCollection collection;
-		actionCollectHistogram(filename, collection, mwaChannels, 0, std::set<size_t>());
-		MeasurementSet set(filename);
-		size_t antennaCount = set.AntennaCount();
-		AntennaInfo antennae[antennaCount];
-		for(size_t a=0;a<antennaCount;++a)
-			antennae[a] = set.GetAntennaInfo(a);
-		
-		HistogramCollection *summedCollection = collection.CreateSummedPolarizationCollection();
-		const std::map<HistogramCollection::AntennaPair, LogHistogram*> &histogramMap = summedCollection->GetRFIHistogram(0);
-		printRFISlopeForHistogram(histogramMap, '*', antennae);
-		delete summedCollection;
-		for(unsigned p=0;p<polarizationCount;++p)
-		{
-			const std::map<HistogramCollection::AntennaPair, LogHistogram*> &histogramMap = collection.GetRFIHistogram(p);
-			printRFISlopeForHistogram(histogramMap, '0' + p, antennae);
-		}
-	} else if(query == "remove")
-	{
-		histogramFormatter.RemoveAll();
-	} else
-	{
-		std::cerr << "Unknown histogram command: " << query << "\n";
-	}
-}
-
-void printSyntax(std::ostream &stream, char *argv[])
-{
-	stream << "Syntax: " << argv[0] <<
-		" <action> [options]\n\n"
-		"Possible actions:\n"
-		"\thelp        - Get more info about an action (usage: '" << argv[0] << " help <action>')\n"
-		"\tcollect     - Processes the entire measurement set, collects the statistics\n"
-		"\t              and writes them in the quality tables.\n"
-		"\tcombine     - Combine several tables.\n"
-		"\thistogram   - Various histogram actions.\n"
-		"\tquery_b     - Query baselines.\n"
-		"\tquery_t     - Query time.\n"
-		"\tquery_g     - Query single global statistic.\n"
-		"\tremove      - Remove all quality tables.\n"
-		"\tsummarize   - Give a summary of the statistics currently in the quality tables.\n"
-		"\tsummarizerfi- Give a summary of the rfi statistics.\n";
-}
-
-int main(int argc, char *argv[])
-{
-#ifdef HAS_LOFARSTMAN
-	register_lofarstman();
-#endif // HAS_LOFARSTMAN
-
-	if(argc < 2)
-	{
-		printSyntax(std::cerr, argv);
-		return -1;
-	} else {
-		
-		const std::string action = argv[1];
-		
-		if(action == "help")
-		{
-			if(argc != 3)
-			{
-				printSyntax(std::cout, argv);
-			} else {
-				std::string helpAction = argv[2];
-				if(helpAction == "help")
-				{
-					printSyntax(std::cout, argv);
-				}
-				else if(helpAction == "collect")
-				{
-					std::cout << "Syntax: " << argv[0] << " collect [-a] <ms>\n\n"
-						"The collect action will go over a whole measurement set and \n"
-						"collect the default statistics. It will write the results in the \n"
-						"quality subtables of the main measurement set.\n\n"
-						"Currently, the default statistics are:\n"
-						"\tRFIRatio, Count, Mean, SumP2, DCount, DMean, DSumP2.\n"
-						"The subtables that will be updated are:\n"
-						"\tQUALITY_KIND_NAME, QUALITY_TIME_STATISTIC,\n"
-						"\tQUALITY_FREQUENCY_STATISTIC and QUALITY_BASELINE_STATISTIC.\n\n"
-						"-c will use the CORRECTED_DATA column.\n";
-				}
-				else if(helpAction == "summarize")
-				{
-					std::cout << "Syntax: " << argv[0] << " summarize <ms>\n\n"
-						"Gives a summary of the statistics in the measurement set.\n";
-				}
-				else if(helpAction == "query_b")
-				{
-					std::cout << "Syntax: " << argv[0] << " query_b <kind> <ms>\n\n"
-						"Prints the given statistic for each baseline.\n";
-				}
-				else if(helpAction == "query_t")
-				{
-					std::cout << "Syntax: " << argv[0] << " query_t <kind> <ms>\n\n"
-						"Print the given statistic for each time step.\n";
-				}
-				else if(helpAction == "query_g")
-				{
-					std::cout << "Syntax " << argv[0] << " query_g <kind> <ms>\n\n"
-						"Print the given statistic for this measurement set.\n";
-				}
-				else if(helpAction == "combine")
-				{
-					std::cout << "Syntax: " << argv[0] << " combine <target_ms> [<in_ms> [<in_ms> ..]]\n\n"
-						"This will read all given input measurement sets, combine the statistics and \n"
-						"write the results to a target measurement set. The target measurement set should\n"
-						"not exist beforehand.\n";
-				}
-				else if(helpAction == "histogram")
-				{
-					std::cout << "Syntax: " << argv[0] << " histogram <query> <ms>]\n\n"
-						"Query can be:\n"
-						"\trfislope - performs linear regression on the part of the histogram that should contain the RFI.\n"
-						"\t           Reports one value per polarisation.\n";
-				}
-				else if(helpAction == "remove")
-				{
-					std::cout << "Syntax: " << argv[0] << " remove [ms]\n\n"
-						"This will completely remove all quality tables from the measurement set.\n";
-				}
-				else
-				{
-					std::cerr << "Unknown action specified in help.\n";
-					return -1;
-				}
-			}
-		}
-		else if(action == "collect" || action == "mwacollect")
-		{
-			bool mwacollect = (action == "mwacollect");
-			if(argc < 3)
-			{
-				std::cerr << "collect actions needs one or two parameters (the measurement set)\n";
-				return -1;
-			}
-			else {
-				bool histograms = (std::string(argv[2]) == "-h");
-				int argi = histograms ? 3 : 2;
-				std::string filename = argv[argi];
-				size_t flaggedTimesteps = 0;
-				++argi;
-				std::set<size_t> flaggedAntennae;
-				if(argi != argc) {
-					flaggedTimesteps = atoi(argv[argi]);
-					++argi;
-					while(argi != argc) {
-						flaggedAntennae.insert(atoi(argv[argi]));
-						++argi;
-					}
-				}
-				actionCollect(filename, histograms ? CollectHistograms : CollectDefault, mwacollect, flaggedTimesteps, flaggedAntennae);
-			}
-		}
-		else if(action == "combine")
-		{
-			if(argc < 3 )
-			{
-				std::cerr << "combine actions needs at least one parameter.\n";
-				return -1;
-			}
-			else {
-				std::string outFilename = argv[2];
-				std::vector<std::string> inFilenames;
-				for(int i=3;i<argc;++i)
-					inFilenames.push_back(argv[i]);
-				actionCombine(outFilename, inFilenames);
-			}
-		}
-		else if(action == "histogram")
-		{
-			if(argc != 4)
-			{
-				std::cerr << "histogram actions needs two parameters (the query and the measurement set)\n";
-				return -1;
-			}
-			else {
-				actionHistogram(argv[3], argv[2], false);
-			}
-		}
-		else if(action == "summarize")
-		{
-			if(argc != 3)
-			{
-				std::cerr << "summarize actions needs one parameter (the measurement set)\n";
-				return -1;
-			}
-			else {
-				actionSummarize(argv[2]);
-			}
-		}
-		else if(action == "summarizerfi")
-		{
-			if(argc != 3)
-			{
-				std::cerr << "summarizerfi actions needs one parameter (the measurement set)\n";
-				return -1;
-			}
-			else {
-				actionSummarizeRFI(argv[2]);
-			}
-		}
-		else if(action == "query_g")
-		{
-			if(argc != 4)
-			{
-				std::cerr << "Syntax for query global stat: 'aoquality query_g <KIND> <MS>'\n";
-				return -1;
-			}
-			else {
-				actionQueryGlobalStat(argv[2], argv[3]);
-			}
-		}
-		else if(action == "query_b")
-		{
-			if(argc != 4)
-			{
-				std::cerr << "Syntax for query baselines: 'aoquality query_b <KIND> <MS>'\n";
-				return -1;
-			}
-			else {
-				actionQueryBaselines(argv[2], argv[3]);
-			}
-		}
-		else if(action == "query_t")
-		{
-			if(argc != 4)
-			{
-				std::cerr << "Syntax for query times: 'aoquality query_t <KIND> <MS>'\n";
-				return -1;
-			}
-			else {
-				actionQueryTime(argv[2], argv[3]);
-				return 0;
-			}
-		}
-		else if(action == "remove")
-		{
-			if(argc != 3)
-			{
-				std::cerr << "Syntax for removing quality tables: 'aoquality remove <MS>'\n";
-				return -1;
-			}
-			else {
-				actionRemove(argv[2]);
-				return 0;
-			}
-		}
-		else
-		{
-			std::cerr << "Unknown action '" << action << "'.\n\n";
-			printSyntax(std::cerr, argv);
-			return -1;
-		}
-		
-		return 0;
-	}
-}
diff --git a/CEP/DP3/AOFlagger/src/aorefscript.cpp b/CEP/DP3/AOFlagger/src/aorefscript.cpp
deleted file mode 100644
index 99c18663810580528970de7a562b846c28a523e0..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/aorefscript.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2011 by A.R. Offringa                                   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#include <iostream>
-
-#include <AOFlagger/ref/concatenatescript.h>
-#include <AOFlagger/ref/copyallscript.h>
-#include <AOFlagger/ref/flagallscript.h>
-#include <AOFlagger/ref/listnodes.h>
-#include <AOFlagger/ref/listsets.h>
-#include <AOFlagger/ref/refmovescript.h>
-
-using namespace std;
-
-int main(int argc, char *argv[])
-{
-	if(argc != 4)
-	{
-		cerr << "Syntax: " << argv[0] << " <scripttype> <reffile> <local-destination>\n"
-			"script types: concatenate, copyall, flagall, refmove, listnodes, listsets\n";
-		return -1;
-	} else {
-		string type(argv[1]);
-		if(type == "concatenate")
-			AOTools::ConcatenateScript::Make(cout, argv[2], argv[3]);
-		else if(type =="copyall")
-			AOTools::CopyAllScript::Make(cout, argv[2], argv[3]);
-		else if(type =="flagall")
-			AOTools::FlagAllScript::Make(cout, argv[2], argv[3]);
-		else if(type =="refmove")
-			AOTools::RefMoveScript::Make(cout, argv[2], argv[3]);
-		else if(type =="listnodes")
-			AOTools::ListNodes::Make(cout, argv[2]);
-		else if(type =="listsets")
-			AOTools::ListSets::Make(cout, argv[2]);
-		else
-			cerr << "Incorrect script type given." << "\n";
-		return 0;
-	}
-}
diff --git a/CEP/DP3/AOFlagger/src/aoremoteclient.cpp b/CEP/DP3/AOFlagger/src/aoremoteclient.cpp
deleted file mode 100644
index 87b54dc0e59f5828d62f08e9f23d767fc34012b5..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/aoremoteclient.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2011 by A.R. Offringa                                   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#include <iostream>
-
-#include <AOFlagger/remote/client.h>
-
-#include <AOFlagger/quality/statisticscollection.h>
-
-int main(int argc, char *argv[])
-{
-	if(argc == 3)
-	{
-		std::string serverHost = argv[2];
-		aoRemote::Client client;
-		client.Run(serverHost);
-	} else {
-		std::cerr << "Syntax: aoremoteclient connect <serverhost>\n";
-	}
-}
diff --git a/CEP/DP3/AOFlagger/src/aostats.cpp b/CEP/DP3/AOFlagger/src/aostats.cpp
deleted file mode 100644
index 3b6468a57783a13f3fe4b0fe60890bead050dd63..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/aostats.cpp
+++ /dev/null
@@ -1,76 +0,0 @@
-
-#include <iostream>
-#include <cmath>
-
-#include <ms/MeasurementSets/MSTable.h>
-#include <ms/MeasurementSets/MSColumns.h>
-
-#include <AOFlagger/msio/measurementset.h>
-#include <AOFlagger/strategy/algorithms/rfistatistics.h>
-
-using namespace std;
-
-int main(int argc, char *argv[])
-{
-	if(argc != 2)
-	{
-		cerr << "Usage: " << argv[0] << " <MS>\n";
-	} else {
-		std::string msPath = argv[1];
-		
-		MeasurementSet ms(msPath);
-		const BandInfo band = ms.GetBandInfo(0);
-		
-		const unsigned polarizationCount = ms.GetPolarizationCount();
-		
-		casa::Table table(msPath);
-		casa::ROArrayColumn<casa::Complex> dataCol(table, "DATA");
-		casa::ROArrayColumn<bool> flagCol(table, "FLAG");
-		casa::ROScalarColumn<double> timeCol(table, "TIME");
-		casa::ROScalarColumn<int> antenna1Col(table, "ANTENNA1");
-		casa::ROScalarColumn<int> antenna2Col(table, "ANTENNA2");
-		
-		RFIStatistics statistics;
-		
-		for(size_t row=0;row<table.nrow();++row)
-		{
-			size_t antenna1 = antenna1Col(row);
-			size_t antenna2 = antenna2Col(row);
-			if(antenna1 != antenna2)
-			{
-				double time = timeCol(row);
-				casa::Array<casa::Complex> dataArray = dataCol(row);
-				casa::Array<bool> flagsArray = flagCol(row);
-				casa::Array<casa::Complex>::const_iterator dataIterator = dataArray.begin();
-				casa::Array<bool>::const_iterator flagIterator = flagsArray.begin();
-				
-				RFIStatistics::TimeFrequencyInfo tfInfo;
-				tfInfo.time = time;
-				tfInfo.centralFrequency = band.CenterFrequencyHz();
-				for(unsigned freqIndex = 0;freqIndex < band.channels.size();++freqIndex)
-				{
-					for(unsigned p=0;p<polarizationCount;++p)
-					{
-						const bool flag = *flagIterator;
-						const casa::Complex data = *dataIterator;
-						const double amplitude = sqrt((double) data.imag()*data.imag() + data.real()*data.real());
-						if(std::isfinite(amplitude))
-						{
-							if(flag)
-							{
-								++tfInfo.rfiCount;
-								tfInfo.rfiAmplitude += amplitude;
-							}
-							++tfInfo.totalCount;
-							tfInfo.totalAmplitude += amplitude;
-						}
-						++flagIterator;
-						++dataIterator;
-					}
-				}
-				statistics.Add(tfInfo, false);
-			}
-		}
-		statistics.Save();
-	}
-}
diff --git a/CEP/DP3/AOFlagger/src/badstations.cpp b/CEP/DP3/AOFlagger/src/badstations.cpp
deleted file mode 100644
index a1680e9f032841746b432d4eca16bf81618e90dd..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/badstations.cpp
+++ /dev/null
@@ -1,123 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2011 by A.R. Offringa                                   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#include <iostream>
-
-#include <AOFlagger/strategy/algorithms/baselineselector.h>
-
-#include <AOFlagger/msio/measurementset.h>
-
-#include <AOFlagger/quality/defaultstatistics.h>
-#include <AOFlagger/quality/histogramcollection.h>
-#include <AOFlagger/quality/qualitytablesformatter.h>
-#include <AOFlagger/quality/statisticscollection.h>
-#include <AOFlagger/quality/statisticsderivator.h>
-
-#include <AOFlagger/remote/clusteredobservation.h>
-#include <AOFlagger/remote/processcommander.h>
-
-#include <AOFlagger/configuration.h>
-
-#ifdef HAS_LOFARSTMAN
-#include <LofarStMan/Register.h>
-#include <AOFlagger/quality/histogramtablesformatter.h>
-#endif // HAS_LOFARSTMAN                                                       
-
-void checkStations(const std::string &filename)
-{
-	bool remote = aoRemote::ClusteredObservation::IsClusteredFilename(filename);
-	StatisticsCollection statisticsCollection;
-	HistogramCollection histogramCollection;
-	std::vector<AntennaInfo> antennae;
-	if(remote)
-	{
-		aoRemote::ClusteredObservation *observation = aoRemote::ClusteredObservation::Load(filename);
-		aoRemote::ProcessCommander commander(*observation);
-		commander.PushReadAntennaTablesTask();
-		commander.PushReadQualityTablesTask(&statisticsCollection, &histogramCollection);
-		commander.Run();
-		antennae = commander.Antennas();
-		delete observation;
-	}
-	else {
-		MeasurementSet *ms = new MeasurementSet(filename);
-		const unsigned polarizationCount = ms->GetPolarizationCount();
-		
-		statisticsCollection.SetPolarizationCount(polarizationCount);
-		QualityTablesFormatter qualityData(filename);
-		statisticsCollection.Load(qualityData);
-		unsigned antennaCount = ms->AntennaCount();
-		for(unsigned a=0;a<antennaCount;++a)
-			antennae.push_back(ms->GetAntennaInfo(a));
-		delete ms;
-	}
-	
-	rfiStrategy::BaselineSelector selector;
-	selector.SetUseLog(true);
-	
-	statisticsCollection.IntegrateBaselinesToOneChannel();
-	const BaselineStatisticsMap &baselineMap = statisticsCollection.BaselineStatistics();
-	const std::vector<std::pair<unsigned, unsigned> > list = baselineMap.BaselineList();
-	for(std::vector<std::pair<unsigned, unsigned> >::const_iterator i=list.begin();i!=list.end();++i)
-	{
-		const unsigned a1 = i->first, a2 = i->second;
-		
-		DefaultStatistics statistic = baselineMap.GetStatistics(a1, a2);
-		selector.Add(statistic, antennae[a1], antennae[a2]);
-	}
-	std::vector<rfiStrategy::BaselineSelector::SingleBaselineInfo> markedBaselines;
-	std::set<unsigned> badStations;
-	
-	selector.Search(markedBaselines);
-	selector.ImplyStations(markedBaselines, 0.3, badStations);
-	
-	std::cout << "List of " << badStations.size() << " bad stations:\n";
-	for(std::set<unsigned>::const_iterator i=badStations.begin();i!=badStations.end();++i)
-	{
-		std::cout << antennae[*i].name << " (" << *i << ")\n";
-	}
-}
-
-void printSyntax(std::ostream &stream, char *argv[])
-{
-	stream << "Syntax: badstations <filename>\n\n"
-		"The binary 'badstations ' will print all stations that are outliers\n"
-		"according to the RFI statistics. It takes into account that short baselines\n"
-		"often see fewer RFI, by fitting a curve to the statistic as a function of\n"
-		"baseline.\n";
-}
-
-int main(int argc, char *argv[])
-{
-#ifdef HAS_LOFARSTMAN
-	register_lofarstman();
-#endif // HAS_LOFARSTMAN
-
-	if(argc != 2)
-	{
-		printSyntax(std::cerr, argv);
-		return -1;
-	} else {
-		
-		const std::string filename = argv[1];
-		checkStations(filename);
-		return 0;
-	}
-}
diff --git a/CEP/DP3/AOFlagger/src/cleaner.cpp b/CEP/DP3/AOFlagger/src/cleaner.cpp
deleted file mode 100644
index 320c9ea97d52aac03acdf1bb34da7bdc19b361d6..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/cleaner.cpp
+++ /dev/null
@@ -1,155 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include "cleaner.h"
-
-#include "msio/image2d.h"
-
-#include "util/ffttools.h"
-
-#include <iostream>
-
-Cleaner::Cleaner() : _residualReal(0), _residualImaginary(0)
-{
-}
-
-Cleaner::~Cleaner()
-{
-	if(_residualReal != 0) {
-		delete _residualReal;
-		delete _residualImaginary;
-		delete _weightsImaginary;
-		delete _psfReal;
-		delete _psfImaginary;
-		delete _deconvolvedReal;
-		delete _deconvolvedImaginary;
-		delete _convolvedReal;
-		delete _convolvedImaginary;
-	}
-}
-
-void Cleaner::Init(const Image2D &real, const Image2D &imaginary, const Image2D &weights, long double gain)
-{
-	_real = &real;
-	_imaginary = &imaginary;
-	_weightsReal = &weights;
-	_gain = gain;
-
-	// Imaginary values are 0, as we only use real factors for the weights
-	_weightsImaginary = Image2D::CreateZeroImage(weights.Width(), weights.Height());
-
-	_psfReal = Image2D::CreateEmptyImage(weights.Width(), weights.Height());
-	_psfImaginary = Image2D::CreateZeroImage(weights.Width(), weights.Height());
-	FFTTools::CreateFFTImage(*_weightsReal, *_weightsImaginary, *_psfReal, *_psfImaginary);
-
-	_residualReal = Image2D::CreateCopy(*_real);
-	_residualImaginary = Image2D::CreateCopy(*_imaginary);
-	_deconvolvedReal = Image2D::CreateZeroImage(real.Width(), real.Height());
-	_deconvolvedImaginary = Image2D::CreateZeroImage(imaginary.Width(), imaginary.Height());
-	unsigned x, y;
-	FindPeak(*_psfReal, *_psfImaginary, x, y);
-	_psfPeak = _psfReal->Value(x, y);
-	_convolvedReal = Image2D::CreateEmptyImage(_residualReal->Width(), _residualReal->Height()),
-	_convolvedImaginary = Image2D::CreateEmptyImage(_residualImaginary->Width(), _residualImaginary->Height());
-	_psfSum = 0.0;
-	for(unsigned j=0;j<_psfReal->Height();++j) {
-		for(unsigned i=0;i<_psfReal->Width();++i) {
-			_psfSum += fabsf(_psfReal->Value(i, j));
-		}
-	}
-	std::cout << "psf sum: " << _psfSum << std::endl;
-}
-
-void Cleaner::Iteration()
-{
-	unsigned x, y;
-	
-	std::cout << "Finding peak in convolved: ";
-	FFTTools::FFTConvolve(*_residualReal, *_residualImaginary, *_psfReal, *_psfImaginary, *_convolvedReal, *_convolvedImaginary);
-
-	FindPeak(*_convolvedReal, *_convolvedImaginary, x, y);
-
-	{ //testing
-		std::cout << "Finding peak in original: ";
-		unsigned x2, y2;
-		FindPeak(*_residualReal, *_residualImaginary, x2, y2);
-	}
-
-	long double currentGain = _gain * MaxAllowedGain(*_residualReal, *_psfReal, x, y);
-	unsigned area = _residualReal->Width()*_residualReal->Height();
-	std::cout << "Gain: " << currentGain << " conv gain: " << (_gain*_convolvedReal->Value(x,y)/(_psfSum*area*area)) << std::endl;
-	_deconvolvedReal->AddValue(x, y, currentGain);
-	Subtract(*_residualReal, *_psfReal, x, y, currentGain);
-	Subtract(*_residualImaginary, *_psfImaginary, x, y, currentGain);
-}
-
-void Cleaner::FindPeak(const Image2D &real, const Image2D &imaginary, unsigned &x, unsigned &y)
-{
-	long double highest = real.Value(0, 0); //*real.Value(0, 0) + imaginary.Value(0, 0)*imaginary.Value(0, 0);
-	x = 0;
-	y = 0;
-	for(unsigned j=0;j<real.Height();++j) {
-		for(unsigned i=0;i<real.Width();++i) {
-			long double vr = real.Value(i, j);
-			//long double vi = imaginary.Value(i, j);
-			//long double a = vr*vr+vi*vi;
-			if(vr > highest) {
-				x = i;
-				y = j;
-				highest = vr;
-			}
-		}
-	}
-	std::cout << "Peak: " << x << "," << y << " (" << real.Value(x,y) << ")" << std::endl;
-}
-
-long double Cleaner::MaxAllowedGain(const Image2D &image, const Image2D &subtract, unsigned x, unsigned y)
-{
-	/*unsigned halfwidth = image.Width()/2, halfheight = image.Height()/2, count = 0;
-	long double sum = 0.0, norm = 1.0L / image.Value(x,y);
-	for(unsigned j=0;j<image.Height();++j) {
-		for(unsigned i=0;i<image.Width();++i) {
-			long double s = subtract.Value((i - x + halfwidth)%image.Width(), (j - y + halfheight)%image.Height());
-			if( ( s > 0) == (image.Value(i, j)>0) ) {
-				sum += fabsf(image.Value(i, j) - s);
-				++count;
-			}
-		}
-	}
-	return sum * norm * 100.0 / (image.Width() * image.Height()); */
-	
-	unsigned halfwidth = image.Width()/2, halfheight = image.Height()/2;
-	long double ratioA = image.Value(x, y) / subtract.Value(halfwidth, halfheight);
-	long double ratioB = image.Value((x+1)%image.Width(), y) / subtract.Value(halfwidth+1, halfheight);
-	long double ratioC = image.Value((x+image.Width()-1)%image.Width(), y) / subtract.Value(halfwidth-1, halfheight);
-	long double ratioD = image.Value(x, (y+1)%image.Height()) / subtract.Value(halfwidth, halfheight+1);
-	long double ratioE = image.Value(x, (y+image.Height()-1)%image.Height()) / subtract.Value(halfwidth, halfheight-1);
-	std::cout << "A=" << ratioA << ",B=" << ratioB << ",C=" << ratioC << ",D=" << ratioD << ",E=" << ratioE << std::endl;
-	return (ratioA*2.0 + ratioB + ratioC + ratioD + ratioE) / 6.0;
-}
-
-void Cleaner::Subtract(Image2D &original, const Image2D &rightHand, unsigned x, unsigned y, long double gain)
-{
-	unsigned cx = rightHand.Width()/2, cy = rightHand.Height()/2;
-	for(unsigned j=0;j<rightHand.Height();++j) {
-		for(unsigned i=0;i<rightHand.Width();++i) {
-			original.AddValue(i, j, -rightHand.Value((i+cx-x)%rightHand.Width(), (j+cy-y)%rightHand.Height()) * gain);
-		}
-	}
-}
diff --git a/CEP/DP3/AOFlagger/src/colormapper.cpp b/CEP/DP3/AOFlagger/src/colormapper.cpp
deleted file mode 100644
index 7cf97b5cc03579013e2f3987333cfe66e633bc41..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/colormapper.cpp
+++ /dev/null
@@ -1,517 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <iostream>
-#include <cstdlib>
-#include <vector>
-#include <algorithm>
-
-#include <AOFlagger/msio/fitsfile.h>
-#include <AOFlagger/msio/image2d.h>
-#include <AOFlagger/msio/pngfile.h>
-
-#include <AOFlagger/util/ffttools.h>
-
-using namespace std;
-
-struct ImageInfo { unsigned index; long double variance; };
-
-bool operator<(const ImageInfo &a, const ImageInfo &b) {
-	return a.variance > b.variance; // note that a noise image is "smaller" than a clean image
-}
-
-void addFits(Image2D *red, Image2D *green, Image2D *blue, Image2D *mono, const std::string &filename);
-
-void HLStoRGB(long double hue,long double lum,long double sat,long double &red,long double &green, long double &blue);
-void WLtoRGB(long double wavelength,long double &red,long double &green, long double &blue);
-inline void ScaledWLtoRGB(long double position,long double &red,long double &green, long double &blue)
-{ return WLtoRGB(position*300.0+400.0,red,green,blue); }
-void ReportRMS(Image2D *image);
-
-int main(int argc, char *argv[])
-{
-	int pindex = 1;
-	// parameters
-	bool useSpectrum = true;
-	bool colormap = false;
-	int removeNoiseImages = 0;
-	bool fft = false;
-	enum ScaleMethod { MaximumContrast, Constant } scaleMethod = MaximumContrast;
-	long double scaleValue = 1.0;
-	std::string subtractFile, outputFitsFile, outputPngFile;
-	bool subtract = false, redblue = false, rms = false, individualMaximization = false, displayMax = false, singleImage = false;
-	bool window = false, cutWindow = false, saveFits = false, savePng = false;
-	size_t windowX = 0, windowY = 0, windowWidth = 0, windowHeight = 0;
-	size_t cutWindowX = 0, cutWindowY = 0, cutWindowWidth = 0, cutWindowHeight = 0;
-	size_t singleImageIndex = 0;
-
-	while(pindex < argc && argv[pindex][0] == '-') {
-		string parameter = argv[pindex]+1;
-		if(parameter == "s") { useSpectrum = true; }
-		else if(parameter == "c") { useSpectrum = false; }
-		else if(parameter == "d") { ++pindex; subtractFile = argv[pindex]; subtract=true; }
-		else if(parameter == "fft") { fft = true; }
-		else if(parameter == "fi") { individualMaximization = true; }
-		else if(parameter == "fits") {
-			saveFits = true;
-			++pindex; outputFitsFile = argv[pindex];
-		}
-		else if(parameter == "fm") { scaleMethod = MaximumContrast; }
-		else if(parameter == "fv") { scaleMethod = Constant; ++pindex; scaleValue = atof(argv[pindex]); }
-		else if(parameter == "m") { colormap = true; }
-		else if(parameter == "max") { displayMax=true; }
-		else if(parameter == "png")
-		{
-			savePng = true;
-			++pindex; outputPngFile = argv[pindex];
-		}
-		else if(parameter == "r") { ++pindex; removeNoiseImages = atoi(argv[pindex]); }
-		else if(parameter == "rb") { redblue=true; }
-		else if(parameter == "rms") { rms=true; }
-		else if(parameter == "si")
-		{
-			singleImage = true;
-			++pindex; singleImageIndex = atoi(argv[pindex]);
-		}
-		else if(parameter == "w") {
-			window = true;
-			++pindex; windowX = atoi(argv[pindex]);
-			++pindex; windowY = atoi(argv[pindex]);
-			++pindex; windowWidth = atoi(argv[pindex]);
-			++pindex; windowHeight = atoi(argv[pindex]);
-		}
-		else if(parameter == "wc") {
-			cutWindow = true;
-			++pindex; cutWindowX = atoi(argv[pindex]);
-			++pindex; cutWindowY = atoi(argv[pindex]);
-			++pindex; cutWindowWidth = atoi(argv[pindex]);
-			++pindex; cutWindowHeight = atoi(argv[pindex]);
-		}
-		else {
-			cerr << "Unknown parameter: -" << parameter << endl;
-			return -1;
-		}
-		++pindex;
-	}
-
-	if(argc-pindex < 1) {
-		cerr << "Usage: \n\t" << argv[0] << " [options] <input fits file>\n"
-				"\toptions:\n"
-				"\t-d <fitsfile> subtract the file from the image\n"
-				"\t-fft perform fft before combining\n"
-				"\t-fi maximize each individual image before summing\n"
-				"\t-fits <file> store in fits file (does not preserve the headers)\n"
-				"\t-fm scale colors for maximum contrast, upper 0.02% of the data will be oversaturated (default)\n"
-				"\t-fv <value> scale so that <value> flux is full brightness\n"
-				"\t-m add colormap to image\n"
-				"\t-max display maximum of each image\n"
-				"\t-png <file> save as png file\n"
-				"\t-rb don't use frequency colored, but use red/blue map for positive/negative values\n"
-				"\t-rms calculate and show the rms of the upperleft 10% data\n"
-				"\t-s use spectrum (default)\n"
-				"\t-si <index> select single image from each fits file\n"
-				"\t-c use color circle\n"
-				"\t-w <x> <y> <width> <height> select a window of each frame only\n"
-				"\t-wc <x> <y> <width> <height> cut a window in each frame\n";
-		return -1;
-	}
-
-	Image2D *red = 0;
-	Image2D *green = 0;
-	Image2D *blue = 0;
-	Image2D *mono = 0;
-
-	long double totalRed = 0.0, totalGreen = 0.0, totalBlue = 0.0;
-	unsigned addedCount = 0;
-	
-	size_t inputCount = argc-pindex;
-	for(unsigned inputIndex=pindex;inputIndex<(unsigned) argc;++inputIndex)
-	{
-		cout << "Opening " << argv[inputIndex] << "..." << endl;
-		FitsFile fitsfile(argv[inputIndex]);
-		fitsfile.Open(FitsFile::ReadOnlyMode);
-		fitsfile.MoveToHDU(1);
-		unsigned images = Image2D::GetImageCountInHUD(fitsfile);
-
-		FitsFile *subtractFits = 0;
-		if(subtract) {
-			cout << "Opening " << subtractFile << "..." << endl;
-			subtractFits = new FitsFile(subtractFile);
-			subtractFits->Open(FitsFile::ReadOnlyMode);
-			subtractFits->MoveToHDU(1);
-			unsigned sImages = Image2D::GetImageCountInHUD(fitsfile);
-			if(sImages < images)
-				images = sImages;
-		}
-
-		std::vector<ImageInfo> variances;
-
-		if(removeNoiseImages > 0) {
-			cout << "Sorting images on noise level..." << endl;
-			for(unsigned i=0;i<images;++i)
-			{
-				if(i % 8 == 0) {
-					unsigned upper = i+9;
-					if(upper > images) upper = images;
-					cout << "Measuring noise level in images " << (i+1) << " - " << upper << "..." << endl;
-				}
-				Image2D *image = Image2D::CreateFromFits(fitsfile, i);
-				struct ImageInfo imageInfo;
-				imageInfo.variance = image->GetRMS();
-				imageInfo.index = i;
-				variances.push_back(imageInfo);
-				delete image;
-			}
-			sort(variances.begin(), variances.end());
-
-			cout << "The following images are removed because of too many noise: "
-					<< variances.front().index;
-			for(std::vector<ImageInfo>::const_iterator i=variances.begin()+1;i<variances.begin()+removeNoiseImages;++i)
-			{
-				cout << ", " << i->index;
-			}
-			cout << endl;
-		}
-
-		unsigned lowI, highI;
-		if(singleImage)
-		{
-			lowI = singleImageIndex;
-			highI = singleImageIndex+1;
-		} else {
-			lowI = 0;
-			highI = images;
-		}
-			
-		for(unsigned i=lowI;i<highI;++i)
-		{
-			if(i % 8 == 0) {
-				unsigned upper = i+9;
-				if(upper > images) upper = images;
-				cout << "Adding image " << (i+1) << " - " << upper << "..." << endl;
-			}
-			bool skip = false;
-			if(removeNoiseImages > 0) {
-				for(std::vector<ImageInfo>::const_iterator j=variances.begin();j<variances.begin()+removeNoiseImages;++j)
-				{
-					if(j->index == i) { skip = true; break; }
-				}
-			}
-			if(!skip) {
-				long double wavelengthRatio;
-				if(images*inputCount > 1)
-					wavelengthRatio = (1.0 - (long double) (i+((int) inputIndex-(int) pindex)*images) / (images*inputCount-1.0));
-				else
-					wavelengthRatio = 0.5;
-				std::cout << "ratio=" << wavelengthRatio << '\n';
-				Image2D *image = Image2D::CreateFromFits(fitsfile, i);
-				if(subtract)
-				{
-					Image2D *imageB = Image2D::CreateFromFits(*subtractFits, i);
-					Image2D *AminB = Image2D::CreateFromDiff(*image, *imageB);
-					delete image;
-					image = AminB;
-					delete imageB;
-				}
-				if(window)
-				{
-					Image2D *empty = Image2D::CreateZeroImage(image->Width(), image->Height());
-					for(unsigned y=image->Height()-windowY-windowHeight;y<image->Height()-windowY;++y)
-					{
-						for(unsigned x=windowX;x<windowX+windowWidth;++x)
-							empty->SetValue(x, y, image->Value(x, y));
-					}
-					delete image;
-					image = empty;
-				}
-				if(cutWindow)
-				{
-					for(unsigned y=image->Height()-cutWindowY-cutWindowHeight;y<image->Height()-cutWindowY;++y)
-					{
-						for(unsigned x=cutWindowX;x<cutWindowX+cutWindowWidth;++x)
-							image->SetValue(x, y, 0.0);
-					}
-				}
-				if(fft) {
-					Image2D *fft = FFTTools::CreateFFTImage(*image, FFTTools::Absolute);
-					Image2D *fullfft = FFTTools::CreateFullImageFromFFT(*fft);
-					delete image;
-					delete fft;
-					image = fullfft;
-				}
-				long double max;
-				if(individualMaximization) {
-					max = image->GetMaximum();
-					if(max <= 0.0) max = 1.0;
-				} else {
-					max = 1.0;
-				}
-				if(displayMax)
-					cout << "max=" << image->GetMinimum() << ":" << image->GetMaximum() << endl; 
-				if(rms)
-					ReportRMS(image);
-				long double r=0.0,g=0.0,b=0.0;
-				if(redblue) {
-					r = 1.0;
-					b = 1.0;
-				} else if(useSpectrum)
-					ScaledWLtoRGB(wavelengthRatio, r, g, b);
-				else
-					HLStoRGB(wavelengthRatio, 0.5, 1.0, r, g, b);
-				totalRed += r;
-				totalGreen += g;
-				totalBlue += b;
-				if(red == 0) {
-					red = Image2D::CreateUnsetImage(image->Width(), image->Height());
-					green = Image2D::CreateUnsetImage(image->Width(), image->Height());
-					blue = Image2D::CreateUnsetImage(image->Width(), image->Height());
-					mono = Image2D::CreateUnsetImage(image->Width(), image->Height());
-				}
-				size_t minY = image->Height(), minX = image->Width();
-				if(red->Height() < minY) minY = red->Height();
-				if(red->Width() < minX) minX = red->Width();
-				for(unsigned y=0;y<minY;++y)
-				{
-					for(unsigned x=0;x<minX;++x)	
-					{
-						long double value = image->Value(x, y);
-						mono->AddValue(x, y, value);
-						if(redblue) {
-							if(value > 0)
-								red->AddValue(x, y, value/max);
-							else
-								blue->AddValue(x, y, value/(-max)); 
-						}
-						else {
-							if(value < 0.0) value = 0.0;
-							value /= max;
-							if(colormap && (y < 96 && y >= 32 && x < images*8)) { 
-								if(x >= i*8 && x < i*8+8) {
-									red->SetValue(x, y, r * images);
-									green->SetValue(x, y, g * images);
-									blue->SetValue(x, y, b * images);
-								}
-							} else {
-								red->AddValue(x, y, r * value);
-								green->AddValue(x, y, g * value);
-								blue->AddValue(x, y, b * value);
-							}
-						}
-					}
-				}
-				++addedCount; 
-				delete image;
-			}
-		}
-		
-		if(subtract) {
-			subtractFits->Close();
-			delete subtractFits;
-		}
-	}
-		
-	cout << "Scaling to ordinary units..." << endl;
-	for(unsigned y=0;y<red->Height();++y) {
-		for(unsigned x=0;x<red->Width();++x) {
-			red->SetValue(x, y, red->Value(x, y) / addedCount);
-			blue->SetValue(x, y, blue->Value(x, y) / addedCount);
-			green->SetValue(x, y, green->Value(x, y) / addedCount);
-			mono->SetValue(x, y, mono->Value(x, y) / addedCount);
-		}
-	}
-
-	if(rms) {
-		ReportRMS(mono);
-	}
-	
-	if(saveFits)
-	{
-		cout << "Saving fits file..." << endl;
-		mono->SaveToFitsFile(outputFitsFile);
-	}
-
-	if(savePng)
-	{
-		cout << "Normalizing..." << endl;
-		long double maxRed, maxGreen, maxBlue;
-		switch(scaleMethod) {
-			default:
-			case MaximumContrast:
-				maxRed = red->GetTresholdForCountAbove(red->Width() * red->Height() / 5000);
-				maxGreen = green->GetTresholdForCountAbove(green->Width() * green->Height() / 5000);
-				maxBlue = blue->GetTresholdForCountAbove(blue->Width() * blue->Height() / 5000);
-			break;
-			case Constant:
-				maxRed = scaleValue;
-				maxGreen = scaleValue * totalGreen / totalRed;
-				maxBlue = scaleValue * totalBlue / totalRed;
-			break; 
-		}
-		if(maxRed <= 0.0) maxRed = 1.0;
-		if(maxGreen <= 0.0) maxGreen = 1.0;
-		if(maxBlue <= 0.0) maxBlue = 1.0;
-		cout << "Contrast stretch value for red: " << maxRed << endl; 
-		
-		PngFile file(outputPngFile, red->Width(), red->Height());
-		file.BeginWrite();
-
-		cout << "Writing " << outputPngFile << "..." << endl;
-		for(unsigned y=0;y<red->Height();++y)
-		{
-			for(unsigned x=0;x<red->Width();++x)	
-			{
-				unsigned
-					r = (unsigned) ((red->Value(x, y) / maxRed) * 255.0),
-					g = (unsigned) ((green->Value(x, y) / maxGreen) * 255.0),
-					b = (unsigned) ((blue->Value(x, y) / maxBlue) * 255.0);
-				if(r > 255) r = 255;
-				if(g > 255) g = 255;
-				if(b > 255) b = 255;
-				file.PlotDatapoint(x, red->Height() - 1 - y, r, g, b, 255);
-			}
-		}
-		file.Close();
-	}
-	
-	delete red;
-	delete green;
-	delete blue;
-	delete mono;
-
-  return EXIT_SUCCESS;
-}
-
-/* utility routine for HLStoRGB */ 
-long double HueToRGB(long double p,long double q,long double tc)
-{
-	/* range check: note values passed add/subtract thirds of range */ 
-	if (tc < 0)
-			tc += 1.0;
-
-	if (tc > 1.0)
-			tc -= 1.0;
-
-	/* return r,g, or b value from this tridrant */ 
-	if (tc < (1.0/6.0))
-			return ( p + (q-p)*6.0*tc);
-	if (tc < 0.5)
-			return ( q );
-	if (tc < 2.0/3.0)
-			return ( p + (q-p)*6.0*(2.0/3.0 - tc));
-	else
-			return ( p );
-}
-
-void HLStoRGB(long double hue,long double lum,long double sat,long double &red,long double &green, long double &blue)
-{
-
-	if (sat == 0) {
-			red=green=blue=lum;
-		}
-	else  {
-			long double q,p;
-			if (lum < 0.5)
-				q = lum*(1.0 + sat);
-			else
-				q = lum + sat - (lum*sat);
-			p = 2.0*lum-q;
-
-			red = HueToRGB(p,q,hue+1.0/3.0);
-			green = HueToRGB(p,q,hue);
-			blue = HueToRGB(p,q,hue-1.0/3.0);
-	}
-}
-
-void WLtoRGB(long double wavelength,long double &red,long double &green, long double &blue)
-{
-  if(wavelength >= 350.0 && wavelength <= 439.0) {
-   red	= -(wavelength - 440.0) / (440.0 - 350.0);
-   green = 0.0;
-   blue	= 1.0;
-  } else if(wavelength >= 440.0 && wavelength <= 489.0) {
-   red	= 0.0;
-   green = (wavelength - 440.0) / (490.0 - 440.0);
-   blue	= 1.0;
-  } else if(wavelength >= 490.0 && wavelength <= 509.0) {
-   red = 0.0;
-   green = 1.0;
-   blue = -(wavelength - 510.0) / (510.0 - 490.0);
-  } else if(wavelength >= 510.0 && wavelength <= 579.0) { 
-   red = (wavelength - 510.0) / (580.0 - 510.0);
-   green = 1.0;
-   blue = 0.0;
-  } else if(wavelength >= 580.0 && wavelength <= 644.0) {
-   red = 1.0;
-   green = -(wavelength - 645.0) / (645.0 - 580.0);
-   blue = 0.0;
-  } else if(wavelength >= 645.0 && wavelength <= 780.0) {
-   red = 1.0;
-   green = 0.0;
-   blue = 0.0;
-  } else {
-   red = 1.0;
-   green = 0.0;
-   blue = 0.0;
-  }
-  if(wavelength >= 350.0 && wavelength <= 419.0) {
-	  long double factor;
-    factor = 0.3 + 0.7*(wavelength - 350.0) / (420.0 - 350.0);
-		red *= factor;
-		green *= factor;
-		blue *= factor;
-  } else if(wavelength >= 420.0 && wavelength <= 700.0) {
-    // nothing to be done
-  } else if(wavelength >= 701.0 && wavelength <= 780.0) {
-	  long double factor;
-    factor = 0.3 + 0.7*(780.0 - wavelength) / (780.0 - 700.0);
-		red *= factor;
-		green *= factor;
-		blue *= factor;
-  } else if(wavelength >= 780.0) {
-    long double factor;
-    factor = 0.3;
-    red *= factor;
-    green *= factor;
-    blue *= factor;
-  } else {
-		red = 0.0;
-		green = 0.0;
-		blue = 0.0;
- }
-}
-
-void ReportRMS(Image2D *image)
-{
-	unsigned squareWidth = image->Width()/5;
-	unsigned squareHeight = image->Height()/5;
-	cout << "Calculating rms... " << endl;
-	cout << "Total RMS=" << image->GetRMS()*1000.0L << "mJ" << endl;
-	cout << "Center RMS=" << image->GetRMS(image->Width()/2-squareWidth/2,image->Height()/2-squareHeight/2, squareWidth, squareHeight)*1000.0L << "mJ" << endl;
-	cout << "Upperleft RMS=" << image->GetRMS(0, 0, squareWidth, squareHeight)*1000.0L << "mJ" << endl;
-	cout << "Upperright RMS=" << image->GetRMS(image->Width()-squareWidth, 0, squareWidth, squareHeight) * 1000.0L << "mJ" << endl;
-	cout << "Lowerleft RMS=" << image->GetRMS(0, image->Height()-squareHeight, squareWidth, squareHeight) * 1000.0L << "mJ" << endl;
-	cout << "Lowerright RMS=" << image->GetRMS(image->Width()-squareWidth, image->Height()-squareHeight, squareWidth, squareHeight) *1000.0L << "mJ" << endl;
-	cout << "Minimum intensity=" << image->GetMinimum() * 1000.0L << "mJ" << endl;
-	cout << "Maximum intensity=" << image->GetMaximum() * 1000.0L << "mJ" << endl;
-}
diff --git a/CEP/DP3/AOFlagger/src/createuv.cpp b/CEP/DP3/AOFlagger/src/createuv.cpp
deleted file mode 100644
index bc6cf7a0d097dd8c8bbd6d766b3c9a00dad84535..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/createuv.cpp
+++ /dev/null
@@ -1,86 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <iostream>
-
-#include "msio/measurementset.h"
-#include "msio/image2d.h"
-#include "msio/pngfile.h"
-
-#include "util/integerdomain.h"
-
-#include "uvimager.h"
-
-using namespace std;
-
-int main(int argc, char *argv[])
-{
-	cout << "Checking commandline..." << endl;
-
-	int pindex = 1;
-	bool showFlagging = false;
-	bool invFlagging = false;
-	while(pindex < argc && argv[pindex][0] == '-') {
-		string parameter = argv[pindex]+1;
-		if(parameter == "flag") { showFlagging = true; }
-		else if(parameter == "invflag") { invFlagging = true; }
-		else {
-			cerr << "Unknown parameter: -" << parameter << endl;
-			return -1;
-		}
-		++pindex;
-	}
-
-	string msFilename;
-	if(argc-pindex < 1)
-	{
-		cerr << "Syntax:\n\t" << argv[0] << " [options] <ms>\n"
-					"\toptions can be:\n\t-flag create uv-image of the flagging.\n"
-					"\t-invflag invert flagging (when -flag specified).\n";
-		return -1;
-	} else
-	{
-		msFilename = argv[pindex];
-
-		unsigned width = 2048, height = 2048;
-		MeasurementSet ms(msFilename);
-		UVImager::ImageKind kind = UVImager::Homogeneous;
-		if(showFlagging)
-			kind = UVImager::Flagging;
-		UVImager imager(width, height, kind);
-		if(invFlagging)
-			imager.SetInvertFlagging(true);
-		imager.Image(ms, 0, IntegerDomain(1, 1, 256));
-		ColorMap *map;
-		//if(showFlagging)
-		//	map = new ColdHotMap();
-		//else
-		ColdHotMap chMap;
-		map = new PosLogMap(chMap);
-		PngFile::Save(imager.RealUVImage(), "real.png", *map);
-		PngFile::Save(imager.ImaginaryUVImage(), "imaginary.png", *map);
-		delete map;
-		return 0;
-	}
-}
diff --git a/CEP/DP3/AOFlagger/src/flag.cpp b/CEP/DP3/AOFlagger/src/flag.cpp
deleted file mode 100644
index 04e435d265e9bf7bad8d496ecb4eafe14e765034..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/flag.cpp
+++ /dev/null
@@ -1,510 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <iostream>
-#include <cstdlib>
-#include <sstream>
-#include <deque>
-#include <unistd.h> // for sleep()
-
-#include <boost/thread/thread.hpp>
-#include <boost/thread/mutex.hpp>
-
-#include "msio/measurementset.h"
-#include "msio/image2d.h"
-#include "msio/mask2d.h"
-#include "msio/pngfile.h"
-#include "msio/timefrequencyimager.h"
-
-#include "rfi/localfitmethod.h"
-#include "rfi/methoditerator.h"
-#include "rfi/mitigationtester.h"
-#include "rfi/thresholdconfig.h"
-#include "rfi/tiledimage.h"
-
-#include "util/integerdomain.h"
-#include "util/ffttools.h"
-
-#include "types.h"
-
-#include "rfi/svdmitigater.h" //needs to be last
-
-using namespace std;
-
-enum FlagMethod { Remove, LocalGaussianWeightedAvg, Svd };
-enum ThresholdMethod { SumThreshold, VarThreshold };
-
-struct Parameters {
-	FlagMethod method;
-	ThresholdMethod thresholdMethod;
-	int svdRemoveCount;
-	long double falsePositiveProbability;
-	long double threshold;
-	bool useThreshold;
-	bool useOnlyAutoCorrelations;
-	bool useAbsoluteValues;
-	vector<string> sets;
-	bool verbose;
-	int threads;
-	int fittingIterations;
-	bool saveImages;
-	bool writeStats;
-	unsigned band;
-	bool joinFlags;
-	bool joinPoralizations;
-	ThresholdConfig thresholdConfig;
-};
-
-Mask2DPtr Perform(Parameters &parameters, Image2DCPtr real, Image2DCPtr imaginary, Mask2DCPtr flag, const std::string &subname, const BandInfo &bandInfo);
-
-struct WorkThreadFunc {
-	Parameters parameters;
-	deque<unsigned> *workList;
-	boost::mutex *_heavyIOMutex;
-	boost::mutex *_sharedMemoryMutex;
-	IntegerDomain *antenna1Domain, *antenna2Domain;
-	string msFilename;
-	unsigned threadId;
-
-	void operator()() {
-		std::cout << "Spawned new thread (id=" << threadId << ")." << endl;
-		boost::mutex::scoped_lock lock(*_sharedMemoryMutex);
-		while(!workList->empty()) {
-			unsigned antenna = workList->front();
-			workList->pop_front();
-			lock.unlock();
-			PerformTask(antenna);
-			lock.lock();
-		}
-		lock.unlock();
-		std::cout << "Thread finished (id=" << threadId << ")." << endl;
-	}
-
-	void PerformTask(unsigned antenna)
-	{
-		TimeFrequencyImager imager;
-		imager.SetReadFlags(true);
-		boost::mutex::scoped_lock heavyIOLock(*_heavyIOMutex);
-		heavyIOLock.unlock();
-		cout << "|\n| Now processing autocorrelation of antenna " << antenna << "\n|" << endl;
-
-		cout << "Reading measurement set(s)... (antenna " << antenna << ")" << endl;
-		for(vector<string>::const_iterator i=parameters.sets.begin();i!=parameters.sets.end();++i) {
-			heavyIOLock.lock();
-			imager.SetMSFile(*i);
-			imager.Image(antenna, antenna, parameters.band);
-			heavyIOLock.unlock();
-		}
-		cout << endl;
-
-		cout << "Processing " << antenna << ":XX..." << endl;
-		stringstream subname1;
-		subname1 << "xx-a" << antenna;
-		Mask2DPtr maskXX = Perform(parameters, imager.RealXX(), imager.ImaginaryXX(), imager.FlagXX(), subname1.str(), imager.BandInfo());
-
-		cout << "Processing " << antenna << ":XY..." << endl;
-		stringstream subname2;
-		subname2 << "xy-a" << antenna;
-		Mask2DPtr maskXY = Perform(parameters, imager.RealXY(), imager.ImaginaryXY(), imager.FlagXY(), subname2.str(), imager.BandInfo());
-
-		cout << "Processing " << antenna << ":YY..." << endl;
-		stringstream subname3;
-		subname3 << "yy-a" << antenna;
-		Mask2DPtr maskYY = Perform(parameters, imager.RealYY(), imager.ImaginaryYY(), imager.FlagYY(), subname3.str(), imager.BandInfo());
-
-		if(parameters.joinPoralizations)
-		{
-			cout << "Combining masks between polarisations..." << endl;
-			maskXX->Join(maskXY);
-			maskXX->Join(maskYY);
-			(*maskXY) = maskXX;
-			(*maskYY) = maskXX;
-		}
-
-		if(parameters.joinFlags) {
-			cout << "Combining masks with original..." << endl;
-			maskXX->Join(imager.FlagXX());
-			maskXY->Join(imager.FlagXY());
-			maskYY->Join(imager.FlagYY());
-		}
-
-		double oldFlagRatio = (
-				(double) imager.FlagXX()->GetCount<true>() +
-				imager.FlagXY()->GetCount<true>()*2.0 +
-				imager.FlagYY()->GetCount<true>())
-			/ (imager.FlagXX()->Width() * imager.FlagXX()->Height() * 4.0);
-		double joinFlagRatio = round((
-				(double) maskXX->GetCount<true>() +
-				maskXY->GetCount<true>()*2.0 +
-				maskYY->GetCount<true>())
-			/ (maskXX->Width() * maskXX->Height() * 4.0)* 1000.0) / 10.0;
-		cout << "Writing flags (" << joinFlagRatio << "% flagged, was previously " << (round(oldFlagRatio * 1000.0) / 10.0) << "%) ..." << endl;
-		imager.SetMSFile(msFilename);
-		for(unsigned a1index=0;a1index<antenna1Domain->ValueCount();++a1index) {
-			for(unsigned a2index=0;a2index<antenna2Domain->ValueCount();++a2index) {
-				unsigned a1 = antenna1Domain->GetValue(a1index);
-				unsigned a2 = antenna2Domain->GetValue(a2index);
-				if(a1 == antenna || a2 == antenna) {
-					cout << "Joining flags with flagging of antenna " << a1 << " and " << a2 << "..." << endl;
-					heavyIOLock.lock();
-					imager.Image(a1, a2, parameters.band);
-					double oldFlagRatio = round((
-							(double) imager.FlagXX()->GetCount<true>() +
-							imager.FlagXY()->GetCount<true>() +
-							imager.FlagXY()->GetCount<true>() +
-							imager.FlagYY()->GetCount<true>())
-						/ (imager.FlagXX()->Width() * imager.FlagXX()->Height() * 4.0) * 1000.0) / 10.0;
-
-					Mask2DPtr joinedMaskXX = Mask2D::CreateCopy(maskXX);
-					Mask2DPtr joinedMaskXY = Mask2D::CreateCopy(maskXY);
-					Mask2DPtr joinedMaskYY = Mask2D::CreateCopy(maskYY);
-
-					joinedMaskXX->Join(imager.FlagXX());
-					joinedMaskXY->Join(imager.FlagXY());
-					joinedMaskYY->Join(imager.FlagYY());
-
-					double newFlagRatio = round((
-							(double) joinedMaskXX->GetCount<true>() +
-							joinedMaskXY->GetCount<true>()*2.0 +
-							joinedMaskYY->GetCount<true>())
-						/ (joinedMaskXX->Width() * joinedMaskXX->Height() * 4.0) * 1000.0) / 10.0;
-					imager.WriteNewFlags(joinedMaskXX, joinedMaskXY, joinedMaskXY, joinedMaskYY);
-					heavyIOLock.unlock();
-
-					cout << "A" << a1 << "<->A" << a2 << " was " << oldFlagRatio << "% flagged, joined with " << joinFlagRatio << "% flagged mask, now " << newFlagRatio << "% flagged." << endl;
-				}
-			}
-		}
-	}
-};
-
-int main(int argc, char *argv[])
-{
-	Parameters parameters;
-	parameters.method = LocalGaussianWeightedAvg;
-	parameters.thresholdMethod = SumThreshold;
-	parameters.svdRemoveCount = 5;
-	parameters.falsePositiveProbability = 0.001;
-	parameters.threshold = 3.0;
-	parameters.useThreshold = false;
-	parameters.useOnlyAutoCorrelations = false;
-	parameters.useAbsoluteValues = true;
-	parameters.verbose = false;
-	parameters.threads = 2;
-	parameters.fittingIterations = 5;
-	parameters.saveImages = false;
-	parameters.writeStats = false;
-	parameters.band = 0;
-	parameters.joinFlags = true;
-	parameters.joinPoralizations = true;
-
-	int pindex = 1;
-	bool joinFlagsSet = false;
-	while(pindex < argc && argv[pindex][0] == '-') {
-		string parameter = argv[pindex]+1;
-		if(parameter == "m0") parameters.method = Remove;
-		else if(parameter == "m1") parameters.method = LocalGaussianWeightedAvg;
-		else if(parameter == "svd") { parameters.svdRemoveCount = atoi(argv[pindex+1]); ++pindex; }
-		else if(parameter == "i") { parameters.fittingIterations = atoi(argv[pindex+1]); ++pindex; }
-		else if(parameter == "t") {
-			parameters.threshold = atof(argv[pindex+1]);
-			parameters.useThreshold = true;
-			++pindex;
-		}
-		else if(parameter == "p") {
-			parameters.falsePositiveProbability = atof(argv[pindex+1]);
-			parameters.useThreshold = false;
-			++pindex;
-		}
-		else if(parameter == "j") { parameters.threads = atoi(argv[pindex+1]); ++pindex; }
-		else if(parameter == "m2") parameters.method = Svd;
-		else if(parameter == "f") { parameters.joinFlags = false; joinFlagsSet = true; }
-		else if(parameter == "fp") { parameters.joinPoralizations = false; }
-		else if(parameter == "a") parameters.useOnlyAutoCorrelations = true;
-		else if(parameter == "ri") parameters.useAbsoluteValues = false;
-		else if(parameter == "v") parameters.verbose = true;
-		else if(parameter == "si") parameters.saveImages = true;
-		else if(parameter == "ss") parameters.writeStats = true;
-		else if(parameter == "ms") { parameters.sets.push_back(argv[pindex+1]); ++pindex; }
-		else if(parameter == "tm1") parameters.thresholdMethod = SumThreshold;
-		else if(parameter == "tm2") parameters.thresholdMethod = VarThreshold;
-		else {
-			cerr << "Unknown parameter: -" << parameter << endl;
-			return -1;
-		}
-		++pindex;
-	}
-	if(!joinFlagsSet) parameters.joinFlags = ((!parameters.useOnlyAutoCorrelations) && parameters.method != Remove);
-
-	if(argc-pindex < 4) {
-		cerr << "Syntax:\n\t" << argv[0] << " [options] <ms out> <antenna1 domain> <antenna2 domain> <band>\n"
-				 << "options:\n"
-			   << " -m<n>    : method to use for flagging (0: remove flags, 1: local gaussian weighted average, 2: svd).\n"
-		     << " -svd <i> : number of singular values to remove when using the svd method.\n"
-		     << " -f       : don't combine with original flags; previous flagging in measurement set will be removed.\n"
-				 << " -fp      : don't join flags of polarizations.\n"
-		     << " -t <t>   : set threshold to t * sigma.\n"
-		     << " -p <p>   : set theoretical false positive rate to p.\n"
-				 << " -ms <ms> : add a measurement set as input file. If no ms-es are given, ms out will also be used\n"
-			   << "            as input. Can be specified multiple times for ms joining.\n" 
-		     << " -a       : Use only the auto correlations to determine flags -- each antenna combination will\n"
-         << "            be its union of the auto correlations of the first and the second antenna\n"
-		     << " -ri      : threshold the real and imaginary components separately instead\n"
-		     << "            of thresholding the absolute values (also assumes Rayleigh noise dis instead of Gaussian).\n"
-		     << " -v       : be more verbose\n"
-		     << " -i <c>   : number of iterations (only applicable to iterative methods)\n"
-		     << " -j <tc>  : number of threads to be spawned, if task is parellizable\n"
-		     << " -si      : save images (directory \"flag\" should exist)\n"
-		     << " -ss      : save stats (directory \"flag\" should exist)\n"
-		     << " -tm1     : use the sum-threshold method\n"
-         << " -tm2     : use the var-threshold method\n"
-				 << "example:\n"
-				 << "\t" << argv[0] << " -m0 vega.ms 0-9 10-13 0\n";
-		return -1;
-	}
-
-	string msFilename = argv[pindex];
-	if(parameters.sets.size() == 0) parameters.sets.push_back(msFilename);
-	IntegerDomain
-		antenna1Domain(argv[pindex+1]),
-		antenna2Domain(argv[pindex+2]);
-	parameters.band = atoi(argv[pindex+3]);
-
-	if(parameters.useAbsoluteValues)
-		cout << "The absolute values will be thresholded." << endl;
-	else
-		cout << "The real and imaginary components will be thresholded separately." << endl;
-	if(parameters.joinFlags)
-		cout << "Flags will be joined with original flagging." << endl;
-	else
-		cout << "Flags will not be joined with original flagging. " << endl;
-	if(parameters.useThreshold)
-		cout << "Threshold: " << parameters.threshold << " * sigma" << endl;
-	else
-		cout << "False-positive probability: " << parameters.falsePositiveProbability << endl;
-	cout << "Flagging combination of antenna's " << antenna1Domain.GetValue(0);
-	for(unsigned i=1;i<antenna1Domain.ValueCount();++i)
-		cout << ", " << antenna1Domain.GetValue(i);
-	cout << " with antenna's " << antenna2Domain.GetValue(0);
-	for(unsigned i=1;i<antenna2Domain.ValueCount();++i)
-		cout << ", " << antenna2Domain.GetValue(i);
-	cout << "." << endl;
-	if(parameters.useOnlyAutoCorrelations) cout << "Only the auto correlations will be used for flagging!" << endl;
-
-	switch(parameters.method)
-	{
-		case LocalGaussianWeightedAvg:
-			cout << "Flagging with the local Gaussian weighted average method, " << parameters.fittingIterations << " iterations." << endl;
-			break;
-		case Svd:
-			cout << "Flagging with the singular value decomposition method, removing " << parameters.svdRemoveCount << " singular values. " << endl;
-			break;
-		case Remove:
-			cout << "Clearing flag tables!" << endl;
-			break;
-	}
-
-	switch(parameters.method) {
-		case SumThreshold:
-		case Svd:
-		parameters.thresholdConfig.SetMethod(ThresholdConfig::SumThreshold);
-		break;
-		case VarThreshold:
-		parameters.thresholdConfig.SetMethod(ThresholdConfig::VarThreshold);
-		break;
-	}
-	if(parameters.method == Svd)
-		parameters.thresholdConfig.InitializeLengthsDefault(1);
-	else
-		parameters.thresholdConfig.InitializeLengthsDefault();
-	parameters.thresholdConfig.SetVerbose(parameters.verbose);
-	ThresholdConfig::Distribution dist;
-	if(parameters.useAbsoluteValues)
-		dist = ThresholdConfig::Rayleigh;
-	else
-		dist = ThresholdConfig::Gaussian;
-	if(parameters.useThreshold)
-		parameters.thresholdConfig.InitializeThresholdsFromFirstThreshold(parameters.threshold, dist);
-	else
-		parameters.thresholdConfig.InitializeThresholdsWithFalseRate(1000, parameters.falsePositiveProbability, dist);
-
-	if(parameters.useAbsoluteValues)
-		std::cout << "False alarm rate on Rayleigh distributed noise: ";
-	else
-		std::cout << "False alarm rate on Gaussian noise: ";
-	std::cout << parameters.thresholdConfig.CalculateFalseAlarmRate(4000, dist) << std::endl;
-
-	if(parameters.useOnlyAutoCorrelations) {
-		// Analyse only the auto correlations
-		IntegerDomain autoAntennas(antenna1Domain);
-		autoAntennas.Join(antenna2Domain);
-
-		std::deque<unsigned> antennaTasks;
-		for(unsigned aIndex=0;aIndex<autoAntennas.ValueCount();++aIndex)
-			antennaTasks.push_back(autoAntennas.GetValue(aIndex));
-
-		boost::mutex sharedMemoryMutex, heavyIOMutex;
-		boost::thread_group group;
-		for(int i=0;i<parameters.threads;++i) {
-			WorkThreadFunc threadFunc;
-			threadFunc._heavyIOMutex = &heavyIOMutex;
-			threadFunc._sharedMemoryMutex = &sharedMemoryMutex;
-			threadFunc.antenna1Domain = &antenna1Domain;
-			threadFunc.antenna2Domain = &antenna2Domain;
-			threadFunc.msFilename = msFilename;
-			threadFunc.parameters = parameters;
-			threadFunc.workList = &antennaTasks;
-			threadFunc.threadId = i;
-
-			group.create_thread(threadFunc);
-			sleep(45);
-		}
-		group.join_all();
-	} else {
-		// Analyse every correlation between all (specified) antenna's
-		TimeFrequencyImager imager;
-		imager.SetReadFlags(true);
-		for(unsigned a1index=0;a1index<antenna1Domain.ValueCount();++a1index) {
-			for(unsigned a2index=0;a2index<antenna2Domain.ValueCount();++a2index) {
-				unsigned a1 = antenna1Domain.GetValue(a1index);
-				unsigned a2 = antenna2Domain.GetValue(a2index);
-				cout << "|\n| Now processing antenna's " << a1 << " and " << a2 << "\n|" << endl;
-	
-				cout << "Reading measurement set..." << endl;
-				imager.Image(a1, a2, parameters.band);
-	
-				cout << "Processing XX..." << endl;
-				stringstream subname;
-				subname << "-a" << a1 << "a" << a2;
-				Mask2DPtr maskXX = Perform(parameters, imager.RealXX(), imager.ImaginaryXX(), imager.FlagXX(), string("xx") + subname.str(), imager.BandInfo());
-	
-				cout << "Processing XY..." << endl;
-				Mask2DPtr maskXY = Perform(parameters, imager.RealXY(), imager.ImaginaryXY(), imager.FlagXY(), string("xy") + subname.str(), imager.BandInfo());
-	
-				cout << "Processing YX..." << endl;
-				Mask2DPtr maskYX = Perform(parameters, imager.RealYX(), imager.ImaginaryYX(), imager.FlagYX(), string("yx") + subname.str(), imager.BandInfo());
-	
-				cout << "Processing YY..." << endl;
-				Mask2DPtr maskYY = Perform(parameters, imager.RealYY(), imager.ImaginaryYY(), imager.FlagYY(), string("yy") + subname.str(), imager.BandInfo());
-				
-				if(parameters.joinFlags) {
-					cout << "Combining masks..." << endl;
-					maskXX->Join(imager.FlagXX());
-					maskXY->Join(imager.FlagXY());
-					maskYX->Join(imager.FlagYX());
-					maskYY->Join(imager.FlagYY());
-				}
-
-				double oldFlagRatio = (long double) (
-						imager.FlagXX()->GetCount<true>() +
-						imager.FlagXY()->GetCount<true>() +
-						imager.FlagYX()->GetCount<true>() +
-						imager.FlagYY()->GetCount<true>())
-					/ (imager.FlagXX()->Width() * imager.FlagXX()->Height() * 4);
-				double newFlagRatio = (long double) (
-						maskXX->GetCount<true>() +
-						maskXY->GetCount<true>() +
-						maskYX->GetCount<true>() +
-						maskYY->GetCount<true>())
-					/ (maskXX->Width() * maskXX->Height() * 4);
-	
-				cout << "Writing flags (" << (round(newFlagRatio * 1000.0) / 10.0) << "% flagged, was previously " << (round(oldFlagRatio * 1000.0) / 10.0) << "%) ..." << endl;
-				imager.WriteNewFlags(maskXX, maskXY, maskYX, maskYY, a1, a2, parameters.band);
-			}
-		}
-	}
-
-  return EXIT_SUCCESS;
-}
-
-Mask2DPtr Perform(Parameters &parameters, Image2DCPtr real, Image2DCPtr imaginary, Mask2DCPtr flag, const std::string &subname, const BandInfo &bandInfo)
-{
-	bool containsUnflagged = false;
-	for(unsigned y=0;y<flag->Height();++y) {
-		for(unsigned x=0;x<flag->Width();++x) {
-			if(flag->Value(x, y)) {
-				containsUnflagged = true;
-				goto endOfLoop;
-			}
-		}
-	}
-endOfLoop:
-	if(!containsUnflagged && !parameters.method == Remove) {
-		std::cout << "Image contains only zeros! Skipping!" << std::endl;
-		return Mask2D::CreateSetMaskPtr<false>(real->Width(), real->Height());
-	} else {
-		MethodIterator iterator;
-		iterator.SetSavePNGs(parameters.saveImages);
-		iterator.SetWriteStats(parameters.writeStats);
-		iterator.SetOriginalFlag(flag);
-		iterator.SetThresholdConfig(parameters.thresholdConfig);
-		iterator.SetVerbose(parameters.verbose);
-		iterator.SetBandInfo(&bandInfo);
-
-		switch(parameters.method) {
-		case LocalGaussianWeightedAvg: {
-			LocalFitMethod fitMethod;
-			fitMethod.SetToWeightedAverage(20, 40, 7.5, 15.0); // 20 40 15 30 (10, 20, 7.5, 15.0)
-		
-			if(parameters.useAbsoluteValues) {
-				Image2DPtr absolute = Image2DPtr(FFTTools::CreateAbsoluteImage(*real, *imaginary));
-				TimeFrequencyData data(TimeFrequencyData::AmplitudePart, TimeFrequencyData::SinglePolarisation, absolute);
-				iterator.SetInput(data);
-				iterator.IterateBackgroundFit(fitMethod, parameters.threads, std::string("flag/") + subname + "-imgabsolute", parameters.fittingIterations);
-				Mask2DPtr mask = Mask2D::CreateCopy(iterator.GetMask());
-				return mask;
-			} else {
-				TimeFrequencyData rData(TimeFrequencyData::RealPart, TimeFrequencyData::SinglePolarisation, real);
-				iterator.SetInput(rData);
-				iterator.IterateBackgroundFit(fitMethod, parameters.threads, std::string("flag/") + subname + "-imgreal", parameters.fittingIterations);
-				Mask2DPtr mask = Mask2D::CreateCopy(iterator.GetMask());
-		
-				TimeFrequencyData iData(TimeFrequencyData::ImaginaryPart, TimeFrequencyData::SinglePolarisation, imaginary);
-				iterator.SetInput(iData);
-				iterator.IterateBackgroundFit(fitMethod, parameters.threads, std::string("flag/") + subname + "-imgimaginary", parameters.fittingIterations);
-	
-				mask->Join(iterator.GetMask());
-				return mask;
-			}
-		}
-	
-		case Svd: {
-			TimeFrequencyData data(TimeFrequencyData::SinglePolarisation, real, imaginary);
-
-			SVDMitigater mitigater;
-
-			iterator.SetInput(data);
-			iterator.IterateBackgroundFit(mitigater, parameters.threads, std::string("flag/") + subname + "-imgcomplex", parameters.fittingIterations);
-			Mask2DPtr mask = Mask2D::CreateCopy(iterator.GetMask());
-			return mask;
-			}
-	
-		case Remove: {
-			return Mask2D::CreateSetMaskPtr<false>(real->Width(), real->Height());
-			}
-		}
-	
-	}
-	return Mask2DPtr();
-}
diff --git a/CEP/DP3/AOFlagger/src/flagtest.cpp b/CEP/DP3/AOFlagger/src/flagtest.cpp
deleted file mode 100644
index 187a4d9a91778a36796bac866289267155352a67..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/flagtest.cpp
+++ /dev/null
@@ -1,349 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <iostream>
-#include <cstdlib>
-
-#include "msio/image2d.h"
-
-#include "rfi/localfitmethod.h"
-#include "rfi/methoditerator.h"
-#include "rfi/mitigationtester.h"
-#include "rfi/thresholdconfig.h"
-
-#include "util/integerdomain.h"
-#include "util/plot.h"
-
-#include "roctree.h"
-
-#include "rfi/svdmitigater.h" // last!
-
-using namespace std;
-
-class FlagTest : ROCTreeClassifier {
-	public:
-		FlagTest() { SetDefaultParameters(); }
-		void Run(int argc, char *argv[])
-		{
-			ParseParameters(argc, argv);
-			RunAllTests();
-			Clean();
-		}
-		virtual void Perform(long double &falseRatio, long double &trueRatio, long double parameter);
-	private:
-		void SetDefaultParameters();
-		void ParseParameters(int argc, char *argv[]);
-		void RunAllTests();
-		void RunTest(long double &falseRatio, long double &trueRatio);
-		void Clean() { }
-
-		SurfaceFitMethod *method;
-		int testSet;
-		MethodIterator iterator;
-
-		// options
-		ThresholdConfig::Method thresholdMethod;
-		long double falseRate;
-		unsigned width, height;
-		enum MitigateMethod { Threshold, SVD } mitigateMethod;
-		enum BackFitMethod { None, GaussianWeightedAvg, Median } backFitMethod;
-		unsigned iterations;
-		unsigned svdCount;
-		IntegerDomain *testSets;
-		bool verbose;
-		long double expFactor;
-		bool roc;
-		std::string rocFilename;
-		long double rocLimit;
-		int repeat;
-		int thresCount;
-		int thresLength;
-		bool savePng;
-		bool thresCurve;
-		long double thresCurveLimit;
-		int hWindowSize, vWindowSize;
-};
-
-void FlagTest::SetDefaultParameters()
-{
-	thresholdMethod = ThresholdConfig::SumThreshold;
-	falseRate = 0.001;
-	width = 1024;
-	height = 256;
-	mitigateMethod = Threshold;
-	backFitMethod = GaussianWeightedAvg;
-	iterations = 3;
-	svdCount = 2;
-	testSets = new IntegerDomain(0, 7);
-	verbose = false;
-	expFactor = 0.0L;
-	roc = false;
-	rocFilename = "";
-	rocLimit = 1.0L;
-	repeat = 1;
-	thresCount = 0;
-	thresLength = 1;
-	savePng = true;
-	thresCurve = false;
-	thresCurveLimit = 3.0;
-	hWindowSize = 4;
-	vWindowSize = 8;
-}
-
-void FlagTest::ParseParameters(int argc, char *argv[])
-{
-	int pindex = 1;
-	while(pindex < argc) {
-		string parameter = argv[pindex]+1;
-		if(parameter == "tm1") thresholdMethod = ThresholdConfig::SumThreshold;
-		else if(parameter == "tm2") thresholdMethod = ThresholdConfig::VarThreshold;
-		else if(parameter == "m1") mitigateMethod = Threshold;
-		else if(parameter == "m2") mitigateMethod = SVD;
-		else if(parameter == "bm0") backFitMethod = None;
-		else if(parameter == "bm1") backFitMethod = GaussianWeightedAvg;
-		else if(parameter == "bm2") backFitMethod = Median;
-		else if(parameter == "ww") {
-			++pindex;
-			hWindowSize = atoi(argv[pindex]);
-		}
-		else if(parameter == "wh") {
-			++pindex;
-			vWindowSize = atoi(argv[pindex]);
-		}
-		else if(parameter == "v") verbose = true;
-		else if(parameter == "nopng") savePng = false;
-		else if(parameter == "threscount") {
-			++pindex;
-			thresCount = atoi(argv[pindex]);
-		}
-		else if(parameter == "threslength") {
-			++pindex;
-			thresLength = atoi(argv[pindex]);
-		}
-		else if(parameter == "fr") {
-			++pindex;
-			falseRate = atof(argv[pindex]);
-		}
-		else if(parameter == "ts") {
-			++pindex;
-			delete testSets;
-			testSets = new IntegerDomain(argv[pindex]);
-		}
-		else if(parameter == "svdcount") {
-			++pindex;
-			svdCount = atoi(argv[pindex]);
-		}
-		else if(parameter == "w") {
-			++pindex;
-			width = atoi(argv[pindex]);
-		}
-		else if(parameter == "h") {
-			++pindex;
-			height = atoi(argv[pindex]);
-		}
-		else if(parameter == "i") {
-			++pindex;
-			iterations = atoi(argv[pindex]);
-		}
-		else if(parameter == "x") {
-			++pindex;
-			expFactor = atof(argv[pindex]);
-		}
-		else if(parameter == "roc") {
-			++pindex;
-			rocFilename = argv[pindex];
-			roc = true;
-		}
-		else if(parameter == "r") {
-			++pindex;
-			repeat = atoi(argv[pindex]);
-		}
-		else if(parameter == "roclimit") {
-			++pindex;
-			rocLimit = atof(argv[pindex]);
-		}
-		else if(parameter == "threscurve") {
-			++pindex;
-			thresCurve = true;
-			thresCurveLimit = atof(argv[pindex]);
-		}
-		else {
-			cerr << "Unknown parameter: -" << parameter << endl;
-			throw;
-		}
-		++pindex;
-	}
-}
-
-void FlagTest::RunAllTests()
-{
-	iterator.SetSavePNGs(true);
-	iterator.SetWriteStats(false);
-	iterator.SetVerbose(verbose);
-	ThresholdConfig config;
-	config.SetVerbose(verbose);
-	if(expFactor != 0.0L) {
-		config.SetExpThresholdFactor(expFactor);
-	}
-	if(roc)
-		falseRate = 0.0;
-
-	if(mitigateMethod == Threshold) {
-		LocalFitMethod *thresholdMitigater = new LocalFitMethod();
-		method = thresholdMitigater;
-		switch(backFitMethod) {
-			case None:
-				thresholdMitigater->SetToNone();
-				break;
-			case GaussianWeightedAvg:
-				thresholdMitigater->SetToWeightedAverage(20, 40, 7.5, 15.0);
-				break;
-			case Median:
-				thresholdMitigater->SetToMedianFilter(hWindowSize, vWindowSize);
-				break;
-		}
-	
-		config.SetMethod(thresholdMethod);
-		config.SetFitBackground(method);
-		if(!thresCurve) {
-			config.InitializeLengthsDefault(thresCount);
-			config.InitializeThresholdsFromFirstThreshold(3.9375, ThresholdConfig::Rayleigh);
-			config.InitializeThresholdsWithFalseRate(500, falseRate, ThresholdConfig::Rayleigh);
-		}
-	} else { // SVD
-		SVDMitigater *svdMitigater = new SVDMitigater();
-		method = svdMitigater;
-		svdMitigater->SetRemoveCount(svdCount);
-		svdMitigater->SetVerbose(verbose);
-
-		config.InitializeLengthsSingleSample();
-		config.InitializeThresholdsWithFalseRate(500, falseRate, ThresholdConfig::Rayleigh);
-		iterations = 1;
-	}
-
-	iterator.SetThresholdConfig(config);
-	iterator.SetSavePNGs(savePng);
-
-	for(unsigned setIndex=0;setIndex<testSets->ValueCount();++setIndex) {
-		testSet = testSets->GetValue(setIndex);
-		cout << "#== Data set: " << MitigationTester::GetTestSetDescription(testSet) << " ==" << endl;
-		if(testSet==1 && mitigateMethod==SVD) {
-			cout << "This data set will be skipped because of a bug in the SVD library" << endl;
-		} else {
-			if(roc) {
-				ROCTree tree(config.GetThreshold(0), *this);
-				for(long double a=0.0L;a<rocLimit + rocLimit/20.0L;a += rocLimit/10.0L) {
-					long double falseRatio, trueRatio;
-					tree.Find(a, rocLimit/20.0, falseRatio, trueRatio);
-					cout
-						<< "Correct: " << roundf(trueRatio * 1000.0L)/10.0L << "% of contaminated samples" << endl
-						<< "False: " << roundf(falseRatio * 1000.0L)/10.0L << "% of all samples" << endl;
-				}
-				tree.Save(rocFilename);
-			}
-			else if(thresCurve) {
-				long double thresholdStep = 0.01L;
-				cout << "#threshold\tfalseRatio\ttrueRatio\tcombinations\tfirstCombinationLength" << endl;
-				for(long double threshold = 0.0; threshold <= thresCurveLimit + thresholdStep*thresCurveLimit/2.0L ; threshold += thresholdStep*thresCurveLimit)
-				{
-					config.InitializeLengthsFrom(thresCount, thresLength);
-					if(thresCount == 1)
-						config.SetThreshold(0, threshold);
-					else
-						config.InitializeThresholdsFromFirstThreshold(threshold, ThresholdConfig::Gaussian);
-					long double falseRatio, trueRatio;
-					RunTest(falseRatio, trueRatio);
-					cout << config.GetThreshold(0) << "\t" << falseRatio << "\t" << trueRatio << "\t" << config.GetOperations() << "\t" << config.GetLength(0) << endl;
-				}
-			}
-			else {
-				long double falseRatio, trueRatio;
-				RunTest(falseRatio, trueRatio);
-				cout
-					<< "Correct: " << roundf(trueRatio * 1000.0L)/10.0L << "% of contaminated samples" << endl
-					<< "False: " << roundf(falseRatio * 1000.0L)/10.0L << "% of all samples" << endl;
-			}
-		}
-	}
-	delete method;
-	delete testSets;
-}
-
-void FlagTest::RunTest(long double &falseRatio, long double &trueRatio)
-{
-	bool iterationFinished;
-	int repeated = 0;
-	size_t totalCorrect=0, totalNotfound=0, totalError=0, totalTotal=0, totalTotalRFI=0;
-	do {
-		iterationFinished = true;
-		Mask2DPtr rfi = Mask2D::CreateSetMaskPtr<false>(width, height);
-		Image2DPtr data = MitigationTester::CreateTestSet(testSet, rfi, width, height);
-	
-		iterator.SetOriginalFlag(rfi);
-
-		TimeFrequencyData *input;
-		if(mitigateMethod == SVD) {
-			input = new TimeFrequencyData(TimeFrequencyData::SinglePolarisation, data, data);
-			iterator.SetInput(*input);
-		} else {
-			input = new TimeFrequencyData(TimeFrequencyData::AmplitudePart, TimeFrequencyData::SinglePolarisation, data);
-			iterator.SetInput(*input);
-		}
-	
-		iterator.IterateBackgroundFit(*method, 1, "flags/testset", iterations);
-	
-		size_t correct=0, notfound=0, error=0, total=rfi->Width()*rfi->Height();
-		MitigationTester::CountResults(iterator.GetMask(), rfi, correct, notfound, error);
-		size_t totalRfi = rfi->GetCount<true>();
-		totalCorrect += correct;
-		totalNotfound += notfound;
-		totalError += error;
-		totalTotal += total;
-		totalTotalRFI += totalRfi;
-		if(totalRfi==0) {
-			totalRfi = 1; correct = 1; notfound = 0;
-		}
-	
-		delete input;
-
-		if(repeated+1 < repeat) {
-			iterationFinished = false;
-			repeated++;
-		}
-	} while(!iterationFinished);
-	falseRatio = (long double) totalError / totalTotal;
-	trueRatio = (long double) totalCorrect / totalTotalRFI;
-}
-
-void FlagTest::Perform(long double &falseRatio, long double &trueRatio, long double parameter)
-{
-	iterator.Config().InitializeThresholdsFromFirstThreshold(parameter, ThresholdConfig::Gaussian);
-	RunTest(falseRatio, trueRatio);
-}
-
-int main(int argc, char *argv[])
-{
-	FlagTest flagTest;
-	flagTest.Run(argc, argv);
-}
diff --git a/CEP/DP3/AOFlagger/src/gui/antennamap/antenna.cpp b/CEP/DP3/AOFlagger/src/gui/antennamap/antenna.cpp
deleted file mode 100644
index a247579589b092bae30a075592d128cfb1441835..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/gui/antennamap/antenna.cpp
+++ /dev/null
@@ -1,42 +0,0 @@
-#include <AOFlagger/gui/antennamap/antenna.h>
-#include <AOFlagger/gui/antennamap/antennamap.h>
-
-namespace antennaMap
-{
-
-bool Antenna::Draw(Cairo::RefPtr<Cairo::Context> cairo, double offsetX, double offsetY, int layer, double timeInFrameSeconds)
-{
-	runTo(timeInFrameSeconds);
-	double
-		centerX = _map.UCSToPixelX(GetXInUCS()),
-		centerY = _map.UCSToPixelY(GetYInUCS());
-	cairo->set_line_width(2.0);
-	
-	switch(layer)
-	{
-		case 0:
-			// The red circle that represents the value
-			cairo->arc(centerX + offsetX, centerY + offsetY, 5.0 + _value * GetMaxCircleRadius(), 0.0, 2.0*M_PI);
-			cairo->set_source_rgba(1.0, 0.0, 0.0, 0.25);
-			cairo->fill();
-			break;
-		case 1:
-			// A gray circle that represents the running max value
-			cairo->arc(centerX + offsetX, centerY + offsetY, 5.0 + _runningMaxValue * GetMaxCircleRadius(), 0.0, 2.0*M_PI);
-			cairo->set_source_rgba(0.5, 0.5, 0.5, 1.0);
-			cairo->stroke();
-			break;
-		case 2:
-			// A black with gray filled circle to specify the position of the antenna/station
-			cairo->arc(centerX + offsetX, centerY + offsetY, 5.0, 0.0, 2.0*M_PI);
-			cairo->set_source_rgba(0.5, 0.5, 0.5, 1.0);
-			cairo->fill_preserve();
-			
-			cairo->set_source_rgba(0.0, 0.0, 0.0, 1.0);
-			cairo->stroke();
-			break;
-	}
-	return layer < 2;
-}
-
-}
diff --git a/CEP/DP3/AOFlagger/src/gui/antennamap/antennamap.cpp b/CEP/DP3/AOFlagger/src/gui/antennamap/antennamap.cpp
deleted file mode 100644
index c1f20bfdad1c55a28bbfffbce422b09c1d12abe1..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/gui/antennamap/antennamap.cpp
+++ /dev/null
@@ -1,255 +0,0 @@
-#include <AOFlagger/gui/antennamap/antennamap.h>
-#include <AOFlagger/gui/antennamap/clock.h>
-#include <AOFlagger/gui/antennamap/spectrumanalyzer.h>
-
-namespace antennaMap
-{
-
-AntennaMap::AntennaMap(MeasurementSet &set)
-: _clock(0), _analyzer(0), _statFile(0), _lastFactor(0.0), _lastFactorChangeTime(0.0)
-{
-	const size_t antennaCount = set.AntennaCount();
-	for(unsigned i=0;i<antennaCount;++i)
-	{
-		AntennaInfo info = set.GetAntennaInfo(i);
-		_antennas.push_back(new Antenna(*this, info));
-	}
-	_analyzer = new SpectrumAnalyzer(32);
-}
-
-AntennaMap::~AntennaMap()
-{
-	for(std::vector<Antenna*>::iterator i=_antennas.begin(); i!=_antennas.end(); ++i)
-		delete *i;
-	if(_statFile != 0)
-		delete _statFile;
-	if(_clock != 0)
-		delete _clock;
-	if(_analyzer != 0)
-		delete _analyzer;
-}
-
-void AntennaMap::Draw(Cairo::RefPtr<Cairo::Context> cairo, int width, int height, double timeInFrameSeconds)
-{
-	_widthInPixels = width;
-	_heightInPixels = height;
-	initMetrics();
-	
-	cairo->rectangle(0.0, 0.0, width, height);
-	cairo->set_source_rgba(255, 255, 255, 1);
-	cairo->fill();
-	
-	double analyzerHeight = 100.0;
-
-	double
-		offsetX = Antenna::GetMaxWidthInPixels()/2.0,
-		offsetY = Antenna::GetMaxHeightInPixels()/2.0;
-	bool moreLayers;
-	int layer = 0;
-	do {
-		 moreLayers = false;
-		for(std::vector<Antenna*>::iterator i=_antennas.begin();i!=_antennas.end();++i)
-		{
-			if((*i)->Draw(cairo, offsetX, offsetY, layer, timeInFrameSeconds))
-				moreLayers = true;
-		}
-		++layer;
-	} while(moreLayers);
-
-	double clockWidth = 0.0;
-	if(_clock != 0)
-	{
-		_clock->Draw(cairo, 0.0, 0.0);
-		clockWidth = _clock->Width();
-	}
-	if(_analyzer != 0)
-		_analyzer->Draw(cairo, clockWidth, 0.0, width - clockWidth - 2, analyzerHeight, timeInFrameSeconds);
-}
-
-void AntennaMap::initMetrics()
-{
-	const double analyzerHeight = 100.0;
-	
-	if(_antennas.size() == 0)
-	{
-		_xUCSToPixelsFactor = 0.0;
-		_xUCSToPixelsOffset = 0.0;
-		_yUCSToPixelsFactor = 0.0;
-		_yUCSToPixelsOffset = 0.0;
-	} else {
-		std::vector<Antenna*>::const_iterator i = _antennas.begin();
-		
-		double
-			minX = (*i)->GetXInUCS(),
-			minY = (*i)->GetYInUCS(),
-			maxX = (*i)->GetXInUCS(),
-			maxY = (*i)->GetYInUCS();
-			
-		++i;
-		
-		while(i!=_antennas.end())
-		{
-			const double 
-				x = (*i)->GetXInUCS(),
-				y = (*i)->GetYInUCS();
-			if(x < minX) minX = x;
-			if(y < minY) minY = y;
-			if(x > maxX) maxX = x;
-			if(y > maxY) maxY = y;
-			++i;
-		}
-		if(maxX == minX)
-		{
-			maxX += 1;
-			minX -= 1;
-		}
-		if(maxY == minY)
-		{
-			maxY += 1;
-			minY -= 1;
-		}
-		
-		double
-			availableWidth = _widthInPixels - Antenna::GetMaxWidthInPixels(),
-			availableHeight = _heightInPixels - Antenna::GetMaxHeightInPixels() - analyzerHeight;
-			
-		_xUCSToPixelsFactor = availableWidth / (maxX - minX);
-		_xUCSToPixelsOffset = -minX * _xUCSToPixelsFactor;
-		_yUCSToPixelsFactor = availableHeight / (maxY - minY);
-		_yUCSToPixelsOffset = -minY * _yUCSToPixelsFactor + analyzerHeight;
-	}
-}
-
-void AntennaMap::OpenStatFile(const std::string &statFilename)
-{
-	if(_statFile != 0)
-		delete _statFile;
-	_statFile = new std::ifstream(statFilename.c_str());
-	string headers;
-	getline(*_statFile, headers);
-	_clock = new Clock();
-}
-
-void AntennaMap::OpenAntennaFile(const std::string &antennaFile, double timeInFrameSeconds)
-{
-	if(_statFile != 0)
-		delete _statFile;
-	const unsigned size = _antennas.size();
-	
-	std::ifstream f(antennaFile.c_str());
-	string headers;
-	getline(f, headers);
-	Image2DPtr
-		weights = Image2D::CreateZeroImagePtr(size, size),
-		values = Image2D::CreateZeroImagePtr(size, size);
-	while(!f.eof())
-	{
-		int antenna1Index, antenna2Index;
-		unsigned long totalCount, rfiCount;
-		std::string tmpString;
-		double tmp;
-		f
-		>> antenna1Index;
-		if(f.eof()) break;
-		f
-		>> antenna2Index
-		>> tmpString
-		>> tmpString
-		>> tmp
-		>> tmp
-		>> totalCount
-		>> tmp
-		>> rfiCount
-		>> tmp
-		>> tmp
-		>> tmp
-		>> tmp
-		>> tmp;
-		
-		if(antenna2Index > antenna1Index)
-		{
-			weights->AddValue(antenna1Index, antenna2Index, totalCount);
-			values->AddValue(antenna1Index, antenna2Index, rfiCount);
-		} else {
-			weights->AddValue(antenna2Index, antenna1Index, totalCount);
-			values->AddValue(antenna2Index, antenna1Index, rfiCount);
-		}
-	}
-	setValues(values, weights, timeInFrameSeconds);
-}
-
-void AntennaMap::ReadStatFile(int timeSteps, double timeInFrameSeconds)
-{
-	const unsigned count = _antennas.size();
-	Image2DPtr
-		weights = Image2D::CreateZeroImagePtr(count, count),
-		values = Image2D::CreateZeroImagePtr(count, count);
-	std::streampos matrixStart = _statFile->tellg();
-	double currentTime = 0.0;
-	while(!_statFile->eof() && timeSteps >= 0)
-	{
-		int antenna1Index, antenna2Index;
-		double time, totalCount, rfiCount;
-		std::streampos rowStart = _statFile->tellg();
-		(*_statFile)
-		>> antenna1Index;
-		if(_statFile->eof()) break;
-		(*_statFile)
-		>> antenna2Index
-		>> time
-		>> totalCount
-		>> rfiCount;
-		if(time != currentTime)
-		{
-			--timeSteps;
-			matrixStart = rowStart;
-			currentTime = time;
-		}
-		if(timeSteps >= 0)
-		{
-			if(antenna2Index > antenna1Index)
-			{
-				weights->AddValue(antenna1Index, antenna2Index, totalCount);
-				values->AddValue(antenna1Index, antenna2Index, rfiCount);
-			} else {
-				weights->AddValue(antenna2Index, antenna1Index, totalCount);
-				values->AddValue(antenna2Index, antenna1Index, rfiCount);
-			}
-		}
-	}
-	_clock->SetTime(currentTime);
-	_statFile->seekg(matrixStart);
-	setValues(values, weights, timeInFrameSeconds);
-}
-
-void AntennaMap::OpenSpectrumFile(const std::string &spectrumFile, double timeInFrameSeconds)
-{
-	std::ifstream f(spectrumFile.c_str());
-	string headers;
-	getline(f, headers);
-	while(!f.eof())
-	{
-		unsigned index;
-		double frequencyStart, frequencyEnd;
-		long double totalCount, rfiCount;
-		double tmp;
-		f
-		>> index;
-		if(f.eof()) break;
-		f
-		>> frequencyStart
-		>> frequencyEnd
-		>> totalCount
-		>> tmp
-		>> rfiCount;
-		for(unsigned i=0;i<11 + 14*3;++i)
-		{
-			f >> tmp;
-			std::cout << tmp << ' ';
-		}
-		std::cout << index << '\n';
-		_analyzer->SetValue(index/8, (long double) rfiCount / (long double) totalCount, timeInFrameSeconds);
-	}
-}
-
-}
diff --git a/CEP/DP3/AOFlagger/src/gui/application.cpp b/CEP/DP3/AOFlagger/src/gui/application.cpp
deleted file mode 100644
index 49c516f775fcbd693ed34e41561186f94e2607d5..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/gui/application.cpp
+++ /dev/null
@@ -1,55 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <AOFlagger/gui/application.h>
-
-#include <gtkmm.h>
-
-#include <AOFlagger/configuration.h>
-
-#ifdef HAS_LOFARSTMAN
-#include <LofarStMan/Register.h>
-#endif // HAS_LOFARSTMAN
-
-#include <AOFlagger/gui/mswindow.h>
-
-Application::Application()
-{
-}
-
-Application::~Application()
-{
-}
-
-void Application::Run(int argc, char *argv[])
-{
-#ifdef HAS_LOFARSTMAN
-  register_lofarstman();
-#endif // HAS_LOFARSTMAN
-
-	Gtk::Main kit(argc, argv);
-	MSWindow window;
-	window.present();
-	if(argc > 1)
-	{
-		window.OpenPath(argv[1]);
-	}
-	kit.run(window);
-}
-
diff --git a/CEP/DP3/AOFlagger/src/gui/complexplaneplotwindow.cpp b/CEP/DP3/AOFlagger/src/gui/complexplaneplotwindow.cpp
deleted file mode 100644
index 830c309dab11907b1af69950c5ff3a083716dca5..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/gui/complexplaneplotwindow.cpp
+++ /dev/null
@@ -1,373 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <AOFlagger/gui/complexplaneplotwindow.h>
-
-#include <set>
-#include <sstream>
-
-#include <gtkmm/messagedialog.h>
-
-#include <AOFlagger/msio/antennainfo.h>
-#include <AOFlagger/msio/date.h>
-#include <AOFlagger/msio/image2d.h>
-
-#include <AOFlagger/strategy/plots/rfiplots.h>
-
-#include <AOFlagger/strategy/algorithms/thresholdmitigater.h>
-#include <AOFlagger/strategy/algorithms/fringestoppingfitter.h>
-
-#include <AOFlagger/gui/plot/plotmanager.h>
-
-#include <AOFlagger/imaging/uvimager.h>
-
-#include <AOFlagger/gui/mswindow.h>
-
-ComplexPlanePlotWindow::ComplexPlanePlotWindow(MSWindow &_msWindow, PlotManager &plotManager)
-	: _msWindow(_msWindow),
-		_plotManager(plotManager),
-		_detailsFrame("Location details"),
-		_detailsLabel(),
-		_xPositionLabel("time start position:"),
-		_yPositionLabel("frequency start position:"),
-		_lengthLabel("time length:"),
-		_ySumLengthLabel("Frequency averaging size:"),
-		_xPositionScale(0.0, _msWindow.GetOriginalData().ImageWidth(), 1.0),
-		_yPositionScale(0.0, _msWindow.GetOriginalData().ImageHeight(), 1.0),
-		_lengthScale(1.0, _msWindow.GetOriginalData().ImageWidth(), 1.0),
-		_ySumLengthScale(1.0, _msWindow.GetOriginalData().ImageHeight(), 1.0),
-		_realVersusImaginaryButton("Real versus imaginary"),
-		_timeVersusRealButton("Time versus real"),
-		_allValuesButton("All values"),
-		_unmaskedValuesButton("Unmasked values"),
-		_maskedValuesButton("Masked values"),
-		_fittedValuesButton("Fitted values (constant freq)"),
-		_individualSampleFitButton("Channel fitted values (varying freq)"),
-		_fringeFitButton("Fringe fitted (varying freq)"),
-		_dynamicFringeFitButton("Dynamic fringe fitted (varying freq+amp)"),
-		_plotButton("Plot"),
-		_xMax(_msWindow.GetOriginalData().ImageWidth()),
-		_yMax(_msWindow.GetOriginalData().ImageHeight())
-{
-	_detailsFrame.add(_detailsBox);
-	_detailsBox.show();
-
-	_detailsBox.pack_start(_detailsLabel);
-	_detailsLabel.set_line_wrap(true);
-	_detailsLabel.set_max_width_chars(40);
-	_detailsLabel.show();
-
-	_mainBox.pack_start(_detailsFrame);
-	_detailsFrame.show();
-	
-	_mainBox.pack_start(_xPositionLabel);
-	_xPositionLabel.show();
-	_xPositionScale.signal_value_changed().
-		connect(sigc::mem_fun(*this, &ComplexPlanePlotWindow::onTimeStartChanged));
-	_mainBox.pack_start(_xPositionScale);
-	_xPositionScale.show();
-
-	_mainBox.pack_start(_yPositionLabel);
-	_yPositionLabel.show();
-	_yPositionScale.signal_value_changed().
-		connect(sigc::mem_fun(*this, &ComplexPlanePlotWindow::onFreqChanged));
-	_mainBox.pack_start(_yPositionScale);
-	_yPositionScale.show();
-
-	_mainBox.pack_start(_lengthLabel);
-	_lengthLabel.show();
-	_lengthScale.signal_value_changed().
-		connect(sigc::mem_fun(*this, &ComplexPlanePlotWindow::onTimeDurationChanged));
-	_mainBox.pack_start(_lengthScale);
-	_lengthScale.show();
-
-	_mainBox.pack_start(_ySumLengthLabel);
-	_ySumLengthLabel.show();
-	_ySumLengthScale.signal_value_changed().
-		connect(sigc::mem_fun(*this, &ComplexPlanePlotWindow::onFreqSizeChanged));
-	_mainBox.pack_start(_ySumLengthScale);
-	_ySumLengthScale.show();
-
-	_mainBox.pack_start(_realVersusImaginaryButton);
-	_realVersusImaginaryButton.show();
-	Gtk::RadioButtonGroup group = _realVersusImaginaryButton.get_group();
-	_timeVersusRealButton.set_group(group);
-	_realVersusImaginaryButton.set_active(true);
-	_mainBox.pack_start(_timeVersusRealButton);
-	_timeVersusRealButton.show();
-
-	_mainBox.pack_start(_allValuesButton);
-	_allValuesButton.set_active(true);
-	_allValuesButton.show();
-
-	_mainBox.pack_start(_maskedValuesButton);
-	_maskedValuesButton.show();
-
-	_mainBox.pack_start(_unmaskedValuesButton);
-	_unmaskedValuesButton.show();
-
-	_mainBox.pack_start(_fittedValuesButton);
-	_fittedValuesButton.set_active(true);
-	_fittedValuesButton.show();
-
-	_mainBox.pack_start(_individualSampleFitButton);
-	_individualSampleFitButton.show();
-
-	_mainBox.pack_start(_fringeFitButton);
-	_fringeFitButton.show();
-
-	_mainBox.pack_start(_dynamicFringeFitButton);
-	_dynamicFringeFitButton.show();
-
-	_plotButton.signal_clicked().connect(sigc::mem_fun(*this, &ComplexPlanePlotWindow::onPlotPressed));
-	_buttonBox.pack_start(_plotButton);
-	_plotButton.show();
-
-	_mainBox.pack_start(_buttonBox);
-	_buttonBox.show();
-
-	add(_mainBox);
-	_mainBox.show();
-
-	_observationTimes = _msWindow.TimeFrequencyMetaData()->ObservationTimes();
-
-	setDetailsLabel();
-}
-
-ComplexPlanePlotWindow::~ComplexPlanePlotWindow()
-{
-}
-
-void ComplexPlanePlotWindow::onPlotPressed()
-{
-	if(_msWindow.HasImage())
-	{
-		try {
-			Plot2D &plot = _plotManager.NewPlot2D("Complex plane");
-			size_t x = (size_t) _xPositionScale.get_value();
-			size_t y = (size_t) _yPositionScale.get_value();
-			size_t length = (size_t) _lengthScale.get_value();
-			size_t avgSize = (size_t) _ySumLengthScale.get_value();
-			bool realVersusImaginary = _realVersusImaginaryButton.get_active();
-			const TimeFrequencyData &data = _msWindow.GetActiveData();
-
-			if(_allValuesButton.get_active())
-			{
-				Plot2DPointSet *pointSet;
-				if(realVersusImaginary)
-					pointSet = &plot.StartLine("Data", Plot2DPointSet::DrawPoints);
-				else
-					pointSet = &plot.StartLine("Data (real)", Plot2DPointSet::DrawPoints);
-				Mask2DPtr mask = Mask2D::CreateSetMaskPtr<false>(_msWindow.AltMask()->Width(), _msWindow.AltMask()->Height());
-				RFIPlots::MakeComplexPlanePlot(*pointSet, data, x, length, y, avgSize, mask, realVersusImaginary, false);
-	
-				if(!realVersusImaginary)
-				{
-					pointSet = &plot.StartLine("Data (imaginary)", Plot2DPointSet::DrawPoints);
-					RFIPlots::MakeComplexPlanePlot(*pointSet, data, x, length, y, avgSize, mask, realVersusImaginary, true);
-				}
-			}
-
-			if(_unmaskedValuesButton.get_active())
-			{
-				Plot2DPointSet *pointSet = &plot.StartLine("Without RFI");
-				RFIPlots::MakeComplexPlanePlot(*pointSet, data, x, length, y, avgSize, _msWindow.AltMask(), realVersusImaginary, false);
-				if(!realVersusImaginary)
-				{
-					pointSet = &plot.StartLine("Without RFI (I)");
-					RFIPlots::MakeComplexPlanePlot(*pointSet, data, x, length, y, avgSize, _msWindow.AltMask(), realVersusImaginary, true);
-				}
-			}
-	
-			if(_maskedValuesButton.get_active())
-			{
-				Plot2DPointSet *pointSet = &plot.StartLine("Only RFI");
-				Mask2DPtr mask = Mask2D::CreateCopy(_msWindow.AltMask());
-				mask->Invert();
-				RFIPlots::MakeComplexPlanePlot(*pointSet, data, x, length, y, avgSize, mask, realVersusImaginary, false);
-				if(!realVersusImaginary)
-				{
-					pointSet = &plot.StartLine("Only RFI (I)");
-					RFIPlots::MakeComplexPlanePlot(*pointSet, data, x, length, y, avgSize, mask, realVersusImaginary, true);
-				}
-			}
-	
-			if(_fittedValuesButton.get_active())
-			{
-				Plot2DPointSet *pointSet;
-				if(realVersusImaginary)
-					pointSet = &plot.StartLine("Fit");
-				else
-					pointSet = &plot.StartLine("Fit (real)");
-				size_t middleY = (2*y + avgSize) / 2;
-				Baseline baseline(_msWindow.TimeFrequencyMetaData()->Antenna1(), _msWindow.TimeFrequencyMetaData()->Antenna2());
-				long double fringeCount =
-					UVImager::GetFringeCount(x, x+length, middleY, _msWindow.TimeFrequencyMetaData());
-				long double fringeFrequency = fringeCount / length;
-				Mask2DPtr mask = Mask2D::CreateSetMaskPtr<false>(_msWindow.AltMask()->Width(), _msWindow.AltMask()->Height());
-				RFIPlots::MakeFittedComplexPlot(*pointSet, data, x, length, y, avgSize, mask, fringeFrequency, realVersusImaginary, false);
-				if(!realVersusImaginary)
-				{
-					pointSet = &plot.StartLine("Fit (imaginary)");
-					RFIPlots::MakeFittedComplexPlot(*pointSet, data, x, length, y, avgSize, mask, fringeFrequency, realVersusImaginary, true);
-				}
-			}
-
-			if(_individualSampleFitButton.get_active())
-			{
-				FringeStoppingFitter fitter;
-				fitter.Initialize(data);
-				fitter.SetFitChannelsIndividually(true);
-				fitter.SetFringesToConsider(1.0L);
-				fitter.SetMaxWindowSize(256);
-				fitter.SetReturnFittedValue(true);
-				fitter.SetReturnMeanValue(false);
-				
-				fitter.SetMetaData(_msWindow.TimeFrequencyMetaData());
-				fitter.PerformStaticFrequencyFitOnOneChannel(y);
-
-				Plot2DPointSet *pointSet;
-				if(realVersusImaginary)
-					pointSet = &plot.StartLine("Fit");
-				else
-					pointSet = &plot.StartLine("Fit (real)");
-				Mask2DPtr mask = Mask2D::CreateSetMaskPtr<false>(_msWindow.AltMask()->Width(), _msWindow.AltMask()->Height());
-				RFIPlots::MakeComplexPlanePlot(*pointSet, fitter.Background(), x, length, y, avgSize, mask, realVersusImaginary, false);
-	
-				fitter.SetReturnFittedValue(false);
-				fitter.SetReturnMeanValue(true);
-				if(!realVersusImaginary)
-				{
-					pointSet = &plot.StartLine("Fit (imaginary)");
-					RFIPlots::MakeComplexPlanePlot(*pointSet, fitter.Background(), x, length, y, avgSize, mask, realVersusImaginary, true);
-				}
-
-				fitter.PerformStaticFrequencyFitOnOneChannel(y);
-
-				pointSet = &plot.StartLine("Center");
-				RFIPlots::MakeComplexPlanePlot(*pointSet, fitter.Background(), x, length, y, avgSize, mask, realVersusImaginary, false);
-	
-				if(!realVersusImaginary)
-				{
-					pointSet = &plot.StartLine("Center (I)");
-					RFIPlots::MakeComplexPlanePlot(*pointSet, fitter.Background(), x, length, y, avgSize, mask, realVersusImaginary, true);
-				}
-			}
-	
-			if(_fringeFitButton.get_active() || _dynamicFringeFitButton.get_active())
-			{
-				/*FringeStoppingFitter fitter;
-				Image2DPtr zero = Image2D::CreateZeroImagePtr(data.ImageWidth(), data.ImageHeight());
-				Image2DPtr ones = Image2D::CreateZeroImagePtr(data.ImageWidth(), data.ImageHeight());
-				for(size_t yi=0;yi<ones->Height();++yi)
-					for(size_t xi=0;xi<ones->Width();++xi)
-						ones->SetValue(xi, yi, 1.0L);
-				TimeFrequencyData data(StokesIPolarisation, ones, zero);
-				fitter.Initialize(data);
-				fitter.SetFitChannelsIndividually(true);
-				
-				fitter.SetMetaData(_msWindow.TimeFrequencyMetaData());
-				fitter.PerformFringeStop();
-
-				plot.StartLine("Fringe rotation");
-				Mask2DPtr mask = Mask2D::CreateSetMaskPtr<false>(_msWindow.AltMask()->Width(), _msWindow.AltMask()->Height());
-				RFIPlots::MakeComplexPlanePlot(plot, fitter.Background(), x, length, y, avgSize, mask, realVersusImaginary, false);
-	
-				if(!realVersusImaginary)
-				{
-					plot.StartLine("Fringe rotation (I)");
-					RFIPlots::MakeComplexPlanePlot(plot, fitter.Background(), x, length, y, avgSize, mask, realVersusImaginary, true);
-				}*/
-
-				FringeStoppingFitter fitter;
-				fitter.Initialize(data);
-				
-				fitter.SetMetaData(_msWindow.TimeFrequencyMetaData());
-				//fitter.PerformFringeStop();
-				fitter.SetReturnFittedValue(true);
-				if(_dynamicFringeFitButton.get_active())
-					fitter.PerformDynamicFrequencyFit(y, y + avgSize, 200);
-				else
-					fitter.PerformDynamicFrequencyFit(y, y + avgSize);
-
-				Plot2DPointSet *pointSet;
-				if(realVersusImaginary)
-					pointSet = &plot.StartLine("Fit");
-				else
-					pointSet = &plot.StartLine("Fit (real)");
-				Mask2DPtr mask = Mask2D::CreateSetMaskPtr<false>(_msWindow.AltMask()->Width(), _msWindow.AltMask()->Height());
-				RFIPlots::MakeComplexPlanePlot(*pointSet, fitter.Background(), x, length, y, avgSize, mask, realVersusImaginary, false);
-	
-				if(!realVersusImaginary)
-				{
-					pointSet = &plot.StartLine("Fit (imaginary)");
-					RFIPlots::MakeComplexPlanePlot(*pointSet, fitter.Background(), x, length, y, avgSize, mask, realVersusImaginary, true);
-				}
-			}
-
-			_plotManager.Update();
-			
-		} catch(std::exception &e)
-		{
-			Gtk::MessageDialog dialog(*this, e.what(), false, Gtk::MESSAGE_ERROR);
-			dialog.run();
-		}
-	}
-}
-
-void ComplexPlanePlotWindow::setDetailsLabel()
-{
-	size_t x = (size_t) _xPositionScale.get_value();
-	size_t y = (size_t) _yPositionScale.get_value();
-	size_t length = (size_t) _lengthScale.get_value();
-	size_t avgSize = (size_t) _ySumLengthScale.get_value();
-	size_t middleY = (2*y + avgSize) / 2;
-	TimeFrequencyMetaDataCPtr metaData = _msWindow.TimeFrequencyMetaData();
-
-	double timeStart = _observationTimes[x];
-	double deltaTime;
-	if(_observationTimes.size()>1)
-		deltaTime = _observationTimes[1] - _observationTimes[0];
-	else
-		deltaTime = 1.0;
-	long double frequency = metaData->Band().channels[middleY].frequencyHz;
-	Baseline baseline(metaData->Antenna1(), metaData->Antenna2());
-	long double delayRA = metaData->Field().delayDirectionRA;
-	long double delayDec = metaData->Field().delayDirectionDec;
-	long double intFringeFreq =
-		UVImager::GetFringeCount(x, x+length, y, metaData);
-	long double midFringeFreq =
-		UVImager::GetFringeStopFrequency((x*2 + length)/2, baseline, delayRA, delayDec, frequency, metaData);
-
-	std::stringstream s;
-	s << "Start time: " << Date::AipsMJDToString(timeStart) << std::endl
-		<< "Frequency: " << frequency/1000000.0L << "Mhz" << std::endl
-		<< "Baseline: " << baseline.Distance() << "m" << std::endl
-		<< "Delay direction: " << delayRA << "RA, " << delayDec << "dec." << std::endl
-		<< "(=" << RightAscension::ToString(delayRA) << " RA, " << Declination::ToString(delayDec) << " dec.)" << std::endl
-		<< "Mid fringe stopping freq: " << midFringeFreq << "(Hz)" << std::endl
-		<< "Fringe count: " << intFringeFreq << std::endl
-		<< "Fringe length: " << 1.0L/intFringeFreq << "(s)" << std::endl
-		<< "Time step: " << deltaTime << "(s)" << std::endl
-		<< "Samples/fringe: " << (1.0L / (deltaTime * intFringeFreq)) << std::endl
-		<< "Fringes in domain: " << intFringeFreq << std::endl;
-	
-	_detailsLabel.set_text(s.str());
-}
-
diff --git a/CEP/DP3/AOFlagger/src/gui/editstrategywindow.cpp b/CEP/DP3/AOFlagger/src/gui/editstrategywindow.cpp
deleted file mode 100644
index 29fa474bbacb55a81fa8703bdfcebb0199961f3d..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/gui/editstrategywindow.cpp
+++ /dev/null
@@ -1,563 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <iostream>
-
-#include <gtkmm/stock.h>
-#include <gtkmm/messagedialog.h>
-
-#include <AOFlagger/strategy/actions/iterationaction.h>
-#include <AOFlagger/strategy/actions/strategyaction.h>
-
-#include <AOFlagger/strategy/control/strategyreader.h>
-#include <AOFlagger/strategy/control/strategywriter.h>
-
-#include <AOFlagger/gui/editstrategywindow.h>
-#include <AOFlagger/gui/mswindow.h>
-#include <AOFlagger/gui/addstrategyactionmenu.h>
-
-#include <AOFlagger/gui/strategyframes/absthresholdframe.h>
-#include <AOFlagger/gui/strategyframes/baselineselectionframe.h>
-#include <AOFlagger/gui/strategyframes/changeresolutionframe.h>
-#include <AOFlagger/gui/strategyframes/cutareaframe.h>
-#include <AOFlagger/gui/strategyframes/directionprofileframe.h>
-#include <AOFlagger/gui/strategyframes/foreachbaselineframe.h>
-#include <AOFlagger/gui/strategyframes/foreachmsframe.h>
-#include <AOFlagger/gui/strategyframes/foreachpolarisationframe.h>
-#include <AOFlagger/gui/strategyframes/foreachcomplexcomponentframe.h>
-#include <AOFlagger/gui/strategyframes/frequencyconvolutionframe.h>
-#include <AOFlagger/gui/strategyframes/fringestoppingframe.h>
-#include <AOFlagger/gui/strategyframes/highpassfilterframe.h>
-#include <AOFlagger/gui/strategyframes/iterationframe.h>
-#include <AOFlagger/gui/strategyframes/plotframe.h>
-#include <AOFlagger/gui/strategyframes/resamplingframe.h>
-#include <AOFlagger/gui/strategyframes/setflaggingframe.h>
-#include <AOFlagger/gui/strategyframes/setimageframe.h>
-#include <AOFlagger/gui/strategyframes/slidingwindowfitframe.h>
-#include <AOFlagger/gui/strategyframes/spatialcompositionframe.h>
-#include <AOFlagger/gui/strategyframes/statisticalflaggingframe.h>
-#include <AOFlagger/gui/strategyframes/svdframe.h>
-#include <AOFlagger/gui/strategyframes/sumthresholdframe.h>
-#include <AOFlagger/gui/strategyframes/timeconvolutionframe.h>
-#include <AOFlagger/gui/strategyframes/timeselectionframe.h>
-#include <AOFlagger/gui/strategyframes/uvprojectframe.h>
-
-using namespace rfiStrategy;
-
-EditStrategyWindow::EditStrategyWindow(class MSWindow &msWindow)
- : Gtk::Window(), _msWindow(msWindow),
-	_addActionButton(Gtk::Stock::ADD), _removeActionButton(Gtk::Stock::REMOVE),
-	_moveUpButton(Gtk::Stock::GO_UP), _moveDownButton(Gtk::Stock::GO_DOWN),
-	_addFOBButton("FOB"), _addFOMSButton("FOMS"),
-	_loadEmptyButton(Gtk::Stock::NEW), _loadDefaultButton("Default"),
-	_load1Button("1"),
-	_load2Button("2"),
-	_load3Button("3"),
-	_saveButton(Gtk::Stock::SAVE), _openButton(Gtk::Stock::OPEN),
-	_rightFrame(0)
-{
-	_store = Gtk::TreeStore::create(_columns);
-	_view.set_model(_store);
-	_view.append_column("Description", _columns.description);
-	_viewScrollWindow.add(_view);
-	_view.get_selection()->signal_changed().connect(
-		sigc::mem_fun(*this, &EditStrategyWindow::onSelectionChanged));
-	
-	_viewScrollWindow.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
-	_viewScrollWindow.set_size_request(100, 400);
-	_strategyBox.pack_start(_viewScrollWindow);
-
-	initEditButtons();
-
-	initLoadDefaultsButtons();
-	
-	_paned.add1(_strategyBox);
-
-	add(_paned);
-	
-	show_all();
-	
-	_strategy = &_msWindow.Strategy();
-	fillStore();
-}
-
-EditStrategyWindow::~EditStrategyWindow()
-{
-	delete _addMenu;
-}
-
-void EditStrategyWindow::initEditButtons()
-{
-	_strategyEditButtonBox.pack_start(_addActionButton);
-	_addActionButton.set_sensitive(false);
-	_addMenu = new AddStrategyActionMenu(*this);
-	_addActionButton.set_menu(*_addMenu);
-
-	_strategyEditButtonBox.pack_start(_moveUpButton);
-	_moveUpButton.set_sensitive(false);
-	_moveUpButton.signal_clicked().connect(sigc::mem_fun(*this, &EditStrategyWindow::onMoveUpClicked));
-
-	_strategyEditButtonBox.pack_start(_moveDownButton);
-	_moveDownButton.set_sensitive(false);
-	_moveDownButton.signal_clicked().connect(sigc::mem_fun(*this, &EditStrategyWindow::onMoveDownClicked));
-
-	_strategyEditButtonBox.pack_start(_removeActionButton);
-	_removeActionButton.set_sensitive(false);
-	_removeActionButton.signal_clicked().connect(sigc::mem_fun(*this, &EditStrategyWindow::onRemoveActionClicked));
-
-	_strategyBox.pack_start(_strategyEditButtonBox, Gtk::PACK_SHRINK, 0);
-
-	_strategyFileButtonBox.pack_start(_addFOBButton);
-	_addFOBButton.signal_clicked().connect(sigc::mem_fun(*this, &EditStrategyWindow::onAddFOBaseline));
-
-	_strategyFileButtonBox.pack_start(_addFOMSButton);
-	_addFOMSButton.signal_clicked().connect(sigc::mem_fun(*this, &EditStrategyWindow::onAddFOMS));
-
-	_strategyFileButtonBox.pack_start(_saveButton);
-	_saveButton.signal_clicked().connect(sigc::mem_fun(*this, &EditStrategyWindow::onSaveClicked));
-
-	_strategyFileButtonBox.pack_start(_openButton);
-	_openButton.signal_clicked().connect(sigc::mem_fun(*this, &EditStrategyWindow::onOpenClicked));
-
-	_strategyBox.pack_start(_strategyFileButtonBox, Gtk::PACK_SHRINK, 0);
-}
-
-void EditStrategyWindow::initLoadDefaultsButtons()
-{
-	_strategyLoadDefaultsButtonBox.pack_start(_loadEmptyButton);
-	_loadEmptyButton.signal_clicked().connect(sigc::mem_fun(*this, &EditStrategyWindow::onLoadEmptyClicked));
-	_loadEmptyButton.show();
-
-	_strategyLoadDefaultsButtonBox.pack_start(_loadDefaultButton);
-	_loadDefaultButton.signal_clicked().connect(sigc::mem_fun(*this, &EditStrategyWindow::onLoadDefaultClicked));
-	_loadDefaultButton.show();
-
-	_strategyLoadDefaultsButtonBox.pack_start(_load1Button);
-	_load1Button.signal_clicked().connect(sigc::mem_fun(*this, &EditStrategyWindow::onLoad1ButtonClicked));
-	_load1Button.show();
-
-	_strategyLoadDefaultsButtonBox.pack_start(_load2Button);
-	_load2Button.signal_clicked().connect(sigc::mem_fun(*this, &EditStrategyWindow::onLoad2ButtonClicked));
-	_load2Button.show();
-
-	_strategyLoadDefaultsButtonBox.pack_start(_load3Button);
-	_load3Button.signal_clicked().connect(sigc::mem_fun(*this, &EditStrategyWindow::onLoad3ButtonClicked));
-	_load3Button.show();
-
-	_strategyBox.pack_start(_strategyLoadDefaultsButtonBox, Gtk::PACK_SHRINK, 0);
-	_strategyLoadDefaultsButtonBox.show();
-}
-
-void EditStrategyWindow::fillStore()
-{
-	Gtk::TreeModel::iterator iter = _store->append();
-	Gtk::TreeModel::Row row = *iter;
-	row[_columns.action] = _strategy;
-	row[_columns.description] = _strategy->Description();
-	row[_columns.childIndex] = 0;
-	for(size_t i = 0;i<_strategy->GetChildCount();++i)
-	{
-		fillStore(row, _strategy->GetChild(i), i);
-	}
-	_view.expand_all();
-}
-
-void EditStrategyWindow::fillStore(Gtk::TreeModel::Row &row, Action &action, size_t childIndex)
-{
-	Gtk::TreeModel::iterator iter = _store->append(row.children());
-	Gtk::TreeModel::Row newRow = *iter;
-	newRow[_columns.action] = &action;
-	newRow[_columns.description] = action.Description();
-	newRow[_columns.childIndex] = childIndex;
-	ActionContainer *container = dynamic_cast<ActionContainer*>(&action);
-	if(container != 0)
-	{
-		for(size_t i = 0;i<container->GetChildCount();++i)
-		{
-			fillStore(newRow, container->GetChild(i), i);
-		}
-	}
-}
-
-void EditStrategyWindow::onRemoveActionClicked()
-{
-	clearRightFrame();
-	Action *action = GetSelectedAction();
-	if(action != 0 && action->Parent() != 0)
-	{
-		action->Parent()->RemoveAndDelete(action);
-		_store->clear();
-		fillStore();
-		_view.get_selection()->unselect_all();
-	}
-}
-
-void EditStrategyWindow::onMoveUpClicked()
-{
-	Action *action = GetSelectedAction();
-	if(action != 0 && action->Parent() != 0)
-	{
-		ActionContainer *parent = static_cast<ActionContainer*>(action->Parent());
-		size_t index = GetSelectedActionChildIndex();
-		parent->MoveChildUp(index);
-		_store->clear();
-		fillStore();
-		selectAction(action);
-	}
-}
-
-void EditStrategyWindow::onMoveDownClicked()
-{
-	Action *action = GetSelectedAction();
-	if(action != 0 && action->Parent() != 0)
-	{
-		ActionContainer *parent = static_cast<ActionContainer*>(action->Parent());
-		size_t index = GetSelectedActionChildIndex();
-		parent->MoveChildDown(index);
-		_store->clear();
-		fillStore();
-		selectAction(action);
-	}
-}
-
-void EditStrategyWindow::onSelectionChanged()
-{
-	Action *selectedAction = GetSelectedAction();
-	if(selectedAction != 0)
-	{
-		clearRightFrame();
-		
-		_moveDownButton.set_sensitive(true);
-		_moveUpButton.set_sensitive(true);
-		_removeActionButton.set_sensitive(true);
-		ActionContainer *container = dynamic_cast<rfiStrategy::ActionContainer*>(selectedAction);
-		if(container != 0)
-		{
-			_addActionButton.set_sensitive(true);
-		} else {
-			_addActionButton.set_sensitive(false);
-		}
-
-		switch(selectedAction->Type())
-		{
-			case AbsThresholdActionType:
-				showRight(new AbsThresholdFrame(*static_cast<rfiStrategy::AbsThresholdAction*>(selectedAction), *this));
-				break;
-			case BaselineSelectionActionType:
-				showRight(new BaselineSelectionFrame(*static_cast<rfiStrategy::BaselineSelectionAction*>(selectedAction), *this));
-				break;
-			case ChangeResolutionActionType:
-				showRight(new ChangeResolutionFrame(*static_cast<rfiStrategy::ChangeResolutionAction*>(selectedAction), *this));
-				break;
-			case CutAreaActionType:
-				showRight(new CutAreaFrame(*static_cast<rfiStrategy::CutAreaAction*>(selectedAction), *this));
-				break;
-			case DirectionProfileActionType:
-				showRight(new DirectionProfileFrame(*static_cast<rfiStrategy::DirectionProfileAction*>(selectedAction), *this));
-				break;
-			case FringeStopActionType:
-				showRight(new FringeStoppingFrame(*static_cast<rfiStrategy::FringeStopAction*>(selectedAction), *this));
-				break;
-			case IterationBlockType:
-				showRight(new IterationFrame(*static_cast<rfiStrategy::IterationBlock*>(selectedAction), *this));
-				break;
-			case SlidingWindowFitActionType:
-				showRight(new SlidingWindowFitFrame(*static_cast<rfiStrategy::SlidingWindowFitAction*>(selectedAction), *this));
-				break;
-			case SVDActionType:
-				showRight(new SVDFrame(*static_cast<rfiStrategy::SVDAction*>(selectedAction), *this));
-				break;
-			case ForEachBaselineActionType:
-				showRight(new ForEachBaselineFrame(*static_cast<rfiStrategy::ForEachBaselineAction*>(selectedAction), *this));
-				break;
-			case ForEachComplexComponentActionType:
-				showRight(new ForEachComplexComponentFrame(*static_cast<rfiStrategy::ForEachComplexComponentAction*>(selectedAction), *this));
-				break;
-			case ForEachMSActionType:
-				showRight(new ForEachMSFrame(*static_cast<rfiStrategy::ForEachMSAction*>(selectedAction), *this));
-				break;
-			case ForEachPolarisationBlockType:
-				showRight(new ForEachPolarisationFrame(*static_cast<rfiStrategy::ForEachPolarisationBlock*>(selectedAction), *this));
-				break;
-			case FrequencyConvolutionActionType:
-				showRight(new FrequencyConvolutionFrame(*static_cast<rfiStrategy::FrequencyConvolutionAction*>(selectedAction), *this));
-				break;
-			case HighPassFilterActionType:
-				showRight(new HighPassFilterFrame(*static_cast<rfiStrategy::HighPassFilterAction*>(selectedAction), *this));
-				break;
-			case PlotActionType:
-				showRight(new StrategyPlotFrame(*static_cast<rfiStrategy::PlotAction*>(selectedAction), *this));
-				break;
-			case ResamplingActionType:
-				showRight(new ResamplingFrame(*static_cast<rfiStrategy::ResamplingAction*>(selectedAction), *this));
-				break;
-			case SetImageActionType:
-				showRight(new SetImageFrame(*static_cast<rfiStrategy::SetImageAction*>(selectedAction), *this));
-				break;
-			case SetFlaggingActionType:
-				showRight(new SetFlaggingFrame(*static_cast<rfiStrategy::SetFlaggingAction*>(selectedAction), *this));
-				break;
-			case SpatialCompositionActionType:
-				showRight(new SpatialCompositionFrame(*static_cast<rfiStrategy::SpatialCompositionAction*>(selectedAction), *this));
-				break;
-			case StatisticalFlagActionType:
-				showRight(new StatisticalFlaggingFrame(*static_cast<rfiStrategy::StatisticalFlagAction*>(selectedAction), *this));
-				break;
-			case SumThresholdActionType:
-				showRight(new SumThresholdFrame(*static_cast<rfiStrategy::SumThresholdAction*>(selectedAction), *this));
-				break;
-			case TimeConvolutionActionType:
-				showRight(new TimeConvolutionFrame(*static_cast<rfiStrategy::TimeConvolutionAction*>(selectedAction), *this));
-				break;
-			case TimeSelectionActionType:
-				showRight(new TimeSelectionFrame(*static_cast<rfiStrategy::TimeSelectionAction*>(selectedAction), *this));
-				break;
-			case UVProjectActionType:
-				showRight(new UVProjectFrame(*static_cast<rfiStrategy::UVProjectAction*>(selectedAction), *this));
-				break;
-			default:
-				break;
-		}
-	} else {
-		_addActionButton.set_sensitive(false);
-		_moveDownButton.set_sensitive(false);
-		_moveUpButton.set_sensitive(false);
-		_removeActionButton.set_sensitive(false);
-	}
-}
-
-void EditStrategyWindow::clearRightFrame()
-{
-	if(_rightFrame != 0)
-	{
-		delete _rightFrame;
-		_rightFrame = 0;
-	}
-}
-
-rfiStrategy::Action *EditStrategyWindow::GetSelectedAction()
-{
-	Gtk::TreeModel::iterator iter = _view.get_selection()->get_selected();
-	if(iter) //If anything is selected
-	{
-		Gtk::TreeModel::Row row = *iter;
-		return row[_columns.action];
-	}
-	else return 0;
-}
-
-size_t EditStrategyWindow::GetSelectedActionChildIndex()
-{
-	Gtk::TreeModel::iterator iter = _view.get_selection()->get_selected();
-	if(iter) //If anything is selected
-	{
-		Gtk::TreeModel::Row row = *iter;
-		return row[_columns.childIndex];
-	}
-	else return 0;
-}
-
-void EditStrategyWindow::AddAction(rfiStrategy::Action *newAction)
-{
-	Action *action = GetSelectedAction();
-	if(action != 0)
-	{
-		rfiStrategy::ActionContainer *container = dynamic_cast<rfiStrategy::ActionContainer*>(action);
-		if(container != 0)
-		{
-			container->Add(newAction);
-			_store->clear();
-			fillStore();
-			_view.get_selection()->unselect_all();
-			selectAction(newAction);
-		}
-	}
-}
-
-void EditStrategyWindow::selectAction(rfiStrategy::Action *action)
-{
-	_view.get_selection()->select(findActionRow(action));
-}
-
-void EditStrategyWindow::UpdateAction(Action *action)
-{
-	if(action != 0)
-	{
-		Gtk::TreeModel::Row row = findActionRow(action);
-		row[_columns.description] = action->Description();
-	}
-}
-
-Gtk::TreeModel::Row EditStrategyWindow::findActionRow(rfiStrategy::Action *action)
-{
-	std::deque<Gtk::TreeModel::Row> rows;
-	Gtk::TreeNodeChildren children = _store->children();
-	for(Gtk::TreeModel::const_iterator iter = children.begin();iter!=children.end();++iter)
-	{
-		const Gtk::TreeModel::Row &row = (*iter);
-		rows.push_back(row);
-	}
-	while(!rows.empty())
-	{
-		Gtk::TreeModel::Row row = rows.front();
-		rows.pop_front();
-		if(row[_columns.action] == action)
-		{
-			return row;
-		}
-		Gtk::TreeNodeChildren rowChildren = row.children();
-		for(Gtk::TreeModel::const_iterator iter = rowChildren.begin();iter != rowChildren.end();++iter)
-		{
-			Gtk::TreeModel::Row childRow = *iter;
-			rows.push_back(childRow);
-		}
-	}
-	throw BadUsageException("Could not find row in view");
-}
-
-void EditStrategyWindow::onLoadEmptyClicked()
-{
-	_strategy->RemoveAll();
-	_store->clear();
-	fillStore();
-}
-
-void EditStrategyWindow::onLoadDefaultClicked()
-{
-	_strategy->RemoveAll();
-	_strategy->LoadDefaultSingleStrategy();
-	_store->clear();
-	fillStore();
-}
-
-void EditStrategyWindow::onLoadOldClicked()
-{
-	_strategy->RemoveAll();
-	_strategy->LoadOldDefaultSingleStrategy();
-	_store->clear();
-	fillStore();
-}
-
-void EditStrategyWindow::onLoad1ButtonClicked()
-{
-	_strategy->RemoveAll();
-	_strategy->LoadFastStrategy();
-	_store->clear();
-	fillStore();
-}
-
-void EditStrategyWindow::onLoad2ButtonClicked()
-{
-	_strategy->RemoveAll();
-	_strategy->LoadDefaultStrategy();
-	_store->clear();
-	fillStore();
-}
-
-void EditStrategyWindow::onLoad3ButtonClicked()
-{
-	_strategy->RemoveAll();
-	_strategy->LoadBestStrategy();
-	_store->clear();
-	fillStore();
-}
-
-void EditStrategyWindow::onSaveClicked()
-{
-  Gtk::FileChooserDialog dialog(*this, "Save strategy", Gtk::FILE_CHOOSER_ACTION_SAVE);
-
-  dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
-  dialog.add_button("Save", Gtk::RESPONSE_OK);
-
-  Gtk::FileFilter filter;
-  filter.set_name("RFI strategies");
-  filter.add_pattern("*.rfis");
-  filter.add_mime_type("text/rfistrategy+xml");
-  dialog.add_filter(filter);
-
-  int result = dialog.run();
-  if(result == Gtk::RESPONSE_OK)
-	{
-		rfiStrategy::StrategyWriter writer;
-		std::string filename(dialog.get_filename());
-		if(filename.find('.') == std::string::npos)
-			filename += ".rfis";
-		writer.WriteToFile(*_strategy, filename);
-		
-	}
-}
-
-void EditStrategyWindow::onOpenClicked()
-{
-  Gtk::FileChooserDialog dialog(*this, "OPEN strategy", Gtk::FILE_CHOOSER_ACTION_OPEN);
-
-  dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
-  dialog.add_button("Open", Gtk::RESPONSE_OK);
-
-  Gtk::FileFilter filter;
-  filter.set_name("RFI strategies");
-  filter.add_pattern("*.rfis");
-  filter.add_mime_type("text/rfistrategy+xml");
-  dialog.add_filter(filter);
-
-  int result = dialog.run();
-  if(result == Gtk::RESPONSE_OK)
-	{
-		StrategyReader reader;
-		std::string filename(dialog.get_filename());
-		Strategy *oldStrategy = _strategy;
-		try {
-			_strategy = reader.CreateStrategyFromFile(filename);
-			_msWindow.SetStrategy(_strategy);
-			delete oldStrategy;
-			_store->clear();
-			fillStore();
-		} catch(std::exception &e)
-		{
-			Gtk::MessageDialog dialog(*this, e.what(), false, Gtk::MESSAGE_ERROR);
-			dialog.run();
-		}
-	}
-}
-
-void EditStrategyWindow::onAddFOBaseline()
-{
-	addContainerBetween(*_strategy, new rfiStrategy::ForEachBaselineAction());
-	_store->clear();
-	fillStore();
-}
-
-void EditStrategyWindow::onAddFOMS()
-{
-	addContainerBetween(*_strategy, new rfiStrategy::ForEachMSAction());
-	_store->clear();
-	fillStore();
-}
-
-void EditStrategyWindow::addContainerBetween(rfiStrategy::ActionContainer &root, rfiStrategy::ActionContainer *newContainer)
-{
-	while(root.GetChildCount() > 0)
-	{
-		Action *moveAction = &root.GetFirstChild();
-		root.RemoveWithoutDelete(moveAction);
-		newContainer->Add(moveAction);
-	}
-	root.Add(dynamic_cast<Action *>(newContainer));
-}
-
diff --git a/CEP/DP3/AOFlagger/src/gui/gotowindow.cpp b/CEP/DP3/AOFlagger/src/gui/gotowindow.cpp
deleted file mode 100644
index c8a4ad42f84f02a4579d255f02f879e59ffbf0dc..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/gui/gotowindow.cpp
+++ /dev/null
@@ -1,170 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <AOFlagger/gui/gotowindow.h>
-
-#include <sstream>
-
-#include <gtkmm/treemodel.h>
-
-#include <AOFlagger/strategy/imagesets/msimageset.h>
-
-#include <AOFlagger/gui/mswindow.h>
-
-
-GoToWindow::GoToWindow(MSWindow &msWindow) : Gtk::Window(),
-	_antenna1Frame("Antenna 1"), _antenna2Frame("Antenna 2"), _bandFrame("Band"),
-	_loadButton("Load"),
-	_msWindow(msWindow),
-	_imageSet(&dynamic_cast<rfiStrategy::MSImageSet&>(msWindow.GetImageSet()))
-{
-	_antennaeStore = Gtk::ListStore::create(_antennaModelColumns);
-	_bandStore = Gtk::ListStore::create(_bandModelColumns);
-
-	const std::vector<std::pair<size_t,size_t> > &_baselines =
-		_imageSet->Baselines();
-
-	const rfiStrategy::MSImageSetIndex &setIndex =
-		static_cast<rfiStrategy::MSImageSetIndex&>(_msWindow.GetImageSetIndex());
-	const unsigned antenna1Index = _imageSet->GetAntenna1(setIndex);
-	const unsigned antenna2Index = _imageSet->GetAntenna2(setIndex);
-	const unsigned bandIndex = _imageSet->GetBand(setIndex);
-
-	// First, the baseline pairs are iterated to get all antenna indices.
-	std::set<size_t> set;
-	for(std::vector<std::pair<size_t,size_t> >::const_iterator i=_baselines.begin();
-		i != _baselines.end() ; ++i)
-	{
-		set.insert(i->first);
-		set.insert(i->second);
-	}
-
-	Gtk::TreeModel::iterator a1Row, a2Row, bandRow;
-
-	// Now we make a store that contains all antennas. This store is shared for both a1 and a2 views.
-	for(std::set<size_t>::const_iterator i=set.begin();i!=set.end();++i)
-	{
-		Gtk::TreeModel::iterator iter = _antennaeStore->append();
-		(*iter)[_antennaModelColumns.antennaIndex] = *i;
-		AntennaInfo antenna = _imageSet->GetAntennaInfo(*i);
-		(*iter)[_antennaModelColumns.antennaName] = antenna.name;
-		if(antenna1Index == *i)
-			a1Row = iter;
-		if(antenna2Index == *i)
-			a2Row = iter;
-	}
-
-	for(size_t i=0;i<_imageSet->BandCount();++i)
-	{
-		Gtk::TreeModel::iterator iter = _bandStore->append();
-		(*iter)[_bandModelColumns.bandIndex] = i;
-		std::stringstream desc;
-		BandInfo band = _imageSet->GetBandInfo(i);
-		desc << Frequency::ToString(band.channels.front().frequencyHz);
-		desc << " - ";
-		desc << Frequency::ToString(band.channels.back().frequencyHz);
-		(*iter)[_bandModelColumns.bandDescription] = desc.str();
-		if(i == bandIndex)
-			bandRow = iter;
-	}
-
-	_antenna1View.set_model(_antennaeStore);
-	_antenna1View.append_column("Index", _antennaModelColumns.antennaIndex);
-	_antenna1View.append_column("Name", _antennaModelColumns.antennaName);
-	_antenna1View.set_size_request(-1, 512);
-	_antenna1View.get_selection()->select(a1Row);
-	_antenna1Scroll.add(_antenna1View);
-	_antenna1View.show();
-	_antenna1Frame.add(_antenna1Scroll);
-	_antenna1Scroll.set_policy(Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC);
-	_antenna1Scroll.show();
-	_hBox.pack_start(_antenna1Frame);
-	_antenna1Frame.show();
-
-	_antenna2View.set_model(_antennaeStore);
-	_antenna2View.append_column("Index", _antennaModelColumns.antennaIndex);
-	_antenna2View.append_column("Name", _antennaModelColumns.antennaName);
-	_antenna2View.set_size_request(-1, 512);
-	_antenna2View.get_selection()->select(a2Row);
-	_antenna2Scroll.add(_antenna2View);
-	_antenna2View.show();
-	_antenna2Frame.add(_antenna2Scroll);
-	_antenna2Scroll.set_policy(Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC);
-	_antenna2Scroll.show();
-	_hBox.pack_start(_antenna2Frame);
-	_antenna2Frame.show();
-
-	_bandView.set_model(_bandStore);
-	_bandView.append_column("Index", _bandModelColumns.bandIndex);
-	_bandView.append_column("Description", _bandModelColumns.bandDescription);
-	_bandView.set_size_request(-1, 512);
-	_bandView.get_selection()->select(bandRow);
-	_bandScroll.add(_bandView);
-	_bandView.show();
-	_bandFrame.add(_bandScroll);
-	_bandScroll.set_policy(Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC);
-	_bandScroll.show();
-	_hBox.pack_start(_bandFrame);
-	_bandFrame.show();
-
-	_vBox.pack_start(_hBox);
-	_hBox.show();
-
-	_loadButton.signal_clicked().connect(sigc::mem_fun(*this, &GoToWindow::onLoadClicked));
-	_buttonBox.pack_start(_loadButton);
-	_loadButton.show();
-
-	_vBox.pack_start(_buttonBox, Gtk::PACK_SHRINK, 0);
-	_buttonBox.show();
-
-	add(_vBox);
-	_vBox.show();
-}
-
-GoToWindow::~GoToWindow()
-{
-}
-
-void GoToWindow::onLoadClicked()
-{
-	Glib::RefPtr<Gtk::TreeSelection> a1 =
-    _antenna1View.get_selection();
-	Gtk::TreeModel::iterator iterA1 = a1->get_selected();
-
-	Glib::RefPtr<Gtk::TreeSelection> a2 =
-    _antenna2View.get_selection();
-	Gtk::TreeModel::iterator iterA2 = a2->get_selected();
-
-	Glib::RefPtr<Gtk::TreeSelection> b =
-    _bandView.get_selection();
-	Gtk::TreeModel::iterator iterB = b->get_selected();
-
-	if(iterA1 && iterA2 && iterB)
-	{
-		Gtk::TreeModel::Row a1Row = *iterA1;
-		Gtk::TreeModel::Row a2Row = *iterA2;
-		Gtk::TreeModel::Row bRow = *iterB;
-		size_t a1Index = a1Row[_antennaModelColumns.antennaIndex];
-		size_t a2Index = a2Row[_antennaModelColumns.antennaIndex];
-		size_t bIndex = bRow[_bandModelColumns.bandIndex];
-		_msWindow.SetImageSetIndex(_imageSet->Index(a1Index, a2Index, bIndex));
-		hide();
-	}
-}
-
diff --git a/CEP/DP3/AOFlagger/src/gui/highlightwindow.cpp b/CEP/DP3/AOFlagger/src/gui/highlightwindow.cpp
deleted file mode 100644
index bf5f3d5e976dc7572cd47ff27905c9900c95b06a..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/gui/highlightwindow.cpp
+++ /dev/null
@@ -1,97 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <AOFlagger/gui/highlightwindow.h>
-
-#include <AOFlagger/strategy/algorithms/thresholdconfig.h>
-
-#include <AOFlagger/gui/mswindow.h>
-
-#include <iostream>
-
-HighlightWindow::HighlightWindow(MSWindow &msWindow) :
-	_msWindow(msWindow),
-	_highlightThresholdHighScale(0.0, 1.0, 0.001),
-	_highlightThresholdLowScale(-0.005, 0.005, 0.00001),
-	_connectedCountScale(1.0, 64.0, 1.0),
-	_highlightButton("Highlighting")
-{
-	_highlightThresholdHighScale.set_inverted(true);
-	_highlightThresholdHighScale.set_value(1.0);
-	_highlightThresholdHighScale.set_size_request(-1, 200);
-	_highlightThresholdHighScale.signal_value_changed().
-		connect(sigc::mem_fun(*this, &HighlightWindow::onValueChange));
-	_highlightThresholdBox.pack_start(_highlightThresholdHighScale);
-	_highlightThresholdHighScale.show();
-
-	_highlightThresholdLowScale.set_inverted(true);
-	_highlightThresholdLowScale.set_value(0.0);
-	_highlightThresholdLowScale.set_size_request(-1, 200);
-	_highlightThresholdLowScale.signal_value_changed().
-		connect(sigc::mem_fun(*this, &HighlightWindow::onValueChange));
-	_highlightThresholdBox.pack_start(_highlightThresholdLowScale);
-	_highlightThresholdLowScale.show();
-
-	_mainBox.pack_start(_highlightThresholdBox);
-	_highlightThresholdBox.show();
-
-	_connectedCountScale.set_value(1.0);
-	_connectedCountScale.signal_value_changed().
-		connect(sigc::mem_fun(*this, &HighlightWindow::onValueChange));
-	_mainBox.pack_start(_connectedCountScale);
-	_connectedCountScale.show();
-
-	_highlightButton.set_active(false);
-	_highlightButton.signal_clicked().
-		connect(sigc::mem_fun(*this, &HighlightWindow::onHighlightingToggled));
-	_mainBox.pack_start(_highlightButton, false, true);
-	_highlightButton.show();
-
-	_max = _msWindow.GetActiveData().GetSingleImage()->GetMaximum();
-
-	add(_mainBox);
-	_mainBox.show();
-}
-
-
-HighlightWindow::~HighlightWindow()
-{
-}
-
-void HighlightWindow::onValueChange()
-{
-	// make val between [0,10]
-	long double val =
-		(_highlightThresholdHighScale.get_value() + _highlightThresholdLowScale.get_value()) *12.0L;
-	// make it exponential and between [0,1]
-	val = powl(2.0L, val) / (4096.0L);
-
-	_msWindow.HighlightConfig().InitializeThresholdsFromFirstThreshold(val*_max, ThresholdConfig::Gaussian);
-	_msWindow.HighlightConfig().SetMinimumConnectedSamples((size_t) round(_connectedCountScale.get_value()));
-	if(_highlightButton.get_active())
-		_msWindow.Update();
-	else
-		_highlightButton.set_active(true);
-}
-
-void HighlightWindow::onHighlightingToggled()
-{
-	_msWindow.SetHighlighting(_highlightButton.get_active());
-	_msWindow.Update();
-}
diff --git a/CEP/DP3/AOFlagger/src/gui/imagecomparisonwidget.cpp b/CEP/DP3/AOFlagger/src/gui/imagecomparisonwidget.cpp
deleted file mode 100644
index 96a4c65bcca82bd05eb3d964adb8918bb00b05ce..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/gui/imagecomparisonwidget.cpp
+++ /dev/null
@@ -1,64 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <AOFlagger/gui/imagecomparisonwidget.h>
-
-#include <AOFlagger/strategy/algorithms/thresholdconfig.h>
-#include <AOFlagger/strategy/algorithms/thresholdtools.h>
-
-ImageComparisonWidget::ImageComparisonWidget() :
-	_visualizedImage(TFOriginalImage)
-{
-}
-
-ImageComparisonWidget::~ImageComparisonWidget()
-{
-}
-
-void ImageComparisonWidget::SetNewData(const TimeFrequencyData &data, TimeFrequencyMetaDataCPtr metaData)
-{
-	Clear();
-	
-	_original = data;
-	_revised = _original;
-	_revised.SetImagesToZero();
-	_contaminated = _original;
-	updateVisualizedImage();
-	
-	SetOriginalMask(data.GetSingleMask());
-	SetMetaData(metaData);
-	ResetDomains();
-}
-
-void ImageComparisonWidget::updateVisualizedImage()
-{
-  Image2DCPtr image;
-  switch(_visualizedImage)
-    {
-    case TFOriginalImage: image = _original.GetSingleImage(); break;
-    case TFRevisedImage: image = _revised.GetSingleImage(); break;
-    case TFContaminatedImage: image = _contaminated.GetSingleImage(); break;
-    }
-  ImageWidget::SetImage(image);
-} 
-
-void ImageComparisonWidget::ClearBackground()
-{
-	_revised.SetImagesToZero();
-}
diff --git a/CEP/DP3/AOFlagger/src/gui/imageplanewindow.cpp b/CEP/DP3/AOFlagger/src/gui/imageplanewindow.cpp
deleted file mode 100644
index fb3c1c85bbf8ed3d1ba5975570d0b9e4cccb6325..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/gui/imageplanewindow.cpp
+++ /dev/null
@@ -1,483 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <AOFlagger/gui/imageplanewindow.h>
-
-#include <gtkmm/filechooserdialog.h>
-#include <gtkmm/stock.h>
-
-#include <AOFlagger/msio/fitsfile.h>
-
-#include <AOFlagger/strategy/algorithms/sinusfitter.h>
-
-#include <AOFlagger/util/ffttools.h>
-#include <AOFlagger/util/plot.h>
-#include <AOFlagger/util/ffttools.h>
-#include <AOFlagger/gui/imagepropertieswindow.h>
-
-ImagePlaneWindow::ImagePlaneWindow()
-  : _imager(512, 512), /*3x1024 */ _clearButton("Clear"),
-	_applyWeightsButton("Apply weights"),
-	_refreshCurrentButton("R"),
-	_memoryStoreButton("MS"),
-	_memoryRecallButton("MR"),
-	_memoryMultiplyButton("Mx"),
-	_memorySubtractButton("M-"),
-	_sqrtButton("sqrt"),
-	_plotHorizontalButton("H"), _plotVerticalButton("V"),
-	_angularTransformButton("AT"),
-	_saveFitsButton("F"),
-	_propertiesButton("P"),
-	_uvPlaneButton("UV"), _imagePlaneButton("Image"),
-	_zoomMenuButton("zoom"),
-	_zoomXd4Button(_zoomGroup, "x1/4"), _zoomXd2Button(_zoomGroup, "x1/2"),
-	_zoomX1Button(_zoomGroup, "x1"), _zoomX2Button(_zoomGroup, "x2"), _zoomX4Button(_zoomGroup, "x4"),
-	_zoomX8Button(_zoomGroup, "x8"), _zoomX16Button(_zoomGroup, "x16"),
-	_zoomX32Button(_zoomGroup, "x32"), _zoomX64Button(_zoomGroup, "x64"),
-	_zoomX128Button(_zoomGroup, "x128"),
-	_zoom(1.0L), _displayingUV(true),
-	_propertiesWindow(0)
-{
-	set_default_size(400,400);
-
-	// Add the plane radio buttons
-	Gtk::RadioButtonGroup group;
-	_topBox.pack_start(_uvPlaneButton, false, true);
-	_uvPlaneButton.signal_clicked().connect(sigc::mem_fun(*this, &ImagePlaneWindow::onUVPlaneButtonClicked));
-	_uvPlaneButton.set_group(group);
-	_uvPlaneButton.set_active(true);
-	_uvPlaneButton.set_tooltip_text("Switch to the UV plane");
-
-	_topBox.pack_start(_imagePlaneButton, false, true);
-	_imagePlaneButton.set_group(group);
-	_imagePlaneButton.signal_clicked().connect(sigc::mem_fun(*this, &ImagePlaneWindow::onImagePlaneButtonClicked));
-	_imagePlaneButton.set_tooltip_text("Switch to the image plane");
-
-	// Add the clear button
-	_topBox.pack_start(_clearButton, false, true);
-	_clearButton.signal_clicked().connect(sigc::mem_fun(*this, &ImagePlaneWindow::onClearClicked));
-	_clearButton.set_tooltip_text("Sets the current images to zero (both image and uv plane)");
-
-	_topBox.pack_start(_applyWeightsButton, false, true);
-	_applyWeightsButton.signal_clicked().connect(sigc::mem_fun(*this, &ImagePlaneWindow::onApplyWeightsClicked));
-	_applyWeightsButton.set_tooltip_text("Divides each pixel by the number of times a sample was added to the pixel");
-
-	// Add the zoom buttons
-	_topBox.pack_start(_zoomMenuButton, false, true);
-	_zoomMenuButton.signal_clicked().connect(sigc::mem_fun(*this, &ImagePlaneWindow::onZoomMenuButtonClicked));
-	
-	_zoomMenu.append(_zoomXd4Button);
-	_zoomXd4Button.signal_toggled().connect(sigc::mem_fun(*this, &ImagePlaneWindow::onZoomButtonClicked));
-
-	_zoomMenu.append(_zoomXd2Button);
-	_zoomXd2Button.signal_toggled().connect(sigc::mem_fun(*this, &ImagePlaneWindow::onZoomButtonClicked));
-
-	_zoomMenu.append(_zoomX1Button);
-	_zoomX1Button.set_active(true);
-	_zoomX1Button.signal_toggled().connect(sigc::mem_fun(*this, &ImagePlaneWindow::onZoomButtonClicked));
-
-	_zoomMenu.append(_zoomX2Button);
-	_zoomX2Button.signal_toggled().connect(sigc::mem_fun(*this, &ImagePlaneWindow::onZoomButtonClicked));
-
-	_zoomMenu.append(_zoomX4Button);
-	_zoomX4Button.signal_toggled().connect(sigc::mem_fun(*this, &ImagePlaneWindow::onZoomButtonClicked));
-
-	_zoomMenu.append(_zoomX8Button);
-	_zoomX8Button.signal_toggled().connect(sigc::mem_fun(*this, &ImagePlaneWindow::onZoomButtonClicked));
-
-	_zoomMenu.append(_zoomX16Button);
-	_zoomX16Button.signal_toggled().connect(sigc::mem_fun(*this, &ImagePlaneWindow::onZoomButtonClicked));
-
-	_zoomMenu.append(_zoomX32Button);
-	_zoomX32Button.signal_toggled().connect(sigc::mem_fun(*this, &ImagePlaneWindow::onZoomButtonClicked));
-
-	_zoomMenu.append(_zoomX64Button);
-	_zoomX64Button.signal_toggled().connect(sigc::mem_fun(*this, &ImagePlaneWindow::onZoomButtonClicked));
-
-	_zoomMenu.append(_zoomX128Button);
-	_zoomX128Button.signal_toggled().connect(sigc::mem_fun(*this, &ImagePlaneWindow::onZoomButtonClicked));
-	
-	_zoomMenu.show_all_children();
-
-	_topBox.pack_start(_refreshCurrentButton, false, true);
-	_refreshCurrentButton.signal_clicked().connect(sigc::mem_fun(*this, &ImagePlaneWindow::onRefreshCurrentClicked));
-	_refreshCurrentButton.set_tooltip_text("Refreshes the image so that it matches the current uv plane (any layout changes applied will be lost)");
-
-	_topBox.pack_start(_memoryStoreButton, false, true);
-	_memoryStoreButton.signal_clicked().connect(sigc::mem_fun(*this, &ImagePlaneWindow::onMemoryStoreClicked));
-	_memoryStoreButton.set_tooltip_text("Store current visible image in the image memory");
-
-	_topBox.pack_start(_memoryRecallButton, false, true);
-	_memoryRecallButton.signal_clicked().connect(sigc::mem_fun(*this, &ImagePlaneWindow::onMemoryRecallClicked));
-	_memoryRecallButton.set_tooltip_text("Recall a previously stored image from memory");
-
-	_topBox.pack_start(_memoryMultiplyButton, false, true);
-	_memoryMultiplyButton.signal_clicked().connect(sigc::mem_fun(*this, &ImagePlaneWindow::onMemoryMultiplyClicked));
-	_memoryMultiplyButton.set_tooltip_text("Multiply the current visible image with the image in memory");
-
-	_topBox.pack_start(_memorySubtractButton, false, true);
-	_memorySubtractButton.signal_clicked().connect(sigc::mem_fun(*this, &ImagePlaneWindow::onMemorySubtractClicked));
-	_memorySubtractButton.set_tooltip_text("Subtract current visible image from memory image");
-
-	_topBox.pack_start(_sqrtButton, false, true);
-	_sqrtButton.signal_clicked().connect(sigc::mem_fun(*this, &ImagePlaneWindow::onSqrtClicked));
-	_sqrtButton.set_tooltip_text("Take the square root of all values");
-
-	_topBox.pack_start(_plotHorizontalButton, false, true);
-	_plotHorizontalButton.signal_clicked().connect(sigc::mem_fun(*this, &ImagePlaneWindow::onPlotHorizontally));
-	_plotHorizontalButton.set_tooltip_text("Make plot of amplitudes over x-axis");
-	
-	_topBox.pack_start(_plotVerticalButton, false, true);
-	_plotVerticalButton.signal_clicked().connect(sigc::mem_fun(*this, &ImagePlaneWindow::onPlotVertically));
-	_plotVerticalButton.set_tooltip_text("Make plot of amplitudes over y-axis");
-	
-	_topBox.pack_start(_angularTransformButton, false, true);
-	_angularTransformButton.signal_clicked().connect(sigc::mem_fun(*this, &ImagePlaneWindow::onAngularTransformButton));
-	_angularTransformButton.set_tooltip_text("Perform an angular transform");
-	
-	_topBox.pack_start(_saveFitsButton, false, true);
-	_saveFitsButton.signal_clicked().connect(sigc::mem_fun(*this, &ImagePlaneWindow::onSaveFitsButton));
-	_saveFitsButton.set_tooltip_text("Save the current visible image in a FITS-file");
-	
-	_topBox.pack_start(_propertiesButton, false, true);
-	_propertiesButton.signal_clicked().connect(sigc::mem_fun(*this, &ImagePlaneWindow::onPropertiesButton));
-	_propertiesButton.set_tooltip_text("Imaging properties...");
-	
-	_box.pack_start(_topBox, false, true);
-	
-	_box.pack_start(_imageWidget);
-	_imageWidget.add_events(Gdk::BUTTON_RELEASE_MASK | Gdk::BUTTON_PRESS_MASK);
-	_imageWidget.OnButtonReleasedEvent().connect(sigc::mem_fun(*this, &ImagePlaneWindow::onButtonReleased));
-	_imageWidget.SetRange(ImageWidget::MinMax);
-
-	add(_box);
-	_box.show_all();
-
-	onZoomButtonClicked();
-}
-
-ImagePlaneWindow::~ImagePlaneWindow()
-{
-	if(_propertiesWindow != 0)
-		delete _propertiesWindow;
-}
-
-void ImagePlaneWindow::AddData(const TimeFrequencyData &data, TimeFrequencyMetaDataCPtr metaData)
-{
-	_imager.Image(data, metaData);
-	_lastMetaData = metaData;
-	Update();
-}
-
-void ImagePlaneWindow::AddData(const TimeFrequencyData &data, class SpatialMatrixMetaData *spatialMetaData)
-{
-	_imager.Image(data, spatialMetaData);
-	Update();
-}
-
-void ImagePlaneWindow::onClearClicked()
-{
-	_imager.Empty();
-	Update();
-}
-
-void ImagePlaneWindow::onUVPlaneButtonClicked()
-{
-	if(!_displayingUV)
-	{
-		Update();
-	}
-}
-
-void ImagePlaneWindow::onImagePlaneButtonClicked()
-{
-	if(_displayingUV)
-		Update();
-}
-
-void ImagePlaneWindow::onZoomButtonClicked()
-{
-	double zoom = 1;
-	if(_zoomXd4Button.get_active()) zoom = 0.25;
-	else if(_zoomXd2Button.get_active()) zoom = 0.5;
-	else if(_zoomX2Button.get_active()) zoom = 2;
-	else if(_zoomX4Button.get_active()) zoom = 4;
-	else if(_zoomX8Button.get_active()) zoom = 8;
-	else if(_zoomX16Button.get_active()) zoom = 16;
-	else if(_zoomX32Button.get_active()) zoom = 32;
-	else if(_zoomX64Button.get_active()) zoom = 64;
-	else if(_zoomX128Button.get_active()) zoom = 128;
-	if(_zoom != zoom)
-	{
-		_imager.Empty();
-		_imager.SetUVScaling(0.0001L * (long double) zoom); // TODO
-		Update();
-		_zoom = zoom;
-	}
-}
-
-void ImagePlaneWindow::Update()
-{
-	if(_uvPlaneButton.get_active())
-	{
-		if(_imager.HasUV()) {
-			_imageWidget.SetImage(Image2D::CreateCopyPtr(_imager.RealUVImage()));
-			_imageWidget.Update();
-			_displayingUV = true;
-		}
-	}
-	else
-	{
-		if(!_imager.HasFFT() && _imager.HasUV())
-			_imager.PerformFFT();
-
-		if(_imager.HasFFT()) {
-			_imageWidget.SetImage(Image2D::CreateCopyPtr(_imager.FTReal()));
-			_imageWidget.Update();
-			printStats();
-			_displayingUV = false;
-		}
-	}
-}
-
-void ImagePlaneWindow::onApplyWeightsClicked()
-{
-	_imager.ApplyWeightsToUV();
-	Update();
-}
-
-void ImagePlaneWindow::onRefreshCurrentClicked()
-{
-	Update();
-}
-
-void ImagePlaneWindow::onMemoryStoreClicked()
-{
-	_memory = _imageWidget.Image();
-}
-
-void ImagePlaneWindow::onMemoryRecallClicked()
-{
-	_imageWidget.SetImage(_memory);
-	_imageWidget.Update();
-}
-
-void ImagePlaneWindow::onMemoryMultiplyClicked()
-{
-	if(_memory != 0)
-	{
-		Image2DPtr multiplied = Image2D::CreateCopy(_memory);
-		Image2DCPtr old = _imageWidget.Image();
-		for(size_t y=0;y<multiplied->Height();++y)
-		{
-			for(size_t x=0;x<multiplied->Width();++x)
-			{
-				multiplied->SetValue(x, y, multiplied->Value(x, y) * old->Value(x, y));
-			}
-		}
-		_imageWidget.SetImage(multiplied);
-		_imageWidget.Update();
-		printStats();
-	}
-}
-
-void ImagePlaneWindow::onMemorySubtractClicked()
-{
-	if(_memory != 0)
-	{
-		Image2DPtr subtracted = Image2D::CreateCopy(_memory);
-		Image2DCPtr old = _imageWidget.Image();
-		for(size_t y=0;y<subtracted->Height();++y)
-		{
-			for(size_t x=0;x<subtracted->Width();++x)
-			{
-				subtracted->SetValue(x, y, subtracted->Value(x, y) - old->Value(x, y));
-			}
-		}
-		_imageWidget.SetImage(subtracted);
-		_imageWidget.Update();
-		printStats();
-	}
-}
-
-void ImagePlaneWindow::onSqrtClicked()
-{
-	if(_imageWidget.HasImage())
-	{
-		Image2DPtr sqrtImage = Image2D::CreateCopy(_imageWidget.Image());
-		FFTTools::SignedSqrt(sqrtImage);
-		_imageWidget.SetImage(sqrtImage);
-		_imageWidget.Update();
-		printStats();
-	}
-}
-
-void ImagePlaneWindow::onPlotHorizontally()
-{
-	if(_imageWidget.HasImage())
-	{
-		Plot plot("Image-horizontal-axis.pdf");
-		plot.SetXAxisText("RA index");
-		plot.SetYAxisText("Amplitude");
-		//plot.SetLogScale(false, true);
-		plot.StartLine();
-		Image2DCPtr image = _imageWidget.Image();
-		for(size_t x=0;x<image->Width();++x)
-		{
-			num_t sum = 0.0;
-			for(size_t y=0;y<image->Height();++y)
-			{
-				sum += image->Value(x, y);
-			}
-			plot.PushDataPoint(x, sum);
-		}
-		plot.Close();
-		plot.Show();
-	}
-}
-
-void ImagePlaneWindow::onPlotVertically()
-{
-	if(_imageWidget.HasImage())
-	{
-		Plot plot("Image-vertical-axis.pdf");
-		plot.SetXAxisText("Declination index");
-		plot.SetYAxisText("Amplitude");
-		//plot.SetLogScale(false, true);
-		plot.StartLine();
-		Image2DCPtr image = _imageWidget.Image();
-		for(size_t y=0;y<image->Height();++y)
-		{
-			num_t sum = 0.0;
-			for(size_t x=0;x<image->Width();++x)
-			{
-				sum += image->Value(x, y);
-			}
-			plot.PushDataPoint(y, sum);
-		}
-		plot.Close();
-		plot.Show();
-	}
-}
-
-void ImagePlaneWindow::printStats()
-{
-	if(_imageWidget.HasImage())
-	{
-		num_t topLeftRMS = _imageWidget.Image()->GetRMS(0, 0, _imageWidget.Image()->Width()/3, _imageWidget.Image()->Height()/3);
-		std::cout << "RMS=" << _imageWidget.Image()->GetRMS()
-			<< ", max=" << _imageWidget.Image()->GetMaximum()
-			<< ", min=" << _imageWidget.Image()->GetMinimum()
-			<< ", top left RMS=" << topLeftRMS
-			<< ", SNR=" << _imageWidget.Image()->GetMaximum()/topLeftRMS
-			<< std::endl;
-	}
-}
-
-void ImagePlaneWindow::onButtonReleased(size_t x, size_t y)
-{
-	if(_imageWidget.HasImage() && _lastMetaData != 0)
-	{
-		int 
-			width = _imageWidget.Image()->Width(),
-			height = _imageWidget.Image()->Height();
-			
-		int left = x - 3, right = x + 3, top = y - 3, bottom = y + 3;
-		if(left < 0) left = 0;
-		if(right >= width) right = width - 1;
-		if(top < 0) top = 0;
-		if(bottom >= height) bottom = height - 1;
-		
-		const BandInfo band = _lastMetaData->Band();
-		num_t frequencyHz = band.channels[band.channels.size()/2].frequencyHz;
-		num_t rms = _imageWidget.Image()->GetRMS(left, top, right-left, bottom-top);
-		num_t max = _imageWidget.Image()->GetMaximum(left, top, right-left, bottom-top);
-		num_t xRel = x-width/2.0, yRel = y-height/2.0;
-		const numl_t
-			dist = sqrtnl(xRel*xRel + yRel*yRel),
-			delayRa = _lastMetaData->Field().delayDirectionRA,
-			delayDec = _lastMetaData->Field().delayDirectionDec;
-		std::cout << "Clicked at: " << xRel << "," << yRel << '\n';
-		double
-			distanceRad = _imager.ImageDistanceToDecRaDistance(dist);
-		std::cout << "RMS=" << rms << ", max=" << max
-			<< ", angle=" << (SinusFitter::Phase(xRel, -yRel)*180.0/M_PI) << ", dist=" << dist << "\n"
-			<< "Distance ~ "
-			<< distanceRad << " rad = "
-			<< Angle::ToString(distanceRad) << " = "
-			<< (1.0/_imager.ImageDistanceToFringeSpeedInSamples(dist, frequencyHz, _lastMetaData)) << " samples/fringe.\n";
-		numl_t
-			centerX = cosn(delayRa) * delayDec,
-			centerY = -sinn(delayRa) * delayDec,
-			dx = _imager.ImageDistanceToDecRaDistance(-xRel) + centerX,
-			dy = _imager.ImageDistanceToDecRaDistance(yRel) + centerY,
-			ra = 2.0*M_PInl - SinusFitter::Phase(dx, dy),
-			dec = sqrtnl(dx*dx + dy*dy);
-		std::cout << "Delay = " << RightAscension::ToString(delayRa) << ", " << Declination::ToString(delayDec) << " (@" << dx << "," << dy << ")\n";
-		std::cout << "RA = " << RightAscension::ToString(ra) << ", DEC = " << Declination::ToString(dec) << "\n";
-	}
-}
-
-void ImagePlaneWindow::onAngularTransformButton()
-{
-	Image2DPtr transformedImage = FFTTools::AngularTransform(_imageWidget.Image());
-	_imageWidget.SetImage(transformedImage);
-	_imageWidget.Update();
-}
-
-void ImagePlaneWindow::onPropertiesButton()
-{
-	if(_propertiesWindow == 0)
-	{
-		_propertiesWindow = new ImagePropertiesWindow(_imageWidget, "Display properties for imager window");
-		_propertiesWindow->show();
-	} else {
-		_propertiesWindow->show();
-		_propertiesWindow->raise();
-	}
-}
-
-void ImagePlaneWindow::onSaveFitsButton()
-{
-	Gtk::FileChooserDialog dialog("Select a measurement set");
-	dialog.set_transient_for(*this);
-
-	//Add response buttons the the dialog:
-	dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
-	dialog.add_button("Save", Gtk::RESPONSE_OK);
-
-	Gtk::FileFilter fitsFilter;
-	fitsFilter.set_name("Flexible Image Transport System (*.fits)");
-	fitsFilter.add_pattern("*.fits");
-	fitsFilter.add_mime_type("image/fits");
-	dialog.add_filter(fitsFilter);
-		
-	if(dialog.run() == Gtk::RESPONSE_OK)
-	{
-		const std::string filename = dialog.get_filename();
-		Image2DCPtr image = _imageWidget.Image();
-		image->SaveToFitsFile(filename);
-	}
-}
-
-void ImagePlaneWindow::onZoomMenuButtonClicked()
-{
-	//_zoomMenu.popup(0, gtk_get_current_event_time());
-	_zoomMenu.popup(0, 0);
-}
diff --git a/CEP/DP3/AOFlagger/src/gui/imagepropertieswindow.cpp b/CEP/DP3/AOFlagger/src/gui/imagepropertieswindow.cpp
deleted file mode 100644
index 8d5335019d60a4671d82e974ae2768254322ccb7..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/gui/imagepropertieswindow.cpp
+++ /dev/null
@@ -1,394 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#include <iostream>
-#include <sstream>
-
-#include <gtkmm/stock.h>
-#include <gtkmm/filechooserdialog.h>
-
-#include <AOFlagger/gui/imagepropertieswindow.h>
-#include <AOFlagger/gui/imagewidget.h>
-
-ImagePropertiesWindow::ImagePropertiesWindow(ImageWidget &imageWidget, const std::string &title) :
-	Gtk::Window(),
-	_imageWidget(imageWidget),
-	_applyButton(Gtk::Stock::APPLY),
-	_exportButton("Export"),
-	_closeButton(Gtk::Stock::CLOSE),
-	_saveImage(Gtk::Stock::SAVE, Gtk::ICON_SIZE_BUTTON),
-	
-	_colorMapFrame("Color map"),
-	_grayScaleButton("Grayscale"),
-	_invGrayScaleButton("Inverted grayscale"),
-	_hotColdScaleButton("Hot/cold"),
-	_redBlueScaleButton("Red/blue"),
-	_blackRedScaleButton("Black/red"),
-	_redBlueYellowScaleButton("Red/Yellow/Blue"),
-	
-	_scaleFrame("Scale"),
-	_minMaxScaleButton("From min to max"),
-	_winsorizedScaleButton("Winsorized min and max"),
-	_specifiedScaleButton("Specified:"),
-	_scaleMinLabel("Scale minimum:"),
-	_scaleMaxLabel("Scale maximum:"),
-	_scaleMinEntry(),
-	_scaleMaxEntry(),
-	
-	_optionsFrame("Options"),
-	_normalOptionsButton("Normal scale"),
-	_logScaleButton("Logarithmic scale"),
-	_zeroSymmetricButton("Symmetric around zero"),
-	
-	_hStartScale(0, 1.01, 0.01),
-	_hStopScale(0, 1.01, 0.01),
-	_vStartScale(0, 1.01, 0.01),
-	_vStopScale(0, 1.01, 0.01),
-	
-	_axesFrame("Axes"),
-	_showXYAxes("Show XY axes"),
-	_showColorScale("Show color scale"),
-	_showXAxisDescriptionButton("x-axis desc"),
-	_showYAxisDescriptionButton("y-axis desc"),
-	_showZAxisDescriptionButton("z-axis desc"),
-	_manualXAxisDescription("manual"),
-	_manualYAxisDescription("manual"),
-	_manualZAxisDescription("manual")
-{
-	set_title(title);
-
-	initColorMapButtons();
-	initScaleWidgets();
-	initOptionsWidgets();
-	initZoomWidgets();
-	initAxisWidgets();
-	
-	_applyButton.signal_clicked().connect(sigc::mem_fun(*this, &ImagePropertiesWindow::onApplyClicked));
-	_bottomButtonBox.pack_start(_applyButton);
-
-	_exportButton.signal_clicked().connect(sigc::mem_fun(*this, &ImagePropertiesWindow::onExportClicked));
-	_exportButton.set_image(_saveImage);
-	_bottomButtonBox.pack_start(_exportButton);
-
-	_closeButton.signal_clicked().connect(sigc::mem_fun(*this, &ImagePropertiesWindow::onCloseClicked));
-	_bottomButtonBox.pack_start(_closeButton);
-
-	_topVBox.pack_start(_framesHBox);
-	
-	_topVBox.pack_start(_bottomButtonBox);
-
-	add(_topVBox);
-	_topVBox.show_all();
-}
-
-void ImagePropertiesWindow::initColorMapButtons()
-{
-	Gtk::RadioButton::Group group;
-
-	_grayScaleButton.set_group(group);
-	_colorMapBox.pack_start(_grayScaleButton);
-	
-	_invGrayScaleButton.set_group(group);
-	_colorMapBox.pack_start(_invGrayScaleButton);
-	
-	_hotColdScaleButton.set_group(group);
-	_colorMapBox.pack_start(_hotColdScaleButton);
-	
-	_redBlueScaleButton.set_group(group);
-	_colorMapBox.pack_start(_redBlueScaleButton);
-	
-	_blackRedScaleButton.set_group(group);
-	_colorMapBox.pack_start(_blackRedScaleButton);
-	
-	_redBlueYellowScaleButton.set_group(group);
-	_colorMapBox.pack_start(_redBlueYellowScaleButton);
-	
-	switch(_imageWidget.GetColorMap())
-	{
-		default:
-		case ImageWidget::BWMap: _grayScaleButton.set_active(true); break;
-		case ImageWidget::InvertedMap: _invGrayScaleButton.set_active(true); break;
-		case ImageWidget::HotColdMap: _hotColdScaleButton.set_active(true); break;
-		case ImageWidget::RedBlueMap: _redBlueScaleButton.set_active(true); break;
-		case ImageWidget::BlackRedMap: _blackRedScaleButton.set_active(true); break;
-		case ImageWidget::RedYellowBlueMap: _redBlueYellowScaleButton.set_active(true); break;
-	}
-
-	_colorMapFrame.add(_colorMapBox);
-
-	_framesHBox.pack_start(_colorMapFrame);
-}
-
-void ImagePropertiesWindow::initScaleWidgets()
-{
-	_scaleFrame.add(_scaleBox);
-	
-	Gtk::RadioButton::Group group;
-	
-	_scaleBox.pack_start(_minMaxScaleButton);
-	_minMaxScaleButton.set_group(group);
-	_minMaxScaleButton.signal_clicked().connect(sigc::mem_fun(*this, &ImagePropertiesWindow::onScaleChanged));
-
-	_scaleBox.pack_start(_winsorizedScaleButton);
-	_winsorizedScaleButton.set_group(group);
-	_winsorizedScaleButton.signal_clicked().connect(sigc::mem_fun(*this, &ImagePropertiesWindow::onScaleChanged));
-	_scaleBox.pack_start(_specifiedScaleButton);
-	
-	_specifiedScaleButton.set_group(group);
-	_specifiedScaleButton.signal_clicked().connect(sigc::mem_fun(*this, &ImagePropertiesWindow::onScaleChanged));
-	
-	switch(_imageWidget.Range())
-	{
-		default:
-		case ImageWidget::MinMax: _minMaxScaleButton.set_active(true); break;
-		case ImageWidget::Winsorized: _winsorizedScaleButton.set_active(true); break;
-		case ImageWidget::Specified: _specifiedScaleButton.set_active(true); break;
-	}
-	onScaleChanged();
-
-	updateMinMaxEntries();
-
-	_scaleBox.pack_start(_scaleMinLabel);
-	_scaleBox.pack_start(_scaleMinEntry);
-	
-	_scaleBox.pack_start(_scaleMaxLabel);
-	_scaleBox.pack_start(_scaleMaxEntry);
-	
-	_framesHBox.pack_start(_scaleFrame);
-}
-
-void ImagePropertiesWindow::initOptionsWidgets()
-{
-	Gtk::RadioButton::Group group;
-	
-	_optionsBox.pack_start(_normalOptionsButton);
-	_normalOptionsButton.set_group(group);
-
-	_optionsBox.pack_start(_logScaleButton);
-	_logScaleButton.set_group(group);
-
-	_optionsBox.pack_start(_zeroSymmetricButton);
-	_zeroSymmetricButton.set_group(group);
-	
-	switch(_imageWidget.ScaleOption())
-	{
-		default:
-		case ImageWidget::NormalScale: _normalOptionsButton.set_active(true); break;
-		case ImageWidget::LogScale: _logScaleButton.set_active(true); break;
-		case ImageWidget::ZeroSymmetricScale: _zeroSymmetricButton.set_active(true); break;
-	}
-
-	_optionsFrame.add(_optionsBox);
-	
-	_framesHBox.pack_start(_optionsFrame);
-}
-
-void ImagePropertiesWindow::initZoomWidgets()
-{
-	_zoomHBox.pack_start(_vStartScale, false, false, 10);
-	_vStartScale.set_inverted(true);
-
-	_vStopScale.set_inverted(true);
-	_zoomHBox.pack_start(_vStopScale, false, false, 10);
-
-	_zoomVSubBox.pack_start(_hStartScale, false, false, 3);
-
-	_zoomVSubBox.pack_start(_hStopScale, false, false, 3);
-
-	_vStopScale.set_value(1.0);
-	_hStopScale.set_value(1.0);
-	
-	_zoomHBox.pack_start(_zoomVSubBox);
-
-	_zoomFrame.add(_zoomHBox);
-	_topVBox.pack_start(_zoomFrame);
-}
-
-void ImagePropertiesWindow::initAxisWidgets()
-{
-	
-	_showXYAxes.set_active(_imageWidget.ShowXYAxes());
-	_axesGeneralBox.pack_start(_showXYAxes);
-
-	_showColorScale.set_active(_imageWidget.ShowColorScale());
-	_axesGeneralBox.pack_start(_showColorScale);
-	
-	_axesHBox.pack_start(_axesGeneralBox);
-	
-	_showXAxisDescriptionButton.set_active(_imageWidget.ShowXAxisDescription());
-	_xAxisBox.pack_start(_showXAxisDescriptionButton);
-	
-	_manualXAxisDescription.set_active(_imageWidget.ManualXAxisDescription());
-	_xAxisBox.pack_start(_manualXAxisDescription);
-	
-	_xAxisBox.pack_start(_xAxisDescriptionEntry);
-	
-	_axesVisibilityBox.pack_start(_xAxisBox);
-	
-	_showYAxisDescriptionButton.set_active(_imageWidget.ShowYAxisDescription());
-	_yAxisBox.pack_start(_showYAxisDescriptionButton);
-	
-	_manualYAxisDescription.set_active(_imageWidget.ManualYAxisDescription());
-	_yAxisBox.pack_start(_manualYAxisDescription);
-	
-	_yAxisBox.pack_start(_yAxisDescriptionEntry);
-	
-	_axesVisibilityBox.pack_start(_yAxisBox);
-	
-	_showZAxisDescriptionButton.set_active(_imageWidget.ShowZAxisDescription());
-	_zAxisBox.pack_start(_showZAxisDescriptionButton);
-	
-	_manualZAxisDescription.set_active(_imageWidget.ManualZAxisDescription());
-	_zAxisBox.pack_start(_manualZAxisDescription);
-	
-	_zAxisBox.pack_start(_zAxisDescriptionEntry);
-	
-	_axesVisibilityBox.pack_start(_zAxisBox);
-	
-	_axesHBox.pack_start(_axesVisibilityBox);
-	
-	_axesFrame.add(_axesHBox);
-	_topVBox.pack_start(_axesFrame);
-}
-
-void ImagePropertiesWindow::updateMinMaxEntries()
-{
-	std::stringstream minStr;
-	minStr << _imageWidget.Min();
-	_scaleMinEntry.set_text(minStr.str());
-	
-	std::stringstream maxStr;
-	maxStr << _imageWidget.Max();
-	_scaleMaxEntry.set_text(maxStr.str());
-}
-
-void ImagePropertiesWindow::onApplyClicked()
-{
-	if(_grayScaleButton.get_active())
-		_imageWidget.SetColorMap(ImageWidget::BWMap);
-	else if(_invGrayScaleButton.get_active())
-		_imageWidget.SetColorMap(ImageWidget::InvertedMap);
-	else if(_hotColdScaleButton.get_active())
-		_imageWidget.SetColorMap(ImageWidget::HotColdMap);
-	else if(_redBlueScaleButton.get_active())
-		_imageWidget.SetColorMap(ImageWidget::RedBlueMap);
-	else if(_blackRedScaleButton.get_active())
-		_imageWidget.SetColorMap(ImageWidget::BlackRedMap);
-	else if(_redBlueYellowScaleButton.get_active())
-		_imageWidget.SetColorMap(ImageWidget::RedYellowBlueMap);
-	
-	if(_minMaxScaleButton.get_active())
-		_imageWidget.SetRange(ImageWidget::MinMax);
-	else if(_winsorizedScaleButton.get_active())
-		_imageWidget.SetRange(ImageWidget::Winsorized);
-	else if(_specifiedScaleButton.get_active())
-	{
-		_imageWidget.SetRange(ImageWidget::Specified);
-		_imageWidget.SetMin(atof(_scaleMinEntry.get_text().c_str()));
-		_imageWidget.SetMax(atof(_scaleMaxEntry.get_text().c_str()));
-	}
-	
-	if(_normalOptionsButton.get_active())
-		_imageWidget.SetScaleOption(ImageWidget::NormalScale);
-	else if(_logScaleButton.get_active())
-		_imageWidget.SetScaleOption(ImageWidget::LogScale);
-	else if(_zeroSymmetricButton.get_active())
-		_imageWidget.SetScaleOption(ImageWidget::ZeroSymmetricScale);
-	
-	double
-		timeStart = _hStartScale.get_value(),
-		timeEnd = _hStopScale.get_value(),
-		freqStart = _vStartScale.get_value(),
-		freqEnd = _vStopScale.get_value();
-		
-	_imageWidget.SetHorizontalDomain(timeStart, timeEnd);
-	_imageWidget.SetVerticalDomain(freqStart, freqEnd);
-		
-	_imageWidget.SetShowXYAxes(_showXYAxes.get_active());
-	_imageWidget.SetShowXAxisDescription(_showXAxisDescriptionButton.get_active());
-	_imageWidget.SetShowYAxisDescription(_showYAxisDescriptionButton.get_active());
-	_imageWidget.SetShowZAxisDescription(_showZAxisDescriptionButton.get_active());
-	_imageWidget.SetManualXAxisDescription(_manualXAxisDescription.get_active());
-	if(_manualXAxisDescription.get_active())
-		_imageWidget.SetXAxisDescription(_xAxisDescriptionEntry.get_text());
-	_imageWidget.SetManualYAxisDescription(_manualYAxisDescription.get_active());
-	if(_manualYAxisDescription.get_active())
-		_imageWidget.SetYAxisDescription(_yAxisDescriptionEntry.get_text());
-	_imageWidget.SetManualZAxisDescription(_manualZAxisDescription.get_active());
-	if(_manualZAxisDescription.get_active())
-		_imageWidget.SetZAxisDescription(_zAxisDescriptionEntry.get_text());
-	_imageWidget.SetShowColorScale(_showColorScale.get_active());
-	
-	_imageWidget.Update();
-	
-	updateMinMaxEntries();
-}
-
-void ImagePropertiesWindow::onCloseClicked()
-{
-	hide();
-}
-
-void ImagePropertiesWindow::onExportClicked()
-{
-	if(_imageWidget.HasImage())
-	{
-		Gtk::FileChooserDialog dialog("Specify image filename", Gtk::FILE_CHOOSER_ACTION_SAVE);
-		dialog.set_transient_for(*this);
-
-		//Add response buttons the the dialog:
-		dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
-		dialog.add_button("Save", Gtk::RESPONSE_OK);
-
-		Gtk::FileFilter pdfFilter;
-		std::string pdfName = "Portable Document Format (*.pdf)";
-		pdfFilter.set_name(pdfName);
-		pdfFilter.add_pattern("*.pdf");
-		pdfFilter.add_mime_type("application/pdf");
-		dialog.add_filter(pdfFilter);
-
-		Gtk::FileFilter svgFilter;
-		std::string svgName = "Scalable Vector Graphics (*.svg)";
-		svgFilter.set_name(svgName);
-		svgFilter.add_pattern("*.svg");
-		svgFilter.add_mime_type("image/svg+xml");
-		dialog.add_filter(svgFilter);
-
-		Gtk::FileFilter pngFilter;
-		std::string pngName = "Portable Network Graphics (*.png)";
-		pngFilter.set_name(pngName);
-		pngFilter.add_pattern("*.png");
-		pngFilter.add_mime_type("image/png");
-		dialog.add_filter(pngFilter);
-
-		int result = dialog.run();
-
-		if(result == Gtk::RESPONSE_OK)
-		{
-			const Gtk::FileFilter *filter = dialog.get_filter();
-			if(filter->get_name() == pdfName)
-				_imageWidget.SavePdf(dialog.get_filename());
-			else if(filter->get_name() == svgName)
-				_imageWidget.SaveSvg(dialog.get_filename());
-			else
-				_imageWidget.SavePng(dialog.get_filename());
-		}
-	}
-}
diff --git a/CEP/DP3/AOFlagger/src/gui/imagewidget.cpp b/CEP/DP3/AOFlagger/src/gui/imagewidget.cpp
deleted file mode 100644
index fc4970186f689f6d33643b6997e4057413e5fbdf..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/gui/imagewidget.cpp
+++ /dev/null
@@ -1,682 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <AOFlagger/gui/imagewidget.h>
-
-#include <AOFlagger/msio/image2d.h>
-
-#include <AOFlagger/strategy/algorithms/thresholdconfig.h>
-#include <AOFlagger/strategy/algorithms/thresholdtools.h>
-
-#include <iostream>
-
-#include <AOFlagger/gui/plot/horizontalplotscale.h>
-#include <AOFlagger/gui/plot/verticalplotscale.h>
-#include <AOFlagger/gui/plot/colorscale.h>
-
-ImageWidget::ImageWidget() :
-	_isInitialized(false),
-	_initializedWidth(0),
-	_initializedHeight(0),
-	_showOriginalMask(true),
-	_showAlternativeMask(true),
-	_colorMap(BWMap),
-	_image(),
-	_highlighting(false),
-	_startHorizontal(0.0),
-	_endHorizontal(1.0),
-	_startVertical(0.0),
-	_endVertical(1.0),
-	_segmentedImage(),
-	_horiScale(0),
-	_vertScale(0),
-	_colorScale(0),
-	_scaleOption(NormalScale),
-	_showXYAxes(true),
-	_showColorScale(true),
-	_showXAxisDescription(true),
-	_showYAxisDescription(true),
-	_showZAxisDescription(true),
-	_max(1.0), _min(0.0),
-	_range(Winsorized),
-	_cairoFilter(Cairo::FILTER_BEST),
-	_manualXAxisDescription(false),
-	_manualYAxisDescription(false),
-	_manualZAxisDescription(false),
-	_mouseIsIn(false)
-{
-	_highlightConfig = new ThresholdConfig();
-	_highlightConfig->InitializeLengthsSingleSample();
-
-	add_events(Gdk::POINTER_MOTION_MASK | Gdk::BUTTON_RELEASE_MASK |
-		   Gdk::BUTTON_PRESS_MASK | Gdk::LEAVE_NOTIFY_MASK);
-	signal_motion_notify_event().connect(sigc::mem_fun(*this, &ImageWidget::onMotion));
-	signal_leave_notify_event().connect(sigc::mem_fun(*this, &ImageWidget::onLeave));
-	signal_button_release_event().connect(sigc::mem_fun(*this, &ImageWidget::onButtonReleased));
-	signal_expose_event().connect(sigc::mem_fun(*this, &ImageWidget::onExposeEvent) );
-}
-
-ImageWidget::~ImageWidget()
-{
-	Clear();
-	delete _highlightConfig;
-}
-
-void ImageWidget::Clear()
-{
-  if(HasImage())
-	{
-		_originalMask.reset();
-		_alternativeMask.reset();
-		delete _highlightConfig;
-		_highlightConfig = new ThresholdConfig();
-		_highlightConfig->InitializeLengthsSingleSample();
-		_segmentedImage.reset();
-	}
-	if(_horiScale != 0) {
-		delete _horiScale;
-		_horiScale = 0;
-	}
-	if(_vertScale != 0) {
-		delete _vertScale;
-		_vertScale = 0;
-	}
-	if(_colorScale != 0) {
-		delete _colorScale;
-		_colorScale = 0;
-	}
-}
-
-bool ImageWidget::onExposeEvent(GdkEventExpose *)
-{
-	if(get_width() == (int) _initializedWidth && get_height() == (int) _initializedHeight)
-		redrawWithoutChanges(get_window()->create_cairo_context(), get_width(), get_height());
-	else
-		Update();
-	return true;
-}
-
-void ImageWidget::ResetDomains()
-{
-	_startHorizontal = 0.0;
-	_endHorizontal = 1.0;
-	_startVertical = 0.0;
-	_endVertical = 1.0;
-}
-
-void ImageWidget::Update()
-{
-  if(HasImage())
-	{
-		Glib::RefPtr<Gdk::Window> window = get_window();
-		if(window != 0 && get_width() > 0 && get_height() > 0)
-			update(window->create_cairo_context(), get_width(), get_height());
-	}
-}
-
-void ImageWidget::SavePdf(const std::string &filename)
-{
-	unsigned width = get_width(), height = get_height();
-	Cairo::RefPtr<Cairo::PdfSurface> surface = Cairo::PdfSurface::create(filename, width, height);
-	Cairo::RefPtr<Cairo::Context> cairo = Cairo::Context::create(surface);
-	if(HasImage())
-	{
-		AOLogger::Debug << "Saving PDF of " <<get_width() << " x " << get_height() << "\n";
-		update(cairo, width, height);
-	}
-	cairo->show_page();
-	// We finish the surface. This might be required, because some of the subclasses store the cairo context. In that
-	// case, it won't be written.
-	surface->finish();
-}
-
-void ImageWidget::SaveSvg(const std::string &filename)
-{
-	unsigned width = get_width(), height = get_height();
-	Cairo::RefPtr<Cairo::SvgSurface> surface = Cairo::SvgSurface::create(filename, width, height);
-	Cairo::RefPtr<Cairo::Context> cairo = Cairo::Context::create(surface);
-	if(HasImage())
-	{
-		AOLogger::Debug << "Saving SVG of " << get_width() << " x " << get_height() << "\n";
-		update(cairo, width, height);
-	}
-	cairo->show_page();
-	surface->finish();
-}
-
-void ImageWidget::SavePng(const std::string &filename)
-{
-	unsigned width = get_width(), height = get_height();
-	Cairo::RefPtr<Cairo::ImageSurface> surface = Cairo::ImageSurface::create(Cairo::FORMAT_ARGB32, width, height);
-	Cairo::RefPtr<Cairo::Context> cairo = Cairo::Context::create(surface);
-	if(HasImage())
-	{
-		AOLogger::Debug << "Saving PNG of " << get_width() << " x " << get_height() << "\n";
-		update(cairo, width, height);
-	}
-	surface->write_to_png(filename);
-}
-
-void ImageWidget::update(Cairo::RefPtr<Cairo::Context> cairo, unsigned width, unsigned height)
-{
-	Image2DCPtr image = _image;
-	Mask2DCPtr mask = GetActiveMask(), originalMask = _originalMask, alternativeMask = _alternativeMask;
-	
-	unsigned int
-		startX = (unsigned int) round(_startHorizontal * image->Width()),
-		startY = (unsigned int) round(_startVertical * image->Height()),
-		endX = (unsigned int) round(_endHorizontal * image->Width()),
-		endY = (unsigned int) round(_endVertical * image->Height());
-	size_t
-		imageWidth = endX - startX,
-		imageHeight = endY - startY;
-		
-	if(imageWidth > 30000)
-	{
-		int shrinkFactor = (imageWidth + 29999) / 30000;
-		image = image->ShrinkHorizontally(shrinkFactor);
-		mask = mask->ShrinkHorizontally(shrinkFactor);
-		if(originalMask != 0)
-			originalMask = originalMask->ShrinkHorizontally(shrinkFactor);
-		if(alternativeMask != 0)
-			alternativeMask = alternativeMask->ShrinkHorizontally(shrinkFactor);
-		startX /= shrinkFactor;
-		endX /= shrinkFactor;
-		imageWidth = endX - startX;
-	}
-
-	num_t min, max;
-	findMinMax(image, mask, min, max);
-	
-	if(_horiScale != 0)
-		delete _horiScale;
-	if(_vertScale != 0)
-		delete _vertScale;
-	if(_colorScale != 0)
-		delete _colorScale;
-	if(_showXYAxes)
-	{
-		_vertScale = new VerticalPlotScale();
-		_vertScale->SetDrawWithDescription(_showYAxisDescription);
-		_horiScale = new HorizontalPlotScale();
-		_horiScale->SetDrawWithDescription(_showXAxisDescription);
-	} else {
-		_vertScale = 0;
-		_horiScale = 0;
-	}
-	if(_showColorScale)
-	{
-		_colorScale = new ColorScale();
-		_colorScale->SetDrawWithDescription(_showZAxisDescription);
-	} else {
-		_colorScale = 0;
-	}
-	if(_showXYAxes)
-	{
-		if(_metaData != 0 && _metaData->HasBand()) {
-			_vertScale->InitializeNumericTicks(_metaData->Band().channels[startY].frequencyHz / 1e6, _metaData->Band().channels[endY-1].frequencyHz / 1e6);
-			_vertScale->SetUnitsCaption("Frequency (MHz)");
-		} else {
-			_vertScale->InitializeNumericTicks(-0.5 + startY, 0.5 + endY - 1.0);
-		}
-		if(_metaData != 0 && _metaData->HasObservationTimes())
-		{
-			_horiScale->InitializeTimeTicks(_metaData->ObservationTimes()[startX], _metaData->ObservationTimes()[endX-1]);
-			_horiScale->SetUnitsCaption("Time");
-		} else {
-			_horiScale->InitializeNumericTicks(-0.5 + startX, 0.5 + endX - 1.0);
-		}
-		if(_manualXAxisDescription)
-			_horiScale->SetUnitsCaption(_xAxisDescription);
-		if(_manualYAxisDescription)
-			_vertScale->SetUnitsCaption(_yAxisDescription);
-	}
-	if(_metaData != 0) {
-		if(_showColorScale && _metaData->DataDescription()!="")
-		{
-			if(_metaData->DataUnits()!="")
-				_colorScale->SetUnitsCaption(_metaData->DataDescription() + " (" + _metaData->DataUnits() + ")");
-			else
-				_colorScale->SetUnitsCaption(_metaData->DataDescription());
-		}
-	}
-	if(_showColorScale)
-	{
-		if(_scaleOption == LogScale)
-			_colorScale->InitializeLogarithmicTicks(min, max);
-		else
-			_colorScale->InitializeNumericTicks(min, max);
-		if(_manualZAxisDescription)
-			_colorScale->SetUnitsCaption(_zAxisDescription);
-	}
-
-	// The scale dimensions are depending on each other. However, since the height of the horizontal scale is practically
-	// not dependent on other dimensions, we give the horizontal scale temporary width/height, so that we can calculate its
-	// height:
-	if(_showXYAxes)
-	{
-		_horiScale->SetPlotDimensions(width, height, 0.0, 0.0);
-		_bottomBorderSize = _horiScale->GetHeight(cairo);
-		_rightBorderSize = _horiScale->GetRightMargin(cairo);
-	
-		_topBorderSize = 10;
-		_vertScale->SetPlotDimensions(width - _rightBorderSize + 5.0, height - _topBorderSize - _bottomBorderSize, _topBorderSize);
-		_leftBorderSize = _vertScale->GetWidth(cairo);
-	} else {
-		_bottomBorderSize = 0.0;
-		_rightBorderSize = 0.0;
-		_topBorderSize = 0.0;
-		_leftBorderSize = 0.0;
-	}
-	if(_showColorScale)
-	{
-		_colorScale->SetPlotDimensions(width - _rightBorderSize, height - _topBorderSize, _topBorderSize);
-		_rightBorderSize += _colorScale->GetWidth(cairo) + 5.0;
-	}
-	if(_showXYAxes)
-	{
-		_horiScale->SetPlotDimensions(width - _rightBorderSize + 5.0, height -_topBorderSize - _bottomBorderSize, _topBorderSize, 	_vertScale->GetWidth(cairo));
-	}
-
-	class ColorMap *colorMap = createColorMap();
-	
-	const double
-		minLog10 = min>0.0 ? log10(min) : 0.0,
-		maxLog10 = max>0.0 ? log10(max) : 0.0;
-	if(_showColorScale)
-	{
-		for(unsigned x=0;x<256;++x)
-		{
-			num_t colorVal = (2.0 / 256.0) * x - 1.0;
-			num_t imageVal;
-			if(_scaleOption == LogScale)
-				imageVal = exp10((x / 256.0) * (log10(max) - minLog10) + minLog10);
-			else 
-				imageVal = (max-min) * x / 256.0 + min;
-			double
-				r = colorMap->ValueToColorR(colorVal),
-				g = colorMap->ValueToColorG(colorVal),
-				b = colorMap->ValueToColorB(colorVal);
-			_colorScale->SetColorValue(imageVal, r/255.0, g/255.0, b/255.0);
-		}
-	}
-	
-	_imageSurface.clear();
-	_imageSurface =
-		Cairo::ImageSurface::create(Cairo::FORMAT_ARGB32, imageWidth, imageHeight);
-
-	_imageSurface->flush();
-	unsigned char *data = _imageSurface->get_data();
-	size_t rowStride = _imageSurface->get_stride();
-
-	Mask2DPtr highlightMask;
-	if(_highlighting)
-	{
-		highlightMask = Mask2D::CreateSetMaskPtr<false>(image->Width(), image->Height());
-		_highlightConfig->Execute(image, highlightMask, true, 10.0);
-	}
-	const bool
-		originalActive = _showOriginalMask && originalMask != 0,
-		altActive = _showAlternativeMask && alternativeMask != 0;
-	for(unsigned long y=startY;y<endY;++y) {
-		guint8* rowpointer = data + rowStride * (endY - y - 1);
-		for(unsigned long x=startX;x<endX;++x) {
-			int xa = (x-startX) * 4;
-			char r,g,b,a;
-			if(_highlighting && highlightMask->Value(x, y) != 0) {
-				r = 255; g = 0; b = 0; a = 255;
-			} else if(originalActive && originalMask->Value(x, y)) {
-				r = 255; g = 0; b = 255; a = 255;
-			} else if(altActive && alternativeMask->Value(x, y)) {
-				r = 255; g = 255; b = 0; a = 255;
-			} else {
-				num_t val = image->Value(x, y);
-				if(val > max) val = max;
-				else if(val < min) val = min;
-
-				if(_scaleOption == LogScale)
-				{
-					if(image->Value(x, y) <= 0.0)
-						val = -1.0;
-					else
-						val = (log10(image->Value(x, y)) - minLog10) * 2.0 / (maxLog10 - minLog10) - 1.0;
-				}
-				else
-					val = (image->Value(x, y) - min) * 2.0 / (max - min) - 1.0;
-				if(val < -1.0) val = -1.0;
-				else if(val > 1.0) val = 1.0;
-				r = colorMap->ValueToColorR(val);
-				g = colorMap->ValueToColorG(val);
-				b = colorMap->ValueToColorB(val);
-				a = colorMap->ValueToColorA(val);
-			}
-			rowpointer[xa]=b;
-			rowpointer[xa+1]=g;
-			rowpointer[xa+2]=r;
-			rowpointer[xa+3]=a;
-		}
-	}
-	delete colorMap;
-
-	if(_segmentedImage != 0)
-	{
-		for(unsigned long y=startY;y<endY;++y) {
-			guint8* rowpointer = data + rowStride * (y - startY);
-			for(unsigned long x=startX;x<endX;++x) {
-				if(_segmentedImage->Value(x,y) != 0)
-				{
-					int xa = (x-startX) * 4;
-					rowpointer[xa]=IntMap::R(_segmentedImage->Value(x,y));
-					rowpointer[xa+1]=IntMap::G(_segmentedImage->Value(x,y));
-					rowpointer[xa+2]=IntMap::B(_segmentedImage->Value(x,y));
-					rowpointer[xa+3]=IntMap::A(_segmentedImage->Value(x,y));
-				}
-			}
-		}
-	}
-	_imageSurface->mark_dirty();
-
-	while(_imageSurface->get_width() > (int) width || _imageSurface->get_height() > (int) height)
-	{
-		unsigned
-			newWidth = _imageSurface->get_width(),
-			newHeight = _imageSurface->get_height();
-		if(newWidth > width)
-			newWidth = width;
-		if(newHeight > height)
-			newHeight = height;
-		downsampleImageBuffer(newWidth, newHeight);
-	}
-
-	_isInitialized = true;
-	_initializedWidth = width;
-	_initializedHeight = height;
-	redrawWithoutChanges(cairo, width, height);
-} 
-
-ColorMap *ImageWidget::createColorMap()
-{
-	switch(_colorMap) {
-		case BWMap:
-			return new MonochromeMap();
-		case InvertedMap:
-			return new class InvertedMap();
-		case HotColdMap:
-			return new ColdHotMap();
-		case RedBlueMap:
-			return new class RedBlueMap();
-		case RedYellowBlueMap:
-			return new class RedYellowBlueMap();
-		case BlackRedMap:
-			return new class BlackRedMap();
-		default:
-			return 0;
-	}
-}
-
-void ImageWidget::findMinMax(Image2DCPtr image, Mask2DCPtr mask, num_t &min, num_t &max)
-{
-	switch(_range)
-	{
-		case MinMax:
-			max = ThresholdTools::MaxValue(image, mask);
-			min = ThresholdTools::MinValue(image, mask);
-		break;
-		case Winsorized:
-		{
-			num_t mean, stddev, genMax, genMin;
-			ThresholdTools::WinsorizedMeanAndStdDev(image, mask, mean, stddev);
-			genMax = ThresholdTools::MaxValue(image, mask);
-			genMin = ThresholdTools::MinValue(image, mask);
-			max = mean + stddev*3.0;
-			min = mean - stddev*3.0;
-			if(genMin > min) min = genMin;
-			if(genMax < max) max = genMax;
-		}
-		break;
-		case Specified:
-			min = _min;
-			max = _max;
-		break;
-	}
-	if(min == max)
-	{
-		min -= 1.0;
-		max += 1.0;
-	}
-	if(_scaleOption == LogScale && min<=0.0)
-	{
-		if(max <= 0.0)
-		{
-			max = 1.0;
-		}
-		min = max / 10000.0;
-	}
-	if(_scaleOption == ZeroSymmetricScale)
-	{
-		if(fabs(max) > fabs(min))
-		{
-			max = fabs(max);
-			min = -max;
-		} else {
-			min = -fabs(min);
-			max = -min;
-		}
-	}
-	_max = max;
-	_min = min;
-}
-
-void ImageWidget::redrawWithoutChanges(Cairo::RefPtr<Cairo::Context> cairo, unsigned width, unsigned height)
-{
-	if(_isInitialized) {
-		cairo->set_source_rgb(1.0, 1.0, 1.0);
-		cairo->set_line_width(1.0);
-		cairo->rectangle(0, 0, width, height);
-		cairo->fill();
-		
-		int
-			destWidth = width - (int) floor(_leftBorderSize + _rightBorderSize),
-			destHeight = height - (int) floor(_topBorderSize + _bottomBorderSize),
-			sourceWidth = _imageSurface->get_width(),
-			sourceHeight = _imageSurface->get_height();
-		cairo->save();
-		cairo->translate((int) round(_leftBorderSize), (int) round(_topBorderSize));
-		cairo->scale((double) destWidth / (double) sourceWidth, (double) destHeight / (double) sourceHeight);
-		Cairo::RefPtr<Cairo::SurfacePattern> pattern = Cairo::SurfacePattern::create(_imageSurface);
-		pattern->set_filter(_cairoFilter);
-		cairo->set_source(pattern);
-		cairo->rectangle(0, 0, sourceWidth, sourceHeight);
-		cairo->clip();
-		cairo->paint();
-		cairo->restore();
-		cairo->set_source_rgb(0.0, 0.0, 0.0);
-		cairo->rectangle(round(_leftBorderSize), round(_topBorderSize), destWidth, destHeight);
-		cairo->stroke();
-
-		if(_showColorScale)
-			_colorScale->Draw(cairo);
-		if(_showXYAxes)
-		{
-			_vertScale->Draw(cairo);
-			_horiScale->Draw(cairo);
-		}
-	}
-}
-
-void ImageWidget::downsampleImageBuffer(unsigned newWidth, unsigned newHeight)
-{
-	_imageSurface->flush();
-	const unsigned
-		oldWidth = _imageSurface->get_width(),
-		oldHeight = _imageSurface->get_height();
-	
-	Cairo::RefPtr<Cairo::ImageSurface> newImageSurface = Cairo::ImageSurface::create(Cairo::FORMAT_ARGB32, newWidth, newHeight);
-
-	unsigned char* newData = newImageSurface->get_data();
-	size_t rowStrideOfNew = newImageSurface->get_stride();
-
-	unsigned char *oldData = _imageSurface->get_data();
-	size_t rowStrideOfOld = _imageSurface->get_stride();
-
-	for(unsigned int y=0;y<newHeight;++y) {
-		guint8* rowpointerToNew = newData + rowStrideOfNew * y;
-		
-		for(unsigned int x=0;x<newWidth;++x) {
-			unsigned int r=0, g=0, b=0, a=0;
-			
-			const unsigned
-				xOldStart = x * oldWidth / newWidth,
-				xOldEnd = (x+1) * oldWidth / newWidth,
-				yOldStart = y * oldHeight / newHeight,
-				yOldEnd = (y+1) * oldHeight / newHeight;
-			
-			for(unsigned int yOld=yOldStart;yOld<yOldEnd;++yOld)
-			{
-				unsigned char *rowpointerToOld = oldData + rowStrideOfOld * yOld + xOldStart*4;
-				for(unsigned int xOld=xOldStart;xOld<xOldEnd;++xOld)
-				{
-					r += (*rowpointerToOld); ++rowpointerToOld;
-					g += (*rowpointerToOld); ++rowpointerToOld;
-					b += (*rowpointerToOld); ++rowpointerToOld;
-					a += (*rowpointerToOld); ++rowpointerToOld;
-				}
-			}
-			
-			const unsigned count = (xOldEnd - xOldStart) * (yOldEnd - yOldStart);
-			(*rowpointerToNew) = (unsigned char) (r/count);
-			++rowpointerToNew;
-			(*rowpointerToNew) = (unsigned char) (g/count);
-			++rowpointerToNew;
-			(*rowpointerToNew) = (unsigned char) (b/count);
-			++rowpointerToNew;
-			(*rowpointerToNew) = (unsigned char) (a/count);
-			++rowpointerToNew;
-		}
-	}
-
-	_imageSurface = newImageSurface;
-	_imageSurface->mark_dirty();
-}
-
-Mask2DCPtr ImageWidget::GetActiveMask() const
-{
-	if(!HasImage())
-		throw std::runtime_error("GetActiveMask() called without image");
-	const bool
-		originalActive = _showOriginalMask && _originalMask != 0,
-		altActive = _showAlternativeMask && _alternativeMask != 0;
-	if(originalActive)
-	{
-		if(altActive)
-		{
-			Mask2DPtr mask = Mask2D::CreateCopy(_originalMask); 
-			mask->Join(_alternativeMask);
-			return mask;
-		} else
-			return _originalMask;
-	} else {
-		if(altActive)
-			return _alternativeMask;
-		else
-			return Mask2D::CreateSetMaskPtr<false>(_image->Width(), _image->Height());
-	}
-}
-
-TimeFrequencyMetaDataCPtr ImageWidget::GetMetaData()
-{
-	TimeFrequencyMetaDataCPtr metaData = _metaData;
-
-	if(_startVertical != 0 && metaData != 0)
-	{
-		size_t startChannel = round(StartVertical() * _image->Height());
-		TimeFrequencyMetaData *newData = new TimeFrequencyMetaData(*metaData);
-		metaData = TimeFrequencyMetaDataCPtr(newData);
-		BandInfo band = newData->Band();
-		band.channels.erase(band.channels.begin(), band.channels.begin()+startChannel );
-		newData->SetBand(band);
-	}
-	if(_startHorizontal != 0 && metaData != 0)
-	{
-		size_t startTime = round(StartHorizontal() * _image->Width());
-		TimeFrequencyMetaData *newData = new TimeFrequencyMetaData(*metaData);
-		metaData = TimeFrequencyMetaDataCPtr(newData);
-		std::vector<double> obsTimes = newData->ObservationTimes();
-		obsTimes.erase(obsTimes.begin(), obsTimes.begin()+startTime );
-		newData->SetObservationTimes(obsTimes);
-	}
-	
-	return metaData;
-}
-
-bool ImageWidget::toUnits(double mouseX, double mouseY, int &posX, int &posY)
-{
-	const unsigned int
-		startX = (unsigned int) round(_startHorizontal * _image->Width()),
-		startY = (unsigned int) round(_startVertical * _image->Height()),
-		endX = (unsigned int) round(_endHorizontal * _image->Width()),
-		endY = (unsigned int) round(_endVertical * _image->Height());
-	const unsigned
-		width = endX - startX,
-		height = endY - startY;
-	posX = (int) round((mouseX - _leftBorderSize) * width / (get_width() - _rightBorderSize - _leftBorderSize) - 0.5);
-	posY = (int) round((mouseY - _topBorderSize) * height / (get_height() - _bottomBorderSize - _topBorderSize) - 0.5);
-	bool inDomain = posX >= 0 && posY >= 0 && posX < (int) width && posY < (int) height;
-	posX += startX;
-	posY = endY - posY - 1;
-	return inDomain;
-}
-
-bool ImageWidget::onMotion(GdkEventMotion *event)
-{
-	if(HasImage())
-	{
-		int posX, posY;
-		if(toUnits(event->x, event->y, posX, posY))
-		{
-			_mouseIsIn = true;
-			_onMouseMoved(posX, posY);
-		} else if(_mouseIsIn) {
-			_onMouseLeft();
-			_mouseIsIn = false;
-		}
-	}
-	return true;
-}
-
-bool ImageWidget::onLeave(GdkEventCrossing *event)
-{
-	if(_mouseIsIn)
-	{
-		_onMouseLeft();
-		_mouseIsIn = false;
-	}
-	return true;
-}
-
-bool ImageWidget::onButtonReleased(GdkEventButton *event)
-{
-	if(HasImage())
-	{
-		int posX, posY;
-		if(toUnits(event->x, event->y, posX, posY))
-			_onButtonReleased(posX, posY);
-	}
-	return true;
-}
diff --git a/CEP/DP3/AOFlagger/src/gui/msoptionwindow.cpp b/CEP/DP3/AOFlagger/src/gui/msoptionwindow.cpp
deleted file mode 100644
index 642257dfffc175ce9623e8155ac8e155f6ae2c3e..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/gui/msoptionwindow.cpp
+++ /dev/null
@@ -1,210 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#include <iostream>
-
-#include <gtkmm/messagedialog.h>
-#include <gtkmm/stock.h>
-
-#include <AOFlagger/gui/msoptionwindow.h>
-
-#include <AOFlagger/msio/timefrequencyimager.h>
-
-#include <AOFlagger/strategy/imagesets/msimageset.h>
-
-#include <AOFlagger/gui/mswindow.h>
-
-MSOptionWindow::MSOptionWindow(MSWindow &msWindow, const std::string &filename) :
-	Gtk::Window(),
-	_msWindow(msWindow),
-	_filename(filename),
-	_openButton(Gtk::Stock::OPEN),
-	_dataKindFrame("Columns to read"),
-	_polarisationFrame("Polarisation to read"),
-	_partitioningFrame("Partitioning"),
-	_observedDataButton("Observed"), _correctedDataButton("Corrected"), _modelDataButton("Model"), _residualDataButton("Residual"),
-	_otherColumnButton("Other:"),
-	_allDipolePolarisationButton("Dipole (xx,xy,yx,yy separately)"),
-	_autoDipolePolarisationButton("Dipole auto-correlations (xx and yy)"),
-	_stokesIPolarisationButton("Stokes I"),
-	_noPartitioningButton("No partitioning"),
-	_max2500ScansButton("Split when >2.500 scans"),
-	_max10000ScansButton("Split when >10.000 scans"),
-	_max25000ScansButton("Split when >25.000 scans"),
-	_max100000ScansButton("Split when >100.000 scans"),
-	_directReadButton("Direct IO"),
-	_indirectReadButton("Indirect IO"),
-	_memoryReadButton("Memory-mode IO"),
-	_readUVWButton("Read UVW")
-{
-	set_title("Options for opening a measurement set");
-
-	initDataTypeButtons();
-	initPolarisationButtons();
-
-	_openButton.signal_clicked().connect(sigc::mem_fun(*this, &MSOptionWindow::onOpen));
-	_bottomButtonBox.pack_start(_openButton);
-
-	_leftVBox.pack_start(_directReadButton);
-	_leftVBox.pack_start(_indirectReadButton);
-	_leftVBox.pack_start(_memoryReadButton);
-	Gtk::RadioButton::Group group;
-	_directReadButton.set_group(group);
-	_indirectReadButton.set_group(group);
-	_memoryReadButton.set_group(group);
-	_directReadButton.set_active(true);
-
-	_leftVBox.pack_start(_readUVWButton);
-	_readUVWButton.set_active(true);
-
-	_leftVBox.pack_start(_bottomButtonBox);
-
-	_topHBox.pack_start(_leftVBox);
-
-	initPartitioningButtons();
-
-	add(_topHBox);
-	show_all();
-}
-
-MSOptionWindow::~MSOptionWindow()
-{
-}
-
-void MSOptionWindow::initDataTypeButtons()
-{
-	Gtk::RadioButton::Group group = _observedDataButton.get_group();
-	_correctedDataButton.set_group(group);
-	_modelDataButton.set_group(group);
-	_residualDataButton.set_group(group);
-	_otherColumnButton.set_group(group);
-
-	_dataKindBox.pack_start(_observedDataButton);
-	_dataKindBox.pack_start(_correctedDataButton);
-	_dataKindBox.pack_start(_modelDataButton);
-	_dataKindBox.pack_start(_residualDataButton);
-	
-	_otherColumnBox.pack_start(_otherColumnButton);
-	_otherColumnBox.pack_start(_otherColumnEntry);
-	_dataKindBox.pack_start(_otherColumnBox);
-
-	_dataKindFrame.add(_dataKindBox);
-
-	_leftVBox.pack_start(_dataKindFrame);
-}
-
-void MSOptionWindow::initPolarisationButtons()
-{
-	Gtk::RadioButton::Group group = _allDipolePolarisationButton.get_group();
-	_autoDipolePolarisationButton.set_group(group);
-	_stokesIPolarisationButton.set_group(group);
-
-	_polarisationBox.pack_start(_allDipolePolarisationButton);
-	_polarisationBox.pack_start(_autoDipolePolarisationButton);
-	_polarisationBox.pack_start(_stokesIPolarisationButton);
-
-	_polarisationFrame.add(_polarisationBox);
-	_leftVBox.pack_start(_polarisationFrame);
-}
-
-void MSOptionWindow::initPartitioningButtons()
-{
-	Gtk::RadioButton::Group group = _noPartitioningButton.get_group();
-	_max2500ScansButton.set_group(group);
-	_max10000ScansButton.set_group(group);
-	_max25000ScansButton.set_group(group);
-	_max100000ScansButton.set_group(group);
-
-	_partitioningBox.pack_start(_noPartitioningButton);
-	_partitioningBox.pack_start(_max2500ScansButton);
-	_partitioningBox.pack_start(_max10000ScansButton);
-	_partitioningBox.pack_start(_max25000ScansButton);
-	_partitioningBox.pack_start(_max100000ScansButton);
-
-	_partitioningFrame.add(_partitioningBox);
-	_topHBox.pack_start(_partitioningFrame);
-
-	_noPartitioningButton.show();
-	_max2500ScansButton.show();
-	_max10000ScansButton.show();
-	_max25000ScansButton.show();
-	_max100000ScansButton.show();
-	_partitioningBox.show();
-	_partitioningFrame.show();
-}
-
-void MSOptionWindow::onOpen()
-{
-	std::cout << "Opening " << _filename << std::endl;
-	try
-	{
-		BaselineIOMode ioMode = DirectReadMode;
-		if(_indirectReadButton.get_active()) ioMode = IndirectReadMode;
-		else if(_memoryReadButton.get_active()) ioMode = MemoryReadMode;
-		bool readUVW = _readUVWButton.get_active();
-		rfiStrategy::ImageSet *imageSet = rfiStrategy::ImageSet::Create(_filename, ioMode);
-		if(dynamic_cast<rfiStrategy::MSImageSet*>(imageSet) != 0)
-		{
-			rfiStrategy::MSImageSet *msImageSet = static_cast<rfiStrategy::MSImageSet*>(imageSet);
-			msImageSet->SetSubtractModel(false);
-			if(_observedDataButton.get_active())
-				msImageSet->SetDataColumnName("DATA");
-			else if(_correctedDataButton.get_active())
-				msImageSet->SetDataColumnName("CORRECTED_DATA");
-			else if(_modelDataButton.get_active())
-				msImageSet->SetDataColumnName("MODEL_DATA");
-			else if(_residualDataButton.get_active())
-			{
-				msImageSet->SetDataColumnName("DATA");
-				msImageSet->SetSubtractModel(true);
-			}
-			else if(_otherColumnButton.get_active())
-				msImageSet->SetDataColumnName(_otherColumnEntry.get_text());
-	
-			if(_allDipolePolarisationButton.get_active())
-				msImageSet->SetReadAllPolarisations();
-			else if(_autoDipolePolarisationButton.get_active())
-				msImageSet->SetReadDipoleAutoPolarisations();
-			else
-				msImageSet->SetReadStokesI();
-	
-			if(_max2500ScansButton.get_active())
-				msImageSet->SetMaxScanCounts(2500);
-			else if(_max10000ScansButton.get_active())
-				msImageSet->SetMaxScanCounts(10000);
-			else if(_max25000ScansButton.get_active())
-				msImageSet->SetMaxScanCounts(25000);
-			else if(_max100000ScansButton.get_active())
-				msImageSet->SetMaxScanCounts(100000);
-			else
-				msImageSet->SetMaxScanCounts(0);
-			msImageSet->SetReadUVW(readUVW);
-		}
-		imageSet->Initialize();
-	
-		_msWindow.SetImageSet(imageSet);
-	} catch(std::exception &e)
-	{
-		Gtk::MessageDialog dialog(*this, e.what(), false, Gtk::MESSAGE_ERROR);
-		dialog.run();
-	}
-	hide();
-}
-
diff --git a/CEP/DP3/AOFlagger/src/gui/mswindow.cpp b/CEP/DP3/AOFlagger/src/gui/mswindow.cpp
deleted file mode 100644
index 58d0579fd2f595fe41e4317e6f8babf7a97df1e9..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/gui/mswindow.cpp
+++ /dev/null
@@ -1,2104 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <AOFlagger/gui/mswindow.h>
-
-#include <gtkmm/stock.h>
-#include <gtkmm/uimanager.h>
-#include <gtkmm/filechooserdialog.h>
-#include <gtkmm/messagedialog.h>
-#include <gtkmm/inputdialog.h>
-#include <gtkmm/toolbar.h>
-
-#include <AOFlagger/msio/baselinematrixloader.h>
-#include <AOFlagger/msio/measurementset.h>
-#include <AOFlagger/msio/image2d.h>
-#include <AOFlagger/msio/timefrequencydata.h>
-#include <AOFlagger/msio/timefrequencymetadata.h>
-#include <AOFlagger/msio/segmentedimage.h>
-#include <AOFlagger/msio/spatialmatrixmetadata.h>
-
-#include <AOFlagger/strategy/actions/strategyaction.h>
-
-#include <AOFlagger/strategy/control/artifactset.h>
-
-#include <AOFlagger/strategy/imagesets/msimageset.h>
-#include <AOFlagger/strategy/imagesets/noisestatimageset.h>
-#include <AOFlagger/strategy/imagesets/spatialmsimageset.h>
-#include <AOFlagger/strategy/imagesets/spatialtimeimageset.h>
-
-#include <AOFlagger/strategy/algorithms/baselineselector.h>
-#include <AOFlagger/strategy/algorithms/mitigationtester.h>
-#include <AOFlagger/strategy/algorithms/morphology.h>
-#include <AOFlagger/strategy/algorithms/fringetestcreater.h>
-#include <AOFlagger/strategy/algorithms/fringestoppingfitter.h>
-#include <AOFlagger/strategy/algorithms/polarizationstatistics.h>
-#include <AOFlagger/strategy/algorithms/rfistatistics.h>
-#include <AOFlagger/strategy/algorithms/svdmitigater.h>
-#include <AOFlagger/strategy/algorithms/thresholdtools.h>
-#include <AOFlagger/strategy/algorithms/timefrequencystatistics.h>
-#include <AOFlagger/strategy/algorithms/vertevd.h>
-
-#include <AOFlagger/strategy/plots/antennaflagcountplot.h>
-#include <AOFlagger/strategy/plots/frequencyflagcountplot.h>
-#include <AOFlagger/strategy/plots/frequencypowerplot.h>
-#include <AOFlagger/strategy/plots/iterationsplot.h>
-#include <AOFlagger/strategy/plots/rfiplots.h>
-#include <AOFlagger/strategy/plots/timeflagcountplot.h>
-
-#include <AOFlagger/util/compress.h>
-#include <AOFlagger/util/multiplot.h>
-
-#include <AOFlagger/gui/plot/plot2d.h>
-
-#include <AOFlagger/gui/antennamapwindow.h>
-#include <AOFlagger/gui/complexplaneplotwindow.h>
-#include <AOFlagger/gui/editstrategywindow.h>
-#include <AOFlagger/gui/gotowindow.h>
-#include <AOFlagger/gui/highlightwindow.h>
-#include <AOFlagger/gui/histogramwindow.h>
-#include <AOFlagger/gui/imageplanewindow.h>
-#include <AOFlagger/gui/imagepropertieswindow.h>
-#include <AOFlagger/gui/msoptionwindow.h>
-#include <AOFlagger/gui/noisestatoptionwindow.h>
-#include <AOFlagger/gui/numinputdialog.h>
-#include <AOFlagger/gui/progresswindow.h>
-#include <AOFlagger/gui/rawoptionwindow.h>
-#include <AOFlagger/gui/tfstatoptionwindow.h>
-
-#include <AOFlagger/imaging/model.h>
-#include <AOFlagger/imaging/observatorium.h>
-
-#include <AOFlagger/quality/histogramcollection.h>
-
-#include <iostream>
-
-MSWindow::MSWindow() : _imagePlaneWindow(0), _histogramWindow(0), _optionWindow(0), _editStrategyWindow(0), _gotoWindow(0), _progressWindow(0), _highlightWindow(0), _plotComplexPlaneWindow(0), _imagePropertiesWindow(0), _antennaMapWindow(0), _statistics(new RFIStatistics()),  _imageSet(0), _imageSetIndex(0), _gaussianTestSets(true), _spatialMetaData(0), _plotWindow(_plotManager)
-{
-	createToolbar();
-
-	_mainVBox.pack_start(_timeFrequencyWidget);
-	_timeFrequencyWidget.OnMouseMovedEvent().connect(sigc::mem_fun(*this, &MSWindow::onTFWidgetMouseMoved));
-	_timeFrequencyWidget.OnMouseLeaveEvent().connect(sigc::mem_fun(*this, &MSWindow::setSetNameInStatusBar));
-	_timeFrequencyWidget.OnButtonReleasedEvent().connect(sigc::mem_fun(*this, &MSWindow::onTFWidgetButtonReleased));
-	_timeFrequencyWidget.SetShowXAxisDescription(false);
-	_timeFrequencyWidget.SetShowYAxisDescription(false);
-	_timeFrequencyWidget.SetShowZAxisDescription(false);
-	_timeFrequencyWidget.show();
-
-	_mainVBox.pack_end(_statusbar, Gtk::PACK_SHRINK);
-	_statusbar.push("Ready. For suggestions, contact offringa@astro.rug.nl .");
-	_statusbar.show();
-
-	add(_mainVBox);
-	_mainVBox.show();
-
-	set_default_size(800,600);
-
-	_strategy = rfiStrategy::Strategy::CreateDefaultSingleStrategy();
-	_imagePlaneWindow = new ImagePlaneWindow();
-}
-
-MSWindow::~MSWindow()
-{
-	boost::mutex::scoped_lock lock(_ioMutex);
-	while(!_actionGroup->get_actions().empty())
-		_actionGroup->remove(*_actionGroup->get_actions().begin());
-	
-	delete _imagePlaneWindow;
-	if(_histogramWindow != 0)
-		delete _histogramWindow;
-	if(_optionWindow != 0)
-		delete _optionWindow;
-	if(_editStrategyWindow != 0)
-		delete _editStrategyWindow;
-	if(_gotoWindow != 0)
-		delete _gotoWindow;
-	if(_progressWindow != 0)
-		delete _progressWindow;
-	if(_highlightWindow != 0)
-		delete _highlightWindow;
-	if(_imagePropertiesWindow != 0)
-		delete _imagePropertiesWindow;
-	if(_antennaMapWindow != 0)
-		delete _antennaMapWindow;
-	
-	// The rfistrategy needs the lock to clean up
-	lock.unlock();
-	
-	delete _statistics;
-	delete _strategy;
-	if(HasImageSet())
-	{
-		delete _imageSetIndex;
-		delete _imageSet;
-	}
-	if(_spatialMetaData != 0)
-		delete _spatialMetaData;
-}
-
-void MSWindow::onActionDirectoryOpen()
-{
-  Gtk::FileChooserDialog dialog("Select a measurement set",
-          Gtk::FILE_CHOOSER_ACTION_SELECT_FOLDER);
-  dialog.set_transient_for(*this);
-
-  //Add response buttons the the dialog:
-  dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
-  dialog.add_button("Open", Gtk::RESPONSE_OK);
-
-  int result = dialog.run();
-
-  if(result == Gtk::RESPONSE_OK)
-	{
-		OpenPath(dialog.get_filename());
-	}
-}
-
-void MSWindow::onActionDirectoryOpenForSpatial()
-{
-  Gtk::FileChooserDialog dialog("Select a measurement set",
-          Gtk::FILE_CHOOSER_ACTION_SELECT_FOLDER);
-  dialog.set_transient_for(*this);
-
-  //Add response buttons the the dialog:
-  dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
-  dialog.add_button("Open", Gtk::RESPONSE_OK);
-
-  int result = dialog.run();
-
-  if(result == Gtk::RESPONSE_OK)
-	{
-		boost::mutex::scoped_lock lock(_ioMutex);
-		rfiStrategy::SpatialMSImageSet *imageSet = new rfiStrategy::SpatialMSImageSet(dialog.get_filename());
-		imageSet->Initialize();
-		lock.unlock();
-		SetImageSet(imageSet);
-	}
-}
-
-void MSWindow::onActionDirectoryOpenForST()
-{
-  Gtk::FileChooserDialog dialog("Select a measurement set",
-          Gtk::FILE_CHOOSER_ACTION_SELECT_FOLDER);
-  dialog.set_transient_for(*this);
-
-  //Add response buttons the the dialog:
-  dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
-  dialog.add_button("Open", Gtk::RESPONSE_OK);
-
-  int result = dialog.run();
-
-  if(result == Gtk::RESPONSE_OK)
-	{
-		boost::mutex::scoped_lock lock(_ioMutex);
-		rfiStrategy::SpatialTimeImageSet *imageSet = new rfiStrategy::SpatialTimeImageSet(dialog.get_filename());
-		imageSet->Initialize();
-		lock.unlock();
-		SetImageSet(imageSet);
-	}
-}
-
-void MSWindow::onActionFileOpen()
-{
-  Gtk::FileChooserDialog dialog("Select a measurement set");
-  dialog.set_transient_for(*this);
-
-  //Add response buttons the the dialog:
-  dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
-  dialog.add_button("Open", Gtk::RESPONSE_OK);
-
-  int result = dialog.run();
-
-  if(result == Gtk::RESPONSE_OK)
-	{
-		OpenPath(dialog.get_filename());
-	}
-}
-
-void MSWindow::OpenPath(const std::string &path)
-{
-	if(_optionWindow != 0)
-		delete _optionWindow;
-	if(rfiStrategy::ImageSet::IsRCPRawFile(path))
-	{
-		_optionWindow = new RawOptionWindow(*this, path);
-		_optionWindow->present();
-	}
-	else if(rfiStrategy::ImageSet::IsMSFile(path))
-	{
-		_optionWindow = new MSOptionWindow(*this, path);
-		_optionWindow->present();
-	}
-	else if(rfiStrategy::ImageSet::IsTimeFrequencyStatFile(path))
-	{
-		_optionWindow = new TFStatOptionWindow(*this, path);
-		_optionWindow->present();
-	}
-	else if(rfiStrategy::ImageSet::IsNoiseStatFile(path))
-	{
-		_optionWindow = new NoiseStatOptionWindow(*this, path);
-		_optionWindow->present();
-	}
-	else
-	{
-		boost::mutex::scoped_lock lock(_ioMutex);
-		rfiStrategy::ImageSet *imageSet = rfiStrategy::ImageSet::Create(path, DirectReadMode);
-		imageSet->Initialize();
-		lock.unlock();
-		SetImageSet(imageSet);
-	}
-}
-
-void MSWindow::onToggleFlags()
-{
-	_timeFrequencyWidget.SetShowOriginalMask(_originalFlagsButton->get_active());
-	_timeFrequencyWidget.SetShowAlternativeMask(_altFlagsButton->get_active());
-	_timeFrequencyWidget.Update();
-}
-
-void MSWindow::loadCurrentTFData()
-{
-	if(_imageSet != 0) {
-		try {
-			boost::mutex::scoped_lock lock(_ioMutex);
-			_imageSet->AddReadRequest(*_imageSetIndex);
-			_imageSet->PerformReadRequests();
-			rfiStrategy::BaselineData *baseline = _imageSet->GetNextRequested();
-			lock.unlock();
-			
-			_timeFrequencyWidget.SetNewData(baseline->Data(), baseline->MetaData());
-			delete baseline;
-			if(_spatialMetaData != 0)
-			{
-				delete _spatialMetaData;
-				_spatialMetaData = 0;
-			}
-			if(dynamic_cast<rfiStrategy::SpatialMSImageSet*>(_imageSet) != 0)
-			{
-				_spatialMetaData = new SpatialMatrixMetaData(static_cast<rfiStrategy::SpatialMSImageSet*>(_imageSet)->SpatialMetaData(*_imageSetIndex));
-			}
-			_timeFrequencyWidget.Update();
-			// We store these seperate, as they might access the measurement set. This is
-			// not only faster (the names are used in the onMouse.. events) but also less dangerous,
-			// since the set can be simultaneously accessed by another thread. (thus the io mutex should
-			// be locked before calling below statements).
-			_imageSetName = _imageSet->Name();
-			_imageSetIndexDescription = _imageSetIndex->Description();
-			setSetNameInStatusBar();
-		} catch(std::exception &e)
-		{
-			AOLogger::Error << e.what() << '\n';
-			showError(e.what());
-		}
-	}
-}
-
-void MSWindow::setSetNameInStatusBar()
-{
-  if(HasImageSet()) {
-		_statusbar.pop();
-		_statusbar.push(_imageSetName + ": " + _imageSetIndexDescription);
-  }
-}
-		
-void MSWindow::onLoadPrevious()
-{
-	if(_imageSet != 0) {
-		boost::mutex::scoped_lock lock(_ioMutex);
-		_imageSetIndex->Previous();
-		lock.unlock();
-		loadCurrentTFData();
-	}
-}
-
-void MSWindow::onLoadNext()
-{
-	if(_imageSet != 0) {
-		boost::mutex::scoped_lock lock(_ioMutex);
-		_imageSetIndex->Next();
-		lock.unlock();
-		loadCurrentTFData();
-	}
-}
-
-void MSWindow::onLoadLargeStepPrevious()
-{
-	if(_imageSet != 0) {
-		boost::mutex::scoped_lock lock(_ioMutex);
-		_imageSetIndex->LargeStepPrevious();
-		lock.unlock();
-		loadCurrentTFData();
-	}
-}
-
-void MSWindow::onLoadLargeStepNext()
-{
-	if(_imageSet != 0) {
-		boost::mutex::scoped_lock lock(_ioMutex);
-		_imageSetIndex->LargeStepNext();
-		lock.unlock();
-		loadCurrentTFData();
-	}
-}
-
-void MSWindow::onEditStrategyPressed()
-{
-	if(_editStrategyWindow != 0)
-		delete _editStrategyWindow;
-	_editStrategyWindow = new EditStrategyWindow(*this);
-	_editStrategyWindow->show();
-}
-
-void MSWindow::onExecuteStrategyPressed()
-{
-	if(_progressWindow != 0)
-		delete _progressWindow;
-
-	ProgressWindow *window = new ProgressWindow(*this);
-	_progressWindow = window;
-	_progressWindow->show();
-
-	rfiStrategy::ArtifactSet artifacts(&_ioMutex);
-
-	artifacts.SetAntennaFlagCountPlot(new AntennaFlagCountPlot());
-	artifacts.SetFrequencyFlagCountPlot(new FrequencyFlagCountPlot());
-	artifacts.SetFrequencyPowerPlot(new FrequencyPowerPlot());
-	artifacts.SetTimeFlagCountPlot(new TimeFlagCountPlot());
-	artifacts.SetIterationsPlot(new IterationsPlot());
-	
-	artifacts.SetPolarizationStatistics(new PolarizationStatistics());
-	artifacts.SetBaselineSelectionInfo(new rfiStrategy::BaselineSelector());
-	artifacts.SetImager(_imagePlaneWindow->GetImager());
-
-	if(HasImage())
-	{
-		artifacts.SetOriginalData(GetOriginalData());
-		artifacts.SetContaminatedData(GetContaminatedData());
-		TimeFrequencyData *zero = new TimeFrequencyData(GetOriginalData());
-		zero->SetImagesToZero();
-		artifacts.SetRevisedData(*zero);
-		delete zero;
-	}
-	if(_timeFrequencyWidget.GetMetaData() != 0)
-			artifacts.SetMetaData(_timeFrequencyWidget.GetMetaData());
-	if(HasImageSet())
-	{
-		artifacts.SetImageSet(_imageSet);
-		artifacts.SetImageSetIndex(_imageSetIndex);
-	}
-	rfiStrategy::Strategy::DisableOptimizations(*_strategy);
-	_strategy->InitializeAll();
-	try {
-		_strategy->StartPerformThread(artifacts, *window);
-	}  catch(std::exception &e)
-	{
-		showError(e.what());
-	}
-}
-
-void MSWindow::onExecuteStrategyFinished()
-{
-	rfiStrategy::ArtifactSet *artifacts = _strategy->JoinThread();
-	if(artifacts != 0)
-	{
-		bool update = false;
-		if(!artifacts->RevisedData().IsEmpty())
-		{
-			std::cout << "Updating revised data..." << std::endl;
-			_timeFrequencyWidget.SetRevisedData(artifacts->RevisedData());
-			update = true;
-		}
-
-		if(!artifacts->ContaminatedData().IsEmpty())
-		{
-			std::cout << "Updating contaminated data..." << std::endl;
-			_timeFrequencyWidget.SetContaminatedData(artifacts->ContaminatedData());
-			update = true;
-		}
-		
-		if(update)
-			_timeFrequencyWidget.Update();
-		
-		_imagePlaneWindow->Update();
-		
-		if(artifacts->AntennaFlagCountPlot()->HasData())
-			artifacts->AntennaFlagCountPlot()->MakePlot();
-		if(artifacts->FrequencyFlagCountPlot()->HasData())
-			artifacts->FrequencyFlagCountPlot()->MakePlot();
-		if(artifacts->FrequencyPowerPlot()->HasData())
-			artifacts->FrequencyPowerPlot()->MakePlot();
-		if(artifacts->TimeFlagCountPlot()->HasData())
-			artifacts->TimeFlagCountPlot()->MakePlot();
-		if(artifacts->PolarizationStatistics()->HasData())
-			artifacts->PolarizationStatistics()->Report();
-		if(artifacts->IterationsPlot()->HasData())
-			artifacts->IterationsPlot()->MakePlot();
-
-		delete artifacts->AntennaFlagCountPlot();
-		delete artifacts->FrequencyFlagCountPlot();
-		delete artifacts->FrequencyPowerPlot();
-		delete artifacts->TimeFlagCountPlot();
-		delete artifacts->PolarizationStatistics();
-		delete artifacts->BaselineSelectionInfo();
-		delete artifacts->IterationsPlot();
-		delete artifacts;
-	}
-}
-
-void MSWindow::onToggleImage()
-{
-	ImageComparisonWidget::TFImage image = ImageComparisonWidget::TFOriginalImage;
-	if(_backgroundImageButton->get_active())
-		image = ImageComparisonWidget::TFRevisedImage;
-	else if(_diffImageButton->get_active())
-		image = ImageComparisonWidget::TFContaminatedImage;
-	_timeFrequencyWidget.SetVisualizedImage(image);
-	_timeFrequencyWidget.Update();
-}
-
-void MSWindow::SetImageSet(rfiStrategy::ImageSet *newImageSet)
-{
-	if(_imageSet != 0) {
-		delete _imageSet;
-		delete _imageSetIndex;
-	}
-	_imageSet = newImageSet;
-	_imageSetIndex = _imageSet->StartIndex();
-	
-	if(dynamic_cast<rfiStrategy::MSImageSet*>(newImageSet) != 0)
-	{
-		onGoToPressed();
-	} else {
-		loadCurrentTFData();
-	}
-}
-
-void MSWindow::SetImageSetIndex(rfiStrategy::ImageSetIndex *newImageSetIndex)
-{
-	if(HasImageSet())
-	{
-		delete _imageSetIndex;
-		_imageSetIndex = newImageSetIndex;
-		_imageSetIndexDescription = _imageSetIndex->Description();
-		loadCurrentTFData();
-	} else {
-		delete newImageSetIndex;
-	}
-}
-
-void MSWindow::openTestSet(unsigned index)
-{
-	unsigned width = 1024, height = 1024;
-	if(HasImage())
-	{
-		width = _timeFrequencyWidget.Image()->Width();
-		height = _timeFrequencyWidget.Image()->Height();
-	}
-	Mask2DPtr rfi = Mask2D::CreateSetMaskPtr<false>(width, height);
-	Image2DPtr testSetReal(MitigationTester::CreateTestSet(index, rfi, width, height, _gaussianTestSets));
-	Image2DPtr testSetImaginary(MitigationTester::CreateTestSet(2, rfi, width, height, _gaussianTestSets));
-	TimeFrequencyData data(SinglePolarisation, testSetReal, testSetImaginary);
-	data.SetGlobalMask(rfi);
-	
-	_timeFrequencyWidget.SetNewData(data, _timeFrequencyWidget.GetMetaData());
-	_timeFrequencyWidget.Update();
-}
-
-void MSWindow::createToolbar()
-{
-	_actionGroup = Gtk::ActionGroup::create();
-	_actionGroup->add( Gtk::Action::create("MenuFile", "_File") );
-	_actionGroup->add( Gtk::Action::create("MenuGo", "_Go") );
-	_actionGroup->add( Gtk::Action::create("MenuView", "_View") );
-	_actionGroup->add( Gtk::Action::create("MenuPlot", "_Plot") );
-	_actionGroup->add( Gtk::Action::create("MenuSimulate", "_Simulate") );
-	_actionGroup->add( Gtk::Action::create("MenuPlotFlagComparison", "_Compare flags") );
-	_actionGroup->add( Gtk::Action::create("MenuActions", "_Actions") );
-	_actionGroup->add( Gtk::Action::create("MenuData", "_Data") );
-	_actionGroup->add( Gtk::Action::create("OpenFile", Gtk::Stock::OPEN, "Open _file"),
-  sigc::mem_fun(*this, &MSWindow::onActionFileOpen) );
-	_actionGroup->add( Gtk::Action::create("OpenDirectory", Gtk::Stock::OPEN, "Open _directory"),
-  sigc::mem_fun(*this, &MSWindow::onActionDirectoryOpen) );
-	_actionGroup->add( Gtk::Action::create("OpenDirectorySpatial", Gtk::Stock::OPEN, "Open _directory as spatial"),
-  sigc::mem_fun(*this, &MSWindow::onActionDirectoryOpenForSpatial) );
-	_actionGroup->add( Gtk::Action::create("OpenDirectoryST", Gtk::Stock::OPEN, "Open _directory as spatial/time"),
-  sigc::mem_fun(*this, &MSWindow::onActionDirectoryOpenForST) );
-	_actionGroup->add( Gtk::Action::create("OpenTestSet", "Open _testset") );
-
-	Gtk::RadioButtonGroup testSetGroup;
-	_gaussianTestSetsButton = Gtk::RadioAction::create(testSetGroup, "GaussianTestSets", "Gaussian");
-	_gaussianTestSetsButton->set_active(true);
-	_rayleighTestSetsButton = Gtk::RadioAction::create(testSetGroup, "RayleighTestSets", "Rayleigh");
-	_zeroTestSetsButton = Gtk::RadioAction::create(testSetGroup, "ZeroTestSets", "Zero");
-	_actionGroup->add(_gaussianTestSetsButton, sigc::mem_fun(*this, &MSWindow::onGaussianTestSets) );
-	_actionGroup->add(_rayleighTestSetsButton, sigc::mem_fun(*this, &MSWindow::onRayleighTestSets) );
-	_actionGroup->add(_zeroTestSetsButton, sigc::mem_fun(*this, &MSWindow::onZeroTestSets) );
-	
-	_actionGroup->add( Gtk::Action::create("OpenTestSetA", "Test set A"),
-	sigc::mem_fun(*this, &MSWindow::onOpenTestSetA) );
-	_actionGroup->add( Gtk::Action::create("OpenTestSetB", "Test set B"),
-	sigc::mem_fun(*this, &MSWindow::onOpenTestSetB) );
-	_actionGroup->add( Gtk::Action::create("OpenTestSetC", "Test set C"),
-	sigc::mem_fun(*this, &MSWindow::onOpenTestSetC) );
-	_actionGroup->add( Gtk::Action::create("OpenTestSetD", "Test set D"),
-	sigc::mem_fun(*this, &MSWindow::onOpenTestSetD) );
-	_actionGroup->add( Gtk::Action::create("OpenTestSetE", "Test set E"),
-	sigc::mem_fun(*this, &MSWindow::onOpenTestSetE) );
-	_actionGroup->add( Gtk::Action::create("OpenTestSetF", "Test set F"),
-	sigc::mem_fun(*this, &MSWindow::onOpenTestSetF) );
-	_actionGroup->add( Gtk::Action::create("OpenTestSetG", "Test set G"),
-	sigc::mem_fun(*this, &MSWindow::onOpenTestSetG) );
-	_actionGroup->add( Gtk::Action::create("OpenTestSetH", "Test set H"),
-	sigc::mem_fun(*this, &MSWindow::onOpenTestSetH) );
-	_actionGroup->add( Gtk::Action::create("OpenTestSetNoise", "Noise"),
-	sigc::mem_fun(*this, &MSWindow::onOpenTestSetNoise));
-	_actionGroup->add( Gtk::Action::create("OpenTestSetModel3", "3-stars model"),
-	sigc::mem_fun(*this, &MSWindow::onOpenTestSet3Model));
-	_actionGroup->add( Gtk::Action::create("OpenTestSetModel5", "5-stars model"),
-	sigc::mem_fun(*this, &MSWindow::onOpenTestSet5Model));
-	_actionGroup->add( Gtk::Action::create("OpenTestSetNoiseModel3", "3-stars model with noise"),
-	sigc::mem_fun(*this, &MSWindow::onOpenTestSetNoise3Model));
-	_actionGroup->add( Gtk::Action::create("OpenTestSetNoiseModel5", "5-stars model with noise"),
-	sigc::mem_fun(*this, &MSWindow::onOpenTestSetNoise5Model));
-	_actionGroup->add( Gtk::Action::create("OpenTestSetBStrong", "Test set B (strong RFI)"),
-	sigc::mem_fun(*this, &MSWindow::onOpenTestSetBStrong));
-	_actionGroup->add( Gtk::Action::create("OpenTestSetBWeak", "Test set B (weak RFI)"),
-	sigc::mem_fun(*this, &MSWindow::onOpenTestSetBWeak));
-	_actionGroup->add( Gtk::Action::create("OpenTestSetBAligned", "Test set B (aligned)"),
-	sigc::mem_fun(*this, &MSWindow::onOpenTestSetBAligned));
-	_actionGroup->add( Gtk::Action::create("OpenTestSetGaussianBroadband", "Gaussian broadband"),
-	sigc::mem_fun(*this, &MSWindow::onOpenTestSetGaussianBroadband));
-	_actionGroup->add( Gtk::Action::create("OpenTestSetSinusoidalBroadband", "Sinusoidal broadband"),
-	sigc::mem_fun(*this, &MSWindow::onOpenTestSetSinusoidalBroadband));
-	_actionGroup->add( Gtk::Action::create("OpenTestSetSlewedGaussianBroadband", "Slewed Gaussian"),
-	sigc::mem_fun(*this, &MSWindow::onOpenTestSetSlewedGaussianBroadband));
-	_actionGroup->add( Gtk::Action::create("OpenTestSetBurstBroadband", "Burst"),
-	sigc::mem_fun(*this, &MSWindow::onOpenTestSetBurstBroadband));
-	_actionGroup->add( Gtk::Action::create("OpenTestSetRFIDistributionLow", "Slope -2 dist low"),
-	sigc::mem_fun(*this, &MSWindow::onOpenTestSetRFIDistributionLow));
-	_actionGroup->add( Gtk::Action::create("OpenTestSetRFIDistributionMid", "Slope -2 dist mid"),
-	sigc::mem_fun(*this, &MSWindow::onOpenTestSetRFIDistributionMid));
-	_actionGroup->add( Gtk::Action::create("OpenTestSetRFIDistributionHigh", "Slope -2 dist high"),
-	sigc::mem_fun(*this, &MSWindow::onOpenTestSetRFIDistributionHigh));
-	_actionGroup->add( Gtk::Action::create("AddTestModification", "Test modify") );
-	_actionGroup->add( Gtk::Action::create("AddStaticFringe", "Static fringe"),
-	sigc::mem_fun(*this, &MSWindow::onAddStaticFringe) );
-	_actionGroup->add( Gtk::Action::create("Add1SigmaStaticFringe", "Static 1 sigma fringe"),
-	sigc::mem_fun(*this, &MSWindow::onAdd1SigmaFringe) );
-	_actionGroup->add( Gtk::Action::create("SetToOne", "Set to 1"),
-	sigc::mem_fun(*this, &MSWindow::onSetToOne) );
-	_actionGroup->add( Gtk::Action::create("SetToI", "Set to i"),
-	sigc::mem_fun(*this, &MSWindow::onSetToI) );
-	_actionGroup->add( Gtk::Action::create("SetToOnePlusI", "Set to 1+i"),
-	sigc::mem_fun(*this, &MSWindow::onSetToOnePlusI) );
-	_actionGroup->add( Gtk::Action::create("MultiplyData", "Multiply data..."),
-	sigc::mem_fun(*this, &MSWindow::onMultiplyData) );
-	_actionGroup->add( Gtk::Action::create("Compress", "Compress"),
-	sigc::mem_fun(*this, &MSWindow::onCompress) );
-	_actionGroup->add( Gtk::Action::create("Quit", Gtk::Stock::QUIT),
-	sigc::mem_fun(*this, &MSWindow::onQuit) );
-
-	_actionGroup->add( Gtk::Action::create("ImageProperties", "Plot properties..."),
-  	sigc::mem_fun(*this, &MSWindow::onImagePropertiesPressed) );
-	_timeGraphButton = Gtk::ToggleAction::create("TimeGraph", "Time graph");
-	_timeGraphButton->set_active(false); 
-	_actionGroup->add(_timeGraphButton, sigc::mem_fun(*this, &MSWindow::onTimeGraphButtonPressed) );
-	_actionGroup->add( Gtk::Action::create("ShowAntennaMapWindow", "Show antenna map"), sigc::mem_fun(*this, &MSWindow::onShowAntennaMapWindow) );
-	
-	_actionGroup->add( Gtk::Action::create("PlotDist", "Plot _distribution"),
-  sigc::mem_fun(*this, &MSWindow::onPlotDistPressed) );
-	_actionGroup->add( Gtk::Action::create("PlotLogLogDist", "Plot _log-log dist"),
-  sigc::mem_fun(*this, &MSWindow::onPlotLogLogDistPressed) );
-	_actionGroup->add( Gtk::Action::create("PlotComplexPlane", "Plot _complex plane"),
-  sigc::mem_fun(*this, &MSWindow::onPlotComplexPlanePressed) );
-	_actionGroup->add( Gtk::Action::create("PlotMeanSpectrum", "Plot _mean spectrum"),
-  sigc::mem_fun(*this, &MSWindow::onPlotMeanSpectrumPressed) );
-	_actionGroup->add( Gtk::Action::create("PlotSumSpectrum", "Plot s_um spectrum"),
-  sigc::mem_fun(*this, &MSWindow::onPlotSumSpectrumPressed) );
-	_actionGroup->add( Gtk::Action::create("PlotPowerSpectrum", "Plot _power spectrum"),
-  sigc::mem_fun(*this, &MSWindow::onPlotPowerSpectrumPressed) );
-	_actionGroup->add( Gtk::Action::create("PlotPowerSpectrumComparison", "Power _spectrum"),
-  sigc::mem_fun(*this, &MSWindow::onPlotPowerSpectrumComparisonPressed) );
-	_actionGroup->add( Gtk::Action::create("PlotRMSSpectrum", "Plot _rms spectrum"),
-  sigc::mem_fun(*this, &MSWindow::onPlotPowerRMSPressed) );
-	_actionGroup->add( Gtk::Action::create("PlotSNRSpectrum", "Plot spectrum snr"),
-  sigc::mem_fun(*this, &MSWindow::onPlotPowerSNRPressed) );
-	_actionGroup->add( Gtk::Action::create("PlotPowerTime", "Plot power vs _time"),
-  sigc::mem_fun(*this, &MSWindow::onPlotPowerTimePressed) );
-	_actionGroup->add( Gtk::Action::create("PlotPowerTimeComparison", "Po_wer vs time"),
-  sigc::mem_fun(*this, &MSWindow::onPlotPowerTimeComparisonPressed) );
-	_actionGroup->add( Gtk::Action::create("PlotTimeScatter", "Plot time s_catter"),
-  sigc::mem_fun(*this, &MSWindow::onPlotTimeScatterPressed) );
-	_actionGroup->add( Gtk::Action::create("PlotTimeScatterComparison", "Time _scatter"),
-  sigc::mem_fun(*this, &MSWindow::onPlotTimeScatterComparisonPressed) );
-	_actionGroup->add( Gtk::Action::create("PlotSingularValues", "Plot _singular values"),
-  sigc::mem_fun(*this, &MSWindow::onPlotSingularValuesPressed) );
-	_actionGroup->add( Gtk::Action::create("PlotSNRToFitVariance", "Plot SNR to fit variance"),
-  sigc::mem_fun(*this, &MSWindow::onPlotSNRToFitVariance) );
-	_actionGroup->add( Gtk::Action::create("PlotQuality25", "Plot quality (25)"),
-  sigc::mem_fun(*this, &MSWindow::onPlotQuality25Pressed) );
-	_actionGroup->add( Gtk::Action::create("PlotQualityAll", "Plot quality (all)"),
-  sigc::mem_fun(*this, &MSWindow::onPlotQualityAllPressed) );
-	_actionGroup->add( Gtk::Action::create("ShowImagePlane", "_Show image plane"),
-  sigc::mem_fun(*this, &MSWindow::onShowImagePlane) );
-	_actionGroup->add( Gtk::Action::create("SetAndShowImagePlane", "S_et and show image plane"),
-  sigc::mem_fun(*this, &MSWindow::onSetAndShowImagePlane) );
-	_actionGroup->add( Gtk::Action::create("AddToImagePlane", "Add to _image plane"),
-  sigc::mem_fun(*this, &MSWindow::onAddToImagePlane) );
-	
-	Gtk::RadioButtonGroup setGroup;
-	_ncpSetButton = Gtk::RadioAction::create(setGroup, "NCPSet", "Use NCP set");
-	_b1834SetButton = Gtk::RadioAction::create(setGroup, "B1834Set", "Use B1834 set");
-	_emptySetButton = Gtk::RadioAction::create(setGroup, "EmptySet", "Use empty set");
-	_ncpSetButton->set_active(true); 
-	_actionGroup->add(_ncpSetButton);
-	_actionGroup->add(_b1834SetButton);
-	_actionGroup->add(_emptySetButton);
-	
-	Gtk::RadioButtonGroup chGroup;
-	_sim16ChannelsButton = Gtk::RadioAction::create(chGroup, "Sim16Channels", "16 channels");
-	_sim64ChannelsButton = Gtk::RadioAction::create(chGroup, "Sim64Channels", "64 channels");
-	_sim256ChannelsButton = Gtk::RadioAction::create(chGroup, "Sim256Channels", "256 channels");
-	_sim64ChannelsButton->set_active(true); 
-	_actionGroup->add(_sim16ChannelsButton);
-	_actionGroup->add(_sim64ChannelsButton);
-	_actionGroup->add(_sim256ChannelsButton);
-	
-	_simFixBandwidthButton = Gtk::ToggleAction::create("SimFixBandwidth", "Fix bandwidth");
-	_simFixBandwidthButton->set_active(false); 
-	_actionGroup->add(_simFixBandwidthButton);
-	
-	_actionGroup->add( Gtk::Action::create("SimulateCorrelation", "Simulate correlation"),
-  sigc::mem_fun(*this, &MSWindow::onSimulateCorrelation) );
-	_actionGroup->add( Gtk::Action::create("SimulateSourceSetA", "Simulate source set A"),
-  sigc::mem_fun(*this, &MSWindow::onSimulateSourceSetA) );
-	_actionGroup->add( Gtk::Action::create("SimulateSourceSetB", "Simulate source set B"),
-  sigc::mem_fun(*this, &MSWindow::onSimulateSourceSetB) );
-	_actionGroup->add( Gtk::Action::create("SimulateSourceSetC", "Simulate source set C"),
-  sigc::mem_fun(*this, &MSWindow::onSimulateSourceSetC) );
-	_actionGroup->add( Gtk::Action::create("SimulateSourceSetD", "Simulate source set D"),
-  sigc::mem_fun(*this, &MSWindow::onSimulateSourceSetD) );
-	_actionGroup->add( Gtk::Action::create("SimulateOffAxisSource", "Simulate off-axis source"),
-  sigc::mem_fun(*this, &MSWindow::onSimulateOffAxisSource) );
-	_actionGroup->add( Gtk::Action::create("SimulateOnAxisSource", "Simulate on-axis source"),
-  sigc::mem_fun(*this, &MSWindow::onSimulateOnAxisSource) );
-
-	_actionGroup->add( Gtk::Action::create("EditStrategy", "_Edit strategy"),
-  sigc::mem_fun(*this, &MSWindow::onEditStrategyPressed) );
-	_actionGroup->add( Gtk::Action::create("ExecuteStrategy", "E_xecute strategy"),
-  sigc::mem_fun(*this, &MSWindow::onExecuteStrategyPressed) );
-	_actionGroup->add( Gtk::Action::create("ShowStats", "Show _stats"),
-  sigc::mem_fun(*this, &MSWindow::onShowStats) );
-	_actionGroup->add( Gtk::Action::create("Previous", Gtk::Stock::GO_BACK),
-  sigc::mem_fun(*this, &MSWindow::onLoadPrevious) );
-	_actionGroup->add( Gtk::Action::create("Next", Gtk::Stock::GO_FORWARD),
-  sigc::mem_fun(*this, &MSWindow::onLoadNext) );
-	_actionGroup->add( Gtk::Action::create("LargeStepPrevious", Gtk::Stock::GOTO_FIRST),
-  sigc::mem_fun(*this, &MSWindow::onLoadLargeStepPrevious) );
-	_actionGroup->add( Gtk::Action::create("LargeStepNext", Gtk::Stock::GOTO_LAST),
-  sigc::mem_fun(*this, &MSWindow::onLoadLargeStepNext) );
-	_actionGroup->add( Gtk::Action::create("GoTo", "_Go to..."),
-  sigc::mem_fun(*this, &MSWindow::onGoToPressed) );
-  _originalFlagsButton = Gtk::ToggleAction::create("OriginalFlags", "Original\nflags");
-	_originalFlagsButton->set_active(true); 
-	_actionGroup->add(_originalFlagsButton, sigc::mem_fun(*this, &MSWindow::onToggleFlags) );
-  _altFlagsButton = Gtk::ToggleAction::create("AlternativeFlags", "Alternative\nflags");
-	_altFlagsButton->set_active(true); 
-	_actionGroup->add(_altFlagsButton, sigc::mem_fun(*this, &MSWindow::onToggleFlags) );
-	_actionGroup->add( Gtk::Action::create("ClearAltFlags", "Clear"),
-  sigc::mem_fun(*this, &MSWindow::onClearAltFlagsPressed) );
-
-	Gtk::RadioButtonGroup imageGroup;
-	_originalImageButton = Gtk::RadioAction::create(imageGroup, "ImageOriginal", "Original");
-	_originalImageButton->set_active(true);
-	_backgroundImageButton = Gtk::RadioAction::create(imageGroup, "ImageBackground", "Background");
-	_diffImageButton = Gtk::RadioAction::create(imageGroup, "ImageDiff", "Difference");
-	_actionGroup->add(_originalImageButton, sigc::mem_fun(*this, &MSWindow::onToggleImage) );
-	_actionGroup->add(_backgroundImageButton, sigc::mem_fun(*this, &MSWindow::onToggleImage) );
-	_actionGroup->add(_diffImageButton, sigc::mem_fun(*this, &MSWindow::onToggleImage) );
-
-	_actionGroup->add( Gtk::Action::create("DiffToOriginal", "Diff->Original"),
-  sigc::mem_fun(*this, &MSWindow::onDifferenceToOriginalPressed) );
-	_actionGroup->add( Gtk::Action::create("BackToOriginal", "Background->Original"),
-  sigc::mem_fun(*this, &MSWindow::onBackgroundToOriginalPressed) );
-
-	_actionGroup->add( Gtk::Action::create("ShowReal", "Keep _real part"),
-  sigc::mem_fun(*this, &MSWindow::onShowRealPressed) );
-	_actionGroup->add( Gtk::Action::create("ShowImaginary", "Keep _imaginary part"),
-  sigc::mem_fun(*this, &MSWindow::onShowImaginaryPressed) );
-	_actionGroup->add( Gtk::Action::create("ShowPhase", "Keep _phase part"),
-  sigc::mem_fun(*this, &MSWindow::onShowPhasePressed) );
-	_actionGroup->add( Gtk::Action::create("ShowStokesI", "Keep _stokesI part"),
-  sigc::mem_fun(*this, &MSWindow::onShowStokesIPressed) );
-	_actionGroup->add( Gtk::Action::create("ShowStokesQ", "Keep stokes_Q part"),
-  sigc::mem_fun(*this, &MSWindow::onShowStokesQPressed) );
-	_actionGroup->add( Gtk::Action::create("ShowStokesU", "Keep stokes_U part"),
-  sigc::mem_fun(*this, &MSWindow::onShowStokesUPressed) );
-	_actionGroup->add( Gtk::Action::create("ShowStokesV", "Keep stokes_V part"),
-  sigc::mem_fun(*this, &MSWindow::onShowStokesVPressed) );
-	_actionGroup->add( Gtk::Action::create("ShowAutoPol", "Keep xx+yy part"),
-  sigc::mem_fun(*this, &MSWindow::onShowAutoDipolePressed) );
-	_actionGroup->add( Gtk::Action::create("ShowCrossPol", "Keep xy+yx part"),
-  sigc::mem_fun(*this, &MSWindow::onShowCrossDipolePressed) );
-	_actionGroup->add( Gtk::Action::create("ShowXX", "Keep _xx part"),
-  sigc::mem_fun(*this, &MSWindow::onShowXXPressed) );
-	_actionGroup->add( Gtk::Action::create("ShowXY", "Keep xy part"),
-  sigc::mem_fun(*this, &MSWindow::onShowXYPressed) );
-	_actionGroup->add( Gtk::Action::create("ShowYX", "Keep yx part"),
-  sigc::mem_fun(*this, &MSWindow::onShowYXPressed) );
-	_actionGroup->add( Gtk::Action::create("ShowYY", "Keep _yy part"),
-  sigc::mem_fun(*this, &MSWindow::onShowYYPressed) );
-	_actionGroup->add( Gtk::Action::create("UnrollPhase", "_Unroll phase"),
-	sigc::mem_fun(*this, &MSWindow::onUnrollPhaseButtonPressed) );
-
-	_actionGroup->add( Gtk::Action::create("Segment", "Segment"),
-  sigc::mem_fun(*this, &MSWindow::onSegment) );
-	_actionGroup->add( Gtk::Action::create("Cluster", "Cluster"),
-  sigc::mem_fun(*this, &MSWindow::onCluster) );
-	_actionGroup->add( Gtk::Action::create("Classify", "Classify"),
-  sigc::mem_fun(*this, &MSWindow::onClassify) );
-	_actionGroup->add( Gtk::Action::create("RemoveSmallSegments", "Remove small segments"),
-  sigc::mem_fun(*this, &MSWindow::onRemoveSmallSegments) );
-	_actionGroup->add( Gtk::Action::create("StoreData", "Store"),
-  sigc::mem_fun(*this, &MSWindow::onStoreData) );
-	_actionGroup->add( Gtk::Action::create("RecallData", "Recall"),
-  sigc::mem_fun(*this, &MSWindow::onRecallData) );
-	_actionGroup->add( Gtk::Action::create("SubtractDataFromMem", "Subtract from mem"),
-  sigc::mem_fun(*this, &MSWindow::onSubtractDataFromMem) );
-
-	_actionGroup->add( Gtk::Action::create("Highlight", "Highlight"),
-  sigc::mem_fun(*this, &MSWindow::onHightlightPressed) );
-	_actionGroup->add( Gtk::Action::create("TimeMergeUnsetValues", "Merge unset values in time"),
-  sigc::mem_fun(*this, &MSWindow::onTimeMergeUnsetValues) );
-	_actionGroup->add( Gtk::Action::create("VertEVD", "Vert EVD"),
-  sigc::mem_fun(*this, &MSWindow::onVertEVD) );
-	_actionGroup->add( Gtk::Action::create("ApplyTimeProfile", "Apply time profile"),
-  sigc::mem_fun(*this, &MSWindow::onApplyTimeProfile) );
-	_actionGroup->add( Gtk::Action::create("ApplyVertProfile", "Apply vert profile"),
-  sigc::mem_fun(*this, &MSWindow::onApplyVertProfile) );
-	_actionGroup->add( Gtk::Action::create("RestoreTimeProfile", "Restore time profile"),
-  sigc::mem_fun(*this, &MSWindow::onRestoreTimeProfile) );
-	_actionGroup->add( Gtk::Action::create("RestoreVertProfile", "Restore vert profile"),
-  sigc::mem_fun(*this, &MSWindow::onRestoreVertProfile) );
-	_actionGroup->add( Gtk::Action::create("ReapplyTimeProfile", "Reapply time profile"),
-  sigc::mem_fun(*this, &MSWindow::onReapplyTimeProfile) );
-	_actionGroup->add( Gtk::Action::create("ReapplyVertProfile", "Reapply vert profile"),
-  sigc::mem_fun(*this, &MSWindow::onReapplyVertProfile) );
-
-	Glib::RefPtr<Gtk::UIManager> uiManager =
-		Gtk::UIManager::create();
-	uiManager->insert_action_group(_actionGroup);
-	add_accel_group(uiManager->get_accel_group());
-
-	Glib::ustring ui_info =
-    "<ui>"
-    "  <menubar name='MenuBar'>"
-    "    <menu action='MenuFile'>"
-    "      <menuitem action='OpenFile'/>"
-    "      <menuitem action='OpenDirectory'/>"
-    "      <menuitem action='OpenDirectorySpatial'/>"
-    "      <menuitem action='OpenDirectoryST'/>"
-    "      <menu action='OpenTestSet'>"
-		"        <menuitem action='GaussianTestSets'/>"
-		"        <menuitem action='RayleighTestSets'/>"
-		"        <menuitem action='ZeroTestSets'/>"
-    "        <separator/>"
-		"        <menuitem action='OpenTestSetA'/>"
-		"        <menuitem action='OpenTestSetB'/>"
-		"        <menuitem action='OpenTestSetC'/>"
-		"        <menuitem action='OpenTestSetD'/>"
-		"        <menuitem action='OpenTestSetE'/>"
-		"        <menuitem action='OpenTestSetF'/>"
-		"        <menuitem action='OpenTestSetG'/>"
-		"        <menuitem action='OpenTestSetH'/>"
-		"        <menuitem action='OpenTestSetNoise'/>"
-		"        <menuitem action='OpenTestSetModel3'/>"
-		"        <menuitem action='OpenTestSetModel5'/>"
-		"        <menuitem action='OpenTestSetNoiseModel3'/>"
-		"        <menuitem action='OpenTestSetNoiseModel5'/>"
-		"        <menuitem action='OpenTestSetBStrong'/>"
-		"        <menuitem action='OpenTestSetBWeak'/>"
-		"        <menuitem action='OpenTestSetBAligned'/>"
-		"        <menuitem action='OpenTestSetGaussianBroadband'/>"
-		"        <menuitem action='OpenTestSetSinusoidalBroadband'/>"
-		"        <menuitem action='OpenTestSetSlewedGaussianBroadband'/>"
-		"        <menuitem action='OpenTestSetBurstBroadband'/>"
-		"        <menuitem action='OpenTestSetRFIDistributionLow'/>"
-		"        <menuitem action='OpenTestSetRFIDistributionMid'/>"
-		"        <menuitem action='OpenTestSetRFIDistributionHigh'/>"
-		"      </menu>"
-		"      <menu action='AddTestModification'>"
-		"        <menuitem action='AddStaticFringe'/>"
-		"        <menuitem action='Add1SigmaStaticFringe'/>"
-		"        <menuitem action='SetToOne'/>"
-		"        <menuitem action='SetToI'/>"
-		"        <menuitem action='SetToOnePlusI'/>"
-		"        <menuitem action='MultiplyData'/>"
-		"      </menu>"
-    "      <menuitem action='Compress'/>"
-    "      <menuitem action='Quit'/>"
-    "    </menu>"
-	  "    <menu action='MenuView'>"
-    "      <menuitem action='ImageProperties'/>"
-    "      <menuitem action='ShowAntennaMapWindow'/>"
-    "      <menuitem action='TimeGraph'/>"
-    "      <separator/>"
-    "      <menuitem action='ShowImagePlane'/>"
-    "      <menuitem action='SetAndShowImagePlane'/>"
-    "      <menuitem action='AddToImagePlane'/>"
-	  "    </menu>"
-	  "    <menu action='MenuPlot'>"
-    "      <menu action='MenuPlotFlagComparison'>"
-    "        <menuitem action='PlotPowerSpectrumComparison'/>"
-    "        <menuitem action='PlotPowerTimeComparison'/>"
-    "        <menuitem action='PlotTimeScatterComparison'/>"
-		"      </menu>"
-    "      <separator/>"
-    "      <menuitem action='PlotDist'/>"
-    "      <menuitem action='PlotLogLogDist'/>"
-    "      <menuitem action='PlotComplexPlane'/>"
-    "      <menuitem action='PlotMeanSpectrum'/>"
-    "      <menuitem action='PlotSumSpectrum'/>"
-    "      <menuitem action='PlotPowerSpectrum'/>"
-    "      <menuitem action='PlotRMSSpectrum'/>"
-    "      <menuitem action='PlotSNRSpectrum'/>"
-    "      <menuitem action='PlotPowerTime'/>"
-    "      <menuitem action='PlotTimeScatter'/>"
-    "      <menuitem action='PlotSingularValues'/>"
-    "      <menuitem action='PlotSNRToFitVariance'/>"
-    "      <menuitem action='PlotQuality25'/>"
-    "      <menuitem action='PlotQualityAll'/>"
-	  "    </menu>"
-    "    <menu action='MenuGo'>"
-    "      <menuitem action='LargeStepPrevious'/>"
-    "      <menuitem action='Previous'/>"
-    "      <menuitem action='Next'/>"
-    "      <menuitem action='LargeStepNext'/>"
-    "      <separator/>"
-    "      <menuitem action='GoTo'/>"
-    "    </menu>"
-	  "    <menu action='MenuSimulate'>"
-    "      <menuitem action='NCPSet'/>"
-    "      <menuitem action='B1834Set'/>"
-    "      <menuitem action='EmptySet'/>"
-    "      <separator/>"
-    "      <menuitem action='Sim16Channels'/>"
-    "      <menuitem action='Sim64Channels'/>"
-    "      <menuitem action='Sim256Channels'/>"
-    "      <menuitem action='SimFixBandwidth'/>"
-    "      <separator/>"
-    "      <menuitem action='SimulateCorrelation'/>"
-    "      <menuitem action='SimulateSourceSetA'/>"
-    "      <menuitem action='SimulateSourceSetB'/>"
-    "      <menuitem action='SimulateSourceSetC'/>"
-    "      <menuitem action='SimulateSourceSetD'/>"
-    "      <menuitem action='SimulateOffAxisSource'/>"
-    "      <menuitem action='SimulateOnAxisSource'/>"
-	  "    </menu>"
-	  "    <menu action='MenuData'>"
-    "      <menuitem action='DiffToOriginal'/>"
-    "      <menuitem action='BackToOriginal'/>"
-    "      <separator/>"
-    "      <menuitem action='ShowReal'/>"
-    "      <menuitem action='ShowImaginary'/>"
-    "      <menuitem action='ShowPhase'/>"
-    "      <separator/>"
-    "      <menuitem action='ShowStokesI'/>"
-    "      <menuitem action='ShowStokesQ'/>"
-    "      <menuitem action='ShowStokesU'/>"
-    "      <menuitem action='ShowStokesV'/>"
-    "      <separator/>"
-    "      <menuitem action='ShowXX'/>"
-    "      <menuitem action='ShowXY'/>"
-    "      <menuitem action='ShowYX'/>"
-    "      <menuitem action='ShowYY'/>"
-    "      <menuitem action='ShowAutoPol'/>"
-    "      <menuitem action='ShowCrossPol'/>"
-    "      <menuitem action='UnrollPhase'/>"
-    "      <separator/>"
-    "      <menuitem action='StoreData'/>"
-    "      <menuitem action='RecallData'/>"
-    "      <menuitem action='SubtractDataFromMem'/>"
-	  "    </menu>"
-	  "    <menu action='MenuActions'>"
-    "      <menuitem action='EditStrategy'/>"
-    "      <menuitem action='ExecuteStrategy'/>"
-    "      <separator/>"
-    "      <menuitem action='Segment'/>"
-    "      <menuitem action='Cluster'/>"
-    "      <menuitem action='Classify'/>"
-    "      <menuitem action='RemoveSmallSegments'/>"
-    "      <separator/>"
-    "      <menuitem action='TimeMergeUnsetValues'/>"
-    "      <menuitem action='VertEVD'/>"
-    "      <menuitem action='ApplyTimeProfile'/>"
-    "      <menuitem action='ApplyVertProfile'/>"
-    "      <menuitem action='RestoreTimeProfile'/>"
-    "      <menuitem action='RestoreVertProfile'/>"
-    "      <menuitem action='ReapplyTimeProfile'/>"
-    "      <menuitem action='ReapplyVertProfile'/>"
-	  "    </menu>"
-    "  </menubar>"
-    "  <toolbar  name='ToolBar'>"
-    "    <toolitem action='OpenDirectory'/>"
-    "    <separator/>"
-    "    <toolitem action='ClearAltFlags'/>"
-    "    <toolitem action='ShowStats'/>"
-    "    <separator/>"
-    "    <toolitem action='Previous'/>"
-    "    <toolitem action='Next'/>"
-    "    <toolitem action='OriginalFlags'/>"
-    "    <toolitem action='AlternativeFlags'/>"
-    "    <toolitem action='Highlight'/>"
-    "    <separator/>"
-    "    <toolitem action='ImageOriginal'/>"
-    "    <toolitem action='ImageBackground'/>"
-    "    <toolitem action='ImageDiff'/>"
-    "  </toolbar>"
-    "</ui>";
-
-	uiManager->add_ui_from_string(ui_info);
-	Gtk::Widget* pMenubar = uiManager->get_widget("/MenuBar");
-	_mainVBox.pack_start(*pMenubar, Gtk::PACK_SHRINK);
-	Gtk::Widget* pToolbar = uiManager->get_widget("/ToolBar");
-	static_cast<Gtk::Toolbar *>(pToolbar)->set_toolbar_style(Gtk::TOOLBAR_BOTH);
-	_mainVBox.pack_start(*pToolbar, Gtk::PACK_SHRINK);
-	pMenubar->show();
-}
-
-void MSWindow::onClearAltFlagsPressed()
-{
-	_timeFrequencyWidget.Update();
-}
-
-void MSWindow::onDifferenceToOriginalPressed()
-{
-	if(HasImage())
-	{
-		TimeFrequencyData data(_timeFrequencyWidget.ContaminatedData());
-		_timeFrequencyWidget.SetNewData(data, _timeFrequencyWidget.GetMetaData());
-	}
-	if(_originalImageButton->get_active())
-		_timeFrequencyWidget.Update();
-	else
-		_originalImageButton->set_active();
-}
-
-void MSWindow::onBackgroundToOriginalPressed()
-{
-	if(HasImage())
-	{
-		TimeFrequencyData data(_timeFrequencyWidget.RevisedData());
-		_timeFrequencyWidget.ClearBackground();
-		_timeFrequencyWidget.SetNewData(data, _timeFrequencyWidget.GetMetaData());
-	}
-	if(_originalImageButton->get_active())
-		_timeFrequencyWidget.Update();
-	else
-		_originalImageButton->set_active();
-}
-
-void MSWindow::onHightlightPressed()
-{
-	if(_highlightWindow != 0)
-		delete _highlightWindow;
-	_highlightWindow = new HighlightWindow(*this);
-	_highlightWindow->show();
-}
-
-void MSWindow::onAddStaticFringe()
-{
-	try {
-		if(HasImage())
-		{
-			TimeFrequencyMetaDataCPtr metaData = TimeFrequencyMetaData();
-			TimeFrequencyData data(GetActiveData());
-			FringeTestCreater::AddStaticFringe(data, metaData, 1.0L);
-			_timeFrequencyWidget.SetNewData(data, metaData);
-			_timeFrequencyWidget.Update();
-		}
-	} catch(std::exception &e)
-	{
-		showError(e.what());
-	}
-}
-
-void MSWindow::onAdd1SigmaFringe()
-{
-	try {
-		if(HasImage())
-		{
-			TimeFrequencyMetaDataCPtr metaData = TimeFrequencyMetaData();
-			num_t mean, stddev;
-			TimeFrequencyData data(GetActiveData());
-			ThresholdTools::MeanAndStdDev(data.GetRealPart(), data.GetSingleMask(), mean, stddev);
-			FringeTestCreater::AddStaticFringe(data, metaData, stddev);
-			_timeFrequencyWidget.SetNewData(data, _timeFrequencyWidget.GetMetaData());
-			_timeFrequencyWidget.Update();
-		}
-	} catch(std::exception &e)
-	{
-		showError(e.what());
-	}
-}
-
-void MSWindow::onSetToOne()
-{
-	try {
-		TimeFrequencyData data(GetActiveData());
-		std::pair<Image2DCPtr, Image2DCPtr> images = data.GetSingleComplexImage();
-		Image2DPtr
-			real = Image2D::CreateCopy(images.first),
-			imaginary = Image2D::CreateCopy(images.first);
-		real->SetAll(1.0);
-		imaginary->SetAll(0.0);
-		TimeFrequencyData newData(data.Polarisation(), real, imaginary);
-		newData.SetMask(data);
-		_timeFrequencyWidget.SetNewData(newData, _timeFrequencyWidget.GetMetaData());
-		_timeFrequencyWidget.Update();
-	} catch(std::exception &e)
-	{
-		showError(e.what());
-	}
-}
-
-void MSWindow::onSetToI()
-{
-	try {
-		TimeFrequencyData data(GetActiveData());
-		std::pair<Image2DCPtr, Image2DCPtr> images = data.GetSingleComplexImage();
-		Image2DPtr
-			real = Image2D::CreateCopy(images.first),
-			imaginary = Image2D::CreateCopy(images.first);
-		real->SetAll(0.0);
-		imaginary->SetAll(1.0);
-		TimeFrequencyData newData(data.Polarisation(), real, imaginary);
-		newData.SetMask(data);
-		_timeFrequencyWidget.SetNewData(newData, _timeFrequencyWidget.GetMetaData());
-		_timeFrequencyWidget.Update();
-	} catch(std::exception &e)
-	{
-		showError(e.what());
-	}
-}
-
-void MSWindow::onSetToOnePlusI()
-{
-	try {
-		TimeFrequencyData data(GetActiveData());
-		std::pair<Image2DCPtr, Image2DCPtr> images = data.GetSingleComplexImage();
-		Image2DPtr
-			real = Image2D::CreateCopy(images.first),
-			imaginary = Image2D::CreateCopy(images.first);
-		real->SetAll(1.0);
-		imaginary->SetAll(1.0);
-		TimeFrequencyData newData(data.Polarisation(), real, imaginary);
-		newData.SetMask(data);
-		_timeFrequencyWidget.SetNewData(newData, _timeFrequencyWidget.GetMetaData());
-		_timeFrequencyWidget.Update();
-	} catch(std::exception &e)
-	{
-		showError(e.what());
-	}
-}
-
-void MSWindow::onShowStats()
-{
-	if(_timeFrequencyWidget.HasImage())
-	{
-		TimeFrequencyData activeData = GetActiveData();
-		TimeFrequencyStatistics statistics(activeData);
-		std::stringstream s;
-		s << "Percentage flagged: " << TimeFrequencyStatistics::FormatRatio(statistics.GetFlaggedRatio()) << "\n";
-			
-		Mask2DCPtr
-			original = _timeFrequencyWidget.OriginalMask(),
-			alternative = _timeFrequencyWidget.AlternativeMask();
-		Mask2DPtr
-			intersect;
-		if(original != 0 && alternative != 0)
-		{
-			intersect = Mask2D::CreateCopy(original);
-			intersect->Intersect(alternative);
-			
-			unsigned intCount = intersect->GetCount<true>();
-			if(intCount != 0)
-			{
-				if(!original->Equals(alternative))
-				{
-					s << "Overlap between original and alternative: " << TimeFrequencyStatistics::FormatRatio((double) intCount / ((double) (original->Width() * original->Height()))) << "\n"
-					<< "(relative to alternative flags: " << TimeFrequencyStatistics::FormatRatio((double) intCount / ((double) (alternative->GetCount<true>()))) << ")\n";
-					
-				}
-			}
-		}
-		
-		Image2DCPtr powerImg = activeData.GetSingleImage();
-		Mask2DCPtr mask = activeData.GetSingleMask();
-		double power = 0.0;
-		for(unsigned y=0;y<powerImg->Height();++y)
-		{
-			for(unsigned x=0;x<powerImg->Width();++x)
-			{
-				if(!mask->Value(x, y) && std::isfinite(powerImg->Value(x, y)))
-				{
-					power += powerImg->Value(x, y);
-				}
-			}
-		}
-		s << "Total unflagged power: " << power << "\n";
-		Gtk::MessageDialog dialog(*this, s.str(), false, Gtk::MESSAGE_INFO);
-		dialog.run();
-	}
-}
-
-void MSWindow::onPlotDistPressed()
-{
-	if(_timeFrequencyWidget.HasImage())
-	{
-		Plot2D &plot = _plotManager.NewPlot2D("Distribution");
-
-		TimeFrequencyData activeData = GetActiveData();
-		Image2DCPtr image = activeData.GetSingleImage();
-		Mask2DPtr mask =
-			Mask2D::CreateSetMaskPtr<false>(image->Width(), image->Height());
-		Plot2DPointSet &totalSet = plot.StartLine("Total");
-		RFIPlots::MakeDistPlot(totalSet, image, mask);
-
-		Plot2DPointSet &uncontaminatedSet = plot.StartLine("Uncontaminated");
-		mask = Mask2D::CreateCopy(activeData.GetSingleMask());
-		RFIPlots::MakeDistPlot(uncontaminatedSet, image, mask);
-
-		mask->Invert();
-		Plot2DPointSet &rfiSet = plot.StartLine("RFI");
-		RFIPlots::MakeDistPlot(rfiSet, image, mask);
-
-		_plotManager.Update();
-	}
-}
-
-void MSWindow::onPlotLogLogDistPressed()
-{
-	if(_timeFrequencyWidget.HasImage())
-	{
-		TimeFrequencyData activeData = GetActiveData();
-		HistogramCollection histograms(activeData.PolarisationCount());
-		for(unsigned p=0;p!=activeData.PolarisationCount();++p)
-		{
-			TimeFrequencyData *polData = activeData.CreateTFDataFromPolarisationIndex(p);
-			Image2DCPtr image = polData->GetSingleImage();
-			Mask2DCPtr mask = Mask2D::CreateCopy(polData->GetSingleMask());
-			histograms.Add(0, 1, p, image, mask);
-		}
-		if(_histogramWindow == 0)
-			_histogramWindow = new HistogramWindow(histograms);
-		else
-			_histogramWindow->SetStatistics(histograms);
-		_histogramWindow->show();
-	}
-}
-
-void MSWindow::onPlotComplexPlanePressed()
-{
-	if(HasImage()) {
-		if(_plotComplexPlaneWindow != 0)
-			delete _plotComplexPlaneWindow;
-		_plotComplexPlaneWindow = new ComplexPlanePlotWindow(*this, _plotManager);
-		_plotComplexPlaneWindow->show();
-	}
-}
-
-template<bool Weight>
-void MSWindow::plotMeanSpectrumPressed()
-{
-	if(_timeFrequencyWidget.HasImage())
-	{
-		Plot2D &plot = _plotManager.NewPlot2D("Mean spectrum");
-
-		TimeFrequencyData data = _timeFrequencyWidget.GetActiveData();
-		Mask2DCPtr mask =
-			Mask2D::CreateSetMaskPtr<false>(data.ImageWidth(), data.ImageHeight());
-		Plot2DPointSet &beforeSet = plot.StartLine("Without flagging");
-		RFIPlots::MakeMeanSpectrumPlot<Weight>(beforeSet, data, mask, _timeFrequencyWidget.GetMetaData());
-
-		mask = Mask2D::CreateCopy(data.GetSingleMask());
-		if(!mask->AllFalse())
-		{
-			Plot2DPointSet &afterSet = plot.StartLine("Flagged");
-			RFIPlots::MakeMeanSpectrumPlot<Weight>(afterSet, data, mask, _timeFrequencyWidget.GetMetaData());
-		}
-		
-		_plotManager.Update();
-	}
-}
-
-void MSWindow::onPlotPowerSpectrumPressed()
-{
-	if(_timeFrequencyWidget.HasImage())
-	{
-		Plot2D &plot = _plotManager.NewPlot2D("Power spectrum");
-		plot.SetLogarithmicYAxis(true);
-
-		TimeFrequencyData data = _timeFrequencyWidget.GetActiveData();
-		Image2DCPtr image = data.GetSingleImage();
-		Mask2DPtr mask =
-			Mask2D::CreateSetMaskPtr<false>(image->Width(), image->Height());
-		Plot2DPointSet &beforeSet = plot.StartLine("Before");
-		RFIPlots::MakePowerSpectrumPlot(beforeSet, image, mask, _timeFrequencyWidget.GetMetaData());
-
-		mask = Mask2D::CreateCopy(data.GetSingleMask());
-		if(!mask->AllFalse())
-		{
-			Plot2DPointSet &afterSet = plot.StartLine("After");
-			RFIPlots::MakePowerSpectrumPlot(afterSet, image, mask, _timeFrequencyWidget.GetMetaData());
-		}
-		
-		_plotManager.Update();
-	}
-}
-
-void MSWindow::onPlotPowerSpectrumComparisonPressed()
-{
-	if(_timeFrequencyWidget.HasImage())
-	{
-		Plot2D &plot = _plotManager.NewPlot2D("Power spectrum comparison");
-
-		TimeFrequencyData data = _timeFrequencyWidget.OriginalData();
-		Image2DCPtr image = data.GetSingleImage();
-		Mask2DCPtr mask = data.GetSingleMask();
-		Plot2DPointSet &originalSet = plot.StartLine("Original");
-		RFIPlots::MakePowerSpectrumPlot(originalSet, image, mask, _timeFrequencyWidget.GetMetaData());
-
-		data = _timeFrequencyWidget.ContaminatedData();
-		image = data.GetSingleImage();
-		mask = data.GetSingleMask();
-		Plot2DPointSet &alternativeSet = plot.StartLine("Alternative");
-		RFIPlots::MakePowerSpectrumPlot(alternativeSet, image, mask, _timeFrequencyWidget.GetMetaData());
-	
-		_plotManager.Update();
-	}
-}
-
-void MSWindow::onPlotPowerRMSPressed()
-{
-	if(_timeFrequencyWidget.HasImage())
-	{
-		Plot2D &plot = _plotManager.NewPlot2D("Spectrum RMS");
-		plot.SetLogarithmicYAxis(true);
-
-		Mask2DPtr mask =
-			Mask2D::CreateSetMaskPtr<false>(_timeFrequencyWidget.Image()->Width(), _timeFrequencyWidget.Image()->Height());
-		Plot2DPointSet &beforeSet = plot.StartLine("Before");
-		RFIPlots::MakeRMSSpectrumPlot(beforeSet, _timeFrequencyWidget.Image(), mask);
-
-		mask = Mask2D::CreateCopy(_timeFrequencyWidget.GetActiveData().GetSingleMask());
-		if(!mask->AllFalse())
-		{
-			Plot2DPointSet &afterSet = plot.StartLine("After");
-			RFIPlots::MakeRMSSpectrumPlot(afterSet, _timeFrequencyWidget.Image(), mask);
-	
-			//mask->Invert();
-			//Plot2DPointSet &rfiSet = plot.StartLine("RFI");
-			//RFIPlots::MakeRMSSpectrumPlot(rfiSet, _timeFrequencyWidget.Image(), mask);
-		}
-
-		_plotManager.Update();
-	}
-}
-
-void MSWindow::onPlotPowerSNRPressed()
-{
-	Image2DCPtr
-		image = _timeFrequencyWidget.GetActiveData().GetSingleImage(),
-		model = _timeFrequencyWidget.RevisedData().GetSingleImage();
-	if(_timeFrequencyWidget.HasImage())
-	{
-		Plot2D &plot = _plotManager.NewPlot2D("SNR spectrum");
-		plot.SetLogarithmicYAxis(true);
-
-		Mask2DPtr mask =
-			Mask2D::CreateSetMaskPtr<false>(image->Width(), image->Height());
-		Plot2DPointSet &totalPlot = plot.StartLine("Total");
-		RFIPlots::MakeSNRSpectrumPlot(totalPlot, image, model, mask);
-
-		mask = Mask2D::CreateCopy(_timeFrequencyWidget.GetActiveData().GetSingleMask());
-		if(!mask->AllFalse())
-		{
-			Plot2DPointSet &uncontaminatedPlot = plot.StartLine("Uncontaminated");
-			RFIPlots::MakeSNRSpectrumPlot(uncontaminatedPlot, image, model, mask);
-	
-			mask->Invert();
-			Plot2DPointSet &rfiPlot = plot.StartLine("RFI");
-			RFIPlots::MakeSNRSpectrumPlot(rfiPlot, image, model, mask);
-		}
-
-		_plotManager.Update();
-	}
-}
-
-void MSWindow::onPlotPowerTimePressed()
-{
-	if(_timeFrequencyWidget.HasImage())
-	{
-		Plot2D &plot = _plotManager.NewPlot2D("Power over time");
-		plot.SetLogarithmicYAxis(true);
-
-		Mask2DPtr mask =
-			Mask2D::CreateSetMaskPtr<false>(_timeFrequencyWidget.Image()->Width(), _timeFrequencyWidget.Image()->Height());
-		Plot2DPointSet &totalPlot = plot.StartLine("Total");
-		RFIPlots::MakePowerTimePlot(totalPlot, _timeFrequencyWidget.Image(), mask, _timeFrequencyWidget.GetMetaData());
-
-		mask = Mask2D::CreateCopy(_timeFrequencyWidget.GetActiveData().GetSingleMask());
-		if(!mask->AllFalse())
-		{
-			Plot2DPointSet &uncontaminatedPlot = plot.StartLine("Uncontaminated");
-			RFIPlots::MakePowerTimePlot(uncontaminatedPlot, _timeFrequencyWidget.Image(), mask, _timeFrequencyWidget.GetMetaData());
-	
-			mask->Invert();
-			Plot2DPointSet &rfiPlot = plot.StartLine("RFI");
-			RFIPlots::MakePowerTimePlot(rfiPlot, _timeFrequencyWidget.Image(), mask, _timeFrequencyWidget.GetMetaData());
-		}
-
-		_plotManager.Update();
-	}
-}
-
-void MSWindow::onPlotPowerTimeComparisonPressed()
-{
-	if(_timeFrequencyWidget.HasImage())
-	{
-		Plot2D &plot = _plotManager.NewPlot2D("Time comparison");
-
-		TimeFrequencyData data = _timeFrequencyWidget.OriginalData();
-		Mask2DCPtr mask = data.GetSingleMask();
-		Image2DCPtr image = data.GetSingleImage();
-		Plot2DPointSet &originalPlot = plot.StartLine("Original");
-		RFIPlots::MakePowerTimePlot(originalPlot, image, mask, _timeFrequencyWidget.GetMetaData());
-
-		data = _timeFrequencyWidget.ContaminatedData();
-		mask = data.GetSingleMask();
-		image = data.GetSingleImage();
-		Plot2DPointSet &alternativePlot = plot.StartLine("Original");
-		plot.StartLine("Alternative");
-		RFIPlots::MakePowerTimePlot(alternativePlot, image, mask, _timeFrequencyWidget.GetMetaData());
-
-		_plotManager.Update();
-	}
-}
-
-void MSWindow::onPlotTimeScatterPressed()
-{
-	if(_timeFrequencyWidget.HasImage())
-	{
-		MultiPlot plot(_plotManager.NewPlot2D("Time scatter"), 4);
-		RFIPlots::MakeScatterPlot(plot, GetActiveData(), _timeFrequencyWidget.GetMetaData());
-		plot.Finish();
-		_plotManager.Update();
-	}
-}
-
-void MSWindow::onPlotTimeScatterComparisonPressed()
-{
-	if(_timeFrequencyWidget.HasImage())
-	{
-		MultiPlot plot(_plotManager.NewPlot2D("Time scatter comparison"), 8);
-		RFIPlots::MakeScatterPlot(plot, GetOriginalData(), _timeFrequencyWidget.GetMetaData(), 0);
-		RFIPlots::MakeScatterPlot(plot, GetContaminatedData(), _timeFrequencyWidget.GetMetaData(), 4);
-		plot.Finish();
-		_plotManager.Update();
-	}
-}
-
-void MSWindow::onPlotSingularValuesPressed()
-{
-	if(HasImage())
-	{
-		Plot2D &plot = _plotManager.NewPlot2D("Singular values");
-
-		SVDMitigater::CreateSingularValueGraph(GetActiveData(), plot);
-		_plotManager.Update();
-	}
-}
-
-void MSWindow::onPlotQuality25Pressed()
-{
-	if(HasImage())
-	{
-		Plot2D &plot = _plotManager.NewPlot2D("Quality over 25");
-		RFIPlots::MakeQualityPlot(plot.StartLine(), GetActiveData(), _timeFrequencyWidget.RevisedData(), 25);
-		_plotManager.Update();
-	}
-}
-
-void MSWindow::onPlotQualityAllPressed()
-{
-	if(HasImage())
-	{
-		Plot2D &plot = _plotManager.NewPlot2D("Quality over all");
-		RFIPlots::MakeQualityPlot(plot.StartLine(), GetActiveData(), _timeFrequencyWidget.RevisedData(), _timeFrequencyWidget.RevisedData().ImageWidth());
-		_plotManager.Update();
-	}
-}
-
-void MSWindow::onPlotSNRToFitVariance()
-{
-	bool relative = false;
-
-	FringeStoppingFitter fitter;
-	fitter.SetMetaData(_timeFrequencyWidget.GetMetaData());
-	
-	Plot2D
-		&plotA = _plotManager.NewPlot2D("/tmp/snrplot-a.pdf"),
-		&plotB = _plotManager.NewPlot2D("/tmp/snrplot-b.pdf");
-	plotA.StartLine("Stddev", "SNR (dB)", "Error (sigma-epsilon)");
-	plotA.SetTitle("Fit errors");
-	plotA.SetLogarithmicYAxis(false);
-	plotB.StartLine("Stddev", "SNR (ratio, non-logarithmic)", "Error (sigma-epsilon)");
-	plotB.SetTitle("Fit errors");
-	plotB.SetLogarithmicYAxis(false);
-
-	const unsigned iterations = 2500;
-	std::vector<long double> medians, means, maxs, snrDbs, snrRatios;
-
-	long double start = 4.6;
-	long double stop = 0.0001;
-	if(relative)
-		stop = 0.01;
-
-	for(long double snr = start;snr>stop;snr *= 0.9) {
-		long double amplitudes[iterations], mean = 0, stddev = 0;
-		long double db = 10.0 * logl(snr) / logl(10.0L);
-		long double max = -100e10;
-		for(size_t i=0;i<iterations;++i)
-		{
-			unsigned width = 1024, height = 1;
-			if(HasImage())
-			{
-				width = _timeFrequencyWidget.OriginalData().ImageWidth();
-				//height = _timeFrequencyWidget.Image()->Height();
-			}
-			width /= 16;
-
-			Mask2DPtr rfi = Mask2D::CreateSetMaskPtr<false>(width, height);
-			Image2DPtr testSetReal(MitigationTester::CreateTestSet(2, rfi, width, height, _gaussianTestSets));
-			Image2DPtr testSetImaginary(MitigationTester::CreateTestSet(2, rfi, width, height, _gaussianTestSets));
-			TimeFrequencyData *data = new TimeFrequencyData(SinglePolarisation, testSetReal, testSetImaginary);
-	
-			TimeFrequencyMetaDataCPtr metaData = TimeFrequencyMetaData();
-			FringeTestCreater::AddStaticFringe(*data, metaData, snr);
-	
-			fitter.Initialize(*data);
-			amplitudes[i] =
-				fitter.GetAmplitude(height/2, height/2+1) - snr;
-			mean += amplitudes[i];
-	
-			delete data;
-		}
-		mean /= iterations;
-		for(size_t i=0;i<iterations;++i)
-		{
-			stddev += (amplitudes[i] - mean) * (amplitudes[i] - mean);
-			if(amplitudes[i] > max) max = amplitudes[i];
-		}
-		stddev = sqrtl(stddev / iterations);
-		unsigned medianIndex = iterations/2;
-		std::nth_element(amplitudes, amplitudes + medianIndex, amplitudes+iterations);
-		std::cout << "Snr: " << snr << " (=" << db << " dB), stddev: " << stddev << ", median: " << amplitudes[medianIndex] << ", max: " << max << std::endl;
-		if(relative)
-		{
-			plotA.PushDataPoint(db, stddev/snr);
-			plotB.PushDataPoint(snr, stddev/snr);
-		} else {
-			plotA.PushDataPoint(db, stddev);
-			plotB.PushDataPoint(snr, stddev);
-		}
-		medians.push_back(amplitudes[medianIndex]);
-		snrRatios.push_back(snr);
-		snrDbs.push_back(db);
-		means.push_back(mean);
-		maxs.push_back(max);
-	}
-	plotA.StartLine("median");
-	plotB.StartLine("median");
-	for(unsigned i=0;i<snrDbs.size();++i)
-	{
-		if(relative)
-		{
-			plotA.PushDataPoint(snrDbs[i], medians[i]/snrRatios[i]);
-			plotB.PushDataPoint(snrRatios[i], medians[i]/snrRatios[i]);
-		} else {
-			plotA.PushDataPoint(snrDbs[i], medians[i]);
-			plotB.PushDataPoint(snrRatios[i], medians[i]);
-		}
-	}
-	plotA.StartLine("mean");
-	plotB.StartLine("mean");
-	for(unsigned i=0;i<means.size();++i)
-	{
-		if(relative)
-		{
-			plotA.PushDataPoint(snrDbs[i], means[i]/snrRatios[i]);
-			plotB.PushDataPoint(snrRatios[i], means[i]/snrRatios[i]);
-		} else {
-			plotA.PushDataPoint(snrDbs[i], means[i]);
-			plotB.PushDataPoint(snrRatios[i], means[i]);
-		}
-	}
-	plotA.StartLine("max");
-	plotB.StartLine("max");
-	for(unsigned i=0;i<maxs.size();++i)
-	{
-		if(relative)
-		{
-			plotA.PushDataPoint(snrDbs[i], maxs[i]/snrRatios[i]);
-			plotB.PushDataPoint(snrRatios[i], maxs[i]/snrRatios[i]);
-		} else {
-			plotA.PushDataPoint(snrDbs[i], maxs[i]);
-			plotB.PushDataPoint(snrRatios[i], maxs[i]);
-		}
-	}
-	plotA.StartLine("snr=error");
-	plotB.StartLine("snr=error");
-	for(unsigned i=0;i<means.size();++i)
-	{
-		if(relative)
-		{
-			plotA.PushDataPoint(snrDbs[i], powl(10.0L, snrDbs[i]/10.0L)/snrRatios[i]);
-			plotB.PushDataPoint(snrRatios[i], 1);
-		} else {
-			if(powl(10.0L, snrDbs[i]/10.0L) < 0.45)
-			{
-				plotA.PushDataPoint(snrDbs[i], powl(10.0L, snrDbs[i]/10.0L));
-			}
-			plotB.PushDataPoint(snrRatios[i], snrRatios[i]);
-		}
-	}
-	_plotManager.Update();
-}
-
-void MSWindow::onImagePropertiesPressed()
-{
-	if(_imagePropertiesWindow != 0)
-		delete _imagePropertiesWindow;
-	_imagePropertiesWindow = new ImagePropertiesWindow(_timeFrequencyWidget, "Time-frequency plotting options");
-	_imagePropertiesWindow->show();
-}
-
-void MSWindow::showPhasePart(enum TimeFrequencyData::PhaseRepresentation phaseRepresentation)
-{
-	if(HasImage())
-	{
-		try {
-			TimeFrequencyData *newPart =  _timeFrequencyWidget.GetActiveData().CreateTFData(phaseRepresentation);
-			_timeFrequencyWidget.SetNewData(*newPart, _timeFrequencyWidget.GetMetaData());
-			delete newPart;
-			_timeFrequencyWidget.Update();
-		} catch(std::exception &e)
-		{
-			std::stringstream errstr;
-			errstr
-				<< "The data that was currently in memory could not be converted to the requested "
-				   "type. The error given by the converter was:\n"
-				<< e.what()
-				<< "\n\n"
-				<< "Note that if the original data should be convertable to this type, but "
-				   "you have already used one of the 'Keep ..' buttons, you first need to reload "
-					 "the full data with Goto -> Load.\n\n"
-					 "(alternatively, if loading takes a lot of time, you can use the Store and Recall"
-					 " options in the Data menu)";
-			showError(errstr.str());
-		}
-	}
-}
-
-void MSWindow::showPolarisation(enum PolarisationType polarisation)
-{
-	if(HasImage())
-	{
-		try {
-			TimeFrequencyData *newData =
-				_timeFrequencyWidget.GetActiveData().CreateTFData(polarisation);
-			_timeFrequencyWidget.SetNewData(*newData, _timeFrequencyWidget.GetMetaData());
-			delete newData;
-			_timeFrequencyWidget.Update();
-		} catch(std::exception &e)
-		{
-			std::stringstream errstr;
-			errstr
-				<< "The data that was currently in memory could not be converted to the requested "
-				   "polarization. The error given by the converter was:\n"
-				<< e.what()
-				<< "\n\n"
-				<< "Note that if the original data should be convertable to this polarization, but "
-				   "you have already used one of the 'Keep ..' buttons, you first need to reload "
-					 "the full data with Goto -> Load.\n\n"
-					 "(alternatively, if loading takes a lot of time, you can use the Store and Recall"
-					 " options in the Data menu)";
-			showError(errstr.str());
-		}
-	}
-}
-
-void MSWindow::onGoToPressed()
-{
-	if(HasImageSet())
-	{
-		rfiStrategy::MSImageSet *msSet = dynamic_cast<rfiStrategy::MSImageSet*>(_imageSet);
-		if(msSet != 0)
-		{
-			if(_gotoWindow != 0)
-				delete _gotoWindow;
-			_gotoWindow = new GoToWindow(*this);
-			_gotoWindow->show();
-			} else {
-			showError("Can not goto in this image set; format does not support goto");
-		}
-	}
-}
-
-void MSWindow::onTFWidgetMouseMoved(size_t x, size_t y)
-{
-	Image2DCPtr image = _timeFrequencyWidget.Image();
-	num_t v = image->Value(x, y);
-	_statusbar.pop();
-	std::stringstream s;
-		s << "x=" << x << ",y=" << y << ",value=" << v;
-	TimeFrequencyMetaDataCPtr metaData =_timeFrequencyWidget.GetMetaData();
-	if(metaData != 0)
-	{
-		if(metaData->HasObservationTimes() && metaData->HasBand())
-		{
-			const std::vector<double> &times = _timeFrequencyWidget.GetMetaData()->ObservationTimes();
-			s << " (t=" << Date::AipsMJDToString(times[x]) <<
-			", f=" << Frequency::ToString(_timeFrequencyWidget.GetMetaData()->Band().channels[y].frequencyHz);
-		}
-		
-		if(metaData->HasUVW())
-		{
-			UVW uvw = metaData->UVW()[x];
-			s << ", uvw=" << uvw.u << "," << uvw.v << "," << uvw.w;
-		}
-		s << ')';
-	}
-	_statusbar.push(s.str(), 0);
-}
-
-void MSWindow::onShowImagePlane()
-{
-	_imagePlaneWindow->show();
-}
-
-void MSWindow::onSetAndShowImagePlane()
-{
-	_imagePlaneWindow->GetImager()->Empty();
-	onAddToImagePlane();
-	_imagePlaneWindow->show();
-	_imagePlaneWindow->GetImager()->ApplyWeightsToUV();
-	_imagePlaneWindow->Update();
-}
-
-void MSWindow::onAddToImagePlane()
-{
-	try {
-		if(_timeFrequencyWidget.GetMetaData() != 0 && _timeFrequencyWidget.GetMetaData()->HasUVW())
-		{
-			TimeFrequencyData activeData = GetActiveData();
-			if(activeData.PolarisationCount() != 1)
-			{
-				TimeFrequencyData *singlePolarization = activeData.CreateTFData(StokesIPolarisation);
-				activeData = *singlePolarization;
-				delete singlePolarization;
-			}
-			_imagePlaneWindow->AddData(activeData, _timeFrequencyWidget.GetMetaData());
-		}
-		else if(_spatialMetaData != 0)
-			_imagePlaneWindow->AddData(GetActiveData(), _spatialMetaData);
-		else
-			showError("No meta data found.");
-	}  catch(std::exception &e)
-	{
-		showError(e.what());
-	}
-}
-
-void MSWindow::onMultiplyData()
-{
-	TimeFrequencyData data(GetActiveData());
-	data.MultiplyImages(2.0L);
-	_timeFrequencyWidget.SetNewData(data, _timeFrequencyWidget.GetMetaData());
-	_timeFrequencyWidget.Update();
-}
-
-void MSWindow::onSegment()
-{
-	_segmentedImage = SegmentedImage::CreateUnsetPtr(GetOriginalData().ImageWidth(),  GetOriginalData().ImageHeight());
-	Morphology morphology;
-	morphology.SegmentByLengthRatio(GetActiveData().GetSingleMask(), _segmentedImage);
-	_timeFrequencyWidget.SetSegmentedImage(_segmentedImage);
-	Update();
-}
-
-void MSWindow::onCluster()
-{
-	if(_segmentedImage != 0)
-	{
-		Morphology morphology;
-		morphology.Cluster(_segmentedImage);
-	_timeFrequencyWidget.SetSegmentedImage(_segmentedImage);
-		Update();
-	}
-}
-
-void MSWindow::onClassify()
-{
-	if(_segmentedImage != 0)
-	{
-		Morphology morphology;
-		morphology.Classify(_segmentedImage);
-		_timeFrequencyWidget.SetSegmentedImage(_segmentedImage);
-		Update();
-	}
-}
-
-void MSWindow::onRemoveSmallSegments()
-{
-	if(_segmentedImage != 0)
-	{
-		Morphology morphology;
-		morphology.RemoveSmallSegments(_segmentedImage, 4);
-	_timeFrequencyWidget.SetSegmentedImage(_segmentedImage);
-		Update();
-	}
-}
-
-void MSWindow::onTimeGraphButtonPressed()
-{
-	if(_timeGraphButton->get_active())
-	{
-		_mainVBox.remove(_timeFrequencyWidget);
-		_mainVBox.pack_start(_panedArea);
-		_panedArea.pack1(_timeFrequencyWidget, true, true);
-		_panedArea.pack2(_plotFrame, true, true);
-
-		_panedArea.show();
-		_timeFrequencyWidget.show();
-		_plotFrame.show();
-	} else {
-		_mainVBox.remove(_panedArea);
-		_panedArea.remove(_timeFrequencyWidget);
-		_panedArea.remove(_plotFrame);
-
-		_mainVBox.pack_start(_timeFrequencyWidget);
-		_timeFrequencyWidget.show();
-	}
-}
-
-void MSWindow::onTFWidgetButtonReleased(size_t x, size_t y)
-{
-	if(HasImage())
-	{
-		if(_plotFrame.is_visible())
-		{
-			_plotFrame.SetTimeFrequencyData(GetActiveData());
-			_plotFrame.SetSelectedSample(x, y);
-		
-			_plotFrame.Update();
-		}
-	}
-}
-
-void MSWindow::onUnrollPhaseButtonPressed()
-{
-	if(HasImage())
-	{
-		TimeFrequencyData *data =
-			GetActiveData().CreateTFData(TimeFrequencyData::PhasePart);
-		for(unsigned i=0;i<data->ImageCount();++i)
-		{
-			Image2DPtr image = Image2D::CreateCopy(data->GetImage(i));
-			ThresholdTools::UnrollPhase(image);
-			data->SetImage(i, image);
-		}
-		_timeFrequencyWidget.SetNewData(*data, _timeFrequencyWidget.GetMetaData());
-		_timeFrequencyWidget.Update();
-		delete data;
-	}
-}
-
-void MSWindow::showError(const std::string &description)
-{
-	Gtk::MessageDialog dialog(*this, description, false, Gtk::MESSAGE_ERROR);
-	dialog.run();
-}
-
-DefaultModels::SetLocation MSWindow::getSetLocation(bool empty)
-{
-	if(empty)
-		return DefaultModels::EmptySet;
-	if(_ncpSetButton->get_active())
-		return DefaultModels::NCPSet;
-	else if(_b1834SetButton->get_active())
-		return DefaultModels::B1834Set;
-	else
-		return DefaultModels::EmptySet;
-}
-
-void MSWindow::loadDefaultModel(DefaultModels::Distortion distortion, bool withNoise, bool empty)
-{
-	unsigned channelCount;
-	if(_sim16ChannelsButton->get_active())
-		channelCount = 16;
-	else if(_sim64ChannelsButton->get_active())
-		channelCount = 64;
-	else
-		channelCount = 256;
-	double bandwidth;
-	if(_simFixBandwidthButton->get_active())
-		bandwidth = 16.0 * 2500000.0;
-	else
-		bandwidth = (double) channelCount / 16.0 * 2500000.0;
-	std::pair<TimeFrequencyData, TimeFrequencyMetaDataPtr> pair = DefaultModels::LoadSet(getSetLocation(empty), distortion, withNoise ? 1.0 : 0.0, channelCount, bandwidth);
-	TimeFrequencyData data = pair.first;
-	TimeFrequencyMetaDataCPtr metaData = pair.second;
-	
-	_timeFrequencyWidget.SetNewData(data, metaData);
-	_timeFrequencyWidget.Update();
-}
-
-void MSWindow::onCompress()
-{
-	Compress compress = Compress(GetActiveData());
-	compress.AllToStdOut();
-}
-
-void MSWindow::onShowAntennaMapWindow()
-{
-	if(_antennaMapWindow != 0)
-		delete _antennaMapWindow;
-	AntennaMapWindow *newWindow = new AntennaMapWindow();
-	_antennaMapWindow = newWindow;
-	rfiStrategy::MSImageSet *msImageSet = dynamic_cast<rfiStrategy::MSImageSet*>(_imageSet);
-	if(msImageSet != 0)
-	{
-		MeasurementSet &set = msImageSet->Reader()->Set();
-		newWindow->SetMeasurementSet(set);
-	}
-	newWindow->show();
-}
-
-void MSWindow::onVertEVD()
-{
-	if(HasImage())
-	{
-		TimeFrequencyData data = GetActiveData();
-		TimeFrequencyData old(data);
-		VertEVD::Perform(data, true);
-		TimeFrequencyData *diff = TimeFrequencyData::CreateTFDataFromDiff(old, data);
-		_timeFrequencyWidget.SetNewData(data, _timeFrequencyWidget.GetMetaData());
-		_timeFrequencyWidget.SetRevisedData(*diff);
-		delete diff;
-		_timeFrequencyWidget.Update();
-	}
-}
-
-void MSWindow::onApplyTimeProfile()
-{
-	if(HasImage())
-	{
-		TimeFrequencyData data = GetActiveData();
-		if(_horProfile.size() != data.ImageWidth())
-		{
-			_horProfile.clear();
-			for(unsigned i=0;i<data.ImageWidth();++i)
-				_horProfile.push_back(1.0);
-		}
-		
-		Image2DCPtr weights = data.GetSingleImage();
-		for(unsigned i=0;i<data.ImageCount();++i)
-		{
-			Image2DCPtr input = data.GetImage(i);
-			Image2DPtr output = Image2D::CreateUnsetImagePtr(input->Width(), input->Height());
-			for(unsigned x=0;x<weights->Width();++x)
-			{
-				num_t timeAvg = 0.0;
-				for(unsigned y=0;y<weights->Height();++y)
-				{
-					if(std::isfinite(weights->Value(x, y)))
-						timeAvg += weights->Value(x, y);
-				}
-				timeAvg /= (num_t) weights->Height();
-				_horProfile[x] = timeAvg;
-				for(unsigned y=0;y<input->Height();++y)
-				{
-					output->SetValue(x, y, input->Value(x, y) * timeAvg);
-				}
-			}
-			data.SetImage(i, output);
-		}
-		_timeFrequencyWidget.SetNewData(data, _timeFrequencyWidget.GetMetaData());
-		_timeFrequencyWidget.Update();
-	}
-}
-
-void MSWindow::onApplyVertProfile()
-{
-	if(HasImage())
-	{
-		TimeFrequencyData data = GetActiveData();
-		if(_vertProfile.size() != data.ImageHeight())
-		{
-			_vertProfile.clear();
-			for(unsigned i=0;i<data.ImageHeight();++i)
-				_vertProfile.push_back(1.0);
-		}
-
-		Image2DCPtr weights = data.GetSingleImage();
-		for(unsigned i=0;i<data.ImageCount();++i)
-		{
-			Image2DCPtr input = data.GetImage(i);
-			Image2DPtr output = Image2D::CreateUnsetImagePtr(input->Width(), input->Height());
-			for(unsigned y=0;y<weights->Height();++y)
-			{
-				num_t vertAvg = 0.0;
-				for(unsigned x=0;x<weights->Width();++x)
-				{
-					if(std::isfinite(weights->Value(x, y)))
-						vertAvg += weights->Value(x, y);
-				}
-				vertAvg /= (num_t) weights->Width();
-				_vertProfile[y] = vertAvg;
-				for(unsigned x=0;x<input->Width();++x)
-				{
-					output->SetValue(x, y, input->Value(x, y) * vertAvg);
-				}
-			}
-			data.SetImage(i, output);
-		}
-		_timeFrequencyWidget.SetNewData(data, _timeFrequencyWidget.GetMetaData());
-		_timeFrequencyWidget.Update();
-	}
-}
-
-void MSWindow::onUseTimeProfile(bool inverse)
-{
-	if(HasImage())
-	{
-		TimeFrequencyData data = GetActiveData();
-		if(_horProfile.size()==data.ImageWidth())
-		{
-			for(unsigned i=0;i<data.ImageCount();++i)
-			{
-				Image2DCPtr input = data.GetImage(i);
-				Image2DPtr output = Image2D::CreateUnsetImagePtr(input->Width(), input->Height());
-				for(unsigned x=0;x<input->Width();++x)
-				{
-					for(unsigned y=0;y<input->Height();++y)
-					{
-						if(inverse)
-						{
-							if(_horProfile[x] != 0.0)
-								output->SetValue(x, y, input->Value(x, y) / _horProfile[x]);
-							else
-								output->SetValue(x, y, 0.0);
-						} else {
-								output->SetValue(x, y, input->Value(x, y) * _horProfile[x]);
-						}
-					}
-				}
-				data.SetImage(i, output);
-			}
-			_timeFrequencyWidget.SetNewData(data, _timeFrequencyWidget.GetMetaData());
-			_timeFrequencyWidget.Update();
-		}
-	}
-}
-
-void MSWindow::onUseVertProfile(bool inverse)
-{
-	if(HasImage())
-	{
-		TimeFrequencyData data = GetActiveData();
-		if(_vertProfile.size()==data.ImageHeight())
-		{
-			TimeFrequencyData data = GetActiveData();
-			for(unsigned i=0;i<data.ImageCount();++i)
-			{
-				Image2DCPtr input = data.GetImage(i);
-				Image2DPtr output = Image2D::CreateUnsetImagePtr(input->Width(), input->Height());
-				for(unsigned x=0;x<input->Width();++x)
-				{
-					for(unsigned y=0;y<input->Height();++y)
-					{
-						if(inverse)
-						{
-							if(_vertProfile[y] != 0.0)
-								output->SetValue(x, y, input->Value(x, y) / _vertProfile[y]);
-							else
-								output->SetValue(x, y, 0.0);
-						} else {
-								output->SetValue(x, y, input->Value(x, y) * _vertProfile[y]);
-						}
-					}
-				}
-				data.SetImage(i, output);
-			}
-			_timeFrequencyWidget.SetNewData(data, _timeFrequencyWidget.GetMetaData());
-			_timeFrequencyWidget.Update();
-		}
-	}
-}
-
-void MSWindow::onStoreData()
-{
-	if(HasImage())
-	{
-		_storedData = _timeFrequencyWidget.GetActiveData();
-	}
-}
-
-void MSWindow::onRecallData()
-{
-	_timeFrequencyWidget.SetNewData(_storedData, _timeFrequencyWidget.GetMetaData());
-	_timeFrequencyWidget.Update();
-}
-
-void MSWindow::onSubtractDataFromMem()
-{
-	if(HasImage())
-	{
-		TimeFrequencyData activeData = _timeFrequencyWidget.GetActiveData();
-		TimeFrequencyData *diffData = TimeFrequencyData::CreateTFDataFromDiff(_storedData, activeData);
-		_timeFrequencyWidget.SetNewData(*diffData, _timeFrequencyWidget.GetMetaData());
-		delete diffData;
-		_timeFrequencyWidget.Update();
-	}
-}
-
-void MSWindow::onTimeMergeUnsetValues()
-{
-	if(HasImage())
-	{
-		TimeFrequencyData activeData = _timeFrequencyWidget.GetActiveData();
-		TimeFrequencyMetaDataPtr metaData(new class TimeFrequencyMetaData(*_timeFrequencyWidget.GetMetaData()));
-		rfiStrategy::NoiseStatImageSet::MergeInTime(activeData, metaData);
-		_timeFrequencyWidget.SetNewData(activeData, metaData);
-		_timeFrequencyWidget.Update();
-	}
-}
diff --git a/CEP/DP3/AOFlagger/src/gui/noisestatoptionwindow.cpp b/CEP/DP3/AOFlagger/src/gui/noisestatoptionwindow.cpp
deleted file mode 100644
index 5130b06e62de92acf9722cd089282ee914aaee51..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/gui/noisestatoptionwindow.cpp
+++ /dev/null
@@ -1,99 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#include <gtkmm/messagedialog.h>
-
-#include <AOFlagger/strategy/imagesets/noisestatimageset.h>
-
-#include <AOFlagger/gui/mswindow.h>
-#include <AOFlagger/gui/noisestatoptionwindow.h>
-
-NoiseStatOptionWindow::NoiseStatOptionWindow(MSWindow &msWindow, const std::string &filename) :
-	Gtk::Window(),
-	_msWindow(msWindow),
-	_filename(filename),
-	_openButton("Open"),
-	_modeFrame("What to read"),
-	_meanButton("Mean"),
-	_stdDevButton("Stddev"),
-	_varianceButton("Variance"),
-	_varianceOfVarianceButton("Variance of variance")
-{
-	set_title("Options for opening a noise stat file");
-
-	initModeButtons();
-	
-	_openButton.signal_clicked().connect(sigc::mem_fun(*this, &NoiseStatOptionWindow::onOpen));
-	_bottomButtonBox.pack_start(_openButton);
-
-	_topVBox.pack_start(_bottomButtonBox);
-
-	add(_topVBox);
-	_topVBox.show_all();
-}
-
-void NoiseStatOptionWindow::initModeButtons()
-{
-	Gtk::RadioButton::Group group;
-
-	_meanButton.set_group(group);
-	_modeBox.pack_start(_meanButton);
-	
-	_stdDevButton.set_group(group);
-	_modeBox.pack_start(_stdDevButton);
-	_stdDevButton.set_active(true);
-	
-	_varianceButton.set_group(group);
-	_modeBox.pack_start(_varianceButton);
-	
-	_varianceOfVarianceButton.set_group(group);
-	_modeBox.pack_start(_varianceOfVarianceButton);
-	
-	_modeFrame.add(_modeBox);
-
-	_topVBox.pack_start(_modeFrame);
-}
-
-void NoiseStatOptionWindow::onOpen()
-{
-	std::cout << "Opening " << _filename << std::endl;
-	try
-	{
-		rfiStrategy::NoiseStatImageSet *imageSet =
-			new rfiStrategy::NoiseStatImageSet(_filename);
-		if(_meanButton.get_active())
-			imageSet->SetMode(rfiStrategy::NoiseStatImageSet::Mean);
-		else if(_stdDevButton.get_active())
-			imageSet->SetMode(rfiStrategy::NoiseStatImageSet::StdDev);
-		else if(_varianceButton.get_active())
-			imageSet->SetMode(rfiStrategy::NoiseStatImageSet::Variance);
-		else if(_varianceOfVarianceButton.get_active())
-			imageSet->SetMode(rfiStrategy::NoiseStatImageSet::VarianceOfVariance);
-		imageSet->Initialize();
-	
-		_msWindow.SetImageSet(imageSet);
-	} catch(std::exception &e)
-	{
-		Gtk::MessageDialog dialog(*this, e.what(), false, Gtk::MESSAGE_ERROR);
-		dialog.run();
-	}
-	hide();
-}
-
diff --git a/CEP/DP3/AOFlagger/src/gui/plot/colorscale.cpp b/CEP/DP3/AOFlagger/src/gui/plot/colorscale.cpp
deleted file mode 100644
index 4acc81d30a4bf61309fa7a33dadd74dcc232da96..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/gui/plot/colorscale.cpp
+++ /dev/null
@@ -1,92 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <AOFlagger/gui/plot/colorscale.h>
-
-const double ColorScale::BAR_WIDTH = 15.0;
-
-ColorScale::ColorScale()
-: _width(0.0), _verticalPlotScale()
-{
-	_verticalPlotScale.SetUnitsCaption("z");
-}
-
-void ColorScale::initWidth(Cairo::RefPtr<Cairo::Context> cairo)
-{
-	if(_width == 0.0)
-	{
-		const double textHeight = _verticalPlotScale.GetTextHeight(cairo);
-		const double scaleHeight = _plotHeight - 2.0*textHeight - _topMargin;
-		_verticalPlotScale.SetPlotDimensions(_plotWidth, scaleHeight, _topMargin + textHeight);
-		_scaleWidth = _verticalPlotScale.GetWidth(cairo);
-		_width = _scaleWidth + BAR_WIDTH;
-	}
-}
-
-void ColorScale::Draw(Cairo::RefPtr<Cairo::Context> cairo)
-{
-	initWidth(cairo);
-	const double textHeight = _verticalPlotScale.GetTextHeight(cairo);
-	const double scaleTop = _topMargin + textHeight;
-	const double scaleHeight = _plotHeight - 2.0*textHeight - _topMargin;
-	ColorValue backValue;
-	if(!_colorValues.empty())
-	{
-		backValue = _colorValues.begin()->second;
-	} else {
-		backValue.red = 1.0;
-		backValue.green = 1.0;
-		backValue.blue = 1.0;
-	}
-	cairo->rectangle(_plotWidth - _width + _scaleWidth, scaleTop,
-										BAR_WIDTH, scaleHeight);
-	cairo->set_source_rgb(backValue.red, backValue.green, backValue.blue);
-	cairo->fill();
-	
-	for(std::map<double, ColorValue>::const_iterator i=_colorValues.begin();
-		i!=_colorValues.end();++i)
-	{
-		double val;
-		if(_isLogaritmic)
-		{
-			const double minLog10 = log10(_min);
-			if(i->first <= 0.0)
-				val = 0.0;
-			else
-				val = (log10(i->first) - minLog10) / (log10(_max) - minLog10);
-		} else {
-			val = (i->first - _min) / (_max - _min);
-			if(val < 0.0) val = 0.0;
-			if(val > 1.0) val = 1.0;
-		}
-		const double height = scaleHeight * (1.0 - val);
-		const ColorValue &color = i->second;
-		cairo->set_source_rgb(color.red, color.green, color.blue);
-		cairo->rectangle(_plotWidth - _width + _scaleWidth, scaleTop,
-											BAR_WIDTH, height);
-		cairo->fill();
-	}
-	
-	cairo->rectangle(_plotWidth - _width + _scaleWidth, scaleTop,
-										BAR_WIDTH, scaleHeight);
-	cairo->set_source_rgb(0.0, 0.0, 0.0);
-	cairo->stroke();
-	
-	_verticalPlotScale.Draw(cairo, _plotWidth - _width, 0.0);
-}
diff --git a/CEP/DP3/AOFlagger/src/gui/plot/horizontalplotscale.cpp b/CEP/DP3/AOFlagger/src/gui/plot/horizontalplotscale.cpp
deleted file mode 100644
index c45df803d97f1f04a204bad92a08a51df580cd50..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/gui/plot/horizontalplotscale.cpp
+++ /dev/null
@@ -1,214 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <AOFlagger/gui/plot/horizontalplotscale.h>
-
-#include <AOFlagger/gui/plot/tickset.h>
-
-#include <AOFlagger/util/aologger.h>
-
-HorizontalPlotScale::HorizontalPlotScale()
-	: _plotWidth(0), _plotHeight(0), _metricsAreInitialized(false), _tickSet(0), _drawWithDescription(true), _unitsCaption("x"), _descriptionFontSize(14), _tickValuesFontSize(14), _rotateUnits(false)
-{
-}
-
-HorizontalPlotScale::~HorizontalPlotScale()
-{
-	if(_tickSet != 0)
-		delete _tickSet;
-}
-
-double HorizontalPlotScale::GetHeight(Cairo::RefPtr<Cairo::Context> cairo)
-{
-	initializeMetrics(cairo);
-	return _height;
-}
-
-double HorizontalPlotScale::GetRightMargin(Cairo::RefPtr<Cairo::Context> cairo)
-{
-	initializeMetrics(cairo);
-	return _rightMargin;
-}
-
-void HorizontalPlotScale::Draw(Cairo::RefPtr<Cairo::Context> cairo)
-{
-	initializeMetrics(cairo);
-	cairo->set_source_rgb(0.0, 0.0, 0.0);
-	cairo->set_font_size(_tickValuesFontSize);
-	for(unsigned i=0;i!=_tickSet->Size();++i)
-	{
-		const Tick tick = _tickSet->GetTick(i);
-		double x = tick.first * (_plotWidth - _verticalScaleWidth) + _verticalScaleWidth;
-		cairo->move_to(x, _topMargin + _plotHeight);
-		cairo->line_to(x, _topMargin + _plotHeight + 3);
-		Cairo::TextExtents extents;
-		cairo->get_text_extents(tick.second, extents);
-		if(_rotateUnits)
-		{
-			cairo->move_to(x - extents.y_bearing - extents.height/2, _topMargin + _plotHeight + extents.width + 8);
-			cairo->save();
-			cairo->rotate(-M_PI*0.5);
-			cairo->show_text(tick.second);
-			cairo->restore();
-		}
-		else
-		{
-			cairo->move_to(x - extents.width/2, _topMargin + _plotHeight - extents.y_bearing + extents.height);
-			cairo->show_text(tick.second);
-		}
-	}
-	cairo->stroke();
-	
-	if(_drawWithDescription)
-		drawUnits(cairo);
-}
-
-void HorizontalPlotScale::drawUnits(Cairo::RefPtr<Cairo::Context> cairo)
-{
-	cairo->save();
-	cairo->set_font_size(_descriptionFontSize);
-	Cairo::TextExtents extents;
-	cairo->get_text_extents(_unitsCaption, extents);
-	cairo->move_to(_verticalScaleWidth + 0.3 * _plotWidth,
-								 _topMargin + _plotHeight + _height - extents.y_bearing - extents.height - 5);
-	cairo->show_text(_unitsCaption);
-	cairo->stroke();
-	cairo->restore();
-
-	// Base of arrow
-	cairo->move_to(_verticalScaleWidth + 0.1 * _plotWidth, _topMargin + _plotHeight + _height - 0.5*extents.height - 5);
-	cairo->line_to(_verticalScaleWidth + 0.275 * _plotWidth, _topMargin + _plotHeight + _height - 0.5*extents.height - 5);
-	cairo->stroke();
-
-	// The arrow
-	cairo->move_to(_verticalScaleWidth + 0.275 * _plotWidth, _topMargin + _plotHeight + _height - 0.5*extents.height - 5);
-	cairo->line_to(_verticalScaleWidth + 0.25 * _plotWidth, _topMargin + _plotHeight + _height - 0.1*extents.height - 5);
-	cairo->line_to(_verticalScaleWidth + 0.26 * _plotWidth, _topMargin + _plotHeight + _height - 0.5*extents.height - 5);
-	cairo->line_to(_verticalScaleWidth + 0.25 * _plotWidth, _topMargin + _plotHeight + _height - 0.9*extents.height - 5);
-	cairo->close_path();
-	cairo->fill();
-}
-
-void HorizontalPlotScale::initializeMetrics(Cairo::RefPtr<Cairo::Context> cairo)
-{
-	if(!_metricsAreInitialized)
-	{
-		if(_tickSet != 0)
-		{
-			_tickSet->Reset();
-			while(!ticksFit(cairo) && _tickSet->Size()>2)
-			{
-				_tickSet->DecreaseTicks();
-			}
-			cairo->set_font_size(_tickValuesFontSize);
-			double maxHeight = 0;
-			for(unsigned i=0;i!=_tickSet->Size();++i)
-			{
-				const Tick tick = _tickSet->GetTick(i);
-				Cairo::TextExtents extents;
-				cairo->get_text_extents(tick.second, extents);
-				if(_rotateUnits)
-				{
-					if(maxHeight < extents.width)
-						maxHeight = extents.width;
-				} else {
-					if(maxHeight < extents.height)
-						maxHeight = extents.height;
-				}
-			}
-			if(_rotateUnits)
-				_height = maxHeight + 15;
-			else
-				_height = maxHeight*2 + 10;
-			if(_drawWithDescription)
-			{
-				cairo->set_font_size(_descriptionFontSize);
-				Cairo::TextExtents extents;
-				cairo->get_text_extents(_unitsCaption, extents);
-				_height += extents.height;
-			}
-			
-			if(_tickSet->Size() != 0)
-			{
-				Cairo::TextExtents extents;
-				cairo->get_text_extents(_tickSet->GetTick(_tickSet->Size()-1).second, extents);
-				_rightMargin = extents.width/2+5 > 10 ? extents.width/2+5 : 10;
-			} else {
-				_rightMargin = 0.0;
-			}
-			
-			_metricsAreInitialized = true;
-		}
-	}
-} 
-
-void HorizontalPlotScale::InitializeNumericTicks(double min, double max)
-{
-	if(_tickSet != 0)
-		delete _tickSet;
-	_tickSet = new NumericTickSet(min, max, 25);
-	_metricsAreInitialized = false;
-}
-
-void HorizontalPlotScale::InitializeTimeTicks(double timeMin, double timeMax)
-{
-	if(_tickSet != 0)
-		delete _tickSet;
-	_tickSet = new TimeTickSet(timeMin, timeMax, 25);
-	_metricsAreInitialized = false;
-}
-
-void HorizontalPlotScale::InitializeTextTicks(const std::vector<std::string> &labels)
-{
-	if(_tickSet != 0)
-		delete _tickSet;
-	_tickSet = new TextTickSet(labels, 100);
-	_metricsAreInitialized = false;
-}
-
-bool HorizontalPlotScale::ticksFit(Cairo::RefPtr<Cairo::Context> cairo)
-{
-	cairo->set_font_size(16.0);
-	double prevEndX = 0.0;
-	for(unsigned i=0;i!=_tickSet->Size();++i)
-	{
-		const Tick tick = _tickSet->GetTick(i);
-		Cairo::TextExtents extents;
-		cairo->get_text_extents(tick.second + "M", extents);
-		const double
-			midX = tick.first * (_plotWidth - _verticalScaleWidth) + _verticalScaleWidth;
-		double startX, endX;
-		if(_rotateUnits)
-		{
-			// Use "M" to get at least an "M" of distance between axis
-			startX = midX - extents.height/2,
-			endX = startX + extents.height;
-		} else
-		{
-			// Use "M" to get at least an "M" of distance between ticks
-			cairo->get_text_extents(tick.second + "M", extents);
-			startX = midX - extents.width/2,
-			endX = startX + extents.width;
-		}
-		if(startX < prevEndX)
-			return false;
-		prevEndX = endX;
-	}
-	return true;
-}
diff --git a/CEP/DP3/AOFlagger/src/gui/plot/plot2d.cpp b/CEP/DP3/AOFlagger/src/gui/plot/plot2d.cpp
deleted file mode 100644
index 8f56ec7232c6618feaad8d162d7afc3b01582626..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/gui/plot/plot2d.cpp
+++ /dev/null
@@ -1,316 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <AOFlagger/gui/plot/plot2d.h>
-
-#include <iostream>
-
-Plot2D::Plot2D() :
-	_logarithmicYAxis(false),
-	_showAxes(true),
-	_showAxisDescriptions(true),
-	_vRangeDetermination(MinMaxRange)
-{
-}
-
-Plot2D::~Plot2D()
-{
-	Clear();
-}
-
-void Plot2D::Clear()
-{
-	for(std::vector<Plot2DPointSet*>::iterator i=_pointSets.begin();i!=_pointSets.end();++i)
-		delete *i;
-	_pointSets.clear();
-	_system.Clear();
-}
-
-void Plot2D::Render(Gtk::DrawingArea &drawingArea)
-{
-	_system.Clear();
-	for(std::vector<Plot2DPointSet*>::iterator i=_pointSets.begin();i!=_pointSets.end();++i)
-		_system.AddToSystem(**i);
-
-	Glib::RefPtr<Gdk::Window> window = drawingArea.get_window();
-	if(window != 0)
-	{
-		Cairo::RefPtr<Cairo::Context> cr = window->create_cairo_context();
-
-		Gtk::Allocation allocation = drawingArea.get_allocation();
-		_width = allocation.get_width();
-		_height = allocation.get_height();
-		render(cr);
-	}
-}
-
-void Plot2D::SavePdf(const std::string &filename)
-{
-	Cairo::RefPtr<Cairo::PdfSurface> surface = Cairo::PdfSurface::create(filename, _width, _height);
-	Cairo::RefPtr<Cairo::Context> cairo = Cairo::Context::create(surface);
-	AOLogger::Debug << "Saving PDF of " << _width << " x " << _height << "\n";
-	render(cairo);
-	cairo->show_page();
-	surface->finish();
-}
-
-void Plot2D::SaveSvg(const std::string &filename)
-{
-	Cairo::RefPtr<Cairo::SvgSurface> surface = Cairo::SvgSurface::create(filename, _width, _height);
-	Cairo::RefPtr<Cairo::Context> cairo = Cairo::Context::create(surface);
-	AOLogger::Debug << "Saving SVG of " << _width << " x " << _height << "\n";
-	render(cairo);
-	cairo->show_page();
-	surface->finish();
-}
-
-void Plot2D::SavePng(const std::string &filename)
-{
-	Cairo::RefPtr<Cairo::ImageSurface> surface = Cairo::ImageSurface::create(Cairo::FORMAT_ARGB32, _width, _height);
-	Cairo::RefPtr<Cairo::Context> cairo = Cairo::Context::create(surface);
-	AOLogger::Debug << "Saving PNG of " << _width << " x " << _height << "\n";
-	render(cairo);
-	surface->write_to_png(filename);
-}
-
-
-void Plot2D::render(Cairo::RefPtr<Cairo::Context> cr)
-{
-	cr->set_line_width(2);
-
-	cr->set_source_rgba(1, 1, 1, 1);
-	cr->paint();
-	cr->fill();
-
-	size_t c = 0;
-	
-	if(!_pointSets.empty())
-	{
-		Plot2DPointSet &refPointSet = **_pointSets.begin();
-		
-		double verticalScaleWidth, horiScaleHeight;
-	
-		if(_showAxes)
-		{
-			_horizontalScale.SetDrawWithDescription(_showAxisDescriptions);
-			_horizontalScale.SetRotateUnits(refPointSet.RotateUnits());
-			if(refPointSet.HasTickLabels())
-				_horizontalScale.InitializeTextTicks(refPointSet.TickLabels());
-			else if(refPointSet.XIsTime())
-				_horizontalScale.InitializeTimeTicks(_system.XRangeMin(refPointSet), _system.XRangeMax(refPointSet));
-			else
-				_horizontalScale.InitializeNumericTicks(_system.XRangeMin(refPointSet), _system.XRangeMax(refPointSet));
-			_horizontalScale.SetUnitsCaption(refPointSet.XUnits());
-			_topMargin = 10.0;
-			_horizontalScale.SetPlotDimensions(_width, _height, _topMargin, 0.0);
-			horiScaleHeight = _horizontalScale.GetHeight(cr);
-			
-			double rightMargin = _horizontalScale.GetRightMargin(cr);
-			_verticalScale.SetDrawWithDescription(_showAxisDescriptions);
-			if(_logarithmicYAxis)
-				_verticalScale.InitializeLogarithmicTicks(MinY(), MaxY());
-			else
-				_verticalScale.InitializeNumericTicks(MinY(), MaxY());
-			_verticalScale.SetUnitsCaption(refPointSet.YUnits());
-			_verticalScale.SetPlotDimensions(_width - rightMargin, _height - horiScaleHeight - _topMargin, _topMargin);
-
-			verticalScaleWidth =  _verticalScale.GetWidth(cr);
-			_horizontalScale.SetPlotDimensions(_width - rightMargin, _height - horiScaleHeight, 0.0, verticalScaleWidth);
-		}
-		else {
-			verticalScaleWidth = 0.0;
-			horiScaleHeight = 0.0;
-		}
-		
-		for(std::vector<Plot2DPointSet*>::iterator i=_pointSets.begin();i!=_pointSets.end();++i)
-		{
-			switch(c)
-			{
-				case 0: cr->set_source_rgba(1, 0, 0, 1); break;
-				case 1: cr->set_source_rgba(0, 1, 0, 1); break;
-				case 2: cr->set_source_rgba(0, 0, 1, 1); break;
-				case 3: cr->set_source_rgba(0, 0, 0, 1); break;
-				case 4: cr->set_source_rgba(1, 1, 0, 1); break;
-				case 5: cr->set_source_rgba(1, 0, 1, 1); break;
-				case 6: cr->set_source_rgba(0, 1, 1, 1); break;
-				case 7: cr->set_source_rgba(0.5, 0.5, 0.5, 1); break;
-			}
-			c = (c+1)%8;
-
-			render(cr, **i);
-		}
-		
-		double rightMargin;
-		if(_showAxes)
-		{
-			_horizontalScale.Draw(cr);
-			_verticalScale.Draw(cr);
-			rightMargin = _horizontalScale.GetRightMargin(cr);
-		} else {
-			rightMargin = 0.0;
-		}
-		
-		cr->set_source_rgb(0.0, 0.0, 0.0);
-		cr->rectangle(verticalScaleWidth, _topMargin, _width - verticalScaleWidth - rightMargin, _height - horiScaleHeight - _topMargin);
-		cr->stroke();
-	}
-}
-
-void Plot2D::render(Cairo::RefPtr<Cairo::Context> cr, Plot2DPointSet &pointSet)
-{
-	pointSet.Sort();
-
-	double
-		xLeft = _system.XRangeMin(pointSet),
-		xRight = _system.XRangeMax(pointSet),
-		yMin = _logarithmicYAxis ? MinPositiveY() : MinY(),
-		yMax = _logarithmicYAxis ? MaxPositiveY() : MaxY();
-	if(!std::isfinite(xLeft) || !std::isfinite(xRight))
-	{
-		xLeft = -1;
-		xRight = 1;
-	}
-	else if(xLeft == xRight)
-	{
-		xLeft -= 1;
-		xRight += 1;
-	}
-	if(!std::isfinite(yMin) || !std::isfinite(yMax))
-	{
-		yMin = -1;
-		yMax = 1;
-	}
-	else if(yMin == yMax)
-	{
-		yMin -= 1;
-		yMax += 1;
-	}
-
-	const double rightMargin = _showAxes ? _horizontalScale.GetRightMargin(cr) : 0.0;
-	const double bottomMargin = _showAxes ? _horizontalScale.GetHeight(cr) : 0.0;
-	const double plotLeftMargin = _showAxes ? _verticalScale.GetWidth(cr) : 0.0;
-	
-	const double plotWidth = _width - rightMargin - plotLeftMargin;
-	const double plotHeight = _height - bottomMargin - _topMargin;
-	
-	double fx = (double) plotWidth / (xRight - xLeft);
-	
-	double
-		minYLog10 = log10(yMin),
-		maxYLog10 = log10(yMax);
-
-	bool hasPrevPoint = false;
-	
-	unsigned iterationCount = pointSet.Size();
-	if(pointSet.DrawingStyle() == Plot2DPointSet::DrawLines && iterationCount!=0)
-		--iterationCount;
-
-	for(size_t i=0;i<iterationCount;++i)
-	{
-		double
-			y1Val, y2Val;
-		
-		if(_logarithmicYAxis)
-		{
-			if(pointSet.GetY(i) <= 0.0)
-				y1Val = 0.0;
-			else
-				y1Val = (log10(pointSet.GetY(i)) - minYLog10) / (maxYLog10 - minYLog10);
-			if(pointSet.GetY(i+1) <= 0.0)
-				y2Val = 0.0;
-			else
-				y2Val = (log10(pointSet.GetY(i+1)) - minYLog10) / (maxYLog10 - minYLog10);
-		} else {
-			y1Val = (pointSet.GetY(i) - yMin) / (yMax - yMin);
-			y2Val = (pointSet.GetY(i+1) - yMin) / (yMax - yMin);
-		}
-		if(y1Val < 0.0) y1Val = 0.0;
-		if(y1Val > 1.0) y1Val = 1.0;
-		if(y2Val < 0.0) y2Val = 0.0;
-		if(y2Val > 1.0) y2Val = 1.0;
-			
-		double
-			x1 = (pointSet.GetX(i) - xLeft) * fx + plotLeftMargin,
-			x2 = (pointSet.GetX(i+1) - xLeft) * fx + plotLeftMargin,
-			y1 = (1.0 - y1Val) * plotHeight + _topMargin,
-			y2 = (1.0 - y2Val) * plotHeight + _topMargin;
-
-		if(std::isfinite(x1) && std::isfinite(y1))
-		{
-			switch(pointSet.DrawingStyle())
-			{
-				case Plot2DPointSet::DrawLines:
-					if(std::isfinite(x2) && std::isfinite(y2))
-					{
-						if(!hasPrevPoint)
-							cr->move_to(x1, y1);
-						cr->line_to(x2, y2);
-						hasPrevPoint = true;
-					} else {
-						hasPrevPoint = false;
-					}
-					break;
-				case Plot2DPointSet::DrawPoints:
-					cr->move_to(x1 + 2.0, y1);
-					cr->arc(x1, y1, 2.0, 0.0, 2*M_PI);
-					break;
-				case Plot2DPointSet::DrawColumns:
-					if(y1 <= _topMargin + plotHeight)
-					{
-						double
-							width = 10.0,
-							startX = x1 - width*0.5,
-							endX = x1 + width*0.5;
-						if(startX < plotLeftMargin)
-							startX = plotLeftMargin;
-						if(endX > plotWidth + plotLeftMargin)
-							endX = plotWidth + plotLeftMargin;
-						cr->rectangle(startX, y1, endX - startX, _topMargin + plotHeight - y1);
-					}
-					break;
-			}
-		} else {
-		}
-	}
-	switch(pointSet.DrawingStyle())
-	{
-		case Plot2DPointSet::DrawLines:
-			cr->stroke();
-			break;
-		case Plot2DPointSet::DrawPoints:
-			cr->fill();
-			break;
-		case Plot2DPointSet::DrawColumns:
-			cr->fill_preserve();
-			Cairo::RefPtr<Cairo::Pattern> source = cr->get_source();
-			cr->set_source_rgb(0.0, 0.0, 0.0);
-			cr->stroke();
-			cr->set_source(source);
-			break;
-	}
-
-	// Draw "zero y" x-axis
-	if(yMin <= 0.0 && yMax >= 0.0 && !_logarithmicYAxis)
-	{
-		cr->set_source_rgba(0.5, 0.5, 0.5, 1);
-		cr->move_to(plotLeftMargin, yMax * plotHeight / (yMax - yMin) + _topMargin);
-		cr->line_to(plotWidth + plotLeftMargin, yMax * plotHeight / (yMax - yMin) + _topMargin);
-		cr->stroke();
-	}
-}
diff --git a/CEP/DP3/AOFlagger/src/gui/plot/plotpropertieswindow.cpp b/CEP/DP3/AOFlagger/src/gui/plot/plotpropertieswindow.cpp
deleted file mode 100644
index ab1fc2d6157cb4647f3ca2dcd9f89eed8aaeedb4..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/gui/plot/plotpropertieswindow.cpp
+++ /dev/null
@@ -1,244 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#include <iostream>
-#include <sstream>
-
-#include <gtkmm/stock.h>
-#include <gtkmm/filechooserdialog.h>
-
-#include <AOFlagger/gui/plot/plotpropertieswindow.h>
-#include <AOFlagger/gui/plot/plot2d.h>
-#include <AOFlagger/gui/imagewidget.h>
-#include <AOFlagger/gui/plot/plotwidget.h>
-
-PlotPropertiesWindow::PlotPropertiesWindow(Plot2D &plot, const std::string &title) :
-	Gtk::Window(),
-	_plot(plot),
-	_applyButton(Gtk::Stock::APPLY),
-	_exportButton("Export"),
-	_closeButton(Gtk::Stock::CLOSE),
-	_saveImage(Gtk::Stock::SAVE, Gtk::ICON_SIZE_BUTTON),
-	
-	_vRangeFrame("Vertical scale"),
-	_minMaxVRangeButton("From min to max"),
-	_winsorizedVRangeButton("Winsorized min and max"),
-	_specifiedVRangeButton("Specified:"),
-	_vRangeMinLabel("Scale minimum:"),
-	_vRangeMaxLabel("Scale maximum:"),
-	_vRangeMinEntry(),
-	_vRangeMaxEntry(),
-	
-	_hRangeFrame("Horizontal scale"),
-	_automaticHRangeButton("Automatic"),
-	_hRangeMinLabel("Scale minimum:"),
-	_hRangeMaxLabel("Scale maximum:"),
-	_hRangeMinEntry(),
-	_hRangeMaxEntry(),
-	
-	_optionsFrame("Options"),
-	_normalOptionsButton("Normal scale"),
-	_logScaleButton("Logarithmic scale"),
-	_zeroSymmetricButton("Symmetric around zero"),
-	
-	_showAxes("Show axes"),
-	_showAxisDescriptionsButton("Show axis descriptions")
-{
-	set_title(title);
-
-	initVRangeWidgets();
-	initHRangeWidgets();
-	initOptionsWidgets();
-	
-	_applyButton.signal_clicked().connect(sigc::mem_fun(*this, &PlotPropertiesWindow::onApplyClicked));
-	_bottomButtonBox.pack_start(_applyButton);
-
-	_exportButton.signal_clicked().connect(sigc::mem_fun(*this, &PlotPropertiesWindow::onExportClicked));
-	_exportButton.set_image(_saveImage);
-	_bottomButtonBox.pack_start(_exportButton);
-
-	_closeButton.signal_clicked().connect(sigc::mem_fun(*this, &PlotPropertiesWindow::onCloseClicked));
-	_bottomButtonBox.pack_start(_closeButton);
-
-	_topVBox.pack_start(_framesHBox);
-	
-	_showAxes.set_active(_plot.ShowAxes());
-	_topVBox.pack_start(_showAxes);
-
-	_showAxisDescriptionsButton.set_active(_plot.ShowAxisDescriptions());
-	_topVBox.pack_start(_showAxisDescriptionsButton);
-
-	_topVBox.pack_start(_bottomButtonBox);
-
-	add(_topVBox);
-	_topVBox.show_all();
-}
-
-void PlotPropertiesWindow::initVRangeWidgets()
-{
-	_vRangeFrame.add(_vRangeBox);
-	
-	Gtk::RadioButton::Group group;
-	
-	_vRangeBox.pack_start(_minMaxVRangeButton);
-	_minMaxVRangeButton.set_group(group);
-	_minMaxVRangeButton.signal_clicked().connect(sigc::mem_fun(*this, &PlotPropertiesWindow::onVRangeChanged));
-
-	//_vRangeBox.pack_start(_winsorizedVRangeButton);
-	_winsorizedVRangeButton.set_group(group);
-	_winsorizedVRangeButton.signal_clicked().connect(sigc::mem_fun(*this, &PlotPropertiesWindow::onVRangeChanged));
-	_vRangeBox.pack_start(_specifiedVRangeButton);
-	
-	_specifiedVRangeButton.set_group(group);
-	_specifiedVRangeButton.signal_clicked().connect(sigc::mem_fun(*this, &PlotPropertiesWindow::onVRangeChanged));
-	
-	switch(_plot.VRangeDetermination())
-	{
-		default:
-		case Plot2D::MinMaxRange: _minMaxVRangeButton.set_active(true); break;
-		case Plot2D::WinsorizedRange: _winsorizedVRangeButton.set_active(true); break;
-		case Plot2D::SpecifiedRange: _specifiedVRangeButton.set_active(true); break;
-	}
-	onVRangeChanged();
-
-	updateMinMaxEntries();
-
-	_vRangeBox.pack_start(_vRangeMinLabel);
-	_vRangeBox.pack_start(_vRangeMinEntry);
-	
-	_vRangeBox.pack_start(_vRangeMaxLabel);
-	_vRangeBox.pack_start(_vRangeMaxEntry);
-	
-	_framesHBox.pack_start(_vRangeFrame);
-}
-
-void PlotPropertiesWindow::initHRangeWidgets()
-{
-}
-
-void PlotPropertiesWindow::initOptionsWidgets()
-{
-	Gtk::RadioButton::Group group;
-	
-	_optionsBox.pack_start(_normalOptionsButton);
-	_normalOptionsButton.set_group(group);
-
-	_optionsBox.pack_start(_logScaleButton);
-	_logScaleButton.set_group(group);
-
-	_optionsBox.pack_start(_zeroSymmetricButton);
-	_zeroSymmetricButton.set_group(group);
-	
-	if(_plot.LogarithmicYAxis())
-		_logScaleButton.set_active(true);
-	else
-		_normalOptionsButton.set_active(true);
-
-	_optionsFrame.add(_optionsBox);
-	
-	_framesHBox.pack_start(_optionsFrame);
-}
-
-void PlotPropertiesWindow::updateMinMaxEntries()
-{
-	std::stringstream minStr;
-	minStr << _plot.MinY();
-	_vRangeMinEntry.set_text(minStr.str());
-	
-	std::stringstream maxStr;
-	maxStr << _plot.MaxY();
-	_vRangeMaxEntry.set_text(maxStr.str());
-}
-
-void PlotPropertiesWindow::onApplyClicked()
-{
-	if(_minMaxVRangeButton.get_active())
-		_plot.SetVRangeDetermination(Plot2D::MinMaxRange);
-	else if(_winsorizedVRangeButton.get_active())
-		_plot.SetVRangeDetermination(Plot2D::WinsorizedRange);
-	else if(_specifiedVRangeButton.get_active())
-	{
-		_plot.SetVRangeDetermination(Plot2D::SpecifiedRange);
-		_plot.SetMinY(atof(_vRangeMinEntry.get_text().c_str()));
-		_plot.SetMaxY(atof(_vRangeMaxEntry.get_text().c_str()));
-	}
-	
-	if(_normalOptionsButton.get_active())
-		_plot.SetLogarithmicYAxis(false);
-	else if(_logScaleButton.get_active())
-		_plot.SetLogarithmicYAxis(true);
-	
-	_plot.SetShowAxes(_showAxes.get_active());
-	_plot.SetShowAxisDescriptions(_showAxisDescriptionsButton.get_active());
-	
-	if(OnChangesApplied)
-		OnChangesApplied();
-	
-	updateMinMaxEntries();
-}
-
-void PlotPropertiesWindow::onCloseClicked()
-{
-	hide();
-}
-
-void PlotPropertiesWindow::onExportClicked()
-{
-	Gtk::FileChooserDialog dialog("Specify image filename", Gtk::FILE_CHOOSER_ACTION_SAVE);
-	dialog.set_transient_for(*this);
-
-	//Add response buttons the the dialog:
-	dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
-	dialog.add_button("Save", Gtk::RESPONSE_OK);
-
-	Gtk::FileFilter pdfFilter;
-	std::string pdfName = "Portable Document Format (*.pdf)";
-	pdfFilter.set_name(pdfName);
-	pdfFilter.add_pattern("*.pdf");
-	pdfFilter.add_mime_type("application/pdf");
-	dialog.add_filter(pdfFilter);
-
-	Gtk::FileFilter svgFilter;
-	std::string svgName = "Scalable Vector Graphics (*.svg)";
-	svgFilter.set_name(svgName);
-	svgFilter.add_pattern("*.svg");
-	svgFilter.add_mime_type("image/svg+xml");
-	dialog.add_filter(svgFilter);
-
-	Gtk::FileFilter pngFilter;
-	std::string pngName = "Portable Network Graphics (*.png)";
-	pngFilter.set_name(pngName);
-	pngFilter.add_pattern("*.png");
-	pngFilter.add_mime_type("image/png");
-	dialog.add_filter(pngFilter);
-
-	int result = dialog.run();
-
-	if(result == Gtk::RESPONSE_OK)
-	{
-		const Gtk::FileFilter *filter = dialog.get_filter();
-		if(filter->get_name() == pdfName)
-			_plot.SavePdf(dialog.get_filename());
-		else if(filter->get_name() == svgName)
-			_plot.SaveSvg(dialog.get_filename());
-		else
-			_plot.SavePng(dialog.get_filename());
-	}
-}
diff --git a/CEP/DP3/AOFlagger/src/gui/plot/plotwidget.cpp b/CEP/DP3/AOFlagger/src/gui/plot/plotwidget.cpp
deleted file mode 100644
index 70b2a98fa8e75c012935debf1f99de33ff2933e1..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/gui/plot/plotwidget.cpp
+++ /dev/null
@@ -1,21 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <AOFlagger/gui/plot/plotwidget.h>
-
diff --git a/CEP/DP3/AOFlagger/src/gui/plot/verticalplotscale.cpp b/CEP/DP3/AOFlagger/src/gui/plot/verticalplotscale.cpp
deleted file mode 100644
index 778c6912de1dcabe54a829ed309822a14566d9ea..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/gui/plot/verticalplotscale.cpp
+++ /dev/null
@@ -1,166 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <AOFlagger/gui/plot/verticalplotscale.h>
-
-VerticalPlotScale::VerticalPlotScale()
-	: _plotWidth(0), _plotHeight(0), _metricsAreInitialized(false), _tickSet(0), _isLogarithmic(false), _drawWithDescription(true), _unitsCaption("y"), _descriptionFontSize(14), _tickValuesFontSize(14)
-{
-}
-
-VerticalPlotScale::~VerticalPlotScale()
-{
-	if(_tickSet != 0)
-		delete _tickSet;
-}
-
-double VerticalPlotScale::GetTextHeight(Cairo::RefPtr<Cairo::Context> cairo)
-{
-	Cairo::TextExtents extents;
-	cairo->get_text_extents("M", extents);
-	return extents.height;
-}
-
-void VerticalPlotScale::Draw(Cairo::RefPtr<Cairo::Context> cairo, double offsetX, double offsetY)
-{
-	initializeMetrics(cairo);
-	cairo->set_source_rgb(0.0, 0.0, 0.0);
-	cairo->set_font_size(_tickValuesFontSize);
-	for(unsigned i=0;i!=_tickSet->Size();++i)
-	{
-		const Tick tick = _tickSet->GetTick(i);
-		double y = getTickYPosition(tick);
-		cairo->move_to(_width - 3 + offsetX, y);
-		cairo->line_to(_width + offsetX, y);
-		Cairo::TextExtents extents;
-		cairo->get_text_extents(tick.second, extents);
-		cairo->move_to(_width - extents.width - 8 + offsetX,
-										y - extents.height/2  - extents.y_bearing + offsetY);
-		cairo->show_text(tick.second);
-	}
-	cairo->stroke();
-	
-	if(_drawWithDescription)
-		drawUnits(cairo, offsetX, offsetY);
-}
-
-void VerticalPlotScale::drawUnits(Cairo::RefPtr<Cairo::Context> cairo, double offsetX, double offsetY)
-{
-	cairo->save();
-	cairo->set_font_size(_descriptionFontSize);
-	Cairo::TextExtents extents;
-	cairo->get_text_extents(_unitsCaption, extents);
-	cairo->translate(offsetX - extents.y_bearing + 2,
-								 offsetY + 0.7 * _plotHeight + _topMargin);
-	cairo->rotate(M_PI * 1.5);
-	cairo->move_to(0.0, 0.0);
-	cairo->show_text(_unitsCaption);
-	cairo->stroke();
-	cairo->restore();
-
-	// Base of arrow
-	cairo->move_to(offsetX + extents.height/2.0 + 2, offsetY + _topMargin + _plotHeight * 0.9);
-	cairo->line_to(offsetX + extents.height/2.0 + 2, offsetY + _topMargin + _plotHeight * 0.725);
-	cairo->stroke();
-
-	// The arrow
-	cairo->move_to(offsetX + extents.height/2.0 + 2, offsetY + _topMargin + _plotHeight * 0.725);
-	cairo->line_to(offsetX + 0.1*extents.height + 2, offsetY + _topMargin + _plotHeight * 0.75);
-	cairo->line_to(offsetX + 0.5*extents.height + 2, offsetY + _topMargin + _plotHeight * 0.74);
-	cairo->line_to(offsetX + 0.9*extents.height + 2, offsetY + _topMargin + _plotHeight * 0.75);
-	cairo->close_path();
-	cairo->fill();
-}
-
-void VerticalPlotScale::initializeMetrics(Cairo::RefPtr<Cairo::Context> cairo)
-{
-	if(!_metricsAreInitialized)
-	{
-		if(_tickSet != 0)
-		{
-			_tickSet->Reset();
-			while(!ticksFit(cairo) && _tickSet->Size() > 2)
-			{
-				_tickSet->DecreaseTicks();
-			}
-			cairo->set_font_size(_tickValuesFontSize);
-			double maxWidth = 0;
-			for(unsigned i=0;i!=_tickSet->Size();++i)
-			{
-				Tick tick = _tickSet->GetTick(i);
-				Cairo::TextExtents extents;
-				cairo->get_text_extents(tick.second, extents);
-				if(maxWidth < extents.width)
-					maxWidth = extents.width;
-			}
-			_width = maxWidth + 10;
-			if(_drawWithDescription)
-			{
-				cairo->set_font_size(_descriptionFontSize);
-				Cairo::TextExtents extents;
-				cairo->get_text_extents(_unitsCaption, extents);
-				_width += extents.height;
-			}
-			_metricsAreInitialized = true;
-		}
-	}
-} 
-
-void VerticalPlotScale::InitializeNumericTicks(double min, double max)
-{
-	if(_tickSet == 0)
-		delete _tickSet;
-	_tickSet = new NumericTickSet(min, max, 25);
-	_isLogarithmic = false;
-	_metricsAreInitialized = false;
-}
-
-void VerticalPlotScale::InitializeLogarithmicTicks(double min, double max)
-{
-	if(_tickSet == 0)
-		delete _tickSet;
-	_tickSet = new LogarithmicTickSet(min, max, 25);
-	_isLogarithmic = true;
-	_metricsAreInitialized = false;
-}
-
-double VerticalPlotScale::getTickYPosition(const Tick &tick)
-{
-	return (1.0-tick.first) * _plotHeight + _topMargin;
-}
-
-bool VerticalPlotScale::ticksFit(Cairo::RefPtr<Cairo::Context> cairo)
-{
-	cairo->set_font_size(16.0);
-	double prevTopY = _plotHeight*2.0;
-	for(unsigned i=0;i!=_tickSet->Size();++i)
-	{
-		const Tick tick = _tickSet->GetTick(i);
-		Cairo::TextExtents extents;
-		cairo->get_text_extents(tick.second, extents);
-		// we want a distance of at least one x height between the text, hence height
-		const double
-			bottomY = getTickYPosition(tick) + extents.height,
-			topY = bottomY - extents.height*2;
-		if(bottomY > prevTopY)
-			return false;
-		prevTopY = topY;
-	}
-	return true;
-}
diff --git a/CEP/DP3/AOFlagger/src/gui/plotframe.cpp b/CEP/DP3/AOFlagger/src/gui/plotframe.cpp
deleted file mode 100644
index 26b086d318aa8c6a555bec129990cfcf8f50da41..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/gui/plotframe.cpp
+++ /dev/null
@@ -1,105 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <limits>
-
-#include <AOFlagger/gui/plot/plot2d.h>
-
-#include <AOFlagger/gui/plotframe.h>
-
-PlotFrame::PlotFrame() : _plotData(0), _selectedXStart(0), _selectedYStart(0), _selectedXEnd(0), _selectedYEnd(0)
-{
-	pack_start(_plot);
-	_plot.show();
-}
-
-PlotFrame::~PlotFrame()
-{
-	if(_plotData != 0)
-		delete _plotData;
-}
-
-void PlotFrame::plot()
-{
-	_plot.Clear();
-	if(_plotData != 0)
-		delete _plotData;
-	_plotData = new Plot2D();
-
-	bool drawn = false;
-	if(_data.HasXX()) {
-		plotTimeGraph(_data, "XX", XXPolarisation);
-		drawn = true;
-	}
-	if(_data.HasXY()) {
-		plotTimeGraph(_data, "XY", XYPolarisation);
-		drawn = true;
-	}
-	if(_data.HasYX()) {
-		plotTimeGraph(_data, "YX", YXPolarisation);
-		drawn = true;
-	}
-	if(_data.HasYY()) {
-		plotTimeGraph(_data, "YY", YYPolarisation);
-		drawn = true;
-	}
-
-	if(_data.Polarisation() == StokesIPolarisation)
-	{
-		plotTimeGraph(_data, "Stokes I");
-		drawn = true;
-	} else if(!drawn) {
-		plotTimeGraph(_data, "Data");
-	}
-
-	_plot.SetPlot(*_plotData);
-}
-
-void PlotFrame::plotTimeGraph(const TimeFrequencyData &data, const std::string &label, enum PolarisationType polarisation)
-{
-	TimeFrequencyData *convertedData = data.CreateTFData(polarisation);
-	plotTimeGraph(*convertedData, label);
-	delete convertedData;
-}
-
-void PlotFrame::plotTimeGraph(const TimeFrequencyData &data, const std::string &label)
-{
-	_plotData->StartLine(label);
-	Image2DCPtr image = data.GetSingleImage();
-	Mask2DCPtr mask = data.GetSingleMask();
-
-	for(size_t x=0;x<image->Width();++x)
-	{
-		size_t count = 0;
-		num_t value = 0.0;
-
-		for(size_t y=_selectedYStart;y<_selectedYEnd;++y)
-		{
-			if(!mask->Value(x, y))
-			{
-				++count;
-				value += image->Value(x, y);
-			}
-		}
-		if(count > 0)
-			_plotData->PushDataPoint(x, value / (num_t) count);
-		else
-			_plotData->PushDataPoint(x, std::numeric_limits<num_t>::quiet_NaN());
-	}
-}
diff --git a/CEP/DP3/AOFlagger/src/gui/progresswindow.cpp b/CEP/DP3/AOFlagger/src/gui/progresswindow.cpp
deleted file mode 100644
index 623ab1d8825d16886b9351aed54756ac9568f009..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/gui/progresswindow.cpp
+++ /dev/null
@@ -1,179 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <AOFlagger/gui/progresswindow.h>
-
-#include <iostream>
-
-#include <boost/date_time/posix_time/posix_time.hpp>
-
-#include <gtkmm/messagedialog.h>
-
-#include <AOFlagger/gui/mswindow.h>
-
-ProgressWindow::ProgressWindow(class MSWindow &parentWindow) :
-	_currentTaskTitleLabel("Current task:"),
-	_currentTaskLabel("-"),
-	_timeElapsedTitleLabel("Time elapsed:"),
-	_timeElapsedLabel("-"),
-	_timeEstimatedTitleLabel("Estimated time:"),
-	_timeEstimatedLabel("-"),
-	_started(false),
-	_exceptionOccured(false),
-	_parentWindow(parentWindow),
-	_progress(0.0)
-{
-	set_default_size(400, 300);
-
-	_topBox.pack_start(_currentTaskTitleLabel);
-	_currentTaskTitleLabel.show();
-
-	_topBox.pack_start(_currentTaskLabel);
-	_currentTaskLabel.show();
-
-	_topBox.pack_start(_timeElapsedTitleLabel);
-	_timeElapsedTitleLabel.show();
-
-	_topBox.pack_start(_timeElapsedLabel);
-	_timeElapsedLabel.show();
-
-	_topBox.pack_start(_timeEstimatedTitleLabel);
-	_timeEstimatedTitleLabel.show();
-
-	_topBox.pack_start(_timeEstimatedLabel);
-	_timeEstimatedLabel.show();
-
-	_topBox.pack_start(_progressBar);
-	_progressBar.show();
-
-	add(_topBox);
-	_topBox.show();
-
-	_progressChangeSignal.connect(sigc::mem_fun(*this, &ProgressWindow::UpdateProgress));
-}
-
-
-ProgressWindow::~ProgressWindow()
-{
-}
-
-void ProgressWindow::UpdateProgress()
-{
-	if(!_started)
-	{
-		_startTime = boost::posix_time::microsec_clock::local_time();
-		_started = true;
-	}
-
-	boost::mutex::scoped_lock lock(_mutex);
-
-	if(_exceptionOccured)
-	{
-		_exceptionOccured = false;
-		Gtk::MessageDialog dialog(*this, std::string("An exception was thrown of type '") + _exceptionType + ("': ") + _exceptionDescription, false, Gtk::MESSAGE_ERROR);
-		dialog.run();
-	}
-
-	if(_tasks.size() == 0)
-	{
-		// The task has completed
-
-		lock.unlock();
-
-		_currentTaskLabel.set_text("-");
-		_timeEstimatedLabel.set_text("-");
-		_progressBar.set_fraction(1.0);
-		_parentWindow.onExecuteStrategyFinished();
-	} else
-	{
-		std::vector<std::string>::const_iterator taskDesc =_tasks.begin();
-		std::stringstream str;
-		str << *taskDesc;
-		++taskDesc;
-		for(;taskDesc!=_tasks.end();++taskDesc)
-			str << "->\n  " << *taskDesc;
-	
-		double progress = _progress;
-		lock.unlock();
-
-		_currentTaskLabel.set_text(str.str());
-		_progressBar.set_fraction(progress);
-
-		if(progress > 0.0)
-		{
-			std::stringstream estimatedTimeStr;
-			boost::posix_time::time_duration estimated =
-				(boost::posix_time::microsec_clock::local_time() - _startTime) * (int) (1000000.0*(1.0-progress))/(int) (1000000.0*progress);
-			estimated = boost::posix_time::seconds(estimated.total_seconds());
-			estimatedTimeStr << estimated;
-			_timeEstimatedLabel.set_text(estimatedTimeStr.str());
-		}
-	}
-
-	std::stringstream timeStr;
-	timeStr << (boost::posix_time::microsec_clock::local_time() - _startTime);
-	_timeElapsedLabel.set_text(timeStr.str());
-}
-
-void ProgressWindow::OnStartTask(const rfiStrategy::Action &action, size_t taskNo, size_t taskCount, const std::string &description, size_t weight)
-{
-  boost::mutex::scoped_lock lock(_mutex);
-	ProgressListener::OnStartTask(action, taskNo, taskCount, description, weight);
-	std::stringstream str;
-	str << "[" << taskNo << "/" << taskCount << "] " << description;
-	_tasks.push_back(str.str());
-	_ratios.push_back(Ratio(taskNo, taskCount));
-	_progress = TotalProgress();
-	lock.unlock();
-
-	_progressChangeSignal();
-}
-
-void ProgressWindow::OnEndTask(const rfiStrategy::Action &action)
-{
-  boost::mutex::scoped_lock lock(_mutex);
-	_tasks.pop_back();
-	_ratios.pop_back();
-	_progress = TotalProgress();
-	ProgressListener::OnEndTask(action);
-	lock.unlock();
-
-	_progressChangeSignal();
-}
-
-void ProgressWindow::OnProgress(const rfiStrategy::Action &action, size_t progress, size_t maxProgress)
-{
-  boost::mutex::scoped_lock lock(_mutex);
-	ProgressListener::OnProgress(action, progress, maxProgress);
-	_progress = TotalProgress();
-	lock.unlock();
-
-	_progressChangeSignal();
-}
-
-void ProgressWindow::OnException(const rfiStrategy::Action &, std::exception &thrownException)
-{
-  boost::mutex::scoped_lock lock(_mutex);
-	_exceptionOccured = true;
-	_exceptionDescription = thrownException.what();
-	_exceptionType = typeid(thrownException).name();
-	lock.unlock();
-	_progressChangeSignal();
-}
-
diff --git a/CEP/DP3/AOFlagger/src/gui/quality/aoqplotwindow.cpp b/CEP/DP3/AOFlagger/src/gui/quality/aoqplotwindow.cpp
deleted file mode 100644
index 2c1c8edbaf8e0eebb481d0ba886cfbd80833bc81..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/gui/quality/aoqplotwindow.cpp
+++ /dev/null
@@ -1,212 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2011 by A.R. Offringa                                   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#include <AOFlagger/gui/quality/aoqplotwindow.h>
-
-#include <limits>
-
-#include <gtkmm/main.h>
-#include <gtkmm/messagedialog.h>
-
-#include <AOFlagger/msio/measurementset.h>
-
-#include <AOFlagger/quality/histogramtablesformatter.h>
-#include <AOFlagger/quality/histogramcollection.h>
-#include <AOFlagger/quality/statisticscollection.h>
-
-#include <AOFlagger/remote/clusteredobservation.h>
-#include <AOFlagger/remote/processcommander.h>
-
-AOQPlotWindow::AOQPlotWindow() :
-	_isOpen(false)
-{
-	_notebook.append_page(_baselinePlotPage, "Baselines");
-	_baselinePlotPage.show();
-	_baselinePlotPage.SignalStatusChange().connect(sigc::mem_fun(*this, &AOQPlotWindow::onStatusChange));
-	
-	_notebook.append_page(_antennaePlotPage, "Antennae");
-	_antennaePlotPage.show();
-	
-	_notebook.append_page(_bLengthPlotPage, "Baselines length");
-	_bLengthPlotPage.show();
-	
-	_notebook.append_page(_timePlotPage, "Time");
-	_timePlotPage.show();
-	
-	_notebook.append_page(_frequencyPlotPage, "Frequency");
-	_frequencyPlotPage.show();
-	
-	_notebook.append_page(_timeFrequencyPlotPage, "Time-frequency");
-	_timeFrequencyPlotPage.show();
-	_timeFrequencyPlotPage.SignalStatusChange().connect(sigc::mem_fun(*this, &AOQPlotWindow::onStatusChange));
-	//_timeFrequencyPlotPage.set_sensitive(false);
-	
-	_notebook.append_page(_summaryPage, "Summary");
-	_summaryPage.show();
-	
-	_notebook.append_page(_histogramPage, "Histograms");
-	
-	_vBox.pack_start(_notebook);
-	_notebook.signal_switch_page().connect(sigc::mem_fun(*this, &AOQPlotWindow::onSwitchPage));
-	_notebook.show();
-	
-	_vBox.pack_end(_statusBar, Gtk::PACK_SHRINK);
-	_statusBar.push("Quality plot util is ready. Author: André Offringa (offringa@astro.rug.nl)");
-	_statusBar.show();
-	
-	add(_vBox);
-	_vBox.show();
-	
-	_openOptionsWindow.SignalOpen().connect(sigc::mem_fun(*this, &AOQPlotWindow::onOpenOptionsSelected));
-	signal_hide().connect(sigc::mem_fun(*this, &AOQPlotWindow::onHide));
-}
-
-void AOQPlotWindow::Open(const std::string &filename)
-{
-	_openOptionsWindow.ShowForFile(filename);
-}
-
-void AOQPlotWindow::onOpenOptionsSelected(std::string filename, bool downsampleTime, bool downsampleFreq, size_t timeCount, size_t freqCount, bool correctHistograms)
-{
-	_filename = filename;
-	readStatistics(downsampleTime, downsampleFreq, timeCount, freqCount, correctHistograms);
-	_baselinePlotPage.SetStatistics(_statCollection, _antennas);
-	_antennaePlotPage.SetStatistics(_statCollection, _antennas);
-	_bLengthPlotPage.SetStatistics(_statCollection, _antennas);
-	_timePlotPage.SetStatistics(_statCollection, _antennas);
-	_frequencyPlotPage.SetStatistics(_statCollection, _antennas);
-	_timeFrequencyPlotPage.SetStatistics(_fullStats);
-	_summaryPage.SetStatistics(_statCollection);
-	if(_histogramPage.is_visible())
-		_histogramPage.SetStatistics(*_histCollection);
-	show();
-}
-
-void AOQPlotWindow::close()
-{
-	if(_isOpen)
-	{
-		_baselinePlotPage.CloseStatistics();
-		_antennaePlotPage.CloseStatistics();
-		_bLengthPlotPage.CloseStatistics();
-		_timePlotPage.CloseStatistics();
-		_frequencyPlotPage.CloseStatistics();
-		_timeFrequencyPlotPage.CloseStatistics();
-		_summaryPage.CloseStatistics();
-		_histogramPage.CloseStatistics();
-		delete _statCollection;
-		delete _histCollection;
-		delete _fullStats;
-		_isOpen = false;
-	}
-}
-
-void AOQPlotWindow::readStatistics(bool downsampleTime, bool downsampleFreq, size_t timeSize, size_t freqSize, bool correctHistograms)
-{
-	close();
-	
-	if(aoRemote::ClusteredObservation::IsClusteredFilename(_filename))
-	{
-		aoRemote::ClusteredObservation *observation = aoRemote::ClusteredObservation::Load(_filename);
-		_statCollection = new StatisticsCollection();
-		_histCollection = new HistogramCollection();
-		aoRemote::ProcessCommander commander(*observation);
-		commander.PushReadAntennaTablesTask();
-		commander.PushReadQualityTablesTask(_statCollection, _histCollection, correctHistograms);
-		commander.Run();
-		if(!commander.Errors().empty())
-		{
-			std::stringstream s;
-			s << commander.Errors().size() << " error(s) occured while querying the nodes or measurement sets in the given observation. This might be caused by a failing node, an unreadable measurement set, or maybe the quality tables are not available. The errors reported are:\n\n";
-			size_t count = 0;
-			for(std::vector<std::string>::const_iterator i=commander.Errors().begin();i!=commander.Errors().end() && count < 30;++i)
-			{
-				s << "- " << *i << '\n';
-				++count;
-			}
-			if(commander.Errors().size() > 30)
-			{
-				s << "... and " << (commander.Errors().size()-30) << " more.\n";
-			}
-			s << "\nThe program will continue, but this might mean that the statistics are incomplete. If this is the case, fix the issues and reopen the observation.";
-			std::cerr << s.str() << std::endl;
-			Gtk::MessageDialog dialog(*this, s.str(), false, Gtk::MESSAGE_ERROR);
-			dialog.run();
-		}
-		
-		_antennas = commander.Antennas();
-		
-		delete observation;
-	}
-	else {
-		MeasurementSet *ms = new MeasurementSet(_filename);
-		const unsigned polarizationCount = ms->GetPolarizationCount();
-		unsigned antennaCount = ms->AntennaCount();
-		_antennas.clear();
-		for(unsigned a=0;a<antennaCount;++a)
-			_antennas.push_back(ms->GetAntennaInfo(a));
-		delete ms;
-
-		QualityTablesFormatter qualityTables(_filename);
-		_statCollection = new StatisticsCollection(polarizationCount);
-		_statCollection->Load(qualityTables);
-		
-		HistogramTablesFormatter histogramTables(_filename);
-		_histCollection = new HistogramCollection(polarizationCount);
-		if(histogramTables.HistogramsExist())
-		{
-			_histCollection->Load(histogramTables);
-		}
-	}
-	setShowHistograms(!_histCollection->Empty());
-	if(downsampleTime)
-	{
-		std::cout << "Lowering time resolution..." << std::endl;
-		_statCollection->LowerTimeResolution(timeSize);
-	}
-
-	if(downsampleFreq)
-	{
-		std::cout << "Lowering frequency resolution..." << std::endl;
-		_statCollection->LowerFrequencyResolution(freqSize);
-	}
-
-	std::cout << "Integrating baseline statistics to one channel..." << std::endl;
-	_statCollection->IntegrateBaselinesToOneChannel();
-	
-	std::cout << "Regridding time statistics..." << std::endl;
-	_statCollection->RegridTime();
-	
-	std::cout << "Copying statistics..." << std::endl;
-	_fullStats = new StatisticsCollection(*_statCollection);
-	
-	std::cout << "Integrating time statistics to one channel..." << std::endl;
-	_statCollection->IntegrateTimeToOneChannel();
-	
-	std::cout << "Opening statistics panel..." << std::endl;
-	_isOpen = true;
-}
-
-void AOQPlotWindow::onStatusChange(const std::string &newStatus)
-{
-	_statusBar.pop();
-	_statusBar.push(newStatus);
-}
-
diff --git a/CEP/DP3/AOFlagger/src/gui/quality/baselineplotpage.cpp b/CEP/DP3/AOFlagger/src/gui/quality/baselineplotpage.cpp
deleted file mode 100644
index c2e7b448422abb353255a18bf60ec0d2091f1b4f..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/gui/quality/baselineplotpage.cpp
+++ /dev/null
@@ -1,123 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2011 by A.R. Offringa                                   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#include <limits>
-
-#include <AOFlagger/gui/quality/baselineplotpage.h>
-
-#include <AOFlagger/quality/statisticscollection.h>
-#include <AOFlagger/quality/statisticsderivator.h>
-
-BaselinePlotPage::BaselinePlotPage() :
-	_statCollection(0),
-	_antennas(0)
-{
-	GrayScaleWidget().OnMouseMovedEvent().connect(sigc::mem_fun(*this, &BaselinePlotPage::onMouseMoved));
-	GrayScaleWidget().SetXAxisDescription("Antenna 1 index");
-	GrayScaleWidget().SetYAxisDescription("Antenna 2 index");
-}
-
-BaselinePlotPage::~BaselinePlotPage()
-{
-}
-
-std::pair<TimeFrequencyData, TimeFrequencyMetaDataCPtr> BaselinePlotPage::ConstructImage()
-{
-	if(HasStatistics())
-	{
-		const QualityTablesFormatter::StatisticKind kind = GetSelectedStatisticKind();
-		
-		const unsigned polarizationCount = _statCollection->PolarizationCount();
-		std::vector<std::pair<unsigned, unsigned> > baselines = _statCollection->BaselineStatistics().BaselineList();
-		StatisticsDerivator derivator(*_statCollection);
-		
-		const unsigned antennaCount = _statCollection->BaselineStatistics().AntennaCount();
-
-		Image2DPtr realImages[polarizationCount];
-		Image2DPtr imagImages[polarizationCount];
-		Mask2DPtr mask[polarizationCount];
-		for(unsigned p=0;p<polarizationCount;++p)
-		{
-			realImages[p] = Image2D::CreateUnsetImagePtr(antennaCount, antennaCount);
-			realImages[p]->SetAll(std::numeric_limits<num_t>::quiet_NaN());
-			imagImages[p] = Image2D::CreateUnsetImagePtr(antennaCount, antennaCount);
-			imagImages[p]->SetAll(std::numeric_limits<num_t>::quiet_NaN());
-			mask[p] = Mask2D::CreateSetMaskPtr<true>(antennaCount, antennaCount);
-		}
-		
-		for(std::vector<std::pair<unsigned, unsigned> >::const_iterator i=baselines.begin();i!=baselines.end();++i)
-		{
-			const unsigned antenna1 = i->first, antenna2 = i->second;
-			for(unsigned p=0;p<polarizationCount;++p)
-			{
-				const std::complex<long double> val = derivator.GetComplexBaselineStatistic(kind, antenna1, antenna2, p);
-				realImages[p]->SetValue(antenna1, antenna2, val.real());
-				imagImages[p]->SetValue(antenna1, antenna2, val.imag());
-				mask[p]->SetValue(antenna1, antenna2, false);
-			}
-		}
-		TimeFrequencyData data;
-		if(polarizationCount == 1)
-		{
-			data = TimeFrequencyData(TimeFrequencyData::ComplexRepresentation, SinglePolarisation, realImages[0], imagImages[0]);
-			data.SetGlobalMask(mask[0]);
-		}
-		else if(polarizationCount == 2)
-		{
-			data = TimeFrequencyData(AutoDipolePolarisation, realImages[0], imagImages[0], realImages[1], imagImages[1]);
-			data.SetIndividualPolarisationMasks(mask[0], mask[1]);
-		}
-		else if(polarizationCount == 4)
-		{
-			data = TimeFrequencyData(realImages[0], imagImages[0], realImages[1], imagImages[1], realImages[2], imagImages[2], realImages[3], imagImages[3]);
-			data.SetIndividualPolarisationMasks(mask[0], mask[1], mask[2], mask[3]);
-		}
-		else {
-			std::stringstream s;
-			s << "Set has not 1, 2 or 4 polarizations (?!?) : StatisticsCollection.PolarizationCount() == " << polarizationCount;
-			throw std::runtime_error(s.str());
-		}
-		return std::pair<TimeFrequencyData, TimeFrequencyMetaDataCPtr>(data, TimeFrequencyMetaDataCPtr());
-	} else {
-		return std::pair<TimeFrequencyData, TimeFrequencyMetaDataCPtr>(TimeFrequencyData(), TimeFrequencyMetaDataCPtr());
-	}
-}
-
-void BaselinePlotPage::onMouseMoved(size_t x, size_t y)
-{
-	std::stringstream text;
-	std::string antenna1Name, antenna2Name;
-	if(_antennas == 0)
-	{
-		std::stringstream a1, a2;
-		a1 << x;
-		a2 << y;
-		antenna1Name = a1.str();
-		antenna2Name = a2.str();
-	} else {
-		antenna1Name = (*_antennas)[x].name;
-		antenna2Name = (*_antennas)[y].name;
-	}
-	const QualityTablesFormatter::StatisticKind kind = GetSelectedStatisticKind();
-	const std::string &kindName = QualityTablesFormatter::KindToName(kind);
-	
-	text << "Correlation " << antenna1Name << " x " << antenna2Name << ", " << kindName << " = " << GrayScaleWidget().Image()->Value(x, y);
-	_signalStatusChange(text.str());
-}
diff --git a/CEP/DP3/AOFlagger/src/gui/quality/datawindow.cpp b/CEP/DP3/AOFlagger/src/gui/quality/datawindow.cpp
deleted file mode 100644
index 84c4bba576e3dde171014bc00517a927ce7b76e4..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/gui/quality/datawindow.cpp
+++ /dev/null
@@ -1,81 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#include <AOFlagger/gui/quality/datawindow.h>
-#include <AOFlagger/gui/plot/plot2d.h>
-
-#include <sstream>
-#include <iomanip>
-
-void DataWindow::SetData(const Plot2D &plot)
-{
-	_plot = &plot;
-	int selectedIndex = _comboBox.get_active_row_number();
-	if(selectedIndex < 0)
-		selectedIndex = 0;
-	_comboListStore->clear();
-	for(size_t i=0;i<plot.PointSetCount();++i)
-	{
-		std::stringstream str;
-		str << (i+1) << ". " << plot.GetPointSet(i).Label();
-		Gtk::TreeModel::Row row = *_comboListStore->append();
-		row[_comboColumnRecord._comboListNameColumn] = str.str();
-	}
-	if(selectedIndex < (int) plot.PointSetCount())
-		_comboBox.set_active(selectedIndex);
-	else if(plot.PointSetCount() > 0)
-		_comboBox.set_active(0);
-	onComboChange();
-}
-
-void DataWindow::onComboChange()
-{
-	int active = _comboBox.get_active_row_number();
-	if(active >= 0)
-		loadData(active);
-	else
-		loadData(_plot->PointSetCount());
-}
-
-void DataWindow::loadData(size_t plotSetIndex)
-{
-	std::stringstream _dataStream;
-	_dataStream << std::setprecision(14);
-	if(_plot->PointSetCount() > plotSetIndex)
-	{
-		const Plot2DPointSet &pointSet = _plot->GetPointSet(plotSetIndex);
-		const size_t valueCount = pointSet.Size();
-		for(size_t i=0; i<valueCount; ++i)
-		{
-			const double
-				x = pointSet.GetX(i),
-				y = pointSet.GetY(i);
-			if(pointSet.HasTickLabels())
-			{
-				std::string label = pointSet.TickLabels()[i];
-				_dataStream << i << '\t' << label << '\t' << y << '\n';
-			}
-			else
-				_dataStream << i << '\t' << x << '\t' << y << '\n';
-		}
-	}
-	SetData(_dataStream.str());
-}
-
diff --git a/CEP/DP3/AOFlagger/src/gui/quality/grayscaleplotpage.cpp b/CEP/DP3/AOFlagger/src/gui/quality/grayscaleplotpage.cpp
deleted file mode 100644
index 4e64966ed691fd7286aedf7eaeb92c164d7159e4..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/gui/quality/grayscaleplotpage.cpp
+++ /dev/null
@@ -1,370 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2011 by A.R. Offringa                                   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#include <limits>
-
-#include <AOFlagger/msio/samplerow.h>
-
-#include <AOFlagger/gui/quality/grayscaleplotpage.h>
-
-#include <AOFlagger/gui/imagepropertieswindow.h>
-
-#include <AOFlagger/quality/statisticscollection.h>
-#include <AOFlagger/quality/statisticsderivator.h>
-
-GrayScalePlotPage::GrayScalePlotPage() :
-	_expander("Side bar"),
-	_statisticKindFrame("Statistic kind"),
-	_countButton("Count"),
-	_meanButton("Mean"),
-	_stdDevButton("StdDev"),
-	_dCountButton("DCount"),
-	_dMeanButton("DMean"),
-	_dStdDevButton("DStdDev"),
-	_rfiPercentageButton("RFIPercentage"),
-	_snrButton("SNR"),
-	_polarizationFrame("Polarization"),
-	_polXXButton("XX"),
-	_polXYButton("XY"),
-	_polYXButton("YX"),
-	_polYYButton("YY"),
-	_polXXandYYButton("XX/2 + YY/2"),
-	_polXYandYXButton("XY/2 + YX/2"),
-	_phaseFrame("Phase"),
-	_amplitudePhaseButton("Amplitude"),
-	_phasePhaseButton("Phase"),
-	_realPhaseButton("Real"),
-	_imaginaryPhaseButton("Imaginary"),
-	_plotFrame("Plot"),
-	_rangeMinMaxButton("Min to max"),
-	_rangeWinsorizedButton("Winsorized"),
-	_rangeSpecified("Specified"),
-	_logarithmicScaleButton("Logarithmic"),
-	_normalizeXAxisButton("Normalize X"),
-	_normalizeYAxisButton("Normalize Y"),
-	_meanNormButton("Mean"),
-	_winsorNormButton("Winsor"),
-	_medianNormButton("Median"),
-	_plotPropertiesButton("Properties..."),
-	_selectStatisticKind(QualityTablesFormatter::VarianceStatistic),
-	_ready(false),
-	_imagePropertiesWindow(0)
-{
-	initStatisticKinds();
-	initPolarizations();
-	initPhaseButtons();
-	initPlotOptions();
-	
-	_expander.add(_sideBox);
-	pack_start(_expander, Gtk::PACK_SHRINK);
-	
-	_imageWidget.SetCairoFilter(Cairo::FILTER_NEAREST);
-	_imageWidget.SetColorMap(ImageWidget::HotColdMap);
-	_imageWidget.SetRange(ImageWidget::MinMax);
-	_imageWidget.SetScaleOption(ImageWidget::LogScale);
-	_imageWidget.SetZAxisDescription("Statistical value");
-	_imageWidget.SetManualZAxisDescription(true);
-	_imageWidget.set_size_request(300, 300);
-	
-	pack_start(_imageWidget);
-	
-	show_all_children();
-	
-	_ready = true;
-}
-
-GrayScalePlotPage::~GrayScalePlotPage()
-{
-	if(_imagePropertiesWindow != 0)
-		delete _imagePropertiesWindow;
-}
-
-void GrayScalePlotPage::initStatisticKinds()
-{
-	Gtk::RadioButtonGroup statGroup;
-	_countButton.set_group(statGroup);
-	_countButton.signal_clicked().connect(sigc::mem_fun(*this, &GrayScalePlotPage::onSelectCount));
-	_statisticKindBox.pack_start(_countButton, Gtk::PACK_SHRINK);
-	
-	_meanButton.set_group(statGroup);
-	_meanButton.signal_clicked().connect(sigc::mem_fun(*this, &GrayScalePlotPage::onSelectMean));
-	_statisticKindBox.pack_start(_meanButton, Gtk::PACK_SHRINK);
-	
-	_stdDevButton.set_group(statGroup);
-	_stdDevButton.signal_clicked().connect(sigc::mem_fun(*this, &GrayScalePlotPage::onSelectStdDev));
-	_statisticKindBox.pack_start(_stdDevButton, Gtk::PACK_SHRINK);
-	
-	_dCountButton.set_group(statGroup);
-	_dCountButton.signal_clicked().connect(sigc::mem_fun(*this, &GrayScalePlotPage::onSelectDCount));
-	_statisticKindBox.pack_start(_dCountButton, Gtk::PACK_SHRINK);
-	
-	_dMeanButton.set_group(statGroup);
-	_dMeanButton.signal_clicked().connect(sigc::mem_fun(*this, &GrayScalePlotPage::onSelectDMean));
-	_statisticKindBox.pack_start(_dMeanButton, Gtk::PACK_SHRINK);
-	
-	_dStdDevButton.set_group(statGroup);
-	_dStdDevButton.signal_clicked().connect(sigc::mem_fun(*this, &GrayScalePlotPage::onSelectDStdDev));
-	_statisticKindBox.pack_start(_dStdDevButton, Gtk::PACK_SHRINK);
-	
-	_rfiPercentageButton.set_group(statGroup);
-	_rfiPercentageButton.signal_clicked().connect(sigc::mem_fun(*this, &GrayScalePlotPage::onSelectRFIPercentage));
-	_statisticKindBox.pack_start(_rfiPercentageButton, Gtk::PACK_SHRINK);
-	
-	_snrButton.set_group(statGroup);
-	_snrButton.signal_clicked().connect(sigc::mem_fun(*this, &GrayScalePlotPage::onSelectSNR));
-	_statisticKindBox.pack_start(_snrButton, Gtk::PACK_SHRINK);
-	
-	_stdDevButton.set_active();
-	
-	_statisticKindFrame.add(_statisticKindBox);
-	
-	_sideBox.pack_start(_statisticKindFrame, Gtk::PACK_SHRINK);
-}
-
-void GrayScalePlotPage::initPolarizations()
-{
-	Gtk::RadioButtonGroup polGroup;
-	_polXXButton.set_group(polGroup);
-	_polXXButton.signal_clicked().connect(sigc::mem_fun(*this, &GrayScalePlotPage::UpdateImage));
-	_polarizationBox.pack_start(_polXXButton, Gtk::PACK_SHRINK);
-	
-	_polXYButton.set_group(polGroup);
-	_polXYButton.signal_clicked().connect(sigc::mem_fun(*this, &GrayScalePlotPage::UpdateImage));
-	_polarizationBox.pack_start(_polXYButton, Gtk::PACK_SHRINK);
-
-	_polYXButton.set_group(polGroup);
-	_polYXButton.signal_clicked().connect(sigc::mem_fun(*this, &GrayScalePlotPage::UpdateImage));
-	_polarizationBox.pack_start(_polYXButton, Gtk::PACK_SHRINK);
-
-	_polYYButton.set_group(polGroup);
-	_polYYButton.signal_clicked().connect(sigc::mem_fun(*this, &GrayScalePlotPage::UpdateImage));
-	_polarizationBox.pack_start(_polYYButton, Gtk::PACK_SHRINK);
-
-	_polXXandYYButton.set_group(polGroup);
-	_polXXandYYButton.signal_clicked().connect(sigc::mem_fun(*this, &GrayScalePlotPage::UpdateImage));
-	_polarizationBox.pack_start(_polXXandYYButton, Gtk::PACK_SHRINK);
-
-	_polXYandYXButton.set_group(polGroup);
-	_polXYandYXButton.signal_clicked().connect(sigc::mem_fun(*this, &GrayScalePlotPage::UpdateImage));
-	_polarizationBox.pack_start(_polXYandYXButton, Gtk::PACK_SHRINK);
-
-	_polXXandYYButton.set_active();
-	
-	_polarizationFrame.add(_polarizationBox);
-	
-	_sideBox.pack_start(_polarizationFrame, Gtk::PACK_SHRINK);
-}
-
-void GrayScalePlotPage::initPhaseButtons()
-{
-	Gtk::RadioButtonGroup phaseGroup;
-	
-	_amplitudePhaseButton.set_group(phaseGroup);
-	_amplitudePhaseButton.signal_clicked().connect(sigc::mem_fun(*this, &GrayScalePlotPage::UpdateImage));
-	_phaseBox.pack_start(_amplitudePhaseButton, Gtk::PACK_SHRINK);
-	
-	_phasePhaseButton.set_group(phaseGroup);
-	_phasePhaseButton.signal_clicked().connect(sigc::mem_fun(*this, &GrayScalePlotPage::UpdateImage));
-	_phaseBox.pack_start(_phasePhaseButton, Gtk::PACK_SHRINK);
-	
-	_realPhaseButton.set_group(phaseGroup);
-	_realPhaseButton.signal_clicked().connect(sigc::mem_fun(*this, &GrayScalePlotPage::UpdateImage));
-	_phaseBox.pack_start(_realPhaseButton, Gtk::PACK_SHRINK);
-	
-	_imaginaryPhaseButton.set_group(phaseGroup);
-	_imaginaryPhaseButton.signal_clicked().connect(sigc::mem_fun(*this, &GrayScalePlotPage::UpdateImage));
-	_phaseBox.pack_start(_imaginaryPhaseButton, Gtk::PACK_SHRINK);
-	
-	_amplitudePhaseButton.set_active();
-	
-	_phaseFrame.add(_phaseBox);
-	
-	_sideBox.pack_start(_phaseFrame, Gtk::PACK_SHRINK);
-}
-
-void GrayScalePlotPage::initPlotOptions()
-{
-	Gtk::RadioButtonGroup rangeGroup;
-	_rangeMinMaxButton.set_group(rangeGroup);
-	_rangeMinMaxButton.signal_clicked().connect(sigc::mem_fun(*this, &GrayScalePlotPage::onSelectMinMaxRange));
-	_plotBox.pack_start(_rangeMinMaxButton, Gtk::PACK_SHRINK);
-
-	_rangeWinsorizedButton.set_group(rangeGroup);
-	_rangeWinsorizedButton.signal_clicked().connect(sigc::mem_fun(*this, &GrayScalePlotPage::onSelectWinsorizedRange));
-	_plotBox.pack_start(_rangeWinsorizedButton, Gtk::PACK_SHRINK);
-
-	_rangeSpecified.set_group(rangeGroup);
-	_rangeSpecified.signal_clicked().connect(sigc::mem_fun(*this, &GrayScalePlotPage::onSelectSpecifiedRange));
-	_plotBox.pack_start(_rangeSpecified, Gtk::PACK_SHRINK);
-	
-	_logarithmicScaleButton.signal_clicked().connect(sigc::mem_fun(*this, &GrayScalePlotPage::onLogarithmicScaleClicked));
-	_plotBox.pack_start(_logarithmicScaleButton, Gtk::PACK_SHRINK);
-	_logarithmicScaleButton.set_active(true);
-	
-	_normalizeXAxisButton.signal_clicked().connect(sigc::mem_fun(*this, &GrayScalePlotPage::onNormalizeAxesButtonClicked));
-	_plotBox.pack_start(_normalizeXAxisButton, Gtk::PACK_SHRINK);
-	
-	_normalizeYAxisButton.signal_clicked().connect(sigc::mem_fun(*this, &GrayScalePlotPage::onNormalizeAxesButtonClicked));
-	_plotBox.pack_start(_normalizeYAxisButton, Gtk::PACK_SHRINK);
-	
-	Gtk::RadioButtonGroup normMethodGroup;
-	_meanNormButton.set_group(normMethodGroup);
-	_meanNormButton.signal_clicked().connect(sigc::mem_fun(*this, &GrayScalePlotPage::onChangeNormMethod));
-	_plotBox.pack_start(_meanNormButton, Gtk::PACK_SHRINK);
-	
-	_winsorNormButton.set_group(normMethodGroup);
-	_winsorNormButton.signal_clicked().connect(sigc::mem_fun(*this, &GrayScalePlotPage::onChangeNormMethod));
-	_plotBox.pack_start(_winsorNormButton, Gtk::PACK_SHRINK);
-	
-	_medianNormButton.set_group(normMethodGroup);
-	_medianNormButton.signal_clicked().connect(sigc::mem_fun(*this, &GrayScalePlotPage::onChangeNormMethod));
-	_plotBox.pack_start(_medianNormButton, Gtk::PACK_SHRINK);
-	
-	_plotPropertiesButton.signal_clicked().connect(sigc::mem_fun(*this, &GrayScalePlotPage::onPropertiesClicked));
-	_plotBox.pack_start(_plotPropertiesButton, Gtk::PACK_SHRINK);
-	
-	_plotFrame.add(_plotBox);
-	
-	_sideBox.pack_start(_plotFrame, Gtk::PACK_SHRINK);
-}
-
-
-void GrayScalePlotPage::UpdateImage()
-{
-	if(_ready)
-	{
-		std::pair<TimeFrequencyData, TimeFrequencyMetaDataCPtr> pair = ConstructImage();
-		TimeFrequencyData &data = pair.first;
-		if(!data.IsEmpty())
-		{
-			setToSelectedPolarization(data);
-			
-			setToSelectedPhase(data);
-			
-			Image2DCPtr image = data.GetSingleImage();
-			if(_normalizeXAxisButton.get_active())
-				image = normalizeXAxis(image);
-			if(_normalizeYAxisButton.get_active())
-				image = normalizeYAxis(image);
-			
-			_imageWidget.SetZAxisDescription(StatisticsDerivator::GetDescWithUnits(GetSelectedStatisticKind()));
-			_imageWidget.SetImage(image);
-			_imageWidget.SetOriginalMask(data.GetSingleMask());
-			if(pair.second != 0)
-				_imageWidget.SetMetaData(pair.second);
-			_imageWidget.Update();
-		}
-	}
-}
-
-void GrayScalePlotPage::setToSelectedPolarization(TimeFrequencyData &data)
-{
-	try {
-		TimeFrequencyData *newData = 0;
-		if(_polXXButton.get_active())
-			newData = data.CreateTFData(XXPolarisation);
-		else if(_polXYButton.get_active())
-			newData = data.CreateTFData(XYPolarisation);
-		else if(_polYXButton.get_active())
-			newData = data.CreateTFData(YXPolarisation);
-		else if(_polYYButton.get_active())
-			newData = data.CreateTFData(YYPolarisation);
-		else if(_polXXandYYButton.get_active())
-		{
-			newData = data.CreateTFData(AutoDipolePolarisation);
-			newData->MultiplyImages(0.5);
-		}
-		else if(_polXYandYXButton.get_active())
-			newData = data.CreateTFData(CrossDipolePolarisation);
-		if(newData != 0)
-		{
-			data = *newData;
-			delete newData;
-		}
-	} catch(std::exception &e)
-	{
-		// probably a conversion error -- polarisation was not available.
-		// Best solution is probably to ignore.
-	}
-}
-
-void GrayScalePlotPage::setToSelectedPhase(TimeFrequencyData &data)
-{
-	TimeFrequencyData *newData = 0;
-	if(_amplitudePhaseButton.get_active())
-		newData = data.CreateTFData(TimeFrequencyData::AmplitudePart);
-	else if(_phasePhaseButton.get_active())
-		newData = data.CreateTFData(TimeFrequencyData::PhasePart);
-	else if(_realPhaseButton.get_active())
-		newData = data.CreateTFData(TimeFrequencyData::RealPart);
-	else if(_imaginaryPhaseButton.get_active())
-		newData = data.CreateTFData(TimeFrequencyData::ImaginaryPart);
-	if(newData != 0)
-	{
-		data = *newData;
-		delete newData;
-	}
-}
-
-Image2DCPtr GrayScalePlotPage::normalizeXAxis(Image2DCPtr input)
-{
-	Image2DPtr output = Image2D::CreateUnsetImagePtr(input->Width(), input->Height());
-	for(size_t x=0;x<input->Width();++x)
-	{
-		SampleRowPtr row = SampleRow::CreateFromColumn(input, x);
-		num_t norm;
-		if(_meanNormButton.get_active())
-			norm = 1.0 / row->MeanWithMissings();
-		else if(_winsorNormButton.get_active())
-			norm = 1.0 / row->WinsorizedMeanWithMissings();
-		else // _medianNormButton
-			norm = 1.0 / row->MedianWithMissings();
-		for(size_t y=0;y<input->Height();++y)
-			output->SetValue(x, y, input->Value(x, y) * norm);
-	}
-	return output;
-}
-
-Image2DCPtr GrayScalePlotPage::normalizeYAxis(Image2DCPtr input)
-{
-	Image2DPtr output = Image2D::CreateUnsetImagePtr(input->Width(), input->Height());
-	for(size_t y=0;y<input->Height();++y)
-	{
-		SampleRowPtr row = SampleRow::CreateFromRow(input, y);
-		num_t norm;
-		if(_meanNormButton.get_active())
-			norm = 1.0 / row->MeanWithMissings();
-		else if(_winsorNormButton.get_active())
-			norm = 1.0 / row->WinsorizedMeanWithMissings();
-		else // _medianNormButton
-			norm = 1.0 / row->MedianWithMissings();
-		for(size_t x=0;x<input->Width();++x)
-			output->SetValue(x, y, input->Value(x, y) * norm);
-	}
-	return output;
-}
-
-void GrayScalePlotPage::onPropertiesClicked()
-{
-	if(_imagePropertiesWindow == 0)
-		_imagePropertiesWindow = new ImagePropertiesWindow(_imageWidget, "Plotting properties");
-	_imagePropertiesWindow->show();
-	_imagePropertiesWindow->raise();
-}
diff --git a/CEP/DP3/AOFlagger/src/gui/quality/histogrampage.cpp b/CEP/DP3/AOFlagger/src/gui/quality/histogrampage.cpp
deleted file mode 100644
index 6341d59745a7562a2543971c6c097819a33b7665..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/gui/quality/histogrampage.cpp
+++ /dev/null
@@ -1,524 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2011 by A.R. Offringa                                   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#include <AOFlagger/gui/quality/histogrampage.h>
-
-#include <boost/bind.hpp>
-
-#include <AOFlagger/gui/plot/plotpropertieswindow.h>
-#include <AOFlagger/gui/quality/datawindow.h>
-
-#include <AOFlagger/quality/histogramtablesformatter.h>
-
-#include <AOFlagger/msio/measurementset.h>
-#include <AOFlagger/quality/histogramcollection.h>
-#include <AOFlagger/quality/rayleighfitter.h>
-
-HistogramPage::HistogramPage() :
-	_expander("Side bar"),
-	_histogramTypeFrame("Histogram"),
-	_totalHistogramButton("Total"),
-	_rfiHistogramButton("RFI"),
-	_notRFIHistogramButton("Not RFI"),
-	_xxPolarizationButton("XX"),
-	_xyPolarizationButton("XY"),
-	_yxPolarizationButton("YX"),
-	_yyPolarizationButton("YY"),
-	_sumPolarizationButton("Sum"),
-	_fitFrame("Fitting"),
-	_fitButton("Fit"),
-	_subtractFitButton("Subtract"),
-	_fitLogarithmicButton("Log fit"),
-	_fitAutoRangeButton("Auto range"),
-	_functionFrame("Function"),
-	_nsButton("N(S)"),
-	_dndsButton("dN(S)/dS"),
-	_deltaSEntry(),
-	_plotPropertiesButton("Properties"),
-	_dataExportButton("Data"),
-	_slopeFrame("Slope"),
-	_drawSlopeButton("Draw"),
-	_drawSlope2Button("Draw2"),
-	_slopeAutoRangeButton("Auto range"),
-	_plotPropertiesWindow(0),
-	_histograms(0),
-	_summedPolarizationHistograms(0)
-	{
-	_histogramTypeBox.pack_start(_totalHistogramButton, Gtk::PACK_SHRINK);
-	_totalHistogramButton.set_active(true);
-	_totalHistogramButton.signal_clicked().connect(sigc::mem_fun(*this, &HistogramPage::updatePlot));
-	_histogramTypeBox.pack_start(_rfiHistogramButton, Gtk::PACK_SHRINK);
-	_rfiHistogramButton.set_active(false);
-	_rfiHistogramButton.signal_clicked().connect(sigc::mem_fun(*this, &HistogramPage::updatePlot));
-	_histogramTypeBox.pack_start(_notRFIHistogramButton, Gtk::PACK_SHRINK);
-	_notRFIHistogramButton.set_active(false);
-	_notRFIHistogramButton.signal_clicked().connect(sigc::mem_fun(*this, &HistogramPage::updatePlot));
-	
-	_histogramTypeFrame.add(_histogramTypeBox);
-	
-	_sideBox.pack_start(_histogramTypeFrame, Gtk::PACK_SHRINK);
-	
-	_polarizationBox.pack_start(_xxPolarizationButton, Gtk::PACK_SHRINK);
-	_xxPolarizationButton.set_active(false);
-	_xxPolarizationButton.signal_clicked().connect(sigc::mem_fun(*this, &HistogramPage::updatePlot));
-	_polarizationBox.pack_start(_xyPolarizationButton, Gtk::PACK_SHRINK);
-	_xyPolarizationButton.set_active(false);
-	_xyPolarizationButton.signal_clicked().connect(sigc::mem_fun(*this, &HistogramPage::updatePlot));
-	_polarizationBox.pack_start(_yxPolarizationButton, Gtk::PACK_SHRINK);
-	_yxPolarizationButton.set_active(false);
-	_yxPolarizationButton.signal_clicked().connect(sigc::mem_fun(*this, &HistogramPage::updatePlot));
-	_polarizationBox.pack_start(_yyPolarizationButton, Gtk::PACK_SHRINK);
-	_yyPolarizationButton.set_active(false);
-	_yyPolarizationButton.signal_clicked().connect(sigc::mem_fun(*this, &HistogramPage::updatePlot));
-	_polarizationBox.pack_start(_sumPolarizationButton, Gtk::PACK_SHRINK);
-	_sumPolarizationButton.set_active(true);
-	_sumPolarizationButton.signal_clicked().connect(sigc::mem_fun(*this, &HistogramPage::updatePlot));
-
-	_polarizationFrame.add(_polarizationBox);
-	
-	_sideBox.pack_start(_polarizationFrame, Gtk::PACK_SHRINK);
-	
-	_fitBox.pack_start(_fitButton, Gtk::PACK_SHRINK);
-	_fitButton.signal_clicked().connect(sigc::mem_fun(*this, &HistogramPage::updatePlot));
-	_fitBox.pack_start(_subtractFitButton, Gtk::PACK_SHRINK);
-	_subtractFitButton.signal_clicked().connect(sigc::mem_fun(*this, &HistogramPage::updatePlot));
-	_fitBox.pack_start(_fitLogarithmicButton, Gtk::PACK_SHRINK);
-	_fitLogarithmicButton.signal_clicked().connect(sigc::mem_fun(*this, &HistogramPage::updatePlot));
-	_fitBox.pack_start(_fitAutoRangeButton, Gtk::PACK_SHRINK);
-	_fitAutoRangeButton.set_active(true);
-	_fitAutoRangeButton.signal_clicked().connect(sigc::mem_fun(*this, &HistogramPage::onAutoRangeClicked));
-	
-	_fitBox.pack_start(_fitStartEntry, Gtk::PACK_SHRINK);
-	_fitStartEntry.set_sensitive(false);
-	_fitStartEntry.signal_activate().connect(sigc::mem_fun(*this, &HistogramPage::updatePlot));
-	_fitBox.pack_start(_fitEndEntry, Gtk::PACK_SHRINK);
-	_fitEndEntry.set_sensitive(false);
-	_fitEndEntry.signal_activate().connect(sigc::mem_fun(*this, &HistogramPage::updatePlot));
-	_fitBox.pack_start(_fitTextView, Gtk::PACK_SHRINK);
-	
-	_fitFrame.add(_fitBox);
-	
-	_sideBox.pack_start(_fitFrame, Gtk::PACK_SHRINK);
-	
-	Gtk::RadioButtonGroup group;
-	_functionBox.pack_start(_nsButton, Gtk::PACK_SHRINK);
-	_nsButton.signal_clicked().connect(sigc::mem_fun(*this, &HistogramPage::updatePlot));
-	_nsButton.set_group(group);
-	_functionBox.pack_start(_dndsButton, Gtk::PACK_SHRINK);
-	_dndsButton.signal_clicked().connect(sigc::mem_fun(*this, &HistogramPage::updatePlot));
-	_dndsButton.set_group(group);
-	_nsButton.set_active(true);
-	_functionBox.pack_start(_deltaSEntry, Gtk::PACK_SHRINK);
-	_deltaSEntry.set_text("2");
-	_deltaSEntry.signal_activate().connect(sigc::mem_fun(*this, &HistogramPage::updatePlot));
-	
-	_functionFrame.add(_functionBox);
-	_sideBox.pack_start(_functionFrame, Gtk::PACK_SHRINK);
-	
-	_plotPropertiesButton.signal_clicked().connect(sigc::mem_fun(*this, &HistogramPage::onPlotPropertiesClicked));
-	_sideBox.pack_start(_plotPropertiesButton, Gtk::PACK_SHRINK);
-	
-	_dataExportButton.signal_clicked().connect(sigc::mem_fun(*this, &HistogramPage::onDataExportClicked));
-	_sideBox.pack_start(_dataExportButton, Gtk::PACK_SHRINK);
-	
-	_slopeBox.pack_start(_slopeTextView, Gtk::PACK_SHRINK);
-	_drawSlopeButton.signal_clicked().connect(sigc::mem_fun(*this, &HistogramPage::updatePlot));
-	_slopeBox.pack_start(_drawSlopeButton, Gtk::PACK_SHRINK);
-	_drawSlope2Button.signal_clicked().connect(sigc::mem_fun(*this, &HistogramPage::updatePlot));
-	_slopeBox.pack_start(_drawSlope2Button, Gtk::PACK_SHRINK);
-
-	_slopeBox.pack_start(_slopeAutoRangeButton, Gtk::PACK_SHRINK);
-	_slopeAutoRangeButton.set_active(true);
-	_slopeAutoRangeButton.signal_clicked().connect(sigc::mem_fun(*this, &HistogramPage::onSlopeAutoRangeClicked));
-	
-	_slopeBox.pack_start(_slopeStartEntry, Gtk::PACK_SHRINK);
-	_slopeStartEntry.set_sensitive(false);
-	_slopeStartEntry.signal_activate().connect(sigc::mem_fun(*this, &HistogramPage::updatePlot));
-	_slopeBox.pack_start(_slopeEndEntry, Gtk::PACK_SHRINK);
-	_slopeEndEntry.set_sensitive(false);
-	_slopeEndEntry.signal_activate().connect(sigc::mem_fun(*this, &HistogramPage::updatePlot));
-	_slopeBox.pack_start(_slopeRFIRatio, Gtk::PACK_SHRINK);
-	_slopeRFIRatio.set_text("1.0");
-	_slopeRFIRatio.signal_activate().connect(sigc::mem_fun(*this, &HistogramPage::updatePlot));
-	
-	_slopeFrame.add(_slopeBox);
-	_sideBox.pack_start(_slopeFrame, Gtk::PACK_SHRINK);
-	
-	_expander.add(_sideBox);
-	
-	pack_start(_expander, Gtk::PACK_SHRINK);
-	
-	_plotWidget.SetPlot(_plot);
-	pack_start(_plotWidget, Gtk::PACK_EXPAND_WIDGET);
-	
-	show_all_children();
-	
-	_dataWindow = new DataWindow();
-}
-
-HistogramPage::~HistogramPage()
-{
-	CloseStatistics();
-	if(_plotPropertiesWindow != 0)
-		delete _plotPropertiesWindow;
-	delete _dataWindow;
-}
-
-void HistogramPage::readFromFile()
-{
-	CloseStatistics();
-	HistogramTablesFormatter histogramTables(_statFilename);
-	if(histogramTables.HistogramsExist())
-	{
-		MeasurementSet set(_statFilename);
-		
-		const unsigned polarizationCount = set.GetPolarizationCount();
-
-		_histograms = new HistogramCollection(polarizationCount);
-		_histograms->Load(histogramTables);
-	}
-}
-
-void HistogramPage::CloseStatistics()
-{
-	_statFilename = std::string();
-	if(_histograms != 0)
-	{
-		delete _histograms;
-		_histograms = 0;
-	}
-	if(_summedPolarizationHistograms != 0)
-	{
-		delete _summedPolarizationHistograms;
-		_summedPolarizationHistograms = 0;
-	}
-}
-
-void HistogramPage::SetStatistics(HistogramCollection &collection)
-{
-	CloseStatistics();
-	_histograms = new HistogramCollection(collection);
-	_summedPolarizationHistograms = _histograms->CreateSummedPolarizationCollection();
-	updatePlot();
-}
-
-void HistogramPage::updatePlot()
-{
-	if(HasStatistics())
-	{
-		_plot.Clear();
-		
-		const unsigned polarizationCount = _histograms->PolarizationCount();
-		if(_xxPolarizationButton.get_active())
-			plotPolarization(*_histograms, 0);
-		if(_xyPolarizationButton.get_active() && polarizationCount>=2)
-			plotPolarization(*_histograms, 1);
-		if(_yxPolarizationButton.get_active() && polarizationCount>=3)
-			plotPolarization(*_histograms, 2);
-		if(_yyPolarizationButton.get_active() && polarizationCount>=4)
-			plotPolarization(*_histograms, 3);
-		if(_sumPolarizationButton.get_active())
-			plotPolarization(*_summedPolarizationHistograms, 0);
-		
-		_plotWidget.Update();
-		updateDataWindow();
-	}
-}
-
-void HistogramPage::plotPolarization(const HistogramCollection &histogramCollection, unsigned polarization)
-{
-	LogHistogram totalHistogram, rfiHistogram;
-	histogramCollection.GetTotalHistogramForCrossCorrelations(polarization, totalHistogram);
-	histogramCollection.GetRFIHistogramForCrossCorrelations(polarization, rfiHistogram);
-	plotPolarization(totalHistogram, rfiHistogram);
-}
-
-void HistogramPage::plotPolarization(const LogHistogram &totalHistogram, const LogHistogram &rfiHistogram)
-{
-	if(_totalHistogramButton.get_active())
-	{
-		_plot.StartLine("Total histogram", "Amplitude in arbitrary units (log)", "Frequency (log)");
-		addHistogramToPlot(totalHistogram);
-		
-		if(_fitButton.get_active() || _subtractFitButton.get_active())
-		{
-			plotFit(totalHistogram, "Fit to total");
-		}
-		if(_drawSlopeButton.get_active())
-		{
-			plotSlope(totalHistogram, "Fitted slope", false);
-		}
-		if(_drawSlope2Button.get_active())
-		{
-			plotSlope(totalHistogram, "Fitted slope", true);
-		}
-		updateSlopeFrame(totalHistogram);
-	}
-
-	if(_rfiHistogramButton.get_active())
-	{
-		_plot.StartLine("RFI histogram", "Amplitude in arbitrary units (log)", "Frequency (log)");
-		addHistogramToPlot(rfiHistogram);
-
-		if(_fitButton.get_active() || _subtractFitButton.get_active())
-		{
-			plotFit(rfiHistogram, "Fit to RFI");
-		}
-		updateSlopeFrame(rfiHistogram);
-		if(_drawSlopeButton.get_active())
-		{
-			plotSlope(rfiHistogram, "Fitted slope", false);
-		}
-		if(_drawSlope2Button.get_active())
-		{
-			plotSlope(rfiHistogram, "Fitted slope", true);
-		}
-	}
-	
-	if(_notRFIHistogramButton.get_active())
-	{
-		_plot.StartLine("Non-RFI histogram", "Amplitude in arbitrary units (log)", "Frequency (log)");
-		LogHistogram histogram(totalHistogram);
-		histogram -= rfiHistogram;
-		addHistogramToPlot(histogram);
-
-		if(_fitButton.get_active() || _subtractFitButton.get_active())
-		{
-			plotFit(histogram, "Fit to Non-RFI");
-		}
-	}
-}
-
-void HistogramPage::plotFit(const LogHistogram &histogram, const std::string &title)
-{
-	double minRange, maxRange, sigmaEstimate;
-	sigmaEstimate = RayleighFitter::SigmaEstimate(histogram);
-	if(_fitAutoRangeButton.get_active())
-	{
-		RayleighFitter::FindFitRangeUnderRFIContamination(histogram.MinPositiveAmplitude(), sigmaEstimate, minRange, maxRange);
-		std::stringstream minRangeStr, maxRangeStr;
-		minRangeStr << minRange;
-		maxRangeStr << maxRange;
-		_fitStartEntry.set_text(minRangeStr.str());
-		_fitEndEntry.set_text(maxRangeStr.str());
-	} else {
-		minRange = atof(_fitStartEntry.get_text().c_str());
-		maxRange = atof(_fitEndEntry.get_text().c_str());
-	}
-	double sigma = sigmaEstimate, n = RayleighFitter::NEstimate(histogram, minRange, maxRange);
-	RayleighFitter fitter;
-	fitter.SetFitLogarithmic(_fitLogarithmicButton.get_active());
-	fitter.Fit(minRange, maxRange, histogram, sigma, n);
-	if(_fitButton.get_active())
-	{
-		_plot.StartLine(title, "Amplitude in arbitrary units (log)", "Frequency (log)");
-		addRayleighToPlot(histogram, sigma, n);
-	}
-	if(_subtractFitButton.get_active())
-	{
-		_plot.StartLine(title, "Amplitude in arbitrary units (log)", "Frequency (log)");
-		addRayleighDifferenceToPlot(histogram, sigma, n);
-	}
-
-	std::stringstream str;
-	str << "σ=1e" << log10(sigma) << ",n=1e" << log10(n) << '\n'
-		<< "n_t=1e" << log10(histogram.NormalizedTotalCount()) << '\n'
-		<< "mode=1e" << log10(histogram.AmplitudeWithMaxNormalizedCount()) << '\n'
-		<< "ε_R=" << RayleighFitter::ErrorOfFit(histogram, minRange, maxRange, sigma, n);
-	_fitTextView.get_buffer()->set_text(str.str());
-}
-
-void HistogramPage::addHistogramToPlot(const LogHistogram &histogram)
-{
-	const bool derivative = _dndsButton.get_active();
-	double deltaS = atof(_deltaSEntry.get_text().c_str());
-	if(deltaS <= 1.0001) deltaS = 1.0001;
-	for(LogHistogram::iterator i=histogram.begin();i!=histogram.end();++i)
-	{
-		if(derivative)
-		{
-			const double x = i.value();
-			const double logx = log10(x);
-			const double cslope = histogram.NormalizedSlope(x/deltaS, x*deltaS);
-			if(std::isfinite(logx) && std::isfinite(cslope))
-				_plot.PushDataPoint(logx, cslope);
-		} else {
-			const double x = i.value();
-			const double logx = log10(x);
-			const double logc = log10(i.normalizedCount());
-			if(std::isfinite(logx) && std::isfinite(logc))
-				_plot.PushDataPoint(logx, logc);
-		}
-	}
-}
-
-void HistogramPage::addRayleighToPlot(const LogHistogram &histogram, double sigma, double n)
-{
-	const bool derivative = _dndsButton.get_active();
-	double x = histogram.MinPositiveAmplitude();
-	const double xend = sigma*5.0;
-	const double sigmaP2 = sigma*sigma;
-	while(x < xend) {
-		const double logx = log10(x);
-		if(derivative)
-		{
-			const double dc = -(pow10(2.0*x)-sigmaP2)/sigmaP2;
-			if(std::isfinite(logx) && std::isfinite(dc))
-				_plot.PushDataPoint(logx, dc);
-		} else {
-			const double c = n * x / (sigmaP2) * exp(-x*x/(2*sigmaP2));
-			const double logc = log10(c);
-			if(std::isfinite(logx) && std::isfinite(logc))
-				_plot.PushDataPoint(logx, logc);
-		}
-		x *= 1.05;
-	}
-}
-
-void HistogramPage::addRayleighDifferenceToPlot(const LogHistogram &histogram, double sigma, double n)
-{
-	const double sigmaP2 = sigma*sigma;
-	double minCount = histogram.MinPosNormalizedCount();
-	for(LogHistogram::iterator i=histogram.begin();i!=histogram.end();++i)
-	{
-		const double x = i.value();
-		
-    const double c = n * x / (sigmaP2) * exp(-x*x/(2*sigmaP2));
-		double diff = fabs(i.normalizedCount() - c);
-		if(diff >= minCount)
-		{
-			const double logx = log10(x);
-			const double logc = log10(diff);
-			if(std::isfinite(logx) && std::isfinite(logc))
-				_plot.PushDataPoint(logx, logc);
-		}
-	}
-}
-
-void HistogramPage::plotSlope(const LogHistogram &histogram, const std::string &title, bool useLowerLimit2)
-{
-	double start, end;
-	if(_slopeAutoRangeButton.get_active())
-	{
-		histogram.GetRFIRegion(start, end);
-	} else {
-		start = atof(_slopeStartEntry.get_text().c_str());
-		end = atof(_slopeEndEntry.get_text().c_str());
-	}
-	double
-		xMin = log10(histogram.MinPositiveAmplitude()),
-		rfiRatio = atof(_slopeRFIRatio.get_text().c_str()),
-		slope = histogram.NormalizedSlope(start, end),
-		offset = histogram.NormalizedSlopeOffset(start, end, slope),
-		upperLimit = log10(histogram.PowerLawUpperLimit(start, slope, pow10(offset))),
-		lowerLimit = useLowerLimit2 ?
-			log10(histogram.PowerLawLowerLimit2(start, slope, pow10(offset), rfiRatio)) :
-			log10(histogram.PowerLawLowerLimit(start, slope, pow10(offset), rfiRatio));
-	double xStart, xEnd;
-	if(std::isfinite(lowerLimit))
-		xStart = lowerLimit;
-	else
-		xStart = log10(start) - 1.0;
-	if(std::isfinite(upperLimit))
-		xEnd = upperLimit;
-	else
-		xEnd = log10(histogram.MaxAmplitude());
-	double
-		yStart = xStart*slope + offset,
-		yEnd = xEnd*slope + offset;
-	_plot.StartLine(title, "Amplitude in arbitrary units (log)", "Frequency (log)");
-	if(useLowerLimit2 && std::isfinite(xMin))
-		_plot.PushDataPoint(xMin, yStart);
-	_plot.PushDataPoint(xStart, yStart);
-	_plot.PushDataPoint(xEnd, yEnd);
-}
-
-void HistogramPage::onPlotPropertiesClicked()
-{
-	if(_plotPropertiesWindow == 0)
-	{
-		_plotPropertiesWindow = new PlotPropertiesWindow(_plot, "Plot properties");
-		_plotPropertiesWindow->OnChangesApplied = boost::bind(&HistogramPage::updatePlot, this);
-	}
-	
-	_plotPropertiesWindow->show();
-	_plotPropertiesWindow->raise();
-}
-
-void HistogramPage::onDataExportClicked()
-{
-	_dataWindow->show();
-	_dataWindow->raise();
-	updateDataWindow();
-}
-
-void HistogramPage::updateSlopeFrame(const LogHistogram &histogram)
-{
-	std::stringstream str;
-	addSlopeText(str, histogram, true);
-	
-	_slopeTextView.get_buffer()->set_text(str.str());
-}
-
-void HistogramPage::addSlopeText(std::stringstream &str, const LogHistogram &histogram, bool updateRange)
-{
-	double deltaS = atof(_deltaSEntry.get_text().c_str());
-	if(deltaS <= 1.0001) deltaS = 1.0001;
-	double minRange, maxRange;
-	if(_slopeAutoRangeButton.get_active())
-	{
-		histogram.GetRFIRegion(minRange, maxRange);
-		if(updateRange)
-		{
-			std::stringstream minRangeStr, maxRangeStr;
-			minRangeStr << minRange;
-			maxRangeStr << maxRange;
-			_slopeStartEntry.set_text(minRangeStr.str());
-			_slopeEndEntry.set_text(maxRangeStr.str());
-		}
-	} else {
-		minRange = atof(_slopeStartEntry.get_text().c_str());
-		maxRange = atof(_slopeEndEntry.get_text().c_str());
-	}
-	double rfiRatio = atof(_slopeRFIRatio.get_text().c_str());
-
-	const double
-		slope = histogram.NormalizedSlope(minRange, maxRange),
-		powerLawExp = histogram.PowerLawExponent(minRange),
-		powerLawExpError = histogram.PowerLawExponentStdError(minRange, powerLawExp),
-		offset = histogram.NormalizedSlopeOffset(minRange, maxRange, slope),
-		error = histogram.NormalizedSlopeStdError(minRange, maxRange, slope),
-		errorB = histogram.NormalizedSlopeStdDevBySampling(minRange, maxRange, slope, deltaS),
-		upperLimit = histogram.PowerLawUpperLimit(minRange, slope, pow10(offset)),
-		lowerLimit = histogram.PowerLawLowerLimit(minRange, slope, pow10(offset), rfiRatio),
-		lowerError = fabs(lowerLimit - histogram.PowerLawLowerLimit(minRange, slope - error, pow10(offset), rfiRatio)),
-		lowerLimit2 = histogram.PowerLawLowerLimit2(minRange, slope, pow10(offset), rfiRatio);
-	str << slope << "±" << error << "\n/±" << errorB << "\nb=" << pow10(offset)
-		<< "\nPL:"
-		<< powerLawExp << "±" << powerLawExpError << "\n["
-		<< log10(lowerLimit) << "±" << lowerError << ';' << log10(upperLimit) << ']' << '\n'
-		<< log10(lowerLimit2);
-}
-
-void HistogramPage::updateDataWindow()
-{
-	if(_dataWindow->is_visible())
-		_dataWindow->SetData(_plot);
-}
diff --git a/CEP/DP3/AOFlagger/src/gui/quality/timefrequencyplotpage.cpp b/CEP/DP3/AOFlagger/src/gui/quality/timefrequencyplotpage.cpp
deleted file mode 100644
index 41d84c001d4f7bacf88bf878b178e8f88afac282..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/gui/quality/timefrequencyplotpage.cpp
+++ /dev/null
@@ -1,72 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2011 by A.R. Offringa                                   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#include <limits>
-
-#include <AOFlagger/gui/quality/timefrequencyplotpage.h>
-
-#include <AOFlagger/quality/statisticscollection.h>
-#include <AOFlagger/quality/statisticsderivator.h>
-
-TimeFrequencyPlotPage::TimeFrequencyPlotPage() :
-	_statCollection(0)
-{
-	GrayScaleWidget().OnMouseMovedEvent().connect(sigc::mem_fun(*this, &TimeFrequencyPlotPage::onMouseMoved));
-	GrayScaleWidget().SetXAxisDescription("Time index");
-	GrayScaleWidget().SetYAxisDescription("Frequency index");
-}
-
-TimeFrequencyPlotPage::~TimeFrequencyPlotPage()
-{
-}
-
-std::pair<TimeFrequencyData, TimeFrequencyMetaDataCPtr> TimeFrequencyPlotPage::ConstructImage()
-{
-	if(HasStatistics())
-	{
-		const QualityTablesFormatter::StatisticKind kind = GetSelectedStatisticKind();
-		
-		StatisticsDerivator derivator(*_statCollection);
-		
-		std::pair<TimeFrequencyData, TimeFrequencyMetaDataCPtr> data = derivator.CreateTFData(kind);
-		if(data.second == 0)
-		{
-			GrayScaleWidget().SetXAxisDescription("Time index");
-			GrayScaleWidget().SetYAxisDescription("Frequency index");
-		} else {
-			GrayScaleWidget().SetXAxisDescription("Time");
-			GrayScaleWidget().SetYAxisDescription("Frequency (MHz)");
-		}
-		return data;
-	} else {
-		return std::pair<TimeFrequencyData, TimeFrequencyMetaDataCPtr>(TimeFrequencyData(), TimeFrequencyMetaDataCPtr());
-	}
-}
-
-void TimeFrequencyPlotPage::onMouseMoved(size_t x, size_t y)
-{
-	std::stringstream text;
-
-	const QualityTablesFormatter::StatisticKind kind = GetSelectedStatisticKind();
-	const std::string &kindName = QualityTablesFormatter::KindToName(kind);
-	
-	text << kindName << " = " << GrayScaleWidget().Image()->Value(x, y) << " (" << x << ", " << y << ")";
-	_signalStatusChange(text.str());
-}
diff --git a/CEP/DP3/AOFlagger/src/gui/quality/twodimensionalplotpage.cpp b/CEP/DP3/AOFlagger/src/gui/quality/twodimensionalplotpage.cpp
deleted file mode 100644
index bf8c3ee26c3f2ffee048b4b5bdbe8d7c0156ba99..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/gui/quality/twodimensionalplotpage.cpp
+++ /dev/null
@@ -1,380 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2011 by A.R. Offringa                                   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#include <limits>
-
-#include <boost/bind.hpp>
-
-#include <AOFlagger/gui/quality/datawindow.h>
-#include <AOFlagger/gui/quality/twodimensionalplotpage.h>
-
-#include <AOFlagger/quality/statisticscollection.h>
-#include <AOFlagger/quality/statisticsderivator.h>
-
-#include <AOFlagger/gui/plot/plotpropertieswindow.h>
-
-TwoDimensionalPlotPage::TwoDimensionalPlotPage() :
-	_expander("Side bar"),
-	_statisticFrame("Statistics"),
-	_countButton("Count"),
-	_meanButton("Mean"),
-	_stdDevButton("StdDev"),
-	_varianceButton("Variance"),
-	_dCountButton("DCount"),
-	_dMeanButton("DMean"),
-	_dStdDevButton("DStdDev"),
-	_rfiPercentageButton("RFI"),
-	_snrButton("SNR"),
-	_polarizationFrame("Polarization"),
-	_polXXButton("XX"),
-	_polXYButton("XY"),
-	_polYXButton("YX"),
-	_polYYButton("YY"),
-	_polXXandYYButton("XX/2+YY/2"),
-	_polXYandYXButton("XY/2+YX/2"),
-	_phaseFrame("Phase"),
-	_amplitudeButton("Amplitude"),
-	_phaseButton("Phase"),
-	_realButton("Real"),
-	_imaginaryButton("Imaginary"),
-	_plotFrame("Plot"),
-	_logarithmicButton("Logarithmic"),
-	_zeroAxisButton("Zero axis"),
-	_plotPropertiesButton("Properties..."),
-	_dataExportButton("Data..."),
-	_statCollection(0),
-	_plotPropertiesWindow(0),
-	_customButtonsCreated(false)
-{
-	initStatisticKindButtons();
-	initPolarizationButtons();
-	initPhaseButtons();
-	initPlotButtons();
-	
-	_expander.add(_sideBox);
-	pack_start(_expander, Gtk::PACK_SHRINK);
-	
-	_plotWidget.SetPlot(_plot);
-	pack_start(_plotWidget, Gtk::PACK_EXPAND_WIDGET);
-	
-	show_all_children();
-	
-	_dataWindow = new DataWindow();
-}
-
-TwoDimensionalPlotPage::~TwoDimensionalPlotPage()
-{
-	delete _dataWindow;
-	if(_plotPropertiesWindow != 0)
-		delete _plotPropertiesWindow;
-}
-
-unsigned TwoDimensionalPlotPage::selectedKindCount() const
-{
-	unsigned count = 0;
-	if(_countButton.get_active()) ++count;
-	if(_meanButton.get_active()) ++count;
-	if(_stdDevButton.get_active()) ++count;
-	if(_varianceButton.get_active()) ++count;
-	if(_dCountButton.get_active()) ++count;
-	if(_dMeanButton.get_active()) ++count;
-	if(_dStdDevButton.get_active()) ++count;
-	if(_rfiPercentageButton.get_active()) ++count;
-	if(_snrButton.get_active()) ++count;
-	return count;
-}
-
-void TwoDimensionalPlotPage::updatePlot()
-{
-	if(HasStatistics())
-	{
-		_plot.Clear();
-		
-		if(_countButton.get_active())
-			plotStatistic(QualityTablesFormatter::CountStatistic);
-		if(_meanButton.get_active())
-			plotStatistic(QualityTablesFormatter::MeanStatistic);
-		if(_stdDevButton.get_active())
-			plotStatistic(QualityTablesFormatter::StandardDeviationStatistic);
-		if(_varianceButton.get_active())
-			plotStatistic(QualityTablesFormatter::VarianceStatistic);
-		if(_dCountButton.get_active())
-			plotStatistic(QualityTablesFormatter::DCountStatistic);
-		if(_dMeanButton.get_active())
-			plotStatistic(QualityTablesFormatter::DMeanStatistic);
-		if(_dStdDevButton.get_active())
-			plotStatistic(QualityTablesFormatter::DStandardDeviationStatistic);
-		if(_rfiPercentageButton.get_active())
-			plotStatistic(QualityTablesFormatter::RFIPercentageStatistic);
-		if(_snrButton.get_active())
-			plotStatistic(QualityTablesFormatter::SignalToNoiseStatistic);
-		
-		processPlot(_plot);
-		
-		_plotWidget.Update();
-		
-		if(_dataWindow->get_visible())
-		{
-			updateDataWindow();
-		}
-	}
-}
-
-void TwoDimensionalPlotPage::updatePlotConfig()
-{
-	_plot.SetIncludeZeroYAxis(_zeroAxisButton.get_active());
-	_plot.SetLogarithmicYAxis(_logarithmicButton.get_active());
-	_plotWidget.Update();
-}
-
-template<enum TwoDimensionalPlotPage::PhaseType Phase>
-double TwoDimensionalPlotPage::getValue(const std::complex<long double> val)
-{
-	switch(Phase)
-	{
-		case AmplitudePhaseType: return sqrt(val.real()*val.real() + val.imag()*val.imag());
-		case PhasePhaseType: return atan2(val.imag(), val.real());
-		case RealPhaseType: return val.real();
-		case ImaginaryPhaseType: return val.imag();
-	}
-}
-
-template<enum TwoDimensionalPlotPage::PhaseType Phase>
-void TwoDimensionalPlotPage::plotPhase(QualityTablesFormatter::StatisticKind kind, unsigned polarization)
-{
-	std::ostringstream s;
-	s << "Polarization " << polarization;
-	StartLine(_plot, s.str(), getYDesc());
-	StatisticsDerivator derivator(*_statCollection);
-	const std::map<double, DefaultStatistics> &statistics = GetStatistics();
-	for(std::map<double, DefaultStatistics>::const_iterator i=statistics.begin();i!=statistics.end();++i)
-	{
-		const double x = i->first;
-		const std::complex<long double> val = derivator.GetComplexStatistic(kind, i->second, polarization);
-		_plot.PushDataPoint(x, getValue<Phase>(val));
-	}
-}
-
-template<enum TwoDimensionalPlotPage::PhaseType Phase>
-void TwoDimensionalPlotPage::plotPhase(QualityTablesFormatter::StatisticKind kind, unsigned polarizationA, unsigned polarizationB)
-{
-	std::ostringstream s;
-	s << "Polarization " << polarizationA << " and " << polarizationB;
-	StartLine(_plot, s.str(), getYDesc());
-	StatisticsDerivator derivator(*_statCollection);
-	const std::map<double, DefaultStatistics> &statistics = GetStatistics();
-	for(std::map<double, DefaultStatistics>::const_iterator i=statistics.begin();i!=statistics.end();++i)
-	{
-		const double x = i->first;
-		const std::complex<long double>
-			valA = derivator.GetComplexStatistic(kind, i->second, polarizationA),
-			valB = derivator.GetComplexStatistic(kind, i->second, polarizationB),
-			val = valA*0.5l + valB*0.5l;
-		_plot.PushDataPoint(x, getValue<Phase>(val));
-	}
-}
-
-void TwoDimensionalPlotPage::plotStatistic(QualityTablesFormatter::StatisticKind kind)
-{
-	if(_polXXButton.get_active())
-		plotPolarization(kind, 0);
-	if(_polXYButton.get_active())
-		plotPolarization(kind, 1);
-	if(_polYXButton.get_active())
-		plotPolarization(kind, 2);
-	if(_polYYButton.get_active())
-		plotPolarization(kind, 3);
-	if(_polXXandYYButton.get_active())
-		plotPolarization(kind, 0, 3);
-	if(_polXYandYXButton.get_active())
-		plotPolarization(kind, 1, 2);
-}
-
-void TwoDimensionalPlotPage::plotPolarization(QualityTablesFormatter::StatisticKind kind, unsigned polarization)
-{
-	if(_amplitudeButton.get_active())
-		plotPhase<AmplitudePhaseType>(kind, polarization);
-	if(_phaseButton.get_active())
-		plotPhase<PhasePhaseType>(kind, polarization);
-	if(_realButton.get_active())
-		plotPhase<RealPhaseType>(kind, polarization);
-	if(_imaginaryButton.get_active())
-		plotPhase<ImaginaryPhaseType>(kind, polarization);
-}
-
-void TwoDimensionalPlotPage::plotPolarization(QualityTablesFormatter::StatisticKind kind, unsigned polarizationA, unsigned polarizationB)
-{
-	if(_amplitudeButton.get_active())
-		plotPhase<AmplitudePhaseType>(kind, polarizationA, polarizationB);
-	if(_phaseButton.get_active())
-		plotPhase<PhasePhaseType>(kind, polarizationA, polarizationB);
-	if(_realButton.get_active())
-		plotPhase<RealPhaseType>(kind, polarizationA, polarizationB);
-	if(_imaginaryButton.get_active())
-		plotPhase<ImaginaryPhaseType>(kind, polarizationA, polarizationB);
-}
-
-void TwoDimensionalPlotPage::initStatisticKindButtons()
-{
-	_countButton.signal_clicked().connect(sigc::mem_fun(*this, &TwoDimensionalPlotPage::updatePlot));
-	_statisticBox.pack_start(_countButton, Gtk::PACK_SHRINK);
-	
-	_meanButton.signal_clicked().connect(sigc::mem_fun(*this, &TwoDimensionalPlotPage::updatePlot));
-	_statisticBox.pack_start(_meanButton, Gtk::PACK_SHRINK);
-	
-	_stdDevButton.signal_clicked().connect(sigc::mem_fun(*this, &TwoDimensionalPlotPage::updatePlot));
-	_stdDevButton.set_active(true);
-	_statisticBox.pack_start(_stdDevButton, Gtk::PACK_SHRINK);
-	
-	_varianceButton.signal_clicked().connect(sigc::mem_fun(*this, &TwoDimensionalPlotPage::updatePlot));
-	_statisticBox.pack_start(_varianceButton, Gtk::PACK_SHRINK);
-	
-	_dCountButton.signal_clicked().connect(sigc::mem_fun(*this, &TwoDimensionalPlotPage::updatePlot));
-	_statisticBox.pack_start(_dCountButton, Gtk::PACK_SHRINK);
-	
-	_dMeanButton.signal_clicked().connect(sigc::mem_fun(*this, &TwoDimensionalPlotPage::updatePlot));
-	_statisticBox.pack_start(_dMeanButton, Gtk::PACK_SHRINK);
-	
-	_dStdDevButton.signal_clicked().connect(sigc::mem_fun(*this, &TwoDimensionalPlotPage::updatePlot));
-	_statisticBox.pack_start(_dStdDevButton, Gtk::PACK_SHRINK);
-	
-	_rfiPercentageButton.signal_clicked().connect(sigc::mem_fun(*this, &TwoDimensionalPlotPage::updatePlot));
-	_statisticBox.pack_start(_rfiPercentageButton, Gtk::PACK_SHRINK);
-	
-	_snrButton.signal_clicked().connect(sigc::mem_fun(*this, &TwoDimensionalPlotPage::updatePlot));
-	_statisticBox.pack_start(_snrButton, Gtk::PACK_SHRINK);
-	
-	_statisticFrame.add(_statisticBox);
-	
-	_sideBox.pack_start(_statisticFrame, Gtk::PACK_SHRINK);
-}
-
-void TwoDimensionalPlotPage::initPolarizationButtons()
-{
-	_polXXButton.signal_clicked().connect(sigc::mem_fun(*this, &TwoDimensionalPlotPage::updatePlot));
-	_polarizationBox.pack_start(_polXXButton, Gtk::PACK_SHRINK);
-	
-	_polXYButton.signal_clicked().connect(sigc::mem_fun(*this, &TwoDimensionalPlotPage::updatePlot));
-	_polarizationBox.pack_start(_polXYButton, Gtk::PACK_SHRINK);
-	
-	_polYXButton.signal_clicked().connect(sigc::mem_fun(*this, &TwoDimensionalPlotPage::updatePlot));
-	_polarizationBox.pack_start(_polYXButton, Gtk::PACK_SHRINK);
-	
-	_polYYButton.signal_clicked().connect(sigc::mem_fun(*this, &TwoDimensionalPlotPage::updatePlot));
-	_polarizationBox.pack_start(_polYYButton, Gtk::PACK_SHRINK);
-	
-	_polXXandYYButton.signal_clicked().connect(sigc::mem_fun(*this, &TwoDimensionalPlotPage::updatePlot));
-	_polXXandYYButton.set_active(true);
-	_polarizationBox.pack_start(_polXXandYYButton, Gtk::PACK_SHRINK);
-	
-	_polXYandYXButton.signal_clicked().connect(sigc::mem_fun(*this, &TwoDimensionalPlotPage::updatePlot));
-	_polarizationBox.pack_start(_polXYandYXButton, Gtk::PACK_SHRINK);
-	
-	_polarizationFrame.add(_polarizationBox);
-	
-	_sideBox.pack_start(_polarizationFrame, Gtk::PACK_SHRINK);
-}
-
-void TwoDimensionalPlotPage::initPhaseButtons()
-{
-	_amplitudeButton.signal_clicked().connect(sigc::mem_fun(*this, &TwoDimensionalPlotPage::updatePlot));
-	_amplitudeButton.set_active(true);
-	_phaseBox.pack_start(_amplitudeButton, Gtk::PACK_SHRINK);
-	
-	_phaseButton.signal_clicked().connect(sigc::mem_fun(*this, &TwoDimensionalPlotPage::updatePlot));
-	_phaseBox.pack_start(_phaseButton, Gtk::PACK_SHRINK);
-	
-	_realButton.signal_clicked().connect(sigc::mem_fun(*this, &TwoDimensionalPlotPage::updatePlot));
-	_phaseBox.pack_start(_realButton, Gtk::PACK_SHRINK);
-	
-	_imaginaryButton.signal_clicked().connect(sigc::mem_fun(*this, &TwoDimensionalPlotPage::updatePlot));
-	_phaseBox.pack_start(_imaginaryButton, Gtk::PACK_SHRINK);
-	
-	_phaseFrame.add(_phaseBox);
-	
-	_sideBox.pack_start(_phaseFrame, Gtk::PACK_SHRINK);
-}
-
-void TwoDimensionalPlotPage::initPlotButtons()
-{
-	_logarithmicButton.signal_clicked().connect(sigc::mem_fun(*this, &TwoDimensionalPlotPage::onLogarithmicClicked));
-	_plotBox.pack_start(_logarithmicButton, Gtk::PACK_SHRINK);
-	
-	_zeroAxisButton.signal_clicked().connect(sigc::mem_fun(*this, &TwoDimensionalPlotPage::updatePlotConfig));
-	_zeroAxisButton.set_active(true);
-	_plotBox.pack_start(_zeroAxisButton, Gtk::PACK_SHRINK);
-	_plot.SetIncludeZeroYAxis(true);
-	
-	_plotPropertiesButton.signal_clicked().connect(sigc::mem_fun(*this, &TwoDimensionalPlotPage::onPlotPropertiesClicked));
-	_plotBox.pack_start(_plotPropertiesButton, Gtk::PACK_SHRINK);
-
-	_dataExportButton.signal_clicked().connect(sigc::mem_fun(*this, &TwoDimensionalPlotPage::onDataExportClicked));
-	_plotBox.pack_start(_dataExportButton, Gtk::PACK_SHRINK);
-	
-	_plotFrame.add(_plotBox);
-	
-	_sideBox.pack_start(_plotFrame, Gtk::PACK_SHRINK);
-}
-
-void TwoDimensionalPlotPage::onPlotPropertiesClicked()
-{
-	if(_plotPropertiesWindow == 0)
-	{
-		_plotPropertiesWindow = new PlotPropertiesWindow(_plot, "Plot properties");
-		_plotPropertiesWindow->OnChangesApplied = boost::bind(&TwoDimensionalPlotPage::updatePlot, this);
-	}
-	
-	_plotPropertiesWindow->show();
-	_plotPropertiesWindow->raise();
-}
-
-void TwoDimensionalPlotPage::updateDataWindow()
-{
-	if(_dataWindow->is_visible())
-		_dataWindow->SetData(_plot);
-}
-
-void TwoDimensionalPlotPage::onDataExportClicked()
-{
-	_dataWindow->show();
-	_dataWindow->raise();
-	updateDataWindow();
-}
-
-std::string TwoDimensionalPlotPage::getYDesc() const
-{
-	if(selectedKindCount() != 1)
-		return "Value";
-	else
-	{
-		QualityTablesFormatter::StatisticKind kind;
-		if(_countButton.get_active()) kind = QualityTablesFormatter::CountStatistic;
-		if(_meanButton.get_active()) kind = QualityTablesFormatter::MeanStatistic;
-		if(_stdDevButton.get_active()) kind = QualityTablesFormatter::StandardDeviationStatistic;
-		if(_varianceButton.get_active()) kind = QualityTablesFormatter::VarianceStatistic;
-		if(_dCountButton.get_active()) kind = QualityTablesFormatter::DCountStatistic;
-		if(_dMeanButton.get_active()) kind = QualityTablesFormatter::DMeanStatistic;
-		if(_dStdDevButton.get_active()) kind = QualityTablesFormatter::DStandardDeviationStatistic;
-		if(_rfiPercentageButton.get_active()) kind = QualityTablesFormatter::RFIPercentageStatistic;
-		if(_snrButton.get_active()) kind = QualityTablesFormatter::SignalToNoiseStatistic;
-		return StatisticsDerivator::GetDescWithUnits(kind);
-	}
-}
-
diff --git a/CEP/DP3/AOFlagger/src/gui/rawoptionwindow.cpp b/CEP/DP3/AOFlagger/src/gui/rawoptionwindow.cpp
deleted file mode 100644
index 7b66f868525823b18996ae4dbf4d2d2e4d929ede..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/gui/rawoptionwindow.cpp
+++ /dev/null
@@ -1,127 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#include <iostream>
-
-#include <gtkmm/messagedialog.h>
-
-#include <AOFlagger/msio/timefrequencyimager.h>
-
-#include <AOFlagger/strategy/imagesets/msimageset.h>
-#include <AOFlagger/strategy/imagesets/rspimageset.h>
-
-#include <AOFlagger/gui/mswindow.h>
-#include <AOFlagger/gui/rawoptionwindow.h>
-
-RawOptionWindow::RawOptionWindow(MSWindow &msWindow, const std::string &filename) :
-	Gtk::Window(),
-	_msWindow(msWindow),
-	_filename(filename),
-	_openButton("Open"),
-	_modeFrame("Columns to read"),
-	_allBeamletsButton("All beamlets"), _singleBeamletButton("Single beamlet"), _channelBeamletButton("Single beamlet with channels"),
-	_statisticsButton("Read whole set for statistics"),
-	_beamletsInSetLabel("Beamlets in raw file:"), _timeBlockSizeLabel("Time block size for reading 128*2^n; n="),
-	_beamletsInSetScale(1, 62, 1), _timeBlockSizeScale(1, 10, 1)
-{
-	set_title("Options for opening a raw file");
-
-	initModeButtons();
-	
-	_topVBox.pack_start(_beamletsInSetLabel);
-	_beamletsInSetLabel.show();
-	
-	_beamletsInSetScale.set_value(5);
-	_topVBox.pack_start(_beamletsInSetScale);
-	_beamletsInSetScale.show();
-
-	_topVBox.pack_start(_timeBlockSizeLabel);
-	_timeBlockSizeLabel.show();
-	
-	_timeBlockSizeScale.set_value(4);
-	_topVBox.pack_start(_timeBlockSizeScale);
-	_timeBlockSizeScale.show();
-
-	_openButton.signal_clicked().connect(sigc::mem_fun(*this, &RawOptionWindow::onOpen));
-	_bottomButtonBox.pack_start(_openButton);
-	_openButton.show();
-
-	_topVBox.pack_start(_bottomButtonBox);
-	_bottomButtonBox.show();
-
-	add(_topVBox);
-	_topVBox.show();
-}
-
-void RawOptionWindow::initModeButtons()
-{
-	Gtk::RadioButton::Group group;
-
-	_allBeamletsButton.set_group(group);
-	_modeBox.pack_start(_allBeamletsButton);
-	_allBeamletsButton.show();
-	
-	_singleBeamletButton.set_group(group);
-	_modeBox.pack_start(_singleBeamletButton);
-	_singleBeamletButton.show();
-	
-	_channelBeamletButton.set_group(group);
-	_modeBox.pack_start(_channelBeamletButton);
-	_channelBeamletButton.set_active(true);
-	_channelBeamletButton.show();
-	
-	_statisticsButton.set_group(group);
-	_modeBox.pack_start(_statisticsButton);
-	_statisticsButton.show();
-
-	_modeFrame.add(_modeBox);
-	_modeBox.show();
-
-	_topVBox.pack_start(_modeFrame);
-	_modeFrame.show();
-}
-
-void RawOptionWindow::onOpen()
-{
-	std::cout << "Opening " << _filename << std::endl;
-	try
-	{
-		rfiStrategy::RSPImageSet *imageSet = new rfiStrategy::RSPImageSet(_filename);
-		imageSet->SetBeamletsInSet((unsigned int) _beamletsInSetScale.get_value());
-		imageSet->SetTimeBlockSize(128ul << (unsigned long) _timeBlockSizeScale.get_value());
-		if(_allBeamletsButton.get_active())
-			imageSet->SetMode(rfiStrategy::RSPImageSet::AllBeamletsMode);
-		else if(_singleBeamletButton.get_active())
-			imageSet->SetMode(rfiStrategy::RSPImageSet::SingleBeamletMode);
-		else if(_channelBeamletButton.get_active())
-			imageSet->SetMode(rfiStrategy::RSPImageSet::BeamletChannelMode);
-		else
-			imageSet->SetMode(rfiStrategy::RSPImageSet::StatisticsMode);
-		imageSet->Initialize();
-	
-		_msWindow.SetImageSet(imageSet);
-	} catch(std::exception &e)
-	{
-		Gtk::MessageDialog dialog(*this, e.what(), false, Gtk::MESSAGE_ERROR);
-		dialog.run();
-	}
-	hide();
-}
-
diff --git a/CEP/DP3/AOFlagger/src/gui/tfstatoptionwindow.cpp b/CEP/DP3/AOFlagger/src/gui/tfstatoptionwindow.cpp
deleted file mode 100644
index cbdb300774705b5d2c231de53821d7d63b375d80..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/gui/tfstatoptionwindow.cpp
+++ /dev/null
@@ -1,107 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#include <gtkmm/messagedialog.h>
-
-#include <AOFlagger/strategy/imagesets/timefrequencystatimageset.h>
-
-#include <AOFlagger/gui/mswindow.h>
-#include <AOFlagger/gui/tfstatoptionwindow.h>
-
-TFStatOptionWindow::TFStatOptionWindow(MSWindow &msWindow, const std::string &filename) :
-	Gtk::Window(),
-	_msWindow(msWindow),
-	_filename(filename),
-	_openButton("Open"),
-	_modeFrame("What to read"),
-	_rfiPercentangeButton("RFI percentages"),
-	_totalAmplitudeButton("Total amplitudes"),
-	_rfiAmplitudeButton("RFI amplitudes"),
-	_nonRfiAmplitudeButton("Non-RFI amplitudes")
-{
-	set_title("Options for opening a tf stat file");
-
-	initModeButtons();
-	
-	_openButton.signal_clicked().connect(sigc::mem_fun(*this, &TFStatOptionWindow::onOpen));
-	_bottomButtonBox.pack_start(_openButton);
-	_openButton.show();
-
-	_topVBox.pack_start(_bottomButtonBox);
-	_bottomButtonBox.show();
-
-	add(_topVBox);
-	_topVBox.show();
-}
-
-void TFStatOptionWindow::initModeButtons()
-{
-	Gtk::RadioButton::Group group;
-
-	_rfiPercentangeButton.set_group(group);
-	_modeBox.pack_start(_rfiPercentangeButton);
-	_rfiPercentangeButton.set_active(true);
-	_rfiPercentangeButton.show();
-	
-	_totalAmplitudeButton.set_group(group);
-	_modeBox.pack_start(_totalAmplitudeButton);
-	_totalAmplitudeButton.show();
-	
-	_rfiAmplitudeButton.set_group(group);
-	_modeBox.pack_start(_rfiAmplitudeButton);
-	_rfiAmplitudeButton.show();
-	
-	_nonRfiAmplitudeButton.set_group(group);
-	_modeBox.pack_start(_nonRfiAmplitudeButton);
-	_nonRfiAmplitudeButton.show();
-
-	_modeFrame.add(_modeBox);
-	_modeBox.show();
-
-	_topVBox.pack_start(_modeFrame);
-	_modeFrame.show();
-}
-
-void TFStatOptionWindow::onOpen()
-{
-	std::cout << "Opening " << _filename << std::endl;
-	try
-	{
-		rfiStrategy::TimeFrequencyStatImageSet *imageSet =
-			new rfiStrategy::TimeFrequencyStatImageSet(_filename);
-		if(_rfiPercentangeButton.get_active())
-			imageSet->SetMode(rfiStrategy::TimeFrequencyStatImageSet::RFIPercentages);
-		else if(_totalAmplitudeButton.get_active())
-			imageSet->SetMode(rfiStrategy::TimeFrequencyStatImageSet::TotalAmplitude);
-		else if(_rfiAmplitudeButton.get_active())
-			imageSet->SetMode(rfiStrategy::TimeFrequencyStatImageSet::RFIAmplitude);
-		else if(_nonRfiAmplitudeButton.get_active())
-			imageSet->SetMode(rfiStrategy::TimeFrequencyStatImageSet::NonRFIAmplitude);
-		imageSet->Initialize();
-	
-		_msWindow.SetImageSet(imageSet);
-	} catch(std::exception &e)
-	{
-		Gtk::MessageDialog dialog(*this, e.what(), false, Gtk::MESSAGE_ERROR);
-		dialog.run();
-	}
-	hide();
-}
-
diff --git a/CEP/DP3/AOFlagger/src/imaging/fourproductcorrelatortester.cpp b/CEP/DP3/AOFlagger/src/imaging/fourproductcorrelatortester.cpp
deleted file mode 100644
index c412e4438f7f30ac2045bd61ba44e758f82c3acb..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/imaging/fourproductcorrelatortester.cpp
+++ /dev/null
@@ -1,240 +0,0 @@
-#include <AOFlagger/imaging/fourproductcorrelatortester.h>
-
-#include <AOFlagger/imaging/observatorium.h>
-#include <AOFlagger/imaging/model.h>
-#include <AOFlagger/imaging/uvimager.h>
-
-FourProductCorrelatorTester::FourProductCorrelatorTester(class Model &model, class UVImager &imager, class Observatorium &observatorium)
-	: _model(model), _imager(imager), _observatorium(observatorium), _incoherent(false)
-{
-}
-
-void FourProductCorrelatorTester::SimulateObservation(num_t delayDirectionDEC, num_t delayDirectionRA, num_t frequency)
-{
-	size_t frequencySteps = 1;
-
-	for(size_t f=0;f<frequencySteps;++f)
-	{
-		double channelFrequency = frequency + _observatorium.ChannelWidthHz() * f * 256 / frequencySteps;
-		for(size_t i=0;i<_observatorium.AntennaCount();++i)
-		{
-			for(size_t j=0;j<_observatorium.AntennaCount();++j)
-			{
-				for(size_t k=i;k<_observatorium.AntennaCount();++k)
-				{
-					for(size_t l=j;l<_observatorium.AntennaCount();++l)
-					{
-						bool notAnyAutoCorrelation = true;
-						if(!notAnyAutoCorrelation || !(i==j || i==k || i==l || j==k || j==l || k==l))
-						{
-							if(!(i == j && j == k && k == l))
-							{
-								const AntennaInfo
-									&a1 = _observatorium.GetAntenna(i),
-									&a2 = _observatorium.GetAntenna(j),
-									&a3 = _observatorium.GetAntenna(k),
-									&a4 = _observatorium.GetAntenna(l);
-			
-								SimulateCorrelation(delayDirectionDEC, delayDirectionRA, a1, a2, a3, a4, channelFrequency, 12*60*60, 10.0);
-							}
-						}
-					}
-				}
-			}
-			std::cout << "." << std::flush;
-		}
-	}
-	std::cout << std::endl;
-}
-
-void FourProductCorrelatorTester::complexSqrt(num_t &r, num_t &i)
-{
-	num_t rtmp = r;
-	num_t a = sqrt(r*r + i*i);
-	r = sqrt((a + r)/2.0);
-	if(i != 0)
-		i = i / sqrt(2.0*(a + rtmp));
-}
-
-void FourProductCorrelatorTester::amplitudeSqrt(num_t &r, num_t &i)
-{
-	num_t factor = 1.0 / pow(r*r + i*i, 1.0/4.0);
-	r *= factor;
-	i *= factor;
-}
-
-void FourProductCorrelatorTester::phaseMul2(num_t &r, num_t &i)
-{
-	num_t rtmp = r;
-	num_t a = sqrt(r*r + i*i);
-	r = (r*r - i*i) / a;
-	i = (2.0 * rtmp * i) / a;
-}
-
-void FourProductCorrelatorTester::SimulateAntenna(double time, num_t delayDirectionDEC, num_t delayDirectionRA, num_t dx, num_t dy, num_t frequency, num_t earthLattitude, num_t &r, num_t &i, size_t index)
-{
-	if(_incoherent)
-		_model.SimulateUncoherentAntenna(time, delayDirectionDEC, delayDirectionRA, dx, dy, frequency, earthLattitude, r, i, index);
-	else
-		_model.SimulateAntenna(time, delayDirectionDEC, delayDirectionRA, dx, dy, frequency, earthLattitude, r, i);
-}
-
-void FourProductCorrelatorTester::SimulateCorrelation(num_t delayDirectionDEC, num_t delayDirectionRA, const AntennaInfo &a1, const AntennaInfo &a2, const AntennaInfo &a3, const AntennaInfo &a4, num_t frequency, double totalTime, double integrationTime)
-{
-	num_t
-		x = a1.position.x,
-		y = a1.position.y,
-		z = a1.position.z,
-		dx2 = x - a2.position.x,
-		dy2 = y - a2.position.y,
-		dz2 = z - a2.position.z,
-		dx3 = x - a3.position.x,
-		dy3 = y - a3.position.y,
-		dz3 = z - a3.position.z,
-		dx4 = x - a4.position.x,
-		dy4 = y - a4.position.y,
-		dz4 = z - a4.position.z,
-		combdx = dx2 - dx3 + dx4,
-		combdy = dy2 - dy3 + dy4,
-		combdz = dz2 - dz3 + dz4;
-
-	num_t wavelength = 1.0L / frequency;
-	int index = 0;
-	for(num_t t=0.0;t<totalTime;t+=integrationTime)
-	{
-		++index;
-		double earthLattitudeApprox = t*(M_PI/12.0/60.0/60.0);
-		num_t u, v, rsub1, isub1, rsub2, isub2, rsub3, isub3, rsub4, isub4, r, i;
-		_model.GetUVPosition(u, v, earthLattitudeApprox, delayDirectionDEC, delayDirectionRA, combdx, combdy, combdz, wavelength);
-
-		// First product
-		SimulateAntenna(t, delayDirectionDEC, delayDirectionRA, 0, 0, frequency, earthLattitudeApprox, rsub1, isub1, index);
-		amplitudeSqrt(rsub1, isub1);
-		r = rsub1;
-		i = isub1;
-
-		// Second product
-		if(a2.id == a1.id)
-		{
-			rsub2 = rsub1;
-			isub2 = isub1;
-		} else {
-			SimulateAntenna(t, delayDirectionDEC, delayDirectionRA, dx2, dy2, frequency, earthLattitudeApprox, rsub2, isub2, index);
-			amplitudeSqrt(rsub2, isub2);
-		}
-		num_t rtmp = r;
-		r = r*rsub2 - (i*-isub2);
-		i = rtmp*-isub2 + i*rsub2;
-
-		// Third product
-		if(a3.id == a1.id)
-		{
-			rsub3 = rsub1;
-			isub3 = isub1;
-		} else if(a3.id == a2.id)
-		{
-			rsub3 = rsub2;
-			isub3 = isub2;
-		} else {
-			SimulateAntenna(t, delayDirectionDEC, delayDirectionRA, dx3, dy3, frequency, earthLattitudeApprox, rsub3, isub3, index);
-			amplitudeSqrt(rsub3, isub3);
-		}
-		rtmp = r;
-		r = r*rsub3 - (i*isub3);
-		i = rtmp*isub3 + i*rsub3;
-
-		// Fourth product
-		if(a4.id == a1.id)
-		{
-			rsub4 = rsub1;
-			isub4 = isub1;
-		} else if(a4.id == a2.id)
-		{
-			rsub4 = rsub2;
-			isub4 = isub2;
-		} else if(a4.id == a3.id)
-		{
-			rsub4 = rsub3;
-			isub4 = isub3;
-		} else { 
- 			SimulateAntenna(t, delayDirectionDEC, delayDirectionRA, dx4, dy4, frequency, earthLattitudeApprox, rsub4, isub4, index);
-			amplitudeSqrt(rsub4, isub4);
-		}
-		rtmp = r;
-		r = r*rsub4 - (i*-isub4);
-		i = rtmp*-isub4 + i*rsub4;
-
-		_imager.SetUVValue(u, v, r, i, 1.0);
-		_imager.SetUVValue(-u, -v, r, -i, 1.0);
-	}
-}
-
-void FourProductCorrelatorTester::SimulateTwoProdObservation(num_t delayDirectionDEC, num_t delayDirectionRA, num_t frequency)
-{
-	size_t frequencySteps = 1;
-
-	for(size_t f=0;f<frequencySteps;++f)
-	{
-		double channelFrequency = frequency + _observatorium.ChannelWidthHz() * f * 256 / frequencySteps;
-		for(size_t i=0;i<_observatorium.AntennaCount();++i)
-		{
-			for(size_t j=i+1;j<_observatorium.AntennaCount();++j)
-			{
-				if(!(i == j))
-				{
-					const AntennaInfo
-						&a1 = _observatorium.GetAntenna(i),
-						&a2 = _observatorium.GetAntenna(j);
-
-					SimulateTwoProdCorrelation(delayDirectionDEC, delayDirectionRA, a1, a2, channelFrequency, 12*60*60, 10.0);
-				}
-			}
-			std::cout << "." << std::flush;
-		}
-	}
-	std::cout << std::endl;
-}
-
-void FourProductCorrelatorTester::SimulateTwoProdCorrelation(num_t delayDirectionDEC, num_t delayDirectionRA, const AntennaInfo &a1, const AntennaInfo &a2, num_t frequency, double totalTime, double integrationTime)
-{
-	num_t
-		x = a1.position.x,
-		y = a1.position.y,
-		z = a1.position.z,
-		dx2 = x - a2.position.x,
-		dy2 = y - a2.position.y,
-		dz2 = z - a2.position.z;
-
-	num_t wavelength = 1.0L / frequency;
-	size_t index = 0;
-	for(num_t t=0.0;t<totalTime;t+=integrationTime/4)
-	{
-		double earthLattitudeApprox = t*(M_PI/12.0/60.0/60.0);
-		num_t u, v, rsub1, isub1, rsub2, isub2, r, i;
-		_model.GetUVPosition(u, v, earthLattitudeApprox, delayDirectionDEC, delayDirectionRA, dx2*2.0, dy2*2.0, dz2*2.0, wavelength);
-
-		// First product
-		SimulateAntenna(t, delayDirectionDEC, delayDirectionRA, 0, 0, frequency, earthLattitudeApprox, rsub1, isub1, index);
-		phaseMul2(rsub1, isub1);
-		r = rsub1;
-		i = isub1;
-
-		// Second product
-		if(a2.id == a1.id)
-		{
-			rsub2 = rsub1;
-			isub2 = isub1;
-		} else {
-			SimulateAntenna(t, delayDirectionDEC, delayDirectionRA, dx2, dy2, frequency, earthLattitudeApprox, rsub2, isub2, index);
-			phaseMul2(rsub2, isub2);
-		}
-		num_t rtmp = r;
-		r = r*rsub2 - (i*-isub2);
-		i = rtmp*-isub2 + i*rsub2;
-
-		_imager.SetUVValue(u, v, r, i, 1.0);
-		_imager.SetUVValue(-u, -v, r, -i, 1.0);
-
-		++index;
-	}
-}
diff --git a/CEP/DP3/AOFlagger/src/imaging/model.cpp b/CEP/DP3/AOFlagger/src/imaging/model.cpp
deleted file mode 100644
index 4911f4b3a3daf89c764d9b09c6910e1042c208ef..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/imaging/model.cpp
+++ /dev/null
@@ -1,263 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <AOFlagger/imaging/model.h>
-
-#include <AOFlagger/msio/image2d.h>
-#include <AOFlagger/msio/timefrequencydata.h>
-
-#include <AOFlagger/imaging/observatorium.h>
-#include <AOFlagger/util/rng.h>
-
-#include <iostream>
-
-Model::Model() : _noiseSigma(1.0), _sourceSigma(0.0), _integrationTime(15.0)
-{
-}
-
-Model::~Model()
-{
-}
-
-template<typename T>
-void Model::SimulateObservation(struct OutputReceiver<T> &receiver, Observatorium &observatorium, num_t delayDirectionDEC, num_t delayDirectionRA)
-{
-	const size_t channelCount = observatorium.BandInfo().channels.size();
-	const double frequency = observatorium.BandInfo().channels[0].frequencyHz;
-
-	for(size_t f=0;f<channelCount;++f)
-	{
-		double channelFrequency = frequency + observatorium.ChannelWidthHz() * f;
-		receiver.SetY(f);
-		for(size_t i=0;i<observatorium.AntennaCount();++i)
-		{
-			for(size_t j=i+1;j<observatorium.AntennaCount();++j)
-			{
-				const AntennaInfo
-					&antenna1 = observatorium.GetAntenna(i),
-					&antenna2 = observatorium.GetAntenna(j);
-				double
-					dx = antenna1.position.x - antenna2.position.x,
-					dy = antenna1.position.y - antenna2.position.y,
-					dz = antenna1.position.z - antenna2.position.z;
-
-				SimulateCorrelation(receiver, delayDirectionDEC, delayDirectionRA, dx, dy, dz, channelFrequency, observatorium.ChannelWidthHz(), 12*60*60, _integrationTime);
-			}
-		}
-	}
-}
-
-template void Model::SimulateObservation(struct OutputReceiver<UVImager> &receiver, Observatorium &observatorium, num_t delayDirectionDEC, num_t delayDirectionRA);
-template void Model::SimulateObservation(struct OutputReceiver<TimeFrequencyData> &receiver, Observatorium &observatorium, num_t delayDirectionDEC, num_t delayDirectionRA);
-
-std::pair<TimeFrequencyData, TimeFrequencyMetaDataPtr> Model::SimulateObservation(class Observatorium &observatorium, num_t delayDirectionDEC, num_t delayDirectionRA, size_t a1, size_t a2)
-{
-	const size_t channelCount = observatorium.BandInfo().channels.size();
-	const double frequency = observatorium.BandInfo().channels[0].frequencyHz;
-	
-	OutputReceiver<TimeFrequencyData> tfOutputter;
-	tfOutputter._real = Image2D::CreateZeroImagePtr((size_t) (12*60*60/_integrationTime), channelCount);
-	tfOutputter._imaginary = Image2D::CreateZeroImagePtr((size_t) (12*60*60/_integrationTime), channelCount);
-	
-	TimeFrequencyMetaData *metaData = new TimeFrequencyMetaData();
-	metaData->SetAntenna1(observatorium.GetAntenna(a1));
-	metaData->SetAntenna2(observatorium.GetAntenna(a2));
-	metaData->SetBand(observatorium.BandInfo());
-	double
-		dx = metaData->Antenna1().position.x - metaData->Antenna2().position.x,
-		dy = metaData->Antenna1().position.y - metaData->Antenna2().position.y,
-		dz = metaData->Antenna1().position.z - metaData->Antenna2().position.z;
-
-	for(size_t f=0;f<channelCount;++f)
-	{
-		double channelFrequency = frequency + observatorium.ChannelWidthHz() * f;
-		tfOutputter.SetY(f);
-		SimulateCorrelation(tfOutputter, delayDirectionDEC, delayDirectionRA, dx, dy, dz, channelFrequency, observatorium.ChannelWidthHz(), 12*60*60, _integrationTime);
-	}
-
-	std::vector<double> times;
-	std::vector<UVW> uvws;
-	num_t wavelength = 1.0L / frequency;
-	for(num_t t=0.0;t<12*60*60;t+=_integrationTime)
-	{
-		times.push_back(t);
-		num_t earthLattitudeApprox = t*M_PIn/(12.0*60.0*60.0);
-		UVW uvw;
-		GetUVPosition(uvw.u, uvw.v, earthLattitudeApprox, delayDirectionDEC, delayDirectionRA, dx, dy, dz, wavelength);
-		uvw.u = uvw.u * (299792458.0L / frequency);
-		uvw.v = uvw.v * (299792458.0L / frequency);
-		uvw.w = GetWPosition(delayDirectionDEC, delayDirectionRA, frequency, earthLattitudeApprox, dx, dy) * (299792458.0L / frequency);
-		uvws.push_back(uvw);
-	}
-	metaData->SetUVW(uvws);
-	metaData->SetObservationTimes(times);
-	FieldInfo field;
-	field.fieldId = 0;
-	field.delayDirectionDec = delayDirectionDEC;
-	field.delayDirectionDecNegCos = -cos(delayDirectionDEC);
-	field.delayDirectionDecNegSin = -sin(delayDirectionDEC);
-	field.delayDirectionRA = delayDirectionRA;
-	metaData->SetField(field);
-
-	return std::pair<TimeFrequencyData, TimeFrequencyMetaDataPtr>(TimeFrequencyData(StokesIPolarisation, tfOutputter._real, tfOutputter._imaginary), TimeFrequencyMetaDataPtr(metaData));
-}
-
-template<typename T>
-void Model::SimulateCorrelation(struct OutputReceiver<T> &receiver, num_t delayDirectionDEC, num_t delayDirectionRA, num_t dx, num_t dy, num_t dz, num_t frequency, num_t channelWidth, double totalTime, double integrationTime)
-{
-	double sampleGain = integrationTime/(12.0*60.0*60.0) * channelWidth;
-	num_t wavelength = 1.0L / frequency;
-	size_t index = 0;
-	for(num_t t=0.0;t<totalTime;t+=integrationTime)
-	{
-		const double timeInDays = t/(12.0*60.0*60.0);
-		const num_t earthLattitudeApprox = timeInDays*M_PIn;
-		num_t u, v, r1, i1, r2, i2;
-		GetUVPosition(u, v, earthLattitudeApprox, delayDirectionDEC, delayDirectionRA, dx, dy, dz, wavelength);
-		SimulateAntenna(timeInDays, delayDirectionDEC, delayDirectionRA, 0, 0, frequency, earthLattitudeApprox, r1, i1);
-		SimulateAntenna(timeInDays, delayDirectionDEC, delayDirectionRA, dx, dy, frequency, earthLattitudeApprox, r2, i2);
-		num_t
-			r = r1 * r2 - (i1 * -i2),
-			i = r1 * -i2 + r2 * i1;
-		receiver.SetUVValue(index, u, v, r * sampleGain, i * sampleGain, 1.0);
-		++index;
-	}
-}
-
-template void Model::SimulateCorrelation(struct OutputReceiver<UVImager> &receiver, num_t delayDirectionDEC, num_t delayDirectionRA, num_t dx, num_t dy, num_t dz, num_t frequency, num_t channelWidth, double totalTime, double integrationTime);
-
-void Model::SimulateAntenna(double time, num_t delayDirectionDEC, num_t delayDirectionRA, num_t dx, num_t dy, num_t frequency, num_t earthLattitude, num_t &r, num_t &i)
-{
-	r = 0.0;
-	i = 0.0;
-	num_t delayW = GetWPosition(delayDirectionDEC, delayDirectionRA, frequency, earthLattitude, dx, dy);
-	for(std::vector<Source *>::const_iterator iter=_sources.begin();iter!=_sources.end();++iter)
-	{
-		Source &source = **iter;
-		num_t w = GetWPosition(source.Dec(time), source.Ra(time), frequency, earthLattitude, dx, dy);
-		num_t fieldStrength = source.SqrtFluxIntensity(time) + RNG::Gaussian() * _sourceSigma;
-		num_t noiser, noisei;
-		RNG::ComplexGaussianAmplitude(noiser, noisei);
-		r += fieldStrength * cosn((w - delayW) * M_PIn * 2.0) + noiser * _noiseSigma;
-		i += fieldStrength * sinn((w - delayW) * M_PIn * 2.0) + noisei * _noiseSigma;
-	}
-}
-
-void Model::SimulateUncoherentAntenna(double time, num_t delayDirectionDEC, num_t delayDirectionRA, num_t dx, num_t dy, num_t frequency, num_t earthLattitude, num_t &r, num_t &i, size_t index)
-{
-	num_t delayW = GetWPosition(delayDirectionDEC, delayDirectionRA, frequency, earthLattitude, dx, dy);
-
-	//if(index%(_sources.size()+1) == _sources.size())
-	//{
-	num_t noiser, noisei;
-	RNG::ComplexGaussianAmplitude(noiser, noisei);
-	noiser *= _noiseSigma;
-	noisei *= _noiseSigma;
-	//}
-	//else {
-		Source &source = *_sources[index%_sources.size()];
-		num_t w = GetWPosition(source.Dec(time), source.Ra(time), frequency, earthLattitude, dx, dy);
-		num_t fieldStrength = source.SqrtFluxIntensity(time) + RNG::Gaussian() * _sourceSigma;
-		r = fieldStrength * cosn((w - delayW) * M_PIn * 2.0) + noiser;
-		i = fieldStrength * sinn((w - delayW) * M_PIn * 2.0) + noisei;
-	//}
-}
-
-void Model::GetUVPosition(num_t &u, num_t &v, num_t earthLattitudeAngle, num_t delayDirectionDEC, num_t delayDirectionRA, num_t dx, num_t dy, num_t dz, num_t wavelength)
-{
-	// Rotate baseline plane towards phase center, first rotate around z axis, then around x axis
-	long double raRotation = -earthLattitudeAngle + delayDirectionRA + M_PIn*0.5L;
-	long double tmpCos = cosn(raRotation);
-	long double tmpSin = sinn(raRotation);
-
-	long double dxProjected = tmpCos*dx - tmpSin*dy;
-	long double tmpdy = tmpSin*dx + tmpCos*dy;
-
-	tmpCos = cosn(-delayDirectionDEC);
-	tmpSin = sinn(-delayDirectionDEC);
-	long double dyProjected = tmpCos*tmpdy - tmpSin*dz;
-
-	// Now, the newly projected positive z axis of the baseline points to the phase center
-	long double baselineLength = sqrtn(dxProjected*dxProjected + dyProjected*dyProjected);
-	
-	long double baselineAngle;
-	if(baselineLength == 0.0)
-		baselineAngle = 0.0;
-	else {
-		baselineLength /= 299792458.0L * wavelength;
-		if(dxProjected > 0.0L)
-			baselineAngle = atann(dyProjected/dxProjected);
-		else
-			baselineAngle = M_PIn - atann(dyProjected/-dxProjected);
-	}
-		
-	u = cosn(baselineAngle)*baselineLength;
-	v = -sinn(baselineAngle)*baselineLength;
-}
-
-void Model::loadUrsaMajor(double ra, double dec, double factor)
-{
-	double
-		s = 0.00005 * factor, //scale
-		rs = 6.0 + 2.0 * factor; // stretch in dec
-	double fluxoffset = 0.0;
-
-	AddSource(dec + s*rs*40, ra + s*72, 8.0/8.0 + fluxoffset); // Dubhe
-	AddSource(dec + s*rs*-16, ra + s*81, 4.0/8.0 + fluxoffset); // Beta
-	AddSource(dec + s*rs*-45, ra + s*2, 3.0/8.0 + fluxoffset); // Gamma
-	AddSource(dec + s*rs*-6, ra + s*-27, 2.0/8.0 + fluxoffset); // Delta
-	AddSource(dec + s*rs*-4, ra + s*-85, 6.0/8.0 + fluxoffset); // Alioth
-	AddSource(dec + s*rs*2, ra + s*-131, 5.0/8.0 + fluxoffset); // Zeta
-	AddSource(dec + s*rs*-36, ra + s*-192, 7.0/8.0 + fluxoffset); // Alkaid
-
-	//AddSource(cd, cr - M_PI, 4.0);
-}
-
-void Model::loadUrsaMajorDistortingSource(double ra, double dec, double factor, bool slightlyMiss)
-{
-	if(slightlyMiss)
-	{
-		dec += 0.005;
-		ra += 0.002;
-	}
-	AddSource(dec - 0.12800 * factor, ra + 0.015 + 0.015 * factor, 4.0);
-}
-
-void Model::loadOnAxisSource(double ra, double dec, double factor)
-{
-	AddSource(dec - 0.01280 * factor, ra + 0.0015 + 0.0015 * factor, 4.0);
-}
-
-void Model::loadUrsaMajorDistortingVariableSource(double ra, double dec, double factor, bool weak, bool slightlyMiss)
-{
-	double flux = 4.0;
-	dec = dec - 0.12800 * factor;
-	ra = ra + 0.015 + 0.015 * factor;
-	if(slightlyMiss)
-	{
-		dec += 0.005;
-		ra += 0.002;
-	}
-	if(weak)
-	{
-		flux /= 100.0;
-	}
-	AddVariableSource(dec, ra, flux);
-}
-
diff --git a/CEP/DP3/AOFlagger/src/imaging/uvimager.cpp b/CEP/DP3/AOFlagger/src/imaging/uvimager.cpp
deleted file mode 100644
index 4b5851d15a1212def50fb1d057550f01de5114c1..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/imaging/uvimager.cpp
+++ /dev/null
@@ -1,535 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <AOFlagger/imaging/uvimager.h>
-
-#include <AOFlagger/msio/image2d.h>
-#include <AOFlagger/msio/mask2d.h>
-#include <AOFlagger/msio/timefrequencydata.h>
-#include <AOFlagger/msio/spatialmatrixmetadata.h>
-
-#include <AOFlagger/util/integerdomain.h>
-#include <AOFlagger/util/stopwatch.h>
-#include <AOFlagger/util/ffttools.h>
-
-UVImager::UVImager(unsigned long xRes, unsigned long yRes, ImageKind imageKind) : _xRes(xRes), _yRes(yRes), _xResFT(xRes), _yResFT(yRes), _uvReal(0), _uvImaginary(0), _uvWeights(0), _uvFTReal(0), _uvFTImaginary(0), _antennas(0), _fields(0), _imageKind(imageKind), _invertFlagging(false), _directFT(false), _ignoreBoundWarnings(false)
-{
-	_uvScaling = 0.0001L; // testing
-	Empty();
-}
-
-
-UVImager::~UVImager()
-{
-	Clear();
-}
-
-void UVImager::Clear()
-{
-	if(_uvReal != 0) {
-		delete _uvReal;
-		delete _uvImaginary;
-		delete _uvWeights;
-		_uvReal = 0;
-		_uvImaginary = 0;
-		_uvWeights = 0;
-	}
-	if(_antennas != 0) {
-		delete[] _antennas;
-		_antennas = 0;
-	}
-	if(_fields != 0) {
-		delete [] _fields;
-		_fields = 0;
-	}
-	if(_uvFTReal != 0) {
-		delete _uvFTReal;
-		delete _uvFTImaginary;
-		_uvFTReal = 0;
-		_uvFTImaginary = 0;
-	}
-}
-
-void UVImager::Empty()
-{
-	Clear();
-	_uvReal = Image2D::CreateZeroImage(_xRes, _yRes);
-	_uvImaginary = Image2D::CreateZeroImage(_xRes, _yRes);
-	_uvWeights = Image2D::CreateZeroImage(_xRes, _yRes);
-	_uvFTReal = Image2D::CreateZeroImage(_xRes, _yRes);
-	_uvFTImaginary = Image2D::CreateZeroImage(_xRes, _yRes);
-}
-
-void UVImager::Image(class MeasurementSet &measurementSet, unsigned band)
-{
-	unsigned frequencyCount = measurementSet.FrequencyCount();
-	IntegerDomain frequencies(0, frequencyCount);
-	_measurementSet = &measurementSet;
-	_band = _measurementSet->GetBandInfo(band);
-
-	Image(frequencies);
-}
-
-void UVImager::Image(class MeasurementSet &measurementSet, unsigned band, const IntegerDomain &frequencies)
-{
-	_measurementSet = &measurementSet;
-	_band = _measurementSet->GetBandInfo(band);
-
-	Image(frequencies);
-}
-
-void UVImager::Image(const IntegerDomain &frequencies)
-{
-	Empty();
-
-	_antennaCount = _measurementSet->AntennaCount();
-	_antennas = new AntennaInfo[_antennaCount];
-	for(unsigned i=0;i<_antennaCount;++i)
-		_antennas[i] = _measurementSet->GetAntennaInfo(i);
-	
-	_fieldCount = _measurementSet->FieldCount();
-	_fields = new FieldInfo[_fieldCount];
-	for(unsigned i=0;i<_fieldCount;++i)
-		_fields[i] = _measurementSet->GetFieldInfo(i);
-
-	unsigned parts = (frequencies.ValueCount()-1)/48 + 1;
-	for(unsigned i=0;i<parts;++i) {
-		std::cout << "Imaging " << i << "/" << parts << ":" << frequencies.Split(parts, i).ValueCount() << " frequencies..." << std::endl;
-		Image(frequencies.Split(parts, i), IntegerDomain(0, _antennaCount), IntegerDomain(0, _antennaCount));
-	}
-}
-
-/**
- * Add several frequency channels to the uv plane for several combinations
- * of antenna pairs.
- */
-void UVImager::Image(const IntegerDomain &frequencies, const IntegerDomain &antenna1Domain, const IntegerDomain &antenna2Domain)
-{
-	_scanCount = _measurementSet->MaxScanIndex()+1;
-	std::cout << "Requesting " << frequencies.ValueCount() << " x " << antenna1Domain.ValueCount() << " x " << antenna2Domain.ValueCount() << " x "
-		<< _scanCount << " x " << sizeof(SingleFrequencySingleBaselineData) << " = "
-		<< (frequencies.ValueCount() * antenna1Domain.ValueCount() * antenna2Domain.ValueCount() * _scanCount * sizeof(SingleFrequencySingleBaselineData) / (1024*1024))
-		<< "MB of memory..." << std::endl;
-	SingleFrequencySingleBaselineData ****data =
-		new SingleFrequencySingleBaselineData***[frequencies.ValueCount()];
-	for(unsigned f = 0;f<frequencies.ValueCount();++f) {
-		data[f] =	new SingleFrequencySingleBaselineData**[antenna1Domain.ValueCount()];
-		for(unsigned a1 = 0;a1<antenna1Domain.ValueCount();++a1) {
-			data[f][a1] = new SingleFrequencySingleBaselineData*[antenna2Domain.ValueCount()];
-			for(unsigned a2 = 0;a2<antenna2Domain.ValueCount();++a2) {
-				data[f][a1][a2] = new SingleFrequencySingleBaselineData[_scanCount];
-				for(unsigned scan = 0; scan<_scanCount;++scan) {
-					data[f][a1][a2][scan].flag = true;
-					data[f][a1][a2][scan].available = false;
-				}
-			}	
-		}
-	}
-
-	std::cout << "Reading all data for " << frequencies.ValueCount() << " frequencies..." << std::flush;
-	Stopwatch stopwatch(true);
-	MSIterator iterator(*_measurementSet);
-	size_t rows = iterator.TotalRows();
-	for(unsigned i=0;i<rows;++i,++iterator) {
-		unsigned a1 = iterator.Antenna1();
-		unsigned a2 = iterator.Antenna2();
-		if(antenna1Domain.IsIn(a1) && antenna2Domain.IsIn(a2)) {
-			unsigned scan = iterator.ScanNumber();
-			unsigned index1 = antenna1Domain.Index(a1);
-			unsigned index2 = antenna1Domain.Index(a2);
-			int field = iterator.Field();
-			double time = iterator.Time();
-			casa::Array<casa::Complex>::const_iterator cdI = iterator.CorrectedDataIterator();
-			casa::Array<bool>::const_iterator fI = iterator.FlagIterator();
-			for(int f=0;f<frequencies.GetValue(0);++f) { ++fI; ++fI; ++fI; ++fI; ++cdI; ++cdI; ++cdI; ++cdI; }
-			for(unsigned f=0;f<frequencies.ValueCount();++f) {
-				SingleFrequencySingleBaselineData &curData = data[f][index1][index2][scan];
-				casa::Complex xxData = *cdI;
-				++cdI; ++cdI; ++cdI;
-				casa::Complex yyData = *cdI;
-				++cdI;
-				curData.data = xxData + yyData;
-				bool flagging = *fI;
-				++fI; ++fI; ++fI;
-				flagging = flagging || *fI;
-				++fI;
-				curData.flag = flagging;
-				curData.field = field;
-				curData.time = time;
-				curData.available = true;
-			}
-		}
-	}
-	stopwatch.Pause();
-	std::cout << "DONE in " << stopwatch.ToString() << " (" << (stopwatch.Seconds() / (antenna1Domain.ValueCount() * antenna1Domain.ValueCount())) << "s/antenna)" << std::endl;
-
-	std::cout << "Imaging..." << std::flush;
-	stopwatch.Reset();
-	stopwatch.Start();
-	for(unsigned f = 0;f<frequencies.ValueCount();++f) {
-		for(unsigned a1 = 0;a1<antenna1Domain.ValueCount();++a1) {
-			for(unsigned a2 = 0;a2<antenna2Domain.ValueCount();++a2) {
-				Image(frequencies.GetValue(f), _antennas[antenna1Domain.GetValue(a1)], _antennas[antenna2Domain.GetValue(a2)], data[f][a1][a2]);
-			}
-		}
-	}
-	stopwatch.Pause();
-	std::cout << "DONE in " << stopwatch.ToString() << " (" << (stopwatch.Seconds() / (antenna1Domain.ValueCount() * antenna1Domain.ValueCount())) << "s/antenna)" << std::endl;
-
-	// free data
-	for(unsigned f = 0;f<frequencies.ValueCount();++f) {
-		for(unsigned a1 = 0;a1<antenna1Domain.ValueCount();++a1) {
-			for(unsigned a2 = 0;a2<antenna2Domain.ValueCount();++a2) {
-				delete[] data[f][a1][a2];
-			}
-			delete[] data[f][a1];
-		}
-		delete[] data[f];
-	}
-	delete[] data;
-}
-
-void UVImager::Image(unsigned frequencyIndex, AntennaInfo &antenna1, AntennaInfo &antenna2, SingleFrequencySingleBaselineData *data)
-{
-	num_t frequency = _band.channels[frequencyIndex].frequencyHz;
-	num_t speedOfLight = 299792458.0L;
-	AntennaCache cache;
-	cache.wavelength = speedOfLight / frequency;
-
-	// dx, dy, dz is the baseline
-	cache.dx = antenna1.position.x - antenna2.position.x;
-	cache.dy = antenna1.position.y - antenna2.position.y;
-	cache.dz = antenna1.position.z - antenna2.position.z;
-
-	//MSIterator iterator(*_measurementSet);
-	//bool baselineProvided = false;
-	//Stopwatch stopwatch(false);
-	//Stopwatch calcTimer(false);
-	for(unsigned i=0;i<_scanCount;++i) {
-			if(data[i].available) {
-				//if(!baselineProvided) {
-					//std::cout << "Now processing frequency " << frequency << " Hz (index " << frequencyIndex << "), correlation between " << antenna1.station << " " << antenna1.name << " and " << antenna2.station << " " << antenna2.name << "..." << std::flush;
-					//baselineProvided = true;
-					//stopwatch.Start();
-				//}
-				switch(_imageKind) {
-				case Homogeneous:
-				if(!data[i].flag) {
-					num_t u,v;
-					GetUVPosition(u, v, data[i], cache);
-					SetUVValue(u, v, data[i].data.real(), data[i].data.imag(), 1.0);
-					SetUVValue(-u, -v, data[i].data.real(), -data[i].data.imag(), 1.0);
-					//calcTimer.Pause();
-				} 
-				break;
-				case Flagging:
-				if((data[i].flag && !_invertFlagging) ||
-						(!data[i].flag && _invertFlagging)) {
-					num_t u,v;
-					GetUVPosition(u, v, data[i], cache);
-					SetUVValue(u, v, 1, 0, 1.0);
-					SetUVValue(-u, -v, 1, 0, 1.0);
-				}
-				break;
-			}
-		}
-	}
-}
-
-void UVImager::Image(const class TimeFrequencyData &data, class SpatialMatrixMetaData *metaData)
-{
-	if(_uvReal == 0)
-		Empty();
-	Image2DCPtr
-		real = data.GetRealPart(),
-		imaginary = data.GetImaginaryPart();
-	Mask2DCPtr
-		flags = data.GetSingleMask();
-
-	for(unsigned a2=0;a2<data.ImageHeight();++a2) {
-		for(unsigned a1=a2+1;a1<data.ImageWidth();++a1) {
-			num_t
-				vr = real->Value(a1, a2),
-				vi = imaginary->Value(a1, a2);
-			if(std::isfinite(vr) && std::isfinite(vi))
-			{
-				UVW uvw = metaData->UVW(a1, a2);
-				SetUVValue(uvw.u, uvw.v, vr, vi, 1.0);
-				SetUVValue(-uvw.u, -uvw.v, vr, -vi, 1.0);
-			}
-		}
-	}	
-}
-
-
-void UVImager::Image(const TimeFrequencyData &data, TimeFrequencyMetaDataCPtr metaData, unsigned frequencyIndex)
-{
-	if(_uvReal == 0)
-		Empty();
-
-	Image2DCPtr
-		real = data.GetRealPart(),
-		imaginary = data.GetImaginaryPart();
-	Mask2DCPtr
-		flags = data.GetSingleMask();
-
-	for(unsigned i=0;i<data.ImageWidth();++i) {
-		switch(_imageKind) {
-			case Homogeneous:
-			if(flags->Value(i, frequencyIndex)==0.0L) {
-				num_t
-					vr = real->Value(i, frequencyIndex),
-					vi = imaginary->Value(i, frequencyIndex);
-				if(std::isfinite(vr) && std::isfinite(vi))
-				{
-					num_t u,v;
-					GetUVPosition(u, v, i, frequencyIndex, metaData);
-					SetUVValue(u, v, vr, vi, 1.0);
-					SetUVValue(-u, -v, vr, -vi, 1.0);
-				}
-			} 
-			break;
-			case Flagging:
-			if((flags->Value(i, frequencyIndex)!=0.0L && !_invertFlagging) ||
-					(flags->Value(i, frequencyIndex)==0.0L && _invertFlagging)) {
-				num_t u,v;
-				GetUVPosition(u, v, i, frequencyIndex, metaData);
-				SetUVValue(u, v, 1, 0, 1.0);
-				SetUVValue(-u, -v, 1, 0, 1.0);
-			}
-			break;
-		}
-	}
-}
-
-void UVImager::ApplyWeightsToUV()
-{
-	double normFactor = _uvWeights->Sum() / ((num_t) _uvReal->Height() * _uvReal->Width());
-	for(size_t y=0;y<_uvReal->Height();++y) {
-		for(size_t x=0;x<_uvReal->Width();++x) {
-			num_t weight = _uvWeights->Value(x, y);
-			if(weight != 0.0)
-			{
-				_uvReal->SetValue(x, y, _uvReal->Value(x, y) * normFactor / weight);
-				_uvImaginary->SetValue(x, y, _uvImaginary->Value(x, y) * normFactor / weight);
-				_uvWeights->SetValue(x, y, 1.0);
-			} 
-		}
-	}
-	if(_uvFTReal != 0) {
-		delete _uvFTReal;
-		delete _uvFTImaginary;
-		_uvFTReal = 0;
-		_uvFTImaginary = 0;
-	}
-}
-
-void UVImager::SetUVValue(num_t u, num_t v, num_t r, num_t i, num_t weight)
-{
-	 // Nearest neighbour interpolation
-	long uPos = (long) floorn(u*_uvScaling*_xRes+0.5) + (_xRes/2);
-	long vPos = (long) floorn(v*_uvScaling*_yRes+0.5) + (_yRes/2);
-	if(uPos>=0 && uPos<(long) _xRes && vPos>=0 && vPos<(long) _yRes) {
-		_uvReal->AddValue(uPos, vPos, r);
-		_uvImaginary->AddValue(uPos, vPos, i);
-		_uvWeights->AddValue(uPos, vPos, weight);
-	} else {
-		if(!_ignoreBoundWarnings)
-		{
-			std::cout << "Warning! Baseline outside uv window (" << uPos << "," << vPos << ")." << 
-			"(subsequent out of bounds warnings will not be noted)" << std::endl;
-			_ignoreBoundWarnings = true;
-		}
-	}
-	// Linear interpolation
-	/*long uPos = (long) floor(u*_uvScaling*_xRes+0.5L) + _xRes/2;
-	long vPos = (long) floor(v*_uvScaling*_yRes+0.5L) + _yRes/2;
-	if(uPos>=0 && uPos<(long) _xRes && vPos>=0 && vPos<(long) _yRes) {
-		long double dx = (long double) uPos - (_xRes/2) - (u*_uvScaling*_xRes+0.5L);
-		long double dy = (long double) vPos - (_yRes/2) - (v*_uvScaling*_yRes+0.5L);
-		long double distance = sqrtn(dx*dx + dy*dy);
-		if(distance > 1.0) distance = 1.0;
-		weight *= distance;
-		_uvReal->AddValue(uPos, vPos, r*weight);
-		_uvImaginary->AddValue(uPos, vPos, i*weight);
-		_uvWeights->AddValue(uPos, vPos, weight);
-	} else {
-		std::cout << "Warning! Baseline outside uv window (" << uPos << "," << vPos << ")." << std::endl;
-	}*/
-}
-
-void UVImager::SetUVFTValue(num_t u, num_t v, num_t r, num_t i, num_t weight)
-{
-	for(size_t iy=0;iy<_yResFT;++iy)
-	{
-		for(size_t ix=0;ix<_xResFT;++ix)
-		{
-			num_t x = ((num_t) ix - (_xResFT/2)) / _uvScaling * _uvFTReal->Width();
-			num_t y = ((num_t) iy - (_yResFT/2)) / _uvScaling * _uvFTReal->Height();
-			// Calculate F(x,y) += f(u, v) e ^ {i 2 pi (x u + y v) } 
-			num_t fftRotation = (u * x + v * y) * -2.0L * M_PIn;
-			num_t fftCos = cosn(fftRotation), fftSin = sinn(fftRotation);
-			_uvFTReal->AddValue(ix, iy, (fftCos * r - fftSin * i) * weight);
-			_uvFTImaginary->AddValue(ix, iy, (fftSin * r + fftCos * i) * weight);
-		}
-	}
-
-}
-
-void UVImager::PerformFFT()
-{
-	if(_uvFTReal == 0)
-	{
-		_uvFTReal = Image2D::CreateZeroImage(_xRes, _yRes);
-		_uvFTImaginary = Image2D::CreateZeroImage(_xRes, _yRes);
-	}
-	FFTTools::CreateFFTImage(*_uvReal, *_uvImaginary, *_uvFTReal, *_uvFTImaginary);
-}
-
-void UVImager::GetUVPosition(num_t &u, num_t &v, size_t timeIndex, size_t frequencyIndex, TimeFrequencyMetaDataCPtr metaData)
-{
-	num_t frequency = metaData->Band().channels[frequencyIndex].frequencyHz;
-	u = metaData->UVW()[timeIndex].u * frequency / SpeedOfLight();
-	v = metaData->UVW()[timeIndex].v * frequency / SpeedOfLight();
-	return;
-	const Baseline &baseline = metaData->Baseline();
-	num_t delayDirectionRA = metaData->Field().delayDirectionRA;
-	num_t delayDirectionDec = metaData->Field().delayDirectionDec;
-	double time = metaData->ObservationTimes()[timeIndex];
-
-	num_t pointingLattitude = delayDirectionRA;
-	num_t earthLattitudeAngle = Date::JDToHourOfDay(Date::AipsMJDToJD(time))*M_PIn/12.0L;
-
-	// Rotate baseline plane towards source, first rotate around x axis, then around z axis
-	num_t raRotation = earthLattitudeAngle - pointingLattitude + M_PIn*0.5L;
-	num_t raCos = cosn(-raRotation);
-	num_t raSin = sinn(-raRotation);
-
-	num_t dx = baseline.antenna1.x - baseline.antenna2.x;
-	num_t dy = baseline.antenna1.y - baseline.antenna2.y;
-	num_t dz = baseline.antenna1.z - baseline.antenna2.z;
-
-	num_t decCos = cosn(delayDirectionDec);
-	num_t decSin = sinn(delayDirectionDec);
-
-	num_t
-		du = -dx * raCos * decSin - dy * raSin - dz * raCos * decCos,
-		dv = -dx * raSin * decSin + dy * raCos - dz * raSin * decCos;
-
-  /*
-	num_t dxProjected = tmpCos*dx - tmpSin*dy;
-	num_t tmpdy = tmpSin*dx + tmpCos*dy;
-
-	num_t dyProjected = tmpCos*tmpdy - tmpSin*dz;*/
-
-	// du = dx*cosn(ra) - dy*sinn(ra)
-	// dv = ( dx*sinn(ra) + dy*cosn(ra) ) * cosn(-dec) - dz * sinn(-dec)
-	// Now, the newly projected positive z axis of the baseline points to the field
-	num_t baselineLength = sqrtn(du*du + dv*dv);
-
-	num_t baselineAngle;
-	if(baselineLength == 0.0)
-		baselineAngle = 0.0;
-	else {
-		baselineLength *= frequency / SpeedOfLight();
-		if(du > 0.0L)
-			baselineAngle = atann(du/dv);
-		else
-			baselineAngle = M_PIn - atann(du/-dv);
-	}
-	u = cosn(baselineAngle)*baselineLength;
-	v = -sinn(baselineAngle)*baselineLength;
-
-	std::cout << "Calced: " << u << "," << v
-		<< ", ori: " << metaData->UVW()[timeIndex].u << "," << metaData->UVW()[timeIndex].v << "(," << metaData->UVW()[timeIndex].w << ")\n";
-}
-
-void UVImager::GetUVPosition(num_t &u, num_t &v, const SingleFrequencySingleBaselineData &data, const AntennaCache &cache)
-{
-	unsigned field = data.field;
-	num_t pointingLattitude = _fields[field].delayDirectionRA;
-
-	//calcTimer.Start();
-	num_t earthLattitudeAngle = Date::JDToHourOfDay(Date::AipsMJDToJD(data.time))*M_PIn/12.0L;
-
-	//long double pointingLongitude = _fields[field].delayDirectionDec; //not used
-
-	// Rotate baseline plane towards source, first rotate around z axis, then around x axis
-	num_t raRotation = earthLattitudeAngle - pointingLattitude + M_PIn*0.5L;
-	num_t tmpCos = cosn(raRotation);
-	num_t tmpSin = sinn(raRotation);
-
-	num_t dxProjected = tmpCos*cache.dx - tmpSin*cache.dy;
-	num_t tmpdy = tmpSin*cache.dx + tmpCos*cache.dy;
-
-	tmpCos = _fields[field].delayDirectionDecNegCos; // cosn(-pointingLongitude);
-	tmpSin = _fields[field].delayDirectionDecNegSin; //sinn(-pointingLongitude);
-	num_t dyProjected = tmpCos*tmpdy - tmpSin*cache.dz;
-	// long double dzProjected = tmpSin*tmpdy + tmpCos*dzAnt; // we don't need it
-
-	// Now, the newly projected positive z axis of the baseline points to the field
-
-	num_t baselineLength = sqrtn(dxProjected*dxProjected + dyProjected*dyProjected);
-	
-	num_t baselineAngle;
-	if(baselineLength == 0.0L)
-		baselineAngle = 0.0L;
-	else {
-		baselineLength /= cache.wavelength;
-		if(dxProjected > 0.0L)
-			baselineAngle = atann(dyProjected/dxProjected);
-		else
-			baselineAngle = M_PIn - atann(dyProjected/-dxProjected);
-	}
-		
-
-	u = cosn(baselineAngle)*baselineLength;
-	v = -sinn(baselineAngle)*baselineLength;
-}
-
-num_t UVImager::GetFringeStopFrequency(size_t timeIndex, const Baseline &/*baseline*/, num_t /*delayDirectionRA*/, num_t delayDirectionDec, num_t /*frequency*/, TimeFrequencyMetaDataCPtr metaData)
-{
-	// earthspeed = rad / sec
-	const num_t earthSpeed = 2.0L * M_PIn / (24.0L * 60.0L * 60.0L);
-	//num_t earthLattitudeAngle =
-	//	Date::JDToHourOfDay(Date::AipsMJDToJD(metaData->ObservationTimes()[timeIndex]))*M_PIn/12.0L;
-	//num_t raSin = sinn(-delayDirectionRA - earthLattitudeAngle);
-	//num_t raCos = cosn(-delayDirectionRA - earthLattitudeAngle);
-	//num_t dx = baseline.antenna2.x - baseline.antenna1.x;
-	//num_t dy = baseline.antenna2.y - baseline.antenna1.y;
-	//num_t wavelength = 299792458.0L / frequency;
-	return -earthSpeed * metaData->UVW()[timeIndex].u * cosn(delayDirectionDec);
-}
-
-num_t UVImager::GetFringeCount(size_t timeIndexStart, size_t timeIndexEnd, unsigned channelIndex, const TimeFrequencyMetaDataCPtr metaData)
-{
-	// For now, I've made this return the negative fringe count, because it does not match
-	// with the fringe stop frequency returned above otherwise; probably because of a
-	// mismatch in the signs of u,v,w somewhere...
-	return -(metaData->UVW()[timeIndexEnd].w - metaData->UVW()[timeIndexStart].w) * metaData->Band().channels[channelIndex].frequencyHz / 299792458.0L;
-}
-
-void UVImager::InverseImage(class MeasurementSet &prototype, unsigned /*band*/, const Image2D &/*uvReal*/, const Image2D &/*uvImaginary*/, unsigned antenna1Index, unsigned antenna2Index)
-{
-	_timeFreq = Image2D::CreateZeroImage(prototype.MaxScanIndex()+1, prototype.FrequencyCount());
-	AntennaInfo antenna1, antenna2;
-	antenna1 = prototype.GetAntennaInfo(antenna1Index);
-	antenna2 = prototype.GetAntennaInfo(antenna2Index);
-	//Image2D *temp = Image2D::CreateEmptyImage(uvReal.Width(), uvReal.Height());
-}
diff --git a/CEP/DP3/AOFlagger/src/imaging/zenithimager.cpp b/CEP/DP3/AOFlagger/src/imaging/zenithimager.cpp
deleted file mode 100644
index 1f9052ce8e9f0c7d02d98eaa86ed752ef8e6b0ec..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/imaging/zenithimager.cpp
+++ /dev/null
@@ -1,124 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2012 by A.R. Offringa                                   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#include <AOFlagger/imaging/zenithimager.h>
-
-#include <AOFlagger/msio/antennainfo.h>
-
-#include <AOFlagger/util/ffttools.h>
-
-ZenithImager::ZenithImager() : _resolution(0), _totalCount(0), _outsideCount(0)
-{
-}
-
-void ZenithImager::Initialize(size_t resolution)
-{
-	_resolution = resolution;
-	_real = Image2D::CreateZeroImagePtr(resolution, resolution);
-	_imaginary = Image2D::CreateZeroImagePtr(resolution, resolution);
-	_weights = Image2D::CreateZeroImagePtr(resolution, resolution);
-}
-
-void ZenithImager::Clear()
-{
-	_real->SetAll(0.0);
-	_imaginary->SetAll(0.0);
-	_weights->SetAll(0.0);
-	_totalCount = 0;
-	_outsideCount = 0;
-}
-
-void ZenithImager::Add(const BandInfo &band, const std::complex<float> *samples, const bool *isRFI, double u, double v, double w, double phaseRotation)
-{
-	size_t n = band.channels.size();
-	for(size_t f=0;f<n;++f)
-	{
-		if(!isRFI[f])
-		{
-			const double wavelength = Wavelength(band.channels[f].frequencyHz);
-			const double r = samples[f].real(), i = samples[f].imag();
-			add(band, r, i, u, v, w, phaseRotation, wavelength);
-		}
-	}
-}
-
-void ZenithImager::add(const BandInfo &band, double r, double i, double u, double v, double w, double phaseRotation, double wavelength)
-{
-	const double norm = 1.1; //2.0*M_PI; //sqrt(u*u + v*v + w*w) / sqrt(u*u + v*v);
-	const double factor = 1.0 / wavelength;
-	u *= factor * norm;
-	v *= factor * norm;
-	//w *= factor;
-	
-	const double dcpixel = (double) _resolution * 0.5;
-	
-	// Calculate the pixel indices. Because we want the image domain to
-	// have a range of -1 to 1 (which is the horizon), the uv-domain should
-	// go from 1/-1 to 1/1. Hence, the u&v need to be multiplied by two.
-	int uPos = (int) round(u*2.0 + dcpixel);
-	int vPos = (int) round(v*2.0 + dcpixel);
-	
-	if(uPos >= 0 && vPos >= 0 && uPos < (int) _resolution && vPos < (int) _resolution)
-	{
-		phaseRotation *= factor * 2.0 * M_PI;
-		const double sinR = sin(phaseRotation), cosR = cos(phaseRotation);
-		const double rotatedR = r * cosR - i * sinR;
-		const double rotatedI = r * sinR + i * cosR;
-		
-		_real->AddValue(uPos, vPos, rotatedR);
-		_imaginary->AddValue(uPos, vPos, rotatedI);
-		_weights->AddValue(uPos, vPos, 1.0);
-		
-		int uPos2 = (int) round(dcpixel - u*2.0);
-		int vPos2 = (int) round(dcpixel - v*2.0);
-		if(uPos2 >= 0 && vPos2 >= 0 && uPos2 < (int) _resolution && vPos2 < (int) _resolution)
-		{
-			_real->AddValue(uPos2, vPos2, rotatedR);
-			_imaginary->AddValue(uPos2, vPos2, -rotatedI);
-			_weights->AddValue(uPos2, vPos2, 1.0);
-		}
-	} else {
-		_outsideCount++;
-	}
-	
-	++_totalCount;
-}
-
-void ZenithImager::FourierTransform(Image2DPtr &real, Image2DPtr &imaginary)
-{
-	std::cout << "Performing FT of " << _totalCount << " samples, " << _outsideCount << " (" << round(100.0*(double) _outsideCount/(double) _totalCount) << "%) fell outside uv area... " << std::flush;
-	
-	double normFactor = _weights->Sum() / ((num_t) _real->Height() * _real->Width());
-	for(size_t y=0;y<_real->Height();++y) {
-		for(size_t x=0;x<_real->Width();++x) {
-			num_t weight = _weights->Value(x, y);
-			if(weight != 0.0)
-			{
-				_real->SetValue(x, y, _real->Value(x, y) * normFactor / weight);
-				_imaginary->SetValue(x, y, _imaginary->Value(x, y) * normFactor / weight);
-				_weights->SetValue(x, y, 1.0);
-			} 
-		}
-	}
-	
-	real = Image2D::CreateUnsetImagePtr(_resolution, _resolution);
-	imaginary = Image2D::CreateUnsetImagePtr(_resolution, _resolution);
-	FFTTools::CreateFFTImage(*_real, *_imaginary, *real, *imaginary);
-}
diff --git a/CEP/DP3/AOFlagger/src/imgzenith.cpp b/CEP/DP3/AOFlagger/src/imgzenith.cpp
deleted file mode 100644
index fe14560ac29ba485952820b82da79b5e707b34cd..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/imgzenith.cpp
+++ /dev/null
@@ -1,253 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2011 by A.R. Offringa                                   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#include <tables/Tables/Table.h>
-
-#include <measures/Measures/UVWMachine.h>
-#include <measures/Measures/MEpoch.h>
-#include <measures/Measures/MBaseline.h>
-#include <measures/Measures/MCBaseline.h>
-
-#include <ms/MeasurementSets/MeasurementSet.h>
-
-#include <AOFlagger/msio/antennainfo.h>
-#include <AOFlagger/msio/measurementset.h>
-
-#include <AOFlagger/imaging/zenithimager.h>
-#include <AOFlagger/msio/pngfile.h>
-
-const casa::Unit radUnit("rad");
-const casa::Unit dayUnit("d");
-const casa::Unit degUnit("deg");
-
-void repoint(casa::MDirection &phaseDirection, casa::MPosition &position, const casa::MEpoch &obstime, double &u, double &v, double &w, double &phaseRotation, casa::MPosition &a1, casa::MPosition &a2, bool verbose)
-{
-	//MPosition location(MVPosition(Quantity(1, "km"), Quantity(150, "deg"), Quantity(20, "deg")), MPosition::WGS84);
-	
-	//casa::MEpoch obstime(casa::Quantity(t, dayUnit), casa::MEpoch::UTC);
-	//if(verbose)
-	//	std::cout << "Time=" << obstime.getValue() << '\n';
-	casa::MeasFrame timeAndLocation(obstime, position);
-	
-	casa::MDirection::Ref refApparent(casa::MDirection::AZEL, timeAndLocation);
-	
-	// Calculate zenith
-	casa::MDirection outDirection(
-		casa::Quantity(0.0, radUnit),       // Az
-		casa::Quantity(0.5*M_PI, radUnit),  // El
-	refApparent);
-	casa::MDirection j2000Direction =
-		casa::MDirection::Convert(outDirection, casa::MDirection::J2000)();
-	if(verbose)
-		std::cout << "Zenith=" << j2000Direction.getAngle().getValue(degUnit) << '\n';
-	
-	// Construct a CASA UVW converter
-	casa::UVWMachine uvwConverter(j2000Direction, phaseDirection);
-	casa::Vector<double> uvwVector(3);
-	uvwVector[0] = u;
-	uvwVector[1] = v;
-	uvwVector[2] = w;
-	//std::cout << "In: " << u << ',' << v << ',' << w << '\n';
-	phaseRotation = uvwConverter.getPhase(uvwVector);
-	// std::cout << "Phase shift: " << phaseRotation << '\n';
-	//uvwConverter.convertUVW(uvwVector); // getPhase already does that!
-	u = uvwVector[0];
-	v = uvwVector[1];
-	w = uvwVector[2];
-	//std::cout << "Out: " << u << ',' << v << ',' << w << '\n';
-	//std::cout << "Phase centre: " << uvwConverter.phaseCenter().getValue() << '\n';
-}
-
-
-void repoint(casa::MDirection &phaseDirection, casa::MDirection &newDirection, double &u, double &v, double &w, double &phaseRotation)
-{
-	// Construct a CASA UVW converter
-	casa::UVWMachine uvwConverter(newDirection, phaseDirection);
-	casa::Vector<double> uvwVector(3);
-	uvwVector[0] = u;
-	uvwVector[1] = v;
-	uvwVector[2] = w;
-	phaseRotation = uvwConverter.getPhase(uvwVector);
-	u = uvwVector[0];
-	v = uvwVector[1];
-	w = uvwVector[2];
-}
-
-
-int main(int argc, char *argv[])
-{
-	std::string filename(argv[1]);
-	size_t integrationSteps, resolution, startTimeIndex;
-	bool useFlags;
-	if(argc >= 3)
-		integrationSteps = atoi(argv[2]);
-	else
-		integrationSteps = 60;
-	if(argc >= 4)
-		resolution = atoi(argv[3]);
-	else
-		resolution = 1024;
-	if(argc >= 5)
-		startTimeIndex = atoi(argv[4]);
-	else
-		startTimeIndex = 0;
-	if(argc >= 6)
-		useFlags = atoi(argv[4])==1;
-	else
-		useFlags = true;
-	
-	std::cout << "Opening " << filename << "...\n";
-	
-	const unsigned polarizationCount = MeasurementSet::GetPolarizationCount(filename);
-	const BandInfo band = MeasurementSet::GetBandInfo(filename, 0);
-	
-	const unsigned antennaIndex = 0;
-	
-	casa::MeasurementSet table(argv[1]);
-	casa::MEpoch::ROScalarColumn timeColumn(table, "TIME");
-	casa::ROArrayColumn<double> uvwColumn(table, "UVW");
-	casa::ROScalarColumn<int> ant1Column(table, "ANTENNA1");
-	casa::ROScalarColumn<int> ant2Column(table, "ANTENNA2");
-	casa::ROArrayColumn<casa::Complex> dataColumn(table, "DATA");
-	casa::ROArrayColumn<bool> flagColumn(table, "FLAG");
-	
-	casa::Table antennaTable(table.antenna());
-	casa::MPosition::ROScalarColumn antPositionColumn(antennaTable, "POSITION");
-	casa::ROScalarColumn<casa::String> antNameColumn(antennaTable, "NAME");
-        std::vector<casa::MPosition> antennaPositions(antennaTable.nrow());
-	for(unsigned i = 0;i<antennaTable.nrow();++i)
-	{
-		antennaPositions[i] = antPositionColumn(i);
-	}
-	casa::MPosition position = antennaPositions[0];
-	std::cout << "Frame of reference of antennae: " << position.getRefString() << '\n';
-	std::cout << "Imaging zenith of antenna " << antNameColumn(antennaIndex)
-		<< ", pos=" << position.getValue() << '\n';
-		
-	casa::Table fieldTable(table.field());
-	casa::MDirection::ROArrayColumn phaseDirColumn(fieldTable, "PHASE_DIR");
-	casa::MDirection phaseDirection = *phaseDirColumn(0).begin();
-	std::cout << "Phase direction: " << phaseDirection.getAngle().getValue(degUnit) << '\n';
-
-	std::complex<float> *samples[polarizationCount];
-	bool *isRFI[polarizationCount];
-	for(unsigned p = 0; p < polarizationCount; ++p)
-	{
-		isRFI[p] = new bool[band.channels.size()];
-		samples[p] = new std::complex<float>[band.channels.size()];
-	}
-
-	unsigned row = 0;
-	ZenithImager imager;
-	imager.Initialize(resolution);
-	size_t timeStep = 0;
-	bool directionIsSet = false;
-	
-	casa::MEpoch curT = timeColumn(0);
-	while(row<table.nrow() && timeStep < startTimeIndex)
-	{
-		if(timeColumn(row).getValue() != curT.getValue())
-		{
-			++timeStep;
-			curT = timeColumn(row);
-		}
-		++row;
-	}
-	
-	while(row<table.nrow())
-	{
-		const casa::MEpoch t = timeColumn(row);
-		casa::MDirection j2000Direction;
-		
-		if(!directionIsSet)
-		{
-			// Calculate zenith for this time range
-			casa::MeasFrame timeAndLocation(t, position);
-			casa::MDirection::Ref refApparent(casa::MDirection::AZEL, timeAndLocation);
-			casa::MDirection outDirection(
-				casa::Quantity(0.0, radUnit),       // Az
-				casa::Quantity(0.5*M_PI, radUnit),  // El
-			refApparent);
-			j2000Direction =
-				casa::MDirection::Convert(outDirection, casa::MDirection::J2000)();
-			std::cout << "Zenith=" << j2000Direction.getAngle().getValue(degUnit) << '\n';
-			directionIsSet = true;
-		}
-		
-		do
-		{
-			int a1 = ant1Column(row), a2 = ant2Column(row);
-			if(a1 != a2)
-			{
-				casa::Array<double> uvw = uvwColumn(row);
-				casa::Array<double>::const_iterator uvw_i = uvw.begin();
-				double u = *uvw_i; ++uvw_i;
-				double v = *uvw_i; ++uvw_i;
-				double w = *uvw_i;
-				double phaseRotation;
-				repoint(phaseDirection, j2000Direction, u, v, w, phaseRotation);
-				
-				const casa::Array<casa::Complex> dataArray = dataColumn(row);
-				const casa::Array<bool> flagArray = flagColumn(row);
-				
-				casa::Array<casa::Complex>::const_iterator dataIter = dataArray.begin();
-				casa::Array<bool>::const_iterator flagIter = flagArray.begin();
-				
-				for(unsigned channel = 0; channel<band.channels.size(); ++channel)
-				{
-					for(unsigned p = 0; p < polarizationCount; ++p)
-					{
-						samples[p][channel] = *dataIter;
-						if(useFlags)
-							isRFI[p][channel] = *flagIter;
-						else
-							isRFI[p][channel] = false;
-						
-						++dataIter;
-						++flagIter;
-					}
-				}
-				imager.Add(band, samples[0], isRFI[0], u, v, w, phaseRotation);
-			}
-			++row;
-		} while(row<table.nrow() && timeColumn(row).getValue() == t.getValue());
-		
-		timeStep++;
-		if(timeStep % integrationSteps == 0)
-		{
-			Image2DPtr real, imaginary;
-			imager.FourierTransform(real, imaginary);
-			
-			std::stringstream s;
-			if(timeStep < 10000) s << '0';
-			if(timeStep < 1000) s << '0';
-			if(timeStep < 100) s << '0';
-			if(timeStep < 10) s << '0';
-			s << timeStep << ".png";
-			BlackRedMap map;
-			std::cout << "Saving " << s.str() << "... " << std::flush;
-			PngFile::Save(*real, std::string("zen/") + s.str(), map);
-			PngFile::Save(*imager.UVReal(), std::string("zen-uv/") + s.str(), map);
-			imager.Clear();
-			std::cout << "Done.\n";
-			directionIsSet = false;
-		}
-	}
-}
diff --git a/CEP/DP3/AOFlagger/src/ms2uv.cpp b/CEP/DP3/AOFlagger/src/ms2uv.cpp
deleted file mode 100644
index 4d930692dd97d9fd5fd199f07402d48ae28bd8d1..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/ms2uv.cpp
+++ /dev/null
@@ -1,118 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-//#include <iostream>
-
-//#include "timefrequencyimager.h"
-//#include "methodtester.h"
-
-#include <iostream>
-#include <cstdlib>
-#include <sstream>
-
-#include "msio/measurementset.h"
-#include "msio/image2d.h"
-#include "msio/pngfile.h"
-#include "msio/timefrequencyimager.h"
-
-#include "rfi/localfitmethod.h"
-#include "rfi/methoditerator.h"
-#include "rfi/mitigationtester.h"
-#include "rfi/thresholdtools.h"
-#include "rfi/tiledimage.h"
-
-#include "types.h"
-
-#include "rfi/svdmitigater.h" //needs to be last
-
-using namespace std;
-
-int main(int argc, char *argv[])
-{
-	cout << "Checking commandline..." << endl;
-
-	int pindex = 1;
-	bool showFlagging = true, winsorizedStretch = false, useColor = true;
-	while(pindex < argc && argv[pindex][0] == '-') {
-		string parameter = argv[pindex]+1;
-		if(parameter == "nf") { showFlagging = false; }
-		else if(parameter == "wins") { winsorizedStretch = true; }
-		else if(parameter == "bw") { useColor = false; }
-		else {
-			cerr << "Unknown parameter: -" << parameter << endl;
-			return -1;
-		}
-		++pindex;
-	}
-
-
-	string msFilename, outputFile;
-	unsigned antenna1, antenna2, band, pol;
-	if(argc-pindex < 6)
-	{
-		cerr << "Syntax:\n\t" << argv[0] << " [options] <ms> <antenna1> <antenna2> <band> <polarisationIndex> <outputfile>\n"
-					"\toptions can be:\n\t-nf don't show flagging.\n\t-wins stretch the contrast with a Winsorized approach\n\t-bw do not use colors for representing the data\n";
-		return -1;
-	} else
-	{
-		msFilename = argv[pindex];
-		antenna1 = atoi(argv[pindex+1]);
-		antenna2 = atoi(argv[pindex+2]);
-		band = atoi(argv[pindex+3]);
-		pol = atoi(argv[pindex+4]);
-		outputFile = argv[pindex+5];
-
-		MeasurementSet set(msFilename);
-		TimeFrequencyImager imager(set);
-		imager.SetReadFlags(true);
-		cout << "Reading measurement set (a1=" << antenna1 << ", a2=" << antenna2 << ", band=" << band << ")..." << endl;
-		imager.Image(antenna1, antenna2, band);
-		Image2DCPtr image;
-		Mask2DCPtr flag;
-		cout << "Saving png file for polarisation " << pol << "..." << endl;
-		switch(pol) {
-			case 0: image = imager.RealXX(); flag = imager.FlagXX(); break; 
-			case 1: image = imager.RealXY(); flag = imager.FlagXY(); break; 
-			case 2: image = imager.RealYX(); flag = imager.FlagYX(); break; 
-			case 3: image = imager.RealYY(); flag = imager.FlagYY(); break; 
-		}
-		long double mean, stddev;
-		if(!showFlagging) {
-			flag = Mask2D::CreateSetMaskPtr<false>(image->Width(), image->Height());
- 		}
-		ThresholdTools::MeanAndStdDev(image, flag, mean, stddev);
-		cout << "Mean: " << mean << ", stddev: " << stddev << endl;
-		ThresholdTools::WinsorizedMeanAndStdDev(image, flag, mean, stddev);
-		cout << "W-Mean: " << mean << ", w-stddev: " << stddev << endl;
-		long double max = ThresholdTools::MaxValue(image, flag);
-		long double min = ThresholdTools::MinValue(image, flag);
-		cout << "Min: " << min << ", max: " << max << endl;
-		unsigned count = flag->GetCount<true>();
-		cout << "Flagged count: " << count << " (" <<
-            round(1000.0 * count / (flag->Width()*flag->Height())) / 10.0 << "%)" << endl;
-		
-		MethodIterator::SaveFlaggingToPng(image, flag, outputFile, &imager.BandInfo(), showFlagging, winsorizedStretch, useColor);
-		return 0;
-	}
-}
diff --git a/CEP/DP3/AOFlagger/src/msinfo.cpp b/CEP/DP3/AOFlagger/src/msinfo.cpp
deleted file mode 100644
index 430a2555304d9c9c640a2da8c02bc15f4afe65ce..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/msinfo.cpp
+++ /dev/null
@@ -1,248 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <iostream>
-#include <cstdlib>
-#include <sstream>
-#include <vector>
-
-#include <AOFlagger/configuration.h>
-
-#ifdef HAS_LOFARSTMAN
-#include <LofarStMan/Register.h>
-#endif // HAS_LOFARSTMAN                                                       
-
-#include <AOFlagger/msio/measurementset.h>
-#include <AOFlagger/msio/antennainfo.h>
-#include <AOFlagger/msio/timefrequencyimager.h>
-
-#include <AOFlagger/strategy/algorithms/thresholdtools.h>
-
-using namespace std;
-
-void AddLengths(Mask2DCPtr mask, int *counts, int countSize);
-
-std::string BoolToStr(bool val)
-{
-	if(val)
-		return "true";
-	else
-		return "false";
-}
-
-int main(int argc, char *argv[])
-{
-	if(argc < 2) {
-		cout << "This program will provide you general information about a measurement set.\nUsage:\n\t" << argv[0] << " [options] <measurement set>\n"
-		     << endl;
-		exit(-1);
-	}
-
-#ifdef HAS_LOFARSTMAN
-	register_lofarstman();
-#endif // HAS_LOFARSTMAN
-
-	//bool saveFlagLength = false;
-	//string flagLengthFile;
-	bool antennaeList = false;
-	int pindex = 1;
-	while(pindex < argc && argv[pindex][0] == '-') {
-		string parameter = argv[pindex]+1;
-		if(parameter == "antennae")
-		{
-			antennaeList = true;
-		} else
-		/*if(parameter == "flaglength") {
-			saveFlagLength = true;
-			flagLengthFile = argv[pindex+1];
-			++pindex;
-		} else*/
-		{
-			cerr << "Bad parameter: -" << parameter << endl;
-			exit(-1);
-		}
-		++pindex;
-	}
-	
-	string measurementFile = argv[pindex];
-	if(antennaeList)
-	{
-		MeasurementSet set(measurementFile);
-		const size_t antennaCount = set.AntennaCount();
-		for(size_t i=0;i<antennaCount;++i)
-		{
-			cout.width(16);
-			cout.precision(16);
-			const AntennaInfo antenna = set.GetAntennaInfo(i);
-			cout << antenna.id << '\t' << antenna.position.Latitude()*180.0/M_PI << '\t' << antenna.position.Longitude()*180.0/M_PI << '\t' << antenna.position.Altitude() << '\n';
-		}
-	}
-	else {
-		cout << "Opening measurementset " << measurementFile << endl; 
-		MeasurementSet set(measurementFile);
-		size_t antennaCount = set.AntennaCount();
-		cout << "Number of antennea: " << antennaCount << endl;
-		cout << "Number of time scans: " << (set.MaxScanIndex() - set.MinScanIndex()) << endl;
-		cout << "Number of frequencies: " << set.FrequencyCount() << endl;
-		cout << "Number of fields: " << set.FieldCount() << endl;
-		cout << "Last index of spectral band: " << set.MaxSpectralBandIndex() << endl;
-		casa::Table *table = set.OpenTable(false);
-		cout << "Has DATA column: " << BoolToStr(table->tableDesc().isColumn("DATA")) << "\n";
-		cout << "Has CORRECTED_DATA column: " << BoolToStr(table->tableDesc().isColumn("CORRECTED_DATA")) << "\n";
-		cout << "Has MODEL_DATA column: " << BoolToStr(table->tableDesc().isColumn("MODEL_DATA")) << "\n";
-		delete table;
-		std::vector<long double> baselines;
-		for(size_t i=0;i<antennaCount;++i)
-		{
-			cout << "==Antenna " << i << "==\n";
-			AntennaInfo info = set.GetAntennaInfo(i);
-			cout <<
-				"Diameter: " << info.diameter << "\n"
-				"Name: " << info.name << "\n"
-				"Position: " << info.position.ToString() << "\n"
-				"Mount: " << info.mount << "\n"
-				"Station: " << info.station << "\n"
-				"Providing baselines: ";
-			for(size_t j=0;j<antennaCount;++j) {
-				AntennaInfo info2 = set.GetAntennaInfo(j);
-				Baseline b(info.position, info2.position);
-				long double dist = b.Distance();
-				long double angle = b.Angle() * 180.0 / M_PIn;
-				cout << dist << "m/" << angle << "` ";
-				baselines.push_back(dist);
-			}
-			cout << "\n" << endl;
-		}
-		sort(baselines.begin(), baselines.end());
-		cout << "All provided baselines: ";
-		unsigned i=0;
-		while(i<baselines.size()-1) {
-			if(baselines[i+1]-baselines[i] < 1.0)
-				baselines.erase(baselines.begin() + i);
-			else
-				++i;
-		}
-		for(vector<long double>::const_iterator i=baselines.begin();i!=baselines.end();++i)
-			cout << (*i) << " ";
-		cout << endl;
-
-		for(unsigned i=0;i<=set.MaxSpectralBandIndex();++i) {
-			cout << "== Spectral band index " << i << " ==" << endl;
-			BandInfo bandInfo = set.GetBandInfo(i);
-			cout << "Channel count: " << bandInfo.channels.size() << std::endl;
-			cout << "Channels: ";
-			for(unsigned j=0;j<bandInfo.channels.size();++j) {
-				if(j > 0) cout << ", ";
-				cout << round(bandInfo.channels[j].frequencyHz/1000000) << "MHz";
-			}
-			cout << endl;
-		}
-		
-		for(unsigned i=0;i<set.FieldCount();++i) {
-			FieldInfo fieldInfo = set.GetFieldInfo(i);
-			cout << "Field " << i << ":\n\tdelay direction=" << fieldInfo.delayDirectionDec << " dec, " << fieldInfo.delayDirectionRA << "ra.\n\tdelay direction (in degrees)=" << (fieldInfo.delayDirectionDec/M_PIn*180.0L) << " dec," << (fieldInfo.delayDirectionRA/M_PIn*180.0L) << " ra." << endl;
-		}
-
-		/*
-		long unsigned flaggedCount = 0;
-		long unsigned sampleCount = 0;
-		for(unsigned b=0;b<=set.MaxSpectralBandIndex();++b) {
-			cout << "Processing band " << b << "..." << endl;
-			int lengthsSize = set.MaxScanIndex()+1;
-			int *lengthCounts = new int[lengthsSize];
-			for(int i=0;i<lengthsSize;++i)
-				lengthCounts[i] = 0;
-			MeasurementSet set(measurementFile);
-			TimeFrequencyImager imager(set);
-			for(unsigned a1=0;a1<set.AntennaCount();++a1) {
-				for(unsigned a2=a1;a2<set.AntennaCount();++a2) {
-					//std::cout << "A" << a1 << " vs A" << a2 << endl;
-					imager.SetReadData(false);
-					imager.SetReadFlags(true);
-					try {
-						imager.Image(a1, a2, b);
-					} catch(std::exception &e) {
-						std::cerr << "Error reading baseline " << a1 << " x " << a2 << ": " << e.what() << std::endl;
-					}
-					if(imager.HasFlags()) {
-						long unsigned thisCount;
-						long unsigned thisSamples;
-
-						thisCount = imager.FlagXX()->GetCount<true>();
-						thisSamples = imager.FlagXX()->Width()*imager.FlagXX()->Height();
-
-						thisCount += imager.FlagXY()->GetCount<true>();
-						thisSamples += imager.FlagXY()->Width()*imager.FlagXY()->Height();
-
-						thisCount += imager.FlagYX()->GetCount<true>();
-						thisSamples += imager.FlagYX()->Width()*imager.FlagYX()->Height();
-
-						thisCount += imager.FlagYY()->GetCount<true>();
-						thisSamples += imager.FlagYY()->Width()*imager.FlagYY()->Height();
-
-					if(thisCount == 0 || round(1000.0L * (long double) thisCount / thisSamples)*0.1L == 100.0L) {
-							//cout << " (ignored)";
-						} else {
-							
-							cout << "Flagging for antenna " << set.GetAntennaInfo(a1).name
-								<< " x " << set.GetAntennaInfo(a2).name << ": "
-								<< 0.1L * round(1000.0L * (long double) thisCount / thisSamples) << "%" << endl;
-							flaggedCount += thisCount;
-							sampleCount += thisSamples;
-							if(saveFlagLength)
-							{
-								AddLengths(imager.FlagXX(), lengthCounts, lengthsSize);
-								AddLengths(imager.FlagXY(), lengthCounts, lengthsSize);
-								AddLengths(imager.FlagYX(), lengthCounts, lengthsSize);
-								AddLengths(imager.FlagYY(), lengthCounts, lengthsSize);
-							}
-						}
-					}
-				}
-			}
-			cout << "Total percentage RFI in this band: " << round(flaggedCount*1000.0/sampleCount)/10.0 << "% "
-					<< "(" << flaggedCount << " / " << sampleCount << ")" << endl;
-			
-			if(saveFlagLength) {
-				num_t *data = new num_t[lengthsSize];
-				for(int i=0;i<lengthsSize;++i)
-					data[i] = lengthCounts[i];
-				if(set.FrequencyCount() < (set.MaxScanIndex()+1) && set.FrequencyCount()>2 && data[set.FrequencyCount()-1] > data[set.FrequencyCount()-2])
-					data[set.FrequencyCount()-1] = data[set.FrequencyCount()-2];
-				ThresholdTools::OneDimensionalGausConvolution(data, lengthsSize, 200.0);
-				ofstream f(flagLengthFile.c_str());
-				for(int i = 0; i<lengthsSize;++i) {
-					f << (i+1) << "\t" << lengthCounts[i] << "\t" << data[i] << endl;
-				}
-				f.close();
-			}
-			delete[] lengthCounts;
-		}*/
-		return EXIT_SUCCESS;
-	}
-}
-
-void AddLengths(Mask2DCPtr mask, int *counts, int countSize)
-{
-	int *countTmp = new int[countSize];
-	ThresholdTools::CountMaskLengths(mask, countTmp, countSize);
-	for(int i=0;i<countSize;++i)
-		counts[i] += countTmp[i];
-	delete[] countTmp; 
-}
diff --git a/CEP/DP3/AOFlagger/src/msio/baselinematrixloader.cpp b/CEP/DP3/AOFlagger/src/msio/baselinematrixloader.cpp
deleted file mode 100644
index cebc8ecf2d4b6f243a121922ea77a1aa2f473bab..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/msio/baselinematrixloader.cpp
+++ /dev/null
@@ -1,411 +0,0 @@
-#include <AOFlagger/msio/baselinematrixloader.h>
-
-#include <stdexcept>
-
-#include <tables/Tables/ExprNode.h>
-
-#include <AOFlagger/msio/arraycolumniterator.h>
-#include <AOFlagger/msio/scalarcolumniterator.h>
-#include <AOFlagger/msio/spatialmatrixmetadata.h>
-
-BaselineMatrixLoader::BaselineMatrixLoader(MeasurementSet &measurementSet)
-	: _sortedTable(0), _tableIter(0), _currentIterIndex(0), _measurementSet(measurementSet), _timeIndexCount(0), _metaData(0)
-{
-	casa::Table *rawTable = _measurementSet.OpenTable();
-	casa::Block<casa::String> names(4);
-	names[0] = "DATA_DESC_ID";
-	names[1] = "TIME";
-	names[2] = "ANTENNA1";
-	names[3] = "ANTENNA2";
-	_sortedTable = new casa::Table(rawTable->sort(names));
-	delete rawTable;
-
-	casa::Block<casa::String> selectionNames(2);
-	selectionNames[0] = "DATA_DESC_ID";
-	selectionNames[1] = "TIME";
-	casa::TableIterator iter(*_sortedTable, selectionNames, casa::TableIterator::Ascending, casa::TableIterator::NoSort);
-	while(!iter.pastEnd())
-	{
-		iter.next();
-		++_timeIndexCount;
-	}
-	_frequencyCount = _measurementSet.FrequencyCount();
-
-	_tableIter = new casa::TableIterator(*_sortedTable, selectionNames, casa::TableIterator::Ascending, casa::TableIterator::NoSort);
-}
-
-BaselineMatrixLoader::~BaselineMatrixLoader()
-{
-	if(_sortedTable != 0)
-		delete _sortedTable;
-	if(_metaData != 0)
-		delete _metaData;
-	delete _tableIter;
-}
-
-TimeFrequencyData BaselineMatrixLoader::LoadSummed(size_t timeIndex)
-{
-	casa::Block<casa::String> selectionNames(2);
-	selectionNames[0] = "DATA_DESC_ID";
-	selectionNames[1] = "TIME";
-	if(timeIndex < _currentIterIndex)
-	{
-		delete _tableIter;
-		_tableIter = new casa::TableIterator(*_sortedTable, selectionNames, casa::TableIterator::Ascending, casa::TableIterator::NoSort);
-		_currentIterIndex = 0;
-	}
-	while(!_tableIter->pastEnd() && timeIndex-_currentIterIndex > 0)
-	{
-		_tableIter->next();
-		++_currentIterIndex;
-	}
-	if(_tableIter->pastEnd())
-	{
-		throw std::runtime_error("Time index not found");
-	}
-
-	casa::Table table = _tableIter->table();
-	casa::ROScalarColumn<int> antenna1Column(table, "ANTENNA1"); 
-	casa::ROScalarColumn<int> antenna2Column(table, "ANTENNA2");
-
-	ScalarColumnIterator<int> antenna1Iter = ScalarColumnIterator<int>::First(antenna1Column);
-	ScalarColumnIterator<int> antenna2Iter = ScalarColumnIterator<int>::First(antenna2Column);
-
-	// Find highest antenna index
-	int nrAntenna = 0;
-	for(size_t i=0;i<table.nrow();++i)
-	{
-		int
-			a1 = *antenna1Iter,
-			a2 = *antenna2Iter;
-
-		if(a1 > nrAntenna)
-			nrAntenna = a1;
-		if(a2 > nrAntenna)
-			nrAntenna = a2;
-
-		++antenna1Iter;
-		++antenna2Iter;
-	}
-	++nrAntenna;
-
-	if(_metaData != 0)
-		delete _metaData;
-	_metaData = new SpatialMatrixMetaData(nrAntenna);
-
-	casa::ROArrayColumn<bool> flagColumn(table, "FLAG");
-	casa::ROArrayColumn<casa::Complex> dataColumn(table, "DATA");
-	casa::ROArrayColumn<double> uvwColumn(table, "UVW");
-
-	antenna1Iter = ScalarColumnIterator<int>::First(antenna1Column);
-	antenna2Iter = ScalarColumnIterator<int>::First(antenna2Column);
-	ROArrayColumnIterator<casa::Complex> dataIter =
-		ROArrayColumnIterator<casa::Complex>::First(dataColumn);
-	ROArrayColumnIterator<bool> flagIter =
-		ROArrayColumnIterator<bool>::First(flagColumn);
-	ROArrayColumnIterator<double> uvwIter =
-		ROArrayColumnIterator<double>::First(uvwColumn);
-
-	Image2DPtr
-		xxRImage = Image2D::CreateZeroImagePtr(nrAntenna, nrAntenna),
-		xxIImage = Image2D::CreateZeroImagePtr(nrAntenna, nrAntenna),
-		xyRImage = Image2D::CreateZeroImagePtr(nrAntenna, nrAntenna),
-		xyIImage = Image2D::CreateZeroImagePtr(nrAntenna, nrAntenna),
-		yxRImage = Image2D::CreateZeroImagePtr(nrAntenna, nrAntenna),
-		yxIImage = Image2D::CreateZeroImagePtr(nrAntenna, nrAntenna),
-		yyRImage = Image2D::CreateZeroImagePtr(nrAntenna, nrAntenna),
-		yyIImage = Image2D::CreateZeroImagePtr(nrAntenna, nrAntenna);
-	Mask2DPtr
-		xxMask = Mask2D::CreateUnsetMaskPtr(nrAntenna, nrAntenna),
-		xyMask = Mask2D::CreateUnsetMaskPtr(nrAntenna, nrAntenna),
-		yxMask = Mask2D::CreateUnsetMaskPtr(nrAntenna, nrAntenna),
-		yyMask = Mask2D::CreateUnsetMaskPtr(nrAntenna, nrAntenna);
-
-	for(size_t j=0;j<table.nrow();++j)
-	{
-		int
-			a1 = *antenna1Iter,
-			a2 = *antenna2Iter;
-		casa::Array<casa::Complex> data =
-			*dataIter;
-		casa::Array<bool> flags =
-			*flagIter;
-
-		casa::Array<casa::Complex>::const_iterator i = data.begin();
-		casa::Array<bool>::const_iterator fI = flags.begin();
-		num_t
-			xxr = 0.0, xxi = 0.0, xyr = 0.0, xyi = 0.0, yxr = 0.0, yxi = 0.0, yyr = 0.0, yyi = 0.0;
-		size_t
-			xxc = 0, xyc = 0, yxc = 0, yyc = 0;
-		for(size_t f=0;f<(size_t) _frequencyCount;++f) {
-			const casa::Complex &xx = *i;
-			++i;
-			const casa::Complex &xy = *i;
-			++i;
-			const casa::Complex &yx = *i;
-			++i;
-			const casa::Complex &yy = *i;
-			++i;
-			bool xxF = *fI;
-			++fI;
-			bool xyF = *fI;
-			++fI;
-			bool yxF = *fI;
-			++fI;
-			bool yyF = *fI;
-			++fI;
-			if(std::isfinite(xxr) && std::isfinite(xxi) && !xxF)
-			{
-				xxr += xx.real();
-				xxi += xx.imag();
-				++xxc;
-			}
-			if(std::isfinite(xyr) && std::isfinite(xyi) && !xyF)
-			{
-				xyr += xy.real();
-				xyi += xy.imag();
-				++xyc;
-			}
-			if(std::isfinite(yxr) && std::isfinite(yxi) && !yxF)
-			{
-				yxr += yx.real();
-				yxi += yx.imag();
-				++yxc;
-			}
-			if(std::isfinite(yyr) && std::isfinite(yyi) && !yyF)
-			{
-				yyr += yy.real();
-				yyi += yy.imag();
-				++yyc;
-			}
-		}
-
-		xxRImage->SetValue(a1, a2, xxr / xxc);
-		xxIImage->SetValue(a1, a2, xxi / xxc);
-		xyRImage->SetValue(a1, a2, xyr / xxc);
-		xyIImage->SetValue(a1, a2, xyi / xxc);
-		yxRImage->SetValue(a1, a2, yxr / xxc);
-		yxIImage->SetValue(a1, a2, yxi / xxc);
-		yyRImage->SetValue(a1, a2, yyr / xxc);
-		yyIImage->SetValue(a1, a2, yyi / xxc);
-
-		xxMask->SetValue(a1, a2, xxc == 0);
-		xyMask->SetValue(a1, a2, xyc == 0);
-		yxMask->SetValue(a1, a2, yxc == 0);
-		yyMask->SetValue(a1, a2, yyc == 0);
-
-		UVW uvw;
-		casa::Array<double> arr = *uvwIter;
-		casa::Array<double>::const_iterator uvwArrayIterator = arr.begin();
-		uvw.u = *uvwArrayIterator;
-		++uvwArrayIterator;
-		uvw.v = *uvwArrayIterator;
-		++uvwArrayIterator;
-		uvw.w = *uvwArrayIterator;
-		_metaData->SetUVW(a1, a2, uvw);
-
-		if(a1 != a2)
-		{
-			xxRImage->SetValue(a2, a1, xxr / xxc);
-			xxIImage->SetValue(a2, a1, -xxi / xxc);
-			xyRImage->SetValue(a2, a1, xyr / xxc);
-			xyIImage->SetValue(a2, a1, -xyi / xxc);
-			yxRImage->SetValue(a2, a1, yxr / xxc);
-			yxIImage->SetValue(a2, a1, -yxi / xxc);
-			yyRImage->SetValue(a2, a1, yyr / xxc);
-			yyIImage->SetValue(a2, a1, -yyi / xxc);
-
-			xxMask->SetValue(a2, a1, xxc == 0);
-			xyMask->SetValue(a2, a1, xyc == 0);
-			yxMask->SetValue(a2, a1, yxc == 0);
-			yyMask->SetValue(a2, a1, yyc == 0);
-
-			uvw.u = -uvw.u;
-			uvw.v = -uvw.v;
-			uvw.w = -uvw.w;
-			_metaData->SetUVW(a2, a1, uvw);
-		}
-
-		++antenna1Iter;
-		++antenna2Iter;
-		++dataIter;
-		++uvwIter;
-		++flagIter;
-	}
-	casa::ROScalarColumn<int> bandColumn(table, "DATA_DESC_ID");
-	BandInfo band = _measurementSet.GetBandInfo(bandColumn(0));
-	_metaData->SetFrequency(band.CenterFrequencyHz());
-
-	TimeFrequencyData data(xxRImage, xxIImage, xyRImage, xyIImage, yxRImage, yxIImage, yyRImage, yyIImage);
-	data.SetIndividualPolarisationMasks(xxMask, xyMask, yxMask, yyMask);
-	return data;
-}
-
-void BaselineMatrixLoader::LoadPerChannel(size_t timeIndex, std::vector<TimeFrequencyData> &data)
-{
-	casa::Block<casa::String> selectionNames(2);
-	selectionNames[0] = "DATA_DESC_ID";
-	selectionNames[1] = "TIME";
-	if(timeIndex < _currentIterIndex)
-	{
-		delete _tableIter;
-		_tableIter = new casa::TableIterator(*_sortedTable, selectionNames, casa::TableIterator::Ascending, casa::TableIterator::NoSort);
-		_currentIterIndex = 0;
-	}
-	while(!_tableIter->pastEnd() && timeIndex-_currentIterIndex > 0)
-	{
-		_tableIter->next();
-		++_currentIterIndex;
-	}
-	if(_tableIter->pastEnd())
-	{
-		throw std::runtime_error("Time index not found");
-	}
-
-	casa::Table table = _tableIter->table();
-	casa::ROScalarColumn<int> antenna1Column(table, "ANTENNA1"); 
-	casa::ROScalarColumn<int> antenna2Column(table, "ANTENNA2");
-
-	// Find highest antenna index
-	int nrAntenna = 0;
-	for(size_t i=0;i<table.nrow();++i)
-	{
-		int
-			a1 = antenna1Column(i),
-			a2 = antenna2Column(i);
-
-		if(a1 > nrAntenna)
-			nrAntenna = a1;
-		if(a2 > nrAntenna)
-			nrAntenna = a2;
-	}
-	++nrAntenna;
-
-	if(_metaData != 0)
-		delete _metaData;
-	_metaData = new SpatialMatrixMetaData(nrAntenna);
-
-	casa::ROArrayColumn<bool> flagColumn(table, "FLAG");
-	casa::ROArrayColumn<casa::Complex> dataColumn(table, "DATA");
-	casa::ROArrayColumn<double> uvwColumn(table, "UVW");
-
-        std::vector<Image2DPtr>
-		xxRImage(_frequencyCount), xxIImage(_frequencyCount), xyRImage(_frequencyCount), xyIImage(_frequencyCount), yxRImage(_frequencyCount), yxIImage(_frequencyCount), yyRImage(_frequencyCount), yyIImage(_frequencyCount);
-        std::vector<Mask2DPtr>
-		xxMask(_frequencyCount), xyMask(_frequencyCount), yxMask(_frequencyCount), yyMask(_frequencyCount);
-	for(size_t f=0;f<(size_t) _frequencyCount;++f)
-	{
-		xxRImage[f] = Image2D::CreateZeroImagePtr(nrAntenna, nrAntenna),
-		xxIImage[f] = Image2D::CreateZeroImagePtr(nrAntenna, nrAntenna),
-		xyRImage[f] = Image2D::CreateZeroImagePtr(nrAntenna, nrAntenna),
-		xyIImage[f] = Image2D::CreateZeroImagePtr(nrAntenna, nrAntenna),
-		yxRImage[f] = Image2D::CreateZeroImagePtr(nrAntenna, nrAntenna),
-		yxIImage[f] = Image2D::CreateZeroImagePtr(nrAntenna, nrAntenna),
-		yyRImage[f] = Image2D::CreateZeroImagePtr(nrAntenna, nrAntenna),
-		yyIImage[f] = Image2D::CreateZeroImagePtr(nrAntenna, nrAntenna);
-		xxMask[f] = Mask2D::CreateSetMaskPtr<true>(nrAntenna, nrAntenna),
-		xyMask[f] = Mask2D::CreateSetMaskPtr<true>(nrAntenna, nrAntenna),
-		yxMask[f] = Mask2D::CreateSetMaskPtr<true>(nrAntenna, nrAntenna),
-		yyMask[f] = Mask2D::CreateSetMaskPtr<true>(nrAntenna, nrAntenna);
-	}
-
-	for(size_t row=0;row<table.nrow();++row)
-	{
-		int
-			a1 = antenna1Column(row),
-			a2 = antenna2Column(row);
-		casa::Array<casa::Complex> data =
-			dataColumn(row);
-		casa::Array<bool> flags =
-			flagColumn(row);
-
-		casa::Array<casa::Complex>::const_iterator i = data.begin();
-		casa::Array<bool>::const_iterator fI = flags.begin();
-		for(size_t f=0;f<(size_t) _frequencyCount;++f) {
-			const casa::Complex xx = *i;
-			++i;
-			const casa::Complex xy = *i;
-			++i;
-			const casa::Complex yx = *i;
-			++i;
-			const casa::Complex yy = *i;
-			++i;
-			bool xxF = *fI;
-			++fI;
-			bool xyF = *fI;
-			++fI;
-			bool yxF = *fI;
-			++fI;
-			bool yyF = *fI;
-			++fI;
-			if(!std::isfinite(xx.real()) || !std::isfinite(xx.imag()))
-				xxF = true;
-			if(!std::isfinite(xy.real()) || !std::isfinite(xy.imag()))
-				xyF = true;
-			if(!std::isfinite(yx.real()) || !std::isfinite(yx.imag()))
-				yxF = true;
-			if(!std::isfinite(yy.real()) || !std::isfinite(yy.imag()))
-				yyF = true;
-			xxRImage[f]->SetValue(a1, a2, xx.real());
-			xxIImage[f]->SetValue(a1, a2, xx.imag());
-			xyRImage[f]->SetValue(a1, a2, xy.real());
-			xyIImage[f]->SetValue(a1, a2, xy.imag());
-			yxRImage[f]->SetValue(a1, a2, yx.real());
-			yxIImage[f]->SetValue(a1, a2, yx.imag());
-			yyRImage[f]->SetValue(a1, a2, yy.real());
-			yyIImage[f]->SetValue(a1, a2, yy.imag());
-
-			xxMask[f]->SetValue(a1, a2, !xxF);
-			xyMask[f]->SetValue(a1, a2, !xyF);
-			yxMask[f]->SetValue(a1, a2, !yxF);
-			yyMask[f]->SetValue(a1, a2, !yyF);
-
-			if(a1 != a2)
-			{
-				xxRImage[f]->SetValue(a2, a1, xx.real());
-				xxIImage[f]->SetValue(a2, a1, -xx.imag());
-				xyRImage[f]->SetValue(a2, a1, xy.real());
-				xyIImage[f]->SetValue(a2, a1, -xy.imag());
-				yxRImage[f]->SetValue(a2, a1, yx.real());
-				yxIImage[f]->SetValue(a2, a1, -yx.imag());
-				yyRImage[f]->SetValue(a2, a1, yy.real());
-				yyIImage[f]->SetValue(a2, a1, -yy.imag());
-	
-				xxMask[f]->SetValue(a2, a1, !xxF);
-				xyMask[f]->SetValue(a2, a1, !xyF);
-				yxMask[f]->SetValue(a2, a1, !yxF);
-				yyMask[f]->SetValue(a2, a1, !yyF);
-			}
-		}
-
-		UVW uvw;
-		casa::Array<double> arr = uvwColumn(row);
-		casa::Array<double>::const_iterator uvwArrayIterator = arr.begin();
-		uvw.u = *uvwArrayIterator;
-		++uvwArrayIterator;
-		uvw.v = *uvwArrayIterator;
-		++uvwArrayIterator;
-		uvw.w = *uvwArrayIterator;
-		_metaData->SetUVW(a1, a2, uvw);
-
-		if(a1 != a2)
-		{
-			uvw.u = -uvw.u;
-			uvw.v = -uvw.v;
-			uvw.w = -uvw.w;
-			_metaData->SetUVW(a2, a1, uvw);
-		}
-	}
-	casa::ROScalarColumn<int> bandColumn(table, "DATA_DESC_ID");
-	BandInfo band = _measurementSet.GetBandInfo(bandColumn(0));
-	_metaData->SetFrequency(band.CenterFrequencyHz());
-
-	data.clear();
-	for(size_t f=0;f<_frequencyCount;++f)
-	{
-		TimeFrequencyData singleMatrix(xxRImage[f], xxIImage[f], xyRImage[f], xyIImage[f], yxRImage[f], yxIImage[f], yyRImage[f], yyIImage[f]);
-		singleMatrix.SetIndividualPolarisationMasks(xxMask[f], xyMask[f], yxMask[f], yyMask[f]);
-		data.push_back(singleMatrix);
-	}
-}
-
diff --git a/CEP/DP3/AOFlagger/src/msio/baselinereader.cpp b/CEP/DP3/AOFlagger/src/msio/baselinereader.cpp
deleted file mode 100644
index 61ad6d0cc6da15674b3785b85d67531312c995b4..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/msio/baselinereader.cpp
+++ /dev/null
@@ -1,198 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <AOFlagger/msio/baselinereader.h>
-
-#include <set>
-#include <stdexcept>
-
-#include <ms/MeasurementSets/MeasurementSet.h>
-
-#include <tables/Tables/ExprNode.h>
-#include <tables/Tables/IncrStManAccessor.h>
-#include <tables/Tables/StandardStManAccessor.h>
-#include <tables/Tables/TableIter.h>
-#include <tables/Tables/TiledStManAccessor.h>
-
-#include <AOFlagger/msio/timefrequencydata.h>
-
-#include <AOFlagger/util/aologger.h>
-
-BaselineReader::BaselineReader(const std::string &msFile)
-	: _measurementSet(msFile), _dataColumnName("DATA"), _subtractModel(false), _readData(true), _readFlags(true),
-	_polarizationCount(0)
-{
-	AOLogger::Debug << "Baselinereader constructed.\n";
-	_frequencyCount = _measurementSet.FrequencyCount();
-	try {
-		_table = _measurementSet.OpenTable(true);
-	} catch(std::exception &e)
-	{
-		AOLogger::Warn << "Read-write opening of file " << msFile << " failed, trying read-only...\n";
-		_table = _measurementSet.OpenTable(false);
-		AOLogger::Warn << "Table opened in read-only: writing not possible.\n";
-	}
-}
-// 
-BaselineReader::~BaselineReader()
-{
-	delete _table;
-}
-
-void BaselineReader::initObservationTimes()
-{
-	if(_observationTimes.size() == 0)
-	{
-		AOLogger::Debug << "Initializing observation times...\n";
-		const std::set<double> &times = _measurementSet.GetObservationTimesSet();
-		unsigned index = 0;
-		for(std::set<double>::const_iterator i=times.begin();i!=times.end();++i)
-		{
-			_observationTimes.insert(std::pair<double,size_t>(*i, index));
-			_observationTimesVector.push_back(*i);
-			++index;
-		}
-	}
-}
-
-void BaselineReader::AddReadRequest(size_t antenna1, size_t antenna2, size_t spectralWindow)
-{
-	initObservationTimes();
-	
-	addReadRequest(antenna1, antenna2, spectralWindow, 0, _observationTimes.size());
-}
-
-TimeFrequencyData BaselineReader::GetNextResult(std::vector<class UVW> &uvw)
-{
-	size_t requestIndex = 0;
-	TimeFrequencyData data;
-	if(_polarizationCount == 4)
-	{
-		data = TimeFrequencyData(
-			_results[requestIndex]._realImages[0], _results[requestIndex]._imaginaryImages[0],
-			_results[requestIndex]._realImages[1], _results[requestIndex]._imaginaryImages[1],
-			_results[requestIndex]._realImages[2], _results[requestIndex]._imaginaryImages[2],
-			_results[requestIndex]._realImages[3], _results[requestIndex]._imaginaryImages[3]
-			);
-		data.SetIndividualPolarisationMasks(
-			_results[requestIndex]._flags[0],
-			_results[requestIndex]._flags[1],
-			_results[requestIndex]._flags[2],
-			_results[requestIndex]._flags[3]);
-	} else if(_polarizationCount == 2)
-	{
-		data = TimeFrequencyData(AutoDipolePolarisation,
-			_results[requestIndex]._realImages[0], _results[requestIndex]._imaginaryImages[0],
-			_results[requestIndex]._realImages[1], _results[requestIndex]._imaginaryImages[1]);
-		data.SetIndividualPolarisationMasks(
-			_results[requestIndex]._flags[0],
-			_results[requestIndex]._flags[1]);
-	} else if(_polarizationCount == 1)
-	{
-		data = TimeFrequencyData(StokesIPolarisation,
-			_results[requestIndex]._realImages[0], _results[requestIndex]._imaginaryImages[0]);
-		data.SetGlobalMask(_results[requestIndex]._flags[0]);
-	}
-	uvw = _results[0]._uvw;
-	
-	_results.erase(_results.begin() + requestIndex);
-
-	return data;
-}
-
-void BaselineReader::PartInfo(size_t maxTimeScans, size_t &timeScanCount, size_t &partCount)
-{
-	initObservationTimes();
-
-	timeScanCount = _observationTimes.size();
-	if(maxTimeScans == 0)
-		partCount = 1;
-	else
-	{
-		partCount = (timeScanCount + maxTimeScans - 1) / maxTimeScans;
-		if(partCount == 0)
-			partCount = 1;
-	}
-}
-
-void BaselineReader::initializePolarizations()
-{
-	if(_polarizationCount == 0)
-	{
-		casa::MeasurementSet ms(_measurementSet.Location());
-		casa::Table polTable = ms.polarization();
-		casa::ROArrayColumn<int> corTypeColumn(polTable, "CORR_TYPE"); 
-		casa::Array<int> corType = corTypeColumn(0);
-		casa::Array<int>::iterator iterend(corType.end());
-		int polarizationCount = 0;
-		for (casa::Array<int>::iterator iter=corType.begin(); iter!=iterend; ++iter)
-		{
-			switch(*iter) {
-				case 1: //_stokesIIndex = polarizationCount; break;
-				case 5:
-				case 9: //_xxIndex = polarizationCount; break;
-				case 6:
-				case 10:// _xyIndex = polarizationCount; break;
-				case 7:
-				case 11:// _yxIndex = polarizationCount; break;
-				case 8:
-				case 12: //_yyIndex = polarizationCount; break;
-				break;
-				default:
-				{
-					std::stringstream s;
-					s << "There is a polarization in the measurement set that I can not handle (" << *iter << ", polarization index " << polarizationCount << ").";
-					throw std::runtime_error(s.str());
-				}
-			}
-			++polarizationCount;
-		}
-		_polarizationCount = polarizationCount;
-	}
-}
-
-void BaselineReader::clearTableCaches()
-{
-	/*
-	try {
-		casa::ROTiledStManAccessor accessor(*Table(), "LofarStMan");
-		accessor.clearCaches();
-		AOLogger::Debug << "LofarStMan Caches cleared with ROTiledStManAccessor.\n";
-	} catch(std::exception &e)
-	{
-		try {
-			AOLogger::Debug << e.what() << '\n';
-			casa::ROStandardStManAccessor accessor(*Table(), "LofarStMan");
-			accessor.clearCache();
-			AOLogger::Debug << "LofarStMan Caches cleared with ROStandardStManAccessor.\n";
-		} catch(std::exception &e)
-		{
-			try {
-				AOLogger::Debug << e.what() << '\n';
-				casa::ROIncrementalStManAccessor accessor(*Table(), "LofarStMan");
-				accessor.clearCache();
-				AOLogger::Debug << "LofarStMan Caches cleared with ROIncrementalStManAccessor.\n";
-			} catch(std::exception &e)
-			{
-				AOLogger::Debug << e.what() << '\n';
-				AOLogger::Debug << "Could not clear LofarStMan caches; don't know how to access it.\n";
-			}
-		}
-	}*/
-}
diff --git a/CEP/DP3/AOFlagger/src/msio/colormap.cpp b/CEP/DP3/AOFlagger/src/msio/colormap.cpp
deleted file mode 100644
index 098fcb76c57a89baa363527945de5061f4bf4fa2..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/msio/colormap.cpp
+++ /dev/null
@@ -1,65 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2007 by Andre Offringa   *
- *   offringa@gmail.com   *
- *                                                                         *
- *   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.             *
- ***************************************************************************/
-#include <AOFlagger/msio/colormap.h>
-
-ColorMap::ColorMap()
-{
-}
-
-ColorMap::~ColorMap()
-{
-}
-
-ColorMap *ColorMap::CreateColorMap(const std::string &type) throw()
-{
-	if(type == "coldhot")
-		return new ColdHotMap();
-	else if(type == "redblue")
-		return new RedBlueMap();
-	else if(type == "redwhiteblue")
-		return new RedWhiteBlueMap();
-	else if(type=="redyellowblue")
-		return new RedYellowBlueMap();
-	else if(type == "positive")
-		return new PositiveMap();
-	else if(type == "invpositive")
-		return new InvPositiveMap();
-	else if(type == "contrast")
-		return new ContrastMap("monochrome");
-	else if(type == "redbluecontrast")
-		return new ContrastMap("redblue");
-	else if(type == "redyellowbluecontrast")
-		return new ContrastMap("redyellowblue");
-	else if(type == "coldhotcontrast")
-		return new ContrastMap("coldhot");
-	else if(type == "positivecontrast")
-		return new ContrastMap("positive");
-	else if(type == "invpositivecontrast")
-		return new ContrastMap("invpositive");
-	else
-		return new MonochromeMap();
-}
-
-const std::string ColorMap::_colorMapsString("monochrome, coldhot, redblue, redyellowblue, contrast, coldhotcontrast, redbluecontrast, redyellowbluecontrast, positive, invpositive, positivecontrast, invpositivecontrast");
-
-const std::string &ColorMap::GetColorMapsString() throw()
-{
-	return _colorMapsString;
-}
diff --git a/CEP/DP3/AOFlagger/src/msio/directbaselinereader.cpp b/CEP/DP3/AOFlagger/src/msio/directbaselinereader.cpp
deleted file mode 100644
index 08f32ef8a233df9bf3447075b558d237113e1eeb..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/msio/directbaselinereader.cpp
+++ /dev/null
@@ -1,405 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <AOFlagger/msio/directbaselinereader.h>
-
-#include <set>
-#include <stdexcept>
-
-#include <tables/Tables/TiledStManAccessor.h>
-
-#include <AOFlagger/msio/arraycolumniterator.h>
-#include <AOFlagger/msio/scalarcolumniterator.h>
-#include <AOFlagger/msio/timefrequencydata.h>
-
-#include <AOFlagger/util/aologger.h>
-#include <AOFlagger/util/stopwatch.h>
-
-DirectBaselineReader::DirectBaselineReader(const std::string &msFile) : BaselineReader(msFile)
-{
-}
-
-DirectBaselineReader::~DirectBaselineReader()
-{
-	ShowStatistics();
-}
-
-void DirectBaselineReader::initBaselineCache()
-{
-	// Pass one time through the entire measurement set and store the rownumbers of
-	// the baselines.
-	if(_baselineCache.empty())
-	{
-		casa::ROScalarColumn<int> antenna1Column(*Table(), "ANTENNA1"); 
-		casa::ROScalarColumn<int> antenna2Column(*Table(), "ANTENNA2");
-		casa::ROScalarColumn<int> windowColumn(*Table(), "DATA_DESC_ID");
-		for(size_t i=0;i<Table()->nrow();++i) {
-			int
-				antenna1 = antenna1Column(i),
-				antenna2 = antenna2Column(i),
-				window = windowColumn(i);
-			addRowToBaselineCache(antenna1, antenna2, window, i);
-		}
-	}
-}
-
-void DirectBaselineReader::addRowToBaselineCache(int antenna1, int antenna2, int spectralWindow, size_t row)
-{
-	for(std::vector<BaselineCacheItem>::iterator i=_baselineCache.begin();i!=_baselineCache.end();++i)
-	{
-		if(i->antenna1 == antenna1 && i->antenna2 == antenna2 && i->spectralWindow == spectralWindow)
-		{
-			i->rows.push_back(row);
-			return;
-		}
-	}
-	BaselineCacheItem newItem;
-	newItem.antenna1 = antenna1;
-	newItem.antenna2 = antenna2;
-	newItem.spectralWindow = spectralWindow;
-	newItem.rows.push_back(row);
-	_baselineCache.push_back(newItem);
-}
-
-void DirectBaselineReader::addRequestRows(ReadRequest request, size_t requestIndex, std::vector<std::pair<size_t, size_t> > &rows)
-{
-	for(std::vector<BaselineCacheItem>::const_iterator i=_baselineCache.begin();i!=_baselineCache.end();++i)
-	{
-		if(i->antenna1 == request.antenna1 && i->antenna2 == request.antenna2 && i->spectralWindow == request.spectralWindow)
-		{
-			for(std::vector<size_t>::const_iterator j=i->rows.begin();j!=i->rows.end();++j)
-				rows.push_back(std::pair<size_t, size_t>(*j, requestIndex));
-			break;
-		}
-	}
-}
-
-void DirectBaselineReader::addRequestRows(WriteRequest request, size_t requestIndex, std::vector<std::pair<size_t, size_t> > &rows)
-{
-	for(std::vector<BaselineCacheItem>::const_iterator i=_baselineCache.begin();i!=_baselineCache.end();++i)
-	{
-		if(i->antenna1 == request.antenna1 && i->antenna2 == request.antenna2 && i->spectralWindow == request.spectralWindow)
-		{
-			for(std::vector<size_t>::const_iterator j=i->rows.begin();j!=i->rows.end();++j)
-				rows.push_back(std::pair<size_t, size_t>(*j, requestIndex));
-			break;
-		}
-	}
-}
-
-void DirectBaselineReader::PerformReadRequests()
-{
-  Stopwatch stopwatch(true);
-	
-	initialize();
-	initBaselineCache();
-
-	// Each element contains (row number, corresponding request index)
-	std::vector<std::pair<size_t, size_t> > rows;
-	
-	for(size_t i=0;i!=_readRequests.size();++i)
-		addRequestRows(_readRequests[i], i, rows);
-	std::sort(rows.begin(), rows.end());
-	
-	size_t timeCount = AllObservationTimes().size();
-
-	AOLogger::Debug << "Reading " << _readRequests.size() << " requests with " << rows.size() << " rows total, flags=" << ReadFlags() << ", " << PolarizationCount() << " polarizations.\n";
-	
-	_results.clear();
-	for(size_t i=0;i<_readRequests.size();++i)
-	{
-		_results.push_back(Result());
-		size_t
-			startIndex = _readRequests[i].startIndex,
-			endIndex = _readRequests[i].endIndex;
-			
-		if(startIndex > timeCount)
-		{
-			std::cerr << "Warning: startIndex > timeCount" << std::endl;
-		}
-		if(endIndex > timeCount)
-		{
-			endIndex = timeCount;
-			std::cerr << "Warning: endIndex > timeCount" << std::endl;
-		}
-
-		size_t width = endIndex-startIndex;
-		for(size_t p=0;p<PolarizationCount();++p)
-		{
-			if(ReadData()) {
-				_results[i]._realImages.push_back(Image2D::CreateZeroImagePtr(width, FrequencyCount()));
-				_results[i]._imaginaryImages.push_back(Image2D::CreateZeroImagePtr(width, FrequencyCount()));
-			}
-			if(ReadFlags()) {
-				// The flags should be initialized to true, as a baseline might
-				// miss some time scans that other baselines do have, and these
-				// should be flagged.
-				_results[i]._flags.push_back(Mask2D::CreateSetMaskPtr<true>(width, FrequencyCount()));
-			}
-		}
-		_results[i]._uvw.resize(width);
-	}
-
-	casa::Table &table = *Table();
-
-	casa::ROScalarColumn<double> timeColumn(table, "TIME");
-	casa::ROArrayColumn<float> weightColumn(table, "WEIGHT");
-	casa::ROArrayColumn<double> uvwColumn(table, "UVW");
-	casa::ROArrayColumn<bool> flagColumn(table, "FLAG");
-	casa::ROArrayColumn<casa::Complex> *modelColumn;
-
-	casa::ROArrayColumn<casa::Complex> *dataColumn = 0;
-	if(ReadData())
-		dataColumn = new casa::ROArrayColumn<casa::Complex>(table, DataColumnName());
-
-	if(SubtractModel()) {
-		modelColumn = new casa::ROArrayColumn<casa::Complex>(table, "MODEL_DATA");
-	} else {
-		modelColumn = 0;
-	}
-
-	for(std::vector<std::pair<size_t, size_t> >::const_iterator i=rows.begin();i!=rows.end();++i) {
-		size_t rowIndex = i->first;
-		size_t requestIndex = i->second;
-		
-		double time = timeColumn(rowIndex);
-		size_t
-			timeIndex = AllObservationTimes().find(time)->second,
-			startIndex = _readRequests[requestIndex].startIndex,
-			endIndex = _readRequests[requestIndex].endIndex;
-		bool timeIsSelected = timeIndex>=startIndex && timeIndex<endIndex;
-		if(ReadData() && timeIsSelected) {
-			if(DataKind() == WeightData)
-				readWeights(requestIndex, timeIndex-startIndex, FrequencyCount(), weightColumn(rowIndex));
-			else if(modelColumn == 0)
-				readTimeData(requestIndex, timeIndex-startIndex, FrequencyCount(), (*dataColumn)(rowIndex), 0);
-			else {
-				const casa::Array<casa::Complex> model = (*modelColumn)(rowIndex); 
-				readTimeData(requestIndex, timeIndex-startIndex, FrequencyCount(), (*dataColumn)(rowIndex), &model);
-			}
-		}
-		if(ReadFlags() && timeIsSelected) {
-			readTimeFlags(requestIndex, timeIndex-startIndex, FrequencyCount(), flagColumn(rowIndex));
-		}
-		if(timeIsSelected) {
-			casa::Array<double> arr = uvwColumn(rowIndex);
-			casa::Array<double>::const_iterator i = arr.begin();
-			_results[requestIndex]._uvw[timeIndex-startIndex].u = *i;
-			++i;
-			_results[requestIndex]._uvw[timeIndex-startIndex].v = *i;
-			++i;
-			_results[requestIndex]._uvw[timeIndex-startIndex].w = *i;
-		}
-	}
-	if(dataColumn != 0)
-		delete dataColumn;
-	
-	AOLogger::Debug << "Time of ReadRequests(): " << stopwatch.ToString() << '\n';
-
-	_readRequests.clear();
-}
-
-std::vector<UVW> DirectBaselineReader::ReadUVW(unsigned antenna1, unsigned antenna2, unsigned spectralWindow)
-{
-  Stopwatch stopwatch(true);
-	
-	initialize();
-	initBaselineCache();
-
-	const std::map<double, size_t> &allObservationTimes = AllObservationTimes();
-
-	// Each element contains (row number, corresponding request index)
-	std::vector<std::pair<size_t, size_t> > rows;
-	ReadRequest request;
-	request.antenna1 = antenna1;
-	request.antenna2 = antenna2;
-	request.spectralWindow = spectralWindow;
-	request.startIndex = 0;
-	request.endIndex = allObservationTimes.size();
-	addRequestRows(request, 0, rows);
-	std::sort(rows.begin(), rows.end());
-	
-	size_t width = allObservationTimes.size();
-
-	casa::Table &table = *Table();
-	casa::ROScalarColumn<double> timeColumn(table, "TIME");
-	casa::ROArrayColumn<double> uvwColumn(table, "UVW");
-	
-	std::vector<UVW> uvws;
-	uvws.resize(width);
-
-	for(std::vector<std::pair<size_t, size_t> >::const_iterator i=rows.begin();i!=rows.end();++i) {
-		size_t rowIndex = i->first;
-		
-		double time = timeColumn(rowIndex);
-		size_t
-			timeIndex = allObservationTimes.find(time)->second;
-
-		casa::Array<double> arr = uvwColumn(rowIndex);
-		casa::Array<double>::const_iterator j = arr.begin();
-		UVW &uvw = uvws[timeIndex];
-		uvw.u = *j;
-		++j;
-		uvw.v = *j;
-		++j;
-		uvw.w = *j;
-	}
-	
-	AOLogger::Debug << "Read of UVW took: " << stopwatch.ToString() << '\n';
-	return uvws;
-}
-
-void DirectBaselineReader::PerformFlagWriteRequests()
-{
-	Stopwatch stopwatch(true);
-
-	initialize();
-
-	initBaselineCache();
-
-	// Each element contains (row number, corresponding request index)
-	std::vector<std::pair<size_t, size_t> > rows;
-	
-	for(size_t i=0;i!=_writeRequests.size();++i)
-		addRequestRows(_writeRequests[i], i, rows);
-	std::sort(rows.begin(), rows.end());
-
-	casa::ROScalarColumn<double> timeColumn(*Table(), "TIME");
-	casa::ArrayColumn<bool> flagColumn(*Table(), "FLAG");
-
-	for(std::vector<WriteRequest>::iterator i=_writeRequests.begin();i!=_writeRequests.end();++i)
-	{
-		if(FrequencyCount() != i->flags[0]->Height())
-		{
-			std::cerr << "The frequency count in the measurement set (" << FrequencyCount() << ") does not match the image!" << std::endl;
-		}
-		if(i->endIndex - i->startIndex != i->flags[0]->Width())
-		{
-			std::cerr << "The number of time scans to write in the measurement set (" << (i->endIndex - i->startIndex) << ") does not match the image (" << i->flags[0]->Width() << ") !" << std::endl;
-		}
-	}
-
-	size_t rowsWritten = 0;
-
-	for(std::vector<std::pair<size_t, size_t> >::const_iterator i=rows.begin();i!=rows.end();++i)
-	{
-		size_t rowIndex = i->first;
-		WriteRequest &request = _writeRequests[i->second];
-		double time = timeColumn(rowIndex);
-		size_t timeIndex = AllObservationTimes().find(time)->second;
-		if(timeIndex >= request.startIndex + request.leftBorder && timeIndex < request.endIndex - request.rightBorder)
-		{
-			casa::Array<bool> flag = flagColumn(rowIndex);
-			casa::Array<bool>::iterator j = flag.begin();
-			for(size_t f=0;f<(size_t) FrequencyCount();++f) {
-				for(size_t p=0;p<PolarizationCount();++p)
-				{
-					*j = request.flags[p]->Value(timeIndex - request.startIndex, f);
-					++j;
-				}
-			}
-			flagColumn.basePut(rowIndex, flag);
-			++rowsWritten;
-		}
-	}
-	_writeRequests.clear();
-	
-	AOLogger::Debug << rowsWritten << "/" << rows.size() << " rows written in " << stopwatch.ToString() << '\n';
-}
-
-void DirectBaselineReader::readTimeData(size_t requestIndex, size_t xOffset, int frequencyCount, const casa::Array<casa::Complex> data, const casa::Array<casa::Complex> *model)
-{
-	casa::Array<casa::Complex>::const_iterator i = data.begin();
-	casa::Array<casa::Complex>::const_iterator m;
-	if(DataKind() == ResidualData)
-		m = model->begin();
-
-	size_t polarizationCount = PolarizationCount();
-
-	for(size_t f=0;f<(size_t) frequencyCount;++f) {
-		num_t rv,iv;
-
-		for(size_t p=0;p<polarizationCount;++p)
-		{
-			if(DataKind() == ResidualData)
-			{
-				const casa::Complex &iData = *i;
-				const casa::Complex &iModel = *m;
-				++i; ++m;
-
-				rv = iData.real() - iModel.real();
-				iv = iData.imag() - iModel.imag();
-			} else {
-				const casa::Complex &complex = *i;
-				++i;
-
-				rv = complex.real();
-				iv = complex.imag();
-			}
-			_results[requestIndex]._realImages[p]->SetValue(xOffset, f, rv);
-			_results[requestIndex]._imaginaryImages[p]->SetValue(xOffset, f, iv);
-		}
-	}
-}
-
-void DirectBaselineReader::readTimeFlags(size_t requestIndex, size_t xOffset, int frequencyCount, const casa::Array<bool> flag)
-{
-	size_t polarizationCount = PolarizationCount();
-
-	casa::Array<bool>::const_iterator j = flag.begin();
-	for(size_t f=0;f<(size_t) frequencyCount;++f) {
-		for(size_t p=0;p<polarizationCount;++p)
-		{
-			bool v = *j;
-			++j;
-			_results[requestIndex]._flags[p]->SetValue(xOffset, f, v);
-		} 
-	}
-}
-
-void DirectBaselineReader::readWeights(size_t requestIndex, size_t xOffset, int frequencyCount, const casa::Array<float> weight)
-{
-	size_t polarizationCount = PolarizationCount();
-
-	casa::Array<float>::const_iterator j = weight.begin();
-	float values[polarizationCount];
-	for(size_t p=0;p<polarizationCount;++p) {
-		values[p] = *j;
-		++j;
-	}
-	for(size_t f=0;f<(size_t) frequencyCount;++f) {
-		for(size_t p=0;p<polarizationCount;++p)
-		{
-			_results[requestIndex]._realImages[p]->SetValue(xOffset, f, values[p]);
-			_results[requestIndex]._imaginaryImages[p]->SetValue(xOffset, f, 0.0);
-		}
-	} 
-}
-
-void DirectBaselineReader::ShowStatistics()
-{
-	try {
-		casa::ROTiledStManAccessor accessor(*Table(), "LofarStMan");
-		std::stringstream s;
-		accessor.showCacheStatistics(s);
-		AOLogger::Debug << s.str();
-	} catch(std::exception &e)
-	{
-	}
-}
diff --git a/CEP/DP3/AOFlagger/src/msio/fitsfile.cpp b/CEP/DP3/AOFlagger/src/msio/fitsfile.cpp
deleted file mode 100644
index ea906a7f8829b523fe6a1ab564455ba914003733..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/msio/fitsfile.cpp
+++ /dev/null
@@ -1,627 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2007 by Andre Offringa   *
- *   offringa@gmail.com   *
- *                                                                         *
- *   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.             *
- ***************************************************************************/
-#include <AOFlagger/msio/fitsfile.h>
-
-#include <limits>
-#include <cmath>
-
-#include <sstream>
-#include <iostream>
-
-#include <boost/algorithm/string/trim.hpp>
-
-#include <AOFlagger/util/aologger.h>
-
-FitsFile::FitsFile(const std::string &filename) : _filename(filename), _fptr(0), _isOpen(false)
-{
-}
-
-FitsFile::~FitsFile()
-{
-	if(_isOpen)
-		Close();
-}
-
-void FitsFile::CheckStatus(int status) const {
-	if(status) {
-		/* fits_get_errstatus returns at most 30 characters */
-		char err_text[31];
-		fits_get_errstatus(status, err_text);
-		char err_msg[81];
-		std::stringstream errMsg;
-		errMsg << "CFITSIO reported error when performing IO on file '" << _filename << "':" << err_text << " (";
-		while(fits_read_errmsg(err_msg))
-			errMsg << err_msg;
-		errMsg << ')';
-		throw FitsIOException(errMsg.str());
-	}
-}
-
-void FitsFile::CheckOpen() const {
-	if(!_isOpen)
-		throw FitsIOException("No open file, call Open() first");
-}
-
-void FitsFile::Open(FitsFile::FileMode mode)
-{
-	if(_isOpen) {
-		throw FitsIOException("File was opened twice");
-	} else {
-		int status = 0;
-		int modeInt = 0;
-		switch(mode) {
-			case ReadOnlyMode: modeInt = READONLY; break;
-			case ReadWriteMode: modeInt = READWRITE; break;
-			default: throw FitsIOException("Incorrect mode specified"); break;
-		}
-		fits_open_diskfile(&_fptr, _filename.c_str(), modeInt, &status);
-		CheckStatus(status);
-		_isOpen = true;
-	}
-}
-
-void FitsFile::Create()
-{
-	if(_isOpen) {
-		throw FitsIOException("File was opened twice");
-	} else {
-		int status = 0;
-		fits_create_file(&_fptr, (std::string("!") + _filename).c_str(), &status);
-		CheckStatus(status);
-		_isOpen = true;
-	}
-}
-
-void FitsFile::Close() 
-{
-	if(_isOpen) {
-		int status = 0;
-		fits_close_file(_fptr, &status);
-		CheckStatus(status);
-		_isOpen = false;
-		_fptr = 0;
-	} else {
-		throw FitsIOException("Non-opened file was closed");
-	}
-}
-
-int FitsFile::GetHDUCount()
-{
-	CheckOpen();
-	int hdunum = 0, status = 0;
-	fits_get_num_hdus(_fptr, &hdunum, &status);
-	CheckStatus(status);
-	return hdunum;
-}
-
-int FitsFile::GetCurrentHDU()
-{
-	CheckOpen();
-	int hdunum = 0;
-	fits_get_hdu_num(_fptr, &hdunum);
-	return hdunum;
-}
-
-void FitsFile::MoveToHDU(int hduNumber)
-{
-	CheckOpen();
-	int status = 0;
-	fits_movabs_hdu(_fptr, hduNumber, NULL, &status);
-	CheckStatus(status);
-}
-
-enum FitsFile::HDUType FitsFile::GetCurrentHDUType()
-{
-	CheckOpen();
-	int hdutypeInt = 0, status = 0;
-	fits_get_hdu_type(_fptr, &hdutypeInt, &status);
-	CheckStatus(status);
-	enum HDUType hduType;
-	switch(hdutypeInt) {
-		case IMAGE_HDU: hduType = ImageHDUType; break;
-		case ASCII_TBL: hduType = ASCIITableHDUType; break;
-		case BINARY_TBL: hduType = BinaryTableHDUType; break;
-		default: throw FitsIOException("Unknown HDUType returned");
-	}
-	return hduType;
-}
-
-enum FitsFile::ImageType FitsFile::GetCurrentImageType()
-{
-	CheckOpen();
-	int bitPixInt = 0, status = 0;
-	fits_get_img_type(_fptr, &bitPixInt, &status);
-	CheckStatus(status);
-	enum ImageType imageType;
-	switch(bitPixInt) {
-		case BYTE_IMG: imageType = Int8ImageType; break;
-		case SHORT_IMG: imageType = Int16ImageType; break;
-		case LONG_IMG: imageType = Int32ImageType; break;
-		case FLOAT_IMG: imageType = Float32ImageType; break;
-		case DOUBLE_IMG: imageType = Double64ImageType; break;
-		default: throw FitsIOException("Unknown image type returned");
-	}
-	return imageType;
-}
-
-int FitsFile::GetCurrentImageDimensionCount()
-{
-	CheckOpen();
-	int status = 0, naxis = 0;
-	fits_get_img_dim(_fptr, &naxis, &status);
-	CheckStatus(status);
-	return naxis;
-}
-
-long FitsFile::GetCurrentImageSize(int dimension)
-{
-	CheckOpen();
-	if(dimension > GetCurrentImageDimensionCount())
-		throw FitsIOException("Parameter outside range");
-	int status = 0;
-	long *sizes = new long[dimension];
-	fits_get_img_size(_fptr, dimension, sizes, &status);
-	long size = sizes[dimension-1];
-	delete[] sizes;
-	CheckStatus(status);
-	return size;
-}
-
-void FitsFile::ReadCurrentImageData(long startPos, num_t *buffer, long bufferSize, long double nullValue)
-{
-	CheckOpen();
-	int status = 0, dimensions = GetCurrentImageDimensionCount();
-	long *firstpixel = new long[dimensions];
-	for(int i=0;i < dimensions;i++) {
-		firstpixel[i] = 1 + startPos%GetCurrentImageSize(i+1);
-		startPos = startPos/GetCurrentImageSize(i+1);
-	}
-	double *dblbuffer = new double[bufferSize];
-	double dblNullValue = nullValue;
-	int anynul = 0;
-	fits_read_pix(_fptr, TDOUBLE, firstpixel, bufferSize, &dblNullValue, dblbuffer, &anynul, &status);
-	for(int i=0;i<bufferSize;i++)
-		buffer[i] = dblbuffer[i];
-	delete[] dblbuffer;
-	delete[] firstpixel;
-	CheckStatus(status);
-}
-
-void FitsFile::AppendImageHUD(enum FitsFile::ImageType imageType, long width, long height)
-{
-	int status = 0;
-	int bitPixInt;
-	switch(imageType) {
-		case Int8ImageType: bitPixInt = BYTE_IMG; break;
-		case Int16ImageType: bitPixInt = SHORT_IMG; break;
-		case Int32ImageType: bitPixInt = LONG_IMG; break;
-		case Float32ImageType: bitPixInt = FLOAT_IMG; break;
-		case Double64ImageType: bitPixInt = DOUBLE_IMG; break;
-		default: throw FitsIOException();
-	}
-	long *naxes = new long[2];
-	naxes[0] = width;
-	naxes[1] = height;
-	fits_create_img(_fptr, bitPixInt, 2, naxes, &status);
-	delete[] naxes;
-	CheckStatus(status);
-}
-
-void FitsFile::WriteImage(long startPos, double *buffer, long bufferSize, double nullValue)
-{
-	CheckOpen();
-	int status = 0, dimensions = GetCurrentImageDimensionCount();
-	long *firstpixel = new long[dimensions];
-	for(int i=0;i < dimensions;i++) {
-		firstpixel[i] = 1 + startPos%GetCurrentImageSize(i+1);
-		startPos = startPos/GetCurrentImageSize(i+1);
-	}
-	fits_write_pixnull(_fptr, TDOUBLE, firstpixel, bufferSize, buffer, &nullValue, &status);
-	delete[] firstpixel;
-	CheckStatus(status);
-}
-
-int FitsFile::GetRowCount()
-{
-	CheckOpen();
-	long rowCount;
-	int status = 0;
-	fits_get_num_rows(_fptr, &rowCount, &status);
-	CheckStatus(status);
-	return rowCount;
-}
-
-int FitsFile::GetKeywordCount()
-{
-	int status = 0, keysexist;
-	fits_get_hdrspace(_fptr, &keysexist, NULL, &status);
-	CheckStatus(status);
-	return keysexist;
-}
-
-std::string FitsFile::GetKeyword(int keywordNumber)
-{
-	char keyName[FLEN_KEYWORD], keyValue[FLEN_VALUE];
-	int status = 0;
-	fits_read_keyn(_fptr, keywordNumber, keyName, keyValue, NULL, &status);
-	CheckStatus(status);
-	return std::string(keyName);
-}
-
-std::string FitsFile::GetKeywordValue(int keywordNumber)
-{
-	char keyName[FLEN_KEYWORD], keyValue[FLEN_VALUE];
-	int status = 0;
-	fits_read_keyn(_fptr, keywordNumber, keyName, keyValue, NULL, &status);
-	CheckStatus(status);
-	std::string val(keyValue);
-	if(val.length() >= 2 && *val.begin()=='\'' && *val.rbegin()=='\'')
-	{
-		val = val.substr(1, val.length()-2);
-		boost::trim(val);
-	}
-	return val;
-}
-
-std::string FitsFile::GetKeywordValue(const std::string &keywordName)
-{
-	char keyValue[FLEN_VALUE];
-	int status = 0;
-	fits_read_keyword(_fptr, const_cast<char *>(keywordName.c_str()), keyValue, NULL, &status);
-	CheckStatus(status);
-	std::string val(keyValue);
-	if(val.length() >= 2 && *val.begin()=='\'' && *val.rbegin()=='\'')
-	{
-		val = val.substr(1, val.length()-2);
-		boost::trim(val);
-	}
-	return val;
-}
-
-std::string FitsFile::GetKeywordComment(int keywordNumber)
-{
-	char keyName[FLEN_KEYWORD], keyValue[FLEN_VALUE], keyComment[FLEN_COMMENT];
-	int status = 0;
-	fits_read_keyn(_fptr, keywordNumber, keyName, keyValue, keyComment, &status);
-	CheckStatus(status);
-	return std::string(keyComment);
-}
-
-int FitsFile::GetColumnCount()
-{
-	CheckOpen();
-	int rowCount, status = 0;
-	fits_get_num_cols(_fptr, &rowCount, &status);
-	CheckStatus(status);
-	return rowCount;
-}
-
-int FitsFile::GetColumnType(int colNumber)
-{
-	CheckOpen();
-	int typecode, status = 0;
-	long repeat, width;
-	fits_get_coltype(_fptr, colNumber, &typecode, &repeat, &width, &status);
-	CheckStatus(status);
-	return typecode;
-}
-
-int FitsFile::GetIntKeywordValue(int keywordNumber)
-{
-	return atoi(GetKeyword(keywordNumber).c_str());
-}
-
-int FitsFile::GetIntKeywordValue(const std::string &keywordName)
-{
-	return atoi(GetKeywordValue(keywordName).c_str());
-}
-
-double FitsFile::GetDoubleKeywordValue(int keywordNumber)
-{
-	return atof(GetKeyword(keywordNumber).c_str());
-}
-
-double FitsFile::GetDoubleKeywordValue(const std::string &keywordName)
-{
-	return atof(GetKeywordValue(keywordName).c_str());
-}
-
-bool FitsFile::HasGroups()
-{
-	try {
-		return GetKeywordValue("GROUPS") == "T";
-	} catch(FitsIOException &e)
-	{
-		return false;
-	}
-}
-
-int FitsFile::GetGroupCount()
-{
-	return GetIntKeywordValue("GCOUNT");
-}
-
-int FitsFile::GetParameterCount()
-{
-	return GetIntKeywordValue("PCOUNT");
-}
-
-long FitsFile::GetImageSize()
-{
-	long size = 1;
-	for(int i=2;i<=GetCurrentImageDimensionCount();++i)
-	{
-		size *= GetCurrentImageSize(i);
-	}
-	return size;
-}
-
-long FitsFile::GetGroupSize()
-{
-	if(!HasGroups())
-		throw FitsIOException("HDU has no groups");
-	long size = 1;
-	for(int i=2;i<=GetCurrentImageDimensionCount();++i)
-	{
-		size *= GetCurrentImageSize(i);
-	}
-	size += GetParameterCount();
-	return size;
-}
-
-void FitsFile::ReadGroupParameters(long groupIndex, long double *parametersData)
-{
-	int status = 0;
-	long pSize = GetParameterCount();
-	double *parameters = new double[pSize];
-
-	fits_read_grppar_dbl(_fptr, groupIndex+1, 1, pSize, parameters, &status);
-	CheckStatus(status);
-
-	for(long i = 0; i<pSize;++i)
-		parametersData[i] = parameters[i];
-
-	delete[] parameters;
-}
-
-void FitsFile::ReadGroup(long groupIndex, long double *groupData)
-{
-	int status = 0;
-	long size = GetImageSize();
-	long pSize = GetParameterCount();
-	double *parameters = new double[pSize];
-	double nulValue = std::numeric_limits<double>::quiet_NaN();
-	int anynul = 0;
-
-	fits_read_grppar_dbl(_fptr, groupIndex+1, 1, pSize, parameters, &status);
-	CheckStatus(status);
-
-	for(long i = 0; i<pSize;++i)
-		groupData[i] = parameters[i];
-
-	delete[] parameters;
-	double *data = new double[size];
-
-	fits_read_img_dbl(_fptr, groupIndex+1, 1, size, nulValue, data, &anynul, &status);
-	CheckStatus(status);
-
-	for(long i = 0; i<size; ++i)
-		groupData[pSize + i] = data[i];
-
-	delete[] data;
-
-	if(anynul != 0)
-		AOLogger::Warn << "There were nulls in the group\n";
-}
-
-void FitsFile::ReadGroupData(long groupIndex, long double *groupData)
-{
-	int status = 0;
-	long size = GetImageSize();
-	double nulValue = std::numeric_limits<double>::quiet_NaN();
-	int anynul = 0;
-
-	double *data = new double[size];
-
-	fits_read_img_dbl(_fptr, groupIndex+1, 1, size, nulValue, data, &anynul, &status);
-	CheckStatus(status);
-
-	for(long i = 0; i<size; ++i)
-		groupData[i] = data[i];
-
-	delete[] data;
-
-	if(anynul != 0)
-		AOLogger::Warn << "There were nulls in the group data\n";
-}
-
-int FitsFile::GetGroupParameterIndex(const std::string &parameterName)
-{
-	if(!HasGroups())
-		throw FitsIOException("HDU has no groups");
-	int parameterCount = GetParameterCount();
-	for(int i=1;i<=parameterCount;++i)
-	{
-		std::stringstream s;
-		s << "PTYPE" << i;
-		if(GetKeywordValue(s.str()) == parameterName)
-			return i-1;
-	}
-	throw FitsIOException(std::string("Can not find parameter with name ") + parameterName);
-}
-
-int FitsFile::GetGroupParameterIndex(const std::string &parameterName, int number)
-{
-	if(!HasGroups())
-		throw FitsIOException("HDU has no groups");
-	int parameterCount = GetParameterCount();
-	for(int i=1;i<=parameterCount;++i)
-	{
-		std::stringstream s;
-		s << "PTYPE" << i;
-		if(GetKeywordValue(s.str()) == parameterName)
-		{
-			--number;
-			if(number == 0)
-				return i-1;
-		}
-	}
-	throw FitsIOException(std::string("Can not find parameter with name ") + parameterName);
-}
-
-bool FitsFile::HasGroupParameter(const std::string &parameterName)
-{
-	if(!HasGroups()) return false;
-	int parameterCount = GetParameterCount();
-	for(int i=1;i<=parameterCount;++i)
-	{
-		std::stringstream s;
-		s << "PTYPE" << i;
-		if(GetKeywordValue(s.str()) == parameterName)
-			return true;
-	}
-	return false;
-}
-
-bool FitsFile::HasGroupParameter(const std::string &parameterName, int number)
-{
-	if(!HasGroups()) return false;
-	int parameterCount = GetParameterCount();
-	for(int i=1;i<=parameterCount;++i)
-	{
-		std::stringstream s;
-		s << "PTYPE" << i;
-		if(GetKeywordValue(s.str()) == parameterName)
-		{
-			--number;
-			if(number == 0) return true;
-		}
-	}
-	return false;
-}
-
-bool FitsFile::HasTableColumn(const std::string &columnName, int columnIndex)
-{
-	int colCount = GetColumnCount();
-	for(int i=1;i<=colCount;++i)
-	{
-		std::stringstream s;
-		s << "TTYPE" << i;
-		if(GetKeywordValue(s.str()) == columnName)
-		{
-			columnIndex = i;
-			return true;
-		}
-	}
-	return false;
-}
-
-int FitsFile::GetTableColumnIndex(const std::string &columnName)
-{
-	int colCount = GetColumnCount();
-	for(int i=1;i<=colCount;++i)
-	{
-		std::stringstream s;
-		s << "TTYPE" << i;
-		if(GetKeywordValue(s.str()) == columnName)
-			return i;
-	}
-	throw FitsIOException(std::string("Can not find column with name ") + columnName);
-}
-
-int FitsFile::GetTableColumnArraySize(int columnIndex)
-{
-	CheckOpen();
-	int typecode = 0, status = 0;
-	long repeat = 0, width = 0;
-	fits_get_coltype(_fptr, columnIndex, &typecode, &repeat, &width, &status);
-	CheckStatus(status);
-	return repeat;
-}
-
-long FitsFile::GetTableDimensionSize(int columnIndex, int dimension)
-{
-	CheckOpen();
-	int naxis = 0, status = 0, maxdim = 10;
-	long naxes[10];
-	for(size_t i=0;i!=10;++i) naxes[i] = 0;
-	fits_read_tdim(_fptr, columnIndex, maxdim, &naxis, naxes, &status);
-	CheckStatus(status);
-	return naxes[dimension];
-}
-
-void FitsFile::ReadTableCell(int row, int col, double *output, size_t size)
-{
-	int status = 0;
-	double nulValue = std::numeric_limits<double>::quiet_NaN();
-	int anynul = 0;
-	fits_read_col(_fptr, TDOUBLE, col, row, 1, size, &nulValue, output, &anynul, &status);
-}
-
-void FitsFile::ReadTableCell(int row, int col, long double *output, size_t size)
-{
-	double *data = new double[size];
-	int status = 0;
-	double nulValue = std::numeric_limits<double>::quiet_NaN();
-	int anynul = 0;
-	fits_read_col(_fptr, TDOUBLE, col, row, 1, size, &nulValue, data, &anynul, &status);
-	for(size_t i = 0;i<size;++i)
-		output[i] = data[i];
-	delete[] data;
-}
-
-void FitsFile::ReadTableCell(int row, int col, bool *output, size_t size)
-{
-	char *data = new char[size];
-	int status = 0;
-	char nulValue = 0;
-	int anynul = 0;
-	fits_read_col(_fptr, TBIT, col, row, 1, size, &nulValue, data, &anynul, &status);
-	for(size_t i = 0;i<size;++i)
-		output[i] = data[i]!=0;
-	delete[] data;
-}
-
-void FitsFile::ReadTableCell(int row, int col, char *output)
-{
-	int status = 0;
-	double nulValue = std::numeric_limits<double>::quiet_NaN();
-	int anynul = 0;
-	fits_read_col(_fptr, TSTRING, col, row, 1, 1, &nulValue, &output, &anynul, &status);
-}
-
-void FitsFile::WriteTableCell(int row, int col, double *data, size_t size)
-{
-	int status = 0;
-	fits_write_col(_fptr, TDOUBLE, col, row, 1, size, data, &status);
-	CheckStatus(status);
-}
-
-void FitsFile::WriteTableCell(int row, int col, const bool *data, size_t size)
-{
-	char *dataChar = new char[size];
-	int status = 0;
-	for(size_t i = 0;i<size;++i)
-	{
-		dataChar[i] = data[i] ? 1 : 0;
-	}
-	fits_write_col(_fptr, TBIT, col, row, 1, size, dataChar, &status);
-	delete[] dataChar;
-}
diff --git a/CEP/DP3/AOFlagger/src/msio/image2d.cpp b/CEP/DP3/AOFlagger/src/msio/image2d.cpp
deleted file mode 100644
index b7f8c8ca29638b69b8a79fae05a59a9b3f5bb622..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/msio/image2d.cpp
+++ /dev/null
@@ -1,584 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2007 by Andre Offringa   *
- *   offringa@gmail.com   *
- *                                                                         *
- *   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.             *
- ***************************************************************************/
-#include <AOFlagger/msio/image2d.h>
-#include <AOFlagger/msio/pngfile.h>
-#include <AOFlagger/msio/fitsfile.h>
-
-#include <algorithm>
-#include <cmath>
-#include <limits>
-
-#include <iostream>
-
-#include <xmmintrin.h>
-
-Image2D::Image2D(size_t width, size_t height) :
-	_width(width),
-	_height(height),
-	_stride((((width-1)/4)+1)*4)
-{
-	if(_width == 0) _stride=0;
-	unsigned allocHeight = ((((height-1)/4)+1)*4);
-	if(height == 0) allocHeight = 0;
-#ifdef __APPLE__
-        // OS-X has no posix_memalign, but malloc always uses 16-byte alignment.
-        _dataConsecutive = (num_t*)malloc(_stride * allocHeight * sizeof(num_t));
-#else
-	if(posix_memalign((void **) &_dataConsecutive, 16, _stride * allocHeight * sizeof(num_t)) != 0)
-		throw std::bad_alloc();
-#endif	
-	_dataPtr = new num_t*[allocHeight];
-	for(size_t y=0;y<height;++y)
-	{
-		_dataPtr[y] = &_dataConsecutive[_stride * y];
-		// Even though the values after the requested width are never relevant, we will
-		// initialize them to zero to prevent valgrind to report unset values when they
-		// are used in SSE instructions.
-		for(size_t x=_width;x<_stride;++x)
-		{
-			_dataPtr[y][x] = 0.0;
-		}
-	}
-	for(size_t y=height;y<allocHeight;++y)
-	{
-		_dataPtr[y] = &_dataConsecutive[_stride * y];
-		// (see remark above about initializing to zero)
-		for(size_t x=0;x<_stride;++x)
-		{
-			_dataPtr[y][x] = 0.0;
-		}
-	}
-}
-
-Image2D::~Image2D()
-{
-	delete[] _dataPtr;
-	free(_dataConsecutive);
-}
-
-Image2D *Image2D::CreateZeroImage(size_t width, size_t height) 
-{
-	Image2D *image = new Image2D(width, height);
-	image->SetAll(0.0);
-	return image;
-}
-
-Image2D *Image2D::CreateFromSum(const Image2D &imageA, const Image2D &imageB)
-{
-	if(imageA.Width() != imageB.Width() || imageA.Height() != imageB.Height())
-		throw IOException("Images do not match in size");
-	Image2D *image = new Image2D(imageA.Width(), imageA.Height());
-	const size_t total = imageA._stride * imageA.Height();
-	for(size_t i=0;i<total;++i) {
-		image->_dataConsecutive[i] = imageA._dataConsecutive[i] + imageB._dataConsecutive[i];
-	}
-	return image;
-}
-
-Image2D *Image2D::CreateFromDiff(const Image2D &imageA, const Image2D &imageB)
-{
-	if(imageA.Width() != imageB.Width() || imageA.Height() != imageB.Height())
-		throw IOException("Images do not match in size");
-	Image2D *image = new Image2D(imageA.Width(), imageA.Height());
-	const float *lhsPtr = &(imageA._dataConsecutive[0]);
-	const float *rhsPtr = &(imageB._dataConsecutive[0]);
-	float *destPtr = &(image->_dataConsecutive[0]);
-	const float *end = lhsPtr + imageA._stride * imageA._height;
-	while(lhsPtr < end)
-	{
-		// (*destPtr) = (*lhsPtr) - (*rhsPtr);
-		_mm_store_ps(destPtr, _mm_sub_ps(_mm_load_ps(lhsPtr), _mm_load_ps(rhsPtr)));
-		lhsPtr += 4;
-		rhsPtr += 4;
-		destPtr += 4;
-	}
-	return image;
-}
-
-Image2D *Image2D::CreateCopy(const Image2D &image)
-{
-	const size_t width = image.Width(), height = image.Height();
-	Image2D *newImage = new Image2D(width, height);
-	memcpy(newImage->_dataConsecutive, image._dataConsecutive, image._stride * height * sizeof(num_t));
-	return newImage;
-}
-
-void Image2D::SetValues(const Image2D &source)
-{
-	const size_t size = _stride*_height;
-	for(size_t i=0;i<size;++i) {
-		_dataConsecutive[i] = source._dataConsecutive[i];
-	}
-}
-
-void Image2D::SetAll(num_t value)
-{
-	const __m128 value4 = _mm_set_ps(value, value, value, value);
-	float *ptr = &_dataConsecutive[0];
-	const float *end = ptr + _stride * _height;
-	while(ptr < end) {
-		_mm_store_ps(ptr, value4);
-		ptr += 4;
-	}
-}
-
-num_t Image2D::GetAverage() const {
-	size_t count = 0;
-	num_t total = 0.0;
-	for(size_t y=0;y<_height;++y)
-	{
-		for(size_t x=0;x<_width;++x) {
-			total += _dataPtr[y][x];
-			count++;
-		}
-	}
-	return total/(num_t) count;
-}
-
-num_t Image2D::GetMaximum() const {
-	num_t max = _dataPtr[0][0];
-	for(size_t y=0;y<_height;++y)
-	{
-		for(size_t x=0;x<_width;++x) {
-			if(_dataPtr[y][x] > max) {
-				max = _dataPtr[y][x];
-			}
-		}
-	}
-	return max;
-}
-
-num_t Image2D::GetMinimum() const {
-	num_t min = _dataPtr[0][0];
-	for(size_t y=0;y<_height;++y)
-	{
-		for(size_t x=0;x<_width;++x) {
-			if(_dataPtr[y][x] < min) {
-				min = _dataPtr[y][x];
-			}
-		}
-	}
-	return min;
-}
-
-num_t Image2D::GetMaximumFinite() const {
-	num_t max = -1e100;
-	for(size_t y=0;y<_height;++y)
-	{
-		for(size_t x=0;x<_width;++x) {
-			if (std::isfinite(_dataPtr[y][x]) && _dataPtr[y][x] > max) {
-				max = _dataPtr[y][x];
-			}
-		}
-	}
-	return max;
-}
-
-num_t Image2D::GetMinimumFinite() const {
-	num_t min = 1e100;
-	for(size_t y=0;y<_height;++y)
-	{
-		for(size_t x=0;x<_width;++x) {
-			if(std::isfinite(_dataPtr[y][x]) && _dataPtr[y][x] < min) {
-				min = _dataPtr[y][x];
-			}
-		}
-	}
-	return min;
-}
-
-bool Image2D::ContainsOnlyZeros() const 
-{
-	for(size_t y=0;y<_height;++y)
-	{
-		for(size_t x=0;x<_width;++x)
-		{
-			if(_dataPtr[y][x] != 0.0)
-				return false;
-		}
-	}
-	return true;
-}
-
-num_t Image2D::GetMaxMinNormalizationFactor() const
-{
-	num_t max = GetMaximum(), min = GetMinimum();
-	num_t range = (-min) > max ? (-min) : max;
-	return 1.0/range;
-}
-
-num_t Image2D::GetStdDev() const
-{
-	num_t mean = GetAverage();
-	size_t count = 0;
-	num_t total = 0.0;
-	for(size_t y=0;y<_height;++y)
-	{
-		for(size_t x=0;x<_width;++x)
-		{
-			total += (_dataPtr[y][x]-mean)*(_dataPtr[y][x]-mean);
-			count++;
-		}
-	}
-	return sqrt(total / (num_t) count);
-}
-
-num_t Image2D::GetMode() const
-{
-	size_t size = _width * _height;
-
-	num_t mode = 0.0;
-	for(size_t y = 0;y<_height;++y) {
-		for(size_t x = 0;x<_width; ++x) {
-			const num_t value = _dataPtr[y][x];
-			mode += value * value;
-		}
-	}
-	return sqrtn(mode / (2.0L * (num_t) size));
-}
-
-num_t Image2D::GetRMS(size_t xOffset, size_t yOffset, size_t width, size_t height) const
-{
-	size_t count = 0;
-	num_t total = 0.0;
-	for(size_t y=yOffset;y<height+yOffset;++y)
-	{
-		for(size_t x=xOffset;x<width+xOffset;++x)
-		{
-			num_t v = Value(x, y);
-			total += v * v;
-			count++;
-		}
-	}
-	return sqrtn(total / (num_t) count);
-}
-
-void Image2D::NormalizeVariance()
-{
-	num_t variance = GetStdDev();
-	for(size_t y=0;y<_height;++y)
-	{
-		for(size_t x=0;x<_width;++x)
-		{
-			_dataPtr[y][x] /= variance;
-		}
-	}
-}
-
-Image2D *Image2D::CreateFromFits(FitsFile &file, int imageNumber)
-{
-	int dimensions = file.GetCurrentImageDimensionCount();
-	if(dimensions >= 2) {
-		Image2D *image = new Image2D(file.GetCurrentImageSize(1), file.GetCurrentImageSize(2));
-		long bufferSize = (long) image->_width * (long) image->_height;
-		num_t *buffer = new num_t[bufferSize];
-		file.ReadCurrentImageData(bufferSize*imageNumber, buffer, bufferSize, 0.0);
-		num_t *bufferPtr = buffer;
-		for(size_t y=0;y<image->_height;++y)
-		{
-			for(size_t x=0;x<image->_width;++x)
-			{
-				image->_dataPtr[y][x] = *bufferPtr;
-				++bufferPtr;
-			}
-		}
-		delete[] buffer;
-		
-		return image;
-	} else {
-		throw FitsIOException("No 2D images in HUD");
-	}
-}
-
-long Image2D::GetImageCountInHUD(FitsFile &file) {
-	int dimensions = file.GetCurrentImageDimensionCount();
-	long total2DImageCount = 0;
-	if(dimensions>=2) {
-		total2DImageCount = 1;
-		for(int j=3;j<=dimensions;j++) {
-			total2DImageCount *= file.GetCurrentImageSize(j);
-		}
-	}
-	return total2DImageCount;
-}
-
-void Image2D::SaveToFitsFile(const std::string &filename) const
-{
-	FitsFile file(filename);
-	file.Create();
-	file.AppendImageHUD(FitsFile::Double64ImageType, _width, _height);
-	long bufferSize = (long) _width * (long) _height;
-	double *buffer = new double[bufferSize];
-	size_t i=0;
-	for(size_t y=0;y<_height;++y)
-	{
-		for(size_t x=0;x<_width;++x)
-		{
-			buffer[i] = _dataPtr[y][x];
-			++i;
-		}
-	}
-	try {
-		file.WriteImage(0, buffer, bufferSize, -1e100);
-		file.Close();
-	} catch(FitsIOException &exception) {
-		delete[] buffer;
-		throw;
-	}
-	delete[] buffer;
-}
-
-size_t Image2D::GetCountAbove(num_t value) const
-{
-	size_t count=0;
-	for(size_t y=0;y<_height;++y)
-	{
-		for(size_t x=0;x<_width;++x)
-		{
-			if(_dataPtr[y][x] > value) count++;
-		}
-	}
-	return count;
-}
-
-num_t Image2D::GetTresholdForCountAbove(size_t count) const
-{
-	const size_t size = _width * _height;
-	num_t *sorted = new num_t[size];
-	size_t i = 0;
-	for(size_t y=0;y<_height;++y)
-	{
-		for(size_t x=0;x<_width;++x)
-		{
-			sorted[i] = _dataPtr[y][x];
-			++i;
-		}
-	}
-	std::sort(sorted, sorted + size);
-	num_t v = sorted[size - count - 1];
-	delete[] sorted;
-	return v;
-}
-
-void Image2D::CopyData(num_t *destination) const
-{
-	size_t i=0;
-	for(size_t y=0;y<_height;++y)
-	{
-		for(size_t x=0;x<_width;++x)
-		{
-			destination[i] = _dataPtr[y][x];
-			++i;
-		}
-	}
-}
-
-void Image2D::MultiplyValues(num_t factor)
-{
-	const size_t size = _stride * _height;
-	for(size_t i=0;i<size;++i)
-	{
-		_dataConsecutive[i] *= factor;
-	}
-}
-
-void Image2D::SubtractAsRHS(const Image2DCPtr &lhs)
-{
-	float *thisPtr = &_dataConsecutive[0];
-	const float *otherPtr = &(lhs->_dataConsecutive[0]);
-	float *end = thisPtr + _stride * _height;
-/* #ifdef __AVX__
-	while(thisPtr < end)
-	{
-		// (*thisPtr) = (*otherPtr) - (*thisPtr);
-		_mm_store256_ps(thisPtr, _mm_sub256_ps(_mm_load256_ps(otherPtr), _mm_load256_ps(thisPtr)));
-		thisPtr += 8;
-		otherPtr += 8;
-	}
-#else // Use slower SSE instructions
-*/
-	while(thisPtr < end)
-	{
-		// (*thisPtr) = (*otherPtr) - (*thisPtr);
-		_mm_store_ps(thisPtr, _mm_sub_ps(_mm_load_ps(otherPtr), _mm_load_ps(thisPtr)));
-		thisPtr += 4;
-		otherPtr += 4;
-	}
-}
-
-Image2DPtr Image2D::ShrinkHorizontally(size_t factor) const
-{
-	size_t newWidth = (_width + factor - 1) / factor;
-
-	Image2D *newImage = new Image2D(newWidth, _height);
-
-	for(size_t x=0;x<newWidth;++x)
-	{
-		size_t binSize = factor;
-		if(binSize + x*factor > _width)
-			binSize = _width - x*factor;
-
-		for(size_t y=0;y<_height;++y)
-		{
-			num_t sum = 0.0;
-			for(size_t binX=0;binX<binSize;++binX)
-			{
-				size_t curX = x*factor + binX;
-				sum += Value(curX, y);
-			}
-			newImage->SetValue(x, y, sum / (num_t) binSize);
-		}
-	}
-	return Image2DPtr(newImage);
-}
-
-Image2DPtr Image2D::ShrinkVertically(size_t factor) const
-{
-	size_t newHeight = (_height + factor - 1) / factor;
-
-	Image2D *newImage = new Image2D(_width, newHeight);
-
-	for(size_t y=0;y<newHeight;++y)
-	{
-		size_t binSize = factor;
-		if(binSize + y*factor > _height)
-			binSize = _height - y*factor;
-
-		for(size_t x=0;x<_width;++x)
-		{
-			num_t sum = 0.0;
-			for(size_t binY=0;binY<binSize;++binY)
-			{
-				size_t curY = y*factor + binY;
-				sum += Value(x, curY);
-			}
-			newImage->SetValue(x, y, sum / (num_t) binSize);
-		}
-	}
-	return Image2DPtr(newImage);
-}
-
-Image2DPtr Image2D::EnlargeHorizontally(size_t factor, size_t newWidth) const
-{
-	Image2D *newImage = new Image2D(newWidth, _height);
-
-	for(size_t x=0;x<newWidth;++x)
-	{
-		size_t xOld = x / factor;
-
-		for(size_t y=0;y<_height;++y)
-		{
-			newImage->SetValue(x, y, Value(xOld, y));
-		}
-	}
-	return Image2DPtr(newImage);
-}
-
-Image2DPtr Image2D::EnlargeVertically(size_t factor, size_t newHeight) const
-{
-	Image2D *newImage = new Image2D(_width, newHeight);
-
-	for(size_t x=0;x<_width;++x)
-	{
-		for(size_t y=0;y<newHeight;++y)
-		{
-			size_t yOld = y / factor;
-			newImage->SetValue(x, y, Value(x, yOld));
-		}
-	}
-	return Image2DPtr(newImage);
-}
-
-Image2DPtr Image2D::Trim(size_t startX, size_t startY, size_t endX, size_t endY) const
-{
-	size_t
-		width = endX - startX,
-		height = endY - startY;
-	Image2D *image = new Image2D(width, height);
-	for(size_t y=startY;y<endY;++y)
-	{
-		num_t *newPtr = image->_dataPtr[y-startY];
-		num_t *oldPtr = &_dataPtr[y][startX];
-		for(size_t x=startX;x<endX;++x)
-		{
-			*newPtr = *oldPtr;
-			++newPtr;
-			++oldPtr;
-		}
-	}
-	return Image2DPtr(image);
-}
-
-void Image2D::SetTrim(size_t startX, size_t startY, size_t endX, size_t endY)
-{
-	Image2DPtr trimmed = Trim(startX, startY, endX, endY);
-	std::swap(trimmed->_dataConsecutive, _dataConsecutive);
-	std::swap(trimmed->_dataPtr, _dataPtr);
-	std::swap(trimmed->_height, _height);
-	std::swap(trimmed->_width, _width);
-	std::swap(trimmed->_stride, _stride);
-}
-
-/**
-	* Returns the maximum value in the specified range.
-	* @return The maximimum value.
-	*/
-num_t Image2D::GetMaximum(size_t xOffset, size_t yOffset, size_t width, size_t height) const
-{
-	size_t count = 0;
-	num_t max =0.0;
-	for(size_t y=yOffset;y<height+yOffset;++y) {
-		for(size_t x=xOffset;x<width+xOffset;++x)
-		{
-			if(Value(x,y) > max || count==0)
-			{
-				max = Value(x, y);
-				++count;
-			}
-		}
-	}
-	if(count == 0)
-		return std::numeric_limits<num_t>::quiet_NaN();
-	return max;
-}
-
-/**
-	* Returns the minimum value in the specified range.
-	* @return The minimum value.
-	*/
-num_t Image2D::GetMinimum(size_t xOffset, size_t yOffset, size_t width, size_t height) const
-{
-	size_t count = 0;
-	num_t min = 0.0;
-	for(size_t y=yOffset;y<height+yOffset;++y) {
-		for(size_t x=xOffset;x<width+xOffset;++x)
-		{
-			if(Value(x,y) < min || count==0)
-			{
-				min = Value(x, y);
-				++count;
-			}
-		}
-	}
-	if(count == 0)
-		return std::numeric_limits<num_t>::quiet_NaN();
-	return min;
-}
-
diff --git a/CEP/DP3/AOFlagger/src/msio/indirectbaselinereader.cpp b/CEP/DP3/AOFlagger/src/msio/indirectbaselinereader.cpp
deleted file mode 100644
index d25629009852488804215c6763e28653cd643ba4..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/msio/indirectbaselinereader.cpp
+++ /dev/null
@@ -1,662 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <AOFlagger/msio/indirectbaselinereader.h>
-
-#include <fstream>
-#include <set>
-#include <stdexcept>
-
-#include <boost/filesystem.hpp>
-
-#include <AOFlagger/msio/arraycolumniterator.h>
-#include <AOFlagger/msio/scalarcolumniterator.h>
-#include <AOFlagger/msio/timefrequencydata.h>
-#include <AOFlagger/msio/system.h>
-
-#include <AOFlagger/util/aologger.h>
-#include <AOFlagger/util/stopwatch.h>
-
-IndirectBaselineReader::IndirectBaselineReader(const std::string &msFile) : BaselineReader(msFile), _directReader(msFile), _msIsReordered(false), _removeReorderedFiles(false), _reorderedDataFilesHaveChanged(false), _reorderedFlagFilesHaveChanged(false), _maxMemoryUse(1024*1024*1024), _readUVW(false)
-{
-	AOLogger::Debug << "Total system memory detected: " << System::TotalMemory() << '\n';
-	if(System::TotalMemory() < 3l*1024l*1024l*1024l)
-	{
-		AOLogger::Warn << "Memory available is less than 3 GB: using alternative buffer sizes" << '\n';
-		_maxMemoryUse = 128*1024*1024;
-	}
-}
-
-IndirectBaselineReader::~IndirectBaselineReader()
-{
-	if(_reorderedDataFilesHaveChanged)
-		updateOriginalMSData();
-	if(_reorderedFlagFilesHaveChanged)
-		updateOriginalMSFlags();
-	removeTemporaryFiles();
-}
-
-void IndirectBaselineReader::PerformReadRequests()
-{
-	initialize();
-
-	if(!_msIsReordered) initializeReorderedMS();
-
-	_results.clear();
-	AOLogger::Debug << "Performing " << _readRequests.size() << " read requests...\n";
-	for(size_t i=0;i<_readRequests.size();++i)
-	{
-		const ReadRequest request = _readRequests[i];
-		_results.push_back(Result());
-		const size_t width = AllObservationTimes().size();
-		for(size_t p=0;p<PolarizationCount();++p)
-		{
-			if(ReadData()) {
-				_results[i]._realImages.push_back(Image2D::CreateZeroImagePtr(width, FrequencyCount()));
-				_results[i]._imaginaryImages.push_back(Image2D::CreateZeroImagePtr(width, FrequencyCount()));
-			}
-			if(ReadFlags()) {
-				// The flags should be initialized to true, as a baseline might
-				// miss some time scans that other baselines do have, and these
-				// should be flagged.
-				_results[i]._flags.push_back(Mask2D::CreateSetMaskPtr<true>(width, FrequencyCount()));
-			}
-		}
-		if(_readUVW)
-			_results[i]._uvw = _directReader.ReadUVW(request.antenna1, request.antenna2, request.spectralWindow);
-		else {
-			_results[i]._uvw.clear();
-			for(unsigned j=0;j<width;++j)
-			_results[i]._uvw.push_back(UVW(0.0, 0.0, 0.0));
-		}
-
-		const std::string dataFilename = DataFilename(request.antenna1, request.antenna2);
-		std::ifstream dataFile(dataFilename.c_str(), std::ifstream::binary);
-
-		const std::string flagFilename = FlagFilename(request.antenna1, request.antenna2);
-		std::ifstream flagFile(flagFilename.c_str(), std::ifstream::binary);
-
-		const size_t bufferSize = FrequencyCount() * PolarizationCount();
-		for(size_t x=0;x<width;++x)
-		{
-			float dataBuffer[bufferSize*2];
-			bool flagBuffer[bufferSize];
-			dataFile.read((char *) dataBuffer, bufferSize * sizeof(float) * 2);
-			size_t dataBufferPtr = 0;
-			flagFile.read((char *) flagBuffer, bufferSize * sizeof(bool));
-			size_t flagBufferPtr = 0;
-			for(size_t f=0;f<FrequencyCount();++f) {
-				for(size_t p=0;p<PolarizationCount();++p)
-				{
-					_results[i]._realImages[p]->SetValue(x, f, dataBuffer[dataBufferPtr]);
-					++dataBufferPtr;
-					_results[i]._imaginaryImages[p]->SetValue(x, f, dataBuffer[dataBufferPtr]);
-					++dataBufferPtr;
-					_results[i]._flags[p]->SetValue(x, f, flagBuffer[flagBufferPtr]);
-					++flagBufferPtr;
-				}
-			}
-		}
-	}
-	AOLogger::Debug << "Done reading.\n";
-
-	_readRequests.clear();
-}
-
-void IndirectBaselineReader::PerformFlagWriteRequests()
-{
-	for(size_t i=0;i!=_writeRequests.size();++i)
-	{
-		const WriteRequest request = _writeRequests[i];
-		performFlagWriteTask(request.flags, request.antenna1, request.antenna2 /* TODO, request.spectralWindow, request.startIndex, request.endIndex, request.leftBorder, request.rightBorder */);
-	}
-	_writeRequests.clear();
-}
-
-void IndirectBaselineReader::initializeReorderedMS()
-{
-	boost::filesystem::path path("ms-aoinfo.txt");
-	bool reorderRequired = true;
-	
-	if(boost::filesystem::exists(path))
-	{
-		std::ifstream str(path.string().c_str());
-		std::string name;
-		std::getline(str, name);
-		if(boost::filesystem::equivalent(boost::filesystem::path(name), Set().Location()))
-		{
-			AOLogger::Debug << "Measurement set has already been reordered; using old temporary files.\n";
-			reorderRequired = false;
-			_msIsReordered = true;
-			_removeReorderedFiles = false;
-			_reorderedDataFilesHaveChanged = false;
-			_reorderedFlagFilesHaveChanged = false;
-		}
-	}
-	if(reorderRequired)
-	{
-		reorderMS();
-		std::ofstream str(path.string().c_str());
-		str << Set().Location() << '\n';
-	}
-}
-
-void IndirectBaselineReader::reorderMS()
-{
-	casa::Table &table = *Table();
-
-	casa::ROScalarColumn<double> timeColumn(*Table(), "TIME");
-	casa::ROArrayColumn<bool> flagColumn(table, "FLAG");
-	casa::ROScalarColumn<int> antenna1Column(table, "ANTENNA1"); 
-	casa::ROScalarColumn<int> antenna2Column(table, "ANTENNA2");
-
-	int rowCount = table.nrow();
-	if(rowCount == 0)
-		throw std::runtime_error("Measurement set is empty (zero rows)");
-
-	casa::ROArrayColumn<casa::Complex> *dataColumn = new casa::ROArrayColumn<casa::Complex>(table, DataColumnName());
-
-	std::vector<std::pair<size_t,size_t> > baselines;
-	Set().GetBaselines(baselines);
-	size_t
-		antennaCount = Set().AntennaCount(),
-		frequencyCount = FrequencyCount(),
-		polarizationCount = PolarizationCount();
-
-	size_t bufferSize = _maxMemoryUse / (baselines.size() * frequencyCount * polarizationCount * (sizeof(float) * 2 + sizeof(bool)));
-
-	std::vector<std::vector<float *> > dataBuffers;
-	std::vector<std::vector<bool *> > flagBuffers;
-	std::vector<std::vector<std::ofstream *> > dataFiles;
-	std::vector<std::vector<std::ofstream *> > flagFiles;
-	for(size_t i=0;i<antennaCount;++i) {
-		dataBuffers.push_back(std::vector<float *>());
-		dataFiles.push_back(std::vector<std::ofstream *>());
-		flagBuffers.push_back(std::vector<bool *>());
-		flagFiles.push_back(std::vector<std::ofstream *>());
-		for(size_t j=0;j<antennaCount;++j) {
-			dataBuffers[i].push_back(0);
-			dataFiles[i].push_back(0);
-			flagBuffers[i].push_back(0);
-			flagFiles[i].push_back(0);
-		}
-	}
-
-	AOLogger::Debug << "Requesting " << (sizeof(float)*2+sizeof(bool)) << " x " << baselines.size() << " x " << bufferSize << " x " << polarizationCount << " x " << frequencyCount << " bytes of data\n";
-	for(std::vector<std::pair<size_t,size_t> >::const_iterator i=baselines.begin();i<baselines.end();++i)
-	{
-		const std::string dataFilename = DataFilename(i->first, i->second);
-		const std::string flagFilename = FlagFilename(i->first, i->second);
-		dataBuffers[i->first][i->second] = new float[2 * bufferSize * frequencyCount * polarizationCount];
-		dataFiles[i->first][i->second] = new std::ofstream(dataFilename.c_str(), std::ofstream::binary);
-		if(dataFiles[i->first][i->second]->fail())
-			throw std::runtime_error("Error: failed to open temporary data files for writing! Check access rights and free disk space.");
-		flagBuffers[i->first][i->second] = new bool[bufferSize * frequencyCount * polarizationCount];
-		flagFiles[i->first][i->second] = new std::ofstream(flagFilename.c_str(), std::ofstream::binary);
-		if(flagFiles[i->first][i->second]->fail())
-			throw std::runtime_error("Error: failed to open temporary data files for writing! Check access rights and free disk space.");
-	}
-
-	size_t
-		prevTimeIndex = (size_t) (-1),
-		timeIndex = 0,
-		currentBufferBlockPtr = (size_t) (-1);
-	double prevTime = -1.0;
-
-	AOLogger::Debug << 'R';
-	AOLogger::Debug.Flush();
-	for(int rowIndex = 0;rowIndex < rowCount;++rowIndex)
-	{
-		double time = timeColumn(rowIndex);
-		if(time != prevTime)
-		{
-			timeIndex = AllObservationTimes().find(time)->second;
-			if(timeIndex != prevTimeIndex+1)
-			{
-				std::stringstream s;
-				s << "Error: time step " << prevTimeIndex << " is followed by time step " << timeIndex;
-				throw std::runtime_error(s.str());
-			}
-			prevTime = time;
-			prevTimeIndex = timeIndex;
-			++currentBufferBlockPtr;
-
-			if(currentBufferBlockPtr >= bufferSize)
-			{
-				// buffer is full, flush
-				AOLogger::Debug << 'W';
-				AOLogger::Debug.Flush();
-				for(std::vector<std::pair<size_t,size_t> >::const_iterator i=baselines.begin();i<baselines.end();++i)
-				{
-					const size_t sampleCount = bufferSize * frequencyCount * polarizationCount;
-					float *dataBuffer = dataBuffers[i->first][i->second];
-					bool *flagBuffer = flagBuffers[i->first][i->second];
-					std::ofstream *dataFile = dataFiles[i->first][i->second];
-					std::ofstream *flagFile = flagFiles[i->first][i->second];
-					dataFile->write(reinterpret_cast<char*>(dataBuffer), sampleCount * 2 * sizeof(float));
-					if(dataFile->fail())
-						throw std::runtime_error("Error: failed to write temporary data files! Check access rights and free disk space.");
-					flagFile->write(reinterpret_cast<char*>(flagBuffer), sampleCount * sizeof(bool));
-					if(flagFile->fail())
-						throw std::runtime_error("Error: failed to write temporary flag files! Check access rights and free disk space.");
-				}
-
-				AOLogger::Debug << 'R';
-				AOLogger::Debug.Flush();
-				currentBufferBlockPtr = 0;
-			}
-		}
-		
-		casa::Array<casa::Complex> data = (*dataColumn)(rowIndex);
-		casa::Array<casa::Complex>::const_iterator dataI=data.begin();
-		casa::Array<bool> flag = flagColumn(rowIndex);
-		casa::Array<bool>::const_iterator flagI=flag.begin();
-		size_t dataBufferPtr = currentBufferBlockPtr*2*frequencyCount*polarizationCount;
-		float *dataBuffer = dataBuffers[antenna1Column(rowIndex)][antenna2Column(rowIndex)];
-		size_t flagBufferPtr = currentBufferBlockPtr*frequencyCount*polarizationCount;
-		bool *flagBuffer = flagBuffers[antenna1Column(rowIndex)][antenna2Column(rowIndex)];
-		for(size_t f=0;f<frequencyCount;++f) {
-			for(size_t p=0;p<polarizationCount;++p) {
-				dataBuffer[dataBufferPtr] = dataI->real();
-				++dataBufferPtr;
-				dataBuffer[dataBufferPtr] = dataI->imag();
-				++dataI;
-				++dataBufferPtr;
-
-				flagBuffer[flagBufferPtr] = *flagI;
-				++flagBufferPtr;
-				++flagI;
-			}
-		}
-	}
-	
-	// flush half-full buffer
-	AOLogger::Debug << "W";
-	AOLogger::Debug.Flush();
-	++currentBufferBlockPtr; // Since we have finished reading the last timestep
-	                         // the buffer contains one more
-	for(std::vector<std::pair<size_t,size_t> >::const_iterator i=baselines.begin();i<baselines.end();++i)
-	{
-		const size_t sampleCount = currentBufferBlockPtr * frequencyCount * polarizationCount;
-		float *dataBuffer = dataBuffers[i->first][i->second];
-		bool *flagBuffer = flagBuffers[i->first][i->second];
-		std::ofstream *dataFile = dataFiles[i->first][i->second];
-		std::ofstream *flagFile = flagFiles[i->first][i->second];
-		dataFile->write(reinterpret_cast<char*>(dataBuffer), sampleCount * 2 * sizeof(float));
-		if(dataFile->fail())
-			throw std::runtime_error("Error: failed to write temporary data files! Check access rights and free disk space.");
-		flagFile->write(reinterpret_cast<char*>(flagBuffer), sampleCount * sizeof(bool));
-		if(flagFile->fail())
-			throw std::runtime_error("Error: failed to write temporary flag files! Check access rights and free disk space.");
-	}
-
-	for(std::vector<std::pair<size_t,size_t> >::const_iterator i=baselines.begin();i<baselines.end();++i)
-	{
-		delete[] dataBuffers[i->first][i->second];
-		delete[] flagBuffers[i->first][i->second];
-		delete dataFiles[i->first][i->second];
-		delete flagFiles[i->first][i->second];
-	}
-
-	delete dataColumn;
-
-	clearTableCaches();
-
-	AOLogger::Debug << "Done reordering data set\n";
-	_msIsReordered = true;
-	_removeReorderedFiles = true;
-	_reorderedDataFilesHaveChanged = false;
-	_reorderedFlagFilesHaveChanged = false;
-}
-
-void IndirectBaselineReader::removeTemporaryFiles()
-{
-	if(_msIsReordered && _removeReorderedFiles)
-	{
-		boost::filesystem::remove("ms-aoinfo.txt");
-		std::vector<std::pair<size_t,size_t> > baselines;
-		Set().GetBaselines(baselines);
-		for(std::vector<std::pair<size_t,size_t> >::const_iterator i=baselines.begin();i<baselines.end();++i)
-		{
-			boost::filesystem::remove(DataFilename(i->first, i->second));
-			boost::filesystem::remove(FlagFilename(i->first, i->second));
-		}
-		AOLogger::Debug << "Temporary files removed.\n";
-	}
-	_msIsReordered = false;
-	_removeReorderedFiles = false;
-	_reorderedDataFilesHaveChanged = false;
-	_reorderedFlagFilesHaveChanged = false;
-}
-
-void IndirectBaselineReader::PerformDataWriteTask(std::vector<Image2DCPtr> _realImages, std::vector<Image2DCPtr> _imaginaryImages, int antenna1, int antenna2, int /*spectralWindow*/)
-{
-	initialize();
-
-	AOLogger::Debug << "Performing data write task with indirect baseline reader...\n";
-
-	const size_t polarizationCount = PolarizationCount();
-	
-	if(_realImages.size() != polarizationCount || _imaginaryImages.size() != polarizationCount)
-		throw std::runtime_error("PerformDataWriteTask: input format did not match number of polarizations in measurement set");
-	
-	for(size_t i=1;i<_realImages.size();++i)
-	{
-		if(_realImages[0]->Width() != _realImages[i]->Width() || _realImages[0]->Height() != _realImages[i]->Height() || _realImages[0]->Width() != _imaginaryImages[i]->Width() || _realImages[0]->Height() != _imaginaryImages[i]->Height())
-		throw std::runtime_error("PerformDataWriteTask: width and/or height of input images did not match");
-	}
-	
-	if(!_msIsReordered) initializeReorderedMS();
-	
-	const size_t width = _realImages[0]->Width();
-	const size_t bufferSize = FrequencyCount() * PolarizationCount();
-	
-	const std::string dataFilename = DataFilename(antenna1, antenna2);
-	std::ofstream dataFile(dataFilename.c_str(), std::ofstream::binary | std::ofstream::trunc);
-		
-	for(size_t x=0;x<width;++x)
-	{
-		float dataBuffer[bufferSize*2];
-		
-		size_t dataBufferPtr = 0;
-		for(size_t f=0;f<FrequencyCount();++f) {
-			for(size_t p=0;p<PolarizationCount();++p)
-			{
-				dataBuffer[dataBufferPtr] = _realImages[p]->Value(x, f);
-				++dataBufferPtr;
-				dataBuffer[dataBufferPtr] = _imaginaryImages[p]->Value(x, f);
-				++dataBufferPtr;
-			}
-		}
-
-		dataFile.write(reinterpret_cast<char*>(dataBuffer), bufferSize * sizeof(float) * 2);
-		if(dataFile.bad())
-			throw std::runtime_error("Error: failed to update temporary data files! Check access rights and free disk space.");
-	}
-	
-	_reorderedDataFilesHaveChanged = true;
-	
-	AOLogger::Debug << "Done writing.\n";
-}
-
-void IndirectBaselineReader::performFlagWriteTask(std::vector<Mask2DCPtr> flags, int antenna1, int antenna2)
-{
-	initialize();
-
-	const size_t polarizationCount = PolarizationCount();
-	
-	if(flags.size() != polarizationCount)
-		throw std::runtime_error("PerformDataWriteTask: input format did not match number of polarizations in measurement set");
-	
-	for(size_t i=1;i<flags.size();++i)
-	{
-		if(flags[0]->Width() != flags[i]->Width() || flags[0]->Height() != flags[i]->Height())
-		throw std::runtime_error("PerformDataWriteTask: width and/or height of input images did not match");
-	}
-	
-	if(!_msIsReordered) initializeReorderedMS();
-	
-	const size_t width = flags[0]->Width();
-	const size_t bufferSize = FrequencyCount() * PolarizationCount();
-	
-	const std::string flagFilename = FlagFilename(antenna1, antenna2);
-	std::ofstream flagFile(flagFilename.c_str(), std::ofstream::binary | std::ofstream::trunc);
-	
-	for(size_t x=0;x<width;++x)
-	{
-		bool flagBuffer[bufferSize];
-		
-		size_t flagBufferPtr = 0;
-		for(size_t f=0;f<FrequencyCount();++f) {
-			for(size_t p=0;p<PolarizationCount();++p)
-			{
-				flagBuffer[flagBufferPtr] = flags[p]->Value(x, f);
-				++flagBufferPtr;
-			}
-		}
-
-		flagFile.write(reinterpret_cast<char*>(flagBuffer), bufferSize * sizeof(bool));
-		if(flagFile.bad())
-			throw std::runtime_error("Error: failed to update temporary flag files! Check access rights and free disk space.");
-	}
-	
-	_reorderedFlagFilesHaveChanged = true;
-}
-
-template<bool UpdateData, bool UpdateFlags>
-void IndirectBaselineReader::updateOriginalMS()
-{
-	casa::Table &table = *Table();
-
-	casa::ROScalarColumn<double> timeColumn(*Table(), "TIME");
-	casa::ROScalarColumn<int> antenna1Column(table, "ANTENNA1"); 
-	casa::ROScalarColumn<int> antenna2Column(table, "ANTENNA2");
-	casa::ArrayColumn<bool> flagColumn(table, "FLAG");
-	casa::ArrayColumn<casa::Complex> *dataColumn = new casa::ArrayColumn<casa::Complex>(table, DataColumnName());
-
-	int rowCount = table.nrow();
-
-	std::vector<std::pair<size_t,size_t> > baselines;
-	Set().GetBaselines(baselines);
-	size_t
-		antennaCount = Set().AntennaCount(),
-		frequencyCount = FrequencyCount(),
-		polarizationCount = PolarizationCount();
-
-	// Initialize data buffer and files for reading
-	size_t bufferSize = _maxMemoryUse / (baselines.size() * frequencyCount * polarizationCount * (sizeof(float) * 2 + sizeof(bool)));
-	std::vector<std::vector<float *> > dataBuffers;
-	std::vector<std::vector<std::ifstream *> > dataFiles;
-	std::vector<std::vector<bool *> > flagBuffers;
-	std::vector<std::vector<std::ifstream *> > flagFiles;
-	for(size_t i=0;i<antennaCount;++i) {
-		if(UpdateData)
-		{
-			dataBuffers.push_back(std::vector<float *>());
-			dataFiles.push_back(std::vector<std::ifstream *>());
-			for(size_t j=0;j<antennaCount;++j) {
-				dataBuffers[i].push_back(0);
-				dataFiles[i].push_back(0);
-			}
-		}
-		if(UpdateFlags)
-		{
-			flagBuffers.push_back(std::vector<bool *>());
-			flagFiles.push_back(std::vector<std::ifstream *>());
-			for(size_t j=0;j<antennaCount;++j) {
-				flagBuffers[i].push_back(0);
-				flagFiles[i].push_back(0);
-			}
-		}
-	}
-
-	AOLogger::Debug << "Requesting " << (sizeof(float)*2+sizeof(bool)) << " x " << baselines.size() << " x " << bufferSize << " x " << polarizationCount << " x " << frequencyCount << " bytes of data\n";
-	for(std::vector<std::pair<size_t,size_t> >::const_iterator i=baselines.begin();i<baselines.end();++i)
-	{
-		if(UpdateData)
-		{
-			const std::string dataFilename = DataFilename(i->first, i->second);
-			dataBuffers[i->first][i->second] = new float[2 * bufferSize * frequencyCount * polarizationCount];
-			dataFiles[i->first][i->second] = new std::ifstream(dataFilename.c_str(), std::ifstream::binary);
-		}
-		if(UpdateFlags)
-		{
-			const std::string flagFilename = FlagFilename(i->first, i->second);
-			flagBuffers[i->first][i->second] = new bool[bufferSize * frequencyCount * polarizationCount];
-			flagFiles[i->first][i->second] = new std::ifstream(flagFilename.c_str(), std::ifstream::binary);
-		}
-	}
-
-	// read first chunk
-	AOLogger::Debug << 'R';
-	AOLogger::Debug.Flush();
-	for(std::vector<std::pair<size_t,size_t> >::const_iterator i=baselines.begin();i<baselines.end();++i)
-	{
-		const size_t sampleCount = bufferSize * frequencyCount * polarizationCount;
-		if(UpdateData)
-		{
-			float *dataBuffer = dataBuffers[i->first][i->second];
-			std::ifstream *dataFile = dataFiles[i->first][i->second];
-			if(dataFile->fail())
-				throw std::runtime_error("Error: failed to read temporary data files!");
-			dataFile->read(reinterpret_cast<char*>(dataBuffer), sampleCount * 2 * sizeof(float));
-		}
-		if(UpdateFlags)
-		{
-			bool *flagBuffer = flagBuffers[i->first][i->second];
-			std::ifstream *flagFile = flagFiles[i->first][i->second];
-			if(flagFile->fail())
-				throw std::runtime_error("Error: failed to read temporary data files!");
-			flagFile->read(reinterpret_cast<char*>(flagBuffer), sampleCount * sizeof(bool));
-		}
-	}
-	
-	AOLogger::Debug << 'W';
-	AOLogger::Debug.Flush();
-	
-	size_t
-		prevTimeIndex = (size_t) (-1),
-		timeIndex = 0,
-		currentBufferBlockPtr = (size_t) (-1);
-	double prevTime = -1.0;
-	
-	// This loop writes the chunks back to the MS and then reads the next chunks from the reordered file.
-	for(int rowIndex = 0;rowIndex < rowCount;++rowIndex)
-	{
-		// We only read entire time steps at a time, so as long as time does not change, don't check if buffer is empty
-		double time = timeColumn(rowIndex);
-		if(time != prevTime)
-		{
-			// This row has a different time value, so search it up in the index table and do sanity check
-			timeIndex = AllObservationTimes().find(time)->second;
-			if(timeIndex != prevTimeIndex+1)
-			{
-				std::stringstream s;
-				s << "Error: time step " << prevTimeIndex << " is followed by time step " << timeIndex;
-				throw std::runtime_error(s.str());
-			}
-			prevTime = time;
-			prevTimeIndex = timeIndex;
-			++currentBufferBlockPtr;
-
-			if(currentBufferBlockPtr >= bufferSize)
-			{
-				// entire buffer was written to MS, read next chunk from reordered files
-				AOLogger::Debug << 'R';
-				AOLogger::Debug.Flush();
-				for(std::vector<std::pair<size_t,size_t> >::const_iterator i=baselines.begin();i<baselines.end();++i)
-				{
-					const size_t sampleCount = bufferSize * frequencyCount * polarizationCount;
-					if(UpdateData)
-					{
-						float *dataBuffer = dataBuffers[i->first][i->second];
-						std::ifstream *dataFile = dataFiles[i->first][i->second];
-						if(dataFile->fail())
-							throw std::runtime_error("Error: failed to read temporary data files!");
-						dataFile->read(reinterpret_cast<char*>(dataBuffer), sampleCount * 2 * sizeof(float));
-					}
-					if(UpdateFlags)
-					{
-						bool *flagBuffer = flagBuffers[i->first][i->second];
-						std::ifstream *flagFile = flagFiles[i->first][i->second];
-						if(flagFile->fail())
-							throw std::runtime_error("Error: failed to read temporary flag files!");
-						flagFile->read(reinterpret_cast<char*>(flagBuffer), sampleCount * sizeof(bool));
-					}
-				}
-
-				AOLogger::Debug << 'W';
-				AOLogger::Debug.Flush();
-				currentBufferBlockPtr = 0;
-			}
-		}
-		
-		// Write the current row
-		if(UpdateData)
-		{
-			casa::Array<casa::Complex> data = (*dataColumn)(rowIndex);
-			casa::Array<casa::Complex>::iterator dataIter=data.begin();
-			size_t dataBufferPtr = currentBufferBlockPtr*2*frequencyCount*polarizationCount;
-			const float *dataBuffer = dataBuffers[antenna1Column(rowIndex)][antenna2Column(rowIndex)];
-			for(size_t f=0;f<frequencyCount;++f) {
-				for(size_t p=0;p<polarizationCount;++p) {
-					(*dataIter) = casa::Complex(dataBuffer[dataBufferPtr], dataBuffer[dataBufferPtr+1]);
-					++dataIter;
-					dataBufferPtr += 2;
-				}
-			}
-			dataColumn->basePut(rowIndex, data);
-		}
-		if(UpdateFlags)
-		{
-			casa::Array<bool> flagArray = flagColumn(rowIndex);
-			casa::Array<bool>::iterator flagIter=flagArray.begin();
-			size_t flagBufferPtr = currentBufferBlockPtr*frequencyCount*polarizationCount;
-			const bool *flagBuffer = flagBuffers[antenna1Column(rowIndex)][antenna2Column(rowIndex)];
-			for(size_t f=0;f<frequencyCount;++f) {
-				for(size_t p=0;p<polarizationCount;++p) {
-					(*flagIter) = flagBuffer[flagBufferPtr];
-					++flagIter;
-					++flagBufferPtr;
-				}
-			}
-			flagColumn.basePut(rowIndex, flagArray);
-		}
-	}
-	
-	AOLogger::Debug << "\nFreeing the data\n";
-	for(std::vector<std::pair<size_t,size_t> >::const_iterator i=baselines.begin();i<baselines.end();++i)
-	{
-		if(UpdateData)
-		{
-			delete[] dataBuffers[i->first][i->second];
-			delete dataFiles[i->first][i->second];
-		}
-		if(UpdateFlags)
-		{
-			delete[] flagBuffers[i->first][i->second];
-			delete flagFiles[i->first][i->second];
-		}
-	}
-
-	delete dataColumn;
-
-	clearTableCaches();
-
-	if(UpdateData)
-		AOLogger::Debug << "Done updating measurement set data\n";
-	if(UpdateFlags)
-		AOLogger::Debug << "Done updating measurement set flags\n";
-}
-
-void IndirectBaselineReader::updateOriginalMSData()
-{
-	AOLogger::Debug << "Data was changed, need to update the original MS...\n";
-	updateOriginalMS<true, false>();
-	_reorderedDataFilesHaveChanged = false;
-}
-
-void IndirectBaselineReader::updateOriginalMSFlags()
-{
-	Stopwatch watch(true);
-	AOLogger::Debug << "Flags were changed, need to update the original MS...\n";
-	updateOriginalMS<false, true>();
-	_reorderedFlagFilesHaveChanged = false;
-	AOLogger::Debug << "Storing flags toke: " << watch.ToString() << '\n';
-}
diff --git a/CEP/DP3/AOFlagger/src/msio/mask2d.cpp b/CEP/DP3/AOFlagger/src/msio/mask2d.cpp
deleted file mode 100644
index 007f5729128cb65b3bd65651055d3e04c0311df9..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/msio/mask2d.cpp
+++ /dev/null
@@ -1,209 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <AOFlagger/msio/mask2d.h>
-#include <AOFlagger/msio/image2d.h>
-
-#include <iostream>
-
-Mask2D::Mask2D(size_t width, size_t height) :
-	_width(width),
-	_height(height),
-	_stride((((width-1)/4)+1)*4)
-{
-	if(_width == 0) _stride=0;
-	unsigned allocHeight = ((((height-1)/4)+1)*4);
-	if(height == 0) allocHeight = 0;
-	_valuesConsecutive = new bool[_stride * allocHeight * sizeof(bool)];
-	
-	_values = new bool*[allocHeight];
-	for(size_t y=0;y<height;++y)
-	{
-		_values[y] = &_valuesConsecutive[_stride * y];
-		// Even though the values after the requested width are never relevant, we will
-		// initialize them to true to prevent valgrind to report unset values when they
-		// are used in SSE instructions.
-		for(size_t x=_width;x<_stride;++x)
-		{
-			_values[y][x] = true;
-		}
-	}
-	for(size_t y=height;y<allocHeight;++y)
-	{
-		_values[y] = &_valuesConsecutive[_stride * y];
-		// (see remark above about initializing to true)
-		for(size_t x=0;x<_stride;++x)
-		{
-			_values[y][x] = true;
-		}
-	}
-}
-
-Mask2D::~Mask2D()
-{
-	delete[] _values;
-	delete[] _valuesConsecutive;
-}
-
-Mask2D *Mask2D::CreateUnsetMask(const Image2D &templateImage)
-{
-	return new Mask2D(templateImage.Width(), templateImage.Height());
-}
-
-template <bool InitValue>
-Mask2D *Mask2D::CreateSetMask(const class Image2D &templateImage)
-{
-	size_t
-		width = templateImage.Width(),
-		height = templateImage.Height();
-
-	Mask2D *newMask = new Mask2D(width, height);
-	memset(newMask->_valuesConsecutive, InitValue, newMask->_stride * height * sizeof(bool));
-	return newMask;
-}
-
-template Mask2D *Mask2D::CreateSetMask<false>(const class Image2D &templateImage);
-template Mask2D *Mask2D::CreateSetMask<true>(const class Image2D &templateImage);
-
-Mask2D *Mask2D::CreateCopy(const Mask2D &source)
-{
-	size_t
-		width = source.Width(),
-		height = source.Height();
-
-	Mask2D *newMask = new Mask2D(width, height);
-	memcpy(newMask->_valuesConsecutive, source._valuesConsecutive, source._stride * height * sizeof(bool));
-	return newMask;
-}
-
-Mask2DPtr Mask2D::ShrinkHorizontally(int factor) const
-{
-	size_t newWidth = (_width + factor - 1) / factor;
-
-	Mask2D *newMask= new Mask2D(newWidth, _height);
-
-	for(size_t x=0;x<newWidth;++x)
-	{
-		size_t binSize = factor;
-		if(binSize + x*factor > _width)
-			binSize = _width - x*factor;
-
-		for(size_t y=0;y<_height;++y)
-		{
-			bool value = false;
-			for(size_t binX=0;binX<binSize;++binX)
-			{
-				size_t curX = x*factor + binX;
-				value = value | Value(curX, y);
-			}
-			newMask->SetValue(x, y, value);
-		}
-	}
-	return Mask2DPtr(newMask);
-}
-
-Mask2DPtr Mask2D::ShrinkHorizontallyForAveraging(int factor) const
-{
-	size_t newWidth = (_width + factor - 1) / factor;
-
-	Mask2D *newMask= new Mask2D(newWidth, _height);
-
-	for(size_t x=0;x<newWidth;++x)
-	{
-		size_t binSize = factor;
-		if(binSize + x*factor > _width)
-			binSize = _width - x*factor;
-
-		for(size_t y=0;y<_height;++y)
-		{
-			bool value = true;
-			for(size_t binX=0;binX<binSize;++binX)
-			{
-				size_t curX = x*factor + binX;
-				value = value & Value(curX, y);
-			}
-			newMask->SetValue(x, y, value);
-		}
-	}
-	return Mask2DPtr(newMask);
-}
-
-Mask2DPtr Mask2D::ShrinkVertically(int factor) const
-{
-	size_t newHeight = (_height + factor - 1) / factor;
-
-	Mask2D *newMask= new Mask2D(_width, newHeight);
-
-	for(size_t y=0;y<newHeight;++y)
-	{
-		size_t binSize = factor;
-		if(binSize + y*factor > _height)
-			binSize = _height - y*factor;
-
-		for(size_t x=0;x<_width;++x)
-		{
-			bool value = false;
-			for(size_t binY=0;binY<binSize;++binY)
-			{
-				size_t curY = y*factor + binY;
-				value = value | Value(x, curY);
-			}
-			newMask->SetValue(x, y, value);
-		}
-	}
-	return Mask2DPtr(newMask);
-}
-
-void Mask2D::EnlargeHorizontallyAndSet(Mask2DCPtr smallMask, int factor)
-{
-	for(size_t x=0;x<smallMask->Width();++x)
-	{
-		size_t binSize = factor;
-		if(binSize + x*factor > _width)
-			binSize = _width - x*factor;
-
-		for(size_t y=0;y<_height;++y)
-		{
-			for(size_t binX=0;binX<binSize;++binX)
-			{
-				size_t curX = x*factor + binX;
-				SetValue(curX, y, smallMask->Value(x, y));
-			}
-		}
-	}
-}
-
-void Mask2D::EnlargeVerticallyAndSet(Mask2DCPtr smallMask, int factor)
-{
-	for(size_t y=0;y<smallMask->Height();++y)
-	{
-		size_t binSize = factor;
-		if(binSize + y*factor > _height)
-			binSize = _height - y*factor;
-
-		for(size_t x=0;x<_width;++x)
-		{
-			for(size_t binY=0;binY<binSize;++binY)
-			{
-				size_t curY = y*factor + binY;
-				SetValue(x, curY, smallMask->Value(x, y));
-			}
-		}
-	}
-}
diff --git a/CEP/DP3/AOFlagger/src/msio/measurementset.cpp b/CEP/DP3/AOFlagger/src/msio/measurementset.cpp
deleted file mode 100644
index 15c18b347b84ae30bf69931da9ee251d3ce958b8..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/msio/measurementset.cpp
+++ /dev/null
@@ -1,470 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <ms/MeasurementSets/MeasurementSet.h>
-#include <ms/MeasurementSets/MSTable.h>
-#include <tables/Tables/TableDesc.h>
-#include <tables/Tables/TableRow.h>
-#include <tables/Tables/ExprNode.h>
-
-#include <AOFlagger/msio/measurementset.h>
-#include <AOFlagger/msio/arraycolumniterator.h>
-#include <AOFlagger/msio/scalarcolumniterator.h>
-
-#include <AOFlagger/util/aologger.h>
-
-#include <AOFlagger/strategy/control/strategywriter.h>
-
-#include <AOFlagger/Package__Version.h>
-#include <AOFlagger/msio/date.h>
-
-MeasurementSet::MeasurementSet(const std::string &newLocation, const MeasurementSet &formatExample)
-	: _location(newLocation), _maxSpectralBandIndex(-1),
-	_maxFrequencyIndex(-1), _maxScanIndex(-1), _cacheInitialized(false)
-{
-	casa::Table *table = formatExample.OpenTable(false);
-	table->copy(newLocation, casa::Table::New, true);
-	delete table;
-}
-
-MeasurementSet::~MeasurementSet()
-{
-}
-
-casa::Table *MeasurementSet::OpenTable(bool update) const
-{
-	std::string tableLocation = _location;
-	casa::Table *table;
-	if(update)
-		table = new casa::Table(tableLocation, casa::Table::Update);
-	else
-		table = new casa::Table(tableLocation);
-	return table;
-}
-
-size_t MeasurementSet::MaxSpectralBandIndex()
-{
-	if(_maxSpectralBandIndex==-1) {
-		casa::Table *table = OpenTable();
-		casa::ROScalarColumn<int> windowColumn(*table, "DATA_DESC_ID");
-		ScalarColumnIterator<int> windowIter = ScalarColumnIterator<int>::First(windowColumn);
-		for(size_t i=0;i<table->nrow();++i,++windowIter) {
-			if((*windowIter) > _maxSpectralBandIndex)
-				_maxSpectralBandIndex = (*windowIter);
-		}
-		delete table;
-	}
-	return _maxSpectralBandIndex;
-}
-
-size_t MeasurementSet::FrequencyCount()
-{
-	if(_maxFrequencyIndex==-1) {
-		casa::Table *table = OpenTable();
-		casa::ROArrayColumn<casa::Complex> dataColumn(*table, "DATA");
-		if(table->nrow() > 0) {
-			const casa::IPosition &shape = dataColumn.shape(0);
-			if(shape.nelements() > 1)
-				_maxFrequencyIndex = shape[1];
-			else
-				_maxFrequencyIndex = 0;
-		} else 
-			_maxFrequencyIndex = 0;
-		delete table;
-	}
-	return _maxFrequencyIndex;
-}
-
-size_t MeasurementSet::BandCount(const std::string &location)
-{
-	casa::MeasurementSet ms(location);
-	casa::Table spwTable = ms.spectralWindow();
-	size_t count = spwTable.nrow();
-	return count;
-}
-
-void MeasurementSet::CalculateScanCounts()
-{
-	if(_maxScanIndex==-1) {
-		casa::Table *table = OpenTable();
-		casa::ROScalarColumn<int> scanColumn(*table, "SCAN_NUMBER");
-		ScalarColumnIterator<int> scanIter = ScalarColumnIterator<int>::First(scanColumn);
-		for(size_t i=0;i<table->nrow();++i,++scanIter) {
-			if((*scanIter) + 1 > _maxScanIndex)
-				_maxScanIndex = (*scanIter) + 1;
-			if((*scanIter) + 1 < _minScanIndex)
-				_minScanIndex = (*scanIter) + 1;
-		}
-		delete table;
-	}
-}
-
-void MeasurementSet::DataMerge(const MeasurementSet &source)
-{
-	casa::Table *sourceTable = source.OpenTable();
-
-	unsigned newRows = sourceTable->nrow();
-	unsigned sourceCols = sourceTable->tableDesc().ncolumn();
-
-	casa::Table *destTable = OpenTable(true);
-	unsigned rowIndex = destTable->nrow();
-
-	AOLogger::Debug << "Adding " << newRows << " new rows...\n";
-	destTable->addRow (newRows, false);
-
-	AOLogger::Debug << "Copying cells " << rowIndex << "-" << (newRows+rowIndex) << " for all columns ...\n";
-
-	for(unsigned i=0;i<sourceCols;++i)
-	{
-		const std::string name = sourceTable->tableDesc().columnNames()[i];
-		if(name != "FLAG_CATEGORY" && name != "WEIGHT_SPECTRUM") {
-			if(i>0)
-				AOLogger::Debug << ",";
-			AOLogger::Debug << name;
-			casa::ROTableColumn sourceColumn = casa::ROTableColumn(*sourceTable, name);
-			casa::TableColumn destColumn = casa::TableColumn(*destTable, name);
-			for(unsigned j=0;j<newRows;++j)
-				destColumn.put(rowIndex+j, sourceColumn, j);
-		}
-	}
-	AOLogger::Debug << '\n';
-
-	delete destTable;
-	delete sourceTable;
-}
-
-size_t MeasurementSet::AntennaCount()
-{
-	casa::MeasurementSet ms(_location);
-	casa::Table antennaTable = ms.antenna();
-	size_t count = antennaTable.nrow();
-	return count;
-}
-
-class AntennaInfo MeasurementSet::GetAntennaInfo(unsigned antennaId)
-{
-	casa::MeasurementSet ms(_location);
-	casa::Table antennaTable = ms.antenna();
-	unsigned count = antennaTable.nrow();
-	if(antennaId >= count) {
-		throw;
-	}
-	casa::ROArrayColumn<double> positionCol(antennaTable, "POSITION"); 
-	casa::ROScalarColumn<casa::String> nameCol(antennaTable, "NAME");
-	casa::ROScalarColumn<double> diameterCol(antennaTable, "DISH_DIAMETER");
-	casa::ROScalarColumn<casa::String> mountCol(antennaTable, "MOUNT");
-	casa::ROScalarColumn<casa::String> stationCol(antennaTable, "STATION");
-
-	ROArrayColumnIterator<double> p = ROArrayColumnIterator<double>::First(positionCol);
-	ScalarColumnIterator<casa::String> n = ScalarColumnIterator<casa::String>::First(nameCol);
-	ScalarColumnIterator<double> d = ScalarColumnIterator<double>::First(diameterCol);
-	ScalarColumnIterator<casa::String> m = ScalarColumnIterator<casa::String>::First(mountCol);
-	ScalarColumnIterator<casa::String> s = ScalarColumnIterator<casa::String>::First(stationCol);
-	unsigned index = 0;
-	while(index != antennaId)
-	{
-		++index; ++p; ++n; ++d; ++m; ++s;
-	}
-	AntennaInfo info;
-	info.diameter = *d;
-	info.id = antennaId;
-	info.name = *n;
-	casa::Array<double> position = *p;
-	casa::Array<double>::iterator i = position.begin();
-	info.position.x = *i;
-	++i;
-	info.position.y = *i;
-	++i;
-	info.position.z = *i;
-	info.mount = *m;
-	info.station = *s;
-
-	return info;
-}
-
-BandInfo MeasurementSet::GetBandInfo(const std::string &filename, unsigned bandIndex)
-{
-	BandInfo band;
-	casa::MeasurementSet ms(filename);
-	casa::Table spectralWindowTable = ms.spectralWindow();
-	casa::ROScalarColumn<int> numChanCol(spectralWindowTable, "NUM_CHAN");
-	casa::ROArrayColumn<double> frequencyCol(spectralWindowTable, "CHAN_FREQ");
-
-	band.windowIndex = bandIndex;
-	size_t channelCount = numChanCol(bandIndex);
-
-	const casa::Array<double> &frequencies = frequencyCol(bandIndex);
-	casa::Array<double>::const_iterator frequencyIterator = frequencies.begin();
-
-	for(unsigned channel=0;channel<channelCount;++channel) {
-		ChannelInfo channelInfo;
-		channelInfo.frequencyIndex = channel;
-		channelInfo.frequencyHz = frequencies(casa::IPosition(1, channel));
-		channelInfo.channelWidthHz = 0.0;
-		channelInfo.effectiveBandWidthHz = 0.0;
-		channelInfo.resolutionHz = 0.0;
-		band.channels.push_back(channelInfo);
-
-		++frequencyIterator;
-	}
-
-	return band;
-}
-
-size_t MeasurementSet::FieldCount()
-{
-	casa::MeasurementSet ms(_location);
-	casa::Table fieldTable = ms.field();
-	size_t fieldCount = fieldTable.nrow();
-	return fieldCount;
-}
-
-class FieldInfo MeasurementSet::GetFieldInfo(unsigned fieldIndex)
-{
-	casa::MeasurementSet ms(_location);
-	casa::Table fieldTable = ms.field();
-	casa::ROArrayColumn<double> delayDirectionCol(fieldTable, "DELAY_DIR");
-	const casa::Array<double> &delayDirection = delayDirectionCol(fieldIndex);
-	casa::Array<double>::const_iterator delayDirectionIterator = delayDirection.begin();
-
-	FieldInfo field;
-	field.delayDirectionRA = *delayDirectionIterator;
-	++delayDirectionIterator;
-	field.delayDirectionDec = *delayDirectionIterator;
-	field.delayDirectionDecNegCos = cosn(-field.delayDirectionDec);
-	field.delayDirectionDecNegSin = sinn(-field.delayDirectionDec);
-
-	return field;
-}
-
-MSIterator::MSIterator(class MeasurementSet &ms, bool hasCorrectedData) : _row(0)
-{
-	_table = ms.OpenTable(false);
-	_antenna1Col = new casa::ROScalarColumn<int>(*_table, "ANTENNA1");
-	_antenna2Col = new casa::ROScalarColumn<int>(*_table, "ANTENNA2");
-	_dataCol = new casa::ROArrayColumn<casa::Complex>(*_table, "DATA");
-	_flagCol = new casa::ROArrayColumn<bool>(*_table, "FLAG");
-	if(hasCorrectedData)
-		_correctedDataCol = new casa::ROArrayColumn<casa::Complex>(*_table, "CORRECTED_DATA");
-	else
-		_correctedDataCol = 0;
-	_fieldCol = new casa::ROScalarColumn<int>(*_table, "FIELD_ID");
-	_timeCol = new casa::ROScalarColumn<double>(*_table, "TIME");
-	_scanNumberCol = new casa::ROScalarColumn<int>(*_table, "SCAN_NUMBER");
-	_uvwCol = new casa::ROArrayColumn<double>(*_table, "UVW");
-	_windowCol = new casa::ROScalarColumn<int>(*_table, "DATA_DESC_ID");
-}
-
-MSIterator::~MSIterator()
-{
-	delete _antenna1Col;
-	delete _antenna2Col;
-	delete _dataCol;
-	if(_correctedDataCol != 0)
-		delete _correctedDataCol;
-	delete _flagCol;
-	delete _timeCol;
-	delete _fieldCol;
-	delete _table;
-	delete _scanNumberCol;
-	delete _uvwCol;
-	delete _windowCol;
-}
-
-void MeasurementSet::InitCacheData()
-{
-	if(!_cacheInitialized)
-	{
-		AOLogger::Debug << "Initializing ms cache data...\n"; 
-		std::set<double>::iterator obsTimePos = _observationTimes.end();
-		MSIterator iterator(*this, false);
-		size_t antenna1=0xFFFFFFFF, antenna2 = 0xFFFFFFFF;
-		double time = nan("");
-		std::set<std::pair<size_t, size_t> > baselineSet;
-		for(size_t row=0;row<iterator.TotalRows();++row)
-		{
-			size_t cur_a1 = iterator.Antenna1();
-			size_t cur_a2 = iterator.Antenna2();
-			double cur_time = iterator.Time();
-			if(cur_a1 != antenna1 || cur_a2 != antenna2)
-			{
-				baselineSet.insert(std::pair<size_t,size_t>(cur_a1, cur_a2));
-				antenna1 = cur_a1;
-				antenna2 = cur_a2;
-			}
-			if(cur_time != time)
-			{
-				obsTimePos = _observationTimes.insert(obsTimePos, cur_time);
-				time = cur_time;
-			}
-			++iterator;
-		}
-		for(std::set<std::pair<size_t, size_t> >::const_iterator i=baselineSet.begin(); i!=baselineSet.end(); ++i)
-			_baselines.push_back(*i);
-	}
-	
-	_cacheInitialized = true;
-}
-
-size_t MeasurementSet::GetPolarizationCount()
-{
-	return GetPolarizationCount(Location());
-}
-
-size_t MeasurementSet::GetPolarizationCount(const std::string &filename)
-{
-	casa::MeasurementSet ms(filename);
-	casa::Table polTable = ms.polarization();
-	casa::ROArrayColumn<int> corTypeColumn(polTable, "CORR_TYPE"); 
-	casa::Array<int> corType = corTypeColumn(0);
-	casa::Array<int>::iterator iterend(corType.end());
-	size_t polarizationCount = 0;
-	for (casa::Array<int>::iterator iter=corType.begin(); iter!=iterend; ++iter)
-	{
-		++polarizationCount;
-	}
-	return polarizationCount;
-}
-
-bool MeasurementSet::HasRFIConsoleHistory()
-{
-	casa::MeasurementSet ms(_location);
-	casa::Table histtab(ms.history());
-	casa::ROScalarColumn<casa::String> application (histtab, "APPLICATION");
-	for(unsigned i=0;i<histtab.nrow();++i)
-	{
-		if(application(i) == "AOFlagger")
-			return true;
-	}
-	return false;
-}
-
-void MeasurementSet::GetAOFlaggerHistory(std::ostream &stream)
-{
-	casa::MeasurementSet ms(_location);
-	casa::Table histtab(ms.history());
-	casa::ROScalarColumn<double>       time        (histtab, "TIME");
-	casa::ROScalarColumn<casa::String> application (histtab, "APPLICATION");
-	casa::ROArrayColumn<casa::String>  cli         (histtab, "CLI_COMMAND");
-	casa::ROArrayColumn<casa::String>  parms       (histtab, "APP_PARAMS");
-	for(unsigned i=0;i<histtab.nrow();++i)
-	{
-		if(application(i) == "AOFlagger")
-		{
-			stream << "====================\n"
-				"Command: " << cli(i)[0] << "\n"
-				"Date: " << Date::AipsMJDToDateString(time(i)) << "\n"
-				"Time: " << Date::AipsMJDToTimeString(time(i)) << "\n"
-				"Strategy: \n     ----------     \n";
-			const casa::Vector<casa::String> appParamsVec = parms(i);
-			for(casa::Vector<casa::String>::const_iterator j=appParamsVec.begin();j!=appParamsVec.end();++j)
-			{
-				stream << *j << '\n';
-			}
-			stream << "     ----------     \n";
-		}
-	}
-}
-
-void MeasurementSet::AddAOFlaggerHistory(const rfiStrategy::Strategy &strategy, const std::string &commandline)
-{
-	// This has been copied from MSWriter.cc of NDPPP and altered (thanks, Ger!)
-	casa::MeasurementSet ms(_location);
-	casa::Table histtab(ms.keywordSet().asTable("HISTORY"));
-	histtab.reopenRW();
-	casa::ScalarColumn<double>       time        (histtab, "TIME");
-	casa::ScalarColumn<int>          obsId       (histtab, "OBSERVATION_ID");
-	casa::ScalarColumn<casa::String> message     (histtab, "MESSAGE");
-	casa::ScalarColumn<casa::String> application (histtab, "APPLICATION");
-	casa::ScalarColumn<casa::String> priority    (histtab, "PRIORITY");
-	casa::ScalarColumn<casa::String> origin      (histtab, "ORIGIN");
-	casa::ArrayColumn<casa::String>  parms       (histtab, "APP_PARAMS");
-	casa::ArrayColumn<casa::String>  cli         (histtab, "CLI_COMMAND");
-	// Put all parset entries in a Vector<String>.
-	// Some WSRT MSs have a FixedShape APP_PARAMS and CLI_COMMAND column.
-	// For them, put the xml file in a single vector element (with newlines).
-	bool fixedShaped =
-		(parms.columnDesc().options() & casa::ColumnDesc::FixedShape) != 0;
-
-	std::ostringstream ostr;
-	rfiStrategy::StrategyWriter writer;
-	writer.WriteToStream(strategy, ostr);
-
-	casa::Vector<casa::String> appParamsVec;
-	casa::Vector<casa::String> clivec;
-	clivec.resize(1);
-	clivec[0] = commandline;
-	if (fixedShaped) {
-		appParamsVec.resize(1);
-		appParamsVec[0] = ostr.str();
-	} else {
-		// Tokenize the string on '\n'
-		const std::string str = ostr.str();
-		size_t lineCount = std::count(str.begin(), str.end(), '\n');
-		appParamsVec.resize(lineCount+1);
-		casa::Array<casa::String>::contiter viter = appParamsVec.cbegin();
-		size_t curStringPos = 0;
-		for(size_t i=0;i<lineCount;++i)
-		{
-			size_t endPos = str.find('\n', curStringPos);
-			*viter = str.substr(curStringPos, endPos-curStringPos);
-			++viter;
-			curStringPos = endPos + 1;
-		}
-		if(curStringPos < str.size())
-		{
-			*viter = str.substr(curStringPos, str.size()-curStringPos);
-		}
-	}
-	uint rownr = histtab.nrow();
-	histtab.addRow();
-	time.put        (rownr, casa::Time().modifiedJulianDay()*24.0*3600.0);
-	obsId.put       (rownr, 0);
-	message.put     (rownr, "parameters");
-	application.put (rownr, "AOFlagger");
-	priority.put    (rownr, "NORMAL");
-	origin.put      (rownr, LOFAR::Version::getInfo<LOFAR::AOFlaggerVersion>("AOFlagger", "full"));
-	parms.put       (rownr, appParamsVec);
-	cli.put         (rownr, clivec);
-}
-
-std::string MeasurementSet::GetStationName() const
-{
-	casa::MeasurementSet ms(_location);
-	casa::Table antennaTable(ms.antenna());
-	if(antennaTable.nrow() == 0)
-		throw std::runtime_error("GetStationName() : no rows in Antenna table");
-	casa::ROScalarColumn<casa::String> stationColumn(antennaTable, "STATION");
-	return stationColumn(0);
-}
-
-bool MeasurementSet::ChannelZeroIsRubish()
-{
-	try
-	{
-		const std::string station = GetStationName();
-		if(station != "LOFAR") return false;
-		// This is of course a hack, but its the best estimate we can make :-/ (easily)
-		const BandInfo bandInfo = GetBandInfo(0);
-		return (bandInfo.channels.size() == 256 || bandInfo.channels.size()==64);
-	} catch(std::exception &e)
-	{
-		return false;
-	}
-}
diff --git a/CEP/DP3/AOFlagger/src/msio/memorybaselinereader.cpp b/CEP/DP3/AOFlagger/src/msio/memorybaselinereader.cpp
deleted file mode 100644
index dfb02f44645f71ee4308ae1de5a77aafd763a9b5..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/msio/memorybaselinereader.cpp
+++ /dev/null
@@ -1,347 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#include <AOFlagger/msio/memorybaselinereader.h>
-#include <AOFlagger/msio/system.h>
-#include <AOFlagger/util/aologger.h>
-#include <AOFlagger/util/stopwatch.h>
-
-#include <ms/MeasurementSets/MeasurementSet.h>
-
-using namespace casa;
-
-void MemoryBaselineReader::PerformReadRequests()
-{
-	readSet();
-	
-	for(size_t i=0;i!=_readRequests.size();++i)
-	{
-		const ReadRequest &request = _readRequests[i];
-		BaselineID id;
-		id.antenna1 = request.antenna1;
-		id.antenna2 = request.antenna2;
-		id.spw = request.spectralWindow;
-		_results.push_back(_baselines.find(id)->second);
-	}
-	
-	_readRequests.clear();
-}
-
-void MemoryBaselineReader::readSet()
-{
-	if(!_isRead)
-	{
-		Stopwatch watch(true);
-		
-		initialize();
-	
-		casa::Table &table = *Table();
-		
-		ROScalarColumn<int>
-			ant1Column(table, casa::MeasurementSet::columnName(MSMainEnums::ANTENNA1)),
-			ant2Column(table, casa::MeasurementSet::columnName(MSMainEnums::ANTENNA2)),
-			spwColumn(table, casa::MeasurementSet::columnName(MSMainEnums::DATA_DESC_ID));
-		ROScalarColumn<double>
-			timeColumn(table, casa::MeasurementSet::columnName(MSMainEnums::TIME));
-		ROArrayColumn<casa::Complex>
-			dataColumn(table, DataColumnName());
-		ROArrayColumn<bool>
-			flagColumn(table, casa::MeasurementSet::columnName(MSMainEnums::FLAG));
-		ROArrayColumn<double>
-			uvwColumn(table, casa::MeasurementSet::columnName(MSMainEnums::UVW));
-		const std::map<double, size_t>
-			&observationTimes = AllObservationTimes();
-		
-		size_t
-			antennaCount = Set().AntennaCount(),
-			frequencyCount = FrequencyCount(),
-			polarizationCount = PolarizationCount(),
-			timeStepCount = observationTimes.size();
-			
-		if(Set().BandCount() != 1)
-			throw std::runtime_error("Can not handle measurement sets with more than 1 band.");
-		
-		// Initialize the look-up matrix
-		// to quickly access the elements (without the map-lookup)
-		typedef Result* MatrixElement;
-		typedef std::vector<MatrixElement> MatrixRow;
-		typedef std::vector<MatrixRow> Matrix;
-		Matrix matrix(antennaCount);
-		
-		AOLogger::Debug << "Claiming memory for memory baseline reader...\n";
-		
-		BandInfo band = Set().GetBandInfo(0);
-		for(size_t a1=0;a1!=antennaCount;++a1)
-		{
-			matrix[a1].resize(antennaCount);
-			for(size_t a2=0;a2!=antennaCount;++a2)
-				matrix[a1][a2] = 0;
-		}
-		
-		// The actual reading of the data
-		AOLogger::Debug << "Reading the data...\n";
-		
-		IPosition dataShape = IPosition(2);
-		dataShape[0] = polarizationCount;
-		dataShape[1] = frequencyCount;
-		
-		double prevTime = -1.0;
-		unsigned rowCount = table.nrow();
-		size_t timeIndex = 0, prevTimeIndex = (size_t) (-1);
-		casa::Array<casa::Complex> dataArray(dataShape);
-		casa::Array<bool> flagArray(dataShape);
-		for(unsigned rowIndex = 0;rowIndex < rowCount;++rowIndex)
-		{
-			double time = timeColumn(rowIndex);
-			if(time != prevTime)
-			{
-				timeIndex = observationTimes.find(time)->second;
-				if(timeIndex != prevTimeIndex+1)
-				{
-					// sanity check failed -- never seen this happen in a ms, but just for sure.
-					std::stringstream s;
-					s << "Error: time step " << prevTimeIndex << " is followed by time step " << timeIndex;
-					throw std::runtime_error(s.str());
-				}
-				prevTime = time;
-				prevTimeIndex = timeIndex;
-			}
-			
-			size_t ant1 = ant1Column(rowIndex);
-			size_t ant2 = ant2Column(rowIndex);
-			if(ant1 > ant2) std::swap(ant1, ant2);
-			
-			Result *result = matrix[ant1][ant2];
-			if(result == 0)
-			{
-				result = new Result();
-				for(size_t p=0;p!=polarizationCount;++p) {
-					result->_realImages.push_back(Image2D::CreateZeroImagePtr(timeStepCount, frequencyCount));
-					result->_imaginaryImages.push_back(Image2D::CreateZeroImagePtr(timeStepCount, frequencyCount));
-					result->_flags.push_back(Mask2D::CreateSetMaskPtr<true>(timeStepCount, frequencyCount));
-				}
-				result->_bandInfo = band;
-				result->_uvw.resize(timeStepCount);
-				matrix[ant1][ant2] = result;
-			}
-			
-			dataColumn.get(rowIndex, dataArray);
-			flagColumn.get(rowIndex, flagArray);
-			
-			Array<double> uvwArray = uvwColumn.get(rowIndex);
-			Array<double>::const_iterator uvwPtr = uvwArray.begin();
-			UVW uvw;
-			uvw.u = *uvwPtr; ++uvwPtr;
-			uvw.v = *uvwPtr; ++uvwPtr;
-			uvw.w = *uvwPtr;
-			result->_uvw[timeIndex] = uvw;
-			
-			for(size_t p=0;p!=polarizationCount;++p)
-			{
-				Array<Complex>::const_iterator dataPtr = dataArray.begin();
-				Array<bool>::const_iterator flagPtr = flagArray.begin();
-			
-				Image2D *real = &*result->_realImages[p];
-				Image2D *imag = &*result->_imaginaryImages[p];
-				Mask2D *mask = &*result->_flags[p];
-				const size_t imgStride = real->Stride();
-				const size_t mskStride = mask->Stride();
-				num_t *realOutPtr = real->ValuePtr(timeIndex, 0);
-				num_t *imagOutPtr = imag->ValuePtr(timeIndex, 0);
-				bool *flagOutPtr = mask->ValuePtr(timeIndex, 0);
-				
-				for(size_t i=0;i!=p;++i) {
-					++dataPtr;
-					++flagPtr;
-				}
-					
-				for(size_t ch=0;ch!=frequencyCount;++ch)
-				{
-					*realOutPtr = dataPtr->real();
-					*imagOutPtr = dataPtr->imag();
-					*flagOutPtr = *flagPtr;
-					
-					realOutPtr += imgStride;
-					imagOutPtr += imgStride;
-					flagOutPtr += mskStride;
-					
-					for(size_t i=0;i!=polarizationCount;++i) {
-						++dataPtr;
-						++flagPtr;
-					}
-				}
-			}
-		}
-		
-		// Store elements in matrix to the baseline map.
-		for(size_t a1=0;a1!=antennaCount;++a1)
-		{
-			for(size_t a2=a1;a2!=antennaCount;++a2)
-			{
-				if(matrix[a1][a2] != 0)
-				{
-					BaselineID id;
-					id.antenna1 = a1;
-					id.antenna2 = a2;
-					id.spw = 0;
-					_baselines.insert(std::pair<BaselineID, Result>(id, *matrix[a1][a2]));
-					delete matrix[a1][a2];
-				}
-			}
-		}
-		_areFlagsChanged = false;
-		_isRead = true;
-		
-		AOLogger::Debug << "Reading toke " << watch.ToString() << ".\n";
-	}
-}
-
-void MemoryBaselineReader::PerformFlagWriteRequests()
-{
-	readSet();
-	
-	for(size_t i=0;i!=_writeRequests.size();++i)
-	{
-		const WriteRequest &request = _writeRequests[i];
-		BaselineID id;
-		id.antenna1 = request.antenna1;
-		id.antenna2 = request.antenna2;
-		id.spw = request.spectralWindow;
-		Result &result = _baselines[id];
-		if(result._flags.size() != request.flags.size())
-			throw std::runtime_error("Polarizations do not match");
-		for(size_t p=0;p!=result._flags.size();++p)
-			result._flags[p] = Mask2D::CreateCopy(request.flags[p]);
-	}
-	_areFlagsChanged = true;
-	
-	_writeRequests.clear();
-}
-
-void MemoryBaselineReader::writeFlags()
-{
-	casa::Table &table = *Table();
-	
-	ROScalarColumn<int>
-		ant1Column(table, casa::MeasurementSet::columnName(MSMainEnums::ANTENNA1)),
-		ant2Column(table, casa::MeasurementSet::columnName(MSMainEnums::ANTENNA2)),
-		spwColumn(table, casa::MeasurementSet::columnName(MSMainEnums::DATA_DESC_ID));
-	ROScalarColumn<double>
-		timeColumn(table, casa::MeasurementSet::columnName(MSMainEnums::TIME));
-	ArrayColumn<bool>
-		flagColumn(table, casa::MeasurementSet::columnName(MSMainEnums::FLAG));
-	const std::map<double, size_t>
-		&observationTimes = AllObservationTimes();
-	
-	size_t
-		frequencyCount = FrequencyCount(),
-		polarizationCount = PolarizationCount();
-		
-	AOLogger::Debug << "Flags have changed, writing them back to the set...\n";
-	
-	IPosition flagShape = IPosition(2);
-	flagShape[0] = polarizationCount;
-	flagShape[1] = frequencyCount;
-	
-	double prevTime = -1.0;
-	unsigned rowCount = table.nrow();
-	size_t timeIndex = 0;
-	casa::Array<bool> flagArray(flagShape);
-	for(unsigned rowIndex = 0;rowIndex < rowCount;++rowIndex)
-	{
-		double time = timeColumn(rowIndex);
-		if(time != prevTime)
-		{
-			timeIndex = observationTimes.find(time)->second;
-			prevTime = time;
-		}
-		
-		size_t ant1 = ant1Column(rowIndex);
-		size_t ant2 = ant2Column(rowIndex);
-		size_t spw = spwColumn(rowIndex);
-		if(ant1 > ant2) std::swap(ant1, ant2);
-		
-		BaselineID baselineID;
-		baselineID.antenna1 = ant1;
-		baselineID.antenna2 = ant2;
-		baselineID.spw = spw;
-		Result *result = &_baselines.find(baselineID)->second;
-		
-		Array<bool>::iterator flagPtr = flagArray.begin();
-		
-		Mask2D *masks[polarizationCount];
-		for(size_t p=0;p!=polarizationCount;++p)
-			masks[p] = &*result->_flags[p];
-		
-		for(size_t ch=0;ch!=frequencyCount;++ch)
-		{
-			for(size_t p=0;p!=polarizationCount;++p)
-			{
-				*flagPtr = masks[p]->Value(timeIndex, ch);
-				++flagPtr;
-			}
-		}
-		
-		flagColumn.put(rowIndex, flagArray);
-	}
-	
-	_areFlagsChanged = false;
-}
-
-bool MemoryBaselineReader::IsEnoughMemoryAvailable(const std::string &filename)
-{
-	casa::MeasurementSet ms(filename);
-	
-	MSSpectralWindow spwTable = ms.spectralWindow();
-	if(spwTable.nrow() != 1) throw std::runtime_error("Set should have exactly one spectral window");
-	
-	ROScalarColumn<int> numChanCol(spwTable, MSSpectralWindow::columnName(MSSpectralWindowEnums::NUM_CHAN));
-	size_t channelCount = numChanCol.get(0);
-	if(channelCount == 0) throw std::runtime_error("No channels in set");
-	if(ms.nrow() == 0) throw std::runtime_error("Table has no rows (no data)");
-	
-	typedef float num_t;
-	typedef std::complex<num_t> complex_t;
-	ROScalarColumn<int> ant1Column(ms, ms.columnName(MSMainEnums::ANTENNA1));
-	ROScalarColumn<int> ant2Column(ms, ms.columnName(MSMainEnums::ANTENNA2));
-	ROArrayColumn<complex_t> dataColumn(ms, ms.columnName(MSMainEnums::DATA));
-	
-	IPosition dataShape = dataColumn.shape(0);
-	unsigned polarizationCount = dataShape[0];
-	
-	uint64_t size =
-		(uint64_t) polarizationCount * (uint64_t) channelCount *
-		(uint64_t) ms.nrow() * (uint64_t) (sizeof(num_t) * 2 + sizeof(bool));
-		
-	uint64_t totalMem = System::TotalMemory();
-	
-	if(size * 2 >= totalMem)
-	{
-		AOLogger::Warn
-			<< (size/1000000) << " MB required, but " << (totalMem/1000000) << " MB available.\n"
-			"Because this is not at least twice as much, direct read mode (slower!) will be used.\n";
-		return false;
-	} else {
-		AOLogger::Debug
-			<< (size/1000000) << " MB required, " << (totalMem/1000000)
-			<< " MB available: will use memory read mode.\n";
-		return true;
-	}
-}
diff --git a/CEP/DP3/AOFlagger/src/msio/pngfile.cpp b/CEP/DP3/AOFlagger/src/msio/pngfile.cpp
deleted file mode 100644
index ab50e5803602533a5f5577c8c06b2564c1a9147f..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/msio/pngfile.cpp
+++ /dev/null
@@ -1,167 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2007 by Andre Offringa   *
- *   offringa@gmail.com   *
- *                                                                         *
- *   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.             *
- ***************************************************************************/
-#include <AOFlagger/msio/pngfile.h>
-#include <AOFlagger/msio/colormap.h>
-#include <AOFlagger/msio/image2d.h>
-
-PngFile::PngFile(const std::string &filename, unsigned width, unsigned height) : _filename(filename), _width(width), _height(height), _pixelSize(4)
-{
-}
-
-PngFile::~PngFile()
-{
-}
-
-void PngFile::BeginWrite() throw(IOException)
-{
-	_fp = fopen(_filename.c_str(), "wb");
-	if(!_fp)
-		throw IOException("Can not open file");
-	
-	_png_ptr =
-		png_create_write_struct(PNG_LIBPNG_VER_STRING, (png_voidp) NULL, NULL, NULL);
-	
-	if(!_png_ptr) {
-		fclose(_fp);
-		throw IOException("Can not create png write structure");
-	}
-	
-	_info_ptr = png_create_info_struct(_png_ptr);
-	if(!_info_ptr) {
-		png_destroy_write_struct(&_png_ptr, (png_infopp) NULL);
-		fclose(_fp);
-		throw IOException("Can not write info structure to file");
-	}
-	
-	if (setjmp(png_jmpbuf(_png_ptr)))
-	{
-		png_destroy_write_struct(&_png_ptr, &_info_ptr);
-		fclose(_fp);
-		throw IOException("Unknown error occured during writing of png file");
-	}
-	
-	png_init_io(_png_ptr, _fp);
-	
-	png_set_IHDR(_png_ptr, _info_ptr, _width, _height, 8, PNG_COLOR_TYPE_RGB_ALPHA, PNG_INTERLACE_NONE,
-		PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT);
-	
-	_row_pointers = (png_bytep*) png_malloc(_png_ptr, _height*sizeof(png_bytep));
-	
-	for(unsigned i=0; i<_height;i++)
-		_row_pointers[i]=(png_bytep) png_malloc(_png_ptr, _width*_pixelSize);
-}
-
-void PngFile::Close() {
-	png_set_rows(_png_ptr, _info_ptr, _row_pointers);
-	png_write_png(_png_ptr, _info_ptr, PNG_TRANSFORM_IDENTITY, NULL);
-	png_write_end(_png_ptr, _info_ptr);
-	
-	for(unsigned i=0; i<_height;i++)
-		png_free(_png_ptr, _row_pointers[i]);
-	png_free(_png_ptr, _row_pointers);
-	
-	png_destroy_write_struct(&_png_ptr, &_info_ptr);
-	fclose(_fp);
-}
-
-void PngFile::Clear(int colorR, int colorG, int colorB, int colorA) throw()
-{
-	for(unsigned y=0;y<_height;y++) {
-		int xa = 0;
-		for(unsigned x=0;x<_width;x++) {
-			_row_pointers[y][xa++] = colorR;
-			_row_pointers[y][xa++] = colorG;
-			_row_pointers[y][xa++] = colorB;
-			_row_pointers[y][xa++] = colorA;
-		}
-	}
-}
-
-void PngFile::PlotDatapoint(unsigned x, unsigned y, int colorR, int colorG, int colorB, int colorA) throw()
-{
-	int width = 3;
-	for(int xi=(signed) x-width/2;xi<=(signed) x+(width-1)/2;xi++) {
-		if(xi >= 0 && xi < (signed) _width) {
-			_row_pointers[y][xi*_pixelSize] = colorR;
-			_row_pointers[y][xi*_pixelSize+1] = colorG;
-			_row_pointers[y][xi*_pixelSize+2] = colorB;
-			_row_pointers[y][xi*_pixelSize+3] = colorA;
-		}
-	}
-	for(int yi=(signed) y-width/2;yi<=(signed) y+(width-1)/2;yi++) {
-		if(yi >= 0 && yi < (signed) _height) {
-			_row_pointers[yi][x*_pixelSize] = colorR;
-			_row_pointers[yi][x*_pixelSize+1] = colorG;
-			_row_pointers[yi][x*_pixelSize+2] = colorB;
-			_row_pointers[yi][x*_pixelSize+3] = colorA;
-		}
-	}
-}
-
-void PngFile::SetFromImage(const class Image2D &image, const class ColorMap &colorMap, long double normalizeFactor, long double zeroLevel) throw(IOException)
-{
-	png_bytep *row_pointers = RowPointers();
-	for(unsigned long y=0;y<image.Height();y++) {
-		for(unsigned long x=0;x<image.Width();x++) {
-			int xa = x * PixelSize();
-			row_pointers[y][xa]=colorMap.ValueToColorR((image.Value(x, y) - zeroLevel) * normalizeFactor);
-			row_pointers[y][xa+1]=colorMap.ValueToColorG((image.Value(x, y) - zeroLevel) * normalizeFactor);
-			row_pointers[y][xa+2]=colorMap.ValueToColorB((image.Value(x, y) - zeroLevel) * normalizeFactor);
-			row_pointers[y][xa+3]=colorMap.ValueToColorA((image.Value(x, y) - zeroLevel) * normalizeFactor);
-		}
-	}
-}
-
-void PngFile::Save(const Image2D &image, const std::string &filename) throw(IOException)
-{
-	ColorMap *colorMap = ColorMap::CreateColorMap("monochrome");
-	Save(image, filename, *colorMap);
-	delete colorMap;
-}
-
-void PngFile::Save(const Image2D &image, const std::string &filename, const ColorMap &colorMap) throw(IOException)
-{
-	Save(image, filename, colorMap, image.GetMaxMinNormalizationFactor());
-}
-
-void PngFile::Save(const Image2D &image, const std::string &filename, const ColorMap &colorMap, long double normalizeFactor, long double zeroLevel) throw(IOException)
-{
-	PngFile pngFile(filename, image.Width(), image.Height());
-	pngFile.BeginWrite();
-	pngFile.SetFromImage(image, colorMap, normalizeFactor, zeroLevel);
-	pngFile.Close();
-}
-
-void PngFile::Save(const Image2D &image, const ColorMap &colorMap) throw(IOException)
-{
-	long double normalizeFactor = image.GetMaxMinNormalizationFactor();
-	
-	png_bytep *row_pointers = RowPointers();
-	
-	for(unsigned long y=0;y<image.Height();++y) {
-		for(unsigned long x=0;x<image.Width();++x) {
-			int xa = x * PixelSize();
-			row_pointers[y][xa]=colorMap.ValueToColorR(image.Value(x, y) * normalizeFactor);
-			row_pointers[y][xa+1]=colorMap.ValueToColorG(image.Value(x, y) * normalizeFactor);
-			row_pointers[y][xa+2]=colorMap.ValueToColorB(image.Value(x, y) * normalizeFactor);
-			row_pointers[y][xa+3]=colorMap.ValueToColorA(image.Value(x, y) * normalizeFactor);
-		}
-	}
-}
diff --git a/CEP/DP3/AOFlagger/src/msio/rspreader.cpp b/CEP/DP3/AOFlagger/src/msio/rspreader.cpp
deleted file mode 100644
index e3a138465680fc22e6c92d7918c41dd4b0f2529f..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/msio/rspreader.cpp
+++ /dev/null
@@ -1,359 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#include <stdexcept>
-#include <set>
-#include <sstream>
-
-#include <AOFlagger/msio/rspreader.h>
-#include <AOFlagger/msio/image2d.h>
-#include <AOFlagger/msio/mask2d.h>
-#include <AOFlagger/msio/samplerow.h>
-
-#include <AOFlagger/util/aologger.h>
-#include <AOFlagger/util/ffttools.h>
-
-const unsigned char RSPReader::BitReverseTable256[256] = 
-{
-#   define R2(n)     n,     n + 2*64,     n + 1*64,     n + 3*64
-#   define R4(n) R2(n), R2(n + 2*16), R2(n + 1*16), R2(n + 3*16)
-#   define R6(n) R4(n), R4(n + 2*4 ), R4(n + 1*4 ), R4(n + 3*4 )
-		R6(0), R6(2), R6(1), R6(3)
-};
-
-const unsigned long RSPReader::STATION_INTEGRATION_STEPS = 1024;
-
-const unsigned int RSPReader::RCPBeamletData::SIZE = 8;
-
-const unsigned int RSPReader::RCPApplicationHeader::SIZE = 16;
-
-std::pair<TimeFrequencyData,TimeFrequencyMetaDataPtr> RSPReader::ReadChannelBeamlet(unsigned long timestepStart, unsigned long timestepEnd, unsigned beamletCount, unsigned beamletIndex)
-{
-	const unsigned width = timestepEnd - timestepStart;
-	
-	std::pair<TimeFrequencyData,TimeFrequencyMetaDataPtr> data = ReadSingleBeamlet(timestepStart*(unsigned long) 256, timestepEnd*(unsigned long) 256, beamletCount, beamletIndex);
-
-	TimeFrequencyData *allX = data.first.CreateTFData(XXPolarisation);
-	TimeFrequencyData *allY = data.first.CreateTFData(YYPolarisation);
-	Image2DCPtr xr = allX->GetRealPart();
-	Image2DCPtr xi = allX->GetImaginaryPart();
-	Image2DCPtr yr = allY->GetRealPart();
-	Image2DCPtr yi = allY->GetImaginaryPart();
-	delete allX;
-	delete allY;
-	Mask2DCPtr mask = data.first.GetSingleMask();
-	
-	Image2DPtr
-		outXR = Image2D::CreateUnsetImagePtr(width, 256),
-		outXI = Image2D::CreateUnsetImagePtr(width, 256),
-		outYR = Image2D::CreateUnsetImagePtr(width, 256),
-		outYI = Image2D::CreateUnsetImagePtr(width, 256);
-	Mask2DPtr
-		outMask = Mask2D::CreateUnsetMaskPtr(width, 256);
-	
-	std::vector<double> observationTimes;
-	for(unsigned long timestep = 0;timestep < timestepEnd-timestepStart;++timestep)
-	{
-		unsigned long timestepIndex = timestep * 256;
-		SampleRowPtr realX = SampleRow::CreateFromRow(xr, timestepIndex, 256, 0);
-		SampleRowPtr imaginaryX = SampleRow::CreateFromRow(xi, timestepIndex, 256, 0);
-		SampleRowPtr realY = SampleRow::CreateFromRow(yr, timestepIndex, 256, 0);
-		SampleRowPtr imaginaryY = SampleRow::CreateFromRow(yi, timestepIndex, 256, 0);
-		
-		FFTTools::FFT(realX, imaginaryX);
-		FFTTools::FFT(realY, imaginaryY);
-		
-		realX->SetVerticalImageValues(outXR, timestep);
-		imaginaryX->SetVerticalImageValues(outXI, timestep);
-		realY->SetVerticalImageValues(outYR, timestep);
-		imaginaryY->SetVerticalImageValues(outYI, timestep);
-		
-		observationTimes.push_back(data.second->ObservationTimes()[timestepIndex + 256/2]);
-
-		size_t validValues = 0;
-		for(unsigned y=0;y<256;++y)
-		{
-			if(!mask->Value(timestepIndex + y, 0))
-				++validValues;
-		}
-		for(unsigned y=0;y<256;++y)
-		{
-			outMask->SetValue(timestep, y , validValues == 0);
-		}
-	}
-	
-	data.first = TimeFrequencyData(AutoDipolePolarisation, outXR, outXI, outYR, outYI);
-	data.first.SetGlobalMask(outMask);
-	BandInfo band = data.second->Band();
-	band.channels.clear();
-	for(unsigned i=0;i<256;++i)
-	{
-		ChannelInfo channel;
-		channel.frequencyHz = i+1;
-		channel.frequencyIndex = i;
-		band.channels.push_back(channel);
-	}
-	data.second->SetBand(band);
-	data.second->SetObservationTimes(observationTimes);
-	return data;
-}
-
-std::pair<TimeFrequencyData,TimeFrequencyMetaDataPtr> RSPReader::ReadSingleBeamlet(unsigned long timestepStart, unsigned long timestepEnd, unsigned beamletCount, unsigned beamletIndex)
-{
-	std::pair<TimeFrequencyData,TimeFrequencyMetaDataPtr> data = ReadAllBeamlets(timestepStart, timestepEnd, beamletCount);
-	
-	const unsigned width = timestepEnd - timestepStart;
-	Image2DPtr realX = Image2D::CreateZeroImagePtr(width, 1);
-	Image2DPtr imaginaryX = Image2D::CreateZeroImagePtr(width, 1);
-	Image2DPtr realY = Image2D::CreateZeroImagePtr(width, 1);
-	Image2DPtr imaginaryY = Image2D::CreateZeroImagePtr(width, 1);
-	Mask2DPtr mask = Mask2D::CreateUnsetMaskPtr(width, 1);
-	
-	TimeFrequencyData *allX = data.first.CreateTFData(XXPolarisation);
-	TimeFrequencyData *allY = data.first.CreateTFData(YYPolarisation);
-	Image2DCPtr xr = allX->GetRealPart();
-	Image2DCPtr xi = allX->GetImaginaryPart();
-	Image2DCPtr yr = allY->GetRealPart();
-	Image2DCPtr yi = allY->GetImaginaryPart();
-	delete allX;
-	delete allY;
-	Mask2DCPtr maskWithBeamlets = data.first.GetSingleMask();
-	
-	for(unsigned x=0;x<width;++x)
-	{
-		realX->SetValue(x, 0, xr->Value(x, beamletIndex));
-		imaginaryX->SetValue(x, 0, xi->Value(x, beamletIndex));
-		realY->SetValue(x, 0, yr->Value(x, beamletIndex));
-		imaginaryY->SetValue(x, 0, yi->Value(x, beamletIndex));
-		mask->SetValue(x, 0, maskWithBeamlets->Value(x, beamletIndex));
-	}
-	data.first = TimeFrequencyData(AutoDipolePolarisation, realX, imaginaryX, realY, imaginaryY);
-	data.first.SetGlobalMask(mask);
-	BandInfo band = data.second->Band();
-	band.channels[0] = data.second->Band().channels[beamletIndex];
-	band.channels.resize(1);
-	data.second->SetBand(band);
-	return data;
-}
-
-unsigned long RSPReader::TimeStepCount(size_t beamletCount) const
-{
-	std::ifstream stream(_rawFile.c_str(), std::ios_base::binary | std::ios_base::in);
-	stream.seekg(0, std::ios_base::end);
-	unsigned long fileSize = stream.tellg();
-	
-	stream.seekg(0, std::ios_base::beg);
-	RCPApplicationHeader firstHeader;
-	firstHeader.Read(stream);
-	const unsigned long bytesPerFrame = beamletCount * firstHeader.nofBlocks * RCPBeamletData::SIZE + RCPApplicationHeader::SIZE;
-	const unsigned long frames = fileSize / bytesPerFrame;
-	
-	AOLogger::Debug << "File has " << frames << " number of frames (" << ((double) (frames*firstHeader.nofBlocks*STATION_INTEGRATION_STEPS)/_clockSpeed) << "s of data)\n";
-	
-	return frames * firstHeader.nofBlocks;
-}
-
-std::pair<TimeFrequencyData,TimeFrequencyMetaDataPtr> RSPReader::ReadAllBeamlets(unsigned long timestepStart, unsigned long timestepEnd, unsigned beamletCount)
-{
-	const unsigned width = timestepEnd - timestepStart;
-	Image2DPtr realX = Image2D::CreateZeroImagePtr(width, beamletCount);
-	Image2DPtr imaginaryX = Image2D::CreateZeroImagePtr(width, beamletCount);
-	Image2DPtr realY = Image2D::CreateZeroImagePtr(width, beamletCount);
-	Image2DPtr imaginaryY = Image2D::CreateZeroImagePtr(width, beamletCount);
-	Mask2DPtr mask = Mask2D::CreateSetMaskPtr<true>(width, beamletCount);
-	
-	std::ifstream file(_rawFile.c_str(), std::ios_base::binary | std::ios_base::in);
-	size_t frame = 0;
-	std::set<short> stations;
-	std::set<unsigned int> timestamps;
-	
-	TimeFrequencyMetaDataPtr metaData = TimeFrequencyMetaDataPtr(new TimeFrequencyMetaData());
-	BandInfo band;
-	for(size_t i=0;i<beamletCount;++i)
-	{
-		ChannelInfo channel;
-		channel.frequencyHz = i+1;
-		channel.frequencyIndex = i;
-		band.channels.push_back(channel);
-	}
-	metaData->SetBand(band);
-	
-	std::vector<double> observationTimes;
-	
-	// Read a header and determine the reading start position
-	// Because timestepStart might fall within a block, the 
-	RCPApplicationHeader firstHeader;
-	firstHeader.Read(file);
-	const unsigned long bytesPerFrame = beamletCount * firstHeader.nofBlocks * RCPBeamletData::SIZE + RCPApplicationHeader::SIZE;
-	const unsigned long startFrame = timestepStart / (unsigned long) firstHeader.nofBlocks;
-	const unsigned long startByte = startFrame * bytesPerFrame;
-	const unsigned long offsetFromStart = timestepStart - (startFrame * firstHeader.nofBlocks);
-	//AOLogger::Debug << "Seeking to " << startByte << " (timestepStart=" << timestepStart << ", offsetFromStart=" << offsetFromStart << ", startFrame=" << startFrame << ",bytesPerFrame=" << bytesPerFrame << ")\n";
-	file.seekg(startByte, std::ios_base::beg);
-	
-	// Read the frames
-	unsigned long x=0;
-	while(x < width + offsetFromStart && file.good()) {
-		RCPApplicationHeader header;
-		header.Read(file);
-		if(header.versionId != 2)
-		{
-			std::stringstream s;
-			s << "Corrupted header found in frame " << frame << "!";
-			throw std::runtime_error(s.str());
-		}
-		if(stations.count(header.stationId)==0)
-		{
-			stations.insert(header.stationId);
-			AntennaInfo antenna;
-			std::stringstream s;
-			s << "LOFAR station with index " << header.stationId;
-			antenna.name = s.str();
-			metaData->SetAntenna1(antenna);
-			metaData->SetAntenna2(antenna);
-		}
-		for(size_t j=0;j<beamletCount;++j)
-		{
-			for(size_t i=0;i<header.nofBlocks;++i)
-			{
-				RCPBeamletData data;
-				data.Read(file);
-				if(i + x < width + offsetFromStart && i + x >= offsetFromStart)
-				{
-					const unsigned long pos = i + x - offsetFromStart;
-					realX->SetValue(pos, j, data.xr);
-					imaginaryX->SetValue(pos, j, data.xi);
-					realY->SetValue(pos, j, data.yr);
-					imaginaryY->SetValue(pos, j, data.yi);
-					mask->SetValue(pos, j, false);
-				}
-			}
-		}
-		x += header.nofBlocks;
-		++frame;
-	}
-	//AOLogger::Debug << "Read " << frame << " frames.\n";
-	
-	for(unsigned long i=0;i<width;++i)
-	{
-		const unsigned long pos = i + timestepStart;
-		const double time =
-			(double) pos * (double) STATION_INTEGRATION_STEPS / (double) _clockSpeed;
-		observationTimes.push_back(time);
-	}
-	
-	metaData->SetObservationTimes(observationTimes);
-	
-	std::pair<TimeFrequencyData,TimeFrequencyMetaDataPtr> data;
-	data.first = TimeFrequencyData(AutoDipolePolarisation, realX, imaginaryX, realY, imaginaryY);
-	data.first.SetGlobalMask(mask);
-	data.second = metaData;
-	return data;
-}
-
-void RSPReader::ReadForStatistics(unsigned beamletCount)
-{
-	long unsigned timesteps = TimeStepCount(beamletCount);
-	long unsigned stepSize = 1024;
-        std::vector<BeamletStatistics>
-          statistics(beamletCount),
-          timeStartStatistics(beamletCount);
-
-	std::ofstream *statFile[beamletCount];
-	for(unsigned i=0;i<beamletCount;++i)
-	{
-		std::ostringstream str;
-		str << "rsp-statistics" << i << ".txt";
-		statFile[i] = new std::ofstream(str.str().c_str());
-	}
-
-	double startTime = -1.0, periodStartTime = -1.0;
-	
-	for(unsigned long timestepIndex=0;timestepIndex<timesteps;timestepIndex += stepSize)
-	{
-		//Read the data
-		unsigned long end = timestepIndex+stepSize;
-		if(end > timesteps) end = timesteps;
-		std::pair<TimeFrequencyData,TimeFrequencyMetaDataPtr> dataPair = ReadAllBeamlets(timestepIndex, end, beamletCount);
-		const TimeFrequencyData &data = dataPair.first;
-		if(startTime == -1.0) {
-			startTime = dataPair.second->ObservationTimes()[0];
-			periodStartTime = startTime;
-		}
-
-		//Count the statistics
-		for(unsigned imageIndex=0;imageIndex < data.ImageCount();++imageIndex)
-		{
-			Image2DCPtr image = data.GetImage(imageIndex);
-			for(unsigned y=0;y<image->Height();++y) {
-				for(unsigned x=0;x<image->Width();++x) {
-					int value = (int) image->Value(x, y);
-					if(value < 0) {
-						value = -value;
-						++(statistics[y].bitUseCount[15]);
-					}
-					unsigned highestBit = (value!=0) ? 1 : 0;
-					for(unsigned bit=0;bit<15;++bit) {
-						if((value & (2<<bit)) != 0) {
-							highestBit = bit+1;
-						}
-					}
-					for(unsigned bit=0;bit<highestBit;++bit)
-						++(statistics[y].bitUseCount[bit]);
-					++(statistics[y].totalCount);
-				}
-			}
-		}
-		if((timestepIndex/stepSize)%100000==0 || timestepIndex+stepSize>=timesteps)
-		{
-			for(unsigned i=0;i<beamletCount;++i)
-			{
-				AOLogger::Info << "Beamlet index " << i << ":\n";
-				statistics[i].Print();
-			}
-		}
-		if((dataPair.second->ObservationTimes()[0] - periodStartTime) > 60.0)
-		{
-			AOLogger::Debug << "Processed 1 minute of data (" << (dataPair.second->ObservationTimes()[0] - startTime) << "s)\n";
-			for(unsigned i=0;i<beamletCount;++i)
-			{
-				(*statFile[i])
-					<< (periodStartTime - startTime) << '\t'
-					<< (statistics[i].totalCount - timeStartStatistics[i].totalCount);
-				statistics[i].totalCount = timeStartStatistics[i].totalCount;
-				for(unsigned bit=0;bit<15;++bit)
-				{
-					(*statFile[i]) << '\t' << (statistics[i].bitUseCount[bit] - timeStartStatistics[i].bitUseCount[bit]);
-					timeStartStatistics[i].bitUseCount[bit] = statistics[i].bitUseCount[bit];
-				}
-				(*statFile[i]) << '\n';
-			}
-
-			periodStartTime = dataPair.second->ObservationTimes()[0];
-		}
-	}
-	
-	for(unsigned i=0;i<beamletCount;++i)
-	{
-		AOLogger::Info << "Beamlet index " << i << ":\n";
-		statistics[i].Print();
-		delete statFile[i];
-	}
-}
diff --git a/CEP/DP3/AOFlagger/src/msio/samplerow.cpp b/CEP/DP3/AOFlagger/src/msio/samplerow.cpp
deleted file mode 100644
index 04fd9ad13cf85d4111b15806cbee6adf1b07b665..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/msio/samplerow.cpp
+++ /dev/null
@@ -1,38 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <AOFlagger/msio/samplerow.h>
-
-SampleRowPtr SampleRow::CreateWithoutMissings() const
-{
-	size_t newSize = 0;
-	for(size_t i=0;i<_size;++i)
-		if(std::isfinite(_values[i])) ++newSize;
-	SampleRow *newRow = new SampleRow(newSize);
-	size_t indexToNew = 0;
-	for(size_t i=0;i<_size;++i)
-	{
-		if(std::isfinite(_values[i]))
-		{
-			newRow->_values[indexToNew] = _values[i];
-			++indexToNew;
-		}
-	}
-	return SampleRowPtr(newRow);
-}
diff --git a/CEP/DP3/AOFlagger/src/msio/segmentedimage.cpp b/CEP/DP3/AOFlagger/src/msio/segmentedimage.cpp
deleted file mode 100644
index 2b04bb6605ecfe93cad6bfaaa1a27fb3cf3e3a95..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/msio/segmentedimage.cpp
+++ /dev/null
@@ -1,21 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <AOFlagger/msio/segmentedimage.h>
-
diff --git a/CEP/DP3/AOFlagger/src/msio/sortedtimestepaccessor.cpp b/CEP/DP3/AOFlagger/src/msio/sortedtimestepaccessor.cpp
deleted file mode 100644
index 80fd143208569e3fd637f8b25bfea5adf4e9e49b..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/msio/sortedtimestepaccessor.cpp
+++ /dev/null
@@ -1,177 +0,0 @@
-#include <AOFlagger/msio/sortedtimestepaccessor.h>
-
-#include <ms/MeasurementSets/MeasurementSet.h>
-#include <ms/MeasurementSets/MSColumns.h>
-
-void SortedTimestepAccessor::Open()
-{
-	assertNotOpen();
-
-	_totalChannelCount = 0;
-	_highestFrequency = 0.0;
-	_lowestFrequency = 0.0;
-
-	for(SetInfoVector::iterator i=_sets.begin(); i!=_sets.end(); ++i)
-	{
-		SetInfo &set = *i;
-
-		casa::MeasurementSet ms(set.path);
-		casa::Table mainTable(set.path, casa::Table::Update);
-
-		// Create the sorted table and iterator
-		casa::Block<casa::String> names(4);
-		names[0] = "TIME";
-		names[1] = "ANTENNA1";
-		names[2] = "ANTENNA2";
-		names[3] = "DATA_DESC_ID";
-		casa::Table sortab = mainTable.sort(names);
-		names.resize(3, true, true);
-		set.tableIter = new casa::TableIterator(sortab, names, casa::TableIterator::Ascending, casa::TableIterator::NoSort);
-
-		// Check number of polarizations
-		casa::Table polTable = ms.polarization();
-		casa::ROArrayColumn<int> corTypeColumn(polTable, "CORR_TYPE");
-		if(_polarizationCount==0 && i==_sets.begin())
-			_polarizationCount = corTypeColumn(0).shape()[0];
-		else if(_polarizationCount != corTypeColumn(0).shape()[0])
-			throw TimestepAccessorException("Number of polarizations don't match!");
-
-		// Find lowest and highest frequency and check order
-		set.lowestFrequency = 0.0;
-		set.highestFrequency = 0.0;
-		casa::Table spectralWindowTable = ms.spectralWindow();
-		casa::ROArrayColumn<double> frequencyCol(spectralWindowTable, "CHAN_FREQ");
-		for(unsigned b=0;b<spectralWindowTable.nrow();++b)
-		{
-			casa::Array<double> frequencyArray = frequencyCol(b);
-			casa::Array<double>::const_iterator frequencyIterator = frequencyArray.begin();
-			while(frequencyIterator != frequencyArray.end())
-			{
-				double frequency = *frequencyIterator;
-				if(set.lowestFrequency == 0.0) set.lowestFrequency = frequency;
-				if(frequency < set.lowestFrequency || frequency <= set.highestFrequency)
-					throw TimestepAccessorException("Channels or bands are not ordered in increasing frequency");
-				set.highestFrequency = frequency;
-				++frequencyIterator;
-			}
-		}
-		if(set.lowestFrequency < _highestFrequency)
-			throw TimestepAccessorException("Sub-bands are not given in order of increasing frequency");
-		if(_lowestFrequency == 0.0) _lowestFrequency = set.lowestFrequency;
-		_highestFrequency = set.highestFrequency;
-
-		set.bandCount = spectralWindowTable.nrow();
-		set.channelsPerBand = casa::ROArrayColumn<casa::Complex>(mainTable, "DATA")(0).shape()[1];
-		_totalChannelCount += set.bandCount * set.channelsPerBand;
-	}
-	_isOpen = true;
-}
-
-void SortedTimestepAccessor::Close()
-{
-	assertOpen();
-
-	for(SetInfoVector::iterator i=_sets.begin(); i!=_sets.end(); ++i)
-	{
-		delete i->tableIter;
-	}
-	_isOpen = false;
-}
-
-bool SortedTimestepAccessor::ReadNext(SortedTimestepAccessor::TimestepIndex &index, SortedTimestepAccessor::TimestepData &data)
-{
-	assertOpen();
-
-	index.FreeTables();
-
-	double timeStep = 0.0;
-	unsigned valIndex = 0;
-	casa::Table **tablePtr = index.tables;
-
-	for(SetInfoVector::iterator i=_sets.begin(); i!=_sets.end(); ++i)
-	{
-		SetInfo &set = *i;
-
-		if(set.tableIter->pastEnd())
-			return false;
-		*tablePtr = new casa::Table(set.tableIter->table());
-		casa::Table &table(**tablePtr);
-
-		// Check timestep & read u,v coordinates & antenna's
-		casa::ROScalarColumn<double> timeColumn = casa::ROScalarColumn<double>(table, "TIME");
-		if(timeStep == 0.0) {
-			casa::ROArrayColumn<double> uvwColumn = casa::ROArrayColumn<double>(table, "UVW");
-			timeStep = timeColumn(0);
-			casa::Array<double> uvwArray = uvwColumn(0);
-			casa::Array<double>::const_iterator uvwIterator = uvwArray.begin();
-			data.u = *uvwIterator;
-			++uvwIterator;
-			data.v = *uvwIterator;
-			casa::ROScalarColumn<int>
-				antenna1Column = casa::ROScalarColumn<int>(table, "ANTENNA1"),
-				antenna2Column = casa::ROScalarColumn<int>(table, "ANTENNA2");
-			data.antenna1 = antenna1Column(0);
-			data.antenna2 = antenna2Column(0);
-		}
-		else if(timeStep != timeColumn(0))
-			throw TimestepAccessorException("Sets do not have same time steps");
-
-		// Copy data from tables in arrays
-		casa::ROArrayColumn<casa::Complex> dataColumn(table, "DATA");
-		for(unsigned band=0;band<set.bandCount;++band)
-		{
-			casa::Array<casa::Complex> dataArray = dataColumn(band);
-			casa::Array<casa::Complex>::const_iterator dataIterator = dataArray.begin();
-			for(unsigned f=0;f<set.channelsPerBand;++f)
-			{
-				for(unsigned p=0;p<_polarizationCount;++p)
-				{
-					data.realData[p][valIndex] = (*dataIterator).real();
-					data.imagData[p][valIndex] = (*dataIterator).imag();
-					++dataIterator;
-				}
-				++valIndex;
-			}
-		}
-
-		set.tableIter->next();
-		++tablePtr;
-	}
-	return true;
-}
-
-void SortedTimestepAccessor::Write(SortedTimestepAccessor::TimestepIndex &index, const SortedTimestepAccessor::TimestepData &data)
-{
-	assertOpen();
-
-	casa::Table **tablePtr = index.tables;
-	unsigned valIndex = 0;
-
-	for(SetInfoVector::iterator i=_sets.begin(); i!=_sets.end(); ++i)
-	{
-		const SetInfo &set = *i;
-
-		casa::Table &table = **tablePtr;
-
-		// Copy data from arrays in tables
-		casa::ArrayColumn<casa::Complex> dataColumn(table, "DATA");
-		for(unsigned band=0;band<set.bandCount;++band)
-		{
-			casa::Array<casa::Complex> dataArray = dataColumn(band);
-			casa::Array<casa::Complex>::iterator dataIterator = dataArray.begin();
-			for(unsigned f=0;f<set.channelsPerBand;++f)
-			{
-				for(unsigned p=0;p<_polarizationCount;++p)
-				{
-					(*dataIterator).real(data.realData[p][valIndex]);
-					(*dataIterator).imag(data.imagData[p][valIndex]);
-					++dataIterator;
-				}
-				++valIndex;
-			}
-			dataColumn.basePut(band, dataArray);
-		}
-		set.tableIter->next();
-	}
-	index.FreeTables();
-}
diff --git a/CEP/DP3/AOFlagger/src/msio/spatialtimeloader.cpp b/CEP/DP3/AOFlagger/src/msio/spatialtimeloader.cpp
deleted file mode 100644
index 21cf62b448e4e80c37de6d11bbe686832d21fd5b..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/msio/spatialtimeloader.cpp
+++ /dev/null
@@ -1,145 +0,0 @@
-#include <AOFlagger/msio/spatialtimeloader.h>
-
-#include <stdexcept>
-
-#include <tables/Tables/ExprNode.h>
-
-#include <AOFlagger/msio/arraycolumniterator.h>
-#include <AOFlagger/msio/scalarcolumniterator.h>
-
-#include <AOFlagger/util/aologger.h>
-
-SpatialTimeLoader::SpatialTimeLoader(MeasurementSet &measurementSet)
-	:  _measurementSet(measurementSet), _sortedTable(0), _tableIter(0)
-{
-	casa::Table *rawTable = _measurementSet.OpenTable();
-	casa::Block<casa::String> names(4);
-	names[0] = "DATA_DESC_ID";
-	names[1] = "TIME";
-	names[2] = "ANTENNA1";
-	names[3] = "ANTENNA2";
-	_sortedTable = new casa::Table(rawTable->sort(names));
-	delete rawTable;
-
-	_channelCount = _measurementSet.FrequencyCount();
-	_timestepsCount = _measurementSet.MaxScanIndex();
-	_antennaCount = _measurementSet.AntennaCount();
-	_polarizationCount = _measurementSet.GetPolarizationCount();
-
-	casa::Block<casa::String> selectionNames(1);
-	selectionNames[0] = "DATA_DESC_ID";
-	_tableIter = new casa::TableIterator(*_sortedTable, selectionNames, casa::TableIterator::Ascending, casa::TableIterator::NoSort);
-}
-
-SpatialTimeLoader::~SpatialTimeLoader()
-{
-	if(_sortedTable != 0)
-		delete _sortedTable;
-	delete _tableIter;
-}
-
-TimeFrequencyData SpatialTimeLoader::Load(unsigned channelIndex, bool fringeStop)
-{
-	const unsigned baselineCount = _antennaCount * (_antennaCount-1) / 2;
-	
-	casa::Table table = _tableIter->table();
-	casa::ROScalarColumn<int> antenna1Column(table, "ANTENNA1"); 
-	casa::ROScalarColumn<int> antenna2Column(table, "ANTENNA2");
-	casa::ROScalarColumn<double> timeColumn(table, "TIME");
-	casa::ROArrayColumn<double> uvwColumn(table, "UVW");
-	casa::ROArrayColumn<bool> flagColumn(table, "FLAG");
-	casa::ROArrayColumn<casa::Complex> dataColumn(table, "DATA");
-
-        std::vector<Image2DPtr>
-                realImages(_polarizationCount),
-                imagImages(_polarizationCount);
-        std::vector<Mask2DPtr>
-                masks(_polarizationCount);
-	for(unsigned p=0;p<_polarizationCount;++p)
-	{
-		realImages[p] = Image2D::CreateUnsetImagePtr(_timestepsCount, baselineCount);
-		imagImages[p] = Image2D::CreateUnsetImagePtr(_timestepsCount, baselineCount);
-		masks[p] = Mask2D::CreateUnsetMaskPtr(_timestepsCount, baselineCount);
-	}
-	
-	ChannelInfo channelInfo = _measurementSet.GetBandInfo(0).channels[channelIndex];
-	
-	unsigned timeIndex = 0;
-	double lastTime = timeColumn(0);
-	for(unsigned row=0;row<table.nrow();++row)
-	{
-		const int
-			a1 = antenna1Column(row),
-			a2 = antenna2Column(row);
-		const double
-			time = timeColumn(row);
-		if(time != lastTime)
-		{
-			timeIndex++;
-			lastTime = time;
-		}
-		
-		if(a1 != a2)
-		{
-			const casa::Array<casa::Complex> data = dataColumn(row);
-			const casa::Array<bool> flags = flagColumn(row);
-			const casa::Array<double> uvws = uvwColumn(row);
-
-			casa::Array<casa::Complex>::const_iterator i = data.begin();
-			casa::Array<bool>::const_iterator fI = flags.begin();
-			casa::Array<double>::const_iterator uvwIter = uvws.begin();
-			++uvwIter; ++uvwIter;
-			const double wRotation = -channelInfo.MetersToLambda(*uvwIter) * M_PI * 2.0;
-			
-			unsigned baselineIndex = baselineCount - (_antennaCount-a1)*(_antennaCount-a1-1)/2+a2-a1-1;
-
-			for(unsigned c=0;c<_channelCount;++c) {
-				if(c == channelIndex)
-				{
-					AOLogger::Debug << "Reading timeIndex=" << timeIndex << ", baselineIndex=" << baselineIndex << ", a1=" << a1 << ", a2=" << a2 << ",w=" << wRotation << "\n";
-					for(unsigned p=0;p<_polarizationCount;++p) {
-						double realValue = i->real();
-						double imagValue = i->imag();
-						if(fringeStop)
-						{
-							double newRealValue = realValue * cosn(wRotation) - imagValue * sinn(wRotation);
-							imagValue = realValue * sinn(wRotation) + imagValue * cosn(wRotation);
-							realValue = newRealValue;
-						}
-						realImages[p]->SetValue(timeIndex, baselineIndex, realValue);
-						imagImages[p]->SetValue(timeIndex, baselineIndex, imagValue);
-						++i;
-						masks[p]->SetValue(timeIndex, baselineIndex, *fI);
-						++fI;
-					}
-				} else {
-					for(unsigned p=0;p<_polarizationCount;++p) {
-						++i;
-						++fI;
-					}
-				}
-			}
-		}
-	}
-	casa::ROScalarColumn<int> bandColumn(table, "DATA_DESC_ID");
-	const BandInfo band = _measurementSet.GetBandInfo(bandColumn(0));
-
-	TimeFrequencyData data;
-	if(_polarizationCount == 4)
-	{
-		data = TimeFrequencyData(realImages[0], imagImages[0], realImages[1], imagImages[1], realImages[2], imagImages[2], realImages[3], imagImages[3]);
-		data.SetIndividualPolarisationMasks(masks[0], masks[1], masks[2], masks[3]);
-	} else if(_polarizationCount == 2)
-	{
-		data = TimeFrequencyData(AutoDipolePolarisation, realImages[0], imagImages[0], realImages[1], imagImages[1]);
-		data.SetIndividualPolarisationMasks(masks[0], masks[1]);
-	} else if(_polarizationCount == 1)
-	{
-		data = TimeFrequencyData(SinglePolarisation, realImages[0], imagImages[0]);
-		data.SetGlobalMask(masks[0]);
-	} else {
-		throw std::runtime_error("Unknown number of polarizations!");
-	}
-	return data;
-}
-
diff --git a/CEP/DP3/AOFlagger/src/msio/stokesimager.cpp b/CEP/DP3/AOFlagger/src/msio/stokesimager.cpp
deleted file mode 100644
index 10f579a42872787c6c290f4ca09a26ffb2a9cd7a..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/msio/stokesimager.cpp
+++ /dev/null
@@ -1,140 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <AOFlagger/msio/stokesimager.h>
-
-StokesImager::StokesImager() : _stokesI(0), _stokesQ(0), _stokesU(0), _stokesV(0)
-{
-}
-
-StokesImager::~StokesImager()
-{
-	if(_stokesI) {
-		delete _stokesI;
-		delete _stokesQ;
-		delete _stokesU;
-		delete _stokesV;
-	}
-}
-
-void StokesImager::Image(const Image2D &realXX, const Image2D &imaginaryXX, const Image2D &realXY, const Image2D &imaginaryXY, const Image2D &realYY, const Image2D &imaginaryYY)
-{
-	if(_stokesI) {
-		delete _stokesI;
-		delete _stokesQ;
-		delete _stokesU;
-		delete _stokesV;
-	}
-	_stokesI = Image2D::CreateUnsetImage(realXX.Width(), realXX.Height());
-	_stokesQ = Image2D::CreateUnsetImage(realXX.Width(), realXX.Height());
-	_stokesU = Image2D::CreateUnsetImage(realXX.Width(), realXX.Height());
-	_stokesV = Image2D::CreateUnsetImage(realXX.Width(), realXX.Height());
-
-	for(unsigned long y = 0; y < realXX.Height(); ++y) {
-		for(unsigned long x = 0; x < realXX.Width(); ++x) {
-			double xx_a = sqrt(realXX.Value(x, y)*realXX.Value(x, y) + imaginaryXX.Value(x, y)*imaginaryXX.Value(x, y));
-			double yy_a = sqrt(realYY.Value(x, y)*realYY.Value(x, y) + imaginaryYY.Value(x, y)*imaginaryYY.Value(x, y));
-		
-			double stokesI = xx_a + yy_a;
-			double stokesQ = xx_a - yy_a;
-			double stokesU = 2.0 * realXY.Value(x, y);
-			double stokesV = 2.0 * imaginaryXY.Value(x, y);
-			_stokesI->SetValue(x, y, stokesI);
-			_stokesQ->SetValue(x, y, stokesQ);
-			_stokesU->SetValue(x, y, stokesU);
-			_stokesV->SetValue(x, y, stokesV);
-		}
-	}
-} 
-
-Image2DPtr StokesImager::CreateStokesIAmplitude(Image2DCPtr realXX, Image2DCPtr imaginaryXX, Image2DCPtr realYY, Image2DCPtr imaginaryYY)
-{
-	Image2D *stokesI = Image2D::CreateUnsetImage(realXX->Width(), realXX->Height());
-
-	for(unsigned long y = 0; y < realXX->Height(); ++y) {
-		for(unsigned long x = 0; x < realXX->Width(); ++x) {
-			double xx_a = sqrt(realXX->Value(x, y)*realXX->Value(x, y) + imaginaryXX->Value(x, y)*imaginaryXX->Value(x, y));
-			double yy_a = sqrt(realYY->Value(x, y)*realYY->Value(x, y) + imaginaryYY->Value(x, y)*imaginaryYY->Value(x, y));
-		
-			stokesI->SetValue(x, y, xx_a + yy_a);
-		}
-	}
-	return Image2DPtr(stokesI);
-}
-
-Image2DPtr StokesImager::CreateSum(Image2DCPtr left, Image2DCPtr right)
-{
-	Image2D *sum = Image2D::CreateUnsetImage(left->Width(), right->Height());
-
-	for(unsigned long y = 0; y < left->Height(); ++y) {
-		for(unsigned long x = 0; x < right->Width(); ++x) {
-			num_t left_a = left->Value(x, y);
-			num_t right_a = right->Value(x, y);
-		
-			sum->SetValue(x, y, left_a + right_a);
-		}
-	}
-	return Image2DPtr(sum);
-}
-
-Image2DPtr StokesImager::CreateNegatedSum(Image2DCPtr left, Image2DCPtr right)
-{
-	Image2D *sum = Image2D::CreateUnsetImage(left->Width(), right->Height());
-
-	for(unsigned long y = 0; y < left->Height(); ++y) {
-		for(unsigned long x = 0; x < right->Width(); ++x) {
-			num_t left_a = left->Value(x, y);
-			num_t right_a = right->Value(x, y);
-		
-			sum->SetValue(x, y, -(left_a + right_a));
-		}
-	}
-	return Image2DPtr(sum);
-}
-
-Image2DPtr StokesImager::CreateDifference(Image2DCPtr left, Image2DCPtr right)
-{
-	Image2D *difference = Image2D::CreateUnsetImage(left->Width(), right->Height());
-
-	for(unsigned long y = 0; y < left->Height(); ++y) {
-		for(unsigned long x = 0; x < right->Width(); ++x) {
-			num_t left_a = left->Value(x, y);
-			num_t right_a = right->Value(x, y);
-		
-			difference->SetValue(x, y, left_a - right_a);
-		}
-	}
-	return Image2DPtr(difference);
-}
-
-Image2DPtr StokesImager::CreateAvgPhase(Image2DCPtr xx, Image2DCPtr yy)
-{
-	Image2D *avgPhase = Image2D::CreateUnsetImage(xx->Width(), xx->Height());
-
-	for(unsigned long y = 0; y < xx->Height(); ++y) {
-		for(unsigned long x = 0; x < xx->Width(); ++x) {
-			double xx_a = xx->Value(x, y);
-			double yy_a = yy->Value(x, y);
-		
-			avgPhase->SetValue(x, y, fmodn(xx_a + yy_a, 2.0L*M_PIn) );
-		}
-	}
-	return Image2DPtr(avgPhase);
-}
-
diff --git a/CEP/DP3/AOFlagger/src/msio/timefrequencydata.cpp b/CEP/DP3/AOFlagger/src/msio/timefrequencydata.cpp
deleted file mode 100644
index 3b3db9094ffc759c07a3c6036d30bf0ee558982e..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/msio/timefrequencydata.cpp
+++ /dev/null
@@ -1,401 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <AOFlagger/msio/timefrequencydata.h>
-#include <AOFlagger/msio/stokesimager.h>
-
-#include <AOFlagger/util/ffttools.h>
-
-Image2DCPtr TimeFrequencyData::GetAbsoluteFromComplex(const Image2DCPtr &real, const Image2DCPtr &imag) const
-{
-	return Image2DPtr(FFTTools::CreateAbsoluteImage(*real, *imag));
-}
-			
-Image2DCPtr TimeFrequencyData::GetSum(const Image2DCPtr &left, const Image2DCPtr &right) const
-{
-	return StokesImager::CreateSum(left, right);
-}
-
-Image2DCPtr TimeFrequencyData::GetNegatedSum(const Image2DCPtr &left, const Image2DCPtr &right) const
-{
-	return StokesImager::CreateNegatedSum(left, right);
-}
-
-Image2DCPtr TimeFrequencyData::GetDifference(const Image2DCPtr &left, const Image2DCPtr &right) const
-{
-	return StokesImager::CreateDifference(left, right);
-}
-
-Image2DCPtr TimeFrequencyData::GetSinglePhaseFromDipolePhase(size_t xx, size_t yy) const
-{
-	return StokesImager::CreateAvgPhase(_images[xx], _images[yy]);
-}
-
-Image2DCPtr TimeFrequencyData::GetZeroImage() const
-{
-	return Image2D::CreateZeroImagePtr(_images[0]->Width(), _images[0]->Height());
-}
-
-Mask2DCPtr TimeFrequencyData::GetCombinedMask() const
-{
-	if(_flagging.empty())
-		return GetSetMask<false>();
-	else if(_flagging.size() == 1)
-		return _flagging[0];
-	else
-	{
-		std::vector<Mask2DCPtr>::const_iterator i = _flagging.begin();
-		Mask2DPtr mask = Mask2D::CreateCopy(*i);
-		++i;
-		while(i!=_flagging.end())
-		{
-			for(unsigned y=0;y<mask->Height();++y) {
-				for(unsigned x=0;x<mask->Width();++x) {
-					bool v = (*i)->Value(x, y);
-					if(v)
-						mask->SetValue(x, y, true);
-				}
-			}
-			++i;
-		}
-		return mask;
-	}
-}
-
-TimeFrequencyData *TimeFrequencyData::CreateTFDataFromSingleComplex(enum PhaseRepresentation phase) const
-{
-	TimeFrequencyData *data;
-	switch(phase)
-	{
-		case RealPart:
-			data = new TimeFrequencyData(RealPart, _polarisationType, _images[0]);
-			break;
-		case ImaginaryPart:
-			data = new TimeFrequencyData(ImaginaryPart, _polarisationType, _images[1]);
-			break;
-		case AmplitudePart:
-			data = new TimeFrequencyData(AmplitudePart, _polarisationType, GetAbsoluteFromComplex(0, 1));
-			break;
-		case PhasePart:
-			data = new TimeFrequencyData(PhasePart, _polarisationType, GetPhaseFromComplex(_images[0], _images[1]));
-			break;
-		default:
-			throw BadUsageException("Creating TF data with non implemented phase parameters");
-	}
-	CopyFlaggingTo(data);
-	return data;
-}
-
-TimeFrequencyData *TimeFrequencyData::CreateTFDataFromDipoleComplex(enum PhaseRepresentation phase) const
-{
-	TimeFrequencyData *data;
-	switch(phase)
-	{
-		case RealPart:
-			data = new TimeFrequencyData(RealPart,
-				GetRealPartFromDipole(XXPolarisation),
-				GetRealPartFromDipole(XYPolarisation),
-				GetRealPartFromDipole(YXPolarisation),
-				GetRealPartFromDipole(YYPolarisation));
-			break;
-		case ImaginaryPart:
-			data = new TimeFrequencyData(ImaginaryPart,
-				GetImaginaryPartFromDipole(XXPolarisation),
-				GetImaginaryPartFromDipole(XYPolarisation),
-				GetImaginaryPartFromDipole(YXPolarisation),
-				GetImaginaryPartFromDipole(YYPolarisation));
-			break;
-		case AmplitudePart:
-			{
-				Image2DCPtr
-					xx = GetAmplitudePartFromDipole(XXPolarisation),
-					xy = GetAmplitudePartFromDipole(XYPolarisation),
-					yx = GetAmplitudePartFromDipole(YXPolarisation),
-					yy = GetAmplitudePartFromDipole(YYPolarisation);
-				data = new TimeFrequencyData(AmplitudePart, xx, xy, yx, yy);
-			}
-			break;
-		case PhasePart:
-			{
-				Image2DCPtr
-					xx = GetPhasePartFromDipole(XXPolarisation),
-					xy = GetPhasePartFromDipole(XYPolarisation),
-					yx = GetPhasePartFromDipole(YXPolarisation),
-					yy = GetPhasePartFromDipole(YYPolarisation);
-				data = new TimeFrequencyData(PhasePart, xx, xy, yx, yy);
-			}
-			break;
-		default:
-			throw BadUsageException("Creating TF data with non implemented phase parameters (not real/imaginary/amplitude)");
-	}
-	CopyFlaggingTo(data);
-	return data;
-}
-
-TimeFrequencyData *TimeFrequencyData::CreateTFDataFromAutoDipoleComplex(enum PhaseRepresentation phase) const
-{
-	TimeFrequencyData *data;
-	switch(phase)
-	{
-		case RealPart:
-			data = new TimeFrequencyData(RealPart, AutoDipolePolarisation,
-				GetRealPartFromAutoDipole(XXPolarisation),
-				GetRealPartFromAutoDipole(YYPolarisation));
-			break;
-		case ImaginaryPart:
-			data = new TimeFrequencyData(ImaginaryPart, AutoDipolePolarisation,
-				GetImaginaryPartFromAutoDipole(XXPolarisation),
-				GetImaginaryPartFromAutoDipole(YYPolarisation));
-			break;
-		case AmplitudePart:
-			{
-				Image2DCPtr
-					xx = GetAmplitudePartFromAutoDipole(XXPolarisation),
-					yy = GetAmplitudePartFromAutoDipole(YYPolarisation);
-				data = new TimeFrequencyData(AmplitudePart, AutoDipolePolarisation, xx, yy);
-			}
-			break;
-		case PhasePart:
-			{
-				Image2DCPtr
-					xx = GetPhasePartFromAutoDipole(XXPolarisation),
-					yy = GetPhasePartFromAutoDipole(YYPolarisation);
-				data = new TimeFrequencyData(PhasePart, AutoDipolePolarisation, xx, yy);
-			}
-			break;
-		default:
-			throw BadUsageException("Creating TF data with non implemented phase parameters (not real/imaginary/amplitude)");
-	}
-	CopyFlaggingTo(data);
-	return data;
-}
-
-TimeFrequencyData *TimeFrequencyData::CreateTFDataFromCrossDipoleComplex(enum PhaseRepresentation phase) const
-{
-	TimeFrequencyData *data;
-	switch(phase)
-	{
-		case RealPart:
-			data = new TimeFrequencyData(RealPart, CrossDipolePolarisation,
-				GetRealPartFromCrossDipole(XYPolarisation),
-				GetRealPartFromCrossDipole(YXPolarisation));
-			break;
-		case ImaginaryPart:
-			data = new TimeFrequencyData(ImaginaryPart, CrossDipolePolarisation,
-				GetImaginaryPartFromCrossDipole(XYPolarisation),
-				GetImaginaryPartFromCrossDipole(YXPolarisation));
-			break;
-		case AmplitudePart:
-			{
-				Image2DCPtr
-					xy = GetAmplitudePartFromCrossDipole(XYPolarisation),
-					yx = GetAmplitudePartFromCrossDipole(YXPolarisation);
-				data = new TimeFrequencyData(AmplitudePart, CrossDipolePolarisation, xy, yx);
-			}
-			break;
-		case PhasePart:
-			{
-				Image2DCPtr
-					xy = GetPhasePartFromAutoDipole(XYPolarisation),
-					yx = GetPhasePartFromAutoDipole(YXPolarisation);
-				data = new TimeFrequencyData(PhasePart, CrossDipolePolarisation, xy, yx);
-			}
-			break;
-		default:
-			throw BadUsageException("Creating TF data with non implemented phase parameters (not real/imaginary/amplitude)");
-	}
-	CopyFlaggingTo(data);
-	return data;
-}
-
-TimeFrequencyData *TimeFrequencyData::CreateTFDataFromComplexCombination(const TimeFrequencyData &real, const TimeFrequencyData &imaginary)
-{
-	if(real.PhaseRepresentation() == ComplexRepresentation || imaginary.PhaseRepresentation() == ComplexRepresentation)
-		throw BadUsageException("Trying to create complex from real/imaginary time frequency that is are already complex");
-	if(real.Polarisation() != imaginary.Polarisation())
-		throw BadUsageException("Combining real/imaginary time frequency data from different polarisations"); 
-	switch(real.Polarisation())
-	{
-		case XXPolarisation:
-		case XYPolarisation:
-		case YXPolarisation:
-		case YYPolarisation:
-		case SinglePolarisation:
-		case StokesIPolarisation:
-		case StokesQPolarisation:
-		case StokesUPolarisation:
-		case StokesVPolarisation:
-			return new TimeFrequencyData(real.Polarisation(), real._images[0], imaginary._images[0]);
-		case DipolePolarisation:
-			return new TimeFrequencyData(
-				real._images[0], imaginary._images[0],
-				real._images[1], imaginary._images[1],
-				real._images[2], imaginary._images[2],
-				real._images[3], imaginary._images[3]);
-		case AutoDipolePolarisation:
-			return new TimeFrequencyData(AutoDipolePolarisation,
-				real._images[0], imaginary._images[0],
-				real._images[1], imaginary._images[1]);
-		case CrossDipolePolarisation:
-			return new TimeFrequencyData(CrossDipolePolarisation,
-				real._images[0], imaginary._images[0],
-				real._images[1], imaginary._images[1]);
-	}
-	throw BadUsageException("Invalid polarisation type");
-}
-
-TimeFrequencyData *TimeFrequencyData::CreateTFDataFromDipoleCombination(const TimeFrequencyData &xx, const TimeFrequencyData &xy, const TimeFrequencyData &yx, const TimeFrequencyData &yy)
-{
-	if(xx.PhaseRepresentation() != xy.PhaseRepresentation() ||
-		xx.PhaseRepresentation() != yx.PhaseRepresentation() ||
-		xx.PhaseRepresentation() != yy.PhaseRepresentation())
-		throw BadUsageException("Trying to create dipole time frequency combination from data with different phase representations!");
-
-	TimeFrequencyData *data;
-	switch(xx.PhaseRepresentation())
-	{
-		case PhasePart:
-		case AmplitudePart:
-		case RealPart:
-		case ImaginaryPart:
-			data = new TimeFrequencyData(xx.PhaseRepresentation(), xx._images[0], xy._images[0],yx._images[0], yy._images[0]);
-			break;
-		case ComplexRepresentation:
-			data = new TimeFrequencyData(xx._images[0], xx._images[1], xy._images[0], xy._images[1], yx._images[0], yx._images[1], yy._images[0], yy._images[1]);
-			break;
-		default:
-			throw BadUsageException("Invalid phase representation");
-	}
-	data->SetIndividualPolarisationMasks(xx.GetSingleMask(), xy.GetSingleMask(), yx.GetSingleMask(), yy.GetSingleMask());
-	return data;
-}
-
-TimeFrequencyData *TimeFrequencyData::CreateTFDataFromAutoDipoleCombination(const TimeFrequencyData &xx, const TimeFrequencyData &yy)
-{
-	if(xx.PhaseRepresentation() != yy.PhaseRepresentation())
-		throw BadUsageException("Trying to create auto dipole time frequency combination from data with different phase representations!");
-
-	TimeFrequencyData *data;
-	switch(xx.PhaseRepresentation())
-	{
-		case PhasePart:
-		case AmplitudePart:
-		case RealPart:
-		case ImaginaryPart:
-			data = new TimeFrequencyData(xx.PhaseRepresentation(), AutoDipolePolarisation, xx._images[0], yy._images[0]);
-			break;
-		case ComplexRepresentation:
-			data = new TimeFrequencyData(AutoDipolePolarisation, xx._images[0], xx._images[1], yy._images[0], yy._images[1]);
-			break;
-		default:
-			throw BadUsageException("Invalid phase representation");
-	}
-	data->SetIndividualPolarisationMasks(xx.GetSingleMask(), yy.GetSingleMask());
-	return data;
-}
-
-TimeFrequencyData *TimeFrequencyData::CreateTFDataFromCrossDipoleCombination(const TimeFrequencyData &xy, const TimeFrequencyData &yx)
-{
-	if(xy.PhaseRepresentation() != yx.PhaseRepresentation())
-		throw BadUsageException("Trying to create cross dipole time frequency combination from data with different phase representations!");
-
-	TimeFrequencyData *data;
-	switch(xy.PhaseRepresentation())
-	{
-		case PhasePart:
-		case AmplitudePart:
-		case RealPart:
-		case ImaginaryPart:
-			data = new TimeFrequencyData(xy.PhaseRepresentation(), AutoDipolePolarisation, xy._images[0], yx._images[0]);
-			break;
-		case ComplexRepresentation:
-			data = new TimeFrequencyData(AutoDipolePolarisation, xy._images[0], xy._images[1], yx._images[0], yx._images[1]);
-			break;
-		default:
-			throw BadUsageException("Invalid phase representation");
-	}
-	data->SetIndividualPolarisationMasks(xy.GetSingleMask(), yx.GetSingleMask());
-	return data;
-}
-
-void TimeFrequencyData::SetImagesToZero()
-{
-	if(!IsEmpty())
-	{
-		Image2DPtr zeroImage = Image2D::CreateZeroImagePtr(ImageWidth(), ImageHeight());
-		Mask2DPtr mask = Mask2D::CreateSetMaskPtr<false>(ImageWidth(), ImageHeight());
-		for(std::vector<Image2DCPtr>::iterator i=_images.begin();i!=_images.end();++i)
-			(*i) = zeroImage;
-		for(std::vector<Mask2DCPtr>::iterator i=_flagging.begin();i!=_flagging.end();++i)
-			(*i) = mask;
-	}
-}
-
-void TimeFrequencyData::MultiplyImages(long double factor)
-{
-	for(std::vector<Image2DCPtr>::iterator i=_images.begin();i!=_images.end();++i)
-	{
-		Image2DPtr newImage = Image2D::CreateCopy(*i);
-		newImage->MultiplyValues(factor);
-		(*i) = newImage;
-	}
-}
-
-void TimeFrequencyData::JoinMask(const TimeFrequencyData &other)
-{
-	if(other._flagging.size() == _flagging.size())
-	{
-		for(size_t i=0;i<_flagging.size();++i)
-		{
-			Mask2DPtr mask = Mask2D::CreateCopy(_flagging[i]);
-			mask->Join(other._flagging[i]);
-			_flagging[i] = mask;
-		}
-	} else if(other._flagging.size() == 1)
-	{
-		for(size_t i=0;i<_flagging.size();++i)
-		{
-			Mask2DPtr mask = Mask2D::CreateCopy(_flagging[i]);
-			mask->Join(other._flagging[0]);
-			_flagging[i] = mask;
-		}
-	} else if(_flagging.size() == 1)
-	{
-		Mask2DPtr mask = Mask2D::CreateCopy(_flagging[0]);
-		mask->Join(other.GetSingleMask());
-		_flagging[0] = mask;
-	} else if(other._flagging.empty())
-	{
-		// Nothing to be done; other has no flags
-	}	else if(_flagging.empty())
-	{
-		for(std::vector<Mask2DCPtr>::const_iterator i=other._flagging.begin();
-			i!=other._flagging.end();++i)
-		{
-			_flagging.push_back(*i);
-		}
-	}
-	else
-		throw BadUsageException("Joining time frequency flagging with incompatible structures");
-}
-
-Image2DCPtr TimeFrequencyData::GetPhaseFromComplex(const Image2DCPtr &real, const Image2DCPtr &imag) const
-{
-	return FFTTools::CreatePhaseImage(real, imag);
-}
diff --git a/CEP/DP3/AOFlagger/src/msio/timefrequencyimager.cpp b/CEP/DP3/AOFlagger/src/msio/timefrequencyimager.cpp
deleted file mode 100644
index bfe4d0d994bb4a327354855417ed3aca4efdf838..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/msio/timefrequencyimager.cpp
+++ /dev/null
@@ -1,703 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <AOFlagger/msio/timefrequencyimager.h>
-#include <AOFlagger/msio/timefrequencydata.h>
-
-#include <set>
-#include <stdexcept>
-
-#include <ms/MeasurementSets/MeasurementSet.h>
-
-#include <tables/Tables/ExprNode.h>
-#include <tables/Tables/TableIter.h>
-
-#include <AOFlagger/util/aologger.h>
-
-#include <AOFlagger/msio/arraycolumniterator.h>
-#include <AOFlagger/msio/scalarcolumniterator.h>
-
-TimeFrequencyImager::TimeFrequencyImager(MeasurementSet &measurementSet)
-	: _readData(true), _readFlags(false),
-		_readXX(true), _readXY(true), _readYX(true), _readYY(true), _readStokesI(false), _readStokesIDirectly(false),
-		_measurementSet(&measurementSet), _dataKind(CorrectedData), _sortedTable(0)
-{
-}
-
-TimeFrequencyImager::~TimeFrequencyImager()
-{
-	ClearImages();
-	if(_sortedTable != 0)
-		delete _sortedTable;
-}
-
-void TimeFrequencyImager::ClearImages()
-{
-	_realXX.reset();
-	_imaginaryXX.reset();
-	_realXY.reset();
-	_imaginaryXY.reset();
-	_realYX.reset();
-	_imaginaryYX.reset();
-	_realYY.reset();
-	_imaginaryYY.reset();
-	_realStokesI.reset();
-	_imaginaryStokesI.reset();
-	_flagXX.reset();
-	_flagXY.reset();
-	_flagYX.reset();
-	_flagYY.reset();
-	_flagCombined.reset();
-}
-
-void TimeFrequencyImager::setObservationTimes(MeasurementSet &set, std::map<double,size_t> &observationTimes)
-{
-	observationTimes.clear();
-	const std::set<double> &times = set.GetObservationTimesSet();
-	unsigned index = 0;
-	for(std::set<double>::const_iterator i=times.begin();i!=times.end();++i)
-	{
-		observationTimes.insert(std::pair<double,size_t>(*i, index));
-		++index; 
-	}
-}
-
-void TimeFrequencyImager::Image(size_t antenna1Select, size_t antenna2Select, size_t spectralWindowSelect)
-{
-	_antenna1Select = antenna1Select;
-	_antenna2Select	= antenna2Select;
-	_spectralWindowSelect = spectralWindowSelect;
-
-	_bandInfo = _measurementSet->GetBandInfo(spectralWindowSelect);
-
-	setObservationTimes(*_measurementSet, _observationTimes);
-	image(antenna1Select, antenna2Select, spectralWindowSelect, 0, _observationTimes.size());
-}
-
-void TimeFrequencyImager::Image(size_t antenna1Select, size_t antenna2Select, size_t spectralWindowSelect, size_t startIndex, size_t endIndex)
-{
-	_antenna1Select = antenna1Select;
-	_antenna2Select	= antenna2Select;
-	_spectralWindowSelect = spectralWindowSelect;
-
-	_bandInfo = _measurementSet->GetBandInfo(spectralWindowSelect);
-
-	setObservationTimes(*_measurementSet, _observationTimes);
-	image(antenna1Select, antenna2Select, spectralWindowSelect, startIndex, endIndex);
-}
-
-void TimeFrequencyImager::image(size_t antenna1Select, size_t antenna2Select, size_t spectralWindowSelect, size_t startIndex, size_t endIndex)
-{
-	size_t timeCount = _observationTimes.size();
-	int frequencyCount = _measurementSet->FrequencyCount();
-
-	initializePolarizations();
-	checkPolarizations();
-
-	if(_sortedTable == 0)
-	{
-		casa::Table *rawTable = _measurementSet->OpenTable();
-		casa::Block<casa::String> names(4);
-		names[0] = "DATA_DESC_ID";
-		names[1] = "ANTENNA1";
-		names[2] = "ANTENNA2";
-		names[3] = "TIME";
-		_sortedTable = new casa::Table(rawTable->sort(names));
-		delete rawTable;
-	}
-
-	casa::Block<casa::String> selectionNames(3);
-	selectionNames[0] = "DATA_DESC_ID";
-	selectionNames[1] = "ANTENNA1";
-	selectionNames[2] = "ANTENNA2";
-	casa::TableIterator iter(*_sortedTable, selectionNames, casa::TableIterator::Ascending, casa::TableIterator::NoSort);
-	while(!iter.pastEnd())
-	{
-		casa::Table table = iter.table();
-		casa::ROScalarColumn<int> antenna1(table, "ANTENNA1"); 
-		casa::ROScalarColumn<int> antenna2(table, "ANTENNA2");
-		casa::ROScalarColumn<int> windowColumn(table, "DATA_DESC_ID");
-		if(table.nrow() > 0 && windowColumn(0) == (int) spectralWindowSelect && antenna1(0) == (int) antenna1Select && antenna2(0) == (int) antenna2Select)
-		{
-			break;
-		} else {
-			iter.next();
-		}
-	}
-	if(iter.pastEnd())
-	{
-		throw std::runtime_error("Baseline not found");
-	}
-
-	casa::Table table = iter.table();
-
-	if(startIndex > timeCount)
-	{
-		std::cerr << "Warning: startIndex > timeCount" << std::endl;
-	}
-	if(endIndex > timeCount)
-	{
-		endIndex = timeCount;
-		std::cerr << "Warning: endIndex > timeCount" << std::endl;
-	}
-
-	size_t width = endIndex-startIndex;
-	if(width == 0 || frequencyCount == 0)
-		return;
-
-	ClearImages();
-
-	if(_readData) {
-		if(_realXX==0 && _readXX)
-		{
-			_realXX = Image2D::CreateZeroImagePtr(width, frequencyCount);
-			_imaginaryXX = Image2D::CreateZeroImagePtr(width, frequencyCount);
-		}
-		if(_realXY == 0 && _readXY)
-		{
-			_realXY = Image2D::CreateZeroImagePtr(width, frequencyCount);
-			_imaginaryXY = Image2D::CreateZeroImagePtr(width, frequencyCount);
-		}
-		if(_realYX == 0 && _readYX)
-		{
-			_realYX = Image2D::CreateZeroImagePtr(width, frequencyCount);
-			_imaginaryYX = Image2D::CreateZeroImagePtr(width, frequencyCount);
-		}
-		if(_realYY == 0 && _readYY)
-		{
-			_realYY = Image2D::CreateZeroImagePtr(width, frequencyCount);
-			_imaginaryYY = Image2D::CreateZeroImagePtr(width, frequencyCount);
-		}
-		if(_realStokesI == 0 && _readStokesI)
-		{
-			_realStokesI = Image2D::CreateZeroImagePtr(width, frequencyCount);
-			_imaginaryStokesI = Image2D::CreateZeroImagePtr(width, frequencyCount);
-		}
-	}
-	if(_readFlags) {
-		// The flags should be initialized to true, as this baseline might
-		// miss some time scans that other baselines do have, and these
-		// should be flagged.
-		if(_flagXX==0 && _readXX)
-			_flagXX = Mask2D::CreateSetMaskPtr<true>(width, frequencyCount);
-		if(_flagXY==0 && _readXY)
-			_flagXY = Mask2D::CreateSetMaskPtr<true>(width, frequencyCount);
-		if(_flagYX==0 && _readYX)
-			_flagYX = Mask2D::CreateSetMaskPtr<true>(width, frequencyCount);
-		if(_flagYY==0 && _readYY)
-			_flagYY = Mask2D::CreateSetMaskPtr<true>(width, frequencyCount);
-		if(_flagCombined==0 && _readStokesI)
-			_flagCombined = Mask2D::CreateSetMaskPtr<true>(width, frequencyCount);
-	}
-	_uvw.resize(width);
-
-	casa::ROScalarColumn<int> antenna1(table, "ANTENNA1"); 
-	casa::ROScalarColumn<int> antenna2(table, "ANTENNA2");
-	casa::ROScalarColumn<int> windowColumn(table, "DATA_DESC_ID");
-	casa::ROScalarColumn<double> timeColumn(table, "TIME");
-	casa::ROArrayColumn<float> weightColumn(table, "WEIGHT");
-	casa::ROArrayColumn<double> uvwColumn(table, "UVW");
-
-	casa::ROArrayColumn<casa::Complex> *dataColumn = 0;
-	if(_readData)
-		dataColumn = CreateDataColumn(_dataKind, table);
-
-	ROArrayColumnIterator<casa::Complex> *modelIter;
-	if(_dataKind == ResidualData) {
-		casa::ROArrayColumn<casa::Complex> *modelColumn;
-		modelColumn = new casa::ROArrayColumn<casa::Complex>(table, "MODEL_DATA");
-		modelIter = new ROArrayColumnIterator<casa::Complex>(ROArrayColumnIterator<casa::Complex>::First(*modelColumn));
-	} else {
-		modelIter = 0;
-	}
-	casa::ROArrayColumn<bool> flagColumn(table, "FLAG");
-
-	ScalarColumnIterator<int> antenna1Iter = ScalarColumnIterator<int>::First(antenna1);
-	ScalarColumnIterator<int> antenna2Iter = ScalarColumnIterator<int>::First(antenna2);
-	ScalarColumnIterator<int> windowIter = ScalarColumnIterator<int>::First(windowColumn);
-	ScalarColumnIterator<double> timeIter = ScalarColumnIterator<double>::First(timeColumn);
-	ROArrayColumnIterator<double> uvwIter = ROArrayColumnIterator<double>::First(uvwColumn);
-	ROArrayColumnIterator<float> weightIter = ROArrayColumnIterator<float>::First(weightColumn);
-	ROArrayColumnIterator<casa::Complex> dataIter = 
-		ROArrayColumnIterator<casa::Complex>::First(*dataColumn);
-	ROArrayColumnIterator<bool> flagIter = 
-		ROArrayColumnIterator<bool>::First(flagColumn);
-
-	for(size_t i=0;i<table.nrow();++i) {
-		double time = *timeIter;
-		size_t timeIndex = _observationTimes.find(time)->second;
-		bool timeIsSelected = timeIndex>=startIndex && timeIndex<endIndex;
-		if(_readData && timeIsSelected) {
-			if(_dataKind == WeightData)
-				ReadWeights(timeIndex-startIndex, frequencyCount, *weightIter);
-			else if(modelIter == 0)
-				ReadTimeData(timeIndex-startIndex, frequencyCount, *dataIter, 0);
-			else {
-				const casa::Array<casa::Complex> model = **modelIter; 
-				ReadTimeData(timeIndex-startIndex, frequencyCount, *dataIter, &model);
-			}
-		}
-		if(_readFlags && timeIsSelected) {
-			const casa::Array<bool> flag = *flagIter;
-			ReadTimeFlags(timeIndex-startIndex, frequencyCount, flag);
-		}
-		if(timeIsSelected) {
-			casa::Array<double> arr = *uvwIter;
-			casa::Array<double>::const_iterator i = arr.begin();
-			_uvw[timeIndex-startIndex].u = *i;
-			++i;
-			_uvw[timeIndex-startIndex].v = *i;
-			++i;
-			_uvw[timeIndex-startIndex].w = *i;
-		}
-
-		if(_readData)
-		{
-			++dataIter;
-			if(modelIter != 0)
-				++(*modelIter);
-		}
-		if(_readFlags)
-		{
-			++flagIter;
-		}
-
-		++weightIter;
-		++antenna1Iter;
-		++antenna2Iter;
-		++timeIter;
-		++uvwIter;
-		++windowIter;
-	}
-	if(dataColumn != 0)
-		delete dataColumn;
-}
-
-casa::ROArrayColumn<casa::Complex> *TimeFrequencyImager::CreateDataColumn(DataKind kind, casa::Table &table)
-{
-	switch(kind) {
-		case ObservedData:
-		default:
-		return new casa::ROArrayColumn<casa::Complex>(table, "DATA");
-		case CorrectedData:
-		case ResidualData:
-		return new casa::ROArrayColumn<casa::Complex>(table, "CORRECTED_DATA");
-		case ModelData:
-		return new casa::ROArrayColumn<casa::Complex>(table, "MODEL_DATA");
-	}
-}
-
-void TimeFrequencyImager::WriteNewFlags(Mask2DCPtr newXX, Mask2DCPtr newXY, Mask2DCPtr newYX, Mask2DCPtr newYY)
-{
-	WriteNewFlagsPart(newXX, newXY, newYX, newYY, _antenna1Select, _antenna2Select, _spectralWindowSelect, 0, newXX->Width());
-}
-
-void TimeFrequencyImager::WriteNewFlags(Mask2DCPtr newXX, Mask2DCPtr newXY, Mask2DCPtr newYX, Mask2DCPtr newYY, int antenna1, int antenna2, int spectralWindow)
-{
-	WriteNewFlagsPart(newXX, newXY, newYX, newYY, antenna1, antenna2, spectralWindow, 0, newXX->Width());
-}
-
-void TimeFrequencyImager::WriteNewFlagsPart(Mask2DCPtr newXX, Mask2DCPtr newXY, Mask2DCPtr newYX, Mask2DCPtr newYY, int antenna1, int antenna2, int spectralWindow, size_t timeOffset, size_t timeEnd, size_t leftBorder, size_t rightBorder)
-{
-	initializePolarizations();
-	checkPolarizations();
-
-	size_t frequencyCount = _measurementSet->FrequencyCount();
-
-	std::map<double,size_t> observationTimes;
-	setObservationTimes(*_measurementSet, observationTimes);
-
-	casa::Table *table = _measurementSet->OpenTable(true);
-	casa::ROScalarColumn<int> antenna1Column(*table, "ANTENNA1"); 
-	casa::ROScalarColumn<int> antenna2Column(*table, "ANTENNA2");
-	casa::ROScalarColumn<int> windowColumn(*table, "DATA_DESC_ID");
-	casa::ROScalarColumn<double> timeColumn(*table, "TIME");
-	casa::ArrayColumn<bool> flagColumn(*table, "FLAG");
-
-	ScalarColumnIterator<int> antenna1Iter = ScalarColumnIterator<int>::First(antenna1Column);
-	ScalarColumnIterator<int> antenna2Iter = ScalarColumnIterator<int>::First(antenna2Column);
-	ScalarColumnIterator<int> windowIter = ScalarColumnIterator<int>::First(windowColumn);
-	ScalarColumnIterator<double> timeIter = ScalarColumnIterator<double>::First(timeColumn);
-	ArrayColumnIterator<bool> flagIter = ArrayColumnIterator<bool>::First(flagColumn);
-
-	if(frequencyCount != newXX->Height())
-	{
-		std::cerr << "The frequency count in the measurement set (" << frequencyCount << ") does not match the image!" << std::endl;
-	}
-	if(timeEnd - timeOffset != newXX->Width())
-	{
-		std::cerr << "The number of time scans to write in the measurement set (" << (timeEnd - timeOffset) << ") does not match the image (" << newXX->Width() << ") !" << std::endl;
-	}
-
-	size_t rowsWritten = 0;
-	for(size_t i=0;i<table->nrow();++i) {
-		if((*antenna1Iter) == (int) antenna1 &&
-		   (*antenna2Iter) == (int) antenna2 &&
-		   (*windowIter) == (int) spectralWindow)
-		{
-			double time = *timeIter;
-			size_t timeIndex = observationTimes.find(time)->second;
-			if(timeIndex >= timeOffset + leftBorder && timeIndex < timeEnd - rightBorder)
-			{
-				casa::Array<bool> flag = *flagIter;
-				casa::Array<bool>::iterator j = flag.begin();
-				for(size_t f=0;f<(size_t) frequencyCount;++f) {
-					if(_stokesIIndex >= 0)
-					{
-						if(_readStokesIDirectly) *j = newXX->Value(timeIndex - timeOffset, f);
-						++j;
-					}
-					if(_xxIndex >= 0)
-					{
-						if(_readXX) *j = newXX->Value(timeIndex - timeOffset, f);
-						++j;
-					}
-					if(_xyIndex >= 0)
-					{
-						if(_readXY) *j = newXY->Value(timeIndex - timeOffset, f);
-						++j;
-					}
-					if(_yxIndex >= 0)
-					{
-						if(_readYX) *j = newYX->Value(timeIndex - timeOffset, f);
-						++j;
-					}
-					if(_yyIndex >= 0)
-					{
-						if(_readYY) *j = newYY->Value(timeIndex - timeOffset, f);
-						++j;
-					}
-				}
-				flagIter.Set(flag);
-				++rowsWritten;
-			}
-		}
-
-		++antenna1Iter;
-		++antenna2Iter;
-		++timeIter;
-		++windowIter;
-		++flagIter;
-	}
-	AOLogger::Debug << "Rows written: " << rowsWritten << '\n';
-
-	delete table;
-}
-
-void TimeFrequencyImager::ReadTimeData(size_t xOffset, int frequencyCount, const casa::Array<casa::Complex> data, const casa::Array<casa::Complex> *model)
-{
-	casa::Array<casa::Complex>::const_iterator i = data.begin();
-	casa::Array<casa::Complex>::const_iterator m;
-	if(_dataKind == ResidualData)
-		m = model->begin();
-
-	for(size_t f=0;f<(size_t) frequencyCount;++f) {
-		double xxr, xxi, xyr, xyi, yxr, yxi, yyr, yyi, ir, ii;
-
-		if(_dataKind == ResidualData) {
-			const casa::Complex &iData = *i;
-			const casa::Complex &iModel = *m;
-			if(_stokesIIndex >= 0) { ++i; ++m; }
-
-			const casa::Complex &xxData = *i;
-			const casa::Complex &xxModel = *m;
-			if(_xxIndex >= 0) { ++i; ++m; }
-
-			const casa::Complex &xyData = *i;
-			const casa::Complex &xyModel = *m;
-			if(_xyIndex >= 0) { ++i; ++m; }
-
-			const casa::Complex &yxData = *i;
-			const casa::Complex &yxModel = *m;
-			if(_yxIndex >= 0) { ++i; ++m; }
-
-			const casa::Complex &yyData = *i;
-			const casa::Complex &yyModel = *m;
-			if(_yyIndex >= 0) { ++i; ++m; }
-
-			ir = iData.real() - iModel.real();
-			ii = iData.imag() - iModel.imag();
-			xxr = xxData.real() - xxModel.real();
-			xxi = xxData.imag() - xxModel.imag();
-			xyr = xyData.real() - xyModel.real();
-			xyi = xyData.imag() - xyModel.imag();
-			yxr = yxData.real() - yxModel.real();
-			yxi = yxData.imag() - yxModel.imag();
-			yyr = yyData.real() - yyModel.real();
-			yyi = yyData.imag() - yyModel.imag();
-		} else {
-			const casa::Complex &stokesI = *i;
-			if(_stokesIIndex >= 0) ++i;
-			const casa::Complex &xx = *i;
-			if(_xxIndex >= 0) ++i;
-			const casa::Complex &xy = *i;
-			if(_xyIndex >= 0) ++i;
-			const casa::Complex &yx = *i;
-			if(_yxIndex >= 0) ++i;
-			const casa::Complex &yy = *i;
-			if(_yyIndex >= 0) ++i;
-
-			xxr = xx.real();
-			xxi = xx.imag();
-			xyr = xy.real();
-			xyi = xy.imag();
-			yxr = yx.real();
-			yxi = yx.imag();
-			yyr = yy.real();
-			yyi = yy.imag();
-			ir = stokesI.real();
-			ii = stokesI.imag();
-		}
-	
-		if(_readXX)
-		{
-			_realXX->SetValue(xOffset, f, xxr);
-			_imaginaryXX->SetValue(xOffset, f, xxi);
-		}
-		if(_readXY)
-		{
-			_realXY->SetValue(xOffset, f, xyr);
-			_imaginaryXY->SetValue(xOffset, f, xyi);
-		}
-		if(_readYX)
-		{
-			_realYX->SetValue(xOffset, f, yxr);
-			_imaginaryYX->SetValue(xOffset, f, yxi);
-		}
-		if(_readYY)
-		{
-			_realYY->SetValue(xOffset, f, yyr);
-			_imaginaryYY->SetValue(xOffset, f, yyi);
-		}
-		if(_readStokesI)
-		{
-			if(_readStokesIDirectly) {
-				_realStokesI->SetValue(xOffset, f, ir);
-				_imaginaryStokesI->SetValue(xOffset, f, ii);
-			} else {
-				_realStokesI->SetValue(xOffset, f, xxr + yyr);
-				_imaginaryStokesI->SetValue(xOffset, f, xxi + yyi);
-			}
-		}
-	}
-}
-
-void TimeFrequencyImager::ReadTimeFlags(size_t xOffset, int frequencyCount, const casa::Array<bool> flag)
-{
-	casa::Array<bool>::const_iterator j = flag.begin();
-	for(size_t f=0;f<(size_t) frequencyCount;++f) {
-		bool stokesIF = false;
-		if(_stokesIIndex >= 0) {
-			stokesIF = *j;
-			++j;
-		}
-		if(_xxIndex >= 0)
-		{
-			if(_readXX) _flagXX->SetValue(xOffset, f, *j);
-			stokesIF |= *j;
-			++j;
-		}
-		if(_xyIndex >= 0)
-		{
-			if(_readXY) _flagXY->SetValue(xOffset, f, *j);
-			stokesIF |= *j;
-			++j;
-		}
-		if(_yxIndex >= 0)
-		{
-			if(_readYX) _flagYX->SetValue(xOffset, f, *j);
-			stokesIF |= *j;
-			++j;
-		}
-		if(_yyIndex >= 0)
-		{
-			if(_readYY) _flagYY->SetValue(xOffset, f, *j);
-			stokesIF |= *j;
-			++j;
-		}
-		if(_readStokesI)
-		{
-			_flagCombined->SetValue(xOffset, f, stokesIF);
-		}
-	} 
-}
-
-void TimeFrequencyImager::ReadWeights(size_t xOffset, int frequencyCount, const casa::Array<float> weight)
-{
-	casa::Array<float>::const_iterator j = weight.begin();
-	float xx = *j;
-	++j;
-	float xy = *j;
-	++j;
-	float yx = *j;
-	++j;
-	float yy = *j;
-	++j;
-	for(size_t f=0;f<(size_t) frequencyCount;++f) {
-		if(_readXX)
-		{
-			_realXX->SetValue(xOffset, f, xx);
-			_imaginaryXX->SetValue(xOffset, f, 0.0);
-		}
-		if(_readXY)
-		{
-			_realXY->SetValue(xOffset, f, xy);
-			_imaginaryXY->SetValue(xOffset, f, 0.0);
-		}
-		if(_readYX)
-		{
-			_realYX->SetValue(xOffset, f, yx);
-			_imaginaryYX->SetValue(xOffset, f, 0.0);
-		}
-		if(_readYY)
-		{
-			_realYY->SetValue(xOffset, f, yy);
-			_imaginaryYY->SetValue(xOffset, f, 0.0);
-		}
-		if(_readStokesI)
-		{
-			_realStokesI->SetValue(xOffset, f, xx + yy);
-			_imaginaryStokesI->SetValue(xOffset, f, 0.0);
-		}
-	} 
-}
-
-TimeFrequencyData TimeFrequencyImager::GetData() const
-{
-	TimeFrequencyData data;
-	if(
-		_realXX != 0 && _imaginaryXX != 0 &&
-		_realXY != 0 && _imaginaryXY != 0 &&
-		_realYX != 0 && _imaginaryYX != 0 &&
-		_realYY != 0 && _imaginaryYY != 0)
-	{
-		data = TimeFrequencyData(_realXX, _imaginaryXX, _realXY, _imaginaryXY, _realYX, _imaginaryYX, _realYY, _imaginaryYY);
-	} else if(
-		_realXX != 0 && _imaginaryXX != 0 &&
-		_realYY != 0 && _imaginaryYY != 0)
-	{
-		data = TimeFrequencyData(AutoDipolePolarisation, _realXX, _imaginaryXX, _realYY, _imaginaryYY);
-	} else if(_realStokesI != 0 && _imaginaryStokesI != 0)
-	{
-		data = TimeFrequencyData(StokesIPolarisation, _realStokesI, _imaginaryStokesI);
-	}
-
-	if(_flagXX != 0 && _flagXY != 0 && _flagYX != 0 && _flagYY != 0)
-	{
-		if(data.Polarisation() != DipolePolarisation)
-			throw BadUsageException("Trying to read dipole polarisation masks, but TF data does not have the dipole polarisations"); 
-		data.SetIndividualPolarisationMasks(_flagXX, _flagXY, _flagYX, _flagYY);
-	} else if(_flagXX != 0 && _flagYY != 0)
-	{
-		if(data.Polarisation() != AutoDipolePolarisation)
-			throw BadUsageException("Trying to read auto dipole polarisation masks, but TF data does not have the auto dipole polarisations"); 
-		data.SetIndividualPolarisationMasks(_flagXX, _flagYY);
-	} else if(_flagCombined != 0)
-	{
-		data.SetGlobalMask(_flagCombined);
-	}
-
-	return data;
-}
-
-void TimeFrequencyImager::PartInfo(const std::string &msFile, size_t maxTimeScans, size_t &timeScanCount, size_t &partCount)
-{
-	MeasurementSet set(msFile);
-	std::map<double,size_t> observationTimes;
-	setObservationTimes(set, observationTimes);
-
-	timeScanCount = observationTimes.size();
-	if(maxTimeScans == 0)
-		partCount = 1;
-	else
-	{
-		partCount = (timeScanCount + maxTimeScans - 1) / maxTimeScans;
-		if(partCount == 0)
-			partCount = 1;
-	}
-}
-
-void TimeFrequencyImager::initializePolarizations()
-{
-	casa::MeasurementSet ms(_measurementSet->Location());
-	casa::Table polTable = ms.polarization();
-	casa::ROArrayColumn<int> corTypeColumn(polTable, "CORR_TYPE"); 
-	casa::Array<int> corType = corTypeColumn(0);
-	casa::Array<int>::iterator iterend(corType.end());
-	_xxIndex = -1, _xyIndex = -1, _yxIndex = -1, _yyIndex = -1; _stokesIIndex = -1;
-	int polarizationCount = 0;
-	for (casa::Array<int>::iterator iter=corType.begin(); iter!=iterend; ++iter)
-	{
-		switch(*iter) {
-			case 1: _stokesIIndex = polarizationCount; break;
-			case 5:
-			case 9: _xxIndex = polarizationCount; break;
-			case 6:
-			case 10: _xyIndex = polarizationCount; break;
-			case 7:
-			case 11: _yxIndex = polarizationCount; break;
-			case 8:
-			case 12: _yyIndex = polarizationCount; break;
-			default:
-			{
-				std::stringstream s;
-				s << "There is a polarization in the measurement set that I can not handle (" << *iter << ", polarization index " << polarizationCount << ").";
-				throw std::runtime_error(s.str());
-			}
-		}
-		++polarizationCount;
-  }
-}
-
-void TimeFrequencyImager::checkPolarizations()
-{
-	if(_readXX && _xxIndex < 0)
-	{
-		std::cerr << "Warning: trying to read XX polarization, but polarization not available." << std::endl;
-		_readXX = false;
-	}
-	if(_readXY && _xyIndex < 0)
-	{
-		std::cerr << "Warning: trying to read XY polarization, but polarization not available." << std::endl;
-		_readXY = false;
-	}
-	if(_readYX && _yxIndex < 0)
-	{
-		std::cerr << "Warning: trying to read YX polarization, but polarization not available." << std::endl;
-		_readYX = false;
-	}
-	if(_readYY && _yyIndex < 0)
-	{
-		std::cerr << "Warning: trying to read YY polarization, but polarization not available." << std::endl;
-		_readYY = false;
-	}
-	if(_readStokesI)
-	{
-		if(_stokesIIndex >= 0)
-			_readStokesIDirectly = true;
-		else if(_xxIndex >= 0 && _yyIndex >= 0)
-		{
-			_readStokesIDirectly = false;
-		} else
-		{
-			std::cerr << "Warning: trying to read StokesI polarization, but polarization not available." << std::endl;
-			_readStokesI = false;
-		}
-	}
-}
diff --git a/CEP/DP3/AOFlagger/src/msio/timestepaccessor.cpp b/CEP/DP3/AOFlagger/src/msio/timestepaccessor.cpp
deleted file mode 100644
index 350d71dda2866a03824bf7354e98da270160c5f2..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/msio/timestepaccessor.cpp
+++ /dev/null
@@ -1,333 +0,0 @@
-#include <AOFlagger/msio/timestepaccessor.h>
-
-#include <ms/MeasurementSets/MeasurementSet.h>
-
-#include <sstream>
-
-void TimestepAccessor::Open()
-{
-	assertNotOpen();
-
-	_totalChannelCount = 0;
-	_highestFrequency = 0.0;
-	_lowestFrequency = 0.0;
-	_totalRowCount = 0;
-	_currentRow = 0;
-
-	for(SetInfoVector::iterator i=_sets.begin(); i!=_sets.end(); ++i)
-	{
-		SetInfo &set = *i;
-
-		casa::MeasurementSet ms(set.path);
-
-		openSet(set);
-
-		// Check number of polarizations
-		casa::Table polTable = ms.polarization();
-		casa::ROArrayColumn<int> corTypeColumn(polTable, "CORR_TYPE");
-		if(_polarizationCount==0 && i==_sets.begin())
-			_polarizationCount = corTypeColumn(0).shape()[0];
-		else if(_polarizationCount != corTypeColumn(0).shape()[0])
-			throw TimestepAccessorException("Number of polarizations don't match!");
-
-		// Find lowest and highest frequency and check order
-		set.lowestFrequency = 0.0;
-		set.highestFrequency = 0.0;
-		casa::Table spectralWindowTable = ms.spectralWindow();
-		casa::ROArrayColumn<double> frequencyCol(spectralWindowTable, "CHAN_FREQ");
-		for(unsigned b=0;b<spectralWindowTable.nrow();++b)
-		{
-			casa::Array<double> frequencyArray = frequencyCol(b);
-			casa::Array<double>::const_iterator frequencyIterator = frequencyArray.begin();
-			while(frequencyIterator != frequencyArray.end())
-			{
-				double frequency = *frequencyIterator;
-				if(set.lowestFrequency == 0.0) set.lowestFrequency = frequency;
-				if(frequency < set.lowestFrequency || frequency <= set.highestFrequency)
-					throw TimestepAccessorException("Channels or bands are not ordered in increasing frequency");
-				set.highestFrequency = frequency;
-				++frequencyIterator;
-			}
-		}
-		if(set.lowestFrequency < _highestFrequency)
-			throw TimestepAccessorException("Sub-bands are not given in order of increasing frequency");
-		if(_lowestFrequency == 0.0) _lowestFrequency = set.lowestFrequency;
-		_highestFrequency = set.highestFrequency;
-		
-		// Set some general values
-		set.bandCount = spectralWindowTable.nrow();
-		set.channelsPerBand = (*set.dataColumn)(0).shape()[1];
-		_totalChannelCount += set.bandCount * set.channelsPerBand;
-		if(_totalRowCount == 0)
-			_totalRowCount = set.table->nrow();
-		else
-			if(_totalRowCount != set.table->nrow())
-				throw TimestepAccessorException("Sets do not have equal number of rows");
-
-		closeSet(set);
-	}
-	if(_startRow < _totalRowCount)
-		_currentRow = _startRow;
-	else
-		_currentRow = _totalRowCount;
-	_endRow = _totalRowCount;
-	_bufferSize = 20000;
-	_readBuffer = new BufferItem[_bufferSize];
-	_readBufferPtr = 0;
-	_inReadBuffer = 0;
-	_writeBuffer = new BufferItem[_bufferSize];
-	_inWriteBuffer = 0;
-	for(unsigned i=0;i<_bufferSize;++i)
-	{
-		_readBuffer[i].data.Allocate(_polarizationCount, _totalChannelCount);
-		_writeBuffer[i].data.Allocate(_polarizationCount, _totalChannelCount);
-	}
-	_isOpen = true;
-}
-
-void TimestepAccessor::Close()
-{
-	assertOpen();
-	
-	emptyWriteBuffer();
-	
-	_isOpen = false;
-
-	for(unsigned i=0;i<_bufferSize;++i)
-	{
-		_readBuffer[i].data.Free(_polarizationCount);
-		_writeBuffer[i].data.Free(_polarizationCount);
-	}
-	delete[] _readBuffer;
-	delete[] _writeBuffer;
-}
-
-bool TimestepAccessor::ReadNext(TimestepAccessor::TimestepIndex &index, TimestepAccessor::TimestepData &data)
-{
-	assertOpen();
-
-	if(_readBufferPtr >= _inReadBuffer)
-	{
-		if(!fillReadBuffer())
-			return false;
-	}
-
-	const BufferItem &item = _readBuffer[_readBufferPtr];
-	index.row = item.row;
-	item.data.CopyTo(data, _polarizationCount, _totalChannelCount);
-	
-	++_readBufferPtr;
-	return true;
-}
-
-void TimestepAccessor::openSet(TimestepAccessor::SetInfo &set, bool update)
-{
-	lock(set.index);
-	
-	set.table = 0;
-	do {
-		try {
-			if(update)
-				set.table = new casa::Table(set.path, casa::Table::Update);
-			else
-				set.table = new casa::Table(set.path);
-		} catch(std::exception &e) {
-			std::cout << "WARNING: exception was thrown:\n"
-				<< e.what() << '\n'
-				<< "Will try again in 30 sec.\n";
-			sleep(30);
-			set.table = 0;
-		}
-	} while(set.table == 0);
-	set.antenna1Column = new casa::ROScalarColumn<int>(*set.table, "ANTENNA1");
-	set.antenna2Column = new casa::ROScalarColumn<int>(*set.table, "ANTENNA2");
-	set.timeColumn = new casa::ROScalarColumn<double>(*set.table, "TIME");
-	if(update)
-	{
-		set.dataColumn = 0;
-		set.updateDataColumn = new casa::ArrayColumn<casa::Complex>(*set.table, _columnName);
-	}
-	else
-	{
-		set.dataColumn = new casa::ROArrayColumn<casa::Complex>(*set.table, _columnName);
-		set.updateDataColumn = 0;
-	}
-	set.uvwColumn = new casa::ROArrayColumn<double>(*set.table, "UVW");
-}
-
-void TimestepAccessor::closeSet(TimestepAccessor::SetInfo &set)
-{
-	delete set.antenna1Column;
-	delete set.antenna2Column;
-	delete set.timeColumn;
-	//bool update = set.updateDataColumn != 0;
-	if(set.dataColumn != 0)
-		delete set.dataColumn;
-	if(set.updateDataColumn != 0)
-		delete set.updateDataColumn;
-	delete set.uvwColumn;
-	delete set.table;
-
-	unlock(set.index);
-}
-
-bool TimestepAccessor::fillReadBuffer()
-{
-	if(_currentRow >= _endRow)
-		return false;
-	
-	for(unsigned i=0;i<_bufferSize;++i)
-	{
-		_readBuffer[i].data.timestep = 0.0;
-	}
-	
-	unsigned valIndex = 0;
-	for(SetInfoVector::iterator i=_sets.begin(); i!=_sets.end(); ++i)
-	{
-		SetInfo &set = *i;
-		_inReadBuffer = 0;
-
-		openSet(set);
-		
-		while(_inReadBuffer < _bufferSize && _currentRow + _inReadBuffer < _endRow)
-		{
-			TimestepData &data = _readBuffer[_inReadBuffer].data;
-			unsigned long row = _currentRow + _inReadBuffer;
-			_readBuffer[_inReadBuffer].row = row;
-			
-			// Check timestep & read u,v coordinates & antenna's
-			if(data.timestep == 0.0) {
-				data.timestep = (*set.timeColumn)(row);
-				casa::Array<double> uvwArray = (*set.uvwColumn)(row);
-				casa::Array<double>::const_iterator uvwIterator = uvwArray.begin();
-				data.u = *uvwIterator;
-				++uvwIterator;
-				data.v = *uvwIterator;
-				data.antenna1 = (*set.antenna1Column)(row);
-				data.antenna2 = (*set.antenna2Column)(row);
-			}
-			else {
-				if(data.timestep != ((*set.timeColumn)(row)))
-				  {
-				    std::stringstream s;
-				    bool onlyWarn;
-				    double thisTimestep = (*set.timeColumn)(row);
-				    if(fabs(data.timestep - (*set.timeColumn)(row)) < 1e-3)
-				      onlyWarn = true;
-				    else
-				      onlyWarn = false;
-				    s << "Sets do not have equal time steps; first set has " << data.timestep << " while set " << set.index << " has " << thisTimestep << " (row=" << row << ", difference=" << (data.timestep-thisTimestep) << ")";
-				    if(onlyWarn)
-				      std::cout << "WARNING: " << s.str() << "\nIgnoring difference because it is < 1e-3\n";
-				    else
-				      throw TimestepAccessorException(s.str());
-					
-				  }
-				if(data.antenna1 != (unsigned) ((*set.antenna1Column)(row)))
-					throw TimestepAccessorException("Sets do not have same antenna1 ordering");
-				if(data.antenna2 != (unsigned) ((*set.antenna2Column)(row)))
-					throw TimestepAccessorException("Sets do not have same antenna2 ordering");
-			}
-
-			// Copy data from tables in arrays
-			casa::Array<casa::Complex> dataArray = (*set.dataColumn)(row);
-			casa::Array<casa::Complex>::const_iterator dataIterator = dataArray.begin();
-			unsigned currentIndex = valIndex;
-			for(unsigned f=0;f<set.channelsPerBand;++f)
-			{
-				for(unsigned p=0;p<_polarizationCount;++p)
-				{
-					data.realData[p][currentIndex] = (*dataIterator).real();
-					data.imagData[p][currentIndex] = (*dataIterator).imag();
-					++dataIterator;
-				}
-				++currentIndex;
-			}
-			++_inReadBuffer;
-		}
-		valIndex += set.channelsPerBand;
-
-		closeSet(set);
-	}
-	_currentRow += _inReadBuffer;
-	_readBufferPtr = 0;
-	return true;
-}
-
-
-void TimestepAccessor::Write(TimestepAccessor::TimestepIndex &index, const TimestepAccessor::TimestepData &data)
-{
-	assertOpen();
-
-	if(_inWriteBuffer >= _bufferSize)
-		emptyWriteBuffer();
-	
-	BufferItem &item = _writeBuffer[_inWriteBuffer];
-	data.CopyTo(item.data, _polarizationCount, _totalChannelCount);
-	item.row = index.row;
-	
-	++_inWriteBuffer;
-	++_writeActionCount;
-}
-
-void TimestepAccessor::emptyWriteBuffer()
-{
-	unsigned valIndex = 0;
-	
-	for(SetInfoVector::iterator i=_sets.begin(); i!=_sets.end(); ++i)
-	{
-		SetInfo &set = *i;
-
-		openSet(set, true);
-
-		for(unsigned writeBufferIndex = 0; writeBufferIndex < _inWriteBuffer; ++writeBufferIndex)
-		{
-			const BufferItem &item = _writeBuffer[writeBufferIndex];
-
-			// Copy data from arrays in tables
-			casa::Array<casa::Complex> dataArray = (*set.updateDataColumn)(item.row);
-			casa::Array<casa::Complex>::iterator dataIterator = dataArray.begin();
-			unsigned currentIndex = valIndex;
-			for(unsigned f=0;f<set.channelsPerBand;++f)
-			{
-				for(unsigned p=0;p<_polarizationCount;++p)
-				{
-					(*dataIterator).real(item.data.realData[p][currentIndex]);
-					(*dataIterator).imag(item.data.imagData[p][currentIndex]);
-					++dataIterator;
-				}
-				++currentIndex;
-			}
-			set.updateDataColumn->basePut(item.row, dataArray);
-		}
-		valIndex += set.channelsPerBand;
-
-		closeSet(set);
-	}
-	_inWriteBuffer = 0;
-}
-
-void TimestepAccessor::lock(unsigned setIndex)
-{
-	if(_performLocking)
-	{
-		std::ostringstream s;
-		s << "ssh node079 -C \"~/LOFAR-build/bin/aosynchronisation lock-unique \"" << setIndex << " 2> /dev/null\n";
-		std::string str = s.str();
-		if(system(str.c_str()) != 0)
-			throw std::runtime_error("system() returned nonzero");
-	}
-}
-
-void TimestepAccessor::unlock(unsigned setIndex)
-{
-	if(_performLocking)
-	{
-		std::ostringstream s;
-		s << "ssh node079 -C \"~/LOFAR-build/bin/aosynchronisation release-unique \"" << setIndex << " 2> /dev/null\n";
-		std::string str = s.str();
-		if(system(str.c_str()) != 0)
-			throw std::runtime_error("system() returned nonzero");
-	}
-}
-
diff --git a/CEP/DP3/AOFlagger/src/ns2bbs.cpp b/CEP/DP3/AOFlagger/src/ns2bbs.cpp
deleted file mode 100644
index 43e61651e7684a222bfea549379782c4457da884..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/ns2bbs.cpp
+++ /dev/null
@@ -1,75 +0,0 @@
-#include <iostream>
-#include <vector>
-#include <fstream>
-
-using namespace std;
-
-struct NewStarEntry
-{
-	string name;
-	double I;
-	string RA, DEC;
-	string ID;
-	double Q, U, V;
-	double longSize, shortSize;
-	double PA, SI, RM, reserved;
-};
-
-bool readEntry(istream &stream, struct NewStarEntry &output)
-{
-	string token;
-	stream >> token;
-	if(token == "end") return false;
-	output.name = token;
-	stream
-		>> output.I >> output.RA >> output.DEC >> output.ID >> output.Q >> output.U >> output.V
-		>> output.longSize >> output.shortSize >> output.PA >> output.SI >> output.RM >> output.reserved;
-
-	return true;
-}
-
-int main(int, char *[])
-{
-	cout
-		<< "This program will convert a newstar skymodel to a bbs skymodel.\n"
-		<< "Copy the NewStar-formatted sources to the terminal, end with a line with \"end\":" << endl;
-
-	vector<struct NewStarEntry*> entries;
-	NewStarEntry *entry = new NewStarEntry();
-	while(readEntry(cin, *entry))
-	{
-		entries.push_back(entry);
-		entry = new NewStarEntry();
-	}
-	delete entry;
-
-	string filename;
-	getline(cin, filename); // read garbage (return) after "end"
-
-	cout << "Read " << entries.size() << " entries." << endl;
-	cout << "Name of output file: ";
-	getline(cin, filename);
-	ofstream ostr(filename.c_str());
-
-	ostr <<
-		"############################################################\n"
-		"# " << filename << "\n"
-		"# (Name, Type, Ra, Dec, I, Q, U, V, ReferenceFrequency=’55.468e6’, "
-		"SpectralIndexDegree=’0’, SpectralIndex:0=’0.0’, SpectralIndex:1=’0.0’, "
-		"MajorAxis, MinorAxis, Orientation) = format\n";
-
-	for(vector<struct NewStarEntry*>::iterator i=entries.begin();i!=entries.end();++i)
-	{
-		const NewStarEntry *entry = *i;
-		ostr
-			<< entry->name << ", POINT, " << entry->RA << ", " << entry->DEC << ", "
-			<< (entry->I*0.005) << ", "
-			<< (entry->Q*entry->I*0.01*0.005) << ", "
-			<< (entry->U*entry->I*0.01*0.005) << ", "
-			<< (entry->V*entry->I*0.01*0.005)
-			<< "\n";
-		delete *i;
-	}
-	ostr.close();
-	return 0;
-}
diff --git a/CEP/DP3/AOFlagger/src/quality/histogramcollection.cpp b/CEP/DP3/AOFlagger/src/quality/histogramcollection.cpp
deleted file mode 100644
index 1fbcc2521688405ca2ead619550ca3c1814544ba..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/quality/histogramcollection.cpp
+++ /dev/null
@@ -1,80 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <AOFlagger/quality/histogramcollection.h>
-
-#include <AOFlagger/quality/histogramtablesformatter.h>
-#include <AOFlagger/quality/loghistogram.h>
-
-void HistogramCollection::Save(HistogramTablesFormatter &histogramTables)
-{
-	histogramTables.InitializeEmptyTables();
-	for(size_t p=0;p<_polarizationCount;++p)
-	{
-		LogHistogram totalHistogram;
-		GetTotalHistogramForCrossCorrelations(p, totalHistogram);
-		const unsigned totalIndex = histogramTables.StoreOrQueryTypeIndex(HistogramTablesFormatter::TotalHistogram, p);
-		for(LogHistogram::iterator i=totalHistogram.begin();i!=totalHistogram.end();++i)
-		{
-			histogramTables.StoreValue(totalIndex, i.binStart(), i.binEnd(), i.unnormalizedCount());
-		}
-		
-		LogHistogram rfiHistogram;
-		GetRFIHistogramForCrossCorrelations(p, rfiHistogram);
-		const unsigned rfiIndex = histogramTables.StoreOrQueryTypeIndex(HistogramTablesFormatter::RFIHistogram, p);
-		for(LogHistogram::iterator i=rfiHistogram.begin();i!=rfiHistogram.end();++i)
-		{
-			histogramTables.StoreValue(rfiIndex, i.binStart(), i.binEnd(), i.unnormalizedCount());
-		}
-	}
-}
-
-void HistogramCollection::Load(HistogramTablesFormatter &histogramTables)
-{
-	Clear();
-	for(unsigned p=0;p<_polarizationCount;++p)
-	{
-		const unsigned totalHistogramIndex = histogramTables.QueryTypeIndex(HistogramTablesFormatter::TotalHistogram, p);
-		std::vector<HistogramTablesFormatter::HistogramItem> totalHistogram;
-		histogramTables.QueryHistogram(totalHistogramIndex, totalHistogram);
-		GetTotalHistogram(0, 1, p).SetData(totalHistogram);
-
-		const unsigned rfiHistogramIndex = histogramTables.QueryTypeIndex(HistogramTablesFormatter::RFIHistogram, p);
-		std::vector<HistogramTablesFormatter::HistogramItem> rfiHistogram;
-		histogramTables.QueryHistogram(rfiHistogramIndex, rfiHistogram);
-		GetRFIHistogram(0, 1, p).SetData(rfiHistogram);
-	}
-}
-
-void HistogramCollection::Add(const unsigned antenna1, const unsigned antenna2, const unsigned polarization, Image2DCPtr image, Mask2DCPtr mask)
-{
-	LogHistogram &totalHistogram = GetTotalHistogram(antenna1, antenna2, polarization);
-	LogHistogram &rfiHistogram = GetRFIHistogram(antenna1, antenna2, polarization);
-	
-	for(size_t y=0;y<image->Height();++y)
-	{
-		for(size_t x=0;x<image->Width();++x)
-		{
-			const double amplitude = image->Value(x, y);
-			totalHistogram.Add(amplitude);
-			if(mask->Value(x, y))
-				rfiHistogram.Add(amplitude);
-		}
-	}
-}
diff --git a/CEP/DP3/AOFlagger/src/quality/histogramtablesformatter.cpp b/CEP/DP3/AOFlagger/src/quality/histogramtablesformatter.cpp
deleted file mode 100644
index 43e0e3b6526a8c788dd10fd88c40b415bebbc14b..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/quality/histogramtablesformatter.cpp
+++ /dev/null
@@ -1,247 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#include <AOFlagger/quality/histogramtablesformatter.h>
-
-#include <stdexcept>
-
-#include <ms/MeasurementSets/MSColumns.h>
-
-#include <tables/Tables/ScaColDesc.h>
-#include <tables/Tables/SetupNewTab.h>
-
-#include <measures/TableMeasures/TableMeasDesc.h>
-
-#include <measures/Measures/MEpoch.h>
-
-#include <AOFlagger/quality/statisticalvalue.h>
-
-const std::string HistogramTablesFormatter::ColumnNameType      = "TYPE";
-const std::string HistogramTablesFormatter::ColumnNameName      = "NAME";
-const std::string HistogramTablesFormatter::ColumnNameCount     = "COUNT";
-const std::string HistogramTablesFormatter::ColumnNamePolarization = "POLARIZATION";
-const std::string HistogramTablesFormatter::ColumnNameBinStart  = "BIN_START";
-const std::string HistogramTablesFormatter::ColumnNameBinEnd    = "BIN_END";
-
-unsigned HistogramTablesFormatter::QueryTypeIndex(enum HistogramType type, unsigned polarizationIndex)
-{
-	unsigned kindIndex;
-	if(!QueryTypeIndex(type, polarizationIndex, kindIndex))
-		throw std::runtime_error("getKindIndex(): Requested statistic kind not available.");
-	return kindIndex;
-}
-
-bool HistogramTablesFormatter::QueryTypeIndex(enum HistogramType type, unsigned polarizationIndex, unsigned &destTypeIndex)
-{
-	openTypeTable(false);
-	casa::ROScalarColumn<int> typeColumn(*_typeTable, ColumnNameType);
-	casa::ROScalarColumn<int> polarizationColumn(*_typeTable, ColumnNamePolarization);
-	casa::ROScalarColumn<casa::String> nameColumn(*_typeTable, ColumnNameName);
-	const casa::String nameToFind(TypeToName(type));
-	
-	const unsigned nrRow = _typeTable->nrow();
-	
-	for(unsigned i=0;i<nrRow;++i)
-	{
-		if((unsigned) polarizationColumn(i) == polarizationIndex && nameColumn(i) == nameToFind)
-		{
-			destTypeIndex = typeColumn(i);
-			return true;
-		}
-	}
-	return false;
-}
-
-bool HistogramTablesFormatter::hasOneEntry(unsigned typeIndex)
-{
-	casa::Table &casaTable = getTable(HistogramCountTable, false);
-	casa::ROScalarColumn<int> typeColumn(casaTable, ColumnNameType);
-	
-	const unsigned nrRow = casaTable.nrow();
-	
-	for(unsigned i=0;i<nrRow;++i)
-	{
-		if(typeColumn(i) == (int) typeIndex)
-			return true;
-	}
-	return false;
-}
-
-void HistogramTablesFormatter::createTypeTable()
-{
-	casa::TableDesc tableDesc(TypeTableName() + "_TYPE", "1.0", casa::TableDesc::Scratch);
-	tableDesc.comment() = "Couples the TYPE column in the QUALITY_HISTOGRAM_COUNT table to the name and polarization of the histogram";
-	tableDesc.addColumn(casa::ScalarColumnDesc<int>(ColumnNameType, "Index of the statistic kind"));
-	tableDesc.addColumn(casa::ScalarColumnDesc<int>(ColumnNamePolarization, "Index of the polarization corresponding to the main table"));
-	tableDesc.addColumn(casa::ScalarColumnDesc<casa::String>(ColumnNameName, "Name of the statistic"));
-
-	casa::SetupNewTable newTableSetup(TableFilename(HistogramTypeTable), tableDesc, casa::Table::New);
-	casa::Table newTable(newTableSetup);
-	openMainTable(true);
-	_measurementSet->rwKeywordSet().defineTable(TypeTableName(), newTable);
-}
-
-void HistogramTablesFormatter::createCountTable()
-{
-	casa::TableDesc tableDesc(CountTableName() + "_TYPE", "1.0", casa::TableDesc::Scratch);
-	tableDesc.comment() = "Histograms of the data in the main table";
-	tableDesc.addColumn(casa::ScalarColumnDesc<int>(ColumnNameType, "Index of the statistic kind"));
-	tableDesc.addColumn(casa::ScalarColumnDesc<double>(ColumnNameBinStart, "Lower start value of the bin corresponding to the count"));
-	tableDesc.addColumn(casa::ScalarColumnDesc<double>(ColumnNameBinEnd, "Higher end value of the bin corresponding to the count"));
-	tableDesc.addColumn(casa::ScalarColumnDesc<double>(ColumnNameCount, "Histogram y-value"));
-
-	casa::SetupNewTable newTableSetup(TableFilename(HistogramCountTable), tableDesc, casa::Table::New);
-	casa::Table newTable(newTableSetup);
-	openMainTable(true);
-	_measurementSet->rwKeywordSet().defineTable(CountTableName(), newTable);
-}
-
-unsigned HistogramTablesFormatter::StoreType(enum HistogramType type, unsigned polarizationIndex)
-{
-	openTypeTable(true);
-	
-	unsigned typeIndex = findFreeTypeIndex(*_typeTable);
-	
-	unsigned newRow = _typeTable->nrow();
-	_typeTable->addRow();
-	casa::ScalarColumn<int> typeColumn(*_typeTable, ColumnNameType);
-	casa::ScalarColumn<int> polarizationColumn(*_typeTable, ColumnNamePolarization);
-	casa::ScalarColumn<casa::String> nameColumn(*_typeTable, ColumnNameName);
-	typeColumn.put(newRow, typeIndex);
-	polarizationColumn.put(newRow, polarizationIndex);
-	nameColumn.put(newRow, TypeToName(type));
-	return typeIndex;
-}
-
-unsigned HistogramTablesFormatter::findFreeTypeIndex(casa::Table &typeTable)
-{
-	int maxIndex = 0;
-	
-	casa::ROScalarColumn<int> typeColumn(typeTable, ColumnNameType);
-	
-	const unsigned nrRow = typeTable.nrow();
-	
-	for(unsigned i=0;i<nrRow;++i)
-	{
-		if(typeColumn(i) > maxIndex)
-			maxIndex = typeColumn(i);
-	}
-	return maxIndex + 1;
-}
-
-void HistogramTablesFormatter::openTable(enum TableKind table, bool needWrite, casa::Table **tablePtr)
-{
-	if(*tablePtr == 0)
-	{
-		openMainTable(false);
-		*tablePtr = new casa::Table(_measurementSet->keywordSet().asTable(TableName(table)));
-		if(needWrite)
-			(*tablePtr)->reopenRW();
-	} else {
-		if(needWrite && !(*tablePtr)->isWritable())
-			(*tablePtr)->reopenRW();
-	}
-}
-
-void HistogramTablesFormatter::StoreValue(unsigned typeIndex, double binStart, double binEnd, double count)
-{
-	openCountTable(true);
-	
-	unsigned newRow = _countTable->nrow();
-	_countTable->addRow();
-	
-	casa::ScalarColumn<int> typeColumn(*_countTable, ColumnNameType);
-	casa::ScalarColumn<double> binStartColumn(*_countTable, ColumnNameBinStart);
-	casa::ScalarColumn<double> binEndColumn(*_countTable, ColumnNameBinEnd);
-	casa::ScalarColumn<double> countColumn(*_countTable, ColumnNameCount);
-	
-	typeColumn.put(newRow, typeIndex);
-	binStartColumn.put(newRow, binStart);
-	binEndColumn.put(newRow, binEnd);
-	countColumn.put(newRow, count);
-}
-
-void HistogramTablesFormatter::removeTypeEntry(enum HistogramType type, unsigned polarizationIndex)
-{
-	openTypeTable(true);
-	casa::ScalarColumn<int> polarizationColumn(*_typeTable, ColumnNamePolarization);
-	casa::ScalarColumn<casa::String> nameColumn(*_typeTable, ColumnNameName);
-	
-	const unsigned nrRow = _typeTable->nrow();
-	const casa::String typeName(TypeToName(type));
-	
-	for(unsigned i=0;i<nrRow;++i)
-	{
-		if(nameColumn(i) == typeName && (unsigned) polarizationColumn(i) ==  polarizationIndex)
-		{
-			_typeTable->removeRow(i);
-			break;
-		}
-	}
-}
-
-void HistogramTablesFormatter::removeEntries(enum TableKind table)
-{
-	casa::Table &casaTable = getTable(table, true);
-	const unsigned nrRow = casaTable.nrow();
-	for(int i=nrRow-1;i>=0;--i)
-	{
-		casaTable.removeRow(i);
-	}
-}
-
-void HistogramTablesFormatter::QueryHistogram(unsigned typeIndex, std::vector<HistogramItem> &histogram)
-{
-	casa::Table &table(getTable(HistogramCountTable, false));
-	const unsigned nrRow = table.nrow();
-	
-	casa::ROScalarColumn<int> typeColumn(table, ColumnNameType);
-	casa::ROScalarColumn<double> binStartColumn(table, ColumnNameBinStart);
-	casa::ROScalarColumn<double> binEndColumn(table, ColumnNameBinEnd);
-	casa::ROScalarColumn<double> countColumn(table, ColumnNameCount);
-	
-	for(unsigned i=0;i<nrRow;++i)
-	{
-		if(typeColumn(i) == (int) typeIndex)
-		{
-			HistogramItem item;
-			item.binStart = binStartColumn(i);
-			item.binEnd = binEndColumn(i);
-			item.count = countColumn(i);
-			histogram.push_back(item);
-		}
-	}
-}
-
-void HistogramTablesFormatter::openMainTable(bool needWrite)
-{
-	if(_measurementSet == 0)
-	{
-		if(needWrite)
-			_measurementSet = new casa::Table(_measurementSetName, casa::Table::Update);
-		else
-			_measurementSet = new casa::Table(_measurementSetName);
-	}
-	else if(needWrite)
-	{
-		if(!_measurementSet->isWritable())
-			_measurementSet->reopenRW();
-	}
-}
diff --git a/CEP/DP3/AOFlagger/src/quality/qualitytablesformatter.cpp b/CEP/DP3/AOFlagger/src/quality/qualitytablesformatter.cpp
deleted file mode 100644
index c78ef8054b005fa1f37597ad207d1ad0889181bc..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/quality/qualitytablesformatter.cpp
+++ /dev/null
@@ -1,594 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#include <AOFlagger/quality/qualitytablesformatter.h>
-
-#include <stdexcept>
-#include <set>
-
-#include <ms/MeasurementSets/MSColumns.h>
-
-#include <tables/Tables/ArrColDesc.h>
-#include <tables/Tables/ScaColDesc.h>
-#include <tables/Tables/SetupNewTab.h>
-
-#include <measures/TableMeasures/TableMeasDesc.h>
-
-#include <measures/Measures/MEpoch.h>
-
-#include <AOFlagger/quality/statisticalvalue.h>
-
-const std::string QualityTablesFormatter::_kindToNameTable[] =
-{
-	"Count", "Sum", "Mean", "RFICount", "RFISum", "RFIMean", "RFIRatio", "RFIPercentage", "FlaggedCount", "FlaggedRatio", "SumP2", "SumP3", "SumP4", "Variance", "VarianceOfVariance", "StandardDeviation", "Skewness", "Kurtosis", "SignalToNoise", "DSum", "DMean", "DSumP2", "DSumP3", "DSumP4", "DVariance", "DVarianceOfVariance", "DStandardDeviation", "DCount", "BadSolutionCount", "CorrectCount", "CorrectedMean", "CorrectedSumP2", "CorrectedDCount", "CorrectedDMean", "CorrectedDSumP2", "FTSum", "FTSumP2"
-};
-
-const std::string QualityTablesFormatter::_tableToNameTable[] =
-{
-	"QUALITY_KIND_NAME",
-	"QUALITY_TIME_STATISTIC",
-	"QUALITY_FREQUENCY_STATISTIC",
-	"QUALITY_BASELINE_STATISTIC",
-	"QUALITY_BASELINE_TIME_STATISTIC"
-};
-
-const enum QualityTablesFormatter::QualityTable QualityTablesFormatter::_dimensionToTableTable[] =
-{
-	TimeStatisticTable,
-	FrequencyStatisticTable,
-	BaselineStatisticTable,
-	BaselineTimeStatisticTable
-};
-
-const std::string QualityTablesFormatter::ColumnNameAntenna1  = "ANTENNA1";
-const std::string QualityTablesFormatter::ColumnNameAntenna2  = "ANTENNA2";
-const std::string QualityTablesFormatter::ColumnNameFrequency = "FREQUENCY";
-const std::string QualityTablesFormatter::ColumnNameKind      = "KIND";
-const std::string QualityTablesFormatter::ColumnNameName      = "NAME";
-const std::string QualityTablesFormatter::ColumnNameTime      = "TIME";
-const std::string QualityTablesFormatter::ColumnNameValue     = "VALUE";
-
-enum QualityTablesFormatter::StatisticKind QualityTablesFormatter::NameToKind(const std::string &kindName)
-{
-	for(unsigned i=0;i<37;++i)
-	{
-		if(kindName == _kindToNameTable[i])
-			return (QualityTablesFormatter::StatisticKind) i;
-	}
-	throw std::runtime_error("Statistics kind not known");
-}
-
-unsigned QualityTablesFormatter::QueryKindIndex(enum StatisticKind kind)
-{
-	unsigned kindIndex;
-	if(!QueryKindIndex(kind, kindIndex))
-		throw std::runtime_error("getKindIndex(): Requested statistic kind not available.");
-	return kindIndex;
-}
-
-bool QualityTablesFormatter::QueryKindIndex(enum StatisticKind kind, unsigned &destKindIndex)
-{
-	openKindNameTable(false);
-	casa::ROScalarColumn<int> kindColumn(*_kindNameTable, ColumnNameKind);
-	casa::ROScalarColumn<casa::String> nameColumn(*_kindNameTable, ColumnNameName);
-	const casa::String nameToFind(KindToName(kind));
-	
-	const unsigned nrRow = _kindNameTable->nrow();
-	
-	for(unsigned i=0;i<nrRow;++i)
-	{
-		if(nameColumn(i) == nameToFind)
-		{
-			destKindIndex = kindColumn(i);
-			return true;
-		}
-	}
-	return false;
-}
-
-bool QualityTablesFormatter::hasOneEntry(enum QualityTable table, unsigned kindIndex)
-{
-	casa::Table &casaTable = getTable(table, false);
-	casa::ROScalarColumn<int> kindColumn(casaTable, ColumnNameKind);
-	
-	const unsigned nrRow = casaTable.nrow();
-	
-	for(unsigned i=0;i<nrRow;++i)
-	{
-		if(kindColumn(i) == (int) kindIndex)
-			return true;
-	}
-	return false;
-}
-
-/**
- * Will add an empty table to the measurement set named "QUALITY_KIND_NAME" and
- * initialize its default column.
- * This table can hold a list of quality statistic types that are referred to in
- * the statistic value tables.
- */
-void QualityTablesFormatter::createKindNameTable()
-{
-	casa::TableDesc tableDesc("QUALITY_KIND_NAME_TYPE", QUALITY_TABLES_VERSION_STR, casa::TableDesc::Scratch);
-	tableDesc.comment() = "Couples the KIND column in the other quality tables to the name of a statistic (e.g. Mean)";
-	tableDesc.addColumn(casa::ScalarColumnDesc<int>(ColumnNameKind, "Index of the statistic kind"));
-	tableDesc.addColumn(casa::ScalarColumnDesc<casa::String>(ColumnNameName, "Name of the statistic"));
-
-	casa::SetupNewTable newTableSetup(TableToFilename(KindNameTable), tableDesc, casa::Table::New);
-	casa::Table newTable(newTableSetup);
-	openMainTable(true);
-	_measurementSet->rwKeywordSet().defineTable(TableToName(KindNameTable), newTable);
-}
-
-/**
- * Add the time column to the table descriptor. Used by create..Table() methods.
- * It holds "Measure"s of time, which is what casacore defines as a value including
- * a unit and a reference frame.
- */
-void QualityTablesFormatter::addTimeColumn(casa::TableDesc &tableDesc)
-{
-	casa::ScalarColumnDesc<double> timeDesc(ColumnNameTime, "Central time of statistic");
-	tableDesc.addColumn(timeDesc);
-	
-	casa::TableMeasRefDesc measRef(casa::MEpoch::UTC);
-	casa::TableMeasValueDesc measVal(tableDesc, ColumnNameTime);
-	casa::TableMeasDesc<casa::MEpoch> mepochCol(measVal, measRef);
-	mepochCol.write(tableDesc);
-}
-
-/**
- * Add the frequency column to the table descriptor. Used by create..Table() methods.
- * It holds "Quantum"s of frequency, which is what casacore defines as a value including
- * a unit (Hertz).
- */
-void QualityTablesFormatter::addFrequencyColumn(casa::TableDesc &tableDesc)
-{
-	casa::ScalarColumnDesc<double> freqDesc(ColumnNameFrequency, "Central frequency of statistic bin");
-	tableDesc.addColumn(freqDesc);
-	
-	casa::Unit hertzUnit("Hz");
-	
-	casa::TableQuantumDesc quantDesc(tableDesc, ColumnNameFrequency, hertzUnit);
-	quantDesc.write(tableDesc);
-}
-
-/**
- * Add value column to the table descriptor. Used by create..Table() methods.
- * It consist of an array of statistics, each element holds a polarization.
- */
-void QualityTablesFormatter::addValueColumn(casa::TableDesc &tableDesc, unsigned polarizationCount)
-{
-	casa::IPosition shape(1);
-	shape[0] = polarizationCount;
-	casa::ArrayColumnDesc<casa::Complex> valDesc(ColumnNameValue, "Value of statistic", shape, casa::ColumnDesc::Direct);
-	tableDesc.addColumn(valDesc);
-}
-
-/**
- * Will add an empty table to the measurement set named "QUALITY_TIME_STATISTIC" and
- * initialize its default column.
- * This table can hold several statistic kinds per time step. 
- * @param polarizationCount specifies the nr polarizations. This is required for the
- * shape of the value column.
- */
-void QualityTablesFormatter::createTimeStatisticTable(unsigned polarizationCount)
-{
-	casa::TableDesc tableDesc("QUALITY_TIME_STATISTIC_TYPE", QUALITY_TABLES_VERSION_STR, casa::TableDesc::Scratch);
-	tableDesc.comment() = "Statistics over time";
-	
-	addTimeColumn(tableDesc);
-	addFrequencyColumn(tableDesc);
-	tableDesc.addColumn(casa::ScalarColumnDesc<int>(ColumnNameKind, "Index of the statistic kind"));
-	addValueColumn(tableDesc, polarizationCount);
-
-	casa::SetupNewTable newTableSetup(TableToFilename(TimeStatisticTable), tableDesc, casa::Table::New);
-	casa::Table newTable(newTableSetup);
-	openMainTable(true);
-	_measurementSet->rwKeywordSet().defineTable(TableToName(TimeStatisticTable), newTable);
-}
-
-/**
- * Will add an empty table to the measurement set named "QUALITY_FREQUENCY_STATISTIC" and
- * initialize its default column.
- * This table can hold several statistic kinds per time step. 
- * @param polarizationCount specifies the nr polarizations. This is required for the
- * shape of the value column.
- */
-void QualityTablesFormatter::createFrequencyStatisticTable(unsigned polarizationCount)
-{
-	casa::TableDesc tableDesc("QUALITY_FREQUENCY_STATISTIC_TYPE", QUALITY_TABLES_VERSION_STR, casa::TableDesc::Scratch);
-	tableDesc.comment() = "Statistics over frequency";
-	
-	addFrequencyColumn(tableDesc);
-	tableDesc.addColumn(casa::ScalarColumnDesc<int>(ColumnNameKind, "Index of the statistic kind"));
-	addValueColumn(tableDesc, polarizationCount);
-
-	casa::SetupNewTable newTableSetup(TableToFilename(FrequencyStatisticTable), tableDesc, casa::Table::New);
-	casa::Table newTable(newTableSetup);
-	openMainTable(true);
-	_measurementSet->rwKeywordSet().defineTable(TableToName(FrequencyStatisticTable), newTable);
-}
-
-/**
- * Will add an empty table to the measurement set named "QUALITY_BASELINE_STATISTIC" and
- * initialize its default column.
- * This table can hold several statistic kinds per time step. 
- * @param polarizationCount specifies the nr polarizations. This is required for the
- * shape of the value column.
- */
-void QualityTablesFormatter::createBaselineStatisticTable(unsigned polarizationCount)
-{
-	casa::TableDesc tableDesc("QUALITY_BASELINE_STATISTIC_TYPE", QUALITY_TABLES_VERSION_STR, casa::TableDesc::Scratch);
-	tableDesc.comment() = "Statistics per baseline";
-	
-	tableDesc.addColumn(casa::ScalarColumnDesc<int>(ColumnNameAntenna1, "Index of first antenna"));
-	tableDesc.addColumn(casa::ScalarColumnDesc<int>(ColumnNameAntenna2, "Index of second antenna"));
-	addFrequencyColumn(tableDesc);
-	tableDesc.addColumn(casa::ScalarColumnDesc<int>(ColumnNameKind, "Index of the statistic kind"));
-	addValueColumn(tableDesc, polarizationCount);
-
-	casa::SetupNewTable newTableSetup(TableToFilename(BaselineStatisticTable), tableDesc, casa::Table::New);
-	casa::Table newTable(newTableSetup);
-	openMainTable(true);
-	_measurementSet->rwKeywordSet().defineTable(TableToName(BaselineStatisticTable), newTable);
-}
-
-void QualityTablesFormatter::createBaselineTimeStatisticTable(unsigned polarizationCount)
-{
-	casa::TableDesc tableDesc("QUALITY_BASELINE_TIME_STATISTIC_TYPE", QUALITY_TABLES_VERSION_STR, casa::TableDesc::Scratch);
-	tableDesc.comment() = "Statistics per baseline";
-	
-	addTimeColumn(tableDesc);
-	tableDesc.addColumn(casa::ScalarColumnDesc<int>(ColumnNameAntenna1, "Index of first antenna"));
-	tableDesc.addColumn(casa::ScalarColumnDesc<int>(ColumnNameAntenna2, "Index of second antenna"));
-	addFrequencyColumn(tableDesc);
-	tableDesc.addColumn(casa::ScalarColumnDesc<int>(ColumnNameKind, "Index of the statistic kind"));
-	addValueColumn(tableDesc, polarizationCount);
-
-	casa::SetupNewTable newTableSetup(TableToFilename(BaselineTimeStatisticTable), tableDesc, casa::Table::New);
-	casa::Table newTable(newTableSetup);
-	openMainTable(true);
-	_measurementSet->rwKeywordSet().defineTable(TableToName(BaselineTimeStatisticTable), newTable);
-}
-
-unsigned QualityTablesFormatter::StoreKindName(const std::string &name)
-{
-	// This should be done atomically, but two quality writers in the same table would be
-	// a weird thing to do anyway, plus I don't know how the casa tables can be made atomic
-	// (and still have good performance).
-	
-	openKindNameTable(true);
-	
-	unsigned kindIndex = findFreeKindIndex(*_kindNameTable);
-	
-	unsigned newRow = _kindNameTable->nrow();
-	_kindNameTable->addRow();
-	casa::ScalarColumn<int> kindColumn(*_kindNameTable, ColumnNameKind);
-	casa::ScalarColumn<casa::String> nameColumn(*_kindNameTable, ColumnNameName);
-	kindColumn.put(newRow, kindIndex);
-	nameColumn.put(newRow, name);
-	return kindIndex;
-}
-
-unsigned QualityTablesFormatter::findFreeKindIndex(casa::Table &kindTable)
-{
-	int maxIndex = 0;
-	
-	casa::ROScalarColumn<int> kindColumn(kindTable, ColumnNameKind);
-	
-	const unsigned nrRow = kindTable.nrow();
-	
-	for(unsigned i=0;i<nrRow;++i)
-	{
-		if(kindColumn(i) > maxIndex)
-			maxIndex = kindColumn(i);
-	}
-	return maxIndex + 1;
-}
-
-void QualityTablesFormatter::openTable(QualityTable table, bool needWrite, casa::Table **tablePtr)
-{
-	if(*tablePtr == 0)
-	{
-		openMainTable(false);
-		*tablePtr = new casa::Table(_measurementSet->keywordSet().asTable(TableToName(table)));
-		if(needWrite)
-			(*tablePtr)->reopenRW();
-	} else {
-		if(needWrite && !(*tablePtr)->isWritable())
-			(*tablePtr)->reopenRW();
-	}
-}
-
-void QualityTablesFormatter::StoreTimeValue(double time, double frequency, const StatisticalValue &value)
-{
-	openTimeTable(true);
-	
-	unsigned newRow = _timeTable->nrow();
-	_timeTable->addRow();
-	
-	// TODO maybe the columns need to be cached to avoid having to look them up for each store...
-	casa::ScalarColumn<double> timeColumn(*_timeTable, ColumnNameTime);
-	casa::ScalarColumn<double> frequencyColumn(*_timeTable, ColumnNameFrequency);
-	casa::ScalarColumn<int> kindColumn(*_timeTable, ColumnNameKind);
-	casa::ArrayColumn<casa::Complex> valueColumn(*_timeTable, ColumnNameValue);
-	
-	timeColumn.put(newRow, time);
-	frequencyColumn.put(newRow, frequency);
-	kindColumn.put(newRow, value.KindIndex());
-	casa::Vector<casa::Complex> data(value.PolarizationCount());
-	for(unsigned i=0;i<value.PolarizationCount();++i)
-		data[i] = value.Value(i);
-	valueColumn.put(newRow, data);
-}
-
-void QualityTablesFormatter::StoreFrequencyValue(double frequency, const StatisticalValue &value)
-{
-	openFrequencyTable(true);
-	
-	unsigned newRow = _frequencyTable->nrow();
-	_frequencyTable->addRow();
-	
-	casa::ScalarColumn<double> frequencyColumn(*_frequencyTable, ColumnNameFrequency);
-	casa::ScalarColumn<int> kindColumn(*_frequencyTable, ColumnNameKind);
-	casa::ArrayColumn<casa::Complex> valueColumn(*_frequencyTable, ColumnNameValue);
-	
-	frequencyColumn.put(newRow, frequency);
-	kindColumn.put(newRow, value.KindIndex());
-	casa::Vector<casa::Complex> data(value.PolarizationCount());
-	for(unsigned i=0;i<value.PolarizationCount();++i)
-		data[i] = value.Value(i);
-	valueColumn.put(newRow, data);
-}
-
-void QualityTablesFormatter::StoreBaselineValue(unsigned antenna1, unsigned antenna2, double frequency, const StatisticalValue &value)
-{
-	openBaselineTable(true);
-	
-	unsigned newRow = _baselineTable->nrow();
-	_baselineTable->addRow();
-	
-	casa::ScalarColumn<int> antenna1Column(*_baselineTable, ColumnNameAntenna1);
-	casa::ScalarColumn<int> antenna2Column(*_baselineTable, ColumnNameAntenna2);
-	casa::ScalarColumn<double> frequencyColumn(*_baselineTable, ColumnNameFrequency);
-	casa::ScalarColumn<int> kindColumn(*_baselineTable, ColumnNameKind);
-	casa::ArrayColumn<casa::Complex> valueColumn(*_baselineTable, ColumnNameValue);
-	
-	antenna1Column.put(newRow, antenna1);
-	antenna2Column.put(newRow, antenna2);
-	frequencyColumn.put(newRow, frequency);
-	kindColumn.put(newRow, value.KindIndex());
-	casa::Vector<casa::Complex> data(value.PolarizationCount());
-	for(unsigned i=0;i<value.PolarizationCount();++i)
-		data[i] = value.Value(i);
-	valueColumn.put(newRow, data);
-}
-
-void QualityTablesFormatter::StoreBaselineTimeValue(unsigned antenna1, unsigned antenna2, double time, double frequency, const StatisticalValue &value)
-{
-	openBaselineTimeTable(true);
-	
-	unsigned newRow = _baselineTimeTable->nrow();
-	_baselineTimeTable->addRow();
-	
-	casa::ScalarColumn<double> timeColumn(*_baselineTimeTable, ColumnNameTime);
-	casa::ScalarColumn<int> antenna1Column(*_baselineTimeTable, ColumnNameAntenna1);
-	casa::ScalarColumn<int> antenna2Column(*_baselineTimeTable, ColumnNameAntenna2);
-	casa::ScalarColumn<double> frequencyColumn(*_baselineTimeTable, ColumnNameFrequency);
-	casa::ScalarColumn<int> kindColumn(*_baselineTimeTable, ColumnNameKind);
-	casa::ArrayColumn<casa::Complex> valueColumn(*_baselineTimeTable, ColumnNameValue);
-	
-	timeColumn.put(newRow, time);
-	antenna1Column.put(newRow, antenna1);
-	antenna2Column.put(newRow, antenna2);
-	frequencyColumn.put(newRow, frequency);
-	kindColumn.put(newRow, value.KindIndex());
-	casa::Vector<casa::Complex> data(value.PolarizationCount());
-	for(unsigned i=0;i<value.PolarizationCount();++i)
-		data[i] = value.Value(i);
-	valueColumn.put(newRow, data);
-}
-
-void QualityTablesFormatter::removeStatisticFromStatTable(enum QualityTable qualityTable, enum StatisticKind kind)
-{
-	unsigned kindIndex;
-	if(QueryKindIndex(kind, kindIndex))
-	{
-		casa::Table &table = getTable(qualityTable, true);
-		casa::ScalarColumn<int> kindColumn(table, ColumnNameKind);
-
-		unsigned nrRow = table.nrow();
-
-		for(unsigned i=0;i<nrRow;++i)
-		{
-			while(i<nrRow && kindColumn(i) == (int) kindIndex)
-			{
-				table.removeRow(i);
-				--nrRow;
-			}
-		}
-	}
-}
-
-void QualityTablesFormatter::removeKindNameEntry(enum StatisticKind kind)
-{
-	openKindNameTable(true);
-	casa::ScalarColumn<casa::String> nameColumn(*_kindNameTable, ColumnNameName);
-	
-	const unsigned nrRow = _kindNameTable->nrow();
-	const casa::String kindName(KindToName(kind));
-	
-	for(unsigned i=0;i<nrRow;++i)
-	{
-		if(nameColumn(i) == kindName)
-		{
-			_kindNameTable->removeRow(i);
-			break;
-		}
-	}
-}
-
-void QualityTablesFormatter::removeEntries(enum QualityTable table)
-{
-	casa::Table &casaTable = getTable(table, true);
-	const unsigned nrRow = casaTable.nrow();
-	for(int i=nrRow-1;i>=0;--i)
-	{
-		casaTable.removeRow(i);
-	}
-}
-
-unsigned QualityTablesFormatter::QueryStatisticEntryCount(enum StatisticDimension dimension, unsigned kindIndex)
-{
-	casa::Table &casaTable(getTable(DimensionToTable(dimension), false));
-	casa::ROScalarColumn<int> kindColumn(casaTable, ColumnNameKind);
-	
-	const unsigned nrRow = casaTable.nrow();
-	size_t count = 0;
-	
-	for(unsigned i=0;i<nrRow;++i)
-	{
-		if(kindColumn(i) == (int) kindIndex)
-			++count;
-	}
-	return count;
-}
-
-unsigned QualityTablesFormatter::GetPolarizationCount()
-{
-	casa::Table &table(getTable(TimeStatisticTable, false));
-	casa::ROArrayColumn<casa::Complex> valueColumn(table, ColumnNameValue);
-	return valueColumn.columnDesc().shape()[0];
-}
-
-void QualityTablesFormatter::QueryTimeStatistic(unsigned kindIndex, std::vector<std::pair<TimePosition, StatisticalValue> > &entries)
-{
-	casa::Table &table(getTable(TimeStatisticTable, false));
-	const unsigned nrRow = table.nrow();
-	
-	casa::ROScalarColumn<double> timeColumn(table, ColumnNameTime);
-	casa::ROScalarColumn<double> frequencyColumn(table, ColumnNameFrequency);
-	casa::ROScalarColumn<int> kindColumn(table, ColumnNameKind);
-	casa::ROArrayColumn<casa::Complex> valueColumn(table, ColumnNameValue);
-	
-	int polarizationCount = valueColumn.columnDesc().shape()[0];
-	
-	for(unsigned i=0;i<nrRow;++i)
-	{
-		if(kindColumn(i) == (int) kindIndex)
-		{
-			StatisticalValue value(polarizationCount);
-			value.SetKindIndex(kindIndex);
-			casa::Array<casa::Complex> valueArray = valueColumn(i);
-			casa::Array<casa::Complex>::iterator iter = valueArray.begin();
-			for(int p=0;p<polarizationCount;++p)
-			{
-				value.SetValue(p, *iter);
-				++iter;
-			}
-			TimePosition position;
-			position.time = timeColumn(i);
-			position.frequency = frequencyColumn(i);
-			entries.push_back(std::pair<TimePosition, StatisticalValue>(position, value));
-		}
-	}
-}
-
-void QualityTablesFormatter::QueryFrequencyStatistic(unsigned kindIndex, std::vector<std::pair<FrequencyPosition, StatisticalValue> > &entries)
-{
-	casa::Table &table(getTable(FrequencyStatisticTable, false));
-	const unsigned nrRow = table.nrow();
-	
-	casa::ROScalarColumn<double> frequencyColumn(table, ColumnNameFrequency);
-	casa::ROScalarColumn<int> kindColumn(table, ColumnNameKind);
-	casa::ROArrayColumn<casa::Complex> valueColumn(table, ColumnNameValue);
-	
-	int polarizationCount = valueColumn.columnDesc().shape()[0];
-	
-	for(unsigned i=0;i<nrRow;++i)
-	{
-		if(kindColumn(i) == (int) kindIndex)
-		{
-			StatisticalValue value(polarizationCount);
-			value.SetKindIndex(kindIndex);
-			casa::Array<casa::Complex> valueArray = valueColumn(i);
-			casa::Array<casa::Complex>::iterator iter = valueArray.begin();
-			for(int p=0;p<polarizationCount;++p)
-			{
-				value.SetValue(p, *iter);
-				++iter;
-			}
-			FrequencyPosition position;
-			position.frequency = frequencyColumn(i);
-			entries.push_back(std::pair<FrequencyPosition, StatisticalValue>(position, value));
-		}
-	}
-}
-
-void QualityTablesFormatter::QueryBaselineStatistic(unsigned kindIndex, std::vector<std::pair<BaselinePosition, StatisticalValue> > &entries)
-{
-	casa::Table &table(getTable(BaselineStatisticTable, false));
-	const unsigned nrRow = table.nrow();
-	
-	casa::ROScalarColumn<int> antenna1Column(table, ColumnNameAntenna1);
-	casa::ROScalarColumn<int> antenna2Column(table, ColumnNameAntenna2);
-	casa::ROScalarColumn<double> frequencyColumn(table, ColumnNameFrequency);
-	casa::ROScalarColumn<int> kindColumn(table, ColumnNameKind);
-	casa::ROArrayColumn<casa::Complex> valueColumn(table, ColumnNameValue);
-	
-	int polarizationCount = valueColumn.columnDesc().shape()[0];
-	
-	for(unsigned i=0;i<nrRow;++i)
-	{
-		if(kindColumn(i) == (int) kindIndex)
-		{
-			StatisticalValue value(polarizationCount);
-			value.SetKindIndex(kindIndex);
-			casa::Array<casa::Complex> valueArray = valueColumn(i);
-			casa::Array<casa::Complex>::iterator iter = valueArray.begin();
-			for(int p=0;p<polarizationCount;++p)
-			{
-				value.SetValue(p, *iter);
-				++iter;
-			}
-			BaselinePosition position;
-			position.antenna1 = antenna1Column(i);
-			position.antenna2 = antenna2Column(i);
-			position.frequency = frequencyColumn(i);
-			entries.push_back(std::pair<BaselinePosition, StatisticalValue>(position, value));
-		}
-	}
-}
-
-void QualityTablesFormatter::openMainTable(bool needWrite)
-{
-	if(_measurementSet == 0)
-	{
-		if(needWrite)
-			_measurementSet = new casa::Table(_measurementSetName, casa::Table::Update);
-		else
-			_measurementSet = new casa::Table(_measurementSetName);
-	}
-	else if(needWrite)
-	{
-		if(!_measurementSet->isWritable())
-			_measurementSet->reopenRW();
-	}
-}
diff --git a/CEP/DP3/AOFlagger/src/quality/rayleighfitter.cpp b/CEP/DP3/AOFlagger/src/quality/rayleighfitter.cpp
deleted file mode 100644
index 175d18244319ff61c7fe9c94a38984120dd98815..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/quality/rayleighfitter.cpp
+++ /dev/null
@@ -1,223 +0,0 @@
-#include <AOFlagger/quality/rayleighfitter.h>
-
-#include <lofar_config.h>
-
-#include <iostream>
-
-#ifdef HAVE_GSL
-
-#include <gsl/gsl_vector.h>
-#include <gsl/gsl_blas.h>
-#include <gsl/gsl_multifit_nlin.h>
-
-static int fit_f(const gsl_vector *xvec, void *data, gsl_vector *f)
-{
-	const double sigma = gsl_vector_get(xvec, 0);
-	const double n = gsl_vector_get(xvec, 1);
-	
-	size_t t = 0;
-	RayleighFitter &fitter = *(RayleighFitter *) data;
-	const LogHistogram &hist = *fitter._hist;
-	const double minVal = fitter._minVal;
-	const double maxVal = fitter._maxVal;
-  
-	for (LogHistogram::const_iterator i=hist.begin(); i!=hist.end(); ++i)
-	{
-		const double x = i.value();
-		if(x >= minVal && x < maxVal && std::isfinite(x))
-		{
-			const double val = i.normalizedCount();
-			//const double logval = log(val);
-			//const double weight = logval;
-			
-			double sigmaP2 = sigma*sigma;
-			double Yi = x * exp(-(x*x)/(2*sigmaP2)) * n / sigmaP2;
-			if(fitter.FitLogarithmic())
-				gsl_vector_set(f, t, log(Yi) - log(val));
-			else
-				gsl_vector_set(f, t, (Yi - val));
-			++t;
-		}
-	}
-	
-	return GSL_SUCCESS;
-}
-
-int fit_df(const gsl_vector *xvec, void *data, gsl_matrix *J)
-{
-	const double sigma = gsl_vector_get(xvec, 0);
-	const double n = gsl_vector_get(xvec, 1);
-	
-	size_t t = 0;
-	RayleighFitter &fitter = *(RayleighFitter *) data;
-	const LogHistogram &hist = *fitter._hist;
-	const double minVal = fitter._minVal;
-	const double maxVal = fitter._maxVal;
-	const double sigmaP2 = sigma*sigma;
-  const double sigmaP3 = sigma*sigma*sigma;
-	for (LogHistogram::const_iterator i=hist.begin(); i!=hist.end(); ++i)
-	{
-		const double x = i.value();
-		if(x >= minVal && x < maxVal && std::isfinite(x))
-		{
-			//const double val = i.normalizedCount();
-			//const double weight = log(val);
-
-			double dfdsigma, dfdn;
-			if(fitter.FitLogarithmic())
-			{
-				dfdsigma = (x*x-2.0*sigmaP2)/sigmaP3;
-				dfdn = 1.0/n;
-			} else {
-				dfdsigma = -n * 2.0*x*x*x / (sigmaP3 * sigmaP3) * exp(-x*x/(2.0*sigmaP2));
-				dfdn = x * exp(-(x*x)/(2*sigmaP2)) / sigmaP2;
-			}
-			
-			// diff to sigma
-			gsl_matrix_set (J, t, 0, dfdsigma); 
-			// diff to n
-			gsl_matrix_set (J, t, 1, dfdn);
-			
-			++t;
-		}
-	}	
-	return GSL_SUCCESS;
-}
-     
-int fit_fdf(const gsl_vector *x, void *data,
-						 gsl_vector *f, gsl_matrix *J)
-{
-	fit_f (x, data, f);
-	fit_df (x, data, J);
-  
-	return GSL_SUCCESS;
-}
-
-void print_state(size_t iter, gsl_multifit_fdfsolver *s)
-{
-  double sigma = gsl_vector_get (s->x, 0);
-  double N = gsl_vector_get (s->x, 1);
-	std::cout << "iteration " << iter << ", sigma=" << sigma << ", N=" << N << "\n";
-}
-
-void RayleighFitter::Fit(double minVal, double maxVal, const LogHistogram &hist, double &sigma, double &n)
-{
-	unsigned int iter = 0;
-	const size_t nVars = 2;
-	_hist = &hist;
-	if(minVal > 0)
-		_minVal = minVal;
-	else
-		_minVal = hist.MinPositiveAmplitude();
-	_maxVal = maxVal;
-
-	size_t nData = 0;
-	for (LogHistogram::iterator i=hist.begin(); i!=hist.end(); ++i)
-	{
-		const double val = i.value();
-		if(val >= minVal && val < maxVal && std::isfinite(val))
-			++nData;
-	}
-	std::cout << "ndata=" << nData << "\n";
-    
-	double x_init[nVars] = { sigma, n };
-	gsl_vector_view x = gsl_vector_view_array (x_init, nVars);
-  
-	gsl_multifit_function_fdf f;
-	f.f = &fit_f;
-	f.df = &fit_df;
-	f.fdf = &fit_fdf;
-	f.n = nData;
-	f.p = nVars;
-	f.params = this;
-  
-	const gsl_multifit_fdfsolver_type *T = gsl_multifit_fdfsolver_lmsder;
-	gsl_multifit_fdfsolver *s = gsl_multifit_fdfsolver_alloc (T, nData, nVars);
-	gsl_multifit_fdfsolver_set (s, &f, &x.vector);
-  
-	print_state (iter, s);
-  
-	int status;
-	do {
-		iter++;
-		status = gsl_multifit_fdfsolver_iterate (s);
-		
-		std::cout << "status = " << gsl_strerror(status) << "\n";
-		
-		print_state (iter, s);
-			
-		if (status)
-			break;
-		
-		status = gsl_multifit_test_delta (s->dx, s->x, 1e-7, 1e-3);
-		
-  } while (status == GSL_CONTINUE && iter < 500);
-	
-  std::cout << "status = " << gsl_strerror (status) << "\n";
-  print_state(iter, s);
-  sigma = fabs(gsl_vector_get (s->x, 0));
-  n = fabs(gsl_vector_get (s->x, 1));
-  gsl_multifit_fdfsolver_free (s);
-}
-
-#else // No gsl...
-
-void RayleighFitter::Fit(double minVal, double maxVal, const LogHistogram &hist, double &sigma, double &n)
-{
-	sigma = 1.0;
-	n = 1.0;
-}
-
-#endif
-
-double RayleighFitter::SigmaEstimate(const LogHistogram &hist)
-{
-	return hist.AmplitudeWithMaxNormalizedCount();
-}
-
-void RayleighFitter::FindFitRangeUnderRFIContamination(double minPositiveAmplitude, double sigmaEstimate, double &minValue, double &maxValue)
-{
-	minValue = minPositiveAmplitude;
-	maxValue = sigmaEstimate * 1.5;
-	std::cout << "Found range " << minValue << " -- " << maxValue << "\n";
-}
-
-double RayleighFitter::ErrorOfFit(const LogHistogram &histogram, double rangeStart, double rangeEnd, double sigma, double n)
-{
-	double sum = 0.0;
-	size_t count = 0;
-	for (LogHistogram::const_iterator i=histogram.begin(); i!=histogram.end(); ++i)
-	{
-		const double x = i.value();
-		if(x >= rangeStart && x < rangeEnd && std::isfinite(x))
-		{
-			const double val = i.normalizedCount();
-			
-			double sigmaP2 = sigma*sigma;
-			double Yi = x * exp(-(x*x)/(2*sigmaP2)) * n / sigmaP2;
-			
-			double error = (Yi - val)*(Yi - val);
-			sum += error;
-			++count;
-		}
-	}
-	return sum / (double) count;
-}
-
-double RayleighFitter::NEstimate(const LogHistogram &hist, double rangeStart, double rangeEnd)
-{
-	double rangeSum = 0.0;
-	size_t count = 0;
-	for (LogHistogram::const_iterator i=hist.begin(); i!=hist.end(); ++i)
-	{
-		if(i.value() > rangeStart && i.value() < rangeEnd && std::isfinite(i.value()))
-		{
-			if(std::isfinite(i.normalizedCount()))
-			{
-				rangeSum += i.normalizedCount();
-				++count;
-			}
-		}
-	}
-	return rangeSum / (count * 10.0);
-}
diff --git a/CEP/DP3/AOFlagger/src/rawreader.cpp b/CEP/DP3/AOFlagger/src/rawreader.cpp
deleted file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000
diff --git a/CEP/DP3/AOFlagger/src/remote/client.cpp b/CEP/DP3/AOFlagger/src/remote/client.cpp
deleted file mode 100644
index b6eb23a62bf7208ce02b3b7c767fe65d0e75aef9..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/remote/client.cpp
+++ /dev/null
@@ -1,405 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#include <AOFlagger/remote/client.h>
-
-#include <typeinfo>
-
-#include <boost/asio/read.hpp>
-#include <boost/asio/write.hpp>
-
-#include <ms/MeasurementSets/MSColumns.h>
-
-#include <AOFlagger/quality/histogramcollection.h>
-#include <AOFlagger/quality/histogramtablesformatter.h>
-#include <AOFlagger/quality/qualitytablesformatter.h>
-#include <AOFlagger/quality/statisticscollection.h>
-
-#include <AOFlagger/remote/format.h>
-#include <AOFlagger/remote/processcommander.h>
-
-#include <AOFlagger/msio/antennainfo.h>
-#include <AOFlagger/msio/measurementset.h>
-
-namespace aoRemote
-{
-
-Client::Client()
-	: _socket(_ioService)
-{
-}
-
-void Client::Run(const std::string &serverHost)
-{
-	boost::asio::ip::tcp::resolver resolver(_ioService);
-	std::stringstream s;
-	s << PORT();
-	boost::asio::ip::tcp::resolver::query query(serverHost, s.str());
-	boost::asio::ip::tcp::resolver::iterator iter = resolver.resolve(query);
-	
-	boost::asio::ip::tcp::endpoint endpoint = *iter;
-	_socket.connect(endpoint);
-	
-	const std::string hostname = ProcessCommander::GetHostName();
-	struct InitialBlock initialBlock;
-	boost::asio::read(_socket, boost::asio::buffer(&initialBlock, sizeof(initialBlock)));
-	
-	struct InitialResponseBlock initialResponse;
-	initialResponse.blockIdentifier = InitialResponseId;
-	initialResponse.blockSize = sizeof(initialResponse);
-	initialResponse.negotiatedProtocolVersion = AO_REMOTE_PROTOCOL_VERSION;
-	initialResponse.hostNameSize = hostname.size();
-	if(initialBlock.protocolVersion != AO_REMOTE_PROTOCOL_VERSION || initialBlock.blockSize != sizeof(initialBlock) || initialBlock.blockIdentifier != InitialId)
-	{
-		initialResponse.errorCode = ProtocolNotUnderstoodError;
-		boost::asio::write(_socket, boost::asio::buffer(&initialResponse, sizeof(initialResponse)));
-		boost::asio::write(_socket, boost::asio::buffer(hostname));
-		return;
-	}
-	initialResponse.errorCode = NoError;
-	boost::asio::write(_socket, boost::asio::buffer(&initialResponse, sizeof(initialResponse)));
-	boost::asio::write(_socket, boost::asio::buffer(hostname));
-
-	while(true)
-	{
-		struct RequestBlock requestBlock;
-		boost::asio::read(_socket, boost::asio::buffer(&requestBlock, sizeof(requestBlock)));
-		
-		enum RequestType request = (enum RequestType) requestBlock.request;
-		switch(request)
-		{
-			case StopClientRequest:
-				return;
-			case ReadQualityTablesRequest:
-				handleReadQualityTables(requestBlock.dataSize);
-				break;
-			case ReadAntennaTablesRequest:
-				handleReadAntennaTables(requestBlock.dataSize);
-				break;
-			case ReadBandTableRequest:
-				handleReadBandTable(requestBlock.dataSize);
-				break;
-			case ReadDataRowsRequest:
-				handleReadDataRows(requestBlock.dataSize);
-				break;
-			case WriteDataRowsRequest:
-				handleWriteDataRows(requestBlock.dataSize);
-				break;
-			default:
-				std::cout << "CLIENT: unknown command sent" << std::endl;
-				writeGenericReadException("Command not understood by client: server and client versions don't match?");
-				break;
-		}
-	}
-}
-
-void Client::writeGenericReadException(const std::exception &e)
-{
-	std::stringstream s;
-	s << "Exception type " << typeid(e).name() << ": " << e.what();
-	writeGenericReadException(s.str());
-}
-
-void Client::writeGenericReadException(const std::string &s)
-{
-	GenericReadResponseHeader header;
-	header.blockIdentifier = GenericReadResponseHeaderId;
-	header.blockSize = sizeof(header);
-	header.errorCode = UnexpectedExceptionOccured;
-	header.dataSize = s.size();
-	
-	boost::asio::write(_socket, boost::asio::buffer(&header, sizeof(header)));
-	boost::asio::write(_socket, boost::asio::buffer(s));
-}
-
-void Client::writeGenericReadError(enum ErrorCode error)
-{
-	GenericReadResponseHeader header;
-	header.blockIdentifier = GenericReadResponseHeaderId;
-	header.blockSize = sizeof(header);
-	header.errorCode = CouldNotOpenTableError;
-	header.dataSize = 0;
-	boost::asio::write(_socket, boost::asio::buffer(&header, sizeof(header)));
-}
-
-void Client::writeDataResponse(std::ostringstream &buffer)
-{
-	try {
-		GenericReadResponseHeader header;
-		header.blockIdentifier = GenericReadResponseHeaderId;
-		header.blockSize = sizeof(header);
-		header.errorCode = NoError;
-		const std::string str = buffer.str();
-		header.dataSize = str.size();
-		
-		boost::asio::write(_socket, boost::asio::buffer(&header, sizeof(header)));
-		if(str.size() != 0)
-			boost::asio::write(_socket, boost::asio::buffer(str));
-	} catch(std::exception &e) {
-		writeGenericReadException(e);
-	}
-}
-
-std::string Client::readStr(unsigned size)
-{
-	char data[size+1];
-	boost::asio::read(_socket, boost::asio::buffer(data, size));
-	data[size] = 0;
-	return std::string(data);
-}
-
-void Client::handleReadQualityTables(unsigned dataSize)
-{
-	try {
-		ReadQualityTablesRequestOptions options;
-		boost::asio::read(_socket, boost::asio::buffer(&options.flags, sizeof(options.flags)));
-		
-		unsigned nameLength = dataSize - sizeof(options.flags);
-		options.msFilename = readStr(nameLength);
-		
-		QualityTablesFormatter formatter(options.msFilename);
-		if(!formatter.TableExists(QualityTablesFormatter::KindNameTable))
-		{
-			writeGenericReadError(CouldNotOpenTableError);
-		} else {
-			StatisticsCollection collection(formatter.GetPolarizationCount());
-			collection.Load(formatter);
-			// TODO: maybe we want to configure the following parameter at one point
-			collection.LowerTimeResolution(1000);
-			
-			HistogramTablesFormatter histogramFormatter(options.msFilename);
-			HistogramCollection histogramCollection(formatter.GetPolarizationCount());
-			const bool histogramsExist = histogramFormatter.HistogramsExist();
-			if(histogramsExist)
-			{
-				histogramCollection.Load(histogramFormatter);
-			}
-			
-			std::ostringstream s;
-			collection.Serialize(s);
-			if(histogramsExist)
-				histogramCollection.Serialize(s);
-			writeDataResponse(s);
-		}
-	} catch(std::exception &e) {
-		writeGenericReadException(e);
-	}
-}
-
-void Client::handleReadAntennaTables(unsigned dataSize)
-{
-	try {
-		ReadAntennaTablesRequestOptions options;
-		boost::asio::read(_socket, boost::asio::buffer(&options.flags, sizeof(options.flags)));
-		
-		unsigned nameLength = dataSize - sizeof(options.flags);
-		options.msFilename = readStr(nameLength);
-		
-		std::ostringstream buffer;
-		
-		// Serialize the antennae info
-		MeasurementSet ms(options.msFilename);
-		size_t polarizationCount = ms.GetPolarizationCount();
-		size_t antennas = ms.AntennaCount();
-		Serializable::SerializeToUInt32(buffer, polarizationCount);
-		Serializable::SerializeToUInt32(buffer, antennas);
-		for(unsigned aIndex = 0; aIndex<antennas; ++aIndex)
-		{
-			AntennaInfo antennaInfo = ms.GetAntennaInfo(aIndex);
-			antennaInfo.Serialize(buffer);
-		}
-		
-		writeDataResponse(buffer);
-	} catch(std::exception &e) {
-		writeGenericReadException(e);
-	}
-}
-
-void Client::handleReadBandTable(unsigned dataSize)
-{
-	try {
-		ReadBandTableRequestOptions options;
-		boost::asio::read(_socket, boost::asio::buffer(&options.flags, sizeof(options.flags)));
-		
-		unsigned nameLength = dataSize - sizeof(options.flags);
-		options.msFilename = readStr(nameLength);
-		
-		std::ostringstream buffer;
-		
-		// Serialize the band info
-		MeasurementSet ms(options.msFilename);
-		if(ms.BandCount() != 1)
-			throw std::runtime_error("The number of bands in the measurement set was not 1");
-		BandInfo band = ms.GetBandInfo(0);
-		band.Serialize(buffer);
-		
-		writeDataResponse(buffer);
-	} catch(std::exception &e) {
-		writeGenericReadException(e);
-	}
-}
-
-void Client::handleReadDataRows(unsigned dataSize)
-{
-	try {
-		ReadDataRowsRequestOptions options;
-		boost::asio::read(_socket, boost::asio::buffer(&options.flags, sizeof(options.flags)));
-		
-		unsigned nameLength = dataSize - sizeof(options.flags) - sizeof(options.startRow) - sizeof(options.rowCount);
-		options.msFilename = readStr(nameLength);
-		
-		boost::asio::read(_socket, boost::asio::buffer(&options.startRow, sizeof(options.startRow)));
-		boost::asio::read(_socket, boost::asio::buffer(&options.rowCount, sizeof(options.rowCount)));
-		
-		std::ostringstream buffer;
-		Serializable::SerializeToUInt64(buffer, options.rowCount);
-		
-		// Read meta data from the MS
-		casa::Table table(options.msFilename);
-		if(options.rowCount == 0)
-			Serializable::SerializeToUInt64(buffer, table.nrow());
-		else {
-			casa::ROArrayColumn<casa::Complex> dataCol(table, "DATA");
-			casa::ROArrayColumn<double> uvwColumn(table, "UVW");
-			casa::ROScalarColumn<int> a1Column(table, "ANTENNA1");
-			casa::ROScalarColumn<int> a2Column(table, "ANTENNA2");
-			casa::ROScalarColumn<double> timeColumn(table, "TIME");
-			const casa::IPosition &shape = dataCol.shape(0);
-			size_t channelCount, polarizationCount;
-			if(shape.nelements() > 1)
-			{
-				channelCount = shape[1];
-				polarizationCount = shape[0];
-			}
-			else
-				throw std::runtime_error("Unknown shape of DATA column");
-			const size_t samplesPerRow = polarizationCount * channelCount;
-			
-			// Read and serialize the rows
-			const size_t endRow = options.startRow + options.rowCount;
-			for(size_t rowIndex=options.startRow; rowIndex != endRow; ++rowIndex)
-			{
-				// DATA
-				const casa::Array<casa::Complex> cellData = dataCol(rowIndex);
-				casa::Array<casa::Complex>::const_iterator cellIter = cellData.begin();
-				
-				MSRowDataExt dataExt(polarizationCount, channelCount);
-				MSRowData &data = dataExt.Data();
-				num_t *realPtr = data.RealPtr();
-				num_t *imagPtr = data.ImagPtr();
-				for(size_t i=0;i<samplesPerRow;++i) {
-					*realPtr = cellIter->real();
-					*imagPtr = cellIter->imag();
-					++realPtr;
-					++imagPtr;
-					++cellIter;
-				}
-				
-				// UVW
-				casa::Array<double> uvwArr = uvwColumn(rowIndex);
-				casa::Array<double>::const_iterator uvwIter = uvwArr.begin();
-				dataExt.SetU(*uvwIter);
-				++uvwIter;
-				dataExt.SetV(*uvwIter);
-				++uvwIter;
-				dataExt.SetW(*uvwIter);
-				
-				// OTHER
-				dataExt.SetAntenna1(a1Column(rowIndex));
-				dataExt.SetAntenna2(a2Column(rowIndex));
-				dataExt.SetTime(timeColumn(rowIndex));
-				dataExt.SetTimeOffsetIndex(rowIndex);
-				
-				dataExt.Serialize(buffer);
-			}
-		}
-		
-		writeDataResponse(buffer);
-	} catch(std::exception &e) {
-		writeGenericReadException(e);
-	}
-}
-
-void Client::handleWriteDataRows(unsigned dataSize)
-{
-	try {
-		WriteDataRowsRequestOptions options;
-		
-		boost::asio::read(_socket, boost::asio::buffer(&options.flags, sizeof(options.flags)));
-		unsigned nameLength = dataSize - sizeof(options.flags) - sizeof(options.startRow) - sizeof(options.rowCount) - sizeof(options.dataSize);
-		options.msFilename = readStr(nameLength);
-		boost::asio::read(_socket, boost::asio::buffer(&options.startRow, sizeof(options.startRow)));
-		boost::asio::read(_socket, boost::asio::buffer(&options.rowCount, sizeof(options.rowCount)));
-		boost::asio::read(_socket, boost::asio::buffer(&options.dataSize, sizeof(options.dataSize)));
-		
-		// Read the big data chunk
-		std::vector<char> dataBuffer(options.dataSize);
-		boost::asio::read(_socket, boost::asio::buffer(&dataBuffer[0], options.dataSize));
-		std::istringstream stream;
-		if(stream.rdbuf()->pubsetbuf(&dataBuffer[0], options.dataSize) == 0)
-			throw std::runtime_error("Could not set string buffer");
-		
-		// Write the received data to the MS
-		casa::Table table(options.msFilename, casa::Table::Update);
-		casa::ArrayColumn<casa::Complex> dataCol(table, "DATA");
-		//casa::ROScalarColumn<int> a1Column(table, "ANTENNA1");
-		//casa::ROScalarColumn<int> a2Column(table, "ANTENNA2");
-		const casa::IPosition shape = dataCol.shape(0);
-		size_t channelCount, polarizationCount;
-		if(shape.nelements() > 1)
-		{
-			channelCount = shape[1];
-			polarizationCount = shape[0];
-		}
-		else
-			throw std::runtime_error("Unknown shape of DATA column");
-		const size_t samplesPerRow = polarizationCount * channelCount;
-		
-		// Unserialize and write the rows
-		casa::Array<casa::Complex> cellData(shape);
-		const size_t endRow = options.startRow + options.rowCount;
-		for(size_t rowIndex=options.startRow; rowIndex != endRow; ++rowIndex)
-		{
-			MSRowDataExt dataExt;
-			dataExt.Unserialize(stream);
-			MSRowData &data = dataExt.Data();
-			
-			casa::Array<casa::Complex>::iterator cellIter = cellData.begin();
-			
-			num_t *realPtr = data.RealPtr();
-			num_t *imagPtr = data.ImagPtr();
-			for(size_t i=0;i<samplesPerRow;++i) {
-				*cellIter = casa::Complex(*realPtr, *imagPtr);
-				++realPtr;
-				++imagPtr;
-				++cellIter;
-			}
-			dataCol.put(rowIndex, cellData);
-		}
-		
-		std::ostringstream buffer;
-		writeDataResponse(buffer);
-	} catch(std::exception &e) {
-		writeGenericReadException(e);
-	}
-}
-
-} // namespace
-
diff --git a/CEP/DP3/AOFlagger/src/remote/clusteredobservation.cpp b/CEP/DP3/AOFlagger/src/remote/clusteredobservation.cpp
deleted file mode 100644
index 82f2fbee791d5d5a85cc39616c1e8a00ff9bebfe..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/remote/clusteredobservation.cpp
+++ /dev/null
@@ -1,115 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#include <lofar_config.h>
-
-#include <AOFlagger/remote/clusteredobservation.h>
-
-#include <stdexcept>
-
-#include <memory> // for auto_ptr
-
-#include <LMWCommon/VdsDesc.h>
-
-#include <AOFlagger/ref/reffile.h>
-
-#include <AOFlagger/configuration.h>
-
-namespace aoRemote
-{
-
-ClusteredObservation::ClusteredObservation()
-{
-}
-
-ClusteredObservation *ClusteredObservation::LoadFromVds(const std::string &vdsFilename)
-{
-	throwIfNotEnabled();
-	
-	LOFAR::CEP::VdsDesc vdsDesc(vdsFilename);
-	const std::vector<LOFAR::CEP::VdsPartDesc> &parts = vdsDesc.getParts();
-	
-	std::auto_ptr<ClusteredObservation> cObs(new ClusteredObservation());
-	
-	for(std::vector<LOFAR::CEP::VdsPartDesc>::const_iterator i=parts.begin();i!=parts.end();++i)
-	{
-		const std::string &filename = i->getFileName();
-		const std::string &filesystem = i->getFileSys();
-		
-		size_t separatorPos = filesystem.find(':');
-		if(separatorPos == std::string::npos || separatorPos == 0)
-			throw std::runtime_error("One of the file system descriptors in the VDS file has an unexpected format");
-		const std::string hostname = filesystem.substr(0, separatorPos);
-		
-		ClusteredObservationItem newItem(cObs->Size(), filename, hostname);
-		cObs->AddItem(newItem);
-	}
-	
-	return cObs.release();
-}
-
-ClusteredObservation *ClusteredObservation::LoadFromRef(const std::string &refFilename)
-{
-	throwIfNotEnabled();
-	
-	AOTools::RefFile refFile(refFilename);
-	std::auto_ptr<ClusteredObservation> cObs(new ClusteredObservation());
-	for(AOTools::RefFile::const_iterator i=refFile.begin();i!=refFile.end();++i)
-	{
-		const AOTools::RefFileEntry &entry = *i;
-		cObs->AddItem(ClusteredObservationItem(cObs->Size(), entry.Path(), entry.Node()));
-	}
-	return cObs.release();
-}
-
-ClusteredObservation *ClusteredObservation::Load(const std::string &filename)
-{
-	if(IsVdsFilename(filename))
-		return LoadFromVds(filename);
-	else if(IsRefFilename(filename))
-		return LoadFromRef(filename);
-	else
-		throw std::runtime_error("Could not determine type of specified filename for loading as clustered observation");
-}
-
-bool ClusteredObservation::IsVdsFilename(const std::string &filename)
-{
-	return
-		(filename.size() > 4 && filename.substr(filename.size()-4) == ".vds")
-		||
-		(filename.size() > 4 && filename.substr(filename.size()-4) == ".gds")
-		||
-		(filename.size() > 5 && filename.substr(filename.size()-5) == ".gvds");
-}
-
-bool ClusteredObservation::IsRefFilename(const std::string &filename)
-{
-	return
-		(filename.size() > 4 && filename.substr(filename.size()-4) == ".ref");
-}
-
-void ClusteredObservation::throwIfNotEnabled()
-{
-	//if(!IsRemoteModuleEnabled())
-	//	throw std::runtime_error("The remote module is not enabled: cannot open clustered observations (gds, vds or ref files). See the CMake output why it was disabled.");
-}
-
-
-}
diff --git a/CEP/DP3/AOFlagger/src/remote/processcommander.cpp b/CEP/DP3/AOFlagger/src/remote/processcommander.cpp
deleted file mode 100644
index 86040a7ea769ee0c97e5ce9894b3b99667f568b6..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/remote/processcommander.cpp
+++ /dev/null
@@ -1,360 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#include <AOFlagger/remote/processcommander.h>
-
-#include <unistd.h> //gethostname
-
-#include <AOFlagger/remote/observationtimerange.h>
-#include <AOFlagger/remote/serverconnection.h>
-
-#include <AOFlagger/quality/statisticscollection.h>
-#include <AOFlagger/quality/histogramcollection.h>
-#include <AOFlagger/quality/statisticsderivator.h>
-
-namespace aoRemote {
-
-ProcessCommander::ProcessCommander(const ClusteredObservation &observation)
-: _server(), _observation(observation)
-{
-	_server.SignalConnectionCreated().connect(sigc::mem_fun(*this, &ProcessCommander::onConnectionCreated));
-}
-
-ProcessCommander::~ProcessCommander()
-{
-	endIdleConnections();
-	for(std::vector<RemoteProcess*>::iterator i=_processes.begin();i!=_processes.end();++i)
-	{
-		delete *i;
-	}
-}
-
-void ProcessCommander::endIdleConnections()
-{
-	ConnectionVector idleConnections = _idleConnections;
-	_idleConnections.clear();
-	for(ConnectionVector::const_iterator i=idleConnections.begin();i!=idleConnections.end();++i)
-	{
-		(*i)->StopClient();
-	}
-}
-
-void ProcessCommander::Run(bool finishConnections)
-{
-	_errors.clear();
-	_finishConnections = finishConnections;
-	
-	if(!_observation.GetItems().empty() && !_tasks.empty())
-	{
-		const std::string thisHostName = GetHostName();
-		
-		// make a list of the involved nodes
-		_nodeCommands.Initialize(_observation);
-		
-		// recycle idle connections
-		ConnectionVector list = _idleConnections;
-		_idleConnections.clear();
-		for(ConnectionVector::iterator i=list.begin();i!=list.end();++i)
-		{
-			onConnectionAwaitingCommand(*i);
-		}
-		
-		if(_processes.empty())
-		{
-			//construct a process for each unique node name
-			std::vector<std::string> list;
-			_nodeCommands.NodeList(list);
-			for(std::vector<std::string>::const_iterator i=list.begin();i!=list.end();++i)
-			{
-				RemoteProcess *process = new RemoteProcess(*i, thisHostName);
-				process->SignalFinished().connect(sigc::mem_fun(*this, &ProcessCommander::onProcessFinished));
-				process->Start();
-				_processes.push_back(process);
-			}
-		}
-		
-		// We will now start accepting connections. The Run() method will not return until the server
-		// stops listening and there are no more io operations pending. With asynchroneous
-		// handles, the server and its connections will call onEvent...(). These handles
-		// will push new tasks until all tasks in the ProcessCommander are finished.
-		_server.Run();
-	}
-}
-
-void ProcessCommander::continueReadQualityTablesTask(ServerConnectionPtr serverConnection)
-{
-	const std::string &hostname = serverConnection->Hostname();
-	
-	boost::mutex::scoped_lock lock(_mutex);
-	ClusteredObservationItem item;
-	if(_nodeCommands.Pop(hostname, item))
-	{
-		const std::string &msFilename = item.LocalPath();
-		StatisticsCollection *statisticsCollection = new StatisticsCollection();
-		HistogramCollection *histogramCollection = new HistogramCollection();
-		serverConnection->ReadQualityTables(msFilename, *statisticsCollection, *histogramCollection);
-	} else {
-		handleIdleConnection(serverConnection);
-		
-		if(_nodeCommands.Empty())
-			onCurrentTaskFinished();
-	}
-}
-
-void ProcessCommander::continueReadAntennaTablesTask(ServerConnectionPtr serverConnection)
-{
-	boost::mutex::scoped_lock lock(_mutex);
-	
-	const std::string &hostname = serverConnection->Hostname();
-	std::vector<AntennaInfo> *antennas = new std::vector<AntennaInfo>();
-	serverConnection->ReadAntennaTables(_nodeCommands.Top(hostname).LocalPath(),
-																			boost::shared_ptr<std::vector<AntennaInfo> >(antennas));
-	
-	onCurrentTaskFinished();
-}
-
-void ProcessCommander::continueReadBandTablesTask(ServerConnectionPtr serverConnection)
-{
-	const std::string &hostname = serverConnection->Hostname();
-	
-	boost::mutex::scoped_lock lock(_mutex);
-	ClusteredObservationItem item;
-	if(_nodeCommands.Pop(hostname, item))
-	{
-		const std::string &msFilename = item.LocalPath();
-		serverConnection->ReadBandTable(msFilename, _bands[item.Index()]);
-	} else {
-		handleIdleConnection(serverConnection);
-		
-		if(_nodeCommands.Empty())
-			onCurrentTaskFinished();
-	}
-}
-
-void ProcessCommander::continueReadDataRowsTask(ServerConnectionPtr serverConnection)
-{
-	const std::string &hostname = serverConnection->Hostname();
-	
-	boost::mutex::scoped_lock lock(_mutex);
-	ClusteredObservationItem item;
-	if(_nodeCommands.Pop(hostname, item))
-	{
-		const std::string &msFilename = item.LocalPath();
-		if(_rowCount != 0)
-			serverConnection->ReadDataRows(msFilename, _rowStart, _rowCount, _readRowBuffer[item.Index()]);
-		else
-			serverConnection->ReadDataRows(msFilename, _rowStart, _rowCount, 0);
-	} else {
-		handleIdleConnection(serverConnection);
-		
-		if(_nodeCommands.Empty())
-			onCurrentTaskFinished();
-	}
-}
-
-void ProcessCommander::continueWriteDataRowsTask(ServerConnectionPtr serverConnection)
-{
-	const std::string &hostname = serverConnection->Hostname();
-	
-	boost::mutex::scoped_lock lock(_mutex);
-	ClusteredObservationItem item;
-	if(_nodeCommands.Pop(hostname, item))
-	{
-		const std::string &msFilename = item.LocalPath();
-		_observationTimerange->GetTimestepData(item.Index(), _writeRowBuffer[item.Index()]);
-
-		serverConnection->WriteDataRows(msFilename, _observationTimerange->TimeOffsetIndex(), _observationTimerange->TimestepCount(), _writeRowBuffer[item.Index()]);
-	} else {
-		handleIdleConnection(serverConnection);
-		
-		if(_nodeCommands.Empty())
-			onCurrentTaskFinished();
-	}
-}
-
-std::string ProcessCommander::GetHostName()
-{
-	char name[HOST_NAME_MAX];
-	if(gethostname(name, HOST_NAME_MAX) == 0)
-	{
-		return std::string(name);
-	} else {
-		throw std::runtime_error("Error retrieving hostname");
-	}
-}
-
-void ProcessCommander::onConnectionCreated(ServerConnectionPtr serverConnection, bool &acceptConnection)
-{
-	serverConnection->SignalAwaitingCommand().connect(sigc::mem_fun(*this, &ProcessCommander::onConnectionAwaitingCommand));
-	serverConnection->SignalFinishReadQualityTables().connect(sigc::mem_fun(*this, &ProcessCommander::onConnectionFinishReadQualityTables));
-	serverConnection->SignalFinishReadAntennaTables().connect(sigc::mem_fun(*this, &ProcessCommander::onConnectionFinishReadAntennaTables));
-	serverConnection->SignalFinishReadBandTable().connect(sigc::mem_fun(*this, &ProcessCommander::onConnectionFinishReadBandTable));
-	serverConnection->SignalFinishReadDataRows().connect(sigc::mem_fun(*this, &ProcessCommander::onConnectionFinishReadDataRows));
-	serverConnection->SignalError().connect(sigc::mem_fun(*this, &ProcessCommander::onError));
-	acceptConnection = true;
-}
-
-void ProcessCommander::onConnectionAwaitingCommand(ServerConnectionPtr serverConnection)
-{
-	switch(currentTask())
-	{
-		case ReadQualityTablesTask:
-			continueReadQualityTablesTask(serverConnection);
-			break;
-		case ReadAntennaTablesTask:
-			continueReadAntennaTablesTask(serverConnection);
-			break;
-		case ReadBandTablesTask:
-			continueReadBandTablesTask(serverConnection);
-			break;
-		case ReadDataRowsTask:
-			continueReadDataRowsTask(serverConnection);
-			break;
-		case WriteDataRowsTask:
-			continueWriteDataRowsTask(serverConnection);
-			break;
-		case NoTask:
-			handleIdleConnection(serverConnection);
-			break;
-		default:
-			throw std::runtime_error("Unknown task");
-	}
-}
-
-void ProcessCommander::onConnectionFinishReadQualityTables(ServerConnectionPtr serverConnection, StatisticsCollection &statisticsCollection, HistogramCollection &histogramCollection)
-{
-	boost::mutex::scoped_lock lock(_mutex);
-	if(statisticsCollection.PolarizationCount() == 0)
-		throw std::runtime_error("Client sent StatisticsCollection with 0 polarizations.");
-	
-	// If the collection is still empty, we need to set its polarization count
-	if(_statisticsCollection->PolarizationCount() == 0)
-		_statisticsCollection->SetPolarizationCount(statisticsCollection.PolarizationCount());
-	
-	_statisticsCollection->Add(statisticsCollection);
-	
-	if(!histogramCollection.Empty())
-	{
-		if(_correctHistograms)
-		{
-			DefaultStatistics thisStat(statisticsCollection.PolarizationCount());
-			statisticsCollection.GetGlobalCrossBaselineStatistics(thisStat);
-			DefaultStatistics singlePol = thisStat.ToSinglePolarization();
-			double stddev = StatisticsDerivator::GetStatisticAmplitude(QualityTablesFormatter::DStandardDeviationStatistic, singlePol, 0);
-			
-			std::cout << "Scaling with " << 1.0 / stddev << ".\n";
-			histogramCollection.Rescale(1.0 / stddev);
-		}
-		
-		if(_histogramCollection->PolarizationCount() == 0)
-			_histogramCollection->SetPolarizationCount(histogramCollection.PolarizationCount());
-		
-		_histogramCollection->Add(histogramCollection);
-	}
-	
-	delete &statisticsCollection;
-	delete &histogramCollection;
-}
-
-void ProcessCommander::onConnectionFinishReadAntennaTables(ServerConnectionPtr serverConnection, boost::shared_ptr<std::vector<AntennaInfo> > antennas, size_t polarizationCount)
-{
-	boost::mutex::scoped_lock lock(_mutex);
-	_polarizationCount = polarizationCount;
-	_antennas = *antennas;
-}
-
-void ProcessCommander::onConnectionFinishReadBandTable(ServerConnectionPtr serverConnection, BandInfo &band)
-{
-	// Nothing needs to be done.
-}
-
-void ProcessCommander::onConnectionFinishReadDataRows(ServerConnectionPtr serverConnection, MSRowDataExt *rowData, size_t totalRows)
-{
-	const std::string &hostname = serverConnection->Hostname();
-	ClusteredObservationItem item;
-	_nodeCommands.Current(hostname, item);
-	_observationTimerange->SetTimestepData(item.Index(), rowData, _rowCount);
-	_observationTimerange->SetTimeOffsetIndex(_rowStart);
-	if(_rowsTotal < totalRows)
-		_rowsTotal = totalRows;
-}
-
-void ProcessCommander::onError(ServerConnectionPtr connection, const std::string &error)
-{
-	std::stringstream s;
-	
-	const std::string &hostname = connection->Hostname();
-	ClusteredObservationItem item;
-	bool knowFile = _nodeCommands.Current(hostname, item);
-	s << "On connection with " << hostname;
-	if(knowFile)
-		s << " to process local file '" << item.LocalPath() << "'";
-	s << ", reported error was: " << error;
-	boost::mutex::scoped_lock lock(_mutex);
-	_errors.push_back(s.str());
-}
-
-void ProcessCommander::onProcessFinished(RemoteProcess &process, bool error, int status)
-{
-	boost::mutex::scoped_lock lock(_mutex);
-	
-	if(_nodeCommands.RemoveNode(process.ClientHostname()) && _nodeCommands.Empty())
-		onCurrentTaskFinished();
-	
-	if(error)
-	{
-		std::stringstream s;
-		s << "Remote process to " << process.ClientHostname() << " reported an error";
-		if(status != 0) s << " (status " << status << ")";
-		_errors.push_back(s.str());
-	}
-}
-
-std::string ProcessCommander::ErrorString() const
-{
-	if(!_errors.empty())
-	{
-		std::stringstream s;
-		s << _errors.size() << " error(s) occured while querying the nodes or measurement sets in the given observation. This might be caused by a failing node, an unreadable measurement set, or maybe the quality tables are not available. The errors reported are:\n\n";
-		size_t count = 0;
-		for(std::vector<std::string>::const_iterator i=_errors.begin();i!=_errors.end() && count < 30;++i)
-		{
-			s << "- " << *i << '\n';
-			++count;
-		}
-		if(_errors.size() > 30)
-		{
-			s << "... and " << (_errors.size()-30) << " more.\n";
-		}
-		return s.str();
-	} else {
-		return std::string();
-	}
-}
-
-void ProcessCommander::CheckErrors() const
-{
-	if(!_errors.empty())
-	{
-		throw std::runtime_error(ErrorString());
-	}
-}
-
-}
diff --git a/CEP/DP3/AOFlagger/src/remote/server.cpp b/CEP/DP3/AOFlagger/src/remote/server.cpp
deleted file mode 100644
index 7b8376d8af315df6598e5ed3accdb31b5360c47b..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/remote/server.cpp
+++ /dev/null
@@ -1,78 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#include <AOFlagger/remote/server.h>
-
-#include <vector>
-#include <boost/bind.hpp>
-#include <boost/asio/placeholders.hpp>
-
-#include <AOFlagger/remote/serverconnection.h>
-
-#include <iostream>
-
-namespace aoRemote
-{
-
-Server::Server()
-	: _acceptor(_ioService, boost::asio::ip::tcp::endpoint(boost::asio::ip::tcp::v4(), PORT()))
-{
-}
-
-void Server::Run()
-{
-	startAccept();
-	_ioService.run();
-	_ioService.reset();
-}
-
-void Server::startAccept()
-{
-	ServerConnectionPtr connection = ServerConnection::Create(_ioService);
-	
-	_acceptor.async_accept(connection->Socket(), boost::bind(&Server::handleAccept, this, connection, boost::asio::placeholders::error));
-}
-
-void Server::handleAccept(ServerConnectionPtr connection, const boost::system::error_code &error)
-{
-	if (_acceptor.is_open())
-	{
-		if (!error)
-		{
-			std::cout << "Connection accepted." << std::endl;
-			bool acceptConnection = true;
-			_onConnectionCreated(connection, acceptConnection);
-			if(acceptConnection)
-				connection->Start();
-		}
-
-		startAccept();
-	}
-}
-
-void Server::Stop()
-{
-	if(_acceptor.is_open())
-		std::cout << "No longer accepting connections." << std::endl;
-	_acceptor.close();
-}
-
-
-}
diff --git a/CEP/DP3/AOFlagger/src/remote/serverconnection.cpp b/CEP/DP3/AOFlagger/src/remote/serverconnection.cpp
deleted file mode 100644
index 51230d88909078e00bd42af1e909284cb82469df..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/remote/serverconnection.cpp
+++ /dev/null
@@ -1,437 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#include <AOFlagger/remote/serverconnection.h>
-
-#include <boost/asio/read.hpp>
-#include <boost/asio/write.hpp>
-#include <boost/asio/placeholders.hpp>
-
-#include <boost/bind.hpp>
-
-#include <AOFlagger/remote/format.h>
-
-#include <AOFlagger/util/autoarray.h>
-
-#include <AOFlagger/quality/statisticscollection.h>
-#include <AOFlagger/quality/histogramcollection.h>
-
-namespace aoRemote
-{
-
-ServerConnection::ServerConnection(boost::asio::io_service &ioService) :
-	_socket(ioService), _buffer(0)
-{
-}
-
-ServerConnection::~ServerConnection()
-{
-	if(_buffer != 0)
-		delete[] _buffer;
-}
-
-void ServerConnection::Start()
-{
-	InitialBlock initialBlock;
-	initialBlock.blockIdentifier = InitialId;
-	initialBlock.blockSize = sizeof(initialBlock);
-	initialBlock.options = 0;
-	initialBlock.protocolVersion = AO_REMOTE_PROTOCOL_VERSION;
-	
-	boost::asio::write(_socket, boost::asio::buffer(&initialBlock, sizeof(initialBlock)));
-	
-	prepareBuffer(sizeof(InitialResponseBlock));
-	boost::asio::async_read(_socket, boost::asio::buffer(_buffer, sizeof(InitialResponseBlock)), boost::bind(&ServerConnection::onReceiveInitialResponse, shared_from_this()));
-}
-
-void ServerConnection::onReceiveInitialResponse()
-{
-	InitialResponseBlock initialResponse = *reinterpret_cast<InitialResponseBlock*>(_buffer);
-	enum ErrorCode errorCode = (enum ErrorCode) initialResponse.errorCode;
-	if(initialResponse.blockIdentifier != InitialResponseId || initialResponse.blockSize != sizeof(initialResponse))
-		throw std::runtime_error("Bad response from client during initial response");
-	if(errorCode != NoError)
-		throw std::runtime_error(std::string("Error reported by client during initial response: ") + ErrorStr::GetStr(errorCode));
-	if(initialResponse.negotiatedProtocolVersion != AO_REMOTE_PROTOCOL_VERSION)
-		throw std::runtime_error("Client seems to run different protocol version");
-	if(initialResponse.hostNameSize == 0 || initialResponse.hostNameSize > 65536)
-		throw std::runtime_error("Client did not send proper hostname");
-	
-	char hostname[initialResponse.hostNameSize + 1];
-	boost::asio::read(_socket, boost::asio::buffer(hostname, initialResponse.hostNameSize));
-	hostname[initialResponse.hostNameSize] = 0;
-	_hostname = hostname;
-	
-	_onAwaitingCommand(shared_from_this());
-}
-
-void ServerConnection::StopClient()
-{
-	RequestBlock requestBlock;
-	requestBlock.blockIdentifier = RequestId;
-	requestBlock.blockSize = sizeof(requestBlock);
-	requestBlock.dataSize = 0;
-	requestBlock.request = StopClientRequest;
-	boost::asio::write(_socket, boost::asio::buffer(&requestBlock, sizeof(requestBlock)));
-}
-
-void ServerConnection::ReadQualityTables(const std::string &msFilename, StatisticsCollection &collection, HistogramCollection &histogramCollection)
-{
-	_collection = &collection;
-	_histogramCollection = &histogramCollection;
-	
-	std::stringstream reqBuffer;
-	
-	RequestBlock requestBlock;
-	ReadQualityTablesRequestOptions options;
-	
-	requestBlock.blockIdentifier = RequestId;
-	requestBlock.blockSize = sizeof(requestBlock);
-	requestBlock.dataSize = sizeof(options.flags) + msFilename.size();
-	requestBlock.request = ReadQualityTablesRequest;
-	reqBuffer.write(reinterpret_cast<char *>(&requestBlock), sizeof(requestBlock));
-	
-	options.flags = 0;
-	options.msFilename = msFilename;
-	reqBuffer.write(reinterpret_cast<char *>(&options.flags), sizeof(options.flags));
-	reqBuffer.write(reinterpret_cast<const char *>(options.msFilename.c_str()), options.msFilename.size());
-	
-	boost::asio::write(_socket, boost::asio::buffer(reqBuffer.str()));
-	
-	prepareBuffer(sizeof(GenericReadResponseHeader));
-	boost::asio::async_read(_socket, boost::asio::buffer(_buffer, sizeof(GenericReadResponseHeader)),
-		boost::bind(&ServerConnection::onReceiveQualityTablesResponseHeader, shared_from_this()));
-}
-
-void ServerConnection::ReadAntennaTables(const std::string &msFilename, boost::shared_ptr<std::vector<AntennaInfo> > antennas)
-{
-	_antennas = antennas;
-	
-	std::stringstream reqBuffer;
-	
-	RequestBlock requestBlock;
-	ReadAntennaTablesRequestOptions options;
-	
-	requestBlock.blockIdentifier = RequestId;
-	requestBlock.blockSize = sizeof(requestBlock);
-	requestBlock.dataSize = sizeof(options.flags) + msFilename.size();
-	requestBlock.request = ReadAntennaTablesRequest;
-	reqBuffer.write(reinterpret_cast<char *>(&requestBlock), sizeof(requestBlock));
-	
-	options.flags = 0;
-	options.msFilename = msFilename;
-	reqBuffer.write(reinterpret_cast<char *>(&options.flags), sizeof(options.flags));
-	reqBuffer.write(reinterpret_cast<const char *>(options.msFilename.c_str()), options.msFilename.size());
-	
-	boost::asio::write(_socket, boost::asio::buffer(reqBuffer.str()));
-	
-	std::cout << "Requesting antenna tables from " << Hostname() << "...\n";
-	
-	prepareBuffer(sizeof(GenericReadResponseHeader));
-	boost::asio::async_read(_socket, boost::asio::buffer(_buffer, sizeof(GenericReadResponseHeader)),
-		boost::bind(&ServerConnection::onReceiveAntennaTablesResponseHeader, shared_from_this()));
-}
-
-void ServerConnection::ReadBandTable(const std::string &msFilename, BandInfo &band)
-{
-	_band = &band;
-	
-	std::cout << "Requesting band table from " << Hostname() << "...\n";
-	std::stringstream reqBuffer;
-	
-	RequestBlock requestBlock;
-	ReadBandTableRequestOptions options;
-	
-	requestBlock.blockIdentifier = RequestId;
-	requestBlock.blockSize = sizeof(requestBlock);
-	requestBlock.dataSize = sizeof(options.flags) + msFilename.size();
-	requestBlock.request = ReadBandTableRequest;
-	reqBuffer.write(reinterpret_cast<char *>(&requestBlock), sizeof(requestBlock));
-	
-	options.flags = 0;
-	options.msFilename = msFilename;
-	reqBuffer.write(reinterpret_cast<char *>(&options.flags), sizeof(options.flags));
-	reqBuffer.write(reinterpret_cast<const char *>(options.msFilename.c_str()), options.msFilename.size());
-	
-	boost::asio::write(_socket, boost::asio::buffer(reqBuffer.str()));
-	
-	prepareBuffer(sizeof(GenericReadResponseHeader));
-	boost::asio::async_read(_socket, boost::asio::buffer(_buffer, sizeof(GenericReadResponseHeader)),
-		boost::bind(&ServerConnection::onReceiveBandTableResponseHeader, shared_from_this()));
-}
-
-void ServerConnection::ReadDataRows(const std::string &msFilename, size_t rowStart, size_t rowCount, MSRowDataExt *destinationArray)
-{
-	_readRowData = destinationArray;
-	
-	std::stringstream reqBuffer;
-	
-	RequestBlock requestBlock;
-	ReadDataRowsRequestOptions options;
-	
-	requestBlock.blockIdentifier = RequestId;
-	requestBlock.blockSize = sizeof(requestBlock);
-	requestBlock.dataSize = sizeof(options.flags) + msFilename.size() + sizeof(options.startRow) + sizeof(options.rowCount);
-	requestBlock.request = ReadDataRowsRequest;
-	reqBuffer.write(reinterpret_cast<char *>(&requestBlock), sizeof(requestBlock));
-	
-	options.flags = 0;
-	options.msFilename = msFilename;
-	options.startRow = rowStart;
-	options.rowCount = rowCount;
-	
-	reqBuffer.write(reinterpret_cast<char *>(&options.flags), sizeof(options.flags));
-	reqBuffer.write(reinterpret_cast<const char *>(options.msFilename.c_str()), options.msFilename.size());
-	reqBuffer.write(reinterpret_cast<const char *>(&options.startRow), sizeof(options.startRow));
-	reqBuffer.write(reinterpret_cast<const char *>(&options.rowCount), sizeof(options.rowCount));
-	
-	boost::asio::write(_socket, boost::asio::buffer(reqBuffer.str()));
-	
-	prepareBuffer(sizeof(GenericReadResponseHeader));
-	boost::asio::async_read(_socket, boost::asio::buffer(_buffer, sizeof(GenericReadResponseHeader)),
-		boost::bind(&ServerConnection::onReceiveReadDataRowsResponseHeader, shared_from_this()));
-}
-
-void ServerConnection::WriteDataRows(const std::string &msFilename, size_t rowStart, size_t rowCount, const MSRowDataExt *rowArray)
-{
-	_writeRowData = rowArray;
-	
-	std::stringstream reqBuffer;
-	
-	RequestBlock requestBlock;
-	WriteDataRowsRequestOptions options;
-	
-	requestBlock.blockIdentifier = RequestId;
-	requestBlock.blockSize = sizeof(requestBlock);
-	requestBlock.dataSize = sizeof(options.flags) + msFilename.size() + sizeof(options.startRow) + sizeof(options.rowCount) + sizeof(options.dataSize);
-	requestBlock.request = WriteDataRowsRequest;
-	reqBuffer.write(reinterpret_cast<char *>(&requestBlock), sizeof(requestBlock));
-	
-	std::ostringstream dataBuffer;
-	// Serialize the rows
-	for(size_t rowIndex=0; rowIndex != rowCount; ++rowIndex) {
-		rowArray[rowIndex].Serialize(dataBuffer);
-	}
-	std::string dataBufferStr = dataBuffer.str();
-
-	options.flags = 0;
-	options.msFilename = msFilename;
-	options.startRow = rowStart;
-	options.rowCount = rowCount;
-	options.dataSize = dataBufferStr.size();
-	
-	reqBuffer.write(reinterpret_cast<char *>(&options.flags), sizeof(options.flags));
-	reqBuffer.write(reinterpret_cast<const char *>(options.msFilename.c_str()), options.msFilename.size());
-	reqBuffer.write(reinterpret_cast<const char *>(&options.startRow), sizeof(options.startRow));
-	reqBuffer.write(reinterpret_cast<const char *>(&options.rowCount), sizeof(options.rowCount));
-	reqBuffer.write(reinterpret_cast<const char *>(&options.dataSize), sizeof(options.dataSize));
-	
-	boost::asio::write(_socket, boost::asio::buffer(reqBuffer.str()));
-	boost::asio::write(_socket, boost::asio::buffer(dataBufferStr));
-	
-	prepareBuffer(sizeof(GenericReadResponseHeader));
-	boost::asio::async_read(_socket, boost::asio::buffer(_buffer, sizeof(GenericReadResponseHeader)),
-		boost::bind(&ServerConnection::onReceiveWriteDataRowsResponseHeader, shared_from_this()));
-}
-
-void ServerConnection::handleError(const GenericReadResponseHeader &header)
-{
-	std::stringstream s;
-	s << "Client reported \"" << ErrorStr::GetStr(header.errorCode) << '\"';
-	if(header.dataSize > 0)
-	{
-		char message[header.dataSize+1];
-		boost::asio::read(_socket, boost::asio::buffer(message, header.dataSize));
-		message[header.dataSize] = 0;
-		s << " (detailed info: " << message << ')';
-	}
-	_onError(shared_from_this(), s.str());
-}
-
-void ServerConnection::onReceiveQualityTablesResponseHeader()
-{
-	GenericReadResponseHeader responseHeader = *reinterpret_cast<GenericReadResponseHeader*>(_buffer);
-	if(responseHeader.blockIdentifier != GenericReadResponseHeaderId || responseHeader.blockSize != sizeof(responseHeader))
-	{
-		_onError(shared_from_this(), "Bad response from client upon read quality tables request");
-		StopClient();
-	}
-	else if(responseHeader.errorCode != NoError)
-	{
-		handleError(responseHeader);
-		_onAwaitingCommand(shared_from_this());
-	}
-	else {
-		prepareBuffer(responseHeader.dataSize);
-		boost::asio::async_read(_socket, boost::asio::buffer(_buffer, responseHeader.dataSize),
-			boost::bind(&ServerConnection::onReceiveQualityTablesResponseData, shared_from_this(), responseHeader.dataSize));
-	}
-}
-
-void ServerConnection::onReceiveQualityTablesResponseData(size_t dataSize)
-{
-	std::istringstream stream;
-	if(stream.rdbuf()->pubsetbuf(_buffer, dataSize) == 0)
-		throw std::runtime_error("Could not set string buffer");
-	
-	std::cout << "Received quality table of size " << dataSize << "." << std::endl;
-	_collection->Unserialize(stream);
-	if(stream.tellg() != (std::streampos) dataSize)
-	{
-		size_t histogramTablesSize = dataSize - stream.tellg();
-		std::cout << "Processing histogram tables of size " << histogramTablesSize << "." << std::endl;
-		_histogramCollection->Unserialize(stream);
-	}
-
-	_onFinishReadQualityTables(shared_from_this(), *_collection, *_histogramCollection);
-	_onAwaitingCommand(shared_from_this());
-}
-
-void ServerConnection::onReceiveAntennaTablesResponseHeader()
-{
-	GenericReadResponseHeader responseHeader = *reinterpret_cast<GenericReadResponseHeader*>(_buffer);
-	if(responseHeader.blockIdentifier != GenericReadResponseHeaderId || responseHeader.blockSize != sizeof(responseHeader))
-	{
-		_onError(shared_from_this(), "Bad response from client upon read antenna tables request");
-		StopClient();
-	}
-	else if(responseHeader.errorCode != NoError)
-	{
-		handleError(responseHeader);
-		_onAwaitingCommand(shared_from_this());
-	}
-	else {
-		prepareBuffer(responseHeader.dataSize);
-		boost::asio::async_read(_socket, boost::asio::buffer(_buffer, responseHeader.dataSize),
-			boost::bind(&ServerConnection::onReceiveAntennaTablesResponseData, shared_from_this(), responseHeader.dataSize));
-	}
-}
-
-void ServerConnection::onReceiveBandTableResponseHeader()
-{
-	GenericReadResponseHeader responseHeader = *reinterpret_cast<GenericReadResponseHeader*>(_buffer);
-	if(responseHeader.blockIdentifier != GenericReadResponseHeaderId || responseHeader.blockSize != sizeof(responseHeader))
-	{
-		_onError(shared_from_this(), "Bad response from client upon read band table request");
-		StopClient();
-	}
-	else if(responseHeader.errorCode != NoError)
-	{
-		handleError(responseHeader);
-		_onAwaitingCommand(shared_from_this());
-	}
-	else {
-		prepareBuffer(responseHeader.dataSize);
-		boost::asio::async_read(_socket, boost::asio::buffer(_buffer, responseHeader.dataSize),
-			boost::bind(&ServerConnection::onReceiveBandTableResponseData, shared_from_this(), responseHeader.dataSize));
-	}
-}
-
-void ServerConnection::onReceiveAntennaTablesResponseData(size_t dataSize)
-{
-	std::istringstream stream;
-	if(stream.rdbuf()->pubsetbuf(_buffer, dataSize) == 0)
-		throw std::runtime_error("Could not set string buffer");
-	
-	std::cout << "Received antenna table of size " << dataSize << "." << std::endl;
-	size_t polarizationCount = Serializable::UnserializeUInt32(stream);
-	size_t count = Serializable::UnserializeUInt32(stream);
-	for(size_t i=0;i<count;++i)
-	{
-		_antennas->push_back(AntennaInfo());
-		_antennas->rbegin()->Unserialize(stream);
-	}
-
-	_onFinishReadAntennaTables(shared_from_this(), _antennas, polarizationCount);
-	_onAwaitingCommand(shared_from_this());
-}
-
-void ServerConnection::onReceiveBandTableResponseData(size_t dataSize)
-{
-	std::istringstream stream;
-	if(stream.rdbuf()->pubsetbuf(_buffer, dataSize) == 0)
-		throw std::runtime_error("Could not set string buffer");
-	
-	_band->Unserialize(stream);
-
-	_onFinishReadBandTable(shared_from_this(), *_band);
-	_onAwaitingCommand(shared_from_this());
-}
-
-void ServerConnection::onReceiveReadDataRowsResponseHeader()
-{
-	GenericReadResponseHeader responseHeader = *reinterpret_cast<GenericReadResponseHeader*>(_buffer);
-	if(responseHeader.blockIdentifier != GenericReadResponseHeaderId || responseHeader.blockSize != sizeof(responseHeader))
-	{
-		_onError(shared_from_this(), "Bad response from client upon read data rows request");
-		StopClient();
-	}
-	else if(responseHeader.errorCode != NoError)
-	{
-		handleError(responseHeader);
-		_onAwaitingCommand(shared_from_this());
-	}
-	else {
-		prepareBuffer(responseHeader.dataSize);
-		boost::asio::async_read(_socket, boost::asio::buffer(_buffer, responseHeader.dataSize),
-			boost::bind(&ServerConnection::onReceiveReadDataRowsResponseData, shared_from_this(), responseHeader.dataSize));
-	}
-}
-
-void ServerConnection::onReceiveReadDataRowsResponseData(size_t dataSize)
-{
-	std::istringstream stream;
-	if(stream.rdbuf()->pubsetbuf(_buffer, dataSize) == 0)
-		throw std::runtime_error("Could not set string buffer");
-	
-	size_t rowsSent = Serializable::UnserializeUInt64(stream);
-	size_t rowsTotal = 0;
-	if(rowsSent == 0)
-		rowsTotal = Serializable::UnserializeUInt64(stream);
-	for(size_t i=0;i<rowsSent;++i)
-		_readRowData[i].Unserialize(stream);
-
-	_onFinishReadDataRows(shared_from_this(), _readRowData, rowsTotal);
-	_onAwaitingCommand(shared_from_this());
-}
-
-void ServerConnection::onReceiveWriteDataRowsResponseHeader()
-{
-	GenericReadResponseHeader responseHeader = *reinterpret_cast<GenericReadResponseHeader*>(_buffer);
-	if(responseHeader.blockIdentifier != GenericReadResponseHeaderId || responseHeader.blockSize != sizeof(responseHeader))
-	{
-		_onError(shared_from_this(), "Bad response from client upon write data rows request");
-		StopClient();
-	}
-	else if(responseHeader.errorCode != NoError)
-	{
-		handleError(responseHeader);
-		_onAwaitingCommand(shared_from_this());
-	}
-	else if(responseHeader.dataSize != 0) {
-		_onError(shared_from_this(), "Client sent unexpected data during write rows action");
-		StopClient();
-	} else {
-		_onAwaitingCommand(shared_from_this());
-	}
-}
-
-}
-
diff --git a/CEP/DP3/AOFlagger/src/rficonsole.cpp b/CEP/DP3/AOFlagger/src/rficonsole.cpp
deleted file mode 100644
index 06b127657e57903f2a38af2d913210344713876a..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/rficonsole.cpp
+++ /dev/null
@@ -1,318 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#include <iostream>
-
-#include <libgen.h>
-
-#include <AOFlagger/strategy/actions/foreachmsaction.h>
-#include <AOFlagger/strategy/actions/strategyaction.h>
-
-#include <AOFlagger/strategy/algorithms/baselineselector.h>
-#include <AOFlagger/strategy/algorithms/polarizationstatistics.h>
-
-#include <AOFlagger/strategy/plots/antennaflagcountplot.h>
-#include <AOFlagger/strategy/plots/frequencyflagcountplot.h>
-#include <AOFlagger/strategy/plots/timeflagcountplot.h>
-
-#include <AOFlagger/strategy/control/artifactset.h>
-#include <AOFlagger/strategy/control/strategyreader.h>
-
-#include <AOFlagger/util/aologger.h>
-#include <AOFlagger/util/parameter.h>
-#include <AOFlagger/util/progresslistener.h>
-#include <AOFlagger/util/stopwatch.h>
-
-#include <AOFlagger/configuration.h>
-
-#ifdef HAS_LOFARSTMAN
-#include <LofarStMan/Register.h>
-#endif // HAS_LOFARSTMAN
-
-#include <boost/date_time/posix_time/posix_time.hpp>
-
-class ConsoleProgressHandler : public ProgressListener {
-	private:
-		boost::mutex _mutex;
-		
-	public:
-		
-		virtual void OnStartTask(const rfiStrategy::Action &action, size_t taskNo, size_t taskCount, const std::string &description, size_t weight)
-		{
-			boost::mutex::scoped_lock lock(_mutex);
-			ProgressListener::OnStartTask(action, taskNo, taskCount, description, weight);
-			
-			double totalProgress = TotalProgress();
-			
-			AOLogger::Progress << round(totalProgress*1000.0)/10.0 << "% : ";
-			
-			for(size_t i=1;i<Depth();++i)
-				AOLogger::Progress << "+-";
-			
-			AOLogger::Progress << description << "... \n";
-		}
-		
-		virtual void OnEndTask(const rfiStrategy::Action &action)
-		{
-			boost::mutex::scoped_lock lock(_mutex);
-			
-			ProgressListener::OnEndTask(action);
-		}
-
-		virtual void OnProgress(const rfiStrategy::Action &action, size_t i, size_t j)
-		{
-			ProgressListener::OnProgress(action, i, j);
-		}
-
-		virtual void OnException(const rfiStrategy::Action &, std::exception &thrownException) 
-		{
-			AOLogger::Error << thrownException.what() << '\n';
-		}
-};
-
-#define RETURN_SUCCESS                0
-#define RETURN_CMDLINE_ERROR         10
-#define RETURN_STRATEGY_PARSE_ERROR  20
-#define RETURN_UNHANDLED_EXCEPTION   30
-
-void checkRelease()
-{
-#ifndef NDEBUG
-		AOLogger::Warn
-			<< "This version of RFI console has been compiled as DEBUG version! (NDEBUG was not defined)\n"
-			<< "For better performance, recompile it as a RELEASE.\n\n";
-#endif
-}
-
-int main(int argc, char **argv)
-{
-	if(argc == 1)
-	{
-		AOLogger::Init(basename(argv[0]), true);
-		AOLogger::Error << "Usage: " << argv[0] << " [-v] [-j <threadcount>] [-strategy <file.rfis>] [-indirect-read] [-nolog] [-skip-flagged] <ms1> [<ms2> [..]]\n"
-		"  -v will produce verbose output\n"
-		"  -j overrides the number of threads specified in the strategy\n"
-		"  -strategy specifies a possible customized strategy\n"
-		"  -indirect-read will reorder the measurement set before starting, which is normally faster\n"
-		"  -memory-read will read the entire measurement set in memory. This is the fastest, but requires large memory.\n"
-		"  -direct-read will perform the slowest IO but will always work.\n"
-		"  -auto-read-mode will select either memory or direct mode based on available memory (default).\n"
-		"  -log will use the LOFAR logger to output logging messages\n"
-		"  -nolog will not use the LOFAR logger to output logging messages (default)\n"
-		"  -skip-flagged will skip an ms if it has already been processed by RFI console according\n"
-		"   to its HISTORY table.\n"
-		"  -uvw reads uvw values (some strategies require them)\n"
-		"  -column <NAME> specify column to flag\n"
-		"Execute 'rfistrategy' without parameters for help on creating RFIS strategies.\n";
-		
-		checkRelease();
-		
-		return RETURN_CMDLINE_ERROR;
-	}
-	
-#ifdef HAS_LOFARSTMAN
-	register_lofarstman();
-#endif // HAS_LOFARSTMAN
-	
-	Parameter<size_t> threadCount;
-	Parameter<BaselineIOMode> readMode;
-	Parameter<bool> readUVW;
-	Parameter<std::string> strategyFile;
-	Parameter<bool> useLogger;
-	Parameter<bool> logVerbose;
-	Parameter<bool> skipFlagged;
-	Parameter<std::string> dataColumn;
-
-	size_t parameterIndex = 1;
-	while(parameterIndex < (size_t) argc && argv[parameterIndex][0]=='-')
-	{
-		std::string flag(argv[parameterIndex]+1);
-		if(flag=="j" && parameterIndex < (size_t) (argc-1))
-		{
-			threadCount = atoi(argv[parameterIndex+1]);
-			parameterIndex+=2;
-		}
-		else if(flag=="v")
-		{
-			logVerbose = true;
-			++parameterIndex;
-		}
-		else if(flag=="direct-read")
-		{
-			readMode = DirectReadMode;
-			++parameterIndex;
-		}
-		else if(flag=="indirect-read")
-		{
-			readMode = IndirectReadMode;
-			++parameterIndex;
-		}
-		else if(flag=="memory-read")
-		{
-			readMode = MemoryReadMode;
-			++parameterIndex;
-		}
-		else if(flag=="auto-read-mode")
-		{
-			readMode = AutoReadMode;
-			++parameterIndex;
-		}
-		else if(flag=="strategy")
-		{
-			strategyFile = argv[parameterIndex+1];
-			parameterIndex+=2;
-		}
-		else if(flag=="nolog")
-		{
-			useLogger = false;
-			++parameterIndex;
-		}
-		else if(flag=="skip-flagged")
-		{
-			skipFlagged = true;
-			++parameterIndex;
-		}
-		else if(flag=="uvw")
-		{
-			readUVW = true;
-			++parameterIndex;
-		}
-		else if(flag == "column")
-		{
-			string columnStr(argv[parameterIndex+1]);
-			parameterIndex+=2;
-			dataColumn = columnStr; 
-		}
-		else
-		{
-			AOLogger::Init(basename(argv[0]), useLogger.Value(true));
-			AOLogger::Error << "Incorrect usage; parameter \"" << argv[parameterIndex] << "\" not understood.\n";
-			return 1;
-		}
-	}
-
-	try {
-		AOLogger::Init(basename(argv[0]), useLogger.Value(true), logVerbose.Value(false));
-		AOLogger::Info << 
-			"RFI strategy console runner\n"
-			"This program will execute an RFI strategy as can be created with the RFI gui\n"
-			"or a console program called rfistrategy, and executes it on one or several .MS\n"
-			"directories.\n\n"
-			"Author: André Offringa (offringa@astro.rug.nl)\n\n";
-			
-		checkRelease();
-
-		if(threadCount.IsSet())
-			AOLogger::Debug << "Number of threads: " << threadCount.Value() << "\n";
-
-		Stopwatch watch(true);
-
-		boost::mutex ioMutex;
-		
-		rfiStrategy::Strategy *subStrategy;
-		if(!strategyFile.IsSet())
-		{
-			subStrategy = new rfiStrategy::Strategy();
-			subStrategy->LoadDefaultStrategy();
-		} else {
-			rfiStrategy::StrategyReader reader;
-			try {
-				AOLogger::Debug << "Opening strategy file '" << strategyFile.Value() << "'\n";
-				subStrategy = reader.CreateStrategyFromFile(strategyFile);
-				AOLogger::Debug << "Strategy parsed succesfully.\n";
-			} catch(std::exception &e)
-			{
-				AOLogger::Error <<
-					"ERROR: Reading strategy file \"" << strategyFile.Value() << "\" failed! This\n"
-					"might be caused by a change in the file format of the strategy file after you\n"
-					"created the strategy file, as it is still rapidly changing.\n"
-					"Try recreating the file with rfistrategy.\n"
-					"\nThe thrown exception was:\n" << e.what() << "\n";
-				return RETURN_STRATEGY_PARSE_ERROR;
-			}
-		}
-		if(threadCount.IsSet())
-			rfiStrategy::Strategy::SetThreadCount(*subStrategy, threadCount);
-			
-		rfiStrategy::ForEachMSAction *fomAction = new rfiStrategy::ForEachMSAction();
-		if(readMode.IsSet())
-			fomAction->SetIOMode(readMode);
-		if(readUVW.IsSet())
-			fomAction->SetReadUVW(readUVW);
-		if(dataColumn.IsSet())
-			fomAction->SetDataColumnName(dataColumn);
-		std::stringstream commandLineStr;
-		commandLineStr << argv[0];
-		for(int i=1;i<argc;++i)
-		{
-			commandLineStr << " \"" << argv[i] << '\"';
-		}
-		fomAction->SetCommandLineForHistory(commandLineStr.str());
-		if(skipFlagged.IsSet())
-			fomAction->SetSkipIfAlreadyProcessed(skipFlagged);
-		for(int i=parameterIndex;i<argc;++i)
-		{
-			AOLogger::Debug << "Adding '" << argv[i] << "'\n";
-			fomAction->Filenames().push_back(argv[i]);
-		}
-		fomAction->Add(subStrategy);
-		
-		rfiStrategy::Strategy overallStrategy;
-		overallStrategy.Add(fomAction);
-
-		rfiStrategy::ArtifactSet artifacts(&ioMutex);
-		artifacts.SetAntennaFlagCountPlot(new AntennaFlagCountPlot());
-		artifacts.SetFrequencyFlagCountPlot(new FrequencyFlagCountPlot());
-		artifacts.SetTimeFlagCountPlot(new TimeFlagCountPlot());
-		artifacts.SetPolarizationStatistics(new PolarizationStatistics());
-		artifacts.SetBaselineSelectionInfo(new rfiStrategy::BaselineSelector());
-		
-		ConsoleProgressHandler progress;
-
-		AOLogger::Info << "Starting strategy on " << to_simple_string(boost::posix_time::microsec_clock::local_time()) << '\n';
-		
-		overallStrategy.InitializeAll();
-		overallStrategy.StartPerformThread(artifacts, progress);
-		rfiStrategy::ArtifactSet *set = overallStrategy.JoinThread();
-		overallStrategy.FinishAll();
-
-		set->AntennaFlagCountPlot()->Report();
-		set->FrequencyFlagCountPlot()->Report();
-		set->PolarizationStatistics()->Report();
-
-		delete set->AntennaFlagCountPlot();
-		delete set->FrequencyFlagCountPlot();
-		delete set->TimeFlagCountPlot();
-		delete set->PolarizationStatistics();
-		delete set->BaselineSelectionInfo();
-
-		delete set;
-
-		AOLogger::Debug << "Time: " << watch.ToString() << "\n";
-		
-		return RETURN_SUCCESS;
-	} catch(std::exception &exception)
-	{
-		std::cerr
-			<< "An unhandled exception occured: " << exception.what() << '\n'
-			<< "If you think this is a bug, please contact offringa@astro.rug.nl\n";
-		return RETURN_UNHANDLED_EXCEPTION;
-	}
-}
diff --git a/CEP/DP3/AOFlagger/src/rfigui.cpp b/CEP/DP3/AOFlagger/src/rfigui.cpp
deleted file mode 100644
index 096f238bad80f614b11d37d023bba5d5304270e3..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/rfigui.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#include <libgen.h>
-
-#include <AOFlagger/gui/application.h>
-
-#include <AOFlagger/util/aologger.h>
-
-#include <glibmm/error.h>
-#include <glibmm/wrap.h>
-
-int main(int argc, char *argv[])
-{
-	
-	AOLogger::Init(basename(argv[0]), false, true);
-
-	{
-		Application application;
-		application.Run(argc, argv);
-	}
-	
-	Glib::Error::register_cleanup();
-	Glib::wrap_register_cleanup();
-	
-	return 0;
-}
diff --git a/CEP/DP3/AOFlagger/src/rfihistory.cpp b/CEP/DP3/AOFlagger/src/rfihistory.cpp
deleted file mode 100644
index 84c6eef95ade5ac4c4a82b5f2a1c1264abe892ba..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/rfihistory.cpp
+++ /dev/null
@@ -1,75 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#include <iostream>
-
-#include <libgen.h>
-
-#include <ms/MeasurementSets/MeasurementSet.h>
-#include <ms/MeasurementSets/MSTable.h>
-#include <ms/MeasurementSets/MSColumns.h>
-
-#include <AOFlagger/msio/date.h>
-
-#ifdef HAS_LOFARSTMAN
-#include <LofarStMan/Register.h>
-#endif // HAS_LOFARSTMAN
-
-int main(int argc, char **argv)
-{
-	if(argc != 2)
-	{
-		std::cout << "Usage: " << argv[0] << " <ms1>\n"
-		"This program will list the RFI actions that have been performed on the measurement \n"
-		"set, by reading the HISTORY table in the set.\n";
-	}
-	else
-	{
-#ifdef HAS_LOFARSTMAN
-		register_lofarstman();
-#endif // HAS_LOFARSTMAN
-
-		std::ostream &stream(std::cout);
-
-		casa::MeasurementSet ms(argv[1]);
-		casa::Table histtab(ms.history());
-		casa::ROScalarColumn<double>       time        (histtab, "TIME");
-		casa::ROScalarColumn<casa::String> application (histtab, "APPLICATION");
-		casa::ROArrayColumn<casa::String>  cli         (histtab, "CLI_COMMAND");
-		casa::ROArrayColumn<casa::String>  parms       (histtab, "APP_PARAMS");
-		for(unsigned i=0;i<histtab.nrow();++i)
-		{
-			if(application(i) == "AOFlagger")
-			{
-				stream << "====================\n"
-					"Command: " << cli(i)[0] << "\n"
-					"Date: " << Date::AipsMJDToDateString(time(i)) << "\n"
-					"Time: " << Date::AipsMJDToTimeString(time(i)) << "\n"
-					"Strategy: \n     ----------     \n";
-				const casa::Vector<casa::String> appParamsVec = parms(i);
-				for(casa::Vector<casa::String>::const_iterator j=appParamsVec.begin();j!=appParamsVec.end();++j)
-				{
-					stream << *j << '\n';
-				}
-				stream << "     ----------     \n";
-			}
-		}
-	}
-}
diff --git a/CEP/DP3/AOFlagger/src/rfistatcollect.cpp b/CEP/DP3/AOFlagger/src/rfistatcollect.cpp
deleted file mode 100644
index c4ab5e5468776a9b3084ee245e56c5f372dc45e6..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/rfistatcollect.cpp
+++ /dev/null
@@ -1,473 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#include <iostream>
-#include <fstream>
-#include <stdexcept>
-#include <map>
-#include <cmath>
-#include <iomanip>
-
-#include <AOFlagger/msio/date.h>
-
-#include <AOFlagger/strategy/algorithms/rfistatistics.h>
-#include <AOFlagger/strategy/algorithms/noisestatistics.h>
-#include <AOFlagger/strategy/algorithms/noisestatisticscollector.h>
-
-#include <AOFlagger/util/rng.h>
-
-using namespace std;
-
-void readChannels(RFIStatistics &statistics, string &filename, bool autocorrelation)
-{
-	ifstream f(filename.c_str());
-	string headers;
-	getline(f, headers);
-	while(!f.eof())
-	{
-		RFIStatistics::ChannelInfo channel;
-		f
-		>> channel.frequencyHz;
-		if(f.eof()) break;
-		f
-		>> channel.totalCount
-		>> channel.totalAmplitude
-		>> channel.rfiCount
-		>> channel.rfiAmplitude
-		>> channel.broadbandRfiCount
-		>> channel.lineRfiCount
-		>> channel.broadbandRfiAmplitude
-		>> channel.lineRfiAmplitude
-		>> channel.falsePositiveCount
-		>> channel.falseNegativeCount
-		>> channel.truePositiveCount
-		>> channel.trueNegativeCount
-		>> channel.falsePositiveAmplitude
-		>> channel.falseNegativeAmplitude;
-		statistics.Add(channel, autocorrelation);
-	}
-}
-
-void readTimesteps(RFIStatistics &statistics, string &filename, bool autocorrelation)
-{
-	ifstream f(filename.c_str());
-	string headers;
-	getline(f, headers);
-	while(!f.eof())
-	{
-		RFIStatistics::TimestepInfo timestep;
-		f
-		>> timestep.time;
-		if(f.eof()) break;
-		f
-		>> timestep.totalCount
-		>> timestep.totalAmplitude
-		>> timestep.rfiCount
-		>> timestep.rfiAmplitude
-		>> timestep.broadbandRfiCount
-		>> timestep.lineRfiCount
-		>> timestep.broadbandRfiAmplitude
-		>> timestep.lineRfiAmplitude;
-		statistics.Add(timestep, autocorrelation);
-	}
-}
-
-void readAmplitudes(RFIStatistics &statistics, string &filename, bool autocorrelation)
-{
-	ifstream f(filename.c_str());
-	string headers;
-	getline(f, headers);
-	double maxCount = 0.0;
-	double maxAmp = 0.0;
-	while(f.good())
-	{
-		double centralLogAmplitude;
-		RFIStatistics::AmplitudeBin amplitude;
-		f
-		>> amplitude.centralAmplitude;
-		if(!f.good()) break;
-		f
-		>> centralLogAmplitude
-		>> amplitude.count
-		>> amplitude.rfiCount
-		>> amplitude.broadbandRfiCount
-		>> amplitude.lineRfiCount
-		>> amplitude.featureAvgCount
-		>> amplitude.featureIntCount
-		>> amplitude.featureMaxCount
-		>> amplitude.xxCount
-		>> amplitude.xyCount
-		>> amplitude.yxCount
-		>> amplitude.yyCount
-		>> amplitude.xxRfiCount
-		>> amplitude.xyRfiCount
-		>> amplitude.yxRfiCount
-		>> amplitude.yyRfiCount
-		>> amplitude.stokesQCount
-		>> amplitude.stokesUCount
-		>> amplitude.stokesVCount
-		>> amplitude.falsePositiveCount
-		>> amplitude.falseNegativeCount
-		>> amplitude.truePositiveCount
-		>> amplitude.trueNegativeCount;
-		statistics.Add(amplitude, autocorrelation);
-		if(amplitude.count/amplitude.centralAmplitude > maxCount)
-		{
-			maxCount = amplitude.count/amplitude.centralAmplitude;
-			maxAmp = amplitude.centralAmplitude;
-		}
-	}
-	std::cout << std::setprecision(14) << " mode~=" << maxAmp << '(' << maxCount << ')' << '\n';
-}
-
-void readBaselines(RFIStatistics &statistics, string &filename)
-{
-	ifstream f(filename.c_str());
-	string headers;
-	getline(f, headers);
-	while(!f.eof())
-	{
-		RFIStatistics::BaselineInfo baseline;
-		f
-		>> baseline.antenna1;
-		if(f.eof()) break;
-		f
-		>> baseline.antenna2
-		>> baseline.antenna1Name
-		>> baseline.antenna2Name
-		>> baseline.baselineLength
-		>> baseline.baselineAngle
-		>> baseline.count
-		>> baseline.totalAmplitude
-		>> baseline.rfiCount
-		>> baseline.broadbandRfiCount
-		>> baseline.lineRfiCount
-		>> baseline.rfiAmplitude
-		>> baseline.broadbandRfiAmplitude
-		>> baseline.lineRfiAmplitude;
-		statistics.Add(baseline);
-	}
-}
-
-void readBaselineTime(RFIStatistics &statistics, string &filename)
-{
-	ifstream f(filename.c_str());
-	string headers;
-	getline(f, headers);
-	while(!f.eof())
-	{
-		RFIStatistics::BaselineTimeInfo info;
-		f
-		>> info.antenna1Index;
-		if(f.eof()) break;
-		f
-		>> info.antenna2Index
-		>> info.time
-		>> info.totalCount
-		>> info.rfiCount;
-		statistics.Add(info);
-	}
-}
-
-void readBaselineFrequency(RFIStatistics &statistics, string &filename)
-{
-	ifstream f(filename.c_str());
-	string headers;
-	getline(f, headers);
-	while(!f.eof())
-	{
-		RFIStatistics::BaselineFrequencyInfo info;
-		f
-		>> info.antenna1Index;
-		if(f.eof()) break;
-		f
-		>> info.antenna2Index
-		>> info.centralFrequency
-		>> info.totalCount
-		>> info.rfiCount;
-		statistics.Add(info);
-	}
-}
-
-void readTimeFrequency(RFIStatistics &statistics, string &filename, bool autocorrelation)
-{
-	ifstream f(filename.c_str());
-	string headers;
-	getline(f, headers);
-	while(!f.eof())
-	{
-		RFIStatistics::TimeFrequencyInfo info;
-		f
-		>> info.time;
-		if(f.eof()) break;
-		f
-		>> info.centralFrequency
-		>> info.totalCount
-		>> info.rfiCount
-		>> info.totalAmplitude
-		>> info.rfiAmplitude;
-		statistics.Add(info, autocorrelation);
-	}
-}
-
-void fitGaus(RFIStatistics &statistics)
-{
-	const std::map<double, class RFIStatistics::AmplitudeBin> &amplitudes = statistics.GetCrossAmplitudes();
-	
-	std::map<double, long unsigned> distribution;
-	for(std::map<double, class RFIStatistics::AmplitudeBin>::const_iterator i=amplitudes.begin();i!=amplitudes.end();++i)
-	{
-		distribution.insert(std::pair<double, long unsigned>(i->first, i->second.featureAvgCount));
-	}
-	if(!distribution.empty())
-	{
-		// Find largest value
-		long unsigned max = distribution.begin()->second;
-		double ampOfMax = distribution.begin()->first;
-		for(std::map<double, long unsigned>::const_iterator i=distribution.begin();i!=distribution.end();++i)
-		{
-			if(i->second > max) {
-				max = i->second;
-				ampOfMax = i->first;
-			}
-		}
-		std::cout << "Maximum occurring amplitude=" << ampOfMax << std::endl;
-		std::cout << "Count=" << max << std::endl;
-		double promileArea = 0.0;
-		double promileLimit = max / 1000.0;
-		long unsigned popSize = 0;
-		for(std::map<double, long unsigned>::const_iterator i=distribution.begin();i!=distribution.end();++i)
-		{
-			if(i->second > promileLimit) {
-				promileArea += i->second;
-				//promileEnd = i->first;
-				//if(promileStart == 0.0)
-				//	promileStart = i->first;
-			}
-			popSize += i->second;
-		}
-		double halfPromileArea = promileArea / 2.0;
-		double mean = 0.0;
-		promileArea = 0.0;
-		for(std::map<double, long unsigned>::const_iterator i=distribution.begin();i!=distribution.end();++i)
-		{
-			if(i->second > promileLimit) {
-				promileArea += i->second;
-			}
-			if(promileArea > halfPromileArea)
-			{
-				mean = i->first;
-				break;
-			}
-		}
-		std::cout << "Mean=" << mean << std::endl;
-		double halfStddevArea = 0.682689492137 * halfPromileArea;
-		double stddev = 0.0;
-					// Note: need a cast to const for older compilers
-		for(std::map<double, long unsigned>::const_reverse_iterator i=distribution.rbegin();i!=static_cast<const std::map<double, long unsigned> >(distribution).rend();++i)
-		{
-			if(i->first <= mean) {
-				halfStddevArea -= i->second;
-			}
-			if(halfStddevArea <= 0.0)
-			{
-				stddev = i->first;
-				break;
-			}
-		}
-		std::cout << "Stddev=" << stddev << std::endl;
-
-		ofstream f("fit.txt");
-		f
-		<< setprecision(15)
-		<< "Amplitude\tLogAmplitude\tCount\tCount\tGaussian\tGaussian\tRayleigh\tRayleigh\n";
-		for(std::map<double, long unsigned>::const_iterator i=distribution.begin();i!=distribution.end();++i)
-		{
-			if(i != distribution.begin())
-			{
-				double g = RNG::EvaluateGaussian(i->first - mean, stddev)*popSize;
-				double r = RNG::EvaluateRayleigh(i->first, mean)*popSize;
-				double binsize = i->first / 100.0;
-				g *= binsize;
-				r *= binsize;
-				f
-				<< i->first << '\t' << log10(i->first) << '\t'
-				<< i->second << '\t' << log10(i->second) << '\t'
-				<< g << '\t' << log10(g) << '\t' << r << '\t' << log10(r) << '\n';
-			}
-		}
-	}
-}
-
-void Save(NoiseStatisticsCollector &stats, const std::string baseName)
-{
-	if(!stats.Empty())
-	{
-		stats.SaveTA(baseName + "-ta.txt");
-		stats.SaveTF(baseName + "-tf.txt");
-		stats.SaveTimeAntennaPlot(baseName + "-plotdata.txt", baseName + "-timestation.plt");
-	}
-}
-
-int main(int argc, char **argv)
-{
-	cout << 
-		"RFI statistics collector\n"
-		"This program will collect statistics of several rficonsole runs and\n"
-		"write them in one file.\n\n"
-		"Author: André Offringa (offringa@astro.rug.nl)\n"
-		<< endl;
-
-	if(argc == 1)
-	{
-		std::cerr << "Usage: " << argv[0] << " [-c <N>] [-i] [files]" << std::endl;
-	}
-	else
-	{
-		int argStart = 1;
-		int channelCount = 256;
-		bool ignoreFirst = true;
-		std::string argString(argv[argStart]);
-		while(argString.size()>0 && argString[0]=='-')
-		{
-			if(argString == "-c")
-			{
-				argStart++;
-				channelCount = atoi(argv[argStart]);
-			}
-			else if(argString == "-i")
-				ignoreFirst = false;
-			else {
-				std::cerr << "Wrong option: " << argString << "\n";
-				exit(-1);
-			}
-			++argStart;
-			if(argStart < argc)
-				argString = argv[argStart];
-			else {
-				std::cerr << "No files specified\n";
-				exit(-1);
-			}
-		}
-
-		ofstream amplitudeSlopeFile("amplitudeSlopes.txt");
-		amplitudeSlopeFile << "0.01-0.1\t10-100\tcount\n";
-		std::map<double, double> frequencyFlags;
-		std::map<double, long unsigned> timeTotalCount, timeFlagsCount;
-		RFIStatistics statistics;
-		statistics.SetIgnoreFirstChannel(ignoreFirst);
-		statistics.SetChannelCountPerSubband(channelCount);
-		
-		NoiseStatisticsCollector noise0, noise1, noise2, noise4, noise8;
-
-		for(int i=argStart;i<argc;++i)
-		{
-			string filename = argv[i];
-			cout << "Reading " << filename << "..." << endl;
-			if(filename.find("counts-channels-auto.txt")!=string::npos)
-				readChannels(statistics, filename, true);
-			else if(filename.find("counts-channels-cross.txt")!=string::npos)
-				readChannels(statistics, filename, false);
-			else if(filename.find("counts-timesteps-auto.txt")!=string::npos)
-				readTimesteps(statistics, filename, true);
-			else if(filename.find("counts-timesteps-cross.txt")!=string::npos)
-				readTimesteps(statistics, filename, false);
-			else if(filename.find("counts-amplitudes-auto.txt")!=string::npos)
-				readAmplitudes(statistics, filename, true);
-			else if(filename.find("counts-amplitudes-cross.txt")!=string::npos)
-			{
-				readAmplitudes(statistics, filename, false);
-				RFIStatistics single;
-				readAmplitudes(single, filename, false);
-				amplitudeSlopeFile
-				<< single.AmplitudeCrossSlope(0.01, 0.1) << '\t'
-				<< single.AmplitudeCrossSlope(10.0, 100.0) << '\t'
-				<< single.AmplitudeCrossCount(10.0, 100.0) << '\n';
-			}
-			else if(filename.find("counts-baselines.txt")!=string::npos)
-				readBaselines(statistics, filename);
-			else if(filename.find("counts-baseltime.txt")!=string::npos)
-				readBaselineTime(statistics, filename);
-			else if(filename.find("counts-baselfreq.txt")!=string::npos)
-				readBaselineFrequency(statistics, filename);
-			else if(filename.find("counts-timefreq-auto.txt")!=string::npos)
-				readTimeFrequency(statistics, filename, true);
-			else if(filename.find("counts-timefreq-cross.txt")!=string::npos)
-				readTimeFrequency(statistics, filename, false);
-			else if(filename.find("counts-subbands-auto.txt")!=string::npos)
-				; // skip
-			else if(filename.find("counts-subbands-cross.txt")!=string::npos)
-				; // skip
-			else if(filename.find("counts-timeint-auto.txt")!=string::npos)
-				; // skip
-			else if(filename.find("counts-timeint-cross.txt")!=string::npos)
-				; // skip
-			else if(filename.find("counts-obaselines.txt")!=string::npos)
-				; // skip
-			else if(filename.find("counts-stationstime.txt")!=string::npos)
-				; // skip
-			else if(filename.find("noise-statistics1-ta.txt")!=string::npos)
-				noise1.ReadTA(filename);
-			else if(filename.find("noise-statistics1-tf.txt")!=string::npos)
-				noise1.ReadTF(filename);
-			else if(filename.find("noise-statistics2-ta.txt")!=string::npos)
-				noise2.ReadTA(filename);
-			else if(filename.find("noise-statistics2-tf.txt")!=string::npos)
-				noise2.ReadTF(filename);
-			else if(filename.find("noise-statistics4-ta.txt")!=string::npos)
-				noise4.ReadTA(filename);
-			else if(filename.find("noise-statistics4-tf.txt")!=string::npos)
-				noise4.ReadTF(filename);
-			else if(filename.find("noise-statistics8-ta.txt")!=string::npos)
-				noise8.ReadTA(filename);
-			else if(filename.find("noise-statistics8-tf.txt")!=string::npos)
-				noise8.ReadTF(filename);
-			else if(filename.find("noise-statistics")!=string::npos)
-			{
-				if(filename.find("-ta.txt")!=string::npos)
-					noise0.ReadTA(filename);
-				else if(filename.find("-tf.txt")!=string::npos)
-					noise0.ReadTF(filename);
-				else
-					throw runtime_error("Could not determine type of noise file.");
-			}
-			else
-				throw runtime_error("Could not determine type of file.");
-		}
-		fitGaus(statistics);
-		statistics.Save();
-		std::cout << "Cross correlations: "
-		<< (round(statistics.RFIFractionInCrossChannels()*10000)/100) << "% RFI in channels, "
-		<< (round(statistics.RFIFractionInCrossTimeSteps()*10000)/100) << "% RFI in timesteps.\n"
-		<< "Auto correlations: "
-		<< (round(statistics.RFIFractionInAutoChannels()*10000)/100) << "% RFI in channels, "
-		<< (round(statistics.RFIFractionInAutoTimeSteps()*10000)/100) << "% RFI in timesteps.\n"
-		<< std::setprecision(14)
-		<< "Cross correlation slope fit between 0.01 and 0.1 amplitude: "
-		<< statistics.AmplitudeCrossSlope(0.01, 0.1) << "\n"
-		<< "Cross correlation slope fit between 10 and 100 amplitude: "
-		<< statistics.AmplitudeCrossSlope(10.0, 100.0) << "\n";
-		Save(noise0, "noise-statistics");
-		Save(noise1, "noise-statistics1");
-		Save(noise2, "noise-statistics2");
-		Save(noise4, "noise-statistics4");
-		Save(noise8, "noise-statistics8");
-	}
-}
diff --git a/CEP/DP3/AOFlagger/src/rfistrategy.cpp b/CEP/DP3/AOFlagger/src/rfistrategy.cpp
deleted file mode 100644
index b7e9e70690791a2d20f43b8343235d5d3d3db49c..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/rfistrategy.cpp
+++ /dev/null
@@ -1,223 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#include <iostream>
-#include <libgen.h>
-
-#include <AOFlagger/strategy/actions/strategyaction.h>
-
-#include <AOFlagger/strategy/control/strategyreader.h>
-#include <AOFlagger/strategy/control/strategywriter.h>
-
-#include <AOFlagger/util/aologger.h>
-#include <AOFlagger/util/parameter.h>
-
-using namespace rfiStrategy;
-using namespace std;
-
-int main(int argc, char *argv[])
-{
-	AOLogger::Init(basename(argv[0]), false);
-
-	cout << 
-			"RFI strategy file writer\n"
-			"This program will write an RFI strategy to a file, to run it with the\n"
-			"rficonsole or the rfigui.\n\n"
-			"Author: André Offringa (offringa@astro.rug.nl)\n"
-			<< endl;
-
-	Parameter<enum BaselineSelection> baselineSelection;
-	Parameter<std::string> dataColumn;
-	Parameter<bool> frequencyBasedFlagging;
-	Parameter<bool> flagStokes;
-	Parameter<size_t> threadCount;
-	Parameter<pair<double, double> > kernelSize;
-	Parameter<enum PolarisationType> polarisation;
-	Parameter<num_t> sensitivity;
-	Parameter<pair<size_t, size_t> > windowSize;
-
-	size_t parameterIndex = 1;
-	while(parameterIndex < (size_t) argc && argv[parameterIndex][0]=='-')
-	{
-		string flag(argv[parameterIndex]+1);
-
-		if(flag == "b" || flag == "baseline")
-		{
-			++parameterIndex;
-			string baselineStr(argv[parameterIndex]); 
-			if(baselineStr == "all") baselineSelection = All;
-			else if(baselineStr == "auto") baselineSelection = AutoCorrelations;
-			else if(baselineStr == "cross") baselineSelection = CrossCorrelations;
-			else throw runtime_error("Unknown baseline selection for -b");
-		}
-		else if(flag == "c" || flag == "column")
-		{
-			cerr <<
-			"ERROR: flag -" << flag << ":\n"
-			"As of June 2011, you can no longer specify the column on which a strategy\n"
-			"is applied with rfistrategy: use the -column parameter of rficonsole (or select\n"
-			"the proper column when opening the ms in rfigui)\n";
-			return 1;
-		}
-		else if(flag == "ff" || flag == "freq-based-flagging")	{ frequencyBasedFlagging = true;	}
-		else if(flag == "fs" || flag == "flag-stokes")	{ flagStokes = true; }
-		else if(flag == "j" || flag == "threads") { ++parameterIndex; threadCount = atoi(argv[parameterIndex]); }
-		else if(flag == "ks" || flag == "kernel-size")
-		{
-			++parameterIndex;
-			kernelSize = pair<double, double>( atof(argv[parameterIndex]), atof(argv[parameterIndex+1]));
-			++parameterIndex;
-		}
-		else if(flag == "p" || flag == "polarizations")
-		{
-			++parameterIndex;
-			string polStr(argv[parameterIndex]);
-			if(polStr == "all") polarisation = DipolePolarisation;
-			else if(polStr == "auto") polarisation = AutoDipolePolarisation;
-			else if(polStr == "stokesi") polarisation = StokesIPolarisation;
-			else throw runtime_error("Unknown polarisation type for -p");
-		}
-		else if(flag == "s" || flag == "sensitivity") { ++parameterIndex; sensitivity = atof(argv[parameterIndex]); }
-		else if(flag == "ws" || flag == "window-size")
-		{
-			++parameterIndex;
-			windowSize = pair<size_t, size_t>( atoi(argv[parameterIndex]), atoi(argv[parameterIndex+1]));
-			++parameterIndex;
-		}
-		else
-		{
-			cerr << "Incorrect usage; parameter \"" << argv[parameterIndex] << "\" not understood.\nType rfistrategy without parameters for a list of commands." << endl;
-			return 1;
-		}
-		++parameterIndex;
-	}
-	if((int) parameterIndex > argc-2)
-	{
-		cerr << "Usage: " << argv[0] << " [options] <profile> <filename>\n\n"
-			"Profiles:\n"
-			"  fast     Fastest strategy that provides a moderate\n"
-			"           result in quality.\n"
-			"  average  Best trade-off between speed and quality.\n"
-			"  best     Highest quality detection.\n"
-			"   NOTE: currently, all profiles perform equally. Since the speed\n"
-			"         is currently limited by IO alone, all strategies flag using\n"
-			"         the highest accuracy. This might change over time, once the\n"
-			"         IO problem has been solved.\n"
-			"  pedantic Pedantic detection. Like the 'best' profile,\n"
-			"           but will flag all channels completely that are still\n"
-			"           deviating from others after flagging. Flags about twice\n"
-			"           as much.\n"
-			"  pulsar   Like the best strategy, but will not assume\n"
-			"           smoothness in time; especially usefull for pulsar\n"
-			"           observations.\n"
-			"<filename> is the filename to which the strategy is written. This\n"
-			"file should have the extension \".rfis\".\n\n"
-			"All profiles implement the SumThreshold method. The details of this\n"
-			"method are described in the article named \"Post-correlation radio\n"
-			"frequency interference classification methods\", MNRAS 405 (2010) 155-167.\n"
-			"\n"
-			"Possible options:\n"
-//			"-a -antennae"
-			"-b or -baseline <all/auto/cross>\n"
-			"  Specify which baselines to process (default: all)\n"
-			"-c or -column <DATA/CORRECTED_DATA/...>\n"
-			"  Specify which column to use when reading the data (default: DATA)\n"
-//			"-cf or -clear-flags\n"
-//			"-f  or -freq <channel start>-<channel end>\n"
-			"-ff or -freq-based-flagging\n"
-			"  Overrides default behaviour of smoothing in both time and frequency:\n"
-			"  does not assume time smoothness. Useful e.g. if strong time-dependent\n"
-			"  sources are expected (e.g. pulsars). Default: not enabled, except in\n"
-			"  \'pulsar\' strategy.\n"
-			"-fs or -flag-stokes\n"
-			"  Will calculate the stokes I, Q, U and V components from the orthogonal\n"
-			"  components (calculated with I=XX + YY, Q=XX - YY, U=XY + YX, V=i*XY - YX),\n"
-			"  and use these values for flagging. All polarisations need to be read for this,\n"
-			"  thus this option is only useful together with '-polarizations all'.\n"
-			"-j or -threads <threadcount>\n"
-			"  Set number of threads to use. Each thread will independently process\n"
-			"  whole baselines, thus this has implications on both memory usage and\n"
-			"  CPU usage. Defaults to 3, also overridable in rficonsole.\n"
-			"-ks or -kernel-size <width> <height>\n"
-			"  Gaussian kernel size used for smoothing. Floats. \n"
-			"  Note that the temporal resolution is temporary decreased before\n"
-			"  Gaussian smoothing, which makes the kernel size three times\n"
-			"  apparantly larger.\n"
-			"  Default: 2.5(x3) time steps x 15.0 channels.\n"
-			"-p or -polarizations <all/auto/stokesi>\n"
-			"  Specify what polarizations to read and process. Independent of this setting,\n"
-			"  the flags of all polarizations will be or-ed together and all polarizations\n"
-			"  will be set to that value.\n"
-			"-s or -sensitivity <threshold factor>\n"
-			"  Set a factor that is applied to each (sum)threshold operation. Higher\n"
-			"  values mean higher thresholds, thus less flagged samples. Default: 1.\n"
-//			"-t  or -time <time start index>-<time end index>\n"
-			"-ws or -window-size <width in timesteps> <height in channels>\n"
-			"  Window size used in smoothing. Integers. \n"
-			"  Note that the temporal resolution is temporary decreased before\n"
-			"  Gaussian smoothing, which makes the window size three times\n"
-			"  apparantly larger.\n"
-			"  Default: 10(x3) time steps x 40 channels (pulsar strategy: 1 x 40)\n"
-			"\nScripts are recommended to use the long option names.\n";
-		return 1;
-	}
-
-	string profile(argv[parameterIndex]), filename(argv[parameterIndex+1]);
-
-	rfiStrategy::Strategy *strategy = new rfiStrategy::Strategy();
-	if(profile == "fast")
-		strategy->LoadFastStrategy(false, false);
-	else if(profile == "average" || profile == "default")
-		strategy->LoadAverageStrategy(false, false);
-	else if(profile == "best")
-		strategy->LoadBestStrategy(false, false);
-	else if(profile == "pedantic")
-		strategy->LoadBestStrategy(true, false);
-	else if(profile == "pulsar")
-		strategy->LoadBestStrategy(true, true);
-	else {
-		cerr << "Unknown profile: " << profile << endl;
-		return 1;
-	}
-
-	if(baselineSelection.IsSet())
-		Strategy::SetBaselines(*strategy, baselineSelection);
-	if(dataColumn.IsSet())
-		Strategy::SetDataColumnName(*strategy, dataColumn);
-	if(flagStokes.IsSet())
-		Strategy::SetFlagStokes(*strategy, flagStokes.Value());
-	if(frequencyBasedFlagging.IsSet() && frequencyBasedFlagging.Value())
-		Strategy::SetTransientCompatibility(*strategy);
-	if(threadCount.IsSet())
-		Strategy::SetThreadCount(*strategy, threadCount);
-	if(kernelSize.IsSet())
-		Strategy::SetFittingKernelSize(*strategy, kernelSize.Value().first, kernelSize.Value().second);
-	if(polarisation.IsSet())
-		Strategy::SetPolarisations(*strategy, polarisation);
-	if(sensitivity.IsSet())
-		Strategy::SetMultiplySensitivity(*strategy, sensitivity);
-	if(windowSize.IsSet())
-		Strategy::SetFittingWindowSize(*strategy, windowSize.Value().first, windowSize.Value().second);
-
-	rfiStrategy::StrategyWriter writer;
-	cout << "Writing strategy..." << endl;
-	writer.WriteToFile(*strategy, filename);
-	delete strategy;
-}
diff --git a/CEP/DP3/AOFlagger/src/strategy/actions/baselineselectionaction.cpp b/CEP/DP3/AOFlagger/src/strategy/actions/baselineselectionaction.cpp
deleted file mode 100644
index 859a950d632cdb1eb5b72eeb599b755d8f22d146..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/strategy/actions/baselineselectionaction.cpp
+++ /dev/null
@@ -1,134 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#include <AOFlagger/strategy/actions/baselineselectionaction.h>
-
-#include <iostream>
-
-#include <AOFlagger/util/plot.h>
-
-#include <AOFlagger/msio/mask2d.h>
-#include <AOFlagger/msio/baselinereader.h>
-
-#include <AOFlagger/strategy/actions/strategyaction.h>
-
-#include <AOFlagger/strategy/control/artifactset.h>
-
-#include <AOFlagger/strategy/imagesets/msimageset.h>
-
-namespace rfiStrategy {
-	
-	void BaselineSelectionAction::prepare(class ArtifactSet &artifacts, class ProgressListener &)
-	{
-		if(artifacts.BaselineSelectionInfo() == 0)
-			throw BadUsageException("ArtifactSet does not have baseline selection info");
-		if(artifacts.MetaData() == 0)
-		{
-			AOLogger::Warn << "BaselineSelectionAction is used, but ArtifactSet does not have meta data\n";
-			return;
-		}
-		if(!artifacts.MetaData()->HasBaseline())
-		{
-			AOLogger::Warn << "BaselineSelectionAction is used, but ArtifactSet does not have baseline meta data\n";
-			return;
-		}
-
-		Mask2DCPtr mask = artifacts.ContaminatedData().GetSingleMask();
-
-		BaselineSelector &info = *artifacts.BaselineSelectionInfo();
-		boost::mutex::scoped_lock lock(info.Mutex());
-		info.Add(mask, artifacts.MetaData());
-	}
-	
-	void BaselineSelectionAction::mark(class ArtifactSet &artifacts, class ProgressListener &)
-	{
-		if(artifacts.BaselineSelectionInfo() == 0)
-			throw BadUsageException("ArtifactSet does not have baseline selection info");
-		BaselineSelector &info = *artifacts.BaselineSelectionInfo();
-		if(info.BaselineCount() == 0)
-			throw BadUsageException("BaselineSelectionAction wrongly used: trying to mark baselines, but baselines have not been prepared previously (you need to add a BaselineSelectionAction within a for each baseline block, that calculates the statistics and prepares selection)");
-
-		AOLogger::Debug << "Searching for bad baselines...\n";
-
-		Strategy::SyncAll(*GetRoot());
-
-		boost::mutex::scoped_lock lock(info.Mutex());
-
-		BaselineSelector &selector = *artifacts.BaselineSelectionInfo();
-		selector.SetAbsThreshold(_absThreshold);
-		selector.SetSmoothingSigma(_smoothingSigma);
-		selector.SetThreshold(_threshold);
-		
-		std::vector<BaselineSelector::SingleBaselineInfo> markedBaselines;
-		selector.Search(markedBaselines);
-		
-		if(markedBaselines.size() > 0)
-		{
-			AOLogger::Info << "Found " << markedBaselines.size() << "/" << (markedBaselines.size()+selector.BaselineCount()) << " bad baselines: ";
-			
-			std::vector<BaselineSelector::SingleBaselineInfo>::const_iterator badBaselineIter = markedBaselines.begin();
-			AOLogger::Info << badBaselineIter->antenna1Name << "x" << badBaselineIter->antenna2Name;
-			++badBaselineIter;
-			while(badBaselineIter!=markedBaselines.end())
-			{
-				AOLogger::Info << ", " << badBaselineIter->antenna1Name << "x" << badBaselineIter->antenna2Name;
-				++badBaselineIter;
-			}
-			AOLogger::Info << '\n';
-		} else {
-			AOLogger::Info << "No bad baselines found.\n";
-		}
-		
-		if(_flagBadBaselines)
-		{
-			flagBaselines(artifacts, markedBaselines);
-		} else {
-			if(markedBaselines.size() > 0)
-				AOLogger::Info <<
-					"Bad baseline finding is still experimental, please check the results.\n"
-					"These baselines have therefore NOT been flagged yet. Writing flags to\n"
-					"these baselines can be enabled by setting the flag-bad-baselines\n"
-					"property of both BaselineSelectionAction's to '1' in your strategy\n"
-					"file.\n";
-		}
-	}
-
-	void BaselineSelectionAction::flagBaselines(ArtifactSet &artifacts, const std::vector<BaselineSelector::SingleBaselineInfo> &baselines)
-	{
-		boost::mutex::scoped_lock lock(artifacts.IOMutex());
-
-		ImageSet *imageSet = artifacts.ImageSet();
-		BaselineReaderPtr reader = dynamic_cast<MSImageSet&>(*imageSet).Reader();
-
-		size_t scans = reader->Set().GetObservationTimesSet().size();
-		size_t frequencyCount = reader->Set().FrequencyCount();
-		Mask2DPtr flaggedMask = Mask2D::CreateSetMaskPtr<true>(scans, frequencyCount);
-		std::vector<Mask2DCPtr> masks;
-		for(size_t i=0;i<reader->PolarizationCount();++i)
-			masks.push_back(flaggedMask);
-
-		for(std::vector<BaselineSelector::SingleBaselineInfo>::const_iterator i=baselines.begin();
-			i!=baselines.end();++i)
-		{
-			reader->AddWriteTask(masks, i->antenna1, i->antenna2, i->band);
-		}
-		reader->PerformFlagWriteRequests();
-	}
-}
diff --git a/CEP/DP3/AOFlagger/src/strategy/actions/changeresolutionaction.cpp b/CEP/DP3/AOFlagger/src/strategy/actions/changeresolutionaction.cpp
deleted file mode 100644
index 2da91ea503ff6e0131fbe97069833f94e41550f3..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/strategy/actions/changeresolutionaction.cpp
+++ /dev/null
@@ -1,217 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <AOFlagger/strategy/actions/changeresolutionaction.h>
-
-#include <AOFlagger/strategy/control/artifactset.h>
-
-#include <stdexcept>
-#include <AOFlagger/strategy/algorithms/thresholdtools.h>
-
-namespace rfiStrategy {
-	
-	void ChangeResolutionAction::Perform(class ArtifactSet &artifacts, class ProgressListener &listener)
-	{
-		if(_timeDecreaseFactor != 1)
-		{
-			ArtifactSet artifactsCopy(artifacts);
-			artifactsCopy.SetNoImageSet();
-	
-			TimeFrequencyData oldContaminated = artifacts.ContaminatedData();
-
-			DecreaseTime(artifactsCopy.OriginalData());
-			DecreaseTime(artifactsCopy.ContaminatedData());
-			DecreaseTime(artifactsCopy.RevisedData());
-	
-			PerformFrequencyChange(artifactsCopy, listener);
-	
-			IncreaseTime(artifacts.OriginalData(), artifactsCopy.OriginalData(), false, false);
-			IncreaseTime(artifacts.ContaminatedData(), artifactsCopy.ContaminatedData(), _restoreContaminated, _restoreMasks);
-			IncreaseTime(artifacts.RevisedData(), artifactsCopy.RevisedData(), _restoreRevised, _restoreMasks);
-
-			if(_restoreRevised && !_restoreContaminated)
-			{
-				//TimeFrequencyData *contaminatedData =
-				//	TimeFrequencyData::CreateTFDataFromDiff(oldContaminated, artifacts.RevisedData());
-				//contaminatedData->SetMask(oldContaminated);
-				//artifacts.SetContaminatedData(*contaminatedData);
-				//delete contaminatedData;
-				
-				oldContaminated.Subtract(artifacts.RevisedData());
-				artifacts.SetContaminatedData(oldContaminated);
-			}
-		} else {
-			PerformFrequencyChange(artifacts, listener);
-		}
-	}
-
-	void ChangeResolutionAction::PerformFrequencyChange(class ArtifactSet &artifacts, class ProgressListener &listener)
-	{
-		if(_frequencyDecreaseFactor != 1)
-		{
-			ArtifactSet artifactsCopy(artifacts);
-			artifactsCopy.SetNoImageSet();
-	
-			TimeFrequencyData oldContaminated = artifacts.ContaminatedData();
-
-			DecreaseFrequency(artifactsCopy.OriginalData());
-			DecreaseFrequency(artifactsCopy.ContaminatedData());
-			DecreaseFrequency(artifactsCopy.RevisedData());
-	
-			ActionBlock::Perform(artifactsCopy, listener);
-	
-			IncreaseFrequency(artifacts.OriginalData(), artifactsCopy.OriginalData(), false, false);
-			IncreaseFrequency(artifacts.ContaminatedData(), artifactsCopy.ContaminatedData(), _restoreContaminated, _restoreMasks);
-			IncreaseFrequency(artifacts.RevisedData(), artifactsCopy.RevisedData(), _restoreRevised, _restoreMasks);
-
-			if(_restoreRevised)
-			{
-				TimeFrequencyData *contaminatedData =
-					TimeFrequencyData::CreateTFDataFromDiff(oldContaminated, artifacts.RevisedData());
-				contaminatedData->SetMask(oldContaminated);
-				artifacts.SetContaminatedData(*contaminatedData);
-				delete contaminatedData;
-			}
-		} else {
-			ActionBlock::Perform(artifacts, listener);
-		}
-	}
-
-	void ChangeResolutionAction::DecreaseTime(TimeFrequencyData &timeFrequencyData)
-	{
-		if(_useMaskInAveraging)
-		{
-			DecreaseTimeWithMask(timeFrequencyData);
-		}
-		else {
-			size_t imageCount = timeFrequencyData.ImageCount();
-			for(size_t i=0;i<imageCount;++i)
-			{
-				Image2DCPtr image = timeFrequencyData.GetImage(i);
-				Image2DPtr newImage = image->ShrinkHorizontally(_timeDecreaseFactor);
-				timeFrequencyData.SetImage(i, newImage);
-			}
-			size_t maskCount = timeFrequencyData.MaskCount();
-			for(size_t i=0;i<maskCount;++i)
-			{
-				Mask2DCPtr mask = timeFrequencyData.GetMask(i);
-				Mask2DPtr newMask = mask->ShrinkHorizontally(_timeDecreaseFactor);
-				timeFrequencyData.SetMask(i, newMask);
-			}
-		}
-	}
-	
-	void ChangeResolutionAction::DecreaseTimeWithMask(TimeFrequencyData &data)
-	{
-		size_t polCount = data.PolarisationCount();
-		for(size_t i=0;i<polCount;++i)
-		{
-			TimeFrequencyData *polData = data.CreateTFDataFromPolarisationIndex(i);
-			Mask2DCPtr mask = polData->GetSingleMask();
-			for(unsigned j=0;j<polData->ImageCount();++j)
-			{
-				Image2DCPtr image = polData->GetImage(j);
-				polData->SetImage(j, ThresholdTools::ShrinkHorizontally(_timeDecreaseFactor, image, mask));
-			}
-			delete polData;
-		}
-		size_t maskCount = data.MaskCount();
-		for(size_t i=0;i<maskCount;++i)
-		{
-			Mask2DCPtr mask = data.GetMask(i);
-			Mask2DPtr newMask = mask->ShrinkHorizontallyForAveraging(_timeDecreaseFactor);
-			data.SetMask(i, newMask);
-		}
-	}
-
-	void ChangeResolutionAction::DecreaseFrequency(TimeFrequencyData &timeFrequencyData)
-	{
-		size_t imageCount = timeFrequencyData.ImageCount();
-		for(size_t i=0;i<imageCount;++i)
-		{
-			Image2DCPtr image = timeFrequencyData.GetImage(i);
-			Image2DPtr newImage = image->ShrinkVertically(_frequencyDecreaseFactor);
-			timeFrequencyData.SetImage(i, newImage);
-		}
-		size_t maskCount = timeFrequencyData.MaskCount();
-		for(size_t i=0;i<maskCount;++i)
-		{
-			Mask2DCPtr mask = timeFrequencyData.GetMask(i);
-			Mask2DPtr newMask = mask->ShrinkVertically(_frequencyDecreaseFactor);
-			timeFrequencyData.SetMask(i, newMask);
-		}
-	}
-
-	void ChangeResolutionAction::IncreaseTime(TimeFrequencyData &originalData, TimeFrequencyData &changedData, bool restoreImage, bool restoreMask)
-	{
-		if(restoreImage)
-		{
-			size_t imageCount = originalData.ImageCount();
-			if(imageCount != changedData.ImageCount())
-				throw std::runtime_error("When restoring resolution in change resolution action, original data and changed data do not have the same number of images");
-			for(size_t i=0;i<imageCount;++i)
-			{
-				Image2DCPtr image = changedData.GetImage(i);
-				Image2DPtr newImage = image->EnlargeHorizontally(_timeDecreaseFactor, originalData.ImageWidth());
-				originalData.SetImage(i, newImage);
-			}
-		}
-		if(restoreMask)
-		{
-			originalData.SetMask(changedData);
-			size_t maskCount = originalData.MaskCount();
-			for(size_t i=0;i<maskCount;++i)
-			{
-				Mask2DCPtr mask = changedData.GetMask(i);
-				Mask2DPtr newMask = Mask2D::CreateUnsetMaskPtr(originalData.ImageWidth(), originalData.ImageHeight());
-				newMask->EnlargeHorizontallyAndSet(mask, _timeDecreaseFactor);
-				originalData.SetMask(i, newMask);
-			}
-		}
-	}
-
-	void ChangeResolutionAction::IncreaseFrequency(TimeFrequencyData &originalData, TimeFrequencyData &changedData, bool restoreImage, bool restoreMask)
-	{
-		if(restoreImage)
-		{
-			size_t imageCount = originalData.ImageCount();
-			if(imageCount != changedData.ImageCount())
-				throw std::runtime_error("When restoring resolution in change resolution action, original data and changed data do not have the same number of images");
-			for(size_t i=0;i<imageCount;++i)
-			{
-				Image2DCPtr image = changedData.GetImage(i);
-				Image2DPtr newImage = image->EnlargeVertically(_frequencyDecreaseFactor, originalData.ImageHeight());
-				originalData.SetImage(i, newImage);
-			}
-		}
-		if(restoreMask)
-		{
-			originalData.SetMask(changedData);
-			size_t maskCount = originalData.MaskCount();
-			for(size_t i=0;i<maskCount;++i)
-			{
-				Mask2DCPtr mask = changedData.GetMask(i);
-				Mask2DPtr newMask = Mask2D::CreateUnsetMaskPtr(originalData.ImageWidth(), originalData.ImageHeight());
-				newMask->EnlargeVerticallyAndSet(mask, _frequencyDecreaseFactor);
-				originalData.SetMask(i, newMask);
-			}
-		}
-	}
-
-}
diff --git a/CEP/DP3/AOFlagger/src/strategy/actions/foreachbaselineaction.cpp b/CEP/DP3/AOFlagger/src/strategy/actions/foreachbaselineaction.cpp
deleted file mode 100644
index 70869618603c0f78d87bf385f8e71e4051b95eac..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/strategy/actions/foreachbaselineaction.cpp
+++ /dev/null
@@ -1,391 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <AOFlagger/strategy/actions/foreachbaselineaction.h>
-
-#include <AOFlagger/msio/antennainfo.h>
-
-#include <AOFlagger/util/aologger.h>
-#include <AOFlagger/util/stopwatch.h>
-
-#include <iostream>
-#include <sstream>
-
-#include <boost/thread.hpp>
-
-#include <AOFlagger/strategy/imagesets/imageset.h>
-#include <AOFlagger/strategy/imagesets/msimageset.h>
-
-namespace rfiStrategy {
-	
-	void ForEachBaselineAction::Perform(ArtifactSet &artifacts, ProgressListener &progress)
-	{
-		if(!artifacts.HasImageSet())
-		{
-			progress.OnStartTask(*this, 0, 1, "For each baseline (no image set)");
-			progress.OnEndTask(*this);
-			AOLogger::Warn <<
-				"I executed a ForEachBaselineAction without an active imageset: something is\n"
-				"likely wrong. Check your strategy and the input files.\n";
-		} else if(_selection == Current)
-		{
-			ActionBlock::Perform(artifacts, progress);
-		} else
-		{
-			ImageSet *imageSet = artifacts.ImageSet();
-			MSImageSet *msImageSet = dynamic_cast<MSImageSet*>(imageSet);
-			if(msImageSet != 0)
-			{
-				// Check memory usage
-				ImageSetIndex *tempIndex = msImageSet->StartIndex();
-				size_t timeStepCount = msImageSet->ObservationTimesVector(*tempIndex).size();
-				delete tempIndex;
-				size_t channelCount = msImageSet->GetBandInfo(0).channels.size();
-				size_t estMemorySizePerThread = 8/*bp complex*/ * 4 /*polarizations*/ * timeStepCount * channelCount * 3 /* approx copies of the data that will be made in memory*/;
-				AOLogger::Debug << "Estimate of memory each thread will use: " << estMemorySizePerThread/(1024*1024) << " MB.\n";
-				size_t compThreadCount = _threadCount;
-				if(compThreadCount > 0) --compThreadCount;
-				if(estMemorySizePerThread * compThreadCount > 12ul*1024ul*1024ul*1024ul)
-				{
-					size_t maxThreads = (12ul * 1024ul * 1024ul * 1024ul) / estMemorySizePerThread;
-					if(maxThreads < 1) maxThreads = 1;
-					AOLogger::Warn <<
-						"WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING!\n"
-						"This measurement set is TOO LARGE to be processed with " << _threadCount << " threads!\n" <<
-						_threadCount << " threads would require " << ((estMemorySizePerThread*compThreadCount)/(1024*1024)) << " MB of memory approximately.\n"
-						"Number of threads that will actually be used: " << maxThreads << "\n"
-						"This might hurt performance a lot!\n\n";
-					_threadCount = maxThreads;
-				}
-			}
-			if(!_antennaeToSkip.empty())
-			{
-				AOLogger::Debug << "The following antenna's will be skipped: ";
-				for(std::set<size_t>::const_iterator i=_antennaeToSkip.begin();i!=_antennaeToSkip.end(); ++i)
-					AOLogger::Debug << (*i) << ' ';
-				AOLogger::Debug <<'\n';
-			}
-			if(!_antennaeToInclude.empty())
-			{
-				AOLogger::Debug << "Only the following antenna's will be included: ";
-				for(std::set<size_t>::const_iterator i=_antennaeToInclude.begin();i!=_antennaeToInclude.end(); ++i)
-					AOLogger::Debug << (*i) << ' ';
-				AOLogger::Debug <<'\n';
-			}
-
-			if(artifacts.MetaData() != 0)
-			{
-				_hasInitAntennae = true;
-				if(artifacts.MetaData()->HasAntenna1())
-					_initAntenna1 = artifacts.MetaData()->Antenna1();
-				else
-					_hasInitAntennae = false;
-				if(artifacts.MetaData()->HasAntenna2())
-					_initAntenna2 = artifacts.MetaData()->Antenna2();
-				else
-					_hasInitAntennae = false;
-			}
-			_artifacts = &artifacts;
-			if(msImageSet != 0)
-				_initPartIndex = msImageSet->GetPart(*artifacts.ImageSetIndex());
-			else
-				_initPartIndex = 0;
-
-			_finishedBaselines = false;
-			_baselineCount = 0;
-			_baselineProgress = 0;
-			_nextIndex = 0;
-			
-			// Count the baselines that are to be processed
-			ImageSetIndex *iteratorIndex = imageSet->StartIndex();
-			while(iteratorIndex->IsValid())
-			{
-				if(IsBaselineSelected(*iteratorIndex))
-					++_baselineCount;
-				iteratorIndex->Next();
-			}
-			delete iteratorIndex;
-			AOLogger::Debug << "Will process " << _baselineCount << " baselines.\n";
-			
-			// Initialize thread data and threads
-			_loopIndex = imageSet->StartIndex();
-			_progressTaskNo = new int[_threadCount];
-			_progressTaskCount = new int[_threadCount];
-			progress.OnStartTask(*this, 0, 1, "Initializing");
-
-			boost::thread_group threadGroup;
-			ReaderFunction reader(*this);
-			threadGroup.create_thread(reader);
-			
-			size_t mathThreads = mathThreadCount();
-			for(unsigned i=0;i<mathThreads;++i)
-			{
-				PerformFunction function(*this, progress, i);
-				threadGroup.create_thread(function);
-			}
-			
-			threadGroup.join_all();
-			progress.OnEndTask(*this);
-
-			if(_resultSet != 0)
-			{
-				artifacts = *_resultSet;
-				delete _resultSet;
-			}
-
-			delete[] _progressTaskCount;
-			delete[] _progressTaskNo;
-
-			delete _loopIndex;
-
-			if(_exceptionOccured)
-				throw std::runtime_error("An exception occured in one of the sub tasks of the (multi-threaded) \"For-each baseline\"-action: the RFI strategy will not continue.");
-		}
-	}
-
-	bool ForEachBaselineAction::IsBaselineSelected(ImageSetIndex &index)
-	{
-		ImageSet *imageSet = _artifacts->ImageSet();
-		MSImageSet *msImageSet = dynamic_cast<MSImageSet*>(imageSet);
-		size_t a1id, a2id;
-		if(msImageSet != 0)
-		{
-			a1id = msImageSet->GetAntenna1(index);
-			a2id = msImageSet->GetAntenna2(index);
-		} else {
-			a1id = 0;
-			a2id = 0;
-		}
-		if(_antennaeToSkip.count(a1id) != 0 || _antennaeToSkip.count(a2id) != 0)
-			return false;
-		if(!_antennaeToInclude.empty() && (_antennaeToInclude.count(a1id) == 0 && _antennaeToInclude.count(a2id) == 0))
-			return false;
-
-		switch(_selection)
-		{
-			case All:
-				return true;
-			case CrossCorrelations:
-			{
-				return a1id != a2id;
-			}
-			case AutoCorrelations:
-				return a1id == a2id;
-			case EqualToCurrent: {
-				if(!_hasInitAntennae)
-					throw BadUsageException("For each baseline over 'EqualToCurrent' with no current baseline");
-				throw BadUsageException("Not implemented");
-				/*TimeFrequencyMetaDataCPtr metaData = imageSet->LoadMetaData(index);
-				const AntennaInfo
-					&a1 = metaData->Antenna1(),
-					&a2 = metaData->Antenna2();
-				Baseline b(a1, a2);
-				Baseline initB(_initAntenna1, _initAntenna2);
-				return (roundl(b.Distance()) == roundl(initB.Distance()) &&
-					roundl(b.Angle()/5) == roundl(initB.Angle()/5));*/
-			}
-			case AutoCorrelationsOfCurrentAntennae:
-				if(!_hasInitAntennae)
-					throw BadUsageException("For each baseline over 'AutoCorrelationsOfCurrentAntennae' with no current baseline");
-				return a1id == a2id && (_initAntenna1.id == a1id || _initAntenna2.id == a1id) && _initPartIndex == static_cast<MSImageSet*>(imageSet)->GetPart(index);
-			default:
-				return false;
-		}
-	}
-
-	class ImageSetIndex *ForEachBaselineAction::GetNextIndex()
-	{
-		boost::mutex::scoped_lock lock(_mutex);
-		while(_loopIndex->IsValid())
-		{
-			if(IsBaselineSelected(*_loopIndex))
-			{
-				ImageSetIndex *newIndex = _loopIndex->Copy();
-				_loopIndex->Next();
-
-				return newIndex;
-			}
-			_loopIndex->Next();
-		}
-		return 0;
-	}
-
-	void ForEachBaselineAction::SetExceptionOccured()
-	{
-		boost::mutex::scoped_lock lock(_mutex);
-		_exceptionOccured = true;
-	}
-	
-	void ForEachBaselineAction::SetFinishedBaselines()
-	{
-		boost::mutex::scoped_lock lock(_mutex);
-		_finishedBaselines = true;
-	}
-	
-	void ForEachBaselineAction::PerformFunction::operator()()
-	{
-		ImageSet *privateImageSet = _action._artifacts->ImageSet()->Copy();
-
-		try {
-
-			boost::mutex::scoped_lock lock(_action._mutex);
-			ArtifactSet newArtifacts(*_action._artifacts);
-			lock.unlock();
-			
-			BaselineData *baseline = _action.GetNextBaseline();
-			
-			while(baseline != 0) {
-				baseline->Index().Reattach(*privateImageSet);
-				
-				std::ostringstream progressStr;
-				if(_action._hasInitAntennae)
-					progressStr << "Processing baseline " << baseline->MetaData()->Antenna1().name << " x " << baseline->MetaData()->Antenna2().name;
-				else
-					progressStr << "Processing next baseline";
-				_action.SetProgress(_progress, _action.BaselineProgress(), _action._baselineCount, progressStr.str(), _threadIndex);
-	
-				newArtifacts.SetOriginalData(baseline->Data());
-				newArtifacts.SetContaminatedData(baseline->Data());
-				TimeFrequencyData *zero = new TimeFrequencyData(baseline->Data());
-				zero->SetImagesToZero();
-				newArtifacts.SetRevisedData(*zero);
-				delete zero;
-				newArtifacts.SetImageSetIndex(&baseline->Index());
-				newArtifacts.SetMetaData(baseline->MetaData());
-
-				_action.ActionBlock::Perform(newArtifacts, *this);
-				delete baseline;
-	
-				baseline = _action.GetNextBaseline();
-				_action.IncBaselineProgress();
-			}
-	
-			if(_threadIndex == 0)
-				_action._resultSet = new ArtifactSet(newArtifacts);
-
-		} catch(std::exception &e)
-		{
-			_progress.OnException(_action, e);
-			_action.SetExceptionOccured();
-		}
-
-		delete privateImageSet;
-	}
-
-	void ForEachBaselineAction::PerformFunction::OnStartTask(const Action &/*action*/, size_t /*taskNo*/, size_t /*taskCount*/, const std::string &/*description*/, size_t /*weight*/)
-	{
-	}
-
-	void ForEachBaselineAction::PerformFunction::OnEndTask(const Action &/*action*/)
-	{
-	}
-
-	void ForEachBaselineAction::PerformFunction::OnProgress(const Action &/*action*/, size_t /*progres*/, size_t /*maxProgress*/)
-	{
-	}
-
-	void ForEachBaselineAction::PerformFunction::OnException(const Action &action, std::exception &thrownException)
-	{
-		_progress.OnException(action, thrownException);
-	}
-	
-	void ForEachBaselineAction::ReaderFunction::operator()()
-	{
-		Stopwatch watch(true);
-		bool finished = false;
-		size_t threadCount = _action.mathThreadCount();
-		size_t minRecommendedBufferSize, maxRecommendedBufferSize;
-		MSImageSet *msImageSet = dynamic_cast<MSImageSet*>(_action._artifacts->ImageSet());
-		if(msImageSet != 0)
-		{
-			minRecommendedBufferSize = msImageSet->Reader()->GetMinRecommendedBufferSize(threadCount);
-			maxRecommendedBufferSize = msImageSet->Reader()->GetMaxRecommendedBufferSize(threadCount) - _action.GetBaselinesInBufferCount();
-		} else {
-			minRecommendedBufferSize = 1;
-			maxRecommendedBufferSize = 2;
-		}
-		
-		do {
-			watch.Pause();
-			_action.WaitForBufferAvailable(minRecommendedBufferSize);
-			
-			size_t wantedCount = maxRecommendedBufferSize - _action.GetBaselinesInBufferCount();
-			size_t requestedCount = 0;
-			
-			boost::mutex::scoped_lock lock(_action._artifacts->IOMutex());
-			watch.Start();
-			
-			for(size_t i=0;i<wantedCount;++i)
-			{
-				ImageSetIndex *index = _action.GetNextIndex();
-				if(index != 0)
-				{
-					_action._artifacts->ImageSet()->AddReadRequest(*index);
-					++requestedCount;
-					delete index;
-				} else {
-					finished = true;
-					break;
-				}
-			}
-			
-			if(requestedCount > 0)
-			{
-				_action._artifacts->ImageSet()->PerformReadRequests();
-				watch.Pause();
-				
-				for(size_t i=0;i<requestedCount;++i)
-				{
-					BaselineData *baseline = _action._artifacts->ImageSet()->GetNextRequested();
-					
-					boost::mutex::scoped_lock bufferLock(_action._mutex);
-					_action._baselineBuffer.push(baseline);
-					bufferLock.unlock();
-				}
-			}
-			
-			lock.unlock();
-			
-			_action._dataAvailable.notify_all();
-			watch.Start();
-		} while(!finished);
-		_action.SetFinishedBaselines();
-		_action._dataAvailable.notify_all();
-		watch.Pause();
-		AOLogger::Debug << "Time spent on reading: " << watch.ToString() << '\n';
-	}
-
-	void ForEachBaselineAction::SetProgress(ProgressListener &progress, int no, int count, std::string taskName, int threadId)
-	{
-	  boost::mutex::scoped_lock lock(_mutex);
-		_progressTaskNo[threadId] = no;
-		_progressTaskCount[threadId] = count;
-		size_t totalCount = 0, totalNo = 0;
-		for(size_t i=0;i<_threadCount;++i)
-		{
-			totalCount += _progressTaskCount[threadId];
-			totalNo += _progressTaskNo[threadId];
-		}
-		progress.OnEndTask(*this);
-		std::stringstream str;
-		str << "T" << threadId << ": " << taskName;
-		progress.OnStartTask(*this, totalNo, totalCount, str.str());
-	}
-}
-
diff --git a/CEP/DP3/AOFlagger/src/strategy/actions/foreachmsaction.cpp b/CEP/DP3/AOFlagger/src/strategy/actions/foreachmsaction.cpp
deleted file mode 100644
index cee08592ee017127c6c7e5494334a11f6a8eb18c..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/strategy/actions/foreachmsaction.cpp
+++ /dev/null
@@ -1,139 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <AOFlagger/strategy/actions/foreachmsaction.h>
-
-#include <boost/filesystem.hpp>
-
-#include <AOFlagger/msio/measurementset.h>
-
-#include <AOFlagger/strategy/actions/strategyaction.h>
-
-#include <AOFlagger/strategy/control/artifactset.h>
-
-#include <AOFlagger/strategy/imagesets/imageset.h>
-#include <AOFlagger/strategy/imagesets/msimageset.h>
-
-#include <AOFlagger/util/aologger.h>
-#include <AOFlagger/util/progresslistener.h>
-
-namespace rfiStrategy {
-
-void ForEachMSAction::Perform(ArtifactSet &artifacts, ProgressListener &progress)
-{
-	unsigned taskIndex = 0;
-	
-	FinishAll();
-
-	for(std::vector<std::string>::const_iterator i=_filenames.begin();i!=_filenames.end();++i)
-	{
-		std::string filename = *i;
-		
-		progress.OnStartTask(*this, taskIndex, _filenames.size(), std::string("Processing measurement set ") + filename);
-		
-		bool skip = false;
-		if(_skipIfAlreadyProcessed)
-		{
-			MeasurementSet set(filename);
-			if(set.HasRFIConsoleHistory())
-			{
-				skip = true;
-				AOLogger::Info << "Skipping " << filename << ",\n"
-					"because the set contains AOFlagger history and -skip-flagged was given.\n";
-			}
-		}
-		
-		if(!skip)
-		{
-			ImageSet *imageSet = ImageSet::Create(filename, _baselineIOMode, _readUVW);
-			if(dynamic_cast<MSImageSet*>(imageSet))
-			{ 
-				MSImageSet *msImageSet = static_cast<MSImageSet*>(imageSet);
-				msImageSet->SetDataColumnName(_dataColumnName);
-				msImageSet->SetSubtractModel(_subtractModel);
-			}
-			imageSet->Initialize();
-			ImageSetIndex *index = imageSet->StartIndex();
-			artifacts.SetImageSet(imageSet);
-			artifacts.SetImageSetIndex(index);
-
-			InitializeAll();
-			
-			ActionBlock::Perform(artifacts, progress);
-			
-			FinishAll();
-
-			artifacts.SetNoImageSet();
-			delete index;
-			delete imageSet;
-
-			writeHistory(*i);
-		}
-	
-		progress.OnEndTask(*this);
-
-		
-		++taskIndex;
-	}
-
-	InitializeAll();
-}
-
-void ForEachMSAction::AddDirectory(const std::string &name)
-{
-  // get all files ending in .MS
-  boost::filesystem::path dir_path(name);
-  boost::filesystem::directory_iterator end_it;
-
-  for(boost::filesystem::directory_iterator it(dir_path); it != end_it; ++it) {
-    if( is_directory(it->status()) && extension(it->path()) == ".MS" ) {
-      _filenames.push_back( it->path().string() );
-    }
-  }
-}
-
-void ForEachMSAction::writeHistory(const std::string &filename)
-{
-	if(GetChildCount() != 0)
-	{
-		MeasurementSet ms(filename);
-		const Strategy *strategy = 0;
-		if(GetChildCount() == 1 && dynamic_cast<const Strategy*>(&GetChild(0)) != 0)
-		{
-			strategy = static_cast<const Strategy*>(&GetChild(0));
-		} else {
-			const ActionContainer *root = GetRoot();
-			if(dynamic_cast<const Strategy*>(root) != 0)
-				strategy = static_cast<const Strategy*>(root);
-		}
-		AOLogger::Debug << "Adding strategy to history table of MS...\n";
-		if(strategy != 0) {
-			try {
-				ms.AddAOFlaggerHistory(*strategy, _commandLineForHistory);
-			} catch(std::exception &e)
-			{
-				AOLogger::Warn << "Failed to write history to MS: " << e.what() << '\n';
-			}
-		}
-		else
-			AOLogger::Error << "Could not find root strategy to write to Measurement Set history table!\n";
-	}
-}
-
-}
diff --git a/CEP/DP3/AOFlagger/src/strategy/actions/frequencyselectionaction.cpp b/CEP/DP3/AOFlagger/src/strategy/actions/frequencyselectionaction.cpp
deleted file mode 100644
index a4d466445bd24415f71aacf0879635f6d78226d4..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/strategy/actions/frequencyselectionaction.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <AOFlagger/strategy/actions/frequencyselectionaction.h>
-
-#include <AOFlagger/msio/image2d.h>
-#include <AOFlagger/msio/samplerow.h>
-
-#include <AOFlagger/strategy/control/artifactset.h>
-
-namespace rfiStrategy {
-	
-void FrequencySelectionAction::Perform(ArtifactSet &artifacts, class ProgressListener &)
-{
-	Image2DCPtr image = artifacts.ContaminatedData().GetSingleImage();
-	SampleRowPtr channels = SampleRow::CreateEmpty(image->Height());
-	Mask2DPtr mask = Mask2D::CreateCopy(artifacts.ContaminatedData().GetSingleMask());
-	for(size_t y=0;y<image->Height();++y)
-	{
-		SampleRowPtr row = SampleRow::CreateFromRowWithMissings(image, mask, y);
-		channels->SetValue(y, row->RMSWithMissings());
-	}
-	bool change;
-	do {
-		num_t median = channels->MedianWithMissings();
-		num_t stddev = channels->StdDevWithMissings(median);
-		change = false;
-		for(size_t y=0;y<channels->Size();++y)
-		{
-			if(!channels->ValueIsMissing(y) && (channels->Value(y) - median > stddev * _threshold || (_clipDown && median - channels->Value(y) > stddev * _threshold)))
-			{
-				mask->SetAllHorizontally<true>(y);
-				channels->SetValueMissing(y);
-				change = true;
-			}
-		}
-	} while(change);
-	artifacts.ContaminatedData().SetGlobalMask(mask);
-}
-
-} // namespace
diff --git a/CEP/DP3/AOFlagger/src/strategy/actions/fringestopaction.cpp b/CEP/DP3/AOFlagger/src/strategy/actions/fringestopaction.cpp
deleted file mode 100644
index 07df84180ac4c12a233404b4b7b61dad5dfdddb6..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/strategy/actions/fringestopaction.cpp
+++ /dev/null
@@ -1,74 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#include <AOFlagger/util/progresslistener.h>
-
-#include <AOFlagger/strategy/actions/fringestopaction.h>
-
-#include <AOFlagger/strategy/algorithms/fringestoppingfitter.h>
-
-#include <AOFlagger/strategy/control/artifactset.h>
-
-namespace rfiStrategy {
-
-	void FringeStopAction::Perform(ArtifactSet &artifacts, class ProgressListener &listener)
-	{
-		if(!artifacts.HasMetaData())
-			throw BadUsageException("No meta data available for fringe stopping");
-		if(!artifacts.MetaData()->HasBand())
-			throw BadUsageException("Baseline band data not set");
-		if(!artifacts.MetaData()->HasAntenna1() || !artifacts.MetaData()->HasAntenna2())
-			throw BadUsageException("Baseline antenna info not set");
-		if(!artifacts.MetaData()->HasObservationTimes())
-			throw BadUsageException("Baseline observation times not set");
-
-		FringeStoppingFitter fitter;
-		fitter.SetFringesToConsider(_fringesToConsider);
-		fitter.SetMinWindowSize(_minWindowSize);
-		fitter.SetMaxWindowSize(_maxWindowSize);
-		fitter.SetFitChannelsIndividually(_fitChannelsIndividually);
-		fitter.SetMetaData(artifacts.MetaData());
-		fitter.SetNewPhaseCentreRA(_newPhaseCentreRA);
-		fitter.SetNewPhaseCentreDec(_newPhaseCentreDec);
-		fitter.Initialize(artifacts.ContaminatedData());
-		if(_onlyFringeStop)
-			fitter.PerformFringeStop();
-		else {
-			for(size_t i=0;i<fitter.TaskCount();++i)
-			{
-				fitter.PerformFit(i);
-				listener.OnProgress(*this, i+1, fitter.TaskCount());
-			}
-		}
-
-		TimeFrequencyData newContaminatedData = fitter.Background();
-		newContaminatedData.SetMask(artifacts.ContaminatedData());
-
-		TimeFrequencyData *newRevisedData =
-			TimeFrequencyData::CreateTFDataFromDiff(artifacts.OriginalData(), newContaminatedData);
-		newRevisedData->SetMask(artifacts.RevisedData());
-
-		artifacts.SetRevisedData(*newRevisedData);
-		artifacts.SetContaminatedData(newContaminatedData);
-
-		delete newRevisedData;
-	}
-
-} // namespace rfiStrategy
diff --git a/CEP/DP3/AOFlagger/src/strategy/actions/highpassfilteraction.cpp b/CEP/DP3/AOFlagger/src/strategy/actions/highpassfilteraction.cpp
deleted file mode 100644
index a02f32c4625fdea1a2a27a40fa41293e5cefb1a2..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/strategy/actions/highpassfilteraction.cpp
+++ /dev/null
@@ -1,40 +0,0 @@
-#include <AOFlagger/strategy/actions/highpassfilteraction.h>
-
-#include <AOFlagger/strategy/algorithms/highpassfilter.h>
-
-namespace rfiStrategy {
-
-void HighPassFilterAction::Perform(ArtifactSet &artifacts, ProgressListener &progress)
-{
-	TimeFrequencyData &data = artifacts.ContaminatedData();
-	if(data.PolarisationCount() != 1)
-		throw std::runtime_error("High-pass filtering needs single polarization");
-	HighPassFilter filter;
-	filter.SetHKernelSigmaSq(_hKernelSigmaSq);
-	filter.SetHWindowSize(_windowWidth);
-	filter.SetVKernelSigmaSq(_vKernelSigmaSq);
-	filter.SetVWindowSize(_windowHeight);
-	Mask2DCPtr mask = data.GetSingleMask();
-	size_t imageCount = data.ImageCount();
-	
-	switch(_mode)
-	{
-	case StoreContaminated:
-		for(size_t i=0;i<imageCount;++i)
-		{
-			data.SetImage(i, filter.ApplyHighPass(data.GetImage(i), mask));
-		}
-		break;
-		
-	case StoreRevised:
-		TimeFrequencyData revisedData = data;
-		for(size_t i=0;i<imageCount;++i)
-		{
-			revisedData.SetImage(i, filter.ApplyLowPass(revisedData.GetImage(i), mask));
-		}
-		artifacts.SetRevisedData(revisedData);
-		break;
-	}
-}
-
-}
diff --git a/CEP/DP3/AOFlagger/src/strategy/actions/imageraction.cpp b/CEP/DP3/AOFlagger/src/strategy/actions/imageraction.cpp
deleted file mode 100644
index 86bbf80473eb232c7c882de0d46a9a1857c13794..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/strategy/actions/imageraction.cpp
+++ /dev/null
@@ -1,81 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <AOFlagger/imaging/uvimager.h>
-
-#include <AOFlagger/strategy/actions/imageraction.h>
-#include <AOFlagger/strategy/algorithms/baselinetimeplaneimager.h>
-
-#include <boost/thread/mutex.hpp>
-
-#include <AOFlagger/util/progresslistener.h>
-
-namespace rfiStrategy {
-	void ImagerAction::Perform(ArtifactSet &artifacts, ProgressListener &progress)
-	{
-		boost::mutex::scoped_lock lock(_imagerMutex);
-		UVImager *imager = artifacts.Imager();
-		if(imager == 0)
-			throw BadUsageException("No imager available to create image.");
-		TimeFrequencyData &data = artifacts.ContaminatedData();
-		TimeFrequencyMetaDataCPtr metaData = artifacts.MetaData();
-		if(data.PolarisationCount() > 1)
-		{
-			TimeFrequencyData *tmp = data.CreateTFData(StokesIPolarisation);
-			data = *tmp;
-			delete tmp;
-		}
-		
-		bool btPlaneImager = true;
-		if(btPlaneImager)
-		{
-			typedef double ImagerNumeric;
-			BaselineTimePlaneImager<ImagerNumeric> btImager;
-			BandInfo band = metaData->Band();
-			Image2DCPtr
-				inputReal = data.GetRealPart(),
-				inputImag = data.GetImaginaryPart();
-			Mask2DCPtr mask = data.GetSingleMask();
-			size_t width = inputReal->Width();
-			
-			for(size_t t=0;t!=width;++t)
-			{
-				UVW uvw = metaData->UVW()[t];
-				size_t channelCount = inputReal->Height();
-                                std::vector<std::complex<ImagerNumeric> >data(channelCount);
-				for(size_t ch=0;ch!=channelCount;++ch) {
-					if(mask->Value(t, ch))
-						data[ch] = std::complex<ImagerNumeric>(0.0, 0.0);
-					else
-						data[ch] = std::complex<ImagerNumeric>(inputReal->Value(t, ch), inputImag->Value(t, ch));
-				}
-				
-				btImager.Image(uvw.u, uvw.v, uvw.w, band.channels[0].frequencyHz, band.channels[1].frequencyHz-band.channels[0].frequencyHz, channelCount, &(data[0]), imager->FTReal());
-			}
-		} else {
-			progress.OnStartTask(*this, 0, 1, "Imaging baseline");
-			for(size_t y=0;y<data.ImageHeight();++y)
-			{
-				imager->Image(data, metaData, y);
-				progress.OnProgress(*this, y, data.ImageHeight());
-			}
-			progress.OnEndTask(*this);
-		}
-	}
-}
diff --git a/CEP/DP3/AOFlagger/src/strategy/actions/normalizevarianceaction.cpp b/CEP/DP3/AOFlagger/src/strategy/actions/normalizevarianceaction.cpp
deleted file mode 100644
index 3c6a552845b9ea3594389f1a88ad7b9b175dc513..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/strategy/actions/normalizevarianceaction.cpp
+++ /dev/null
@@ -1,181 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <AOFlagger/strategy/actions/normalizevarianceaction.h>
-
-#include <map>
-
-#include <AOFlagger/util/progresslistener.h>
-
-#include <AOFlagger/quality/defaultstatistics.h>
-#include <AOFlagger/quality/qualitytablesformatter.h>
-#include <AOFlagger/quality/statisticalvalue.h>
-#include <AOFlagger/quality/statisticscollection.h>
-
-#include <AOFlagger/strategy/algorithms/medianwindow.h>
-#include <AOFlagger/strategy/imagesets/msimageset.h>
-#include <AOFlagger/quality/statisticsderivator.h>
-
-namespace rfiStrategy {
-
-NormalizeVarianceAction::~NormalizeVarianceAction()
-{
-}
-
-void NormalizeVarianceAction::initializeStdDevs(ArtifactSet &artifacts)
-{
-	// The thread that calls this function first will initialize the
-	// std dev. When a new measurement set is read, Initialize or Finalize
-	// will be called, causing a clean().
-	
-	boost::mutex::scoped_lock lock(_mutex);
-	if(!_isInitialized)
-	{
-		if(!artifacts.HasImageSet())
-			throw std::runtime_error("Normalize variance called without image set");
-		ImageSet *imageSet = artifacts.ImageSet();
-		MSImageSet *msImageSet = dynamic_cast<MSImageSet*>(imageSet);
-		if(msImageSet == 0)
-			throw std::runtime_error("Normalize variance actions needs measurement set");
-		std::string filename = msImageSet->Reader()->Set().Location();
-		QualityTablesFormatter qtables(filename);
-		StatisticsCollection statCollection(msImageSet->Reader()->Set().GetPolarizationCount());
-		statCollection.LoadTimeStatisticsOnly(qtables);
-		statCollection.IntegrateTimeToOneChannel();
-		_isInitialized = true;
-		
-		// Calculate all stddevs
-		const std::map<double, DefaultStatistics> &statMap = statCollection.TimeStatistics();
-		_stddevs.clear();
-		std::map<double, double>::iterator pos = _stddevs.begin();
-		for(std::map<double, DefaultStatistics>::const_iterator i = statMap.begin();
-				i != statMap.end(); ++i)
-		{
-			double stddev = StatisticsDerivator::GetStatisticAmplitude(
-				QualityTablesFormatter::DStandardDeviationStatistic,
-				i->second.ToSinglePolarization(), 0);
-			pos = _stddevs.insert(pos, std::pair<double, double>(i->first, stddev));
-		}
-	}
-}
-
-void NormalizeVarianceAction::clean()
-{
-	boost::mutex::scoped_lock lock(_mutex);
-	_isInitialized = false;
-	_stddevs.clear(); // frees a bit of memory.
-}
-
-void NormalizeVarianceAction::Perform(ArtifactSet &artifacts, ProgressListener &progress)
-{
-	initializeStdDevs(artifacts);
-	
-	TimeFrequencyData &original = artifacts.OriginalData();
-	const std::vector<double> &observationTimes = artifacts.MetaData()->ObservationTimes();
-	size_t
-		width = original.ImageWidth();
-	
-	std::vector<Image2DPtr> data;
-	for(unsigned img=0;img<original.ImageCount();++img)
-		data.push_back(Image2D::CreateCopy(original.GetImage(img)));
-		
-	// Add the first half of the window
-	const double halfWindowTime = _medianFilterSizeInS * 0.5;
-	MedianWindow<double> window;
-	std::map<double, double>::const_iterator windowRightSideIterator = _stddevs.begin();
-	const double startTime = windowRightSideIterator->first;
-	do {
-		if(std::isfinite(windowRightSideIterator->second))
-			window.Add(windowRightSideIterator->second);
-		++windowRightSideIterator;
-	} while(windowRightSideIterator->first - startTime < halfWindowTime);
-	
-	// Add the second half, and start correcting the data
-	size_t dataTimeIndex = 0;
-	while(windowRightSideIterator != _stddevs.end() &&
-		windowRightSideIterator->first - startTime < _medianFilterSizeInS)
-	{
-		correctDataUpTo(data, dataTimeIndex, windowRightSideIterator->first, observationTimes, window.Median());
-		if(std::isfinite(windowRightSideIterator->second))
-			window.Add(windowRightSideIterator->second);
-		++windowRightSideIterator;
-	}
-	
-	// Slide window until right side hits end
-	std::map<double, double>::const_iterator windowLeftSideIterator = _stddevs.begin();
-	const double endTime = _stddevs.rbegin()->first;
-	while(windowRightSideIterator != _stddevs.end() && windowRightSideIterator->first < endTime)
-	{
-		correctDataUpTo(data, dataTimeIndex, windowRightSideIterator->first, observationTimes, window.Median());
-		
-		if(std::isfinite(windowRightSideIterator->second))
-			window.Add(windowRightSideIterator->second);
-		if(std::isfinite(windowLeftSideIterator->second))
-			window.Remove(windowLeftSideIterator->second);
-		
-		++windowRightSideIterator;
-		++windowLeftSideIterator;
-	}
-	
-	// Slide until window center hits end
-	while(windowLeftSideIterator != _stddevs.end() && windowLeftSideIterator->first + halfWindowTime < endTime)
-	{
-		correctDataUpTo(data, dataTimeIndex, windowLeftSideIterator->first + _medianFilterSizeInS, observationTimes, window.Median());
-		if(std::isfinite(windowLeftSideIterator->second))
-			window.Remove(windowLeftSideIterator->second);
-		++windowLeftSideIterator;
-	}
-	
-	while(dataTimeIndex < width)
-	{
-		correctData(data, dataTimeIndex, window.Median());
-		++dataTimeIndex;
-	}
-	
-	// Replace images
-	for(unsigned img=0;img<original.ImageCount();++img)
-		original.SetImage(img, data[img]);
-}
-
-void NormalizeVarianceAction::correctDataUpTo(std::vector<Image2DPtr> &data, size_t &dataTimeIndex, double rightSideTime, const std::vector<double> &observationTimes, double stddev)
-{
-	size_t width = (*data.begin())->Width();
-	double halfWindowWidth = _medianFilterSizeInS*0.5;
-	while(dataTimeIndex < width &&
-		observationTimes[dataTimeIndex] + halfWindowWidth < rightSideTime)
-	{
-		correctData(data, dataTimeIndex, stddev);
-		++dataTimeIndex;
-	}
-}
-
-void NormalizeVarianceAction::correctData(std::vector<Image2DPtr> &data, size_t timeStep, double stddev)
-{
-	num_t oneOverStddev = 1.0 / stddev;
-	
-	for(std::vector<Image2DPtr>::iterator i=data.begin();i!=data.end();++i)
-	{
-		Image2DPtr image = *i;
-		
-		for(unsigned y=0;y<image->Height();++y)
-			image->SetValue(timeStep, y, image->Value(timeStep, y) * oneOverStddev);
-	}
-}
-
-} // end of namespace
diff --git a/CEP/DP3/AOFlagger/src/strategy/actions/plotaction.cpp b/CEP/DP3/AOFlagger/src/strategy/actions/plotaction.cpp
deleted file mode 100644
index 53978d0fb60ab61713507daa5afdef139f4ae52b..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/strategy/actions/plotaction.cpp
+++ /dev/null
@@ -1,194 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <boost/thread.hpp>
-
-#include <lofar_config.h>
-
-#include <AOFlagger/strategy/actions/plotaction.h>
-
-#include <AOFlagger/strategy/plots/antennaflagcountplot.h>
-#include <AOFlagger/strategy/plots/frequencyflagcountplot.h>
-#include <AOFlagger/strategy/plots/frequencypowerplot.h>
-#include <AOFlagger/strategy/plots/iterationsplot.h>
-#include <AOFlagger/strategy/plots/timeflagcountplot.h>
-
-#include <AOFlagger/strategy/algorithms/polarizationstatistics.h>
-#include <AOFlagger/strategy/algorithms/thresholdtools.h>
-
-#include <AOFlagger/strategy/control/artifactset.h>
-
-namespace rfiStrategy {
-	
-	void PlotAction::Perform(ArtifactSet &artifacts, ProgressListener &)
-	{
-		boost::mutex::scoped_lock lock(_plotMutex);
-		switch(_plotKind)
-		{
-			case AntennaFlagCountPlot:
-				plotAntennaFlagCounts(artifacts);
-				break;
-			case FrequencyFlagCountPlot:
-				plotFrequencyFlagCounts(artifacts);
-				break;
-			case FrequencyPowerPlot:
-				plotFrequencyPower(artifacts);
-				break;
-			case TimeFlagCountPlot:
-				plotTimeFlagCounts(artifacts);
-				break;
-			case BaselineSpectrumPlot:
-				plotSpectrumPerBaseline(artifacts);
-				break;
-			case PolarizationStatisticsPlot:
-				plotPolarizationFlagCounts(artifacts);
-				break;
-			case BaselineRMSPlot:
-				plotBaselineRMS(artifacts);
-				break;
-			case IterationsPlot:
-				plotIterations(artifacts);
-				break;
-		}
-	}
-
-
-#ifdef HAVE_GTKMM
-
-	void PlotAction::plotAntennaFlagCounts(ArtifactSet &artifacts)
-	{
-		if(artifacts.AntennaFlagCountPlot() == 0)
-			throw BadUsageException("No antenna flag count plot in the artifact set");
-
-		TimeFrequencyData &data = artifacts.ContaminatedData();
-		TimeFrequencyMetaDataCPtr meta = artifacts.MetaData();
-		artifacts.AntennaFlagCountPlot()->Add(data, meta);
-	}
-
-	void PlotAction::plotFrequencyFlagCounts(ArtifactSet &artifacts)
-	{
-		if(artifacts.FrequencyFlagCountPlot() == 0)
-			throw BadUsageException("No frequency flag count plot in the artifact set");
-
-		TimeFrequencyData &data = artifacts.ContaminatedData();
-		TimeFrequencyMetaDataCPtr meta = artifacts.MetaData();
-		artifacts.FrequencyFlagCountPlot()->Add(data, meta);
-	}
-
-	void PlotAction::plotFrequencyPower(ArtifactSet &artifacts)
-	{
-		if(artifacts.FrequencyPowerPlot() == 0)
-			throw BadUsageException("No frequency power plot in the artifact set");
-
-		TimeFrequencyData &data = artifacts.ContaminatedData();
-		TimeFrequencyMetaDataCPtr meta = artifacts.MetaData();
-		artifacts.FrequencyPowerPlot()->Add(data, meta);
-	}
-
-	void PlotAction::plotTimeFlagCounts(ArtifactSet &artifacts)
-	{
-		if(artifacts.TimeFlagCountPlot() == 0)
-			throw BadUsageException("No time flag count plot in the artifact set");
-
-		TimeFrequencyData &data = artifacts.ContaminatedData();
-		TimeFrequencyMetaDataCPtr meta = artifacts.MetaData();
-		artifacts.TimeFlagCountPlot()->Add(data, meta);
-	}
-
-	void PlotAction::plotSpectrumPerBaseline(ArtifactSet &artifacts)
-	{
-		if(artifacts.FrequencyPowerPlot() == 0)
-			throw BadUsageException("No frequency power plot in the artifact set");
-
-		TimeFrequencyData &data = artifacts.ContaminatedData();
-		TimeFrequencyMetaDataCPtr meta = artifacts.MetaData();
-		artifacts.FrequencyPowerPlot()->SetLogYAxis(_logYAxis);
-		artifacts.FrequencyPowerPlot()->StartNewLine(meta->Antenna1().name + " x " + meta->Antenna2().name);
-		artifacts.FrequencyPowerPlot()->Add(data, meta);
-	}
-
-	void PlotAction::plotPolarizationFlagCounts(ArtifactSet &artifacts)
-	{
-		if(artifacts.PolarizationStatistics() == 0)
-			throw BadUsageException("No polarization statistics in the artifact set");
-
-		TimeFrequencyData &data = artifacts.ContaminatedData();
-		artifacts.PolarizationStatistics()->Add(data);
-	}
-
-	void PlotAction::plotBaselineRMS(ArtifactSet &artifacts)
-	{
-		if(artifacts.PolarizationStatistics() == 0)
-			throw BadUsageException("No polarization statistics in the artifact set");
-
-		TimeFrequencyData &data = artifacts.ContaminatedData();
-		TimeFrequencyMetaDataCPtr metaData = artifacts.MetaData();
-		double rms = 0.0;
-		for(unsigned i=0;i<data.PolarisationCount();++i)
-		{
-			TimeFrequencyData *polarisation = data.CreateTFDataFromPolarisationIndex(i);
-			Mask2DCPtr mask = polarisation->GetSingleMask();
-			for(unsigned j=0;j<polarisation->ImageCount();++j)
-			{
-				Image2DCPtr image = polarisation->GetImage(j);
-				rms += ThresholdTools::RMS(image, mask);
-			}
-			delete polarisation;
-		}
-		rms /= data.PolarisationCount();
-		;
-		AOLogger::Info << "RMS of " << metaData->Antenna1().name << " x " << metaData->Antenna2().name << ": "
-			<< rms << '\n';
-	}
-	
-	void PlotAction::plotIterations(class ArtifactSet &artifacts)
-	{
-		class IterationsPlot *plot = artifacts.IterationsPlot();
-		if(plot != 0)
-		{
-			plot->Add(artifacts.ContaminatedData(), artifacts.MetaData());
-		}
-	}
-
-#else
-	void PlotAction::plotAntennaFlagCounts(ArtifactSet &)
-	{}
-
-	void PlotAction::plotFrequencyFlagCounts(ArtifactSet &)
-	{}
-
-	void PlotAction::plotFrequencyPower(ArtifactSet &)
-	{}
-
-	void PlotAction::plotTimeFlagCounts(ArtifactSet &)
-	{}
-
-	void PlotAction::plotSpectrumPerBaseline(ArtifactSet &)
-	{}
-
-	void PlotAction::plotPolarizationFlagCounts(ArtifactSet &)
-	{}
-
-	void PlotAction::plotBaselineRMS(ArtifactSet &)
-	{}
-	
-	void PlotAction::plotIterations(class ArtifactSet &)
-	{}
-#endif
-}
diff --git a/CEP/DP3/AOFlagger/src/strategy/actions/slidingwindowfitaction.cpp b/CEP/DP3/AOFlagger/src/strategy/actions/slidingwindowfitaction.cpp
deleted file mode 100644
index 3debaf7adc6408d34d1b771209fc5b391a947d5b..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/strategy/actions/slidingwindowfitaction.cpp
+++ /dev/null
@@ -1,92 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#include <AOFlagger/util/progresslistener.h>
-
-#include <AOFlagger/strategy/actions/slidingwindowfitaction.h>
-
-#include <AOFlagger/strategy/algorithms/localfitmethod.h>
-
-#include <AOFlagger/strategy/control/artifactset.h>
-
-namespace rfiStrategy {
-
-	void SlidingWindowFitAction::LoadDefaults()
-	{
-		_parameters.frequencyDirectionKernelSize = 15.0;
-		_parameters.frequencyDirectionWindowSize = 40;
-		_parameters.method = SlidingWindowFitParameters::GaussianWeightedAverage;
-		_parameters.timeDirectionKernelSize = 7.5;
-		_parameters.timeDirectionWindowSize = 20;
-	}
-
-	void SlidingWindowFitAction::Perform(ArtifactSet &artifacts, class ProgressListener &listener)
-	{
-		LocalFitMethod method;
-		switch(_parameters.method)
-		{
-			case SlidingWindowFitParameters::None:
-				method.SetToNone();
-				break;
-			case SlidingWindowFitParameters::Average:
-				method.SetToAverage(
-					_parameters.timeDirectionWindowSize,
-					_parameters.frequencyDirectionWindowSize);
-				break;
-			case SlidingWindowFitParameters::GaussianWeightedAverage:
-				method.SetToWeightedAverage(
-					_parameters.timeDirectionWindowSize,
-					_parameters.frequencyDirectionWindowSize,
-					_parameters.timeDirectionKernelSize,
-					_parameters.frequencyDirectionKernelSize);
-				break;
-			case SlidingWindowFitParameters::Median:
-				method.SetToMedianFilter(
-					_parameters.timeDirectionWindowSize,
-					_parameters.frequencyDirectionWindowSize);
-				break;
-			case SlidingWindowFitParameters::Minimum:
-				method.SetToMinimumFilter(
-					_parameters.timeDirectionWindowSize,
-					_parameters.frequencyDirectionWindowSize);
-				break;
-		}
-
-		method.Initialize(artifacts.ContaminatedData());
-		
-		size_t taskCount = method.TaskCount();
-		for(size_t i=0;i<taskCount;++i)
-		{
-			method.PerformFit(i);
-			listener.OnProgress(*this, i+1, taskCount);
-		}
-		TimeFrequencyData newRevisedData = method.Background();
-		newRevisedData.SetMask(artifacts.RevisedData());
-
-		TimeFrequencyData *contaminatedData =
-			TimeFrequencyData::CreateTFDataFromDiff(artifacts.ContaminatedData(), newRevisedData);
-		contaminatedData->SetMask(artifacts.ContaminatedData());
-
-		artifacts.SetRevisedData(newRevisedData);
-		artifacts.SetContaminatedData(*contaminatedData);
-
-		delete contaminatedData;
-	}
-} // namespace rfiStrategy
diff --git a/CEP/DP3/AOFlagger/src/strategy/actions/spatialcompositionaction.cpp b/CEP/DP3/AOFlagger/src/strategy/actions/spatialcompositionaction.cpp
deleted file mode 100644
index 8f0504bedefaf7ac2c17e01eb7a284936d24fea1..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/strategy/actions/spatialcompositionaction.cpp
+++ /dev/null
@@ -1,161 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#include <AOFlagger/strategy/actions/spatialcompositionaction.h>
-
-#include <AOFlagger/strategy/algorithms/eigenvalue.h>
-
-#include <AOFlagger/strategy/imagesets/spatialmsimageset.h>
-
-#include <AOFlagger/util/progresslistener.h>
-
-#include <limits>
-
-namespace rfiStrategy {
-	void SpatialCompositionAction::Perform(ArtifactSet &artifacts, ProgressListener &progress)
-	{
-		size_t imageCount = artifacts.ContaminatedData().ImageCount();
-                std::vector<Image2DPtr> images(imageCount);
-		for(size_t p=0;p<imageCount;++p)
-			images[p] = Image2D::CreateZeroImagePtr(artifacts.ContaminatedData().ImageWidth(), artifacts.ContaminatedData().ImageHeight());
-
-		std::string filename = artifacts.ImageSet()->File();
-		SpatialMSImageSet set(filename);
-		ImageSetIndex *index = set.StartIndex();
-		size_t progressStep = 0, totalProgress = artifacts.ContaminatedData().ImageWidth() * artifacts.ContaminatedData().ImageHeight()/256;
-		while(index->IsValid())
-		{
-			TimeFrequencyData *data = set.LoadData(*index);
-			SpatialMatrixMetaData metaData(set.SpatialMetaData(*index));
-			for(size_t p=0;p!=imageCount;++p)
-			{
-				switch(_operation)
-				{
-					case SumCrossCorrelationsOperation:
-						images[p]->SetValue(metaData.TimeIndex(), metaData.ChannelIndex(), sumCrossCorrelations(data->GetImage(p)));
-						break;
-					case SumAutoCorrelationsOperation:
-						images[p]->SetValue(metaData.TimeIndex(), metaData.ChannelIndex(), sumAutoCorrelations(data->GetImage(p)));
-						break;
-					case EigenvalueDecompositionOperation: {
-						num_t value = eigenvalue(data->GetImage(p), data->GetImage(p+1));
-						images[p]->SetValue(metaData.TimeIndex(), metaData.ChannelIndex(), value);
-						images[p+1]->SetValue(metaData.TimeIndex(), metaData.ChannelIndex(), 0.0);
-						++p;
-						} break;
-					case EigenvalueRemovalOperation: {
-						std::pair<num_t, num_t> value = removeEigenvalue(data->GetImage(p), data->GetImage(p+1));
-						images[p]->SetValue(metaData.TimeIndex(), metaData.ChannelIndex(), value.first);
-						images[p+1]->SetValue(metaData.TimeIndex(), metaData.ChannelIndex(), value.second);
-						++p;
-						} break;
-				}
-			}
-			delete data;
-			index->Next();
-			++progressStep;
-			progress.OnProgress(*this, progressStep/256, totalProgress);
-		}
-		delete index;
-
-		TimeFrequencyData newRevisedData = artifacts.RevisedData();
-		for(size_t p=0;p<imageCount;++p)
-			newRevisedData.SetImage(p, images[p]);
-		
-		newRevisedData.SetMask(artifacts.RevisedData());
-
-		TimeFrequencyData *contaminatedData =
-			TimeFrequencyData::CreateTFDataFromDiff(artifacts.ContaminatedData(), newRevisedData);
-		contaminatedData->SetMask(artifacts.ContaminatedData());
-
-		artifacts.SetRevisedData(newRevisedData);
-		artifacts.SetContaminatedData(*contaminatedData);
-
-		delete contaminatedData;
-
-	}
-
-	num_t SpatialCompositionAction::sumCrossCorrelations(Image2DCPtr image) const
-	{
-		num_t sum = 0;
-		for(size_t y=0;y<image->Height();++y)
-		{
-			for(size_t x=0;x<y;++x)
-				sum += image->Value(x, y);
-		}
-		return sum;
-	}
-
-	num_t SpatialCompositionAction::sumAutoCorrelations(Image2DCPtr image) const
-	{
-		num_t sum = 0;
-		for(size_t y=0;y<image->Height();++y)
-		{
-			sum += image->Value(y, y);
-		}
-		return sum;
-	}
-	
-	num_t SpatialCompositionAction::eigenvalue(Image2DCPtr real, Image2DCPtr imaginary) const
-	{
-		try {
-			Image2DPtr
-				r = Image2D::CreateCopy(real),
-				i = Image2D::CreateCopy(imaginary);
-			for(size_t y=0;y<r->Height();++y)
-			{
-				for(size_t x=0;x<r->Width();++x)
-				{
-					if(!std::isfinite(r->Value(x,y))) r->SetValue(x, y, 0.0);
-					if(!std::isfinite(i->Value(x,y))) i->SetValue(x, y, 0.0);
-				}
-			}
-			if(r->ContainsOnlyZeros() && i->ContainsOnlyZeros()) return 0.0;
-			return Eigenvalue::Compute(r, i);
-		} catch(std::exception &e)
-		{
-			return std::numeric_limits<num_t>::quiet_NaN();
-		}
-	}
-
-	std::pair<num_t, num_t> SpatialCompositionAction::removeEigenvalue(Image2DCPtr real, Image2DCPtr imaginary) const
-	{
-		try {
-			Image2DPtr
-				r = Image2D::CreateCopy(real),
-				i = Image2D::CreateCopy(imaginary);
-			for(size_t y=0;y<r->Height();++y)
-			{
-				for(size_t x=0;x<r->Width();++x)
-				{
-					if(!std::isfinite(r->Value(x,y))) r->SetValue(x, y, 0.0);
-					if(!std::isfinite(i->Value(x,y))) i->SetValue(x, y, 0.0);
-				}
-			}
-			if(r->ContainsOnlyZeros() && i->ContainsOnlyZeros()) return std::pair<num_t, num_t>(0.0, 0.0);
-			Eigenvalue::Remove(r, i);
-			return std::pair<num_t, num_t>(r->Value(0,1), i->Value(0,1));
-		} catch(std::exception &e)
-		{
-			return std::pair<num_t, num_t>(std::numeric_limits<num_t>::quiet_NaN(), std::numeric_limits<num_t>::quiet_NaN());
-		}
-	}
-}
-
diff --git a/CEP/DP3/AOFlagger/src/strategy/actions/statisticalflagaction.cpp b/CEP/DP3/AOFlagger/src/strategy/actions/statisticalflagaction.cpp
deleted file mode 100644
index 422a03bac31ee1e8aa6b01a75932564b6483e83c..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/strategy/actions/statisticalflagaction.cpp
+++ /dev/null
@@ -1,48 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#include <AOFlagger/util/progresslistener.h>
-
-#include <AOFlagger/strategy/actions/statisticalflagaction.h>
-
-#include <AOFlagger/strategy/algorithms/statisticalflagger.h>
-#include <AOFlagger/strategy/algorithms/siroperator.h>
-
-#include <AOFlagger/strategy/control/artifactset.h>
-
-namespace rfiStrategy {
-
-	void StatisticalFlagAction::Perform(ArtifactSet &artifacts, class ProgressListener &)
-	{
-		TimeFrequencyData &data = artifacts.ContaminatedData();
-		if(data.MaskCount() > 1)
-			throw std::runtime_error("Error: the statistical flag action (dilation operation) can only be applied on data with a single mask. Therefore, it should be placed 'under' a Set all polarization equal-operation, or inside a For each polarization action.");
-			
-		Mask2DPtr mask = Mask2D::CreateCopy(data.GetSingleMask());
-		
-		StatisticalFlagger::DilateFlags(mask, _enlargeTimeSize, _enlargeFrequencySize);
-		//StatisticalFlagger::LineRemover(mask, (size_t) (_maxContaminatedTimesRatio * (double) mask->Width()), (size_t) (_maxContaminatedFrequenciesRatio * (double) mask->Height()));
-		SIROperator::OperateHorizontally(mask, _minimumGoodTimeRatio);
-		SIROperator::OperateVertically(mask, _minimumGoodFrequencyRatio);
-		data.SetGlobalMask(mask);
-		//artifacts.SetRevisedData(data);
-	}
-
-} // namespace rfiStrategy
diff --git a/CEP/DP3/AOFlagger/src/strategy/actions/strategyaction.cpp b/CEP/DP3/AOFlagger/src/strategy/actions/strategyaction.cpp
deleted file mode 100644
index 55ded6f93bc2a370201a09c36bfece8e00c98cce..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/strategy/actions/strategyaction.cpp
+++ /dev/null
@@ -1,466 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <AOFlagger/strategy/actions/strategyaction.h>
-
-#include <AOFlagger/strategy/actions/adapter.h>
-#include <AOFlagger/strategy/actions/baselineselectionaction.h>
-#include <AOFlagger/strategy/actions/changeresolutionaction.h>
-#include <AOFlagger/strategy/actions/combineflagresultsaction.h>
-#include <AOFlagger/strategy/actions/foreachbaselineaction.h>
-#include <AOFlagger/strategy/actions/foreachcomplexcomponentaction.h>
-#include <AOFlagger/strategy/actions/foreachmsaction.h>
-#include <AOFlagger/strategy/actions/foreachpolarisationaction.h>
-#include <AOFlagger/strategy/actions/frequencyselectionaction.h>
-#include <AOFlagger/strategy/actions/highpassfilteraction.h>
-#include <AOFlagger/strategy/actions/iterationaction.h>
-#include <AOFlagger/strategy/actions/plotaction.h>
-#include <AOFlagger/strategy/actions/setflaggingaction.h>
-#include <AOFlagger/strategy/actions/setimageaction.h>
-#include <AOFlagger/strategy/actions/slidingwindowfitaction.h>
-#include <AOFlagger/strategy/actions/statisticalflagaction.h>
-#include <AOFlagger/strategy/actions/sumthresholdaction.h>
-#include <AOFlagger/strategy/actions/timeselectionaction.h>
-#include <AOFlagger/strategy/actions/writeflagsaction.h>
-
-#include <AOFlagger/strategy/control/strategyiterator.h>
-
-namespace rfiStrategy {
-
-	Strategy *Strategy::CreateDefaultSingleStrategy()
-	{
-		Strategy *strategy = new Strategy();
-		strategy->LoadDefaultSingleStrategy();
-		return strategy;
-	}
-
-	void Strategy::LoadDefaultSingleStrategy(bool pedantic, bool pulsar)
-	{
-		LoadDefaultSingleStrategy(*this, pedantic, pulsar);
-	}
-
-	void Strategy::LoadDefaultSingleStrategy(ActionBlock &block, bool pedantic, bool pulsar)
-	{
-		ActionBlock *current;
-
-		block.Add(new SetFlaggingAction());
-
-		ForEachPolarisationBlock *fepBlock = new ForEachPolarisationBlock();
-		block.Add(fepBlock);
-		current = fepBlock;
-
-		ForEachComplexComponentAction *focAction = new ForEachComplexComponentAction();
-		focAction->SetOnAmplitude(true);
-		focAction->SetOnImaginary(false);
-		focAction->SetOnReal(false);
-		focAction->SetOnPhase(false);
-		focAction->SetRestoreFromAmplitude(false);
-		current->Add(focAction);
-		current = focAction;
-
-		IterationBlock *iteration = new IterationBlock();
-		iteration->SetIterationCount(2);
-		iteration->SetSensitivityStart(4.0);
-		current->Add(iteration);
-		current = iteration;
-		
-		SumThresholdAction *t1 = new SumThresholdAction();
-		t1->SetBaseSensitivity(1.0);
-		if(pulsar)
-			t1->SetFrequencyDirectionFlagging(false);
-		current->Add(t1);
-
-		CombineFlagResults *cfr1 = new CombineFlagResults();
-		current->Add(cfr1);
-
-		cfr1->Add(new FrequencySelectionAction());
-		if(!pulsar)
-			cfr1->Add(new TimeSelectionAction());
-	
-		current->Add(new SetImageAction());
-		ChangeResolutionAction *changeResAction = new ChangeResolutionAction();
-		if(pulsar)
-			changeResAction->SetTimeDecreaseFactor(1);
-		else
-			changeResAction->SetTimeDecreaseFactor(3);
-		changeResAction->SetFrequencyDecreaseFactor(3);
-
-		/*
-		SlidingWindowFitAction *swfAction2 = new SlidingWindowFitAction();
-		if(pulsar)
-		{
-			swfAction2->Parameters().timeDirectionWindowSize = 1;
-		} else {
-			swfAction2->Parameters().timeDirectionKernelSize = 2.5;
-			swfAction2->Parameters().timeDirectionWindowSize = 10;
-		}
-		swfAction2->Parameters().frequencyDirectionKernelSize = 5.0;
-		swfAction2->Parameters().frequencyDirectionWindowSize = 15;
-		changeResAction2->Add(swfAction2);
-		
-		Replaced the sliding window fit action by the faster (SSE) high-pass
-		filter on 26-08-2011
-		*/
-		HighPassFilterAction *hpAction = new HighPassFilterAction();
-		if(pulsar)
-		{
-			hpAction->SetWindowWidth(1);
-		} else {
-			hpAction->SetHKernelSigmaSq(2.5);
-			hpAction->SetWindowWidth(21);
-		}
-		hpAction->SetVKernelSigmaSq(5.0);
-		hpAction->SetWindowHeight(31);
-		hpAction->SetMode(HighPassFilterAction::StoreRevised);
-		changeResAction->Add(hpAction);
-
-		current->Add(changeResAction);
-
-		current = focAction;
-		SumThresholdAction *t2 = new SumThresholdAction();
-		if(pulsar)
-			t2->SetFrequencyDirectionFlagging(false);
-		current->Add(t2);
-		
-		PlotAction *plotPolarizationStatistics = new PlotAction();
-		plotPolarizationStatistics->SetPlotKind(PlotAction::PolarizationStatisticsPlot);
-		block.Add(plotPolarizationStatistics);
-		
-		SetFlaggingAction *setFlagsInAllPolarizations = new SetFlaggingAction();
-		setFlagsInAllPolarizations->SetNewFlagging(SetFlaggingAction::PolarisationsEqual);
-		
-		block.Add(setFlagsInAllPolarizations);
-		block.Add(new StatisticalFlagAction());
-
-		if(pedantic)
-		{
-			CombineFlagResults *cfr2 = new CombineFlagResults();
-			block.Add(cfr2);
-			cfr2->Add(new FrequencySelectionAction());
-			if(!pulsar)
-				cfr2->Add(new TimeSelectionAction());
-		} else {
-			if(!pulsar)
-				block.Add(new TimeSelectionAction());
-		}
-
-		BaselineSelectionAction *baselineSelection = new BaselineSelectionAction();
-		baselineSelection->SetPreparationStep(true);
-		block.Add(baselineSelection);
-
-		SetFlaggingAction *orWithOriginals = new SetFlaggingAction();
-		orWithOriginals->SetNewFlagging(SetFlaggingAction::OrOriginal);
-		block.Add(orWithOriginals);
-	}
-
-	void Strategy::LoadOldDefaultSingleStrategy()
-	{
-		Add(new SetFlaggingAction());
-		ForEachPolarisationBlock *fepBlock = new ForEachPolarisationBlock();
-		Add(fepBlock);
-
-		CombineFlagResults *cfr = new CombineFlagResults();
-		fepBlock->Add(cfr);
-	
-		Adapter *adapter = new Adapter();
-		cfr->Add(adapter);
-	
-		IterationBlock *iteration = new IterationBlock();
-		adapter->Add(iteration);
-	
-		iteration->Add(new SumThresholdAction());
-		iteration->Add(new SetImageAction());
-		iteration->Add(new SlidingWindowFitAction());
-
-		adapter->Add(new SumThresholdAction());
-	}
-
-	void Strategy::LoadDefaultStrategy()
-	{
-		LoadAverageStrategy();
-	}
-
-	void Strategy::LoadFastStrategy(bool pedantic, bool pulsar)
-	{
-		ForEachBaselineAction *feBaseBlock = new ForEachBaselineAction();
-		Add(feBaseBlock);
-
-		LoadDefaultSingleStrategy(*feBaseBlock, pedantic, pulsar);
-
-		feBaseBlock->Add(new WriteFlagsAction());
-
-		PlotAction *antennaPlotAction = new PlotAction();
-		antennaPlotAction->SetPlotKind(PlotAction::AntennaFlagCountPlot);
-		feBaseBlock->Add(antennaPlotAction);
-
-		PlotAction *frequencyPlotAction = new PlotAction();
-		frequencyPlotAction->SetPlotKind(PlotAction::FrequencyFlagCountPlot);
-		feBaseBlock->Add(frequencyPlotAction);
-
-		BaselineSelectionAction *baselineSelection = new BaselineSelectionAction();
-		baselineSelection->SetPreparationStep(false);
-		Add(baselineSelection);
-	}
-
-	void Strategy::LoadAverageStrategy(bool pedantic, bool pulsar)
-	{
-		ForEachBaselineAction *feBaseBlock = new ForEachBaselineAction();
-		Add(feBaseBlock);
-
-		LoadDefaultSingleStrategy(*feBaseBlock, pedantic, pulsar);
-
-		feBaseBlock->Add(new WriteFlagsAction());
-
-		PlotAction *antennaPlotAction = new PlotAction();
-		antennaPlotAction->SetPlotKind(PlotAction::AntennaFlagCountPlot);
-		feBaseBlock->Add(antennaPlotAction);
-
-		PlotAction *frequencyPlotAction = new PlotAction();
-		frequencyPlotAction->SetPlotKind(PlotAction::FrequencyFlagCountPlot);
-		feBaseBlock->Add(frequencyPlotAction);
-
-		BaselineSelectionAction *baselineSelection = new BaselineSelectionAction();
-		baselineSelection->SetPreparationStep(false);
-		Add(baselineSelection);
-	}
-
-	void Strategy::LoadBestStrategy(bool pedantic, bool pulsar)
-	{
-		ForEachBaselineAction *feBaseBlock = new ForEachBaselineAction();
-		Add(feBaseBlock);
-		
-		LoadDefaultSingleStrategy(*feBaseBlock, pedantic, pulsar);
-
-		feBaseBlock->Add(new WriteFlagsAction());
-
-		PlotAction *antennaPlotAction = new PlotAction();
-		antennaPlotAction->SetPlotKind(PlotAction::AntennaFlagCountPlot);
-		feBaseBlock->Add(antennaPlotAction);
-
-		PlotAction *frequencyPlotAction = new PlotAction();
-		frequencyPlotAction->SetPlotKind(PlotAction::FrequencyFlagCountPlot);
-		feBaseBlock->Add(frequencyPlotAction);
-
-		BaselineSelectionAction *baselineSelection = new BaselineSelectionAction();
-		baselineSelection->SetPreparationStep(false);
-		Add(baselineSelection);
-	}
-	
-	ArtifactSet *Strategy::JoinThread()
-	{
-		ArtifactSet *artifact = 0;
-		if(_thread != 0)
-		{
-			_thread->join();
-			delete _thread;
-			artifact = new ArtifactSet(*_threadFunc->_artifacts);
-			delete _threadFunc->_artifacts;
-			delete _threadFunc;
-		}
-		_thread = 0;
-		return artifact;
-	}
-
-	void Strategy::StartPerformThread(const ArtifactSet &artifacts, ProgressListener &progress)
-	{
-		JoinThread();
-		_threadFunc = new PerformFunc(this, new ArtifactSet(artifacts), &progress);
-		_thread = new boost::thread(*_threadFunc);
-	}
-
-	void Strategy::PerformFunc::operator()()
-	{
-		_strategy->Perform(*_artifacts, *_progress);
-	}
-
-	void Strategy::SetThreadCount(Strategy &strategy, size_t threadCount)
-	{
-		StrategyIterator i = StrategyIterator::NewStartIterator(strategy);
-		while(!i.PastEnd())
-		{
-			if(i->Type() == ForEachBaselineActionType)
-			{
-				ForEachBaselineAction &fobAction = static_cast<ForEachBaselineAction&>(*i);
-				fobAction.SetThreadCount(threadCount);
-			}
-			if(i->Type() == WriteFlagsActionType)
-			{
-				WriteFlagsAction &writeAction = static_cast<WriteFlagsAction&>(*i);
-				writeAction.SetMaxBufferItems(threadCount*5);
-				writeAction.SetMinBufferItemsForWriting(threadCount*4);
-			}
-			++i;
-		}
-	}
-
-	void Strategy::SetDataColumnName(Strategy &strategy, const std::string &dataColumnName)
-	{
-		StrategyIterator i = StrategyIterator::NewStartIterator(strategy);
-		while(!i.PastEnd())
-		{
-			if(i->Type() == ForEachMSActionType)
-			{
-				ForEachMSAction &action = static_cast<ForEachMSAction&>(*i);
-				action.SetDataColumnName(dataColumnName);
-			}
-			++i;
-		}
-	}
-
-	/** TODO : implement, also in ForEachPolarisation */
-	void Strategy::SetPolarisations(Strategy &, enum PolarisationType)
-	{
-	}
-
-	void Strategy::SetBaselines(Strategy &strategy, enum BaselineSelection baselineSelection)
-	{
-		StrategyIterator i = StrategyIterator::NewStartIterator(strategy);
-		while(!i.PastEnd())
-		{
-			if(i->Type() == ForEachBaselineActionType)
-			{
-				ForEachBaselineAction &fobAction = static_cast<ForEachBaselineAction&>(*i);
-				fobAction.SetSelection(baselineSelection);
-			}
-			++i;
-		}
-	}
-
-	void Strategy::SetFlagStokes(Strategy &strategy, bool newValue)
-	{
-		StrategyIterator i = StrategyIterator::NewStartIterator(strategy);
-		bool hasBeenAdapted = false;
-		while(!i.PastEnd())
-		{
-			if(i->Type() == ForEachPolarisationBlockType)
-			{
-				if(hasBeenAdapted && newValue)
-					throw std::runtime_error("Flagging on Stokes components was requested, but the separate real/imaginary values have already been converted to amplitude values before the polarization iteration.");
-
-				ForEachPolarisationBlock &fopAction = static_cast<ForEachPolarisationBlock&>(*i);
-				fopAction.SetIterateStokesValues(newValue);
-			}
-			else if(i->Type() == AdapterType)
-			{
-				hasBeenAdapted = true;
-			}
-			++i;
-		}
-	}
-
-	void Strategy::SetTransientCompatibility(Strategy &strategy)
-	{
-		StrategyIterator i = StrategyIterator::NewStartIterator(strategy);
-		while(!i.PastEnd())
-		{
-			if(i->Type() == SumThresholdActionType)
-			{
-				SumThresholdAction &action = static_cast<SumThresholdAction&>(*i);
-				action.SetFrequencyDirectionFlagging(false);
-			} else if(i->Type() == SlidingWindowFitActionType)
-			{
-				SlidingWindowFitAction &action = static_cast<SlidingWindowFitAction&>(*i);
-				action.Parameters().timeDirectionWindowSize = 1;
-			}
-			++i;
-		}
-	}
-
-	void Strategy::SetMultiplySensitivity(Strategy &strategy, num_t factor)
-	{
-		StrategyIterator i = StrategyIterator::NewStartIterator(strategy);
-		while(!i.PastEnd())
-		{
-			if(i->Type() == SumThresholdActionType)
-			{
-				SumThresholdAction &action = static_cast<SumThresholdAction&>(*i);
-				action.SetBaseSensitivity(action.BaseSensitivity() * factor);
-			}
-			++i;
-		}
-	}
-
-	void Strategy::SetFittingWindowSize(Strategy &strategy, size_t windowWidth, size_t windowHeight)
-	{
-		StrategyIterator i = StrategyIterator::NewStartIterator(strategy);
-		while(!i.PastEnd())
-		{
-			if(i->Type() == SlidingWindowFitActionType)
-			{
-				SlidingWindowFitAction &action = static_cast<SlidingWindowFitAction&>(*i);
-				action.Parameters().timeDirectionWindowSize = windowWidth;
-				action.Parameters().frequencyDirectionWindowSize = windowHeight;
-			}
-			++i;
-		}
-	}
-
-	void Strategy::SetFittingKernelSize(Strategy &strategy, num_t kernelWidth, num_t kernelHeight)
-	{
-		StrategyIterator i = StrategyIterator::NewStartIterator(strategy);
-		while(!i.PastEnd())
-		{
-			if(i->Type() == SlidingWindowFitActionType)
-			{
-				SlidingWindowFitAction &action = static_cast<SlidingWindowFitAction&>(*i);
-				action.Parameters().timeDirectionKernelSize = kernelWidth;
-				action.Parameters().frequencyDirectionKernelSize = kernelHeight;
-			}
-			++i;
-		}
-	}
-
-	void Strategy::DisableOptimizations(Strategy &strategy)
-	{
-		StrategyIterator i = StrategyIterator::NewStartIterator(strategy);
-		while(!i.PastEnd())
-		{
-			if(i->Type() == AdapterType)
-			{
-				Adapter &adapter = static_cast<Adapter&>(*i);
-				adapter.SetRestoreOriginals(true);
-			}
-			++i;
-		}
-	}
-
-	/*void Strategy::SetIndirectReader(Strategy &strategy, bool newValue)
-	{
-		StrategyIterator i = StrategyIterator::NewStartIterator(strategy);
-		while(!i.PastEnd())
-		{
-			if(i->Type() == ForEachMSActionType)
-			{
-				ForEachMSAction &action = static_cast<ForEachMSAction&>(*i);
-				action.SetIndirectReader(newValue);
-			}
-			++i;
-		}
-	}*/
-
-	void Strategy::SyncAll(ActionContainer &root)
-	{
-		StrategyIterator i = StrategyIterator::NewStartIterator(root);
-		while(!i.PastEnd())
-		{
-			i->Sync();
-			++i;
-		}
-	}
-}
diff --git a/CEP/DP3/AOFlagger/src/strategy/actions/svdaction.cpp b/CEP/DP3/AOFlagger/src/strategy/actions/svdaction.cpp
deleted file mode 100644
index 1f805be6faf1bfcbd8cd7a96146d08fae2f1285a..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/strategy/actions/svdaction.cpp
+++ /dev/null
@@ -1,55 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#include <AOFlagger/util/progresslistener.h>
-
-#include <AOFlagger/strategy/actions/svdaction.h>
-
-#include <AOFlagger/strategy/algorithms/svdmitigater.h>
-
-#include <AOFlagger/strategy/control/artifactset.h>
-
-namespace rfiStrategy {
-
-	void SVDAction::Perform(ArtifactSet &artifacts, class ProgressListener &listener)
-	{
-		SVDMitigater mitigater;
-		mitigater.Initialize(artifacts.ContaminatedData());
-		mitigater.SetRemoveCount(_singularValueCount);
-		for(size_t i=0;i<mitigater.TaskCount();++i)
-		{
-			mitigater.PerformFit(i);
-			listener.OnProgress(*this, i+1, mitigater.TaskCount());
-		}
-
-		TimeFrequencyData newRevisedData = mitigater.Background();
-		newRevisedData.SetMask(artifacts.RevisedData());
-
-		TimeFrequencyData *contaminatedData =
-			TimeFrequencyData::CreateTFDataFromDiff(artifacts.ContaminatedData(), newRevisedData);
-		contaminatedData->SetMask(artifacts.ContaminatedData());
-
-		artifacts.SetRevisedData(newRevisedData);
-		artifacts.SetContaminatedData(*contaminatedData);
-
-		delete contaminatedData;
-	}
-
-} // namespace rfiStrategy
diff --git a/CEP/DP3/AOFlagger/src/strategy/actions/timeconvolutionaction.cpp b/CEP/DP3/AOFlagger/src/strategy/actions/timeconvolutionaction.cpp
deleted file mode 100644
index 9d31f58eb84e8fa9aa6990294a93c0ed4b2b4480..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/strategy/actions/timeconvolutionaction.cpp
+++ /dev/null
@@ -1,81 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#include <AOFlagger/strategy/actions/timeconvolutionaction.h>
-
-#include <fftw3.h>
-
-namespace rfiStrategy {
-
-void TimeConvolutionAction::PerformFFTSincOperation(ArtifactSet &artifacts, Image2DPtr real, Image2DPtr imag) const
-{
-	fftw_complex
-		*fftIn = (fftw_complex*) fftw_malloc(sizeof(fftw_complex) * real->Width()),
-		*fftOut = (fftw_complex*) fftw_malloc(sizeof(fftw_complex) * real->Width());
-	
-	// FFTW plan routines are not thread safe, so lock.
-	boost::mutex::scoped_lock lock(artifacts.IOMutex());
-	fftw_plan
-		fftPlanForward = fftw_plan_dft_1d(real->Width(), fftIn, fftOut, FFTW_FORWARD, FFTW_MEASURE),
-		fftPlanBackward = fftw_plan_dft_1d(real->Width(), fftIn, fftOut, FFTW_BACKWARD, FFTW_MEASURE);
-	lock.unlock();
-	
-	const size_t width = real->Width();
-
-	const BandInfo band = artifacts.MetaData()->Band();
-	for(unsigned y=0;y<real->Height();++y)
-	{
-		const numl_t sincScale = ActualSincScaleInSamples(artifacts, band.channels[y].frequencyHz);
-		const numl_t limitFrequency = (numl_t) width / sincScale;
-		if(y == real->Height()/2)
-		{
-			AOLogger::Debug << "Horizontal sinc scale: " << sincScale << " (filter scale: " << Angle::ToString(ActualSincScaleAsRaDecDist(artifacts, band.channels[y].frequencyHz)) << ")\n";
-		}
-		if(sincScale > 1.0)
-		{
-			for(unsigned x=0;x<width;++x)
-			{
-				fftIn[x][0] = real->Value(x, y);
-				fftIn[x][1] = imag->Value(x, y);
-			}
-			
-			fftw_execute_dft(fftPlanForward, fftIn, fftOut);
-			size_t filterIndexSize = (limitFrequency > 1.0) ? (size_t) ceil(limitFrequency/2.0) : 1;
-			// Remove the high frequencies [filterIndexSize : n-filterIndexSize]
-			for(size_t f=filterIndexSize;f<width - filterIndexSize;++f)
-			{
-				fftOut[f][0] = 0.0;
-				fftOut[f][1] = 0.0;
-			}
-			fftw_execute_dft(fftPlanBackward, fftOut, fftIn);
-			
-			const double n = width;
-			for(unsigned x=0;x<width;++x)
-			{
-				real->SetValue(x, y, fftIn[x][0] / n);
-				imag->SetValue(x, y, fftIn[x][1] / n);
-			}
-		}
-	}
-	fftw_free(fftIn);
-	fftw_free(fftOut);
-}
-
-}
diff --git a/CEP/DP3/AOFlagger/src/strategy/actions/timeselectionaction.cpp b/CEP/DP3/AOFlagger/src/strategy/actions/timeselectionaction.cpp
deleted file mode 100644
index 88d7593fe8d211a272840fdd2b2a26755b8f5a3f..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/strategy/actions/timeselectionaction.cpp
+++ /dev/null
@@ -1,72 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <AOFlagger/strategy/actions/timeselectionaction.h>
-
-#include <map>
-
-#include <AOFlagger/msio/timefrequencydata.h>
-#include <AOFlagger/msio/image2d.h>
-#include <AOFlagger/msio/samplerow.h>
-
-///#include <AOFlagger/strategy/plots/rfiplots.h>
-
-#include <AOFlagger/strategy/algorithms/medianwindow.h>
-#include <AOFlagger/strategy/algorithms/rfistatistics.h>
-
-#include <AOFlagger/strategy/control/artifactset.h>
-
-///#include <AOFlagger/util/multiplot.h>
-
-namespace rfiStrategy {
-
-/**
- * Automatic selection selects all timesteps which RMS is higher than some value relative to the stddev of
- * all timesteps.
- */
-void TimeSelectionAction::AutomaticSelection(ArtifactSet &artifacts)
-{
-	Image2DCPtr image = artifacts.ContaminatedData().GetSingleImage();
-	SampleRowPtr timesteps = SampleRow::CreateEmpty(image->Width());
-	Mask2DPtr mask = Mask2D::CreateCopy(artifacts.ContaminatedData().GetSingleMask());
-	for(size_t x=0;x<image->Width();++x)
-	{
-		SampleRowPtr row = SampleRow::CreateFromColumnWithMissings(image, mask, x);
-		timesteps->SetValue(x, row->RMSWithMissings());
-	}
-	bool change;
-	MedianWindow<num_t>::SubtractMedian(timesteps, 512);
-	do {
-		num_t median = 0.0;
-		num_t stddev = timesteps->StdDevWithMissings(0.0);
-		change = false;
-		for(size_t x=0;x<timesteps->Size();++x)
-		{
-			if(!timesteps->ValueIsMissing(x) && (timesteps->Value(x) - median > stddev * _threshold || median - timesteps->Value(x) > stddev * _threshold))
-			{
-				mask->SetAllVertically<true>(x);
-				timesteps->SetValueMissing(x);
-				change = true;
-			}
-		}
-	} while(change);
-	artifacts.ContaminatedData().SetGlobalMask(mask);
-}
-
-} // end of namespace
diff --git a/CEP/DP3/AOFlagger/src/strategy/actions/writeflagsaction.cpp b/CEP/DP3/AOFlagger/src/strategy/actions/writeflagsaction.cpp
deleted file mode 100644
index 57d1c3a21358e8a4ffab646321ca48ef9d3bcdca..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/strategy/actions/writeflagsaction.cpp
+++ /dev/null
@@ -1,123 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <AOFlagger/strategy/actions/writeflagsaction.h>
-
-#include <iostream>
-
-#include <AOFlagger/util/aologger.h>
-
-#include <AOFlagger/strategy/control/artifactset.h>
-
-#include <AOFlagger/strategy/imagesets/imageset.h>
-
-#include <boost/thread.hpp>
-
-namespace rfiStrategy {
-
-	WriteFlagsAction::WriteFlagsAction() : _flusher(0), _isFinishing(false), _maxBufferItems(18), _minBufferItemsForWriting(12), _imageSet(0)
-	{
-	}
-	
-	
-	WriteFlagsAction::~WriteFlagsAction()
-	{
-		Finish();
-	}
-	
-	void WriteFlagsAction::Perform(class ArtifactSet &artifacts, ProgressListener &)
-	{
-		if(!artifacts.HasImageSet())
-			throw BadUsageException("No image set active: can not write flags");
-
-		boost::mutex::scoped_lock lock(_mutex);
-		if(_flusher == 0)
-		{
-			_imageSet = artifacts.ImageSet()->Copy();
-			_ioMutex = &artifacts.IOMutex();
-			_isFinishing = false;
-			FlushFunction flushFunction;
-			flushFunction._parent = this;
-			_flusher = new boost::thread(flushFunction);
-		}
-		lock.unlock();
-
-		std::vector<Mask2DCPtr> masks;
-		for(size_t i=0;i<artifacts.ContaminatedData().MaskCount();++i)
-		{
-			Mask2DCPtr mask = artifacts.ContaminatedData().GetMask(i);
-			masks.push_back(mask);
-		}
-		BufferItem newItem(masks, *artifacts.ImageSetIndex());
-		pushInBuffer(newItem);
-	}
-
-	void WriteFlagsAction::FlushFunction::operator()()
-	{
-		boost::mutex::scoped_lock lock(_parent->_mutex);
-		do {
-			while(_parent->_buffer.size() < _parent->_minBufferItemsForWriting && !_parent->_isFinishing)
-				_parent->_bufferChange.wait(lock);
-
-			std::stack<BufferItem> bufferCopy;
-			while(!_parent->_buffer.empty())
-			{
-				BufferItem item = _parent->_buffer.top();
-				_parent->_buffer.pop();
-				item._index->Reattach(*_parent->_imageSet);
-				bufferCopy.push(item);
-			}
-			_parent->_bufferChange.notify_all();
-			if(bufferCopy.size() >= _parent->_minBufferItemsForWriting)
-				AOLogger::Debug << "Flag buffer has reached minimal writing size, flushing flags...\n";
-			else
-				AOLogger::Debug << "Flushing flags...\n";
-			lock.unlock();
-
-			boost::mutex::scoped_lock ioLock(*_parent->_ioMutex);
-			while(!bufferCopy.empty())
-			{
-				BufferItem item = bufferCopy.top();
-				bufferCopy.pop();
-				_parent->_imageSet->AddWriteFlagsTask(*item._index, item._masks);
-			}
-			_parent->_imageSet->PerformWriteFlagsTask();
-			ioLock.unlock();
-
-			lock.lock();
-		} while(!_parent->_isFinishing || !_parent->_buffer.empty());
-	}
-
-	void WriteFlagsAction::Finish()
-	{
-		boost::mutex::scoped_lock lock(_mutex);
-		_isFinishing = true;
-		_bufferChange.notify_all();
-		if(_flusher != 0)
-		{
-			boost::thread *flusher = _flusher;
-			_flusher = 0;
-			lock.unlock();
-			AOLogger::Debug << "Finishing the flusher thread...\n";
-			flusher->join();
-			delete flusher;
-			delete _imageSet;
-		}
-	}
-}
diff --git a/CEP/DP3/AOFlagger/src/strategy/algorithms/baselineselector.cpp b/CEP/DP3/AOFlagger/src/strategy/algorithms/baselineselector.cpp
deleted file mode 100644
index 45a7f218d01780ef191f16d07c17ab252ce58c0a..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/strategy/algorithms/baselineselector.cpp
+++ /dev/null
@@ -1,240 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2011 by A.R. Offringa                                   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#include <AOFlagger/strategy/algorithms/baselineselector.h>
-
-#include <AOFlagger/util/aologger.h>
-#include <AOFlagger/util/plot.h>
-
-#include <AOFlagger/quality/defaultstatistics.h>
-
-#include <AOFlagger/strategy/algorithms/thresholdtools.h>
-
-namespace rfiStrategy
-{
-
-void BaselineSelector::Add(Mask2DCPtr mask, TimeFrequencyMetaDataCPtr metaData)
-{
-	BaselineSelector::SingleBaselineInfo baseline;
-	baseline.length = metaData->Baseline().Distance();
-	if(baseline.length > 0)
-	{
-		baseline.antenna1 = metaData->Antenna1().id;
-		baseline.antenna2 = metaData->Antenna2().id;
-		baseline.antenna1Name = metaData->Antenna1().name;
-		baseline.antenna2Name = metaData->Antenna2().name;
-		baseline.band = metaData->Band().windowIndex;
-
-		baseline.rfiCount = mask->GetCount<true>();
-		baseline.totalCount = mask->Width() * mask->Height();
-
-		_baselines.push_back(baseline);
-	}
-}
-
-void BaselineSelector::Add(DefaultStatistics &baselineStat, AntennaInfo &antenna1, AntennaInfo &antenna2)
-{
-	if(antenna1.id != antenna2.id)
-	{
-		BaselineSelector::SingleBaselineInfo baseline;
-		baseline.length = Baseline(antenna1, antenna2).Distance();
-		baseline.antenna1 = antenna1.id;
-		baseline.antenna2 = antenna2.id;
-		baseline.antenna1Name = antenna1.name;
-		baseline.antenna2Name = antenna2.name;
-		baseline.band = 0;
-		
-		const DefaultStatistics singleStat = baselineStat.ToSinglePolarization();
-		
-		baseline.rfiCount = singleStat.rfiCount[0];
-		baseline.totalCount = singleStat.count[0] + singleStat.rfiCount[0];
-		
-		_baselines.push_back(baseline);
-	}
-}
-
-void BaselineSelector::Search(std::vector<BaselineSelector::SingleBaselineInfo> &markedBaselines)
-{
-	// Perform a first quick threshold to remove baselines which deviate a lot (e.g. 100% flagged
-	// baselines). Sometimes, there are a lot of them, causing instability if this would not be
-	// done.
-	for(int i=_baselines.size()-1;i>=0;--i)
-	{
-		double currentValue = (double) _baselines[i].rfiCount / (double) _baselines[i].totalCount;
-		if(currentValue>_absThreshold || (_baselines[i].rfiCount==0 && _baselines[i].totalCount>=2500))
-		{
-			if(_useLog)
-				AOLogger::Info << "Baseline " << _baselines[i].antenna1Name << " x " << _baselines[i].antenna2Name << " looks bad: "
-			<< round(currentValue * 10000.0)/100.0 << "% rfi (zero or above " << (_absThreshold*100.0) << "% abs threshold)\n";
-				
-			_baselines[i].marked = true;
-			markedBaselines.push_back(_baselines[i]);
-			_baselines.erase(_baselines.begin()+i);
-		}
-	}
-
-	bool foundMoreBaselines;
-	do {
-		std::sort(_baselines.begin(), _baselines.end());
-
-		Plot *plot = 0;
-		if(_makePlot)
-		{
-			plot = new Plot("baselineSelection.pdf");
-			plot->SetXAxisText("Baseline length (meters)");
-			plot->SetYAxisText("Percentage RFI");
-		}
-
-		size_t unmarkedBaselineCount = _baselines.size();
-		double *values = new double[unmarkedBaselineCount];
-
-		// Calculate the smoothed values
-		if(_makePlot)
-			plot->StartLine("Smoothed values");
-
-		size_t valueIndex = 0;
-		for(BaselineVector::const_iterator i=_baselines.begin();i!=_baselines.end();++i)
-		{
-			double smoothedVal = smoothedValue(*i);
-			if(_makePlot)
-				plot->PushDataPoint(i->length, 100.0*smoothedVal);
-			values[valueIndex] = smoothedVal - (double) i->rfiCount / (double) i->totalCount;
-			++valueIndex;
-		}
-
-		// Calculate the std dev
-		double mean, stddev;
-		std::vector<double> valuesCopy;
-		for(size_t i=0;i<unmarkedBaselineCount;++i)
-			valuesCopy.push_back(values[i]);
-		ThresholdTools::TrimmedMeanAndStdDev(valuesCopy, mean, stddev);
-
-		if(_makePlot && _useLog)
-			AOLogger::Debug << "Estimated std dev for thresholding, in percentage of RFI: " << round(10000.0*stddev)/100.0 << "%\n";
-
-		// unselect already marked baselines
-		for(int i=markedBaselines.size()-1;i>=0;--i)
-		{
-			BaselineSelector::SingleBaselineInfo baseline =
-				markedBaselines[i];
-			double currentValue = (double) baseline.rfiCount / (double) baseline.totalCount;
-			double baselineValue =
-				smoothedValue(baseline.length) - currentValue;
-			if(baselineValue >= mean - _threshold*stddev && baselineValue <= mean + _threshold*stddev && currentValue<_absThreshold && (baseline.rfiCount!=0 || baseline.totalCount<2500))
-			{
-				markedBaselines.erase(markedBaselines.begin()+i);
-				_baselines.push_back(baseline);
-				if(_useLog)
-					AOLogger::Info << "Baseline " << baseline.antenna1Name << " x " << baseline.antenna2Name << " is now within baseline curve\n";
-			}
-		}
-		
-		// (re)select baselines to be thrown away
-		foundMoreBaselines = false;
-		if(_makePlot)
-			plot->StartScatter("Threshold");
-		double maxPlotY = 0.0;
-		for(int i=unmarkedBaselineCount-1;i>=0;--i)
-		{
-			double currentValue = (double) _baselines[i].rfiCount / (double) _baselines[i].totalCount;
-			if(_makePlot)
-			{
-				double plotY = 100.0*(values[i] + currentValue + mean + _threshold*stddev);
-				plot->PushDataPoint(_baselines[i].length, plotY);
-				plot->PushDataPoint(_baselines[i].length, 100.0*(values[i] + currentValue + mean - _threshold*stddev));
-				if(plotY > maxPlotY) maxPlotY=plotY;
-			}
-			if(values[i] < mean - _threshold*stddev || values[i] > mean + _threshold*stddev || currentValue>_absThreshold || (_baselines[i].rfiCount==0 && _baselines[i].totalCount>=2500))
-			{
-				if(_useLog)
-					AOLogger::Info << "Baseline " << _baselines[i].antenna1Name << " x " << _baselines[i].antenna2Name << " looks bad: "
-				<< round(currentValue * 10000.0)/100.0 << "% rfi, "
-				<< round(10.0*fabs((values[i] - mean) / stddev))/10.0 << "*sigma away from est baseline curve\n";
-					
-				if(!_baselines[i].marked)
-				{
-					foundMoreBaselines = true;
-					_baselines[i].marked = true;
-				}
-				markedBaselines.push_back(_baselines[i]);
-				_baselines.erase(_baselines.begin()+i);
-			}
-		}
-		if(_makePlot)
-		{
-			plot->SetYRange(0.0, maxPlotY*1.5);
-			plot->StartScatter("Accepted baselines");
-			for(BaselineVector::const_iterator i=_baselines.begin();i!=_baselines.end();++i)
-			{
-				plot->PushDataPoint(i->length, 100.0 * (double) i->rfiCount / (double) i->totalCount);
-			}
-			plot->StartScatter("Rejected baselines");
-			for(BaselineVector::const_iterator i=markedBaselines.begin();i!=markedBaselines.end();++i)
-			{
-				plot->PushDataPoint(i->length, 100.0 * (double) i->rfiCount / (double) i->totalCount);
-			}
-			plot->Close();
-			delete plot;
-		}
-
-		delete[] values;
-	} while(foundMoreBaselines);
-}
-
-void BaselineSelector::ImplyStations(const std::vector<BaselineSelector::SingleBaselineInfo> &markedBaselines, double maxRatio, std::set<unsigned> &badStations) const
-{
-	std::map<unsigned, unsigned> stations;
-	for(std::vector<BaselineSelector::SingleBaselineInfo>::const_iterator i=markedBaselines.begin();i!=markedBaselines.end();++i)
-	{
-		stations[i->antenna1]++;
-		stations[i->antenna2]++;
-	}
-	
-	for(std::map<unsigned, unsigned>::const_iterator i=stations.begin();i!=stations.end();++i)
-	{
-		double ratio = (double) i->second / (double) stations.size();
-		if(ratio > maxRatio)
-		{
-			badStations.insert(i->first);
-		}
-	}
-}
-
-double BaselineSelector::smoothedValue(double length) const
-{
-	double logLength = log(length);
-
-	double sum = 0.0;
-	double weight = 0.0;
-
-	for(BaselineSelector::BaselineVector::const_iterator i=_baselines.begin();i!=_baselines.end();++i)
-	{
-		double otherLogLength = log(i->length);
-		double otherValue = (double) i->rfiCount / (double) i->totalCount;
-		double x = otherLogLength-logLength;
-		double curWeight = exp(-x*x/(2.0*_smoothingSigma*_smoothingSigma));
-		sum += curWeight * otherValue;
-		weight += curWeight;
-	}
-
-	return sum / weight;
-}
-
-}
diff --git a/CEP/DP3/AOFlagger/src/strategy/algorithms/baselinetimeplaneimager.cpp b/CEP/DP3/AOFlagger/src/strategy/algorithms/baselinetimeplaneimager.cpp
deleted file mode 100644
index 05371c6df0118e31020f8a6a10eec036c04b9b19..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/strategy/algorithms/baselinetimeplaneimager.cpp
+++ /dev/null
@@ -1,107 +0,0 @@
-#include <AOFlagger/strategy/algorithms/baselinetimeplaneimager.h>
-#include <AOFlagger/util/aologger.h>
-
-#include <cmath>
-
-#include <fftw3.h>
-#include <boost/iterator/iterator_concepts.hpp>
-
-template<typename NumType>
-void BaselineTimePlaneImager<NumType>::Image(NumType uTimesLambda, NumType vTimesLambda, NumType wTimesLambda, NumType lowestFrequency, NumType frequencyStep, size_t channelCount, const std::complex<NumType> *data, Image2D &output)
-{
-	NumType phi = atan2(vTimesLambda, uTimesLambda);
-	size_t imgSize = output.Width();
-	NumType minLambda = frequencyToWavelength(lowestFrequency + frequencyStep*(NumType) channelCount);
-	NumType uvDist = sqrt(uTimesLambda*uTimesLambda + vTimesLambda*vTimesLambda) / minLambda;
-	NumType scale = 1.0; // scale down from all sky to ...
-	
-	// Steps to be taken:
-	// 1. Create a 1D array with the data in it (in 'u' dir) and otherwise zerod.
-	//    This represents a cut through the uvw plane. The highest non-zero samples
-	//    have uv-distance 2*|uvw|. Channels are not regridded. Therefore, the distance in
-	//    samples is 2 * (lowestFrequency / frequencyStep + channelCount)
-	//    (Two times larger than necessary to prevent border issues).
-	//    
-	// 2. Fourier transform this (FFT 1D)
-	//    The 1D FFT is of size max(imgSize * 2, sampleDist * 2).
-	
-	// 3. Stretch, rotate and make it fill the plane
-	//    - Stretch with 1/|uvw|
-	//    - Rotate with phi
-	// 4. Add to output
-	
-	size_t sampleDist = 2*((size_t) round(lowestFrequency/frequencyStep) + channelCount);
-	size_t fftSize = std::max((size_t) (imgSize*sampleDist/(scale * (2.0*uvDist))), 2*sampleDist);
-	fftw_complex *fftInp = (fftw_complex*) fftw_malloc(sizeof(fftw_complex) * (fftSize/2+1));
-	double *fftOut = (double*) fftw_malloc(sizeof(double) * fftSize);
-	fftw_plan plan = fftw_plan_dft_c2r_1d(fftSize, fftInp, fftOut, FFTW_ESTIMATE);
-	size_t startChannel = (lowestFrequency/frequencyStep);
-	for(size_t i=0;i!=(fftSize/2+1);++i) {
-		fftInp[i][0] = 0.0;
-		fftInp[i][1] = 0.0;
-	}
-	for(size_t ch=0;ch!=channelCount;++ch)
-	{
-		//fftInp[fftSize - (startChannel + ch)][0] = data->real();
-		//fftInp[fftSize - (startChannel + ch)][1] = data->imag();
-		//fftInp[(startChannel + ch)][0] = data->real();
-		//fftInp[(startChannel + ch)][1] = -data->imag();
-		fftInp[(startChannel + ch)][0] = data->real();
-		fftInp[(startChannel + ch)][1] = data->imag();
-		++data;
-	}
-	
-	//AOLogger::Debug << "FFT...\n";
-	fftw_execute(plan);
-	fftw_free(fftInp);
-	
-	// fftw gives unnormalized results; have to divide by sqrt fftSize. 
-	NumType fftFactor = 1.0 / sqrt(fftSize);
-	for(size_t i=0;i!=fftSize;++i)
-	{
-		fftOut[i] *= fftFactor;
-	}
-	
-	AOLogger::Debug << "phi=" << phi << ",imgSize=" << imgSize << ",minLambda=" << minLambda << ",fftSize=" << fftSize << ",uvOnlyDist=" << uvDist << ",sampleDist=" << sampleDist << '\n';
-	
-	size_t fftCentre = fftSize / 2;
-	NumType cosPhi = cos(phi), sinPhi = sin(phi);
-	NumType mid = (NumType) imgSize / 2.0;
-	
-	NumType transformGen = scale * (2.0*uvDist / sampleDist) * (fftSize / imgSize);
-	NumType transformX = cosPhi * transformGen;
-	// Negative rotation (thus positive sin sign)
-	NumType transformY = sinPhi * transformGen;
-	NumType tanZsinChi = 1.0, tanZcosChi = 1.0; // TODO testing!
-	for(size_t y=0;y!=imgSize;++y)
-	{
-		num_t *destPtr = output.ValuePtr(0, y);
-		NumType m = (NumType) y - mid;
-		for(size_t x=0;x!=imgSize;++x)
-		{
-			NumType l = (NumType) x - mid;
-			// We need lookup table for ''(sqrt(1-l*l-m*m)-1)''
-			NumType mSeen = m - (sqrt(1-l*l-m*m)-1) * tanZsinChi;
-			NumType lSeen = l + (sqrt(1-l*l-m*m)-1) * tanZcosChi;
-			NumType yrTransformed = mSeen * transformY;
-			NumType srcX = lSeen * transformX + yrTransformed;
-			size_t srcXIndex = (size_t) round(srcX) + fftCentre;
-			if(srcXIndex < fftSize) {
-				if(srcXIndex < fftCentre)
-					*destPtr += fftOut[srcXIndex+fftCentre];
-				else
-					*destPtr += fftOut[srcXIndex-fftCentre];
-			}
-			++destPtr;
-			//else
-			//	output.SetValue(x, y, 0.0);
-			//if(x==0 && y==0) AOLogger::Debug << "srcX=" << srcX << '\n';
-		}
-	}
-	
-	fftw_destroy_plan(plan);
-	fftw_free(fftOut);
-}
-
-template class BaselineTimePlaneImager<float>;
-template class BaselineTimePlaneImager<double>;
diff --git a/CEP/DP3/AOFlagger/src/strategy/algorithms/eigenvalue.cpp b/CEP/DP3/AOFlagger/src/strategy/algorithms/eigenvalue.cpp
deleted file mode 100644
index f88a9606986be5ae9592618999920229c42232e1..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/strategy/algorithms/eigenvalue.cpp
+++ /dev/null
@@ -1,161 +0,0 @@
-
-#include <AOFlagger/strategy/algorithms/eigenvalue.h>
-
-#include <stdexcept>
-
-// Needs to be included LAST
-#include <AOFlagger/f2c.h>
-#include <AOFlagger/util/aologger.h>
-
-extern "C" {
-	void zheevx_(char *jobz, char *range, char *uplo, integer *n,
-							doublecomplex *a, integer *lda, double *vl, double *vu, integer *il,
-							integer *iu, double *abtol, integer *nfound, double  *w,
-							doublecomplex *z, integer *ldz, doublecomplex *work,
-							integer *lwork, doublereal *rwork, integer *iwork, integer *ifail, integer *info);
-
-	void zheev_(char *jobz, char *uplo, integer *n,
-							doublecomplex *a, integer *lda, double  *w,
-							doublecomplex *work,
-							integer *lwork, doublereal *rwork, integer *info);
-}
-
-double Eigenvalue::Compute(Image2DCPtr real, Image2DCPtr imaginary)
-{
-	if(real->Width() != imaginary->Width() || real->Height() != imaginary->Height())
-		throw std::runtime_error("Size of real and imaginary don't match in eigen value decomposition");
-	if(real->Width() != real->Height())
-		throw std::runtime_error("Not a square image given in eigen value decomposition");
-	
-	char jobz[] = "N";  // compute eigenvalues only
-	char range[] = "I"; // the IL-th through IU-th eigenvalues will be found.
-	char uplo[] = "U";  // Upper triangle of A is stored
-	long int n = real->Width();
-	long int lda = n;
-	double vl = 0, vu = 0;
-	//long int il = 1, iu = 1; // search for first eigenvalue
-	long int il = n, iu = n; // search for nth eigenvalue
-	double abtol = 0.0;
-	long int nfound = 0;
-	double w[n];
-	doublecomplex z; // for eigenvectors, not used
-	long int ldz = 1; // for eigenvectors, not used
-	long int ifail = 0;
-	long int info = 0;
-	
-	doublecomplex *a = new doublecomplex[n * n];
-	for(int y=0;y<n;++y) {
-		for(int x=0;x<n; ++x) {
-			a[y + x*n].r = real->Value(x, y);
-			a[y + x*n].i = imaginary->Value(x, y);
-		}
-	}
-	
-	doublecomplex complexWorkAreaSize;
-	long int workAreaSize = -1;
-	doublereal *rwork = new doublereal[7*n];
-	integer *iwork = new integer[5*n];
-
-	// Determine optimal workareasize
-	zheevx_(jobz, range, uplo, &n, a, &lda, &vl, &vu, &il, &iu, &abtol, &nfound, w, &z, &ldz, &complexWorkAreaSize, &workAreaSize, rwork, iwork, &ifail, &info);
-	
-	if(info != 0)
-	{
-		delete[] a;
-		delete[] rwork;
-		delete[] iwork;
-		throw std::runtime_error("Can not determine workareasize, zheevx returned an error.");
-	}
-	
-	workAreaSize = (int) complexWorkAreaSize.r;
-	doublecomplex *work = new doublecomplex[workAreaSize];
-	zheevx_(jobz, range, uplo, &n, a, &lda, &vl, &vu, &il, &iu, &abtol, &nfound, w, &z, &ldz, work, &workAreaSize, rwork, iwork, &ifail, &info);
-	
-	delete[] work;
-	delete[] a;
-	delete[] rwork;
-	
-	if(info != 0)
-		throw std::runtime_error("zheevx failed");
-	
-	return w[0];
-}
-
-void Eigenvalue::Remove(Image2DPtr real, Image2DPtr imaginary, bool debug)
-{
-	if(real->Width() != imaginary->Width() || real->Height() != imaginary->Height())
-		throw std::runtime_error("Size of real and imaginary don't match in eigen value decomposition");
-	if(real->Width() != real->Height())
-		throw std::runtime_error("Not a square image given in eigen value decomposition");
-	
-	char jobz[] = "V";  // compute eigenvalues and eigenvectors
-	char uplo[] = "U";  // Upper triangle of A is stored
-	long int n = real->Width();
-	long int lda = n;
-	double w[n];
-	long int info = 0;
-	
-	doublecomplex *a = new doublecomplex[n * n];
-	for(int y=0;y<n;++y) {
-		for(int x=0;x<n; ++x) {
-			a[y + x*n].r = real->Value(x, y);
-			a[y + x*n].i = imaginary->Value(x, y);
-		}
-	}
-	
-	doublecomplex complexWorkAreaSize;
-	long int workAreaSize = -1;
-	doublereal *rwork = new doublereal[7*n];
-
-	// Determine optimal workareasize
-	zheev_(jobz, uplo, &n, a, &lda, w, &complexWorkAreaSize, &workAreaSize, rwork, &info);
-	
-	if(info != 0)
-	{
-		delete[] a;
-		delete[] rwork;
-		throw std::runtime_error("Can not determine workareasize, zheev returned an error.");
-	}
-	
-	workAreaSize = (int) complexWorkAreaSize.r;
-	doublecomplex *work = new doublecomplex[workAreaSize];
-	zheev_(jobz, uplo, &n, a, &lda, w, work, &workAreaSize, rwork, &info);
-	
-	delete[] work;
-	delete[] rwork;
-	
-	if(info != 0)
-		throw std::runtime_error("zheev failed");
-		
-	if(debug) 
-	{
-		AOLogger::Debug << "Eigenvalues: ";
-		for(unsigned i=0;i<n;++i)
-			AOLogger::Debug << w[i] << ' ';
-		AOLogger::Debug << '\n';
-	}
-	for(int y=0;y<n;++y)
-	{
-		for(int x=0;x<n;++x)
-		{
-			double a_xy_r = 0.0;
-			double a_xy_i = 0.0;
-			// A = U S U^T , so:
-			// a_xy = \sum_{i=0}^{n} U_{iy} S_{ii} U_{ix}
-			// The eigenvalues are sorted from small (or negative) to large (positive)
-			for(int i=n-1;i<n;++i) {
-				double u_r = a[y + i*n].r;
-				double u_i = a[y + i*n].i;
-				double s = w[i];
-				double ut_r = a[x + i*n].r;
-				double ut_i = a[x + i*n].i;
-				a_xy_r += s * (u_r * ut_r - u_i * ut_i);
-				a_xy_i += s * (u_r * ut_i + u_i * ut_r);
-			}
-			real->SetValue(x, y, /*real->Value(x, y) - */ a_xy_r);
-			imaginary->SetValue(x, y, /*imaginary->Value(x, y) -*/ a_xy_i);
-		}
-	}
-	
-	delete[] a;
-}
diff --git a/CEP/DP3/AOFlagger/src/strategy/algorithms/fringestoppingfitter.cpp b/CEP/DP3/AOFlagger/src/strategy/algorithms/fringestoppingfitter.cpp
deleted file mode 100644
index ead680f2602812ac5dfb522575491a849a1536b8..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/strategy/algorithms/fringestoppingfitter.cpp
+++ /dev/null
@@ -1,436 +0,0 @@
- /***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <AOFlagger/msio/antennainfo.h>
-
-#include <AOFlagger/imaging/uvimager.h>
-
-#include <AOFlagger/util/aologger.h>
-#include <AOFlagger/util/rng.h>
-
-#include <AOFlagger/strategy/algorithms/fringestoppingfitter.h>
-#include <AOFlagger/strategy/algorithms/sinusfitter.h>
-
-FringeStoppingFitter::FringeStoppingFitter() :
-	_originalData(0), _fringesToConsider(1.0), _minWindowSize(32), _maxWindowSize(128), _returnFittedValue(false), _returnMeanValue(false), _fringeFit(true), _newPhaseCentreDec(M_PInl*0.5), _newPhaseCentreRA(0.0)
-{
-}
-
-FringeStoppingFitter::~FringeStoppingFitter()
-{
-}
-
-void FringeStoppingFitter::PerformFit(unsigned taskNumber)
-{
-	if(_fringeFit)
-		PerformDynamicFrequencyFitOnOneChannel(taskNumber, _maxWindowSize);
-	else
-	{
-		size_t x = taskNumber;
-	
-		if(_fitChannelsIndividually)
-		{
-			for(size_t y=0;y<_originalData->ImageHeight();++y)
-			{
-				num_t r, i;
-				CalculateFitValue(*_originalData->GetRealPart(), *_originalData->GetImaginaryPart(), x, y, 1, r, i);
-	
-				_realBackground->SetValue(x, y, r);
-				_imaginaryBackground->SetValue(x, y, i);
-			}
-		}
-		else
-		{
-			num_t r, i;
-			CalculateFitValue(*_originalData->GetRealPart(), *_originalData->GetImaginaryPart(), x, 0, _originalData->ImageHeight(), r, i);
-		
-			for(size_t y=0;y<_originalData->ImageHeight();++y)
-			{
-				_realBackground->SetValue(x, y, r);
-				_imaginaryBackground->SetValue(x, y, i);
-			}
-		}
-	}
-}
-
-void FringeStoppingFitter::PerformStaticFrequencyFitOnOneChannel(unsigned y)
-{
-	if(_fitChannelsIndividually)
-	{
-		for(size_t x=0;x<_originalData->ImageWidth();++x)
-		{
-			num_t r, i;
-			CalculateFitValue(*_originalData->GetRealPart(), *_originalData->GetImaginaryPart(), x, y, 1, r, i);
-
-			_realBackground->SetValue(x, y, r);
-			_imaginaryBackground->SetValue(x, y, i);
-		}
-	}
-	else
-	{
-		for(size_t x=0;x<_originalData->ImageWidth();++x)
-		{
-		num_t r, i;
-		CalculateFitValue(*_originalData->GetRealPart(), *_originalData->GetImaginaryPart(), x, 0, _originalData->ImageHeight(), r, i);
-		
-			_realBackground->SetValue(x, y, r);
-			_imaginaryBackground->SetValue(x, y, i);
-		}
-	}
-}
-
-void FringeStoppingFitter::PerformFringeStop()
-{
-	Image2DCPtr
-		real = _originalData->GetRealPart(),
-		imaginary = _originalData->GetImaginaryPart();
-
-	Baseline baseline(*_antenna1Info, *_antenna2Info);
-
-	for(size_t x=0;x<real->Width();++x)
-	{
-		for(size_t y=0;y<real->Height();++y)
-		{
-			num_t r = real->Value(x, y);
-			num_t i = imaginary->Value(x, y);
-			num_t fringeCount = UVImager::GetFringeCount(0, x, y, _metaData);
-
-			num_t cosfreq = cosn(fringeCount*2.0L*M_PIn), sinfreq = sinn(fringeCount*2.0L*M_PIn);
-			
-			num_t newR = r * cosfreq - i * sinfreq;
-			i = r * sinfreq + i * cosfreq;
-			
-			_realBackground->SetValue(x, y, newR);
-			_imaginaryBackground->SetValue(x, y, i);
-		}
-	}
-}
-
-num_t FringeStoppingFitter::CalculateMaskedAverage(const Image2D &image, size_t x, size_t yFrom, size_t yLength)
-{
-	num_t average = 0.0L;
-	size_t count = 0;
-	for(size_t i = yFrom; i < yFrom+yLength; ++i)
-	{
-		if(!_originalMask->Value(x, i) && std::isfinite(image.Value(x, i)))
-		{
-			average += image.Value(x, i);
-			++count;
-		}
-	}
-	return average / (long double) count;
-}
-
-num_t FringeStoppingFitter::CalculateUnmaskedAverage(const Image2D &image, size_t x, size_t yFrom, size_t yLength)
-{
-	num_t average = 0.0L;
-	size_t count = 0;
-	for(size_t i = yFrom; i < yFrom+yLength; ++i)
-	{
-		if(std::isfinite(image.Value(x, i)))
-		{
-			average += image.Value(x, i);
-			++count;
-		}
-	}
-	return average / (num_t) count;
-}
-
-void FringeStoppingFitter::CalculateFitValue(const Image2D &real, const Image2D &imaginary, size_t x, size_t yFrom, size_t yLength, num_t &rValue, num_t &iValue)
-{
-	size_t windowWidth;
-	size_t yMid = yFrom + yLength/2;
-	num_t estimatedFrequency = GetFringeFrequency(x, yMid);
-	windowWidth = (size_t) ceil(_fringesToConsider/estimatedFrequency);
-	if(windowWidth > _maxWindowSize)
-		windowWidth = _maxWindowSize;
-	if(windowWidth < _minWindowSize)
-		windowWidth = _minWindowSize;
-
-	size_t xLeft, xRight;
-	xRight = x + windowWidth/2;
-	if(x >= (windowWidth/2))
-		xLeft = x - (windowWidth/2);
-	else {
-		xLeft = 0;
-		xRight += (windowWidth/2) - x;
-	}
-	if(xRight > real.Width())
-	{
-		if(xLeft > xRight - real.Width())
-			xLeft -= xRight - real.Width();
-		else
-			xLeft = 0;
-		xRight = real.Width();
-	}
-
-	num_t fringeFrequency = GetFringeFrequency(x, yMid);
-	num_t *dataT = new num_t[xRight - xLeft];
-	num_t *dataR = new num_t[xRight - xLeft];
-	num_t *dataI = new num_t[xRight - xLeft];
-	
-	size_t index = 0;
-	for(size_t i=xLeft;i<xRight;++i)
-	{
-		dataR[index] = CalculateMaskedAverage(real, i, yFrom, yLength);
-		dataI[index] = CalculateMaskedAverage(imaginary, i, yFrom, yLength);
-		if(std::isfinite(dataR[index]) && std::isfinite(dataI[index]))
-		{
-			dataT[index] = i;
-			++index;
-		}
-	}
-	if(index == 0)
-	{
-		for(size_t i=xLeft;i<xRight;++i)
-		{
-			dataR[index] = CalculateUnmaskedAverage(real, i, yFrom, yLength);
-			dataI[index] = CalculateUnmaskedAverage(imaginary, i, yFrom, yLength);
-			if(std::isfinite(dataR[index]) && std::isfinite(dataI[index]))
-			{
-				dataT[index] = i;
-				++index;
-			}
-		}
-	}
-
-	SinusFitter fitter;
-	num_t
-		phaseR, phaseI, amplitude;
-
-	fitter.FindPhaseAndAmplitudeComplex(phaseR, amplitude, dataR, dataI, dataT, index, fringeFrequency);
-	phaseI = fmodn(phaseR+M_PIn*0.5L, 2.0L*M_PIn);
-	num_t rfiValueR =
-		SinusFitter::Value(phaseR, amplitude, x, fringeFrequency, 0.0);
-	num_t rfiValueI =
-		SinusFitter::Value(phaseI, amplitude, x, fringeFrequency, 0.0);
-
-	if(_returnFittedValue)
-	{
-		num_t meanR = fitter.FindMean(phaseR, amplitude, dataR, dataT, index, fringeFrequency);
-		num_t meanI = fitter.FindMean(phaseI, amplitude, dataI, dataT, index, fringeFrequency);
-		rValue = rfiValueR + meanR;
-		iValue = rfiValueI + meanI;
-	}
-	else if(_returnMeanValue)
-	{
-		rValue = fitter.FindMean(phaseR, amplitude, dataR, dataT, index, fringeFrequency);
-		iValue = fitter.FindMean(phaseI, amplitude, dataI, dataT, index, fringeFrequency);
-	}
-	else
-	{
-		num_t observedValueR =
-			CalculateMaskedAverage(real, x, yFrom, yLength);
-		num_t observedValueI =
-			CalculateMaskedAverage(imaginary, x, yFrom, yLength);
-		rValue = observedValueR - rfiValueR;
-		iValue = observedValueI - rfiValueI;
-	}
-
-	delete[] dataR;
-	delete[] dataI;
-	delete[] dataT;
-}
-
-num_t FringeStoppingFitter::GetFringeFrequency(size_t x, size_t y)
-{
-	double deltaTime;
-	if(_observationTimes->size()>1)
-		deltaTime = (*_observationTimes)[1] - (*_observationTimes)[0];
-	else
-		deltaTime = 1.0;
-	num_t observeFreq = _bandInfo->channels[y].frequencyHz;
-	Baseline baseline(*_antenna1Info, *_antenna2Info);
-	num_t delayRA = _fieldInfo->delayDirectionRA;
-	num_t delayDec = _fieldInfo->delayDirectionDec;
-	return deltaTime *
-		UVImager::GetFringeStopFrequency(x, baseline, delayRA, delayDec, observeFreq, _metaData);
-}
-
-void FringeStoppingFitter::GetRFIValue(num_t &r, num_t &i, int x, int y, num_t rfiPhase, num_t rfiStrength)
-{
-	const numl_t earthRotation = UVImager::TimeToEarthLattitude(x, _metaData);
-	const Baseline baseline = _metaData->Baseline();
-	const numl_t newWPos =
-		 UVImager::GetWPosition(_newPhaseCentreDec, _newPhaseCentreRA, _metaData->Band().channels[y].frequencyHz, earthRotation, baseline.DeltaX(), baseline.DeltaY());
-	const num_t rotations =  
-		UVImager::GetFringeCount(0, x, y, _metaData) - newWPos;
-		
-	r = cosn(rotations * 2.0 * M_PIn + rfiPhase) * rfiStrength;
-	i = -sinn(rotations * 2.0 * M_PIn + rfiPhase) * rfiStrength;
-}
-
-void FringeStoppingFitter::GetMeanValue(num_t &rMean, num_t &iMean, num_t phase, num_t amplitude, SampleRowCPtr real, SampleRowCPtr imaginary, unsigned xStart, unsigned xEnd, unsigned y)
-{
-	rMean = 0.0;
-	iMean = 0.0;
-	for(unsigned t=xStart;t<xEnd;++t)
-	{
-		num_t r, i;
-		GetRFIValue(r, i, t, y, phase, amplitude);
-		rMean += real->Value(t) - r;
-		iMean += imaginary->Value(t) - i;
-	}
-	rMean /= (num_t) (xEnd - xStart);
-	iMean /= (num_t) (xEnd - xStart);
-}
-
-void FringeStoppingFitter::MinimizeRFIFitError(num_t &phase, num_t &amplitude, SampleRowCPtr real, SampleRowCPtr imaginary, unsigned xStart, unsigned xEnd, unsigned y) const throw()
-{
-	// calculate 1/N * \sum_x v(t) e^{2 i \pi \tau_g(t)}, where \tau_g(t) is the number of phase rotations
-	// because of the geometric delay as function of time t.
-
-	num_t sumR = 0.0, sumI = 0.0;
-	size_t n = 0;
-
-	const num_t dx = _metaData->Antenna2().position.x - _metaData->Antenna1().position.x;
-	const num_t dy = _metaData->Antenna2().position.y - _metaData->Antenna1().position.y;
-		
-	for(unsigned t=xStart;t<xEnd;++t)
-	{
-		const num_t vR = real->Value(t);
-		const num_t vI = imaginary->Value(t);
-		
-		if(std::isfinite(vR) && std::isfinite(vI))
-		{
-			const num_t tRotation = UVImager::TimeToEarthLattitude(_metaData->ObservationTimes()[t]);
-			const num_t tauge = UVImager::GetFringeCount(0, t, y, _metaData);
-			const num_t taugeNew = UVImager::GetWPosition(_newPhaseCentreDec, _newPhaseCentreRA, _metaData->Band().channels[y].frequencyHz, tRotation, dx, dy);
-			const num_t phaseShift = tauge - taugeNew;
-	
-			sumR += vR * cosn(-2.0 * M_PIn * phaseShift);
-			sumR += vI * sinn(-2.0 * M_PIn * phaseShift);
-	
-			sumI += vR * sinn(-2.0 * M_PIn * phaseShift);
-			sumI -= vI * cosn(-2.0 * M_PIn * phaseShift);
-			++n;
-		}
-	}
-
-	sumR /= (num_t) n;
-	sumI /= (num_t) n;
-
-	phase = SinusFitter::Phase(sumR, sumI);
-	amplitude = sqrtn(sumR*sumR + sumI*sumI);
-}
-
-void FringeStoppingFitter::PerformDynamicFrequencyFitOnOneChannel(unsigned y)
-{
-	SampleRowPtr
-		real = SampleRow::CreateFromRow(_originalData->GetRealPart(), y),
-		imaginary = SampleRow::CreateFromRow(_originalData->GetImaginaryPart(), y);
-	PerformDynamicFrequencyFitOnOneRow(real, imaginary, y);
-}
-
-void FringeStoppingFitter::PerformDynamicFrequencyFitOnOneRow(SampleRowCPtr real, SampleRowCPtr imaginary, unsigned y)
-{
-	num_t phase, strength;
-	MinimizeRFIFitError(phase, strength, real, imaginary, 0, _originalData->ImageWidth(), y);
-	AOLogger::Debug << "Amplitude found: " << strength << " phase found: " << phase << '\n';
-	for(size_t x=0;x<_originalData->ImageWidth();++x)
-	{
-		num_t rfiR, rfiI;
-		GetRFIValue(rfiR, rfiI, x, y, phase, strength);
-		if(_returnFittedValue)
-		{
-			num_t rMean, iMean;
-			GetMeanValue(rMean, iMean, phase, strength, real, imaginary, 0, _originalData->ImageWidth(), y);
-			_realBackground->SetValue(x, y, rfiR + rMean);
-			_imaginaryBackground->SetValue(x, y, rfiI + iMean);
-		} else {
-			_realBackground->SetValue(x, y, rfiR);
-			_imaginaryBackground->SetValue(x, y, rfiI);
-		}
-	}
-}
-
-void FringeStoppingFitter::PerformDynamicFrequencyFitOnOneChannel(unsigned y, unsigned windowSize)
-{
-	SampleRowPtr
-		real = SampleRow::CreateFromRowWithMissings(_originalData->GetRealPart(), _originalMask, y),
-		imaginary = SampleRow::CreateFromRowWithMissings(_originalData->GetImaginaryPart(), _originalMask, y);
-	PerformDynamicFrequencyFitOnOneRow(real, imaginary, y, windowSize);
-}
-
-void FringeStoppingFitter::PerformDynamicFrequencyFitOnOneRow(SampleRowCPtr real, SampleRowCPtr imaginary, unsigned y, unsigned windowSize)
-{
-	unsigned halfWindowSize = windowSize / 2;
-	for(size_t x=0;x<real->Size();++x)
-	{
-		size_t windowStart, windowEnd;
-		if(x > halfWindowSize)
-			windowStart = x - halfWindowSize;
-		else
-			windowStart = 0;
-		if(x + halfWindowSize < real->Size())
-			windowEnd = x + halfWindowSize;
-		else
-			windowEnd =  real->Size();
-		num_t windowPhase, windowStrength;
-		MinimizeRFIFitError(windowPhase, windowStrength, real, imaginary, windowStart, windowEnd, y);
-
-		num_t rfiR, rfiI;
-		GetRFIValue(rfiR, rfiI, x, y, windowPhase, windowStrength);
-		if(_returnFittedValue)
-		{
-			num_t rMean, iMean;
-			GetMeanValue(rMean, iMean, windowPhase, windowStrength, real, imaginary, windowStart, windowEnd, y);
-			_realBackground->SetValue(x, y, rfiR + rMean);
-			_imaginaryBackground->SetValue(x, y, rfiI + iMean);
-		} else {
-			_realBackground->SetValue(x, y, rfiR);
-			_imaginaryBackground->SetValue(x, y, rfiI);
-		}
-	}
-}
-
-void FringeStoppingFitter::PerformDynamicFrequencyFit()
-{
-	for(size_t y=0;y<_originalData->ImageHeight();++y)
-	{
-		PerformDynamicFrequencyFitOnOneChannel(y);
-	}
-}
-
-void FringeStoppingFitter::PerformDynamicFrequencyFit(unsigned yStart, unsigned yEnd, unsigned windowSize)
-{
-	SampleRowPtr
-		real = SampleRow::CreateFromRowSum(_originalData->GetRealPart(), yStart, yEnd),
-		imaginary = SampleRow::CreateFromRowSum(_originalData->GetImaginaryPart(), yStart, yEnd);
-	PerformDynamicFrequencyFitOnOneRow(real, imaginary, (yStart + yEnd) / 2, windowSize);
-}
-
-void FringeStoppingFitter::PerformDynamicFrequencyFit(unsigned yStart, unsigned yEnd)
-{
-	SampleRowPtr
-		real = SampleRow::CreateFromRowSum(_originalData->GetRealPart(), yStart, yEnd),
-		imaginary = SampleRow::CreateFromRowSum(_originalData->GetImaginaryPart(), yStart, yEnd);
-	PerformDynamicFrequencyFitOnOneRow(real, imaginary, (yStart + yEnd) / 2);
-}
-
-num_t FringeStoppingFitter::GetAmplitude(unsigned yStart, unsigned yEnd)
-{
-	unsigned y = (yStart + yEnd) / 2;
-	SampleRowPtr
-		real = SampleRow::CreateFromRowSum(_originalData->GetRealPart(), yStart, yEnd),
-		imaginary = SampleRow::CreateFromRowSum(_originalData->GetImaginaryPart(), yStart, yEnd);
-	num_t phase, amplitude;
-	MinimizeRFIFitError(phase, amplitude, real, imaginary, 0, _originalData->ImageWidth(), y);
-	return amplitude;
-}
diff --git a/CEP/DP3/AOFlagger/src/strategy/algorithms/fringetestcreater.cpp b/CEP/DP3/AOFlagger/src/strategy/algorithms/fringetestcreater.cpp
deleted file mode 100644
index d6945f8e67386f9bc59886f149eb283b9e0f328c..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/strategy/algorithms/fringetestcreater.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <AOFlagger/strategy/algorithms/fringetestcreater.h>
-
-#include <AOFlagger/msio/timefrequencydata.h>
-#include <AOFlagger/msio/timefrequencymetadata.h>
-
-#include <AOFlagger/imaging/uvimager.h>
-
-void FringeTestCreater::AddStaticFringe(class TimeFrequencyData &ftData, TimeFrequencyMetaDataCPtr metaData, long double strength)
-{
-	Image2DCPtr
-		real = ftData.GetRealPart(),
-		imaginary = ftData.GetImaginaryPart();
-	Image2DPtr
-		newReal = Image2D::CreateUnsetImagePtr(real->Width(), real->Height()),
-		newImaginary = Image2D::CreateUnsetImagePtr(real->Width(), real->Height());
-	
-	for(size_t channelIndex = 0; channelIndex < ftData.ImageHeight() ; ++channelIndex)
-	{
-		for(size_t t = 0; t < ftData.ImageWidth() ; ++t)
-		{
-			num_t fringeRotation =
-				2.0 * M_PIn * UVImager::GetFringeCount(0, t, channelIndex, metaData);
-			
-			newReal->SetValue(t, channelIndex, strength * cosn(fringeRotation) + real->Value(t, channelIndex) );
-			newImaginary->SetValue(t, channelIndex, strength * sinn(fringeRotation) + imaginary->Value(t, channelIndex) );
-		}
-	}
-	
-	ftData.Set(ftData.Polarisation(), newReal, newImaginary);
-}
diff --git a/CEP/DP3/AOFlagger/src/strategy/algorithms/highpassfilter.cpp b/CEP/DP3/AOFlagger/src/strategy/algorithms/highpassfilter.cpp
deleted file mode 100644
index 02a09ac93676dcc054481499dfdbce5bd136c29d..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/strategy/algorithms/highpassfilter.cpp
+++ /dev/null
@@ -1,253 +0,0 @@
-
-#include <xmmintrin.h>
-
-#include <AOFlagger/strategy/algorithms/highpassfilter.h>
-#include <AOFlagger/util/rng.h>
-#include <cmath>
-
-HighPassFilter::~HighPassFilter()
-{
-	delete[] _hKernel;
-	delete[] _vKernel;
-}
-
-void HighPassFilter::applyLowPass(const Image2DPtr &image)
-{
-	// Guassian convolution can be separated in two 1D convolution
-	// because of properties of the 2D Gaussian function.
-	Image2DPtr temp = Image2D::CreateZeroImagePtr(image->Width(), image->Height());
-	size_t hKernelMid = _hWindowSize/2;
-	for(size_t i=0; i<_hWindowSize; ++i) {
-		const num_t kernelValue = _hKernel[i];
-		const size_t
-			xStart = (i >= hKernelMid) ? 0 : (hKernelMid-i),
-			xEnd = (i <= hKernelMid) ? image->Width() : image->Width()-i+hKernelMid;
-		for(unsigned y=0;y<image->Height();++y) {
-			for(unsigned x=xStart;x<xEnd;++x)	
-				temp->AddValue(x, y, image->Value(x+i-hKernelMid, y)*kernelValue);
-		}
-	}
-	
-	image->SetAll(0.0);
-	size_t vKernelMid = _vWindowSize/2;
-	for(size_t i=0; i<_vWindowSize; ++i) {
-		const num_t kernelValue = _vKernel[i];
-		const size_t
-			yStart = (i >= vKernelMid) ? 0 : (vKernelMid-i),
-			yEnd = (i <= vKernelMid) ? image->Height() : image->Height()-i+vKernelMid;
-		for(unsigned y=yStart;y<yEnd;++y) {
-			for(unsigned x=0;x<image->Width();++x)
-				image->AddValue(x, y, temp->Value(x, y+i-vKernelMid)*kernelValue);
-		}
-	}
-}
-
-void HighPassFilter::applyLowPassSSE(const Image2DPtr &image)
-{
-	Image2DPtr temp = Image2D::CreateZeroImagePtr(image->Width(), image->Height());
-	unsigned hKernelMid = _hWindowSize/2;
-	for(unsigned i=0; i<_hWindowSize; ++i) {
-		
-		const num_t k = _hKernel[i];
-		const __m128 k4 = _mm_set_ps(k, k, k, k);
-		unsigned
-			/* xStart is the first column to start writing to. Note that it might be larger
-			 * than the width. */
-			xStart = (i >= hKernelMid) ? 0 : (hKernelMid-i),
-			xEnd = (i <= hKernelMid) ? image->Width() : (image->Width()+hKernelMid > i ? (image->Width()-i+hKernelMid) : 0);
-		
-		for(unsigned y=0;y<image->Height();++y) {
-			
-			float *tempPtr = temp->ValuePtr(xStart, y);
-			const float *imagePtr = image->ValuePtr(xStart+i-hKernelMid, y);
-			
-			unsigned x = xStart;
-			for(;x+4<xEnd;x+=4) {
-				const __m128
-					imageVal = _mm_loadu_ps(imagePtr),
-					tempVal = _mm_loadu_ps(tempPtr);
-
-				// *tempPtr += k * (*imagePtr);
-				_mm_storeu_ps(tempPtr, _mm_add_ps(tempVal, _mm_mul_ps(imageVal, k4)));
-				
-				tempPtr += 4;
-				imagePtr += 4;
-			}
-			for(;x<xEnd;++x) {
-				*tempPtr += k * (*imagePtr);
-				++tempPtr;
-				++imagePtr;
-			}
-		}
-	}
-	
-	image->SetAll(0.0);
-	unsigned vKernelMid = _vWindowSize/2;
-	for(unsigned i=0; i<_vWindowSize; ++i) {
-		const num_t k = _vKernel[i];
-		const __m128 k4 = _mm_set_ps(k, k, k, k);
-		const unsigned
-			yStart = (i >= vKernelMid) ? 0 : (vKernelMid-i),
-			yEnd = (i <= vKernelMid) ? image->Height() : ((image->Height()+vKernelMid>i) ? (image->Height()-i+vKernelMid) : 0);
-		for(unsigned y=yStart;y<yEnd;++y) {
-			
-			const float *tempPtr = temp->ValuePtr(0, y+i-vKernelMid);
-			float *imagePtr = image->ValuePtr(0, y);
-			
-			unsigned x=0;
-			for(;x+4<image->Width();x += 4) {
-				
-				const __m128
-					imageVal = _mm_load_ps(imagePtr),
-					tempVal = _mm_load_ps(tempPtr);
-				
-				// *imagePtr += k * (*tempPtr);
-				_mm_store_ps(imagePtr, _mm_add_ps(imageVal, _mm_mul_ps(tempVal, k4)));
-				
-				tempPtr += 4;
-				imagePtr += 4;
-			}
-			for(;x<image->Width();++x) {
-				*imagePtr += k * (*tempPtr);
-				++tempPtr;
-				++imagePtr;
-			}
-		}
-	}
-}
-
-Image2DPtr HighPassFilter::ApplyHighPass(const Image2DCPtr &image, const Mask2DCPtr &mask)
-{
-	Image2DPtr outputImage = ApplyLowPass(image, mask);
-	outputImage->SubtractAsRHS(image);
-	return outputImage;
-}
-
-Image2DPtr HighPassFilter::ApplyLowPass(const Image2DCPtr &image, const Mask2DCPtr &mask)
-{
-	initializeKernel();
-	Image2DPtr
-		outputImage = Image2D::CreateUnsetImagePtr(image->Width(), image->Height()),
-		weights = Image2D::CreateUnsetImagePtr(image->Width(), image->Height());
-	setFlaggedValuesToZeroAndMakeWeightsSSE(image, outputImage, mask, weights);
-	applyLowPassSSE(outputImage);
-	applyLowPassSSE(weights);
-	elementWiseDivideSSE(outputImage, weights);
-	weights.reset();
-	return outputImage;
-}
-
-void HighPassFilter::initializeKernel()
-{
-	if(_hKernel == 0)
-	{
-		_hKernel = new num_t[_hWindowSize];
-		const int midPointX = _hWindowSize/2;
-		for(int x = 0 ; x < (int) _hWindowSize ; ++x)
-			_hKernel[x] = RNG::EvaluateUnnormalizedGaussian(x-midPointX, _hKernelSigmaSq);
-	}
-	
-	if(_vKernel == 0)
-	{
-		_vKernel = new num_t[_vWindowSize];
-		const	int midPointY = _vWindowSize/2;
-		for(int y = 0 ; y < (int) _vWindowSize ; ++y)
-			_vKernel[y] = RNG::EvaluateUnnormalizedGaussian(y-midPointY, _vKernelSigmaSq);
-	}
-}
-
-void HighPassFilter::setFlaggedValuesToZeroAndMakeWeights(const Image2DCPtr &inputImage, const Image2DPtr &outputImage, const Mask2DCPtr &inputMask, const Image2DPtr &weightsOutput)
-{
-	const size_t width = inputImage->Width();
-	for(size_t y=0;y<inputImage->Height();++y)
-	{
-		for(size_t x=0;x<width;++x)
-		{
-			if(inputMask->Value(x, y) || !std::isfinite(inputImage->Value(x, y)))
-			{
-				outputImage->SetValue(x, y, 0.0);
-				weightsOutput->SetValue(x, y, 0.0);
-			} else {
-				outputImage->SetValue(x, y, inputImage->Value(x, y));
-				weightsOutput->SetValue(x, y, 1.0);
-			}
-		}
-	}
-}
-
-void HighPassFilter::setFlaggedValuesToZeroAndMakeWeightsSSE(const Image2DCPtr &inputImage, const Image2DPtr &outputImage, const Mask2DCPtr &inputMask, const Image2DPtr &weightsOutput)
-{
-	const size_t width = inputImage->Width();
-	const __m128i zero4i = _mm_set_epi32(0, 0, 0, 0);
-	const __m128 zero4 = _mm_set_ps(0.0, 0.0, 0.0, 0.0);
-	const __m128 one4 = _mm_set_ps(1.0, 1.0, 1.0, 1.0);
-	for(size_t y=0;y<inputImage->Height();++y)
-	{
-		const bool *rowPtr = inputMask->ValuePtr(0, y);
-		const float *inputPtr = inputImage->ValuePtr(0, y);
-		float *outputPtr = outputImage->ValuePtr(0, y);
-		float *weightsPtr = weightsOutput->ValuePtr(0, y);
-		const float *end = inputPtr + width;
-		while(inputPtr < end)
-		{
-			
-			// Assign each integer to one bool in the mask
-			// Convert false to 0xFFFFFFFF and true to 0
-			__m128 conditionMask = _mm_castsi128_ps(
-				_mm_cmpeq_epi32(_mm_set_epi32(rowPtr[3] || !std::isfinite(inputPtr[3]), rowPtr[2] || !std::isfinite(inputPtr[2]),
-																			rowPtr[1] || !std::isfinite(inputPtr[1]), rowPtr[0] || !std::isfinite(inputPtr[0])),
-												zero4i));
-			
-			_mm_store_ps(weightsPtr, _mm_or_ps(
-				_mm_and_ps(conditionMask, one4),
-				_mm_andnot_ps(conditionMask, zero4)
-			));
-			_mm_store_ps(outputPtr, _mm_or_ps(
-				_mm_and_ps(conditionMask, _mm_load_ps(inputPtr)),
-				_mm_andnot_ps(conditionMask, zero4)
-			));
-			
-			rowPtr += 4;
-			outputPtr += 4;
-			inputPtr += 4;
-			weightsPtr += 4;
-		}
-	}
-}
-
-void HighPassFilter::elementWiseDivide(const Image2DPtr &leftHand, const Image2DCPtr &rightHand)
-{
-	for(unsigned y=0;y<leftHand->Height();++y) {
-		for(unsigned x=0;x<leftHand->Width();++x) {
-			if(rightHand->Value(x, y) == 0.0)
-				leftHand->SetValue(x, y, 0.0);
-			else
-				leftHand->SetValue(x, y, leftHand->Value(x, y) / rightHand->Value(x, y));
-		}
-	}
-}
-
-void HighPassFilter::elementWiseDivideSSE(const Image2DPtr &leftHand, const Image2DCPtr &rightHand)
-{
-	const __m128 zero4 = _mm_set_ps(0.0, 0.0, 0.0, 0.0);
-	
-	for(unsigned y=0;y<leftHand->Height();++y) {
-		float *leftHandPtr = leftHand->ValuePtr(0, y);
-		const float *rightHandPtr = rightHand->ValuePtr(0, y);
-		float *end = leftHandPtr + leftHand->Width();
-		while(leftHandPtr < end)
-		{
-			__m128
-				l = _mm_load_ps(leftHandPtr),
-				r = _mm_load_ps(rightHandPtr);
-			__m128 conditionMask = _mm_cmpeq_ps(r, zero4);
-			_mm_store_ps(leftHandPtr, _mm_or_ps(
-				_mm_and_ps(conditionMask, zero4),
-				_mm_andnot_ps(conditionMask, _mm_div_ps(l, r))
-			));
-			leftHandPtr += 4;
-			rightHandPtr += 4;
-		}
-	}
-}
-
diff --git a/CEP/DP3/AOFlagger/src/strategy/algorithms/imagetile.cpp b/CEP/DP3/AOFlagger/src/strategy/algorithms/imagetile.cpp
deleted file mode 100644
index 2750d946849e619aca9a176c21916ecd0817af0a..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/strategy/algorithms/imagetile.cpp
+++ /dev/null
@@ -1,346 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <AOFlagger/strategy/algorithms/imagetile.h>
-
-#include <AOFlagger/msio/image2d.h>
-#include <AOFlagger/msio/fitsfile.h>
-#include <AOFlagger/msio/pngfile.h>
-
-#include <AOFlagger/util/rng.h>
-
-#include <AOFlagger/strategy/algorithms/thresholdmitigater.h>
-
-#include <iostream>
-#include <math.h>
-
-void ImageTile::InitializeData(unsigned channelCount, unsigned scanCount, unsigned channelOffset, unsigned scanOffset, const Image2D &image, int polynomialTimeOrder, int polynomialFequencyOrder) {
-	_channelCount = channelCount;
-	_scanCount = scanCount;
-	_channelOffset = channelOffset;
-	_scanOffset = scanOffset;
-	_image = &image;
-	_timeOrder = polynomialTimeOrder;
-	_freqOrder = polynomialFequencyOrder;
-	_useMPF = false;
-	_isWindowed = new bool*[_channelCount];
-	for(unsigned j=0;j<_channelCount;++j) {
-		_isWindowed[j] = new bool[_scanCount];
-		for(unsigned i=0;i<_scanCount;++i)	
-			_isWindowed[j][i] = false;
-	}
-	_baselineConsts = new long double[polynomialTimeOrder + polynomialFequencyOrder + 1];
-	for(int i = 0;i < polynomialTimeOrder + polynomialFequencyOrder + 1;++i)
-		_baselineConsts[i] = 1e-5;
-	_trigger = 5.0;
-}
-
-void ImageTile::WindowSquare(unsigned scanIndex, unsigned frequencyIndex)
-{
-	int sstart = scanIndex - 2;
-	int send = scanIndex + 2;
-	int fstart = frequencyIndex - 2;
-	int fend = frequencyIndex + 2;
-	if(sstart < 0) sstart = 0;
-	if(send >= (int) _scanCount) send = _scanCount-1;
-	if(fstart < 0) fstart = 0;
-	if(fend >= (int) _channelCount) fend = _channelCount-1;
-	for(int f = fstart; f <= fend; ++f) {
-		for(int s = sstart; s <= send; ++s) {
-			_isWindowed[f][s] = true;
-		}
-	}
-}
-
-void ImageTile::ConvolveWindows()
-{
-	bool **oldWindows = _isWindowed;
-
-	_isWindowed = new bool*[_channelCount];
-	for(unsigned j=0;j<_channelCount;++j) {
-		_isWindowed[j] = new bool[_scanCount];
-		for(unsigned i=0;i<_scanCount;++i)	
-			_isWindowed[j][i] = false;
-	}
-
-	for(size_t f=0;f<_channelCount;++f) {
-		for(size_t t=0;t<_scanCount;++t) {
-			if(oldWindows[f][t])
-				WindowSquare(t, f);
-		}
-	}
-
-	for(size_t f=0;f<_channelCount;++f) {
-		delete oldWindows[f];
-	}
-	delete oldWindows;
-}
-
-unsigned ImageTile::WindowCount() const {
-	unsigned count = 0;
-	for(unsigned channel=0; channel<_channelCount; ++channel) {
-		for(unsigned scan=0; scan<_scanCount; ++scan) {
-			if(_isWindowed[channel][scan]) count++;
-		}
-	}
-	return count;
-}
-
-void ImageTile::FitBackground()
-{
-
-	// Chose to use the Levenberg-Marquardt solver with scaling
-	const gsl_multifit_fdfsolver_type * T = gsl_multifit_fdfsolver_lmsder;
-
-	// Construct solver
-	gsl_multifit_fdfsolver *solver = gsl_multifit_fdfsolver_alloc (T, _channelCount * _scanCount, _timeOrder + _freqOrder + 1);
-	if(solver == 0) throw std::exception();
-
-	// Initialize function information structure
-	gsl_multifit_function_fdf functionInfo;
-
-	/*if(_useMPF) {
-		functionInfo.f = &BaselineFunctionMPF;
-		functionInfo.df = &BaselineDerivativeMPF;
-		functionInfo.fdf = &BaselineCombinedMPF;
-		// chose 256 bits precision for intermediate values in the evaluation of the function and its derivative
-		mpf_set_default_prec (256); 
-	} else {*/
-		functionInfo.f = &BaselineFunction;
-		functionInfo.df = &BaselineDerivative;
-		functionInfo.fdf = &BaselineCombined;
-	//}
-	functionInfo.n = _channelCount * _scanCount;
-	functionInfo.p = _timeOrder + _freqOrder + 1;
-	functionInfo.params = this;
-
-	// Initialize initial value of parameters
-	//gsl_vector x;
-	double x_init[_timeOrder + _freqOrder + 1];
-	for(int i = 0;i < _timeOrder + _freqOrder + 1;++i)
-		x_init[i] = _baselineConsts[i];
-	gsl_vector_view x_view = gsl_vector_view_array (x_init, _timeOrder + _freqOrder + 1);
-	
-	gsl_multifit_fdfsolver_set (solver, &functionInfo, &x_view.vector);
-
-	// Start iterating
-	int status, iter=0;
-	do {
-		iter++;
-		status = gsl_multifit_fdfsolver_iterate(solver);
-		//PrintState(iter, solver);
-
-		if (status && status != GSL_CONTINUE) {
-			// std::cout << "Error: status = " << gsl_strerror (status) << std::endl;
-			break;
-		}
-
-		status = gsl_multifit_test_delta(solver->dx, solver->x, 0, 0);
-	} while (status == GSL_CONTINUE && iter < 250);
-	
-	// Save coefficients
-	for(int i = 0;i<_freqOrder + _timeOrder + 1;++i)
-		this->_baselineConsts[i] = gsl_vector_get(solver->x, i);
-
-	//PrintState(iter, solver);
-
-	// Clean up
-	gsl_multifit_fdfsolver_free(solver);
-}
-
-void ImageTile::FirstWindowGuess(long double mean, long double variance)
-{
-	// Window everything higher than trigger * sigma
-	/*for(unsigned channel = 0;channel<_channelCount;++channel) {
-		for(unsigned scan = 0;scan<_scanCount;++scan) {
-			// Since we have no baseline yet, we just use the mean as a first guess
-			if(fabs(GetValueAt(channel, scan) - mean) > _trigger * variance && IsValueSet(channel, scan)) {
-				Window(channel, scan);
-			}
-		}
-	}
-	ConvolveWindows();*/
-	LineThreshold(false, mean, variance, true);
-
-	for(unsigned channel = 0;channel<_channelCount;++channel) {
-		for(unsigned scan = 0;scan<_scanCount;++scan) {
-			_isWindowed[channel][scan] = true;
-		}
-	}
-}
-
-/*
-long double ImageTile::EvaluateBaselineFunction(unsigned scan, unsigned channel) const 
-{
-	mpf_t term, tmpA, tmpB;
-	mpf_init(term);
-	mpf_init(tmpA);
-	mpf_init(tmpB);
-	mpf_set_d(term, _baselineConsts[0]);
-	for(int j=1;j <= _freqOrder;++j) {
-		// term += const[j] * pow(channel, j);
-		mpf_set_ui(tmpA, channel);
-		mpf_pow_ui(tmpA, tmpA, j);
-		mpf_set_d(tmpB, _baselineConsts[j]);
-		mpf_mul(tmpA, tmpA, tmpB);
-		mpf_add(term, term, tmpA);
-	}
-	for(int j=1;j <= _timeOrder;++j) {
-		// term += const[j] * pow(scan, j);
-		mpf_set_ui(tmpA, scan);
-		mpf_pow_ui(tmpA, tmpA, j);
-		mpf_set_d(tmpB, _baselineConsts[j + _freqOrder]);
-		mpf_mul(tmpA, tmpA, tmpB);
-		mpf_add(term, term, tmpA);
-	}
-	double result = mpf_get_d(term);
-	mpf_clear(term);
-	mpf_clear(tmpA);
-	mpf_clear(tmpB);
-	return result;
-}*/
-
-long double ImageTile::EvaluateBaselineFunction(unsigned, unsigned) const 
-{
-	return 0.0; // TODO
-}
-
-void ImageTile::AddBaseline(Image2D &dest, double sign)
-{
-	// Add or subtract baseline
-	for(unsigned channel = 0;channel<_channelCount;++channel) {
-		for(unsigned scan = 0;scan<_scanCount;++scan) {
-			long double val = dest.Value(scan+_scanOffset, channel+_channelOffset);
-			val += sign * EvaluateBaselineFunction(scan, channel);
-			SetValueAt(dest, channel, scan, val);
-		}
-	}
-}
-
-void ImageTile::SetWindows(long double variance, bool convolve) {
-	bool methodA = false;
-	bool methodB = false;
-	bool methodC = true;
-
-	// Unwindow everything
-	for(unsigned channel = 0;channel<_channelCount;++channel) {
-		for(unsigned scan = 0;scan<_scanCount;++scan)
-			_isWindowed[channel][scan] = false;
-	}
-
-	if(methodA) {
-		// Window everything higher than trigger * sigma
-		for(unsigned channel = 0;channel<_channelCount;++channel) {
-			for(unsigned scan = 0;scan<_scanCount;++scan) {
-				if(fabsl(GetValueAt(channel, scan) - EvaluateBaselineFunction(scan, channel)) > _trigger * variance) {
-					Window(scan, channel);
-				}
-			}
-		}
-	}
-	if(methodB) {
-		for(unsigned channel = 0;channel<_channelCount;++channel) {
-			for(unsigned scan = 0;scan<_scanCount;++scan) {
-				bool triggered =
-					TriggeredRaise(channel, scan, channel-1, scan-1, variance) ||
-					TriggeredRaise(channel, scan, channel-1, scan+1, variance) ||
-					TriggeredRaise(channel, scan, channel+1, scan-1, variance) ||
-					TriggeredRaise(channel, scan, channel+1, scan+1, variance);
-				if(triggered)
-					Window(scan, channel);
-			}
-		}
-	}
-	if(convolve)
-		ConvolveWindows();
-	if(methodC) {
-		LineThreshold(true, 0.0, variance, convolve);
-	}
-}
-
-void ImageTile::LineThreshold(bool evaluateBaseline, long double mean, long double variance, bool convolve)
-{
-	Image2DPtr input = Image2D::CreateEmptyImagePtr(_scanCount, _channelCount);
-	Mask2DPtr output = Mask2D::CreateSetMaskPtr<false>(_scanCount, _channelCount);
-	if(evaluateBaseline) {
-		for(unsigned channel = 0;channel<_channelCount;++channel)
-			for(unsigned scan = 0;scan<_scanCount;++scan)
-				input->SetValue(scan, channel, GetValueAt(channel, scan) - EvaluateBaselineFunction(scan, channel));
-	} else {
-		for(unsigned channel = 0;channel<_channelCount;++channel)
-			for(unsigned scan = 0;scan<_scanCount;++scan)
-				input->SetValue(scan, channel, GetValueAt(channel, scan) - mean);
-	}
-	ThresholdMitigater::SumThreshold(input, output, 1, _trigger * variance);
-	ThresholdMitigater::SumThreshold(input, output, 2, _trigger * variance * 1.6);
-	ThresholdMitigater::SumThreshold(input, output, 3, _trigger * variance * 2.2);
-	ThresholdMitigater::SumThreshold(input, output, 5, _trigger * variance * 3.0);
-	ThresholdMitigater::SumThreshold(input, output, 10, _trigger * variance * 5.0);
-	unsigned count = 0;
-	for(unsigned channel = 0;channel<_channelCount;++channel) {
-		for(unsigned scan = 0;scan<_scanCount;++scan) {
-			if(output->Value(scan, channel)) {
-				Window(scan, channel);
-				count++;
-			}
-		}
-	}
-	while(count*2 > _channelCount*_scanCount) {
-		size_t x = (size_t) (RNG::Uniform()*_scanCount);
-		size_t y = (size_t) (RNG::Uniform()*_channelCount);
-		if(_isWindowed[y][x]) {
-			count--;
-			_isWindowed[y][x]=false;
-		}
-	}
-	if(convolve)
-		ConvolveWindows();
-}
-
-bool ImageTile::TriggeredRaise(unsigned channelA, unsigned scanA, unsigned channelB, unsigned scanB, long double variance) const
-{
-	if(channelB >= _channelCount) return false;
-	if(scanB >= _scanCount) return false;
-	long double value = GetValueAt(channelA, scanA) - GetValueAt(channelB, scanB);
-	return value > _trigger * variance * 2.0;
-}
-
-void ImageTile::SaveBackgroundToPng(const std::string &filename) {
-	ColdHotMap coldHotMap;
-	PosLogMap logMap(coldHotMap);
-	PngFile file(filename, _scanCount, _channelCount);
-	file.BeginWrite();
-	file.Clear(0, 0, 0, 255);
-	long double norm = _image->GetMaxMinNormalizationFactor();
-	for(unsigned channel=0;channel < _channelCount; ++channel) {
-		for(unsigned scan=0;scan < _scanCount; ++scan) {
-			double val = norm * EvaluateBaselineFunction(scan, channel);
-			file.PlotDatapoint(scan, channel, logMap.ValueToColorR(val), logMap.ValueToColorG(val), logMap.ValueToColorB(val), logMap.ValueToColorA(val));
-		}
-	}
-	file.Close();
-}
-
-long double ImageTile::GetValueAt(unsigned frequencyIndex, unsigned scanIndex) const {
-	return _image->Value(_scanOffset + scanIndex, _channelOffset + frequencyIndex);
-}
-
-void ImageTile::SetValueAt(Image2D &dest, unsigned frequencyIndex, unsigned scanIndex, long double newValue) {
-	return dest.SetValue(_scanOffset + scanIndex, _channelOffset + frequencyIndex, newValue);
-}
diff --git a/CEP/DP3/AOFlagger/src/strategy/algorithms/localfitmethod.cpp b/CEP/DP3/AOFlagger/src/strategy/algorithms/localfitmethod.cpp
deleted file mode 100644
index 3bfbc091ceac2497288b89e43d92882b70ca86de..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/strategy/algorithms/localfitmethod.cpp
+++ /dev/null
@@ -1,328 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <AOFlagger/strategy/algorithms/localfitmethod.h>
-
-#include <AOFlagger/msio/image2d.h>
-#include <AOFlagger/msio/pngfile.h>
-
-#include <AOFlagger/util/rng.h>
-
-#include <AOFlagger/strategy/algorithms/thresholdtools.h>
-
-#include <cmath>
-#include <iostream>
-
-LocalFitMethod::LocalFitMethod() : _background(0), _weights(0)
-{
-}
-
-LocalFitMethod::~LocalFitMethod()
-{
-	if(_background!=0)
-		delete _background;
-	ClearWeights();
-}
-
-void LocalFitMethod::Initialize(const TimeFrequencyData &input)
-{
-	ClearWeights();
-	_original = input.GetSingleImage();
-	_background2D = Image2D::CreateZeroImagePtr(_original->Width(), _original->Height());
-	if(_background!=0)
-		delete _background;
-	_background = new TimeFrequencyData(input.PhaseRepresentation(), input.Polarisation(), _background2D);
-	_mask = input.GetSingleMask();
-	if(_hSquareSize * 2 > _original->Width())
-		_hSquareSize = _original->Width()/2;
-	if(_vSquareSize * 2 > _original->Height())
-		_vSquareSize = _original->Height()/2;
-	switch(_method) {
-		case None:
-		case Average:
-		case Median:
-		case Minimum:
-			break;
-		case GaussianWeightedAverage:
-		case FastGaussianWeightedAverage:
-			InitializeGaussianWeights();
-			break;
-	}
-}
-
-void LocalFitMethod::ClearWeights()
-{
-	if(_weights) {
-		for(unsigned y = 0 ; y < _vSquareSize*2+1 ; ++y)
-			delete[] _weights[y];
-		delete[] _weights;
-		_weights = 0;
-	}
-}
-
-void LocalFitMethod::InitializeGaussianWeights()
-{
-	_weights = new num_t*[_vSquareSize*2+1];
-	for(int y = 0 ; y < (int) (_vSquareSize*2+1) ; ++y) {
-		_weights[y] = new num_t[_hSquareSize*2+1];
-		for(int x = 0 ; x < (int) (_hSquareSize*2+1) ; ++x) {
-			_weights[y][x] = RNG::EvaluateGaussian2D(x-(int)_hSquareSize, y-(int)_vSquareSize, _hKernelSize, _vKernelSize);
-		}
-	}
-}
-
-unsigned LocalFitMethod::TaskCount()
-{
-	if(_method == FastGaussianWeightedAverage)
-		return 1;
-	else
-		return _original->Height();
-}
-
-void LocalFitMethod::PerformFit(unsigned taskNumber)
-{
-	if(_mask == 0)
-		throw BadUsageException("Mask has not been set!");
-	if(_method == FastGaussianWeightedAverage) {
-		CalculateWeightedAverageFast();
-	} else {
-		unsigned y = taskNumber;
-		for(unsigned x=0;x<_original->Width();++x)
-			_background2D->SetValue(x, y, CalculateBackgroundValue(x, y));
-	}
-}
-
-long double LocalFitMethod::CalculateBackgroundValue(unsigned x, unsigned y)
-{
-	ThreadLocal local;
-	local.image = this;
-	local.currentX = x;
-	local.currentY = y;
-
-	if(local.currentY >= _vSquareSize)
-		local.startY = local.currentY-_vSquareSize;
-	else
-		local.startY = 0;
-	local.endY = local.currentY + _vSquareSize;
-	if(local.endY >= _original->Height())
-		local.endY = _original->Height()-1;
-
-	if(local.currentX >= _hSquareSize)
-		local.startX = local.currentX - _hSquareSize;
-	else
-		local.startX = 0;
-	local.endX = local.currentX + _hSquareSize;
-		if(local.endX >= _original->Width())
-			local.endX = _original->Width()-1;
-	local.emptyWindows = 0;
-
-	switch(_method) {
-		case None:
-		case FastGaussianWeightedAverage:
-			return 0.0;
-		case Median:
-			return CalculateMedian(x, y, local);
-		case Minimum:
-			return CalculateMinimum(x, y, local);
-		case Average:
-			return CalculateAverage(x, y, local);
-		case GaussianWeightedAverage:
-			return CalculateWeightedAverage(x, y, local);
-		default:
-			throw ConfigurationException("The LocalFitMethod was not initialized before a fit was executed.");
-	}
-}
-
-long double LocalFitMethod::CalculateAverage(unsigned x, unsigned y, ThreadLocal &local)
-{
-	long double sum = 0.0;
-	unsigned long count = 0;
-	for(unsigned yi=local.startY;yi<=local.endY;++yi) {
-		for(unsigned xi=local.startX;xi<=local.endX;++xi) {
-			if(!_mask->Value(xi, yi) && std::isfinite(_original->Value(xi, yi))) {
-				sum += _original->Value(xi, yi);
-				++count;
-			}
-		}
-	}
-	if(count != 0)
-		return sum / (long double) count;
-	else
-		return _original->Value(x, y);
-}
-
-long double LocalFitMethod::CalculateMedian(unsigned x, unsigned y, ThreadLocal &local)
-{
-	//unsigned maxSize = (local.endY-local.startY)*(local.endX-local.startX);
-	std::vector<long double> orderList;
-	unsigned long count = 0;
-	for(unsigned yi=local.startY;yi<=local.endY;++yi) {
-		for(unsigned xi=local.startX;xi<=local.endX;++xi) {
-			if(!_mask->Value(xi, yi) && std::isfinite(_original->Value(xi, yi))) {
-				orderList.push_back(_original->Value(xi, yi));
-				++count;
-			}
-		}
-	}
-	if(count==0)
-	{
-		local.emptyWindows++;
-		return _original->Value(x, y);
-	}
-	else if(count%2==1) {
-	 	std::nth_element(orderList.begin(), orderList.begin()+count/2, orderList.end());
-		long double mOdd = orderList[count/2];
-		return mOdd;
-	} else {
-	 	std::nth_element(orderList.begin(), orderList.begin()+count/2, orderList.end());
-		long double mOdd = orderList[count/2];
-	 	std::nth_element(orderList.begin(), orderList.begin()+(count/2-1), orderList.end());
-		long double mEven = orderList[count/2-1];
-		return (mOdd + mEven)*0.5L;
-	}
-}
-
-long double LocalFitMethod::CalculateMinimum(unsigned x, unsigned y, ThreadLocal &local)
-{
-	long double minimum = 1e100;
-	unsigned long count = 0;
-	for(unsigned yi=local.startY;yi<=local.endY;++yi) {
-		for(unsigned xi=local.startX;xi<=local.endX;++xi) {
-			if(!_mask->Value(xi, yi) && std::isfinite(_original->Value(xi, yi)) && _original->Value(xi, yi) < minimum) {
-				minimum = _original->Value(xi, yi);
-				++count;
-			}
-		}
-	}
-	if(count==0)
-		return _original->Value(x, y);
-	else
-		return minimum;
-}
-
-long double LocalFitMethod::CalculateWeightedAverage(unsigned x, unsigned y, ThreadLocal &local)
-{
-	long double sum = 0.0;
-	long double totalWeight = 0.0;
-	for(unsigned j=local.startY;j<=local.endY;++j) {
-		for(unsigned i=local.startX;i<=local.endX;++i) {
-			if(!_mask->Value(i, j) && std::isfinite(_original->Value(i, j))) {
-				long double weight = _weights[j - y + _vSquareSize][i - x + _hSquareSize];
-				sum += _original->Value(i, j) * weight;
-				totalWeight += weight;
-			}
-		}
-	}
-	if(totalWeight != 0.0)
-		return sum / totalWeight;
-	else {
-		sum = 0.0;
-		totalWeight = 0.0;
-		for(unsigned j=local.startY;j<=local.endY;++j) {
-			for(unsigned i=local.startX;i<=local.endX;++i) {
-				if(std::isfinite(_original->Value(i, j))) {
-					long double weight = _weights[j - y + _vSquareSize][i - x + _hSquareSize];
-					sum += _original->Value(i, j) * weight;
-					totalWeight += weight;
-				}
-			}
-		}
-		if(totalWeight != 0.0)
-			return sum / totalWeight;
-		else {
-			sum = 0.0;
-			totalWeight = 0.0;
-			for(unsigned j=local.startY;j<=local.endY;++j) {
-				for(unsigned i=local.startX;i<=local.endX;++i) {
-					long double weight = _weights[j - y + _vSquareSize][i - x + _hSquareSize];
-					sum += _original->Value(i, j) * weight;
-					totalWeight += weight;
-				}
-			}
-			return sum / totalWeight;
-		}
-	} 
-}
-
-void LocalFitMethod::CalculateWeightedAverageFast()
-{
-	_background2D->SetValues(*_original);
-	ThresholdTools::SetFlaggedValuesToZero(_background2D, _mask);
-	PerformGaussianConvolution(_background2D);
-	Image2DPtr flagWeights = CreateFlagWeightsMatrix();
-	PerformGaussianConvolution(flagWeights);
-	ElementWiseDivide(_background2D, flagWeights);
-}
-
-void LocalFitMethod::ElementWiseDivide(Image2DPtr leftHand, Image2DCPtr rightHand)
-{
-	for(unsigned y=0;y<leftHand->Height();++y) {
-		for(unsigned x=0;x<leftHand->Width();++x) {
-			if(rightHand->Value(x, y) == 0.0)
-				leftHand->SetValue(x, y, 0.0);
-			else
-				leftHand->SetValue(x, y, leftHand->Value(x, y) / rightHand->Value(x, y));
-		}
-	}
-}
-
-Image2DPtr LocalFitMethod::CreateFlagWeightsMatrix()
-{
-	Image2DPtr image = Image2D::CreateUnsetImagePtr(_mask->Width(), _mask->Height());
-	for(unsigned y=0;y<image->Height();++y) {
-		for(unsigned x=0;x<image->Width();++x) {
-			if(!_mask->Value(x, y) && std::isfinite(_original->Value(x, y)))
-				image->SetValue(x, y, 1.0);
-			else
-				image->SetValue(x, y, 0.0);
-		}
-	}
-	return image;
-}
-
-void LocalFitMethod::PerformGaussianConvolution(Image2DPtr input)
-{
-	// Guassian convolution can be separated in two 1D convolution
-	// because of properties of the 2D Gaussian function.
-	Image2DPtr temp = Image2D::CreateZeroImagePtr(input->Width(), input->Height());
-	for(int i=-_hSquareSize;i<=(int) _hSquareSize;++i) {
-		num_t gaus = _weights[_vSquareSize][i+_hSquareSize];
-		for(unsigned y=0;y<input->Height();++y) {
-			unsigned xStart = i >= 0 ? 0 : -i;
-			unsigned xEnd = i <= 0 ? input->Width() :  input->Width()-i;
-			for(unsigned x=xStart;x<xEnd;++x)	{
-				if(std::isfinite(input->Value(x+i,y)))
-					temp->AddValue(x, y, input->Value(x+i,y)*gaus);
-			}
-		}
-	}
-
-	input->SetAll(0.0);
-	for(int j=-_vSquareSize;j<=(int) _vSquareSize;++j) {
-		num_t gaus = _weights[j+_vSquareSize][_hSquareSize];
-		unsigned yStart = j >= 0 ? 0 : -j;
-		unsigned yEnd = j <= 0 ? input->Height() :  input->Height()-j;
-		for(unsigned y=yStart;y<yEnd;++y)	{
-			for(unsigned x=0;x<input->Width();++x) {
-				if(std::isfinite(temp->Value(x,y+j)))
-					input->AddValue(x, y, temp->Value(x,y+j)*gaus);
-			}
-		}
-	}
-}
diff --git a/CEP/DP3/AOFlagger/src/strategy/algorithms/methoditerator.cpp b/CEP/DP3/AOFlagger/src/strategy/algorithms/methoditerator.cpp
deleted file mode 100644
index 82a88d4d7734ffa6e3d943856934cecb42328e98..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/strategy/algorithms/methoditerator.cpp
+++ /dev/null
@@ -1,390 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <AOFlagger/strategy/algorithms/methoditerator.h>
-
-#include <boost/thread/thread.hpp>
-#include <boost/thread/mutex.hpp>
-
-#include <deque>
-#include <iostream>
-
-#include <AOFlagger/msio/antennainfo.h>
-#include <AOFlagger/msio/image2d.h>
-#include <AOFlagger/msio/pngfile.h>
-
-#include <AOFlagger/util/plot.h>
-#include <AOFlagger/util/statwriter.h>
-#include <AOFlagger/util/stopwatch.h>
-
-#include <AOFlagger/strategy/algorithms/thresholdconfig.h>
-#include <AOFlagger/strategy/algorithms/thresholdtools.h>
-#include <AOFlagger/strategy/algorithms/surfacefitmethod.h>
-
-MethodIterator::MethodIterator() : _writeStats(true), _savePNGs(true), _thresholdConfig(0), _verbose(false), _bandInfo(0)
-{
-}
-
-
-MethodIterator::~MethodIterator()
-{
-}
-
-struct ExecuteFitFunc {
-	std::deque<unsigned> *_tasks;
-	boost::mutex *_mutex;
-	SurfaceFitMethod *_method;
-	ExecuteFitFunc(std::deque<unsigned> *tasks, boost::mutex *mutex, SurfaceFitMethod *method)
-		: _tasks(tasks), _mutex(mutex), _method(method)
-	{
-	}
-	void operator()() {
-		boost::mutex::scoped_lock lock(*_mutex);
-		while(!_tasks->empty()) {
-			unsigned task = _tasks->front();
-			_tasks->pop_front();
-			lock.unlock();
-			_method->PerformFit(task);
-			lock.lock();
-		}
-		lock.unlock();
-	}
-};
-
-void MethodIterator::ExecuteBackgroundFit(SurfaceFitMethod &method, unsigned threadCount)
-{
-	boost::mutex mutex;
-	std::deque<unsigned> tasks;
-	for(unsigned i=0;i<method.TaskCount();++i)
-		tasks.push_back(i);
-
-	boost::thread_group group;
-	for(unsigned i=0;i<threadCount;++i) {
-		ExecuteFitFunc threadFunc(&tasks, &mutex, &method);
-		group.create_thread(threadFunc);
-	}
-	group.join_all();
-} 
-
-void MethodIterator::IterateBackgroundFit(class SurfaceFitMethod &method, unsigned threadCount, const std::string &name, unsigned iterationCount)
-{
-	unsigned imageCount = 0;
-
-	if(_verbose)
-		std::cout << "Initializing background fitting method..." << std::endl;
-
-	_statWriter = 0;
-	if(_writeStats) {
-		std::stringstream statname;
-		statname << name << "-" << _input.ImageWidth() << "-stats";
-		_statWriter = new StatWriter(statname.str());
-	}
-
-	_mask = Mask2D::CreateSetMaskPtr<false>(_input.ImageWidth(), _input.ImageHeight());
-	_input.SetGlobalMask(_mask);
-	method.Initialize(_input);
-
-	if(_writeStats) {
-		_statWriter->NewMethod(name + "-iteration");
-		for(unsigned imageIndex=0;imageIndex < imageCount;++imageIndex) {
-			char c = (char) ((int) 'A' + imageIndex);
-	
-			_statWriter->NewMethod(name + c + "-mean");
-			_statWriter->NewMethod(name + c + "-variance");
-			_statWriter->NewMethod(name + c + "-wMean");
-			_statWriter->NewMethod(name + c + "-wVariance");
-			_statWriter->NewMethod(name + c + "-min");
-			_statWriter->NewMethod(name + c + "-max");
-			_statWriter->NewMethod(name + c + "-rfi-percentage");
-			_statWriter->NewMethod(name + c + "-rfi-overlap");
-			_statWriter->NewMethod(name + c + "-rfi-original");
-		}
-		_statWriter->SetValueInc(0.0);
-	}
-
-	if(_savePNGs) {
-		std::stringstream flagfn1;
-		flagfn1 << name << "-" << _input.ImageWidth() << "-flag-00-original.png";
-		SaveFlaggingToPng(_input.GetSingleImage(), _originalFlagging, flagfn1.str(), _bandInfo, true);
-		std::stringstream flagfn2;
-		flagfn2 << name << "-" << _input.ImageWidth() << "-flag-00-original-nf.png";
-		SaveFlaggingToPng(_input.GetSingleImage(), _originalFlagging, flagfn2.str(), _bandInfo, false);
-	}
-
-	long double sensitivityStart = 4.0L;
-	long double sensitivityStep = powl(sensitivityStart, 1.0L/iterationCount);
- 
-	long double sensitivity = sensitivityStart;
-	if(_verbose)
-		std::cout << "Performing initial threshold..." << std::endl;
-	if(_input.PhaseRepresentation() == TimeFrequencyData::ComplexRepresentation) {
-		_thresholdConfig->Execute(_input.GetRealPart(), _mask, false, sensitivity);
-		_thresholdConfig->Execute(_input.GetImaginaryPart(), _mask, true, sensitivity);
-	} else {
-			Image2DCPtr image = _input.GetSingleImage();
-			_thresholdConfig->Execute(image, _mask, false, sensitivity);
-	}
-	if(_writeStats) {
-		//OutputStatistics(*images[imageIndex], *_mask);	
-	}
-	if(_savePNGs) {
-		//char c = (char) ((int) 'A' + imageIndex);
-		//std::stringstream flagfn2;
-		//flagfn2 << name << c << "-" << images[0]->Width() << "-flag-00-threshold.png";
-		//SaveFlaggingToPng(*images[imageIndex], *_mask, flagfn2.str(), _bandInfo);
-	}
-
-	for(unsigned i=0;i<iterationCount;++i)
-	{
-		if(_verbose)
-			std::cout << "Performing iteration " << i << ": " << std::endl;
-
-		if(_verbose)
-			std::cout << "Fitting background.. " << std::flush;
-		Stopwatch fitTimer(true);
-		method.Initialize(_input);
-		ExecuteBackgroundFit(method, threadCount);
-		fitTimer.Pause();
-		if(_writeStats) {
-			_statWriter->SetValueInc(i+1);
-			OutputMethodDetails(method, fitTimer, *_statWriter);
-		}
-
-		const TimeFrequencyData &background = method.Background();
-		sensitivity /= sensitivityStep;
-
-		if(_input.PhaseRepresentation() == TimeFrequencyData::ComplexRepresentation) {
-			ExecuteThreshold(_input.GetRealPart(), background.GetRealPart(), 0, sensitivity);
-			ExecuteThreshold(_input.GetImaginaryPart(), background.GetImaginaryPart(), 1, sensitivity);
-		} else {
-			Image2DCPtr image = _input.GetSingleImage();
-			Image2DCPtr back = background.GetSingleImage();
-			ExecuteThreshold(image, back, 0, sensitivity);
-		}
-
-		if(_savePNGs) {
-			if(_verbose)
-				std::cout << "Saving " << std::flush;
-
-			if(_verbose)
-				std::cout << "back" << std::flush;
-			std::stringstream backfn;
-
-			Image2DCPtr backVisualization = background.GetSingleImage();
-			Image2DCPtr frontVisualization = _input.GetSingleImage();
-			Image2DCPtr diff = Image2D::CreateFromDiff(frontVisualization, backVisualization);
-
-			backfn << name << "-" << _input.ImageWidth() << "-background-" << ((i+1)/10) << ((i+1)%10) << ".png";
-			SaveFlaggingToPng(backVisualization, _mask, backfn.str(), _bandInfo, false, true, false);
-
-			if(_verbose)
-				std::cout << ",diff" << std::flush;
-			std::stringstream difffn;
-			difffn << name << "-" << _input.ImageWidth()<< "-diff-" << ((i+1)/10) << ((i+1)%10) << ".png";
-			SaveFlaggingToPng(diff, _mask, difffn.str(), _bandInfo, false);
-
-			if(_verbose)
-				std::cout << ",flag" << std::flush;
-			std::stringstream flagfn;
-			flagfn << name << "-" << _input.ImageWidth()<< "-flag-" << ((i+1)/10) << ((i+1)%10) << ".png";
-			SaveFlaggingToPng(frontVisualization, _mask, flagfn.str(), _bandInfo);
-
-			if(_verbose)
-				std::cout << std::endl;
-		}
-	}
-
-	if(_writeStats) delete _statWriter;
-}
-
-void MethodIterator::ExecuteThreshold(Image2DCPtr image, Image2DCPtr background, int imageIndex, long double sensitivity)
-{
-	if(image->ContainsOnlyZeros()) {
-		if(_verbose)
-			std::cout << "Skipping image because it contains only zeros." << std::endl;
-	} else {
-		char imageChar = 'A' + imageIndex;
-		if(_verbose)
-			std::cout << "Subtracting " << imageChar << ".. " << std::flush;
-		Image2DPtr diff = Image2D::CreateFromDiff(image, background);
-
-		if(_verbose)
-			std::cout << "Thresholding " << imageChar << ".. " << std::flush;
-
-		_thresholdConfig->Execute(diff, _mask, imageIndex!=0, sensitivity);
-		if(_verbose)
-			std::cout << "(" << 100.0L*_mask->GetCount<true>()/(_mask->Width()*_mask->Height()) << "%) " << std::flush;
-
-		if(_writeStats)
-			OutputStatistics(diff, _mask);
-	}
-}
-
-void MethodIterator::OutputMethodDetails(const SurfaceFitMethod &, const Stopwatch &watch, StatWriter &)
-{
-	std::cout
-		<< "Creating background in this iteration took: " << watch.ToString() 
-		<< std::endl;
-}
-
-void MethodIterator::OutputStatistics(Image2DCPtr image, Mask2DCPtr mask)
-{
-	num_t mean, stdDev, wMean, wStdDev;
-	ThresholdTools::MeanAndStdDev(image, mask, mean, stdDev);
-	ThresholdTools::WinsorizedMeanAndStdDev(image, mask, wMean, wStdDev);
-	unsigned long flagCount = mask->GetCount<true>();
-	unsigned long orFlagCount = _originalFlagging->GetCount<true>();
-
-	_statWriter->SetValueInc(mean);
-	_statWriter->SetValueInc(stdDev);
-	_statWriter->SetValueInc(wMean);
-	_statWriter->SetValueInc(wStdDev);
-	_statWriter->SetValueInc(ThresholdTools::MinValue(image, mask));
-	_statWriter->SetValueInc(ThresholdTools::MaxValue(image, mask));
-	_statWriter->SetValueInc((num_t) flagCount * 100.0 / (mask->Width()*mask->Height()), 2);
-	_statWriter->SetValueInc((num_t) GetMaskOverlap(mask, _originalFlagging) * 100.0 / (mask->Width()*mask->Height()), 2);
-	_statWriter->SetValueInc((num_t) orFlagCount * 100.0 / (mask->Width()*mask->Height()), 2);
-}
-
-void MethodIterator::SaveFlaggingToPng(Image2DCPtr image, Mask2DCPtr mask, const std::string &filename, const BandInfo *bandInfo, bool showFlagging)
-{
-	SaveFlaggingToPng(image, mask, filename, bandInfo, showFlagging, !showFlagging, !showFlagging);
-}
-
-void MethodIterator::SaveFlaggingToPng(Image2DCPtr image, Mask2DCPtr mask, const std::string &filename, const BandInfo *bandInfo, bool showFlagging, bool winsorizedStretch, bool useColor)
-{
-	PngFile file(filename, image->Width(), image->Height());
-	file.BeginWrite();
-	file.Clear(0, 0, 0, 255);
-
-	num_t max, min;
-	ColorMap *map1;
-
-	if(winsorizedStretch) {
-		num_t mean, stddev, genMax, genMin;
-		if(showFlagging) {
-			ThresholdTools::WinsorizedMeanAndStdDev(image, mask, mean, stddev);
-			genMax = ThresholdTools::MaxValue(image, mask);
-			genMin = ThresholdTools::MinValue(image, mask);
-		} else {
-			Mask2DPtr empty = Mask2D::CreateSetMaskPtr<false>(image->Width(), image->Height());
-			ThresholdTools::WinsorizedMeanAndStdDev(image, empty, mean, stddev);
-			genMax = image->GetMaximum();
-			genMin = image->GetMinimum();
-		}
-		max = mean + stddev*3.0;
-		min = mean - stddev*3.0;
-		if(genMin > min) min = genMin;
-		if(genMax < max) max = genMax;
-	} else {
-		max = ThresholdTools::MaxValue(image, mask);
-		min = ThresholdTools::MinValue(image, mask);
-	}
-	if(useColor) {
-		map1 = new ColdHotMap();
-	} else {
-		map1 = new MonochromeMap();
-	}
-	Plot plot(filename + ".pdf");
-	plot.SetTitle("");
-	plot.SetXRange(0, image->Width()-1);
-	if(bandInfo != 0) {
-		plot.SetYRange(bandInfo->channels[0].frequencyHz / 1000000.0L,
-									bandInfo->channels[image->Height()-1].frequencyHz / 1000000.0L);
-	}
-	plot.SetXAxisText("Time (x10s)");
-	plot.SetYAxisText("Frequency (MHz)");
-	plot.SetZAxisText("Flux (Jy)");
-	if(min != max) {
-		plot.SetZRange(min, max);
-		plot.SetCBRange(min, max);
-	}
-	plot.StartGrid("");
-	for(unsigned y=0;y < image->Height(); ++y) {
-		num_t freq;
-		if(bandInfo != 0) {
-			freq = bandInfo->channels[y].frequencyHz / 1000000.0L;
-		} else {
-			freq=y;
-		}
-		for(unsigned x=0;x < image->Width(); ++x) {
-			if(mask->Value(x, y) == 0.0 || !showFlagging) {
-				num_t val = image->Value(x, y);
-				if(val > max) val = max;
-				else if(val < min) val = min;
-				plot.PushDataPoint(x, freq, val);
-
-				val = (image->Value(x, y) - min) * 2.0 / (max - min) - 1.0;
-				if(val < -1.0) val = -1.0;
-				else if(val > 1.0) val = 1.0;
-				file.PlotPixel(x, y, map1->ValueToColorR(val), map1->ValueToColorG(val), map1->ValueToColorB(val), map1->ValueToColorA(val));
-			} else {
-				file.PlotPixel(x, y, 255, 0, 255, 255);
-				plot.PushUnknownDataPoint(x, freq);
-			}
-		}
-		plot.PushDataBlockEnd();
-	}
-
-	if(showFlagging) {
-		for(unsigned y=0;y < image->Height(); ++y) {
-			num_t freq, freqdist;
-			if(bandInfo != 0) {
-				freq = bandInfo->channels[y].frequencyHz / 1000000.0L;
-				freqdist = (bandInfo->channels[1].frequencyHz - bandInfo->channels[0].frequencyHz) / 1000000.0L;
-			} else {
-				freq = y;
-				freqdist = 1;
-			}
-			unsigned x=0;
-			unsigned lastX = 0;
-			while(x < image->Width()) {
-				if(mask->Value(x, y) == 0)
-				{
-					if(lastX < x)
-						plot.AddRectangle(lastX, -freqdist/2.0L + freq, x, freq+freqdist/2.0L);
-					lastX = x+1;
-				}
-				else if(lastX >= x) lastX = x;
-				++x;
-			}
-			if(lastX < x)
-				plot.AddRectangle(lastX, -freqdist/2.0L + freq, x, freq+freqdist/2.0L);
-		}
-	}
-
-	file.Close();
-
-	delete map1;
-}
-
-unsigned MethodIterator::GetMaskOverlap(Mask2DCPtr mask1, Mask2DCPtr mask2)
-{
-	unsigned count = 0;
-	for(unsigned y=0;y<mask1->Height();++y) {
-		for(unsigned x=0;x<mask1->Width();++x) {
-			bool m1 = mask1->Value(x, y) != 0.0;
-			bool m2 = mask2->Value(x, y) != 0.0;
-			if(m1 && m2) {
-				count++;
-			}
-		}
-	}
-	return count;
-}
diff --git a/CEP/DP3/AOFlagger/src/strategy/algorithms/mitigationtester.cpp b/CEP/DP3/AOFlagger/src/strategy/algorithms/mitigationtester.cpp
deleted file mode 100644
index 9aa8604c34ccf8898bb08c8f12638602ac6edcd2..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/strategy/algorithms/mitigationtester.cpp
+++ /dev/null
@@ -1,644 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <AOFlagger/strategy/algorithms/mitigationtester.h>
-
-#include <iostream>
-#include <sstream>
-
-#include <math.h>
-
-#include <AOFlagger/msio/image2d.h>
-#include <AOFlagger/msio/pngfile.h>
-
-#include <AOFlagger/util/aologger.h>
-#include <AOFlagger/util/ffttools.h>
-#include <AOFlagger/util/statwriter.h>
-#include <AOFlagger/util/stopwatch.h>
-
-#include <AOFlagger/imaging/model.h>
-#include <AOFlagger/imaging/observatorium.h>
-
-#include <AOFlagger/types.h>
-
-#include <AOFlagger/strategy/algorithms/localfitmethod.h>
-#include <AOFlagger/strategy/algorithms/thresholdmitigater.h>
-
-MitigationTester::MitigationTester() : _real(), _imaginary()
-{
-}
-
-
-MitigationTester::~MitigationTester()
-{
-	Clear();
-}
-
-void MitigationTester::Clear()
-{
-	_real.reset();
-	_imaginary.reset();
-}
-
-void MitigationTester::GenerateNoise(size_t scanCount, size_t frequencyCount, bool independentComplex, double sigma, enum NoiseType noiseType)
-{
-	Clear();
-
-	_real = Image2D::CreateUnsetImagePtr(scanCount, frequencyCount);
-	_imaginary = Image2D::CreateUnsetImagePtr(scanCount, frequencyCount);
-
-	if(independentComplex) {
-		for(size_t f=0; f<frequencyCount;++f) {
-			for(size_t t=0; t<scanCount;++t) {
-				_real->SetValue(t, f, Rand(noiseType)*sigma);
-				_imaginary->SetValue(t, f, Rand(noiseType)*sigma);
-			}
-		}
-	} else {
-		for(size_t f=0; f<frequencyCount;++f) {
-			for(size_t t=0; t<scanCount;++t) {
-				double r = Rand(noiseType)*sigma;
-				_real->SetValue(t, f, r);
-				_imaginary->SetValue(t, f, r);
-			}
-		}
-	}
-}
-
-void MitigationTester::AddBroadbandLine(Image2DPtr data, Mask2DPtr rfi, double lineStrength, size_t startTime, size_t duration, double frequencyRatio, double frequencyOffsetRatio)
-{
-	size_t frequencyCount = data->Height();
-	unsigned fStart = (size_t) (frequencyOffsetRatio * frequencyCount);
-	unsigned fEnd = (size_t) ((frequencyOffsetRatio + frequencyRatio) * frequencyCount);
-	AddBroadbandLinePos(data, rfi, lineStrength, startTime, duration, fStart, fEnd, UniformShape);
-}
-
-void MitigationTester::AddBroadbandLinePos(Image2DPtr data, Mask2DPtr rfi, double lineStrength, size_t startTime, size_t duration, unsigned frequencyStart, double frequencyEnd, enum BroadbandShape shape)
-{
-	const double s = (frequencyEnd-frequencyStart);
-	for(size_t f=frequencyStart;f<frequencyEnd;++f) {	
-		// x will run from -1 to 1
-		const double x = (double) ((f-frequencyStart)*2)/s-1.0;
-		double factor = shapeLevel(shape, x);
-		for(size_t t=startTime;t<startTime+duration;++t) {
-			data->AddValue(t, f, lineStrength * factor);
-			if(lineStrength > 0.0)
-				rfi->SetValue(t, f, true);
-		}
-	}
-}
-
-void MitigationTester::AddSlewedBroadbandLinePos(Image2DPtr data, Mask2DPtr rfi, double lineStrength, double slewrate, size_t startTime, size_t duration, unsigned frequencyStart, double frequencyEnd, enum BroadbandShape shape)
-{
-	const double s = (frequencyEnd-frequencyStart);
-	for(size_t f=frequencyStart;f<frequencyEnd;++f) {	
-			// x will run from -1 to 1
-		const double x = (double) ((f-frequencyStart)*2)/s-1.0;
-		double factor = shapeLevel(shape, x);
-		double slew = slewrate * (double) f;
-		size_t slewInt = (size_t) slew;
-		double slewRest = slew - slewInt;
-		
-		data->AddValue(startTime+slewInt, f, lineStrength * factor * (1.0 - slewRest));
-		if(lineStrength > 0.0)
-			rfi->SetValue(startTime+slewInt, f, true);
-		for(size_t t=startTime+1;t<startTime+duration;++t) {
-			data->AddValue(t+slewInt, f, lineStrength * factor);
-			if(lineStrength > 0.0)
-				rfi->SetValue(t+slewInt, f, true);
-		}
-		data->AddValue(startTime+duration+slewInt, f, lineStrength * factor * slewRest);
-		if(lineStrength > 0.0)
-			rfi->SetValue(startTime+duration+slewInt, f, true);
-	}
-}
-
-void MitigationTester::AddRfiPos(Image2DPtr data, Mask2DPtr rfi, double lineStrength, size_t startTime, size_t duration, unsigned frequencyPos)
-{
-	for(size_t t=startTime;t<startTime+duration;++t) {
-		data->AddValue(t, frequencyPos, lineStrength);
-		if(lineStrength > 0)
-			rfi->SetValue(t, frequencyPos, true);
-	}
-}
-
-void MitigationTester::AddRFI(size_t &rfiCount)
-{
-	size_t scanCount = _real->Width();
-	size_t frequencyCount = _real->Height();
-	// Continuous wideband lines
-	size_t t1 = scanCount / 4;
-	size_t t2 = scanCount / 2;
-	double line1Strength = 1.5;
-	double line2Strength = 2.0;
-	for(size_t f=0;f<frequencyCount/2;++f) {
-		size_t f1 = f+frequencyCount/4;
-		size_t f2 = f+frequencyCount/3;
-		// Fat line
-		_real->AddValue(t1-1, f1, line1Strength);
-		_imaginary->AddValue(t1-1, f1, line1Strength);
-		_real->AddValue(t1, f1, line1Strength);
-		_imaginary->AddValue(t1, f1, line1Strength);
-		_real->AddValue(t1+1, f1, line1Strength);
-		_imaginary->AddValue(t1+1, f1, line1Strength);
-		// Thin line
-		_real->AddValue(t2, f2, line2Strength);
-		_imaginary->AddValue(t2, f2, line2Strength);
-	}
-
-	// Make 10 exceptional high rfi-dots of spectral width "3" x time "2"
-	for(size_t i=0;i<10;++i) {
-		double pointStrength = 3.0 + 12.0 * RNG::Uniform();
-		size_t
-			x = (size_t) (RNG::Uniform()*scanCount),
-			y = (size_t) (RNG::Uniform()*(frequencyCount-2));
-		_real->AddValue(x, y, pointStrength);
-		_imaginary->AddValue(x, y, pointStrength);
-		_real->AddValue(x, y+1, pointStrength);
-		_imaginary->AddValue(x, y+1, pointStrength);
-		_real->AddValue(x, y+2, pointStrength);
-		_imaginary->AddValue(x, y+2, pointStrength);
-		_real->AddValue(x+1, y, pointStrength);
-		_imaginary->AddValue(x+1, y, pointStrength);
-		_real->AddValue(x+1, y+1, pointStrength);
-		_imaginary->AddValue(x+1, y+1, pointStrength);
-		_real->AddValue(x+1, y+2, pointStrength);
-		_imaginary->AddValue(x+1, y+2, pointStrength);
-	}
-
-	rfiCount = (frequencyCount/2)*4 + 6*10;
-}
-
-void MitigationTester::SetZero()
-{
-	for(size_t y=0;y<_real->Height();++y) {
-		for(size_t x=0;x<_real->Width();++x) {
-			_real->SetValue(x, y, 0.0);
-			_imaginary->SetValue(x, y, 0.0);
-		}
-	}
-}
-
-void MitigationTester::CountResults(Mask2DCPtr thresholdedMask, Mask2DCPtr originalRFI, size_t &correct, size_t &notfound, size_t &error)
-{
-	correct = 0;
-	notfound = 0;
-	error = 0;
-	for(size_t y=0;y<thresholdedMask->Height();++y) {
-		for(size_t x=0;x<thresholdedMask->Width();++x) {
-			bool rfiTresholded = thresholdedMask->Value(x, y);
-			bool rfiOriginal = originalRFI->Value(x, y);
-			if(rfiTresholded && rfiOriginal) {
-				correct++;
-			} else if(!rfiTresholded && rfiOriginal) {
-				notfound++;
-			} else if(rfiTresholded && !rfiOriginal) {
-				error++;
-			}
-		}
-	}
-}
-
-void MitigationTester::CountCorrectRFI(Image2DCPtr tresholdedReal, Image2DCPtr tresholdedImaginary, size_t &correct, size_t &notfound, size_t &error)
-{
-	correct = 0;
-	notfound = 0;
-	error = 0;
-	for(size_t y=0;y<tresholdedReal->Height();++y) {
-		for(size_t x=0;x<tresholdedReal->Width();++x) {
-			bool rfiTresholded = tresholdedReal->Value(x, y) != 0.0;
-			bool rfiOriginal = _real->Value(x, y) != 0.0;
-			if(rfiTresholded && rfiOriginal) {
-				correct++;
-			} else if(!rfiTresholded && rfiOriginal) {
-				notfound++;
-			} else if(rfiTresholded && !rfiOriginal) {
-				error++;
-			}
-			rfiTresholded = tresholdedImaginary->Value(x, y) != 0.0;
-			rfiOriginal = _imaginary->Value(x, y) != 0.0;
-			if(rfiTresholded && rfiOriginal) {
-				correct++;
-			} else if(!rfiTresholded && rfiOriginal) {
-				notfound++;
-			} else if(rfiTresholded && !rfiOriginal) {
-				error++;
-			}
-		}
-	}
-}
-
-Image2D *MitigationTester::CreateRayleighData(unsigned width, unsigned height)
-{
-	Image2D *image = Image2D::CreateUnsetImage(width, height);
-	for(unsigned y=0;y<height;++y) {
-		for(unsigned x=0;x<width;++x) {
-			image->SetValue(x, y, RNG::Rayleigh());
-		}
-	}
-	return image; 
-}
-
-Image2D *MitigationTester::CreateGaussianData(unsigned width, unsigned height)
-{
-	Image2D *image = Image2D::CreateUnsetImage(width, height);
-	for(unsigned y=0;y<height;++y) {
-		for(unsigned x=0;x<width;++x) {
-			image->SetValue(x, y, RNG::Gaussian());
-		}
-	}
-	return image; 
-}
-
-std::string MitigationTester::GetTestSetDescription(int number)
-{
-	switch(number)
-	{
-		case 0: return "Image of all zero's";
-		case 1: return "Image of all ones";
-		case 2: return "Noise";
-		case 3: return "Several broadband RFI contaminating all channels";
-		case 4: return "Several broadband RFI contaminating a part of channels";
-		case 5: return "Several broadband RFI contaminating a random part of channels";
-		case 6: return "Several broadband RFI on a sine wave background";
-		case 7: return "Several broadband lines on a background of rotating sine waves";
-		case 8: return "Testset 7 with a background fit on the background";
-		case 9: return "Testset 7 in the time-lag domain";
-		case 10: return "Identity matrix";
-		case 11: return "FFT of Identity matrix";
-		case 12: return "Broadband RFI contaminating all channels";
-		case 13: return "Model of three point sources with broadband RFI";
-		case 14: return "Model of five point sources with broadband RFI";
-		case 15: return "Model of five point sources with partial broadband RFI";
-		case 16: return "Model of five point sources with random broadband RFI";
-		case 17: return "Background-fitted model of five point sources with random broadband RFI";
-		case 18: return "Model of three point sources with random RFI"; 
-		case 19: return "Model of three point sources with noise";
-		case 20: return "Model of five point sources with noise";
-		case 21: return "Model of three point sources";
-		case 22: return "Model of five point sources";
-		case 26: return "Gaussian lines";
-		default: return "?";
-	}
-}
-
-Image2DPtr MitigationTester::CreateTestSet(int number, Mask2DPtr rfi, unsigned width, unsigned height, int gaussianNoise)
-{
-	Image2DPtr image;
-	switch(number)
-	{
-		case 0: // Image of all zero's
-		return Image2D::CreateZeroImagePtr(width, height);
-		case 1: // Image of all ones
-		image = Image2D::CreateUnsetImagePtr(width, height);
-		image->SetAll(1.0);
-		break;
-		case 2: // Noise
-		return Image2DPtr(CreateNoise(width, height, gaussianNoise));
-		case 3: { // Several broadband lines
-		image = Image2DPtr(CreateNoise(width, height, gaussianNoise));
-		AddBroadbandToTestSet(image, rfi, 1.0);
-		} break;
-		case 4: { // Several broadband lines
-		image = Image2DPtr(CreateNoise(width, height, gaussianNoise));
-		AddBroadbandToTestSet(image, rfi, 0.5);
-		} break;
-		case 5: { // Several broadband lines of random length
-		image = Image2DPtr(CreateNoise(width, height, gaussianNoise));
-		AddVarBroadbandToTestSet(image, rfi);
-		} break;
-		case 6: { // Different broadband lines + low freq background
-		image = Image2DPtr(CreateNoise(width, height, gaussianNoise));
-		AddVarBroadbandToTestSet(image, rfi);
-		for(unsigned y=0;y<image->Height();++y) {
-			for(unsigned x=0;x<image->Width();++x) {
-				image->AddValue(x, y, sinn((long double) x*M_PIn*5.0 / image->Width()) + 0.1);
-			}
-		}
-		} break;
-		case 7: { // Different broadband lines + high freq background 
-		image = Image2DPtr(CreateNoise(width, height, gaussianNoise));
-		for(unsigned y=0;y<image->Height();++y) {
-			for(unsigned x=0;x<image->Width();++x) {
-				image->AddValue(x, y, sinn((long double) (x+y*0.1)*M_PIn*5.0L / image->Width() + 0.1));
-				image->AddValue(x, y, sinn((long double) (x+pown(y, 1.1))*M_PIn*50.0L / image->Width() + 0.1));
-			}
-		}
-		AddVarBroadbandToTestSet(image, rfi);
-		for(unsigned y=0;y<image->Height();++y) {
-			for(unsigned x=0;x<image->Width();++x) {
-				image->AddValue(x, y, 1.0); 
-			}
-		}
-		} break;
-		case 8: {  // Different droadband lines + smoothed&subtracted high freq background
-		image = Image2DPtr(CreateNoise(width, height, gaussianNoise));
-		for(unsigned y=0;y<image->Height();++y) {
-			for(unsigned x=0;x<image->Width();++x) {
-				image->AddValue(x, y, sinn((num_t) (x+y*0.1)*M_PIn*5.0 / image->Width() + 0.1));
-				image->AddValue(x, y, sinn((num_t) (x+pown(y, 1.1))*M_PIn*50.0 / image->Width() + 0.1));
-			}
-		}
-		SubtractBackground(image);
-		AddVarBroadbandToTestSet(image, rfi);
-		} break;
-		case 9: { //FFT of 7
-		image=CreateTestSet(7, rfi, width, height);
-		//FFTTools::Sqrt(*image);
-		Image2D *copy = Image2D::CreateCopy(*image);
-		FFTTools::CreateHorizontalFFTImage(*image, *copy, false);
-		delete copy;
-		for(unsigned y=0;y<rfi->Height();++y) {
-			for(unsigned x=0;x<rfi->Width();++x) {
-				image->SetValue(x, y, image->Value(x, y) / sqrtn(image->Width()));
-			}
-		}
-		} break;
-		case 10: { // Identity matrix
-		image=Image2D::CreateZeroImagePtr(width, height);
-		unsigned min = width < height ? width : height;
-		for(unsigned i=0;i<min;++i) {
-			image->SetValue(i, i, 1.0);
-			rfi->SetValue(i, i, true);
-		}
-		} break;
-		case 11: { // FFT of identity matrix
-		image=CreateTestSet(10, rfi, width, height);
-		Image2D *copy = Image2D::CreateCopy(*image);
-		FFTTools::CreateHorizontalFFTImage(*image, *copy, false);
-		delete copy;
-		for(unsigned y=0;y<rfi->Height();++y) {
-			for(unsigned x=0;x<rfi->Width();++x) {
-				image->SetValue(x, y, image->Value(x, y) / sqrtn(width)); 
-			}
-		}
-		} break;
-		case 12: { // Broadband contaminating all channels
-		image = Image2DPtr(CreateNoise(width, height, gaussianNoise));
-		for(unsigned y=0;y<image->Height();++y) {
-			for(unsigned x=0;x<image->Width();++x) {
-				image->AddValue(x, y, sinn((num_t) (x+y*0.1)*M_PIn*5.0 / image->Width() + 0.1));
-				image->AddValue(x, y, sinn((num_t) (x+powl(y, 1.1))*M_PIn*50.0 / image->Width() + 0.1));
-			}
-		}
-		AddBroadbandToTestSet(image, rfi, 1.0);
-		} break;
-		case 13: { // Model of three point sources with broadband RFI
-		image = Image2DPtr(CreateNoise(width, height, gaussianNoise));
-		AddModelData(image, 3);
-		AddBroadbandToTestSet(image, rfi, 1.0L);
-		} break;
-		case 14: { // Model of five point sources with broadband RFI
-		image = Image2DPtr(CreateNoise(width, height, gaussianNoise));
-		AddModelData(image, 5);
-		AddBroadbandToTestSet(image, rfi, 1.0L);
-		} break;
-		case 15: { // Model of five point sources with partial broadband RFI
-		image = Image2DPtr(CreateNoise(width, height, gaussianNoise));
-		AddModelData(image, 5);
-		AddBroadbandToTestSet(image, rfi, 0.5L);
-		} break;
-		case 16: { // Model of five point sources with random broadband RFI
-		image = Image2DPtr(CreateNoise(width, height, gaussianNoise));
-		AddModelData(image, 5);
-		AddVarBroadbandToTestSet(image, rfi);
-		} break;
-		case 17: { // Background-fitted model of five point sources with random broadband RFI
-		image = Image2DPtr(CreateNoise(width, height, gaussianNoise));
-		AddModelData(image, 5);
-		SubtractBackground(image);
-		AddVarBroadbandToTestSet(image, rfi);
-		} break;
-		case 18: { // Model of three point sources with random RFI
-		image = Image2DPtr(CreateNoise(width, height, gaussianNoise));
-		AddModelData(image, 3);
-		AddVarBroadbandToTestSet(image, rfi);
-		} break;
-		case 19: { // Model of three point sources with noise
-		image = Image2DPtr(CreateNoise(width, height, gaussianNoise));
-		AddModelData(image, 3);
-		} break;
-		case 20: { // Model of five point sources with noise
-		image = Image2DPtr(CreateNoise(width, height, gaussianNoise));
-		AddModelData(image, 5);
-		} break;
-		case 21: { // Model of three point sources
-		image = Image2D::CreateZeroImagePtr(width, height);
-		AddModelData(image, 3);
-		} break;
-		case 22: { // Model of five point sources
-		image = Image2D::CreateZeroImagePtr(width, height);
-		AddModelData(image, 5);
-		} break;
-		case 23:
-			image = Image2DPtr(CreateNoise(width, height, gaussianNoise));
-			AddBroadbandToTestSet(image, rfi, 0.5, 0.1, true);
-		break;
-		case 24:
-			image = Image2DPtr(CreateNoise(width, height, gaussianNoise));
-			AddBroadbandToTestSet(image, rfi, 0.5, 10.0, true);
-		break;
-		case 25:
-			image = Image2DPtr(CreateNoise(width, height, gaussianNoise));
-			AddBroadbandToTestSet(image, rfi, 0.5, 1.0, true);
-		break;
-		case 26: { // Several Gaussian broadband lines
-			image = Image2DPtr(CreateNoise(width, height, gaussianNoise));
-			AddBroadbandToTestSet(image, rfi, 1.0, 1.0, false, GaussianShape);
-		} break;
-		case 27: { // Several Sinusoidal broadband lines
-			image = Image2DPtr(CreateNoise(width, height, gaussianNoise));
-			AddBroadbandToTestSet(image, rfi, 1.0, 1.0, false, SinusoidalShape);
-		} break;
-		case 28: { // Several slewed Gaussian broadband lines
-			image = Image2DPtr(CreateNoise(width, height, gaussianNoise));
-			AddSlewedBroadbandToTestSet(image, rfi, 1.0);
-		} break;
-		case 29: { // Several bursty broadband lines
-			image = Image2DPtr(CreateNoise(width, height, gaussianNoise));
-			AddBurstBroadbandToTestSet(image, rfi);
-		} break;
-		case 30: { // noise + RFI ^-2 distribution
-			image = sampleRFIDistribution(width, height, 1.0);
-			rfi->SetAll<true>();
-		} break;
-		case 31: { // noise + RFI ^-2 distribution
-			image = sampleRFIDistribution(width, height, 0.1);
-			rfi->SetAll<true>();
-		} break;
-		case 32: { // noise + RFI ^-2 distribution
-			image = sampleRFIDistribution(width, height, 0.01);
-			rfi->SetAll<true>();
-		} break;
-	}
-	return image;
-}
-
-void MitigationTester::AddBroadbandToTestSet(Image2DPtr image, Mask2DPtr rfi, long double length, double strength, bool align, enum BroadbandShape shape)
-{
-	size_t frequencyCount = image->Height();
-	unsigned step = image->Width()/11;
-	if(align)
-	{
-		// see vertevd.h why this is:
-		unsigned n = (unsigned) floor(0.5 + sqrt(0.25 + 2.0 * frequencyCount));
-		unsigned affectedAntennas = (unsigned) n*(double)length;
-		unsigned index = 0;
-		AOLogger::Debug << affectedAntennas << " of " << n << " antennas effected." << '\n';
-		AOLogger::Debug << "Affected  baselines: ";
-		for(unsigned y=0;y<n;++y)
-		{
-			for(unsigned x=y+1;x<n;++x)
-			{
-				double a1, a2;
-				if(x<affectedAntennas) a1=1.0; else a1=0.0;
-				if(y<affectedAntennas) a2=1.0; else a2=0.0;
-				
-				if(y<affectedAntennas || x<affectedAntennas)
-				{
-					AOLogger::Debug << x << " x " << y << ", ";
-					AddRfiPos(image, rfi, 3.0*strength*a1*a2, step*1, 3, index);
-					AddRfiPos(image, rfi, 2.5*strength*a1*a2, step*2, 3, index);
-					AddRfiPos(image, rfi, 2.0*strength*a1*a2, step*3, 3, index);
-					AddRfiPos(image, rfi, 1.8*strength*a1*a2, step*4, 3, index);
-					AddRfiPos(image, rfi, 1.6*strength*a1*a2, step*5, 3, index);
-
-					AddRfiPos(image, rfi, 3.0*strength*a1*a2, step*6, 1, index);
-					AddRfiPos(image, rfi, 2.5*strength*a1*a2, step*7, 1, index);
-					AddRfiPos(image, rfi, 2.0*strength*a1*a2, step*8, 1, index);
-					AddRfiPos(image, rfi, 1.8*strength*a1*a2, step*9, 1, index);
-					AddRfiPos(image, rfi, 1.6*strength*a1*a2, step*10, 1, index);
-				}
-				++index;
-			}
-		}
-		AOLogger::Debug << ".\n";
-	} else {
-		unsigned fStart = (unsigned) ((0.5 - length/2.0) * frequencyCount);
-		unsigned fEnd = (unsigned) ((0.5 + length/2.0) * frequencyCount);
-		AddBroadbandLinePos(image, rfi, 3.0*strength, step*1, 3, fStart, fEnd, shape);
-		AddBroadbandLinePos(image, rfi, 2.5*strength, step*2, 3, fStart, fEnd, shape);
-		AddBroadbandLinePos(image, rfi, 2.0*strength, step*3, 3, fStart, fEnd, shape);
-		AddBroadbandLinePos(image, rfi, 1.8*strength, step*4, 3, fStart, fEnd, shape);
-		AddBroadbandLinePos(image, rfi, 1.6*strength, step*5, 3, fStart, fEnd, shape);
-
-		AddBroadbandLinePos(image, rfi, 3.0*strength, step*6, 1, fStart, fEnd, shape);
-		AddBroadbandLinePos(image, rfi, 2.5*strength, step*7, 1, fStart, fEnd, shape);
-		AddBroadbandLinePos(image, rfi, 2.0*strength, step*8, 1, fStart, fEnd, shape);
-		AddBroadbandLinePos(image, rfi, 1.8*strength, step*9, 1, fStart, fEnd, shape);
-		AddBroadbandLinePos(image, rfi, 1.6*strength, step*10, 1, fStart, fEnd, shape);
-	}
-}
-
-void MitigationTester::AddSlewedBroadbandToTestSet(Image2DPtr image, Mask2DPtr rfi, long double length, double strength, double slewrate, enum BroadbandShape shape)
-{
-	size_t frequencyCount = image->Height();
-	unsigned step = image->Width()/11;
-	unsigned fStart = (unsigned) ((0.5 - length/2.0) * frequencyCount);
-	unsigned fEnd = (unsigned) ((0.5 + length/2.0) * frequencyCount);
-	AddSlewedBroadbandLinePos(image, rfi, 3.0*strength, slewrate, step*1, 3, fStart, fEnd, shape);
-	AddSlewedBroadbandLinePos(image, rfi, 2.5*strength, slewrate, step*2, 3, fStart, fEnd, shape);
-	AddSlewedBroadbandLinePos(image, rfi, 2.0*strength, slewrate, step*3, 3, fStart, fEnd, shape);
-	AddSlewedBroadbandLinePos(image, rfi, 1.8*strength, slewrate, step*4, 3, fStart, fEnd, shape);
-	AddSlewedBroadbandLinePos(image, rfi, 1.6*strength, slewrate, step*5, 3, fStart, fEnd, shape);
-
-	AddSlewedBroadbandLinePos(image, rfi, 3.0*strength, slewrate, step*6, 1, fStart, fEnd, shape);
-	AddSlewedBroadbandLinePos(image, rfi, 2.5*strength, slewrate, step*7, 1, fStart, fEnd, shape);
-	AddSlewedBroadbandLinePos(image, rfi, 2.0*strength, slewrate, step*8, 1, fStart, fEnd, shape);
-	AddSlewedBroadbandLinePos(image, rfi, 1.8*strength, slewrate, step*9, 1, fStart, fEnd, shape);
-	AddSlewedBroadbandLinePos(image, rfi, 1.6*strength, slewrate, step*10, 1, fStart, fEnd, shape);
-}
-
-void MitigationTester::AddVarBroadbandToTestSet(Image2DPtr image, Mask2DPtr rfi)
-{
-	// The "randomness" should be reproducable randomness, so calling
-	// the random number generator to generate the numbers is not a good
-	// idea.
-	unsigned step = image->Width()/11;
-	AddBroadbandLine(image, rfi, 3.0, step*1, 3, 0.937071,0.0185952);
-	AddBroadbandLine(image, rfi, 2.5, step*2, 3, 0.638442,0.327689);
-	AddBroadbandLine(image, rfi, 2.0, step*3, 3, 0.859308,0.0211675);
-	AddBroadbandLine(image, rfi, 1.8, step*4, 3, 0.418327,0.324842);
-	AddBroadbandLine(image, rfi, 1.6, step*5, 3, 0.842374,0.105613);
-
-	AddBroadbandLine(image, rfi, 3.0, step*6, 1, 0.704607,0.163653);
-	AddBroadbandLine(image, rfi, 2.5, step*7, 1, 0.777955,0.0925143);
-	AddBroadbandLine(image, rfi, 2.0, step*8, 1, 0.288418,0.222322);
-	AddBroadbandLine(image, rfi, 1.8, step*9, 1, 0.892462,0.0381083);
-	AddBroadbandLine(image, rfi, 1.6, step*10, 1, 0.444377,0.240526);
-}
-
-void MitigationTester::AddModelData(Image2DPtr , unsigned /*sources*/)
-{
-	//TODO
-	/*
-	class Model model;
-	if(sources>=5) {
-		model.AddSource(0.1,0.1,0.5);
-		model.AddSource(0.1,0.0,0.35);
-		model.AddSource(.101,0.001,0.45);
-		model.AddSource(1.0,0.0,1.0);
-		model.AddSource(4.0,3.0,0.9);
-	} else {
-		if(sources>=1)
-			model.AddSource(0.1,0.1,0.7);
-		if(sources>=2)
-			model.AddSource(0.1,0.0,0.5);
-		if(sources>=3)
-			model.AddSource(1.0,0.0,1.0);
-	}
-	//WSRTObservatorium wsrt(0,1);
-	//std::pair<TimeFrequencyData,TimeFrequencyMetaDataCPtr> data =
-	//	model.SimulateObservation(wsrt, 0.05, 0.05, 130.0e+6, 0, 1);
-	//image->SetValues(data.first.GetRealPart());
-	*/
-}
-
-void MitigationTester::SubtractBackground(Image2DPtr image)
-{
-	Mask2DPtr zero = Mask2D::CreateSetMaskPtr<false>(image->Width(), image->Height());
-	LocalFitMethod fittedImage;
-	fittedImage.SetToWeightedAverage(20, 40, 7.5, 15.0);
-	TimeFrequencyData data(TimeFrequencyData::AmplitudePart, SinglePolarisation, image);
-	data.SetGlobalMask(zero);
-	fittedImage.Initialize(data);
-	for(unsigned i=0;i<fittedImage.TaskCount();++i)
-		fittedImage.PerformFit(i);
-	Image2D *diff = Image2D::CreateFromDiff(*image, *fittedImage.Background().GetSingleImage());
-	image->SetValues(*diff);
-	delete diff;
-	for(unsigned y=0;y<image->Height();++y) {
-		for(unsigned x=0;x<image->Width();++x) {
-			image->AddValue(x, y, 1.0); 
-		}
-	}
-}
-
-Image2DPtr MitigationTester::sampleRFIDistribution(unsigned width, unsigned height, double ig_over_rsq)
-{
-	Image2DPtr image = Image2D::CreateUnsetImagePtr(width, height);
-	const double sigma = 1.0;
-
-	for(size_t f=0; f<height;++f) {
-		for(size_t t=0; t<width;++t) {
-			image->SetValue(t, f, Rand(Gaussian)*sigma + ig_over_rsq / RNG::Uniform());
-		}
-	}
-	return image;
-}
diff --git a/CEP/DP3/AOFlagger/src/strategy/algorithms/morphology.cpp b/CEP/DP3/AOFlagger/src/strategy/algorithms/morphology.cpp
deleted file mode 100644
index 5ec9fa69944528c529a58b002678341d665fe7f2..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/strategy/algorithms/morphology.cpp
+++ /dev/null
@@ -1,518 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <AOFlagger/strategy/algorithms/morphology.h>
-#include <AOFlagger/strategy/algorithms/statisticalflagger.h>
-
-#include <AOFlagger/util/aologger.h>
-
-#include <stack>
-#include <iostream>
-
-size_t
-	Morphology::BROADBAND_SEGMENT = 1,
-	Morphology::LINE_SEGMENT = 2,
-	Morphology::BLOB_SEGMENT = 3;
-
-void Morphology::SegmentByMaxLength(Mask2DCPtr mask, SegmentedImagePtr output)
-{
-	int **lengthWidthValues = new int*[mask->Height()];
-	for(size_t y=0;y<mask->Height();++y)
-		lengthWidthValues[y] = new int[mask->Width()];
-	
-	calculateOpenings(mask, lengthWidthValues);
-
-	for(size_t y=0;y<mask->Height();++y)
-	{
-		for(size_t x=0;x<mask->Width();++x)
-			output->SetValue(x,y,0);
-	}
-	for(size_t y=0;y<mask->Height();++y)
-	{
-		for(size_t x=0;x<mask->Width();++x)
-		{
-			if(mask->Value(x, y) && output->Value(x,y) == 0)
-			{
-				floodFill(mask, output, lengthWidthValues, x, y, output->NewSegmentValue());
-			}
-		}
-	}
-		
-	for(size_t y=0;y<mask->Height();++y)
-		delete[] lengthWidthValues[y];
-	delete[] lengthWidthValues;
-}
-
-void Morphology::SegmentByLengthRatio(Mask2DCPtr mask, SegmentedImagePtr output)
-{
-	Mask2DPtr maskCopy = Mask2D::CreateCopy(mask);
-	//StatisticalFlagger::EnlargeFlags(maskCopy, 2, 2);
-	
-	Mask2DPtr matrices[3];
-	for(size_t i=0;i<3;++i)
-		matrices[i] = Mask2D::CreateUnsetMaskPtr(mask->Width(), mask->Height());
-	
-	int
-		**hCounts = new int*[mask->Height()],
-		**vCounts = new int*[mask->Height()];
-	for(size_t y=0;y<mask->Height();++y)
-	{
-		hCounts[y] = new int[mask->Width()];
-		vCounts[y] = new int[mask->Width()];
-	}
-	
-	// Calculate convolved counts
-	calculateHorizontalCounts(maskCopy, hCounts);
-	calculateVerticalCounts(maskCopy, vCounts);
-	
-	calculateOpenings(maskCopy, matrices, hCounts, vCounts);
-
-
-	for(size_t y=0;y<mask->Height();++y)
-	{
-		for(size_t x=0;x<mask->Width();++x)
-			output->SetValue(x, y, 0);
-	}
-	StatisticalFlagger::EnlargeFlags(matrices[0], _hLineEnlarging, 0);
-	StatisticalFlagger::EnlargeFlags(matrices[2], 0, _vLineEnlarging);
-	StatisticalFlagger::DensityTimeFlagger(matrices[0], _hDensityEnlargeRatio);
-	StatisticalFlagger::DensityFrequencyFlagger(matrices[2], _vDensityEnlargeRatio);
-
-	// Calculate counts again with new matrices
-	calculateHorizontalCounts(matrices[0], hCounts);
-	calculateVerticalCounts(matrices[2], vCounts);
-
-	for(size_t z=0;z<3;z+=2)
-	{
-		for(size_t y=0;y<mask->Height();++y)
-		{
-			for(size_t x=0;x<mask->Width();++x)
-			{
-				if(matrices[z]->Value(x, y) && output->Value(x, y)==0)
-				{
-					floodFill(mask, output, matrices, x, y, z, output->NewSegmentValue(), hCounts, vCounts);
-				}
-			}
-		}
-	}
-	
-	for(size_t y=0;y<mask->Height();++y)
-	{
-		delete[] hCounts[y];
-		delete[] vCounts[y];
-	}
-	delete[] hCounts;
-	delete[] vCounts;
-}
-
-void Morphology::calculateHorizontalCounts(Mask2DCPtr mask, int **values)
-{
-	for(size_t y=0;y<mask->Height();++y)
-	{
-		size_t length = 0;
-
-		for(size_t x=0;x<mask->Width();++x)
-		{
-			if(mask->Value(x, y))
-			{
-				++length;
-			} else if(length > 0) {
-				for(size_t i=x-length;i<x;++i)
-				{
-					values[y][i] = length;
-				}
-				length = 0;
-				values[y][x] = 0;
-			} else {
-				values[y][x] = 0;
-			}
-		}
-		for(size_t i=mask->Width()-length;i<mask->Width();++i)
-		{
-			values[y][i] = length;
-		}
-	}
-}
-
-void Morphology::calculateVerticalCounts(Mask2DCPtr mask, int **values)
-{
-	for(size_t x=0;x<mask->Width();++x)
-	{
-		size_t length = 0;
-
-		for(size_t y=0;y<mask->Height();++y)
-		{
-			if(mask->Value(x, y))
-			{
-				++length;
-			} else if(length > 0) {
-				for(size_t i=y-length;i<y;++i)
-				{
-					values[i][x] = length;
-				}
-				length = 0;
-				values[y][x] = 0;
-			} else {
-				values[y][x] = 0;
-			}
-		}
-		for(size_t i=mask->Height()-length;i<mask->Height();++i)
-		{
-			values[i][x] = length;
-		}
-	}
-}
-
-void Morphology::calculateOpenings(Mask2DCPtr mask, int **values)
-{
-	for(size_t y=0;y<mask->Height();++y)
-	{
-		size_t length = 0;
-
-		for(size_t x=0;x<mask->Width();++x)
-		{
-			if(mask->Value(x, y))
-			{
-				++length;
-			} else if(length > 0) {
-				for(size_t i=x-length;i<x;++i)
-				{
-					values[y][i] = length;
-				}
-				length = 0;
-				values[y][x] = 0;
-			} else {
-				values[y][x] = 0;
-			}
-		}
-		if(length > 0) {
-			for(size_t i=mask->Width()-length;i<mask->Width();++i)
-			{
-				values[y][i] = length;
-			}
-		}
-	}
-
-	for(size_t x=0;x<mask->Width();++x)
-	{
-		size_t length = 0;
-
-		for(size_t y=0;y<mask->Height();++y)
-		{
-			if(mask->Value(x, y))
-			{
-				++length;
-			} else if(length > 0) {
-				for(size_t i=y-length;i<y;++i)
-				{
-					if(values[i][x] < (int) length)
-						values[i][x] = -(int) length;
-				}
-				length = 0;
-			}
-		}
-		if(length > 0) {
-			for(size_t i=mask->Height()-length;i<mask->Height();++i)
-			{
-				if(values[i][x] < (int) length)
-					values[i][x] = -(int) length;
-			}
-		}
-	}
-}
-
-void Morphology::calculateOpenings(Mask2DCPtr mask, Mask2DPtr *values, int **hCounts, int **vCounts)
-{
-	//const int zThreshold = 5;
-	
-	for(size_t y=0;y<mask->Height();++y)
-	{
-		for(size_t x=0;x<mask->Width();++x)
-		{
-			bool v = mask->Value(x, y);
-			values[0]->SetValue(x, y, v && (hCounts[y][x] > vCounts[y][x]));
-			values[1]->SetValue(x, y, v && false);
-			//values[1]->SetValue(x, y, v && (abs(hCounts[y][x] - vCounts[y][x]) < zThreshold));
-			values[2]->SetValue(x, y, v && (hCounts[y][x] <= vCounts[y][x]));
-		}
-	}
-}
-
-struct MorphologyPoint2D { size_t x, y; };
-struct MorphologyPoint3D { size_t x, y, z; };
-
-void Morphology::floodFill(Mask2DCPtr mask, SegmentedImagePtr output, const int *const *lengthWidthValues, size_t x, size_t y, size_t value)
-{
-	std::stack<MorphologyPoint2D> points;
-	MorphologyPoint2D startPoint;
-	startPoint.x = x;
-	startPoint.y = y;
-	points.push(startPoint);
-	do {
-		MorphologyPoint2D p = points.top();
-		points.pop();
-		output->SetValue(p.x, p.y, value);
-		int z = lengthWidthValues[p.y][p.x];
-		if(p.x > 0 && output->Value(p.x-1, p.y) == 0 && mask->Value(p.x-1,p.y))
-		{
-			int zl = lengthWidthValues[p.y][p.x-1];
-			if((zl > 0 && z > 0) || (zl < 0 && z < 0))
-			{
-				MorphologyPoint2D newP;
-				newP.x = p.x-1; newP.y = p.y;
-				points.push(newP);
-			}
-		}
-		if(p.x < mask->Width()-1 && output->Value(p.x+1, p.y)==0 && mask->Value(p.x+1,p.y))
-		{
-			int zr = lengthWidthValues[p.y][p.x+1];
-			if((zr > 0 && z > 0) || (zr < 0 && z < 0))
-			{
-				MorphologyPoint2D newP;
-				newP.x = p.x+1; newP.y = p.y;
-				points.push(newP);
-			}
-		}
-		if(p.y > 0 && output->Value(p.x, p.y-1)==0 && mask->Value(p.x,p.y-1))
-		{
-			int zt = lengthWidthValues[p.y-1][p.x];
-			if((zt > 0 && z > 0) || (zt < 0 && z < 0))
-			{
-				MorphologyPoint2D newP;
-				newP.x = p.x; newP.y = p.y-1;
-				points.push(newP);
-			}
-		}
-		if(p.y < mask->Height()-1 && output->Value(p.x, p.y+1)==0 && mask->Value(p.x,p.y+1))
-		{
-			int zb = lengthWidthValues[p.y+1][p.x];
-			if((zb > 0 && z > 0) || (zb < 0 && z < 0))
-			{
-				MorphologyPoint2D newP;
-				newP.x = p.x; newP.y = p.y+1;
-				points.push(newP);
-			}
-		}
-	} while(points.size() != 0);
-}
-
-void Morphology::floodFill(Mask2DCPtr mask, SegmentedImagePtr output, Mask2DPtr *matrices, size_t x, size_t y, size_t z, size_t value, int **hCounts, int **vCounts)
-{
-	std::stack<MorphologyPoint3D> points;
-	MorphologyPoint3D startPoint;
-	startPoint.x = x;
-	startPoint.y = y;
-	startPoint.z = z;
-	points.push(startPoint);
-	do {
-		MorphologyPoint3D p = points.top();
-		points.pop();
-		if(mask->Value(p.x, p.y))
-		{
-			if(output->Value(p.x, p.y) == 0)
-			{
-				output->SetValue(p.x, p.y, value);
-			} else {
-				// now we need to decide whether to change this sample to the new segment or not
-				if(hCounts[p.y][p.x] < vCounts[p.y][p.x] && p.z == 2)
-					output->SetValue(p.x, p.y, value);
-			}
-		}
-		Mask2DPtr matrix = matrices[p.z];
-		matrix->SetValue(p.x, p.y, false);
-		if((p.z == 0 || p.z == 2) && matrices[1]->Value(p.x,p.y))
-		{
-			MorphologyPoint3D newP;
-			newP.x = p.x; newP.y = p.y; newP.z = 1;
-			points.push(newP);
-		}
-		if(p.x > 0 && matrix->Value(p.x-1,p.y))
-		{
-			MorphologyPoint3D newP;
-			newP.x = p.x-1; newP.y = p.y; newP.z = p.z;
-			points.push(newP);
-		}
-		if(p.x < mask->Width()-1 && matrix->Value(p.x+1,p.y))
-		{
-			MorphologyPoint3D newP;
-			newP.x = p.x+1; newP.y = p.y; newP.z = p.z; newP.z = p.z;
-			points.push(newP);
-		}
-		if(p.y > 0 && matrix->Value(p.x,p.y-1))
-		{
-			MorphologyPoint3D newP;
-			newP.x = p.x; newP.y = p.y-1; newP.z = p.z;
-			points.push(newP);
-		}
-		if(p.y < mask->Height()-1 && matrix->Value(p.x,p.y+1))
-		{
-			MorphologyPoint3D newP;
-			newP.x = p.x; newP.y = p.y+1; newP.z = p.z;
-			points.push(newP);
-		}
-	} while(points.size() != 0);
-}
-
-void Morphology::Cluster(SegmentedImagePtr segmentedImage)
-{
-	std::map<size_t,SegmentInfo> segments = createSegmentMap(segmentedImage);
-	AOLogger::Debug << "Segments before clustering: " << segments.size();
-
-	for(std::map<size_t,SegmentInfo>::iterator i=segments.begin();i!=segments.end();++i)
-	{
-		SegmentInfo &info1 = i->second;
-		for(std::map<size_t,SegmentInfo>::iterator j=segments.begin();j!=segments.end();++j)
-		{
-			if(info1.segment != j->second.segment && !(i->second.mark) && !(j->second.mark))
-			{
-				SegmentInfo &info2 = j->second;
-				size_t hDist = info1.HorizontalDistance(info2);
-				size_t vDist = info1.VerticalDistance(info2);
-	
-				// The MERGE criteria
-				bool cluster = false;
-				//int minDist = hDist > vDist ? vDist : hDist;
-				int maxDist = hDist > vDist ? hDist : vDist;
-				//int maxCount = info1.count > info2.count ? info1.count : info2.count;
-				int minCount = info1.count > info2.count ? info2.count : info1.count;
-				int maxWidth = info1.width > info2.width ? info1.width : info2.width;
-				int maxHeight = info1.height > info2.height ? info1.height : info2.height;
-				int minHeight = info1.height > info2.height ? info2.height : info1.height;
-				//int lDist = abs((int) info1.left - (int) info2.left);
-				//int rDist = abs((int) info1.right - (int) info2.right);
-				//int tDist = abs((int) info1.top - (int) info2.top);
-				//int bDist = abs((int) info1.bottom - (int) info2.bottom);
-				int widthDist = abs((int) info1.width - (int) info2.width);
-				int heightDist = abs((int) info1.height - (int) info2.height);
-				//double x1Mean = (double) info1.xTotal / info1.count; 
-				//double x2Mean = (double) info2.xTotal / info2.count;
-				//double xMeanDist = fabs(x1Mean - x2Mean); 
-				double y1Mean = (double) info1.yTotal / info1.count; 
-				double y2Mean = (double) info2.yTotal / info2.count;
-				double yMeanDist = fabs(y1Mean - y2Mean); 
-	
-				bool remove1 = false, remove2 = false;
-				
-				// Cluster large segments with very small segments that are close together (probably noise
-				// from the continuous transmitter)
-				bool
-					noiseH1 = maxDist <= 1 && info2.count > (info1.count*20) && info2.width>info1.width*8 && info1.height < 16 && info1.width<segmentedImage->Width()/10,
-					noiseH2 =  maxDist <= 1 && info1.count > (info2.count*20) && info1.width>info2.width*8 && info2.height < 16 && info2.width<segmentedImage->Width()/10;
-				cluster = cluster || noiseH1 || noiseH2;
-				remove1 = remove1 || noiseH1;
-				remove2 = remove2 || noiseH2;
-
-				bool
-					noiseV1 = maxDist <= 1 && info2.count > (info1.count*20) && info2.height>info1.height*8 && info1.height < 16 && info1.width<segmentedImage->Width()/10,
-					noiseV2 =  maxDist <= 1 && info1.count > (info2.count*20) && info1.height>info2.height*8 && info2.height < 16 && info2.width<segmentedImage->Width()/10;
-				cluster = cluster || noiseV1 || noiseV2;
-				remove1 = remove1 || noiseV1;
-				remove2 = remove2 || noiseV2;
-	
-				// Cluster same-shaped segments that are in the same channels
-				cluster = cluster || (vDist == 0 && yMeanDist*8 <= (maxHeight+minHeight) && widthDist <= (maxWidth / 4 + 2) && heightDist <= (maxHeight / 4 + 2) && maxDist < minCount*32);
-
-				if(cluster)
-				{
-					size_t oldSegment = info2.segment;
-					segmentedImage->MergeSegments(info1.segment, oldSegment);
-					for(std::map<size_t,SegmentInfo>::iterator i=segments.begin();i!=segments.end();++i)
-					{
-						SegmentInfo &info = i->second;
-						if(info.segment == oldSegment) info.segment=info1.segment;
-					}
-				}
-				if(remove1)
-					info1.mark = true;
-				if(remove2)
-					info2.mark = true;
-			}
-		}
-	}
-}
-
-std::map<size_t,Morphology::SegmentInfo> Morphology::createSegmentMap(SegmentedImageCPtr segmentedImage) const
-{
-	std::map<size_t,SegmentInfo> segments;
-	for(size_t y=0;y<segmentedImage->Height();++y)
-	{
-		for(size_t x=0;x<segmentedImage->Width();++x)
-		{
-			size_t segmentValue = segmentedImage->Value(x,y);
-			if(segmentValue != 0)
-			{
-				if(segments.count(segmentValue) == 0)
-				{
-					SegmentInfo segment;
-					segment.segment = segmentValue;
-					segment.left = x;
-					segment.right = x+1;
-					segment.top = y;
-					segment.bottom = y+1;
-					segment.AddPoint(x,y);
-					segments.insert(std::map<size_t,SegmentInfo>::value_type(segmentValue, segment));
-				} else {
-					SegmentInfo &segment = segments.find(segmentValue)->second;
-					segment.AddPoint(x,y);
-				}
-			}
-		}
-	}
-
-	for(std::map<size_t,SegmentInfo>::iterator i=segments.begin();i!=segments.end();++i)
-	{
-		SegmentInfo &info = i->second;
-		info.width = info.right - info.left;
-		info.height = info.bottom - info.top;
-	}
-	return segments;
-}
-
-void Morphology::RemoveSmallSegments(SegmentedImagePtr segmentedImage, size_t thresholdLevel)
-{
-	std::map<size_t,SegmentInfo> segments = createSegmentMap(segmentedImage);
-	size_t removedSegments = 0;
-
-	for(std::map<size_t,SegmentInfo>::iterator i=segments.begin();i!=segments.end();++i)
-	{
-		const SegmentInfo &segment = i->second;
-		if(segment.count <= thresholdLevel)
-		{
-			++removedSegments;
-			segmentedImage->RemoveSegment(segment.segment, segment.left, segment.right, segment.top, segment.bottom);
-		}
-	}
-	AOLogger::Debug << "Removed " << removedSegments << " segments of size " << thresholdLevel << " or smaller.\n";
-}
-
-void Morphology::Classify(SegmentedImagePtr segmentedImage)
-{
-	std::map<size_t,SegmentInfo> segments = createSegmentMap(segmentedImage);
-
-	for(std::map<size_t,SegmentInfo>::iterator i=segments.begin();i!=segments.end();++i)
-	{
-		SegmentInfo &info = i->second;
-		if(info.width > info.height * 10)
-			segmentedImage->MergeSegments(LINE_SEGMENT, info.segment);
-		else if(info.height > info.width * 10)
-			segmentedImage->MergeSegments(BROADBAND_SEGMENT, info.segment);
-		else
-			segmentedImage->MergeSegments(BLOB_SEGMENT, info.segment);
-	}
-}
diff --git a/CEP/DP3/AOFlagger/src/strategy/algorithms/polfitmethod.cpp b/CEP/DP3/AOFlagger/src/strategy/algorithms/polfitmethod.cpp
deleted file mode 100644
index 7858d4a5ac80296793712fc3660fd026030b2351..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/strategy/algorithms/polfitmethod.cpp
+++ /dev/null
@@ -1,327 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <AOFlagger/strategy/algorithms/polfitmethod.h>
-
-PolFitMethod::PolFitMethod() : _background(0), _previousCoefficients(0)
-{
-}
-
-PolFitMethod::~PolFitMethod()
-{
-	if(_background!=0)
-		delete _background;
-}
-
-void PolFitMethod::Initialize(const TimeFrequencyData &input)
-{
-	_original = input.GetSingleImage();
-	_background2D = Image2D::CreateEmptyImagePtr(_original->Width(), _original->Height());
-	if(_background!=0)
-		delete _background;
-	_background = new TimeFrequencyData(input.PhaseRepresentation(), input.Polarisation(), _background2D);
-	_mask = input.GetSingleMask();
-	if(_hSquareSize * 2 > _original->Width())
-		_hSquareSize = _original->Width()/2;
-	if(_vSquareSize * 2 > _original->Height())
-		_vSquareSize = _original->Height()/2;
-}
-
-unsigned PolFitMethod::TaskCount()
-{
-	return _original->Height();
-}
-
-void PolFitMethod::PerformFit(unsigned taskNumber)
-{
-	if(_mask == 0)
-		throw BadUsageException("Mask has not been set!");
-	unsigned y = taskNumber;
-	for(unsigned x=0;x<_original->Width();++x)
-		_background2D->SetValue(x, y, CalculateBackgroundValue(x, y));
-}
-
-long double PolFitMethod::CalculateBackgroundValue(unsigned x, unsigned y)
-{
-	ThreadLocal local;
-	local.image = this;
-	local.currentX = x;
-	local.currentY = y;
-
-	if(local.currentY >= _vSquareSize)
-		local.startY = local.currentY-_vSquareSize;
-	else
-		local.startY = 0;
-	local.endY = local.currentY + _vSquareSize;
-	if(local.endY >= _original->Height())
-		local.endY = _original->Height()-1;
-
-	if(local.currentX >= _hSquareSize)
-		local.startX = local.currentX - _hSquareSize;
-	else
-		local.startX = 0;
-	local.endX = local.currentX + _hSquareSize;
-		if(local.endX >= _original->Width())
-			local.endX = _original->Width()-1;
-	local.emptyWindows = 0;
-
-	switch(_method) {
-		case None:
-			return 0.0;
-		case LeastSquare:
-		case LeastAbs:
-		case FastGaussianWeightedAverage:
-			return FitBackground(x, y, local);
-		default:
-			throw ConfigurationException("The PolFitMethod was not initialized before a fit was executed.");
-	}
-}
-
-int PolFitMethod::SquareError(const gsl_vector * coefs, void *data, gsl_vector * f)
-{
-	// f(x,y) = ( a * x^2 + b * xy + c * y^2 + d x + e y + l  -  image[x,y] )^2
-	ThreadLocal &local = *(ThreadLocal *) data;
-	double a = gsl_vector_get(coefs, 0);
-	double b = gsl_vector_get(coefs, 1);
-	double c = gsl_vector_get(coefs, 2);
-	double d = gsl_vector_get(coefs, 3);
-	double e = gsl_vector_get(coefs, 4);
-	double l = gsl_vector_get(coefs, 5);
-
-	unsigned index = 0;
-
-	for(unsigned y=local.startY; y <= local.endY; ++y) {
-		double yf = y;
-		for(unsigned x=local.startX; x <= local.endX; ++x) {
-			if(!local.image->_mask->Value(x, y)) {
-				double xf = x;
-				double g_xy = a * xf*xf + b * xf*yf + c * yf*yf + d * xf + e * yf + l - local.image->_original->Value(x, y);
-				gsl_vector_set(f, index, (g_xy*g_xy));
-			} else {
-				gsl_vector_set(f, index, 0.0);
-			}
-			index++;
-		}
-	}
-	return GSL_SUCCESS;
-}
-
-int PolFitMethod::SquareErrorDiff(const gsl_vector *coefs, void *data, gsl_matrix * J)
-{
-	ThreadLocal &local = *(ThreadLocal *) data;
-
-	double a = gsl_vector_get(coefs, 0);
-	double b = gsl_vector_get(coefs, 1);
-	double c = gsl_vector_get(coefs, 2);
-	double d = gsl_vector_get(coefs, 3);
-	double e = gsl_vector_get(coefs, 4);
-	double f = gsl_vector_get(coefs, 5);
-
-	unsigned index = 0;
-	for(unsigned y=local.startY; y <= local.endY; ++y) {
-		double yf = y;
-		for(unsigned x=local.startX; x <= local.endX; ++x) {
-			if(!local.image->_mask->Value(x, y)) {
-				// f(x,y) = ( a * x^2 + b * xy + c * y^2 + d x + e y + f  -  image[x,y] )^2
-				// f(x,y) = g^2(x,y)
-				// df(x,y)/dz =  2 * g(x,y) * dg(x,y)/dz
-				// We now need to calculate df(x,y)/da, df(x,y)/db, ..... for each x and y
-				double xf = x;
-				double g_xy = 2.0 * (a * xf*xf + b * xf*yf + c * yf*yf + d * xf + e * yf + f - local.image->_original->Value(x, y));
-				gsl_matrix_set(J, index, 0, g_xy * xf*xf); // df/da
-				gsl_matrix_set(J, index, 1, g_xy * xf*yf); // df/db
-				gsl_matrix_set(J, index, 2, g_xy * yf*yf); // df/dc
-				gsl_matrix_set(J, index, 3, g_xy * xf); // df/dd
-				gsl_matrix_set(J, index, 4, g_xy * yf); // df/de
-				gsl_matrix_set(J, index, 5, g_xy); // df/df
-			} else {
-				for(unsigned ci=0;ci<6;++ci)
-					gsl_matrix_set(J, index, ci, 0.0);
-			}
-			index++;
-		}
-	}
-	
-	return GSL_SUCCESS;
-}
-
-int PolFitMethod::LinError(const gsl_vector * coefs, void *data, gsl_vector * f)
-{
-	// f(x,y) = | a * x^2 + b * xy + c * y^2 + d x + e y + l  -  image[x,y] |
-	ThreadLocal &local = *(ThreadLocal *) data;
-	double a = gsl_vector_get(coefs, 0);
-	double b = gsl_vector_get(coefs, 1);
-	double c = gsl_vector_get(coefs, 2);
-	double d = gsl_vector_get(coefs, 3);
-	double e = gsl_vector_get(coefs, 4);
-	double l = gsl_vector_get(coefs, 5);
-
-	unsigned index = 0;
-
-	for(unsigned y=local.startY; y <= local.endY; ++y) {
-		double yf = y;
-		for(unsigned x=local.startX; x <= local.endX; ++x) {
-			if(!local.image->_mask->Value(x, y)) {
-				double xf = x;
-				double g_xy = a * xf*xf + b * xf*yf + c * yf*yf + d * xf + e * yf + l - local.image->_original->Value(x, y);
-				gsl_vector_set(f, index, fabs(g_xy));
-			} else {
-				gsl_vector_set(f, index, 0.0);
-			}
-			index++;
-		}
-	}
-	return GSL_SUCCESS;
-}
-
-int PolFitMethod::LinErrorDiff(const gsl_vector *coefs, void *data, gsl_matrix * J)
-{
-	ThreadLocal &local = *(ThreadLocal *) data;
-
-	double a = gsl_vector_get(coefs, 0);
-	double b = gsl_vector_get(coefs, 1);
-	double c = gsl_vector_get(coefs, 2);
-	double d = gsl_vector_get(coefs, 3);
-	double e = gsl_vector_get(coefs, 4);
-	double f = gsl_vector_get(coefs, 5);
-
-	unsigned index = 0;
-	for(unsigned y=local.startY; y <= local.endY; ++y) {
-		double yf = y;
-		for(unsigned x=local.startX; x <= local.endX; ++x) {
-			if(!local.image->_mask->Value(x, y)) {
-				// f(x,y) = | a * x^2 + b * xy + c * y^2 + d x + e y + f  -  image[x,y] |
-				// f(x,y) = | g(x,y) |
-				// df(x,y)/dz =  dg(x,y)/dz * g(x,y) / | g(x,y) |
-				// We now need to calculate df(x,y)/da, df(x,y)/db, ..... for each x and y
-				double xf = x;
-				double g_xy = a * xf*xf + b * xf*yf + c * yf*yf + d * xf + e * yf + f - local.image->_original->Value(x, y);
-				double h_xy = g_xy / fabs(g_xy);
-				gsl_matrix_set(J, index, 0, h_xy * xf*xf); // df/da
-				gsl_matrix_set(J, index, 1, h_xy * xf*yf); // df/db
-				gsl_matrix_set(J, index, 2, h_xy * yf*yf); // df/dc
-				gsl_matrix_set(J, index, 3, h_xy * xf); // df/dd
-				gsl_matrix_set(J, index, 4, h_xy * yf); // df/de
-				gsl_matrix_set(J, index, 5, h_xy); // df/df
-			} else {
-				for(unsigned ci=0;ci<6;++ci)
-					gsl_matrix_set(J, index, ci, 0.0);
-			}
-			index++;
-		}
-	}
-	
-	return GSL_SUCCESS;
-}
-
-long double PolFitMethod::FitBackground(unsigned x, unsigned y, ThreadLocal &local)
-{
-	long double *coefficients = new long double[6];
-
-	boost::mutex::scoped_lock lock(_mutex);
-	if(_previousCoefficients) {
-		for(unsigned i=0;i<6;++i)
-			coefficients[i] = _previousCoefficients[i];
-	} else {
-		for(unsigned i=0;i<6;++i)
-			coefficients[i] = 1e-4 * (i*i*i);
-	}
-	lock.unlock();
-
-	// Chose to use the Levenberg-Marquardt solver with scaling
-	const gsl_multifit_fdfsolver_type * T = gsl_multifit_fdfsolver_lmsder;
-
-	// Construct solver
-	unsigned functionCount = (local.endY - local.startY + 1) * (local.endX - local.startX + 1);
-	unsigned coefficientCount = 6;
-	gsl_multifit_fdfsolver *solver = gsl_multifit_fdfsolver_alloc (T, functionCount, coefficientCount);
-	if(solver == 0) throw BadUsageException("No solver.");
-
-	// Initialize function information structure
-	gsl_multifit_function_fdf functionInfo;
-	switch(_method) {
-		case LeastSquare:
-		default:
-			functionInfo.f = &SquareError;
-			functionInfo.df = &SquareErrorDiff;
-			functionInfo.fdf = &SquareErrorComb;
-			break;
-		case LeastAbs:
-			functionInfo.f = &LinError;
-			functionInfo.df = &LinErrorDiff;
-			functionInfo.fdf = &LinErrorComb;
-			break;
-	}
-	functionInfo.n = functionCount;
-	functionInfo.p = coefficientCount;
-	functionInfo.params = &local;
-
-	// Initialize initial value of parameters
-	//gsl_vector vec;
-	double vec_init[coefficientCount];
-	for(unsigned i = 0;i < coefficientCount;++i)
-		vec_init[i] = coefficients[i];
-	gsl_vector_view vec_view = gsl_vector_view_array (vec_init, coefficientCount);
-	
-	int status = gsl_multifit_fdfsolver_set (solver, &functionInfo, &vec_view.vector);
-	if (status && status != GSL_CONTINUE) {
-		std::cout << "Error: status = " << gsl_strerror (status) << std::endl;
-	}
-
-	// Start iterating
-	int iter=0;
-	do {
-		iter++;
-		status = gsl_multifit_fdfsolver_iterate(solver);
-		//PrintState(iter, solver);
-
-		if (status && status != GSL_CONTINUE) {
-			//std::cout << "Error: status = " << gsl_strerror (status) << std::endl;
-			break;
-		}
-
-		status = gsl_multifit_test_delta(solver->dx, solver->x, _precision, _precision);
-	} while (status == GSL_CONTINUE && iter < 250);
-	
-	// Save coefficients
-	for(unsigned i = 0;i<coefficientCount;++i)
-		coefficients[i] = gsl_vector_get(solver->x, i);
-
-	lock.lock();
-	if(_previousCoefficients == 0)
-		_previousCoefficients = new long double[6];
-	for(unsigned i = 0;i<coefficientCount;++i)
-		_previousCoefficients[i] = coefficients[i];
-	lock.unlock();
-
-	// Clean up
-	gsl_multifit_fdfsolver_free(solver);
-
-	long double evaluation = Evaluate(x, y, coefficients);
-	delete[] coefficients;
-	return evaluation;
-}
-
-long double PolFitMethod::Evaluate(unsigned x, unsigned y, long double *coefficients)
-{
-	// f(x,y) = a * x^2 + b * xy + c * y^2 + d x + e y + f
-	double xf = x, yf = y;
-	return coefficients[0]*xf*xf + coefficients[1]*xf*yf + coefficients[2]*yf*yf + coefficients[3]*xf +
-		coefficients[4]*yf + coefficients[5];
-}
diff --git a/CEP/DP3/AOFlagger/src/strategy/algorithms/rfistatistics.cpp b/CEP/DP3/AOFlagger/src/strategy/algorithms/rfistatistics.cpp
deleted file mode 100644
index 883fb7da20b8e650917b33384032d5a1ab1d58a0..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/strategy/algorithms/rfistatistics.cpp
+++ /dev/null
@@ -1,1796 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008-2010 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <AOFlagger/strategy/algorithms/rfistatistics.h>
-
-#include <deque>
-#include <iostream>
-#include <fstream>
-#include <cmath>
-#include <iomanip>
-
-#include <AOFlagger/msio/date.h>
-#include <AOFlagger/msio/timefrequencydata.h>
-
-#include <AOFlagger/util/aologger.h>
-#include <AOFlagger/util/plot.h>
-
-#include <AOFlagger/strategy/algorithms/morphology.h>
-#include <sys/stat.h>
-
-void RFIStatistics::Add(const TimeFrequencyData &data, TimeFrequencyMetaDataCPtr metaData)
-{
-	Mask2DCPtr mask = data.GetSingleMask();
-	SegmentedImagePtr segmentedMask = SegmentedImage::CreatePtr(mask->Width(), mask->Height());
-	Image2DCPtr image = data.GetSingleImage();
-	
-	SegmentedImagePtr classifiedMask;
-	if(_performClassification)
-	{
-		Morphology morphology;
-		morphology.SegmentByLengthRatio(mask, segmentedMask);
-		classifiedMask = SegmentedImage::CreateCopy(segmentedMask);
-		morphology.Classify(classifiedMask);
-	} else {
-		classifiedMask = segmentedMask;
-	}
-	
-	addEverything(data, metaData, image, mask, segmentedMask, classifiedMask);
-}
-
-void RFIStatistics::addEverything(const TimeFrequencyData &data, TimeFrequencyMetaDataCPtr metaData, Image2DCPtr image, Mask2DCPtr mask, SegmentedImagePtr segmentedMask, SegmentedImagePtr classifiedMask)
-{
-	addSingleBaseline(data, metaData, image, mask, segmentedMask, classifiedMask, _writeImmediately);
-	
-	boost::mutex::scoped_lock taLock(_baselineMapMutex);
-	addBaselines(data, metaData, image, mask, segmentedMask, classifiedMask);
-	if(_writeImmediately)
-	{
-		saveBaselines(_filePrefix + "counts-baselines.txt");
-	}
-}
-
-void RFIStatistics::addSingleBaseline(const TimeFrequencyData &data, TimeFrequencyMetaDataCPtr metaData, Image2DCPtr image, Mask2DCPtr mask, SegmentedImagePtr segmentedMask, SegmentedImagePtr classifiedMask, bool save)
-{
-	boost::mutex::scoped_lock taLock(_taMapMutex);
-	addBaselineTimeInfo(metaData, image, mask);
-	if(save) saveBaselineTimeInfo(_filePrefix + "counts-baseltime.txt");
-	taLock.unlock();
-	
-	boost::mutex::scoped_lock afLock(_afMapMutex);
-	addBaselineFrequencyInfo(metaData, image, mask);
-	saveBaselineFrequencyInfo(_filePrefix + "counts-baselfreq.txt");
-	afLock.unlock();
-	
-	bool isCross = (!metaData->HasAntenna1()) || (!metaData->HasAntenna2()) || metaData->Antenna1().id == metaData->Antenna2().id;
-	if(isCross)
-	{
-		boost::mutex::scoped_lock genLock(_genericMutex);
-		addFeatures(_autoAmplitudes, image, mask, metaData, segmentedMask);
-		segmentedMask.reset();
-		addAmplitudes(_autoAmplitudes, image, mask, metaData, classifiedMask);
-		if(data.Polarisation() == DipolePolarisation && _polarizationAmplitudeStatistics)
-		{
-			addStokes(_autoAmplitudes, data, metaData);
-			addPolarisations(_autoAmplitudes, data, metaData);
-		}
-		if(save) {
-			saveAmplitudes(_autoAmplitudes, _filePrefix + "counts-amplitudes-auto.txt");
-		}
-		genLock.unlock();
-		
-		boost::mutex::scoped_lock freqLock(_frequencyMapMutex);
-		addChannels(_autoChannels, image, mask, metaData, classifiedMask);
-		if(save) saveChannels(_autoChannels, _filePrefix + "counts-channels-auto.txt");
-		freqLock.unlock();
-		
-		boost::mutex::scoped_lock timeLock(_timeMapMutex);
-		addTimesteps(_autoTimesteps, image, mask, metaData, classifiedMask);
-		if(save) {
-			saveTimesteps(_autoTimesteps, _filePrefix + "counts-timesteps-auto.txt");
-			saveTimeIntegrated(_autoTimesteps, _filePrefix + "counts-timeint-auto.txt");
-		}
-		timeLock.unlock();
-		
-		boost::mutex::scoped_lock tfLock(_tfMapMutex);
-		addTimeFrequencyInfo(_autoTimeFrequencyInfo, metaData, image, mask);
-		if(save) saveTimeFrequencyInfo(_autoTimeFrequencyInfo, _filePrefix + "counts-timefreq-auto.txt");
-		tfLock.unlock();
-	} else {
-		boost::mutex::scoped_lock genLock(_genericMutex);
-		addFeatures(_crossAmplitudes, image, mask, metaData, segmentedMask);
-		segmentedMask.reset();
-		addAmplitudes(_crossAmplitudes, image, mask, metaData, classifiedMask);
-		if(data.Polarisation() == DipolePolarisation && _polarizationAmplitudeStatistics)
-		{
-			addStokes(_crossAmplitudes, data, metaData);
-			addPolarisations(_crossAmplitudes, data, metaData);
-		}
-		if(save) saveAmplitudes(_crossAmplitudes, _filePrefix + "counts-amplitudes-cross.txt");
-		genLock.unlock();
-		
-		boost::mutex::scoped_lock freqLock(_frequencyMapMutex);
-		addChannels(_crossChannels, image, mask, metaData, classifiedMask);
-		if(save) saveChannels(_crossChannels, _filePrefix + "counts-channels-cross.txt");
-		freqLock.unlock();
-		
-		boost::mutex::scoped_lock timeLock(_timeMapMutex);
-		addTimesteps(_crossTimesteps, image, mask, metaData, classifiedMask);
-		if(save) {
-			saveTimesteps(_crossTimesteps, _filePrefix + "counts-timesteps-cross.txt");
-			saveTimeIntegrated(_crossTimesteps, _filePrefix + "counts-timeint-cross.txt");
-		}
-		timeLock.unlock();
-		
-		boost::mutex::scoped_lock tfLock(_tfMapMutex);
-		addTimeFrequencyInfo(_crossTimeFrequencyInfo, metaData, image, mask);
-		if(save) saveTimeFrequencyInfo(_crossTimeFrequencyInfo, _filePrefix + "counts-timefreq-cross.txt");
-		tfLock.unlock();
-	}
-}
-
-void RFIStatistics::Add(const ChannelInfo &channel, bool autocorrelation)
-{
-	std::map<double, ChannelInfo> *channels;
-	if(autocorrelation)
-		channels = &_autoChannels;
-	else
-		channels = &_crossChannels;
-	
-	std::map<double, ChannelInfo>::iterator element = channels->find(channel.frequencyHz);
-	if(element == channels->end())
-	{
-		channels->insert(std::pair<double, ChannelInfo>(channel.frequencyHz, channel));
-	} else {
-		ChannelInfo &c = element->second;
-		c.totalCount += channel.totalCount;
-		c.totalAmplitude += channel.totalAmplitude;
-		c.rfiCount += channel.rfiCount;
-		c.rfiAmplitude += channel.rfiAmplitude;
-		c.broadbandRfiCount += channel.broadbandRfiCount;
-		c.lineRfiCount += channel.lineRfiCount;
-		c.broadbandRfiAmplitude += channel.broadbandRfiAmplitude;
-		c.lineRfiAmplitude += channel.lineRfiAmplitude;
-		c.falsePositiveCount += channel.falsePositiveCount;
-		c.falseNegativeCount += channel.falseNegativeCount;
-		c.truePositiveCount += channel.truePositiveCount;
-		c.trueNegativeCount += channel.trueNegativeCount;
-		c.falsePositiveAmplitude += channel.falsePositiveAmplitude;
-		c.falseNegativeAmplitude += channel.falseNegativeAmplitude;
-	}
-}
-
-void RFIStatistics::Add(const TimestepInfo &timestep, bool autocorrelation)
-{
-	std::map<double, TimestepInfo> *timesteps;
-	if(autocorrelation)
-		timesteps = &_autoTimesteps;
-	else
-		timesteps = &_crossTimesteps;
-	
-	std::map<double, TimestepInfo>::iterator element = timesteps->find(timestep.time);
-	if(element == timesteps->end())
-	{
-		timesteps->insert(std::pair<double, TimestepInfo>(timestep.time, timestep));
-	} else {
-		TimestepInfo &t = element->second;
-		t.totalCount += timestep.totalCount;
-		t.totalAmplitude += timestep.totalAmplitude;
-		t.rfiCount += timestep.rfiCount;
-		t.rfiAmplitude += timestep.rfiAmplitude;
-		t.broadbandRfiCount += timestep.broadbandRfiCount;
-		t.lineRfiCount += timestep.lineRfiCount;
-		t.broadbandRfiAmplitude += timestep.broadbandRfiAmplitude;
-		t.lineRfiAmplitude += timestep.lineRfiAmplitude;
-	}
-}
-
-void RFIStatistics::Add(const AmplitudeBin &amplitudeBin, bool autocorrelation)
-{
-	std::map<double, AmplitudeBin> *amplitudes;
-	if(autocorrelation)
-		amplitudes = &_autoAmplitudes;
-	else
-		amplitudes = &_crossAmplitudes;
-	
-	std::map<double, AmplitudeBin>::iterator element = amplitudes->find(amplitudeBin.centralAmplitude);
-	if(element == amplitudes->end())
-	{
-		amplitudes->insert(std::pair<double, AmplitudeBin>(amplitudeBin.centralAmplitude, amplitudeBin));
-	} else {
-		AmplitudeBin &a = element->second;
-		a.count += amplitudeBin.count;
-		a.rfiCount += amplitudeBin.rfiCount;
-		a.broadbandRfiCount += amplitudeBin.broadbandRfiCount;
-		a.lineRfiCount += amplitudeBin.lineRfiCount;
-		a.featureAvgCount += amplitudeBin.featureAvgCount;
-		a.featureMaxCount += amplitudeBin.featureMaxCount;
-		a.featureIntCount += amplitudeBin.featureIntCount;
-		a.xxCount += amplitudeBin.xxCount;
-		a.xyCount += amplitudeBin.xyCount;
-		a.yxCount += amplitudeBin.yxCount;
-		a.yyCount += amplitudeBin.yyCount;
-		a.xxRfiCount += amplitudeBin.xxRfiCount;
-		a.xyRfiCount += amplitudeBin.xyRfiCount;
-		a.yxRfiCount += amplitudeBin.yxRfiCount;
-		a.yyRfiCount += amplitudeBin.yyRfiCount;
-		a.falsePositiveCount += amplitudeBin.falsePositiveCount;
-		a.falseNegativeCount += amplitudeBin.falseNegativeCount;
-		a.truePositiveCount += amplitudeBin.truePositiveCount;
-		a.trueNegativeCount += amplitudeBin.trueNegativeCount;
-	}
-}
-
-void RFIStatistics::Add(const BaselineInfo &baseline)
-{
-	BaselineMatrix::iterator rowElement = _baselines.find(baseline.antenna1);
-	if(rowElement == _baselines.end())
-	{
-		_baselines.insert(BaselineMatrix::value_type(baseline.antenna1, std::map<int, BaselineInfo>()));
-		rowElement = _baselines.find(baseline.antenna1);
-	}
-	
-	std::map<int, BaselineInfo> &row = rowElement->second;
-	std::map<int, BaselineInfo>::iterator element = row.find(baseline.antenna2);
-	if(element == row.end())
-	{
-		row.insert(std::pair<int, BaselineInfo>(baseline.antenna2, baseline));
-	} else {
-		BaselineInfo &b = element->second;
-		b.count += baseline.count;
-		b.totalAmplitude += baseline.totalAmplitude;
-		b.rfiCount += baseline.rfiCount;
-		b.rfiAmplitude += baseline.rfiAmplitude;
-		b.broadbandRfiCount += baseline.broadbandRfiCount;
-		b.lineRfiCount += baseline.lineRfiCount;
-		b.broadbandRfiAmplitude += baseline.broadbandRfiAmplitude;
-		b.lineRfiAmplitude += baseline.lineRfiAmplitude;
-	}
-}
-
-void RFIStatistics::Add(const BaselineFrequencyInfo &entry)
-{
-	IndexTriple index;
-	index.antenna1Index = entry.antenna1Index;
-	index.antenna2Index = entry.antenna2Index;
-	index.thirdIndex = entry.centralFrequency;
-	BaselineFrequencyInfoMap::iterator element = _baselineFrequencyInfo.find(index);
-	if(element == _baselineFrequencyInfo.end())
-	{
-		_baselineFrequencyInfo.insert(std::pair<IndexTriple, BaselineFrequencyInfo>(index, entry));
-	} else {
-		BaselineFrequencyInfo &info = element->second;
-		info.totalCount += entry.totalCount;
-		info.rfiCount += entry.rfiCount;
-	}
-}
-
-void RFIStatistics::Add(const BaselineTimeInfo &entry)
-{
-	IndexTriple index;
-	index.antenna1Index = entry.antenna1Index;
-	index.antenna2Index = entry.antenna2Index;
-	index.thirdIndex = entry.time;
-	BaselineTimeInfoMap::iterator element = _baselineTimeInfo.find(index);
-	if(element == _baselineTimeInfo.end())
-	{
-		_baselineTimeInfo.insert(std::pair<IndexTriple, BaselineTimeInfo>(index, entry));
-	} else {
-		BaselineTimeInfo &info = element->second;
-		info.totalCount += entry.totalCount;
-		info.rfiCount += entry.rfiCount;
-	}
-}
-
-void RFIStatistics::Add(const TimeFrequencyInfo &entry, bool autocorrelation)
-{
-	TimeFrequencyInfoMap *timeFrequencyInfo;
-	if(autocorrelation)
-		timeFrequencyInfo = &_autoTimeFrequencyInfo;
-	else
-		timeFrequencyInfo = &_crossTimeFrequencyInfo;
-	
-	std::pair<double, double> index;
-	index.first = entry.time;
-	index.second = entry.centralFrequency;
-	TimeFrequencyInfoMap::iterator element = timeFrequencyInfo->find(index);
-	if(element == timeFrequencyInfo->end())
-	{
-		timeFrequencyInfo->insert(std::pair<std::pair<double, double>, TimeFrequencyInfo>(index, entry));
-	} else {
-		TimeFrequencyInfo &info = element->second;
-		info.totalCount += entry.totalCount;
-		info.rfiCount += entry.rfiCount;
-		info.totalAmplitude += entry.totalAmplitude;
-		info.rfiAmplitude += entry.rfiAmplitude;
-	}
-}
-
-void RFIStatistics::addChannels(std::map<double, class ChannelInfo> &channels, Image2DCPtr image, Mask2DCPtr mask, TimeFrequencyMetaDataCPtr metaData, SegmentedImageCPtr segmentedImage)
-{
-	for(size_t y=startChannel(image->Height());y<image->Height();++y)
-	{
-		long unsigned count = 0;
-		long double totalAmplitude = 0.0;
-		long unsigned rfiCount = 0;
-		long double rfiAmplitude = 0.0;
-		long unsigned broadbandRfiCount = 0;
-		long unsigned lineRfiCount = 0;
-		long double broadbandRfiAmplitude = 0.0;
-		long double lineRfiAmplitude = 0.0;
-		
-		for(size_t x=0;x<image->Width();++x)
-		{
-			if(std::isfinite(image->Value(x, y)))
-			{
-				totalAmplitude += image->Value(x, y);
-				++count;
-				if(mask->Value(x, y))
-				{
-					++rfiCount;
-					rfiAmplitude += image->Value(x, y);
-					if(segmentedImage->Value(x, y) == Morphology::BROADBAND_SEGMENT)
-					{
-						++broadbandRfiCount;
-						broadbandRfiAmplitude += image->Value(x, y);
-					} else if(segmentedImage->Value(x, y) == Morphology::LINE_SEGMENT)
-					{
-						++lineRfiCount;
-						lineRfiAmplitude += image->Value(x, y);
-					}
-				}
-			}
-		}
-		if(channels.count(metaData->Band().channels[y].frequencyHz) == 0)
-		{
-			ChannelInfo channel(metaData->Band().channels[y].frequencyHz);
-			channel.totalCount = count;
-			channel.totalAmplitude = totalAmplitude;
-			channel.rfiCount = rfiCount;
-			channel.rfiAmplitude = rfiAmplitude;
-			channel.broadbandRfiCount = broadbandRfiCount;
-			channel.lineRfiCount = lineRfiCount;
-			channel.broadbandRfiAmplitude = broadbandRfiAmplitude;
-			channel.lineRfiAmplitude = lineRfiAmplitude;
-			channels.insert(std::pair<double, ChannelInfo>(channel.frequencyHz, channel));
-		} else {
-			ChannelInfo &channel = channels.find(metaData->Band().channels[y].frequencyHz)->second;
-			channel.totalCount += count;
-			channel.totalAmplitude += totalAmplitude;
-			channel.rfiCount += rfiCount;
-			channel.rfiAmplitude += rfiAmplitude;
-			channel.broadbandRfiCount += broadbandRfiCount;
-			channel.lineRfiCount += lineRfiCount;
-			channel.broadbandRfiAmplitude += broadbandRfiAmplitude;
-			channel.lineRfiAmplitude += lineRfiAmplitude;
-		}
-	}
-}
-
-void RFIStatistics::addTimesteps(std::map<double, class TimestepInfo> &timesteps, Image2DCPtr image, Mask2DCPtr mask, TimeFrequencyMetaDataCPtr metaData, SegmentedImageCPtr segmentedImage)
-{
-	for(size_t x=0;x<image->Width();++x)
-	{
-		long unsigned totalCount = 0;
-		long double totalAmplitude = 0.0;
-		long unsigned rfiCount = 0;
-		long double rfiAmplitude = 0.0;
-		long unsigned broadbandRfiCount = 0;
-		long unsigned lineRfiCount = 0;
-		long double broadbandRfiAmplitude = 0.0;
-		long double lineRfiAmplitude = 0.0;
-		
-		for(size_t y=startChannel(image->Height());y<image->Height();++y)
-		{
-			if(std::isfinite(image->Value(x, y)))
-			{
-				++totalCount;
-				totalAmplitude += image->Value(x, y);
-
-				if(mask->Value(x, y))
-				{
-					++rfiCount;
-					rfiAmplitude += image->Value(x, y);
-					if(segmentedImage->Value(x, y) == Morphology::BROADBAND_SEGMENT)
-					{
-						++broadbandRfiCount;
-						broadbandRfiAmplitude += image->Value(x, y);
-					} else if(segmentedImage->Value(x, y) == Morphology::LINE_SEGMENT)
-					{
-						++lineRfiCount;
-						lineRfiAmplitude += image->Value(x, y);
-					}
-				}
-			}
-		}
-		if(timesteps.count(metaData->ObservationTimes()[x]) == 0)
-		{
-			TimestepInfo timestep(metaData->ObservationTimes()[x]);
-			timestep.totalCount = totalCount;
-			timestep.totalAmplitude = totalAmplitude;
-			timestep.rfiCount = rfiCount;
-			timestep.rfiAmplitude = rfiAmplitude;
-			timestep.broadbandRfiCount = broadbandRfiCount;
-			timestep.lineRfiCount = lineRfiCount;
-			timestep.broadbandRfiAmplitude = broadbandRfiAmplitude;
-			timestep.lineRfiAmplitude = lineRfiAmplitude;
-			timesteps.insert(std::pair<double, TimestepInfo>(timestep.time, timestep));
-		} else {
-			TimestepInfo &timestep = timesteps.find(metaData->ObservationTimes()[x])->second;
-			timestep.totalCount += totalCount;
-			timestep.totalAmplitude += totalAmplitude;
-			timestep.rfiCount += rfiCount;
-			timestep.rfiAmplitude += rfiAmplitude;
-			timestep.broadbandRfiCount += broadbandRfiCount;
-			timestep.lineRfiCount += lineRfiCount;
-			timestep.broadbandRfiAmplitude += broadbandRfiAmplitude;
-			timestep.lineRfiAmplitude += lineRfiAmplitude;
-		}
-	}
-}
-
-void RFIStatistics::addAmplitudes(std::map<double, class AmplitudeBin> &amplitudes, Image2DCPtr image, Mask2DCPtr mask, TimeFrequencyMetaDataCPtr, SegmentedImageCPtr segmentedImage)
-{
-	for(size_t y=startChannel(image->Height());y<image->Height();++y)
-	{
-		for(size_t x=0;x<image->Width();++x)
-		{
-			double amp = image->Value(x, y);
-			if(std::isfinite(amp))
-			{
-				double centralAmp = getCentralAmplitude(amp);
-				std::map<double, class AmplitudeBin>::iterator element =
-					amplitudes.find(centralAmp);
-				
-				AmplitudeBin bin;
-				if(element == amplitudes.end())
-				{
-					bin.centralAmplitude = centralAmp;
-				} else {
-					bin = element->second;
-				}
-				++bin.count;
-				if(mask->Value(x, y))
-				{
-					++bin.rfiCount;
-					if(segmentedImage->Value(x, y) == Morphology::BROADBAND_SEGMENT)
-					{
-						++bin.broadbandRfiCount;
-					} else if(segmentedImage->Value(x, y) == Morphology::LINE_SEGMENT)
-					{
-						++bin.lineRfiCount;
-					}
-				}
-				if(element == amplitudes.end())
-					amplitudes.insert(std::pair<double, AmplitudeBin>(centralAmp, bin));
-				else
-					element->second = bin;
-			}
-		}
-	}
-}
-
-void RFIStatistics::addStokes(std::map<double, class AmplitudeBin> &amplitudes, const TimeFrequencyData &data, TimeFrequencyMetaDataCPtr)
-{
-	for(unsigned i=0;i<3;++i)
-	{
-		TimeFrequencyData *stokes;
-		switch(i)
-		{
-			case 0: stokes = data.CreateTFData(StokesQPolarisation); break;
-			case 1: stokes = data.CreateTFData(StokesUPolarisation); break;
-			case 2: stokes = data.CreateTFData(StokesVPolarisation); break;
-			default: stokes = 0; break;
-		}
-		Image2DCPtr image = stokes->GetSingleImage();
-		delete stokes;
-		for(size_t y=startChannel(image->Height());y<image->Height();++y)
-		{
-			for(size_t x=0;x<image->Width();++x)
-			{
-				double amp = image->Value(x, y);
-				if(std::isfinite(amp))
-				{
-					double centralAmp = getCentralAmplitude(amp);
-					std::map<double, class AmplitudeBin>::iterator element =
-						amplitudes.find(centralAmp);
-					
-					AmplitudeBin bin;
-					if(element == amplitudes.end())
-					{
-						bin.centralAmplitude = centralAmp;
-					} else {
-						bin = element->second;
-					}
-					switch(i)
-					{
-						case 0: ++bin.stokesQCount; break;
-						case 1: ++bin.stokesUCount; break;
-						case 2: ++bin.stokesVCount; break;
-					}
-					if(element == amplitudes.end())
-						amplitudes.insert(std::pair<double, AmplitudeBin>(centralAmp, bin));
-					else
-						element->second = bin;
-				}
-			}
-		}
-	}
-}
-
-void RFIStatistics::addPolarisations(std::map<double, class AmplitudeBin> &amplitudes, const TimeFrequencyData &data, TimeFrequencyMetaDataCPtr)
-{
-	for(size_t polIndex=0;polIndex<data.PolarisationCount();++polIndex)
-	{
-		TimeFrequencyData *polData = data.CreateTFDataFromPolarisationIndex(polIndex);
-		Image2DCPtr image = polData->GetSingleImage();
-		Mask2DCPtr mask = polData->GetSingleMask();
-		delete polData;
-		
-		for(size_t y=startChannel(image->Height());y<image->Height();++y)
-		{
-			for(size_t x=0;x<image->Width();++x)
-			{
-				double amp = image->Value(x, y);
-				if(std::isfinite(amp))
-				{
-					double centralAmp = getCentralAmplitude(amp);
-					std::map<double, class AmplitudeBin>::iterator element =
-						amplitudes.find(centralAmp);
-					
-					AmplitudeBin bin;
-					if(element == amplitudes.end())
-					{
-						bin.centralAmplitude = centralAmp;
-					} else {
-						bin = element->second;
-					}
-					switch(polIndex)
-					{
-						case 0: ++bin.xxCount; break;
-						case 1: ++bin.xyCount; break;
-						case 2: ++bin.yxCount; break;
-						case 3: ++bin.yyCount; break;
-					}
-					if(mask->Value(x, y))
-					{
-						switch(polIndex)
-						{
-							case 0: ++bin.xxRfiCount; break;
-							case 1: ++bin.xyRfiCount; break;
-							case 2: ++bin.yxRfiCount; break;
-							case 3: ++bin.yyRfiCount; break;
-						}
-					}
-					if(element == amplitudes.end())
-						amplitudes.insert(std::pair<double, AmplitudeBin>(centralAmp, bin));
-					else
-						element->second = bin;
-				}
-			}
-		}
-	}
-}
-
-void RFIStatistics::addBaselines(const TimeFrequencyData &data, TimeFrequencyMetaDataCPtr metaData, Image2DCPtr image, Mask2DCPtr mask, SegmentedImagePtr segmentedMask, SegmentedImagePtr classifiedMask)
-{
-	long unsigned count = 0;
-	long unsigned rfiCount = 0;
-	long double totalAmplitude = 0.0;
-	long double rfiAmplitude = 0.0;
-	long unsigned broadbandRfiCount = 0;
-	long unsigned lineRfiCount = 0;
-	long double broadbandRfiAmplitude = 0.0;
-	long double lineRfiAmplitude = 0.0;
-
-	for(size_t y=startChannel(image->Height());y<image->Height();++y)
-	{
-		for(size_t x=0;x<image->Width();++x)
-		{
-			if(std::isfinite(image->Value(x, y)))
-			{
-				++count;
-				totalAmplitude += image->Value(x, y);
-				if(mask->Value(x, y))
-				{
-					++rfiCount;
-					rfiAmplitude += image->Value(x, y);
-					if(classifiedMask->Value(x, y) == Morphology::BROADBAND_SEGMENT)
-					{
-						++broadbandRfiCount;
-						broadbandRfiAmplitude += image->Value(x, y);
-					} else if(classifiedMask->Value(x, y) == Morphology::LINE_SEGMENT)
-					{
-						++lineRfiCount;
-						lineRfiAmplitude += image->Value(x, y);
-					}
-				}
-			}
-		}
-	}
-	int a1, a2;
-	if(metaData->HasAntenna1())
-		a1 = metaData->Antenna1().id;
-	else
-		a1 = 0;
-	if(metaData->HasAntenna2())
-		a2 = metaData->Antenna2().id;
-	else
-		a2 = 0;
-	if(_baselines.count(a1) == 0)
-		_baselines.insert(BaselineMatrix::value_type(a1, std::map<int, BaselineInfo>() ));
-	BaselineMatrix::mapped_type &row = _baselines.find(a1)->second;
-	
-	Baseline baselineMSData;
-	if(metaData->HasAntenna1() && metaData->HasAntenna2())
-		baselineMSData = Baseline(metaData->Antenna1(), metaData->Antenna2());
-
-	if(row.count(a2) == 0)
-	{
-		BaselineInfo baseline;
-		baseline.antenna1 = a1;
-		baseline.antenna2 = a2;
-		if(metaData->HasAntenna1())
-			baseline.antenna1Name = metaData->Antenna1().name;
-		if(metaData->HasAntenna2())
-			baseline.antenna2Name = metaData->Antenna2().name;
-		baseline.baselineLength = baselineMSData.Distance();
-		baseline.baselineAngle = baselineMSData.Angle();
-
-		baseline.count = count;
-		baseline.totalAmplitude = totalAmplitude;
-		baseline.rfiCount = rfiCount;
-		baseline.rfiAmplitude = rfiAmplitude;
-		baseline.broadbandRfiCount = broadbandRfiCount;
-		baseline.lineRfiCount = lineRfiCount;
-		baseline.broadbandRfiAmplitude = broadbandRfiAmplitude;
-		baseline.lineRfiAmplitude = lineRfiAmplitude;
-		if(_separateBaselineStatistics)
-		{
-			baseline.baselineStatistics = new RFIStatistics();
-			baseline.baselineStatistics->addSingleBaseline(data, metaData, image, mask, segmentedMask, classifiedMask, false);
-		}
-		row.insert(std::pair<int, BaselineInfo>(a2, baseline));
-	} else {
-		BaselineInfo &baseline = row.find(a2)->second;
-		baseline.count += count;
-		baseline.totalAmplitude += totalAmplitude;
-		baseline.rfiCount += rfiCount;
-		baseline.rfiAmplitude += rfiAmplitude;
-		baseline.broadbandRfiCount += broadbandRfiCount;
-		baseline.lineRfiCount += lineRfiCount;
-		baseline.broadbandRfiAmplitude += broadbandRfiAmplitude;
-		baseline.lineRfiAmplitude += lineRfiAmplitude;
-		if(_separateBaselineStatistics)
-		{
-			baseline.baselineStatistics->addSingleBaseline(data, metaData, image, mask, segmentedMask, classifiedMask, false);
-		}
-	}
-}
-
-void RFIStatistics::addFeatures(std::map<double, class AmplitudeBin> &amplitudes, Image2DCPtr image, Mask2DCPtr mask, TimeFrequencyMetaDataCPtr, SegmentedImageCPtr segmentedImage)
-{
-	FeatureMap features;
-	
-	for(size_t y=startChannel(image->Height());y<image->Height();++y) {
-		for(size_t x=0;x<image->Width();++x) {
-			if(mask->Value(x, y) && std::isfinite(image->Value(x, y)))
-			{
-				FeatureMap::iterator i = features.find(segmentedImage->Value(x, y));
-				if(i == features.end()) {
-					FeatureInfo newFeature;
-					newFeature.amplitudeSum = image->Value(x, y);
-					newFeature.amplitudeMax = image->Value(x, y);
-					newFeature.sampleCount = 1;
-					features.insert(FeatureMap::value_type(segmentedImage->Value(x, y), newFeature));
-				} else {
-					FeatureInfo &feature = i->second;
-					num_t sampleValue = image->Value(x, y);
-					feature.amplitudeSum += sampleValue;
-					if(sampleValue > feature.amplitudeMax)
-						feature.amplitudeMax = sampleValue;
-					feature.sampleCount++;
-				}
-			}
-		}
-	}
-	for(FeatureMap::const_iterator i=features.begin();i!=features.end();++i)
-	{
-		const FeatureInfo &feature = i->second;
-		double intBin = getCentralAmplitude(feature.amplitudeSum);
-		double avgBin = getCentralAmplitude(feature.amplitudeSum / feature.sampleCount);
-		double maxBin = getCentralAmplitude(feature.amplitudeMax);
-		if(amplitudes.count(intBin) == 0)
-		{
-			AmplitudeBin bin;
-			bin.centralAmplitude = intBin;
-			bin.featureIntCount=1;
-			amplitudes.insert(std::pair<double, AmplitudeBin>(intBin, bin));
-		} else {
-			amplitudes[intBin].featureIntCount++;
-		}
-		if(amplitudes.count(avgBin) == 0)
-		{
-			AmplitudeBin bin;
-			bin.centralAmplitude = avgBin;
-			bin.featureAvgCount=1;
-			amplitudes.insert(std::pair<double, AmplitudeBin>(avgBin, bin));
-		} else {
-			amplitudes[avgBin].featureAvgCount++;
-		}
-		if(amplitudes.count(maxBin) == 0)
-		{
-			AmplitudeBin bin;
-			bin.centralAmplitude = maxBin;
-			bin.featureMaxCount=1;
-			amplitudes.insert(std::pair<double, AmplitudeBin>(maxBin, bin));
-		} else {
-			amplitudes[maxBin].featureMaxCount++;
-		}
-	}
-}
-
-void RFIStatistics::addChannelComparison(std::map<double, ChannelInfo> &channels, const TimeFrequencyData &data, TimeFrequencyMetaDataCPtr metaData, Mask2DCPtr groundTruthFlagging)
-{
-	Image2DCPtr image = data.GetSingleImage();
-	Mask2DCPtr mask = data.GetSingleMask();
-
-	for(size_t y=startChannel(image->Height());y<image->Height();++y)
-	{
-		long unsigned falsePositiveCount = 0;
-		long unsigned falseNegativeCount = 0;
-		long unsigned truePositiveCount = 0;
-		long unsigned trueNegativeCount = 0;
-		long double falsePositiveAmplitude = 0;
-		long double falseNegativeAmplitude = 0;
-		
-		for(size_t x=0;x<image->Width();++x)
-		{
-			if(std::isfinite(image->Value(x, y)))
-			{
-				if(mask->Value(x,y) && groundTruthFlagging->Value(x,y))
-					++truePositiveCount;
-				else if(!mask->Value(x,y) && !groundTruthFlagging->Value(x,y))
-					++trueNegativeCount;
-				else if(mask->Value(x,y) && !groundTruthFlagging->Value(x,y))
-				{
-					++falsePositiveCount;
-					falsePositiveAmplitude += image->Value(x, y);
-				}
-				else // !mask->Value(x,y) && groundTruthFlagging->Value(x,y)
-				{
-					++falseNegativeCount;
-					falseNegativeAmplitude += image->Value(x, y);
-				}
-			}
-		}
-		ChannelInfo &channel = channels.find(metaData->Band().channels[y].frequencyHz)->second;
-		channel.falsePositiveCount += falsePositiveCount;
-		channel.falseNegativeCount += falseNegativeCount;
-		channel.truePositiveCount += truePositiveCount;
-		channel.trueNegativeCount += trueNegativeCount;
-		channel.falsePositiveAmplitude += falsePositiveAmplitude;
-		channel.falseNegativeAmplitude += falseNegativeAmplitude;
-	}
-}
-
-void RFIStatistics::addAmplitudeComparison(std::map<double, AmplitudeBin> &amplitudes, const TimeFrequencyData &data, TimeFrequencyMetaDataCPtr, Mask2DCPtr groundTruthFlagging)
-{
-	Image2DCPtr image = data.GetSingleImage();
-	Mask2DCPtr mask = data.GetSingleMask();
-
-	for(size_t y=startChannel(image->Height());y<image->Height();++y)
-	{
-		for(size_t x=0;x<image->Width();++x)
-		{
-			double amp = image->Value(x, y);
-			if(std::isfinite(amp))
-			{
-				double centralAmp = getCentralAmplitude(amp);
-				std::map<double, class AmplitudeBin>::iterator element =
-					amplitudes.find(centralAmp);
-				
-				AmplitudeBin bin;
-				if(element == amplitudes.end())
-				{
-					bin.centralAmplitude = centralAmp;
-				} else {
-					bin = element->second;
-				}
-				if(mask->Value(x,y) && groundTruthFlagging->Value(x,y))
-					++bin.truePositiveCount;
-				else if(!mask->Value(x,y) && !groundTruthFlagging->Value(x,y))
-					++bin.trueNegativeCount;
-				else if(mask->Value(x,y) && !groundTruthFlagging->Value(x,y))
-					++bin.falsePositiveCount;
-				else // !mask->Value(x,y) && groundTruthFlagging->Value(x,y)
-					++bin.falseNegativeCount;
-				if(element == amplitudes.end())
-					amplitudes.insert(std::pair<double, AmplitudeBin>(centralAmp, bin));
-				else
-					amplitudes.find(centralAmp)->second = bin;
-			}
-		}
-	}
-}
-
-void RFIStatistics::addBaselineFrequencyInfo(TimeFrequencyMetaDataCPtr metaData, Image2DCPtr image, Mask2DCPtr mask)
-{
-	IndexTriple index;
-	if(metaData->HasAntenna1())
-		index.antenna1Index = metaData->Antenna1().id;
-	else
-		index.antenna1Index = 0;
-	if(metaData->HasAntenna2())
-		index.antenna2Index = metaData->Antenna2().id;
-	else
-		index.antenna2Index = 0;
-	index.thirdIndex = (metaData->Band().channels.begin()->frequencyHz + metaData->Band().channels.rbegin()->frequencyHz) / 2.0;
-	std::map<IndexTriple, BaselineFrequencyInfo>::iterator element = _baselineFrequencyInfo.find(index);
-	if(element == _baselineFrequencyInfo.end())
-	{
-		BaselineFrequencyInfo newInfo;
-		newInfo.centralFrequency = index.thirdIndex;
-		newInfo.antenna1Index = index.antenna1Index;
-		newInfo.antenna2Index = index.antenna2Index;
-		element = _baselineFrequencyInfo.insert(std::pair<IndexTriple, BaselineFrequencyInfo>(index, newInfo)).first;
-	}
-	for(size_t y=startChannel(image->Height());y<image->Height();++y)
-	{
-		for(size_t x=0;x<image->Width();++x)
-		{
-			if(std::isfinite(image->Value(x, y)))
-			{
-				++element->second.totalCount;
-				if(mask->Value(x, y))
-					++element->second.rfiCount;
-			}
-		}
-	}
-}
-
-void RFIStatistics::addBaselineTimeInfo(TimeFrequencyMetaDataCPtr metaData, Image2DCPtr image, Mask2DCPtr mask)
-{
-	IndexTriple index;
-	if(metaData->HasAntenna1())
-		index.antenna1Index = metaData->Antenna1().id;
-	else
-		index.antenna1Index = 0;
-	if(metaData->HasAntenna2())
-		index.antenna2Index = metaData->Antenna2().id;
-	else
-		index.antenna2Index = 0;
-	//double timeStart = metaData->ObservationTimes()[0];
-	//double duration = metaData->ObservationTimes()[image->Width()-1] - timeStart;
-	for(size_t x=0;x<image->Width();++x)
-	{
-		double time = metaData->ObservationTimes()[x];
-		//double timePos = timeStart + round((double) x * 1000.0 / (double) image->Width()) / 1000.0 * duration;
-		index.thirdIndex = time;
-		std::map<IndexTriple, BaselineTimeInfo>::iterator element = _baselineTimeInfo.find(index);
-		if(element == _baselineTimeInfo.end())
-		{
-			BaselineTimeInfo newInfo;
-			newInfo.time = index.thirdIndex;
-			newInfo.antenna1Index = index.antenna1Index;
-			newInfo.antenna2Index = index.antenna2Index;
-			element = _baselineTimeInfo.insert(std::pair<IndexTriple, BaselineTimeInfo>(index, newInfo)).first;
-		}
-		for(size_t y=startChannel(image->Height());y<image->Height();++y)
-		{
-			if(std::isfinite(image->Value(x, y)))
-			{
-				++element->second.totalCount;
-				if(mask->Value(x, y))
-					++element->second.rfiCount;
-			}
-		}
-	}
-}
-
-void RFIStatistics::addTimeFrequencyInfo(TimeFrequencyInfoMap &map, TimeFrequencyMetaDataCPtr metaData, Image2DCPtr image, Mask2DCPtr mask)
-{
-	double centralFrequency = (metaData->Band().channels.begin()->frequencyHz + metaData->Band().channels.rbegin()->frequencyHz) / 2.0;
-	
-	for(size_t x=0;x<image->Width();++x)
-	{
-		double time = metaData->ObservationTimes()[x];
-		std::pair<double, double> index(time, centralFrequency);
-		
-		TimeFrequencyInfoMap::iterator element = map.find(index);
-		if(element == map.end())
-		{
-			TimeFrequencyInfo newInfo;
-			newInfo.time = index.first;
-			newInfo.centralFrequency = index.second;
-			element = map.insert(std::pair<std::pair<double, double>, TimeFrequencyInfo>(index, newInfo)).first;
-		}
-		for(size_t y=startChannel(image->Height());y<image->Height();++y)
-		{
-			const num_t amplitude = image->Value(x, y);
-			if(std::isfinite(amplitude))
-			{
-				++element->second.totalCount;
-				element->second.totalAmplitude += amplitude;
-				if(mask->Value(x, y))
-				{
-					++element->second.rfiCount;
-					element->second.rfiAmplitude += amplitude;
-				}
-			}
-		}
-	}
-}
-
-void RFIStatistics::saveChannels(const std::map<double, ChannelInfo> &channels, const std::string &filename)
-{
-	std::ofstream file(filename.c_str());
-	file << "frequency\ttotalCount\ttotalAmplitude\trfiCount\trfiSummedAmplitude\tbroadbandRfiCount\tlineRfiCount\tbroadbandRfiAmplitude\tlineRfiAmplitude\tFalse P\tFalse N\tTrue P\tTrue N\tFalse P amp\tFalse N amp\n" << std::setprecision(14);
-	for(std::map<double, class ChannelInfo>::const_iterator i=channels.begin();i!=channels.end();++i)
-	{
-		const ChannelInfo &c = i->second;
-		file
-			<< c.frequencyHz << "\t"
-			<< c.totalCount << "\t"
-			<< c.totalAmplitude << "\t"
-			<< c.rfiCount << "\t"
-			<< c.rfiAmplitude << "\t"
-			<< c.broadbandRfiCount << "\t"
-			<< c.lineRfiCount << "\t"
-			<< c.broadbandRfiAmplitude << "\t"
-			<< c.lineRfiAmplitude << "\t"
-			<< c.falsePositiveCount << "\t"
-			<< c.falseNegativeCount << "\t"
-			<< c.truePositiveCount << "\t"
-			<< c.trueNegativeCount << "\t"
-			<< c.falsePositiveAmplitude << "\t"
-			<< c.falseNegativeAmplitude
-			<< "\n";
-	}
-	file.close();
-}
-
-void RFIStatistics::saveTimesteps(const std::map<double, class TimestepInfo> &timesteps, const std::string &filename)
-{
-	std::ofstream file(filename.c_str());
-	file << "timestep\ttotalCount\ttotalAmplitude\trfiCount\trfiAmplitude\tbroadbandRfiCount\tlineRfiCount\tbroadbandRfiAmplitude\tlineRfiAmplitude\n" << std::setprecision(14);
-	for(std::map<double, class TimestepInfo>::const_iterator i=timesteps.begin();i!=timesteps.end();++i)
-	{
-		const TimestepInfo &c = i->second;
-		file
-			<< c.time << "\t"
-			<< c.totalCount << "\t"
-			<< c.totalAmplitude << "\t"
-			<< c.rfiCount << "\t"
-			<< c.rfiAmplitude << "\t"
-			<< c.broadbandRfiCount << "\t"
-			<< c.lineRfiCount << "\t"
-			<< c.broadbandRfiAmplitude << "\t"
-			<< c.lineRfiAmplitude << "\n";
-	}
-	file.close();
-}
-
-void RFIStatistics::saveSubbands(const std::map<double, class ChannelInfo> &channels, const std::string &filename)
-{
-	std::ofstream file(filename.c_str());
-	file <<
-		"subband\ts-frequency\te-frequency\ttotalCount\ttotalAmplitude\trfiCount\t"
-		"rfiSummedAmplitude\tbroadbandRfiCount\tlineRfiCount\tbroadbandRfiAmplitude\tlineRfiAmplitude\t"
-		"False P\tFalse N\tTrue P\tTrue N\tFalse P amp\tFalse N amp\t"
-		"totalCountLQ\ttotalCountUQ\ttotalAmplitudeLQ\ttotalAmplitudeUQ\trfiCountLQ\trfiCountUQ\t"
-		"rfiSummedAmplitudeLQ\trfiSummedAmplitudeUQ\tbroadbandRfiCountLQ\tbroadbandRfiCountUQ\t"
-		"lineRfiCountLQ\tlineRfiCountUQ\tbroadbandRfiAmplitudeLQ\tbroadbandRfiAmplitudeUQ\t"
-		"lineRfiAmplitudeLQ\tlineRfiAmplitudeUQ\n"
-	<< std::setprecision(14);
-	size_t index = 0;
-	std::multiset<double>
-		bandTotals,
-		bandAmps,
-		bandRFIs,
-		bandRFIAmps,
-		bandBRFIs,
-		bandLRFIs,
-		bandBRFIAmps,
-		bandLRFIAmps,
-		bandFP,
-		bandFN,
-		bandTP,
-		bandTN,
-		bandFPAmps,
-		bandFNAmps;
-	unsigned countPerSubband = _channelCountPerSubband;
-	if(_ignoreFirstChannel) --countPerSubband;
-	for(std::map<double, class ChannelInfo>::const_iterator i=channels.begin();i!=channels.end();++i)
-	{
-		const ChannelInfo &c = i->second;
-		bandTotals.insert(c.totalCount);
-		bandAmps.insert(c.totalAmplitude);
-		bandRFIs.insert(c.rfiCount);
-		bandRFIAmps.insert(c.rfiAmplitude);
-		bandBRFIs.insert(c.broadbandRfiCount);
-		bandLRFIs.insert(c.lineRfiCount);
-		bandBRFIAmps.insert(c.broadbandRfiAmplitude);
-		bandLRFIAmps.insert(c.lineRfiAmplitude);
-		bandFP.insert(c.falsePositiveCount);
-		bandFN.insert(c.falseNegativeCount);
-		bandTP.insert(c.truePositiveCount);
-		bandTN.insert(c.trueNegativeCount);
-		bandFPAmps.insert(c.falsePositiveAmplitude);
-		bandFNAmps.insert(c.falseNegativeAmplitude);
-		if(index%countPerSubband == 0)
-			file << index/countPerSubband << '\t' << c.frequencyHz << '\t';
-		if(index%countPerSubband == (countPerSubband-1))
-		{
-			file
-			<< c.frequencyHz << "\t"
-			<< avg(bandTotals) << "\t" // 4
-			<< avg(bandAmps) << "\t"
-			<< avg(bandRFIs) << "\t"
-			<< avg(bandRFIAmps) << "\t"
-			<< avg(bandBRFIs) << "\t"
-			<< avg(bandLRFIs) << "\t"
-			<< avg(bandBRFIAmps) << "\t"
-			<< avg(bandLRFIAmps) << "\t"
-			<< avg(bandFP) << "\t"
-			<< avg(bandFN) << "\t"
-			<< avg(bandTP) << "\t"
-			<< avg(bandTN) << "\t"
-			<< avg(bandFPAmps) << "\t"
-			<< avg(bandFNAmps) << "\t" // 17
-			<< lowerQuartile(bandTotals) << "\t" << median(bandTotals) << "\t" << upperQuartile(bandTotals) << "\t"
-			<< lowerQuartile(bandAmps) << "\t" << median(bandAmps) << "\t" << upperQuartile(bandAmps) << "\t"
-			<< lowerQuartile(bandRFIs) << "\t" << median(bandRFIs) << "\t" << upperQuartile(bandRFIs) << "\t"
-			<< lowerQuartile(bandRFIAmps) << "\t" << median(bandRFIAmps) << "\t" << upperQuartile(bandRFIAmps) << "\t"
-			<< lowerQuartile(bandBRFIs) << "\t" << median(bandBRFIs) << "\t" << upperQuartile(bandBRFIs) << "\t"
-			<< lowerQuartile(bandLRFIs) << "\t" << median(bandLRFIs) << "\t" << upperQuartile(bandLRFIs) << "\t"
-			<< lowerQuartile(bandBRFIAmps) << "\t" << median(bandBRFIAmps) << "\t" << upperQuartile(bandBRFIAmps) << "\t"
-			<< lowerQuartile(bandLRFIAmps) << "\t" << median(bandLRFIAmps) << "\t" << upperQuartile(bandLRFIAmps) << "\t"
-			<< lowerQuartile(bandFP) << "\t" << median(bandFP) << "\t" << upperQuartile(bandFP) << "\t"
-			<< lowerQuartile(bandFN) << "\t" << median(bandFN) << "\t" << upperQuartile(bandFN) << "\t"
-			<< lowerQuartile(bandTP) << "\t" << median(bandTP) << "\t" << upperQuartile(bandTP) << "\t"
-			<< lowerQuartile(bandTN) << "\t" << median(bandTN) << "\t" << upperQuartile(bandTN) << "\t"
-			<< lowerQuartile(bandFPAmps) << "\t" << median(bandFPAmps) << "\t" << upperQuartile(bandFPAmps) << "\t"
-			<< lowerQuartile(bandFNAmps) << "\t" << median(bandFNAmps) << "\t" << upperQuartile(bandFNAmps) << "\n";
-			bandTotals.clear();
-			bandAmps.clear();
-			bandRFIs.clear();
-			bandRFIAmps.clear();
-			bandBRFIs.clear();
-			bandLRFIs.clear();
-			bandBRFIAmps.clear();
-			bandLRFIAmps.clear();
-			bandFP.clear();
-			bandFN.clear();
-			bandTP.clear();
-			bandTN.clear();
-			bandFPAmps.clear();
-			bandFNAmps.clear();
-		}
-		++index;
-	}
-	file.close();
-	if(index%countPerSubband != 0)
-		AOLogger::Warn << "Warning: " << (index%countPerSubband) << " rows were not part of a sub-band (channels were not dividable by " << countPerSubband << ")\n";
-}
-
-void RFIStatistics::saveTimeIntegrated(const std::map<double, class TimestepInfo> &timesteps, const std::string &filename)
-{
-	size_t steps = 200;
-	if(timesteps.size() < steps) steps = timesteps.size();
-	std::ofstream file(filename.c_str());
-	file <<
-		"timestep\ttime\ttotalCount\ttotalAmplitude\trfiCount\t"
-		"rfiSummedAmplitude\tbroadbandRfiCount\tlineRfiCount\tbroadbandRfiAmplitude\tlineRfiAmplitude\t"
-		"totalCountLQ\ttotalCountUQ\ttotalAmplitudeLQ\ttotalAmplitudeUQ\trfiCountLQ\trfiCountUQ\t"
-		"rfiSummedAmplitudeLQ\trfiSummedAmplitudeUQ\tbroadbandRfiCountLQ\tbroadbandRfiCountUQ\t"
-		"lineRfiCountLQ\tlineRfiCountUQ\tbroadbandRfiAmplitudeLQ\tbroadbandRfiAmplitudeUQ\t"
-		"lineRfiAmplitudeLQ\tlineRfiAmplitudeUQ\n"
-	<< std::setprecision(14);
-	size_t index = 0, integratedSteps = 0;
-	std::multiset<double>
-		totals,
-		amps,
-		rfis,
-		rfiAmps,
-		brfis,
-		lrfis,
-		brfiAmps,
-		lrfiAmps;
-	for(std::map<double, class TimestepInfo>::const_iterator i=timesteps.begin();i!=timesteps.end();++i)
-	{
-		const TimestepInfo &t = i->second;
-		if(totals.size() == 0)
-			file << t.time << "\t-\t";
-		totals.insert(t.totalCount);
-		amps.insert(t.totalAmplitude);
-		rfis.insert(t.rfiCount);
-		rfiAmps.insert(t.rfiAmplitude);
-		brfis.insert(t.broadbandRfiCount);
-		lrfis.insert(t.lineRfiCount);
-		brfiAmps.insert(t.broadbandRfiAmplitude);
-		lrfiAmps.insert(t.lineRfiAmplitude);
-		++index;
-		if(index * steps / timesteps.size() > integratedSteps)
-		{
-			file
-			<< avg(totals) << "\t"
-			<< avg(amps) << "\t"
-			<< avg(rfis) << "\t"
-			<< avg(rfiAmps) << "\t"
-			<< avg(brfis) << "\t"
-			<< avg(lrfis) << "\t"
-			<< avg(brfiAmps) << "\t"
-			<< avg(lrfiAmps) << "\t"
-			<< lowerQuartile(totals) << "\t" << median(totals) << '\t' << upperQuartile(totals) << "\t"
-			<< lowerQuartile(amps) << "\t" << median(amps) << '\t' << upperQuartile(amps) << "\t"
-			<< lowerQuartile(rfis) << "\t" << median(rfis) << '\t' << upperQuartile(rfis) << "\t"
-			<< lowerQuartile(rfiAmps) << "\t" << median(rfiAmps) << '\t' << upperQuartile(rfiAmps) << "\t"
-			<< lowerQuartile(brfis) << "\t" << median(brfis) << '\t' << upperQuartile(brfis) << "\t"
-			<< lowerQuartile(lrfis) << "\t" << median(lrfis) << '\t' << upperQuartile(lrfis) << "\t"
-			<< lowerQuartile(brfiAmps) << "\t" << median(brfiAmps) << '\t' << upperQuartile(brfiAmps) << "\t"
-			<< lowerQuartile(lrfiAmps) << "\t" << median(lrfiAmps) << '\t' << upperQuartile(lrfiAmps) << "\n";
-			totals.clear();
-			amps.clear();
-			rfis.clear();
-			rfiAmps.clear();
-			brfis.clear();
-			lrfis.clear();
-			brfiAmps.clear();
-			lrfiAmps.clear();
-			++integratedSteps;
-		}
-	}
-	file.close();
-}
-
-void RFIStatistics::saveAmplitudes(const std::map<double, class AmplitudeBin> &amplitudes, const std::string &filename)
-{
-	std::ofstream file(filename.c_str());
-	file << "centr-amplitude\tlog-centr-amplitude\tcount\trfiCount\tbroadbandRfiCount\tlineRfiCount\tfeatureAvgCount\tfeatureIntCount\tfeatureMaxCount\txx\txy\tyx\tyy\txxRfi\txyRfi\tyxRfi\tyyRfi\tstokesQ\tstokesU\tstokesV\tFalseP\tFalseN\tTrueP\tTrueN\n" << std::setprecision(14);
-	for(std::map<double, class AmplitudeBin>::const_iterator i=amplitudes.begin();i!=amplitudes.end();++i)
-	{
-		const AmplitudeBin &a = i->second;
-		double logAmp = a.centralAmplitude > 0.0 ? log10(a.centralAmplitude) : 0.0;
-		file
-			<< a.centralAmplitude << '\t'
-			<< logAmp << '\t'
-			<< a.count << '\t'
-			<< a.rfiCount << '\t'
-			<< a.broadbandRfiCount << '\t'
-			<< a.lineRfiCount << '\t'
-			<< a.featureAvgCount<< '\t'
-			<< a.featureIntCount << '\t'
-			<< a.featureMaxCount << '\t'
-			<< a.xxCount << '\t'
-			<< a.xyCount << '\t'
-			<< a.yxCount << '\t'
-			<< a.yyCount << '\t'
-			<< a.xxRfiCount << '\t'
-			<< a.xyRfiCount << '\t'
-			<< a.yxRfiCount << '\t'
-			<< a.yyRfiCount << '\t'
-			<< a.stokesQCount << '\t'
-			<< a.stokesUCount << '\t'
-			<< a.stokesVCount << '\t'
-			<< a.falsePositiveCount << "\t"
-			<< a.falseNegativeCount << "\t"
-			<< a.truePositiveCount << "\t"
-			<< a.trueNegativeCount
-			<< "\n";
-	}
-	file.close();
-}
-
-void RFIStatistics::saveBaselines(const std::string &filename)
-{
-	std::ofstream file(filename.c_str());
-	file << "a1\ta2\ta1name\ta2name\tbaselineLength\tbaselineAngle\tcount\ttotalAmplitude\trfiCount\tbroadbandRfiCount\tlineRfiCount\trfiAmplitude\tbroadbandRfiAmplitude\tlineRfiAmplitude\n" << std::setprecision(14);
-	for(BaselineMatrix::const_iterator i=_baselines.begin();i!=_baselines.end();++i)
-	{
-		const std::map<int, BaselineInfo> &row = i->second;
-		for(std::map<int, BaselineInfo>::const_iterator j=row.begin();j!=row.end();++j)
-		{
-			const BaselineInfo &b = j->second;
-			file
-				<< b.antenna1 << "\t"
-				<< b.antenna2 << "\t"
-				<< b.antenna1Name << "\t"
-				<< b.antenna2Name << "\t"
-				<< b.baselineLength << "\t"
-				<< b.baselineAngle << "\t"
-				<< b.count << "\t"
-				<< b.totalAmplitude << "\t"
-				<< b.rfiCount << "\t"
-				<< b.broadbandRfiCount << "\t"
-				<< b.lineRfiCount << "\t"
-				<< b.rfiAmplitude << "\t"
-				<< b.broadbandRfiAmplitude << "\t"
-				<< b.lineRfiAmplitude << "\n";
-			if(b.baselineStatistics != 0)
-			{
-				std::stringstream s;
-				s << _filePrefix << "baseline-" << b.antenna1 << 'x' << b.antenna2 << '-';
-				b.baselineStatistics->saveWithoutBaselines(s.str());
-			}
-		}
-	}
-	file.close();
-}
-
-void RFIStatistics::saveBaselineTimeInfo(const std::string &filename)
-{
-	std::ofstream file(filename.c_str());
-	file << "antenna1\tantenna2\ttime\ttotalCount\trfiCount\n" << std::setprecision(14);
-	for(BaselineTimeInfoMap::const_iterator i=_baselineTimeInfo.begin();i!=_baselineTimeInfo.end();++i)
-	{
-		const BaselineTimeInfo &info = i->second;
-		file
-			<< info.antenna1Index << "\t"
-			<< info.antenna2Index << "\t"
-			<< info.time << "\t"
-			<< info.totalCount << "\t"
-			<< info.rfiCount << "\n";
-	}
-	file.close();
-}
-
-void RFIStatistics::saveStationTimeInfoRow(std::ostream &stream, bool &firstRow, std::vector<unsigned long> &totals, std::vector<unsigned long> &rfis, double time)
-{
-	if(firstRow)
-	{
-		stream << "time";
-		for(unsigned i=0;i<totals.size();++i)
-		{
-			stream << "\ttotal" << i << "\trfi" << i;
-		}
-		stream << '\n' << std::setprecision(14);
-		firstRow = false;
-	}
-
-	stream << time;
-	for(unsigned i=0;i<totals.size();++i)
-	{
-		stream << '\t' << totals[i] << '\t' << rfis[i];
-		totals[i] = 0;
-		rfis[i] = 0;
-	}
-	stream << '\n';
-}
-
-void RFIStatistics::saveStationTimeInfo(const std::string &filename, const std::string &plotname)
-{
-	std::ofstream file(filename.c_str());
-	std::ofstream stationTimePlot(plotname.c_str());
-	bool firstRow = true;
-	unsigned stationCount = 0;
-	if(_baselineTimeInfo.size() > 0)
-	{
-		// Calculate number of time steps
-		double time = _baselineTimeInfo.begin()->second.time;
-		unsigned long timeStepCount = 1;
-		for(BaselineTimeInfoMap::const_iterator i=_baselineTimeInfo.begin();i!=_baselineTimeInfo.end();++i)
-		{
-			if(time != i->second.time)
-			{
-				time = i->second.time;
-				++timeStepCount;
-			}
-		}
-		
-		time = _baselineTimeInfo.begin()->second.time;
-		unsigned long timeStepIndex = 0 , partIndex = 0;
-		std::vector<unsigned long> totals, rfis;
-		for(BaselineTimeInfoMap::const_iterator i=_baselineTimeInfo.begin();i!=_baselineTimeInfo.end();++i)
-		{
-			const BaselineTimeInfo &info = i->second;
-			unsigned requiredSize = info.antenna1Index+1;
-			if(info.antenna2Index >= requiredSize)
-				requiredSize = info.antenna2Index+1;
-			
-			if(totals.size() <= requiredSize)
-			{
-				totals.resize(requiredSize);
-				rfis.resize(requiredSize);
-			}
-			
-			if(info.time != time)
-			{
-				if(firstRow)
-					stationCount = totals.size();
-				if(timeStepIndex >= (partIndex+1) * timeStepCount / 200)
-				{
-					saveStationTimeInfoRow(file, firstRow, totals, rfis, time);
-					++partIndex;
-				}
-				++timeStepIndex;
-				time = info.time;
-			}
-			
-			totals[info.antenna1Index] += info.totalCount;
-			rfis[info.antenna1Index] += info.rfiCount;
-			totals[info.antenna2Index] += info.totalCount;
-			rfis[info.antenna2Index] += info.rfiCount;
-		}
-		saveStationTimeInfoRow(file, firstRow, totals, rfis, time);
-
-		stationTimePlot << std::setprecision(14) <<
-			"set term postscript enhanced color font \"Helvetica,16\"\n"
-			"set title \"RFI station statistics by time\"\n"
-			"set xlabel \"Time (hrs)\"\n"
-			"set ylabel \"RFI (percentage)\"\n"
-			"set output \"StationsTime-Rfi.ps\"\n"
-			"set key inside top\n"
-			"set xrange [" << 0 << ":" << ((time-_baselineTimeInfo.begin()->second.time)/(60.0*60.0)) << "]\n"
-			"plot \\\n";
-		std::stringstream timeAxisStr;
-		timeAxisStr << std::setprecision(14) << "((column(1)-" << _baselineTimeInfo.begin()->second.time << ")/(60.0*60.0))";
-		const std::string timeAxis = timeAxisStr.str();
-		for(unsigned x=0;x<stationCount;++x)
-		{
-			if(x != 0)
-				stationTimePlot << ", \\\n";
-			stationTimePlot
-			<< "\"counts-stationstime.txt\" using "
-			<< timeAxis
-			<< ":(100*column(" << (x*2+3)
-			<< ")/column(" << (x*2+2)
-			<< ")) title \"" << getStationName(x) << "\" with lines lw 2";
-		}
-		stationTimePlot << '\n';
-	}
-		
-	file.close();
-	stationTimePlot.close();
-}
-
-void RFIStatistics::saveBaselineFrequencyInfo(const std::string &filename)
-{
-	std::ofstream file(filename.c_str());
-	file << "antenna1\tantenna2\tcentralFrequency\ttotalCount\trfiCount\n" << std::setprecision(14);
-	for(BaselineFrequencyInfoMap::const_iterator i=_baselineFrequencyInfo.begin();i!=_baselineFrequencyInfo.end();++i)
-	{
-		const BaselineFrequencyInfo &info = i->second;
-		file
-			<< info.antenna1Index << "\t"
-			<< info.antenna2Index << "\t"
-			<< info.centralFrequency << "\t"
-			<< info.totalCount << "\t"
-			<< info.rfiCount << "\n";
-	}
-	file.close();
-}
-
-void RFIStatistics::saveTimeFrequencyInfo(TimeFrequencyInfoMap &map, const std::string &filename)
-{
-	std::ofstream file(filename.c_str());
-	file << "time\tfrequency\ttotalCount\trfiCount\ttotalAmplitude\trfiAmplitude\n" << std::setprecision(14);
-	for(TimeFrequencyInfoMap::const_iterator i=map.begin();i!=map.end();++i)
-	{
-		const TimeFrequencyInfo &info = i->second;
-		file
-			<< info.time << '\t'
-			<< info.centralFrequency << '\t'
-			<< info.totalCount << '\t'
-			<< info.rfiCount << '\t'
-			<< info.totalAmplitude << '\t'
-			<< info.rfiAmplitude << '\n';
-	}
-	file.close();
-}
-
-void RFIStatistics::saveBaselinesOrdered(const std::string &filename)
-{
-	std::vector<BaselineInfo> orderedBaselines;
-	for(BaselineMatrix::const_iterator i=_baselines.begin();i!=_baselines.end();++i)
-	{
-		const std::map<int, BaselineInfo> &row = i->second;
-		for(std::map<int, BaselineInfo>::const_iterator j=row.begin();j!=row.end();++j)
-		{
-			const BaselineInfo &b = j->second;
-			orderedBaselines.push_back(b);
-		}
-	}
-	std::sort(orderedBaselines.begin(), orderedBaselines.end());
-
-	std::ofstream file(filename.c_str());
-	file << "a1\ta2\ta1name\ta2name\tbaselineLength\tbaselineAngle\tcount\ttotalAmplitude\trfiCount\tbroadbandRfiCount\tlineRfiCount\trfiAmplitude\tbroadbandRfiAmplitude\tlineRfiAmplitude\n" << std::setprecision(14);
-	for(std::vector<BaselineInfo>::const_iterator i=orderedBaselines.begin();i!=orderedBaselines.end();++i)
-	{
-		const BaselineInfo &b = *i;
-		file
-			<< b.antenna1 << "\t"
-			<< b.antenna2 << "\t"
-			<< b.antenna1Name << "\t"
-			<< b.antenna2Name << "\t"
-			<< b.baselineLength << "\t"
-			<< b.baselineAngle << "\t"
-			<< b.count << "\t"
-			<< b.totalAmplitude << "\t"
-			<< b.rfiCount << "\t"
-			<< b.broadbandRfiCount << "\t"
-			<< b.lineRfiCount << "\t"
-			<< b.rfiAmplitude << "\t"
-			<< b.broadbandRfiAmplitude << "\t"
-			<< b.lineRfiAmplitude << "\n";
-	}
-	file.close();
-}
-
-void RFIStatistics::saveStations(const std::string &filename)
-{
-	unsigned stationCount = _baselines.size();
-	for(BaselineMatrix::const_iterator i=_baselines.begin();i!=_baselines.end();++i)
-	{
-		const std::map<int, BaselineInfo> &row = i->second;
-		if(row.size() > stationCount) stationCount = row.size();
-	}
-	double *values = new double[stationCount];
-	for(unsigned i=0;i<stationCount;++i)
-		values[i] = 0.0;
-	
-	
-}
-
-long double RFIStatistics::FitScore(Image2DCPtr image, Image2DCPtr fit, Mask2DCPtr mask)
-{
-	long double summedError = 0.0L;
-	unsigned count = 0;
-
-	for(unsigned y=0;y<image->Height();++y) {
-		for(unsigned x=0;x<image->Width();++x) {
-			if(!mask->Value(x, y) && std::isfinite(image->Value(x, y)))
-			{
-				long double error = image->Value(x, y) - fit->Value(x, y);
-				summedError += error * error;
-				++count;
-			} else {
-			}
-		}
-	}
-	long double procentData = (long double) count / (image->Width() * image->Height());
-	long double averageError = summedError / (image->Width() * image->Height());
-	//long double avgError = summedError / (image->Width()*image->Height());
-	//return 1.0L/(summedError + avgError * 2.0L * (long double) count);
-	return procentData/averageError;
-}
-
-num_t RFIStatistics::DataQuality(Image2DCPtr image, Image2DCPtr model, Mask2DCPtr mask, unsigned startX, unsigned endX)
-{
-	unsigned count = 0;
-	double sum = 0;
-	for(unsigned y=0;y<image->Height();++y)
-	{
-		for(unsigned x=startX;x<endX;++x)
-		{
-			if(!mask->Value(x, y) && std::isfinite(image->Value(x, y)) && std::isfinite(model->Value(x,y)))
-			{
-				num_t noise = fabsn(image->Value(x, y) - model->Value(x, y));
-				num_t signal = fabsn(model->Value(x, y));
-				if(signal != 0.0)
-				{
-					if(noise <= 1e-50) noise = 1e-50;
-					num_t snr = logn(signal / noise);
-					sum += snr;
-
-					++count;
-				}
-			}
-		}
-	}
-	if(count == 0)
-		return 0;
-	else
-		return sum / (sqrtn(count) * sqrtn((endX-startX) * image->Height()));
-}
-
-num_t RFIStatistics::FrequencySNR(Image2DCPtr image, Image2DCPtr model, Mask2DCPtr mask, unsigned channel)
-{
-	num_t sum = 0.0;
-	size_t count = 0;
-	for(unsigned x=0;x<image->Width();++x)
-	{
-		if(!mask->Value(x, channel))
-		{
-			num_t noise = fabsn(image->Value(x, channel) - model->Value(x, channel));
-			num_t signal = fabsn(model->Value(x, channel));
-			if(std::isfinite(signal) && std::isfinite(noise))
-			{
-				if(noise <= 1e-50) noise = 1e-50;
-				num_t snr = logn(signal / noise);
-				sum += snr;
-	
-				++count;
-			}
-		}
-	}
-	return expn(sum / count);
-}
-
-void RFIStatistics::createStationData(std::vector<StationInfo> &stations) const
-{
-	for(BaselineMatrix::const_iterator i=_baselines.begin();i!=_baselines.end();++i)
-	{
-		size_t index1 = i->first;
-		if(index1 >= stations.size())
-			stations.resize(index1+1);
-		const std::map<int, BaselineInfo> &row = i->second;
-		for(std::map<int, BaselineInfo>::const_iterator j=row.begin();j!=row.end();++j)
-		{
-			size_t index2 = j->first;
-			if(index2 >= stations.size())
-				stations.resize(index2+1);
-
-			const BaselineInfo &b = j->second;
-			StationInfo &a1 = stations[index1], &a2 = stations[index2];
-			a1.index = j->second.antenna1;
-			a1.name = j->second.antenna1Name;
-			a1.totalRfi += (double) b.rfiCount / (double) b.count;
-			a1.count++;
-			a2.index = j->second.antenna2;
-			a2.name = j->second.antenna2Name;
-			a2.totalRfi += (double) b.rfiCount / (double) b.count;
-			a2.count++;
-		}
-	}
-	for(std::vector<StationInfo>::iterator i=stations.begin();i!=stations.end();++i)
-	{
-		if(i->count == 0)
-		{
-			--i;
-			stations.erase(i+1);
-		}
-	}
-	std::sort(stations.begin(), stations.end());
-}
-
-void RFIStatistics::saveMetaData(const std::string &filename) const
-{
-	if(_crossTimesteps.empty() || _crossChannels.empty())
-		return;
-	
-	const class TimestepInfo
-		&firstStep = _crossTimesteps.begin()->second,
-		&lastStep = _crossTimesteps.rbegin()->second;
-	const class ChannelInfo
-		&startChannel = _crossChannels.begin()->second,
-		&endChannel = _crossChannels.rbegin()->second;
-
-	double startTime = firstStep.time;
-	double endTime = lastStep.time;
-	double timeResolution = round(100.0 * (lastStep.time - firstStep.time) / (double) _crossTimesteps.size()) * 0.01;
-
-	double
-		freqResolution = round((endChannel.frequencyHz - startChannel.frequencyHz) / ((double) _crossChannels.size() * 1000.0 * 0.01))*0.01,
-		startFrequency = round(startChannel.frequencyHz/100000.0)/10.0,
-		endFrequency = round(endChannel.frequencyHz/100000.0)/10.0;
-	double lengthInUnits;
-	std::string lengthUnits;
-	if((endTime - startTime) / 60.0 > 120.0)
-	{
-		lengthInUnits = round(10.0*(endTime - startTime) / (60.0*60.0))/10.0;
-		lengthUnits = "hrs";
-	} else if((endTime - startTime) > 120.0)
-	{
-		lengthInUnits = round(10.0*(endTime - startTime) / (60.0)) / 10.0;
-		lengthUnits = "min";
-	} else {
-		lengthInUnits = round(10.0*(endTime - startTime) );
-		lengthUnits = "s";
-	}
-	double baselineCount = (double) _baselines.size() * (double) (_baselines.size()+1) / 2.0;
-	double totalSize = (double) _crossTimesteps.size() * (double) _crossChannels.size() * 4.0 * 8.0 * baselineCount;
-	double sizeInUnits;
-	std::string sizeUnits;
-	if(totalSize > (1024.0*1024.0*1024.0*1024.0*1024.0/10.0))
-	{
-		sizeInUnits = round(totalSize*10.0/(1024.0*1024.0*1024.0*1024.0*1024.0))/10.0;
-		sizeUnits = "PB";
-	} else if(totalSize > (1024.0*1024.0*1024.0*1024.0/10.0))
-	{
-		sizeInUnits = round(totalSize*10.0/(1024.0*1024.0*1024.0*1024.0))/10.0;
-		sizeUnits = "TB";
-	} else
-	{
-		sizeInUnits = round(totalSize*10.0/(1024.0*1024.0*1024.0))/10.0;
-		sizeUnits = "GB";
-	}
-	std::vector<BaselineInfo> orderedBaselines;
-	for(BaselineMatrix::const_iterator i=_baselines.begin();i!=_baselines.end();++i)
-	{
-		const std::map<int, BaselineInfo> &row = i->second;
-		for(std::map<int, BaselineInfo>::const_iterator j=row.begin();j!=row.end();++j)
-		{
-			const BaselineInfo &b = j->second;
-			orderedBaselines.push_back(b);
-		}
-	}
-	std::sort(orderedBaselines.begin(), orderedBaselines.end());
-	double maxBaselineLength = round(10.0*orderedBaselines.rbegin()->baselineLength / 1000.0) / 10.0;
-	
-	size_t countPerSubband = _channelCountPerSubband;
-	if(_ignoreFirstChannel) --countPerSubband;
-
-	std::ofstream file(filename.c_str());
-	file
-		<< "Observation date: " << Date::AipsMJDToDateString(startTime) << "\\\\\n"
-		<< "Start time: " << Date::AipsMJDToRoundTimeString(startTime) << "\\\\\n"
-		<< "Observation length: " << lengthInUnits << ' ' << lengthUnits << "\\\\\n"
-		<< "Time resolution: " << timeResolution << " s \\\\\n"
-		<< "Total percentage of RFI: " << round(10000.0*RFIFractionInCrossTimeSteps())/100.0 << " \\%\\\\\n"
-		<< "Number of channels/sub-band: " << _channelCountPerSubband << "\\\\\n"
-		<< "Number of sub-bands: " << (_crossChannels.size()/countPerSubband) << "\\\\\n"
-		<< "Number of stations: " << _baselines.size() << "\\\\\n"
-		<< "Frequency range: " << startFrequency << "-" << endFrequency << " MHz\\\\\n"
-		<< "Frequency resolution: " << freqResolution << " kHz \\\\\n"
-		<< "Total size: " << sizeInUnits << ' ' << sizeUnits << "\\\\\n"
-		<< "Max baseline length: " << maxBaselineLength << " km\\\\\n";
-		
-	std::vector<StationInfo> stations;
-	createStationData(stations);
-	if(stations.size() > 3)
-	{
-		file << "Best 3 stations: ";
-		std::vector<StationInfo>::const_iterator stationI = stations.begin();
-		file << toTex(stationI->name) << ' ' << round(stationI->totalRfi*1000.0/(double) stationI->count)/10.0 << "\\%,\\\\\n\\indent ";
-		++stationI;
-		file << toTex(stationI->name) << ' ' << round(stationI->totalRfi*1000.0/(double) stationI->count)/10.0 << "\\%, ";
-		++stationI;
-		file << toTex(stationI->name) << ' ' << round(stationI->totalRfi*1000.0/(double) stationI->count)/10.0 << "\\%";
-
-		file << "\\\\\nWorst 3 stations: ";
-		std::vector<StationInfo>::const_reverse_iterator stationRI = stations.rbegin();
-		file << toTex(stationRI->name) << ' ' << round(stationRI->totalRfi*1000.0/(double) stationRI->count)/10.0 << "\\%,\\\\\n\\indent ";
-		++stationRI;
-		file << toTex(stationRI->name) << ' ' << round(stationRI->totalRfi*1000.0/(double) stationRI->count)/10.0 << "\\%, ";
-		++stationRI;
-		file << toTex(stationRI->name) << ' ' << round(stationRI->totalRfi*1000.0/(double) stationRI->count)/10.0 << "\\%\n";
-	}
-
-	file.close();
-}
-
-void RFIStatistics::savePlots(const std::string &basename) const
-{
-	
-	class TimestepInfo firstStep, lastStep;
-	if(!_crossTimesteps.empty())
-	{
-		firstStep = _crossTimesteps.begin()->second;
-		lastStep = _crossTimesteps.rbegin()->second;
-	}
-	class ChannelInfo startChannel, endChannel;
-	if(!_crossChannels.empty())
-	{
-		startChannel = _crossChannels.begin()->second;
-		endChannel = _crossChannels.rbegin()->second;
-	}
-
-	std::ofstream baselPlot((basename + "Baseline.plt").c_str());
-	baselPlot << std::setprecision(14) <<
-		"set term postscript enhanced color font \"Helvetica,16\"\n"
-		"set title \"RFI statistics by baseline length\"\n"
-		"set xlabel \"Baseline length (m)\"\n"
-		"set ylabel \"RFI (percentage)\"\n"
-		"set lmargin 2.5\n"
-		"set rmargin 0.5\n"
-		"set tmargin 0.3\n"
-		"set bmargin 0.1\n"
-		"set log x\n"
-		"set output \"Baselines-Rfi.ps\"\n"
-		"set key inside top\n"
-		"plot \\\n"
-		"\"counts-obaselines.txt\" using 5:(100*column(9)/column(7)) title \"Total\" with points lw 0.5 lc rgbcolor \"#FF0000\", \\\n"
-		"\"counts-obaselines.txt\" using 5:(100*column(10)/column(7)) title \"Broadband\" with points lw 0.5 lc rgbcolor \"#008000\", \\\n"
-		"\"counts-obaselines.txt\" using 5:(100*column(11)/column(7)) title \"Spectral line\" with points lw 0.5 lc rgbcolor \"#0000FF\"\n";
-	baselPlot.close();
-
-	std::ofstream distPlot((basename + "Distribution.plt").c_str());
-	distPlot << std::setprecision(14) <<
-		"set term postscript enhanced color font \"Helvetica,16\"\n"
-		"set title \"Data distribution\"\n"
-		"set xlabel \"Visibility amplitude\"\n"
-		"set ylabel \"RFI (percentage)\"\n"
-		"set lmargin 2.5\n"
-		"set rmargin 0.5\n"
-		"set tmargin 0.3\n"
-		"set bmargin 0.1\n"
-		"set log x\n"
-		"set log y\n"
-		"set output \"Distribution.ps\"\n"
-		"set key inside top\n"
-		"plot \\\n"
-		"\"counts-amplitudes-cross.txt\" using 1:(column(3)/column(1)) title \"All\" with points lw 0.5 pt 7 ps 0.4 lc rgbcolor \"#000000\", \\\n"
-		"\"counts-amplitudes-cross.txt\" using 1:(column(4)/column(1)) title \"RFI\" with points lw 0.5 pt 7 ps 0.4 lc rgbcolor \"#FF0000\", \\\n"
-		"\"counts-amplitudes-cross.txt\" using 1:((column(3)-column(4))/column(1)) title \"Non-RFI\" with points lw 0.5 pt 7 ps 0.4 lc rgbcolor \"#808080\", \\\n"
-		"\"counts-amplitudes-cross.txt\" using 1:(column(5)/column(1)) title \"Broadband\" with points lw 0.5 pt 7 ps 0.4 lc rgbcolor \"#008000\", \\\n"
-		"\"counts-amplitudes-cross.txt\" using 1:(column(6)/column(1)) title \"Spectral line\" with points lw 0.5 pt 7 ps 0.4 lc rgbcolor \"#0000FF\"\n";
-	distPlot.close();
-
-	std::ofstream freqPlot((basename + "Frequency.plt").c_str());
-	freqPlot << std::setprecision(14) <<
-		"set term postscript enhanced color font \"Helvetica,16\"\n"
-		"set title \"RFI statistics by frequency\"\n"
-		"set xlabel \"Frequency (MHz)\"\n"
-		"set ylabel \"RFI (percentage)\"\n"
-		"set lmargin 2.5\n"
-		"set rmargin 0.5\n"
-		"set tmargin 0.3\n"
-		"set bmargin 0.1\n"
-		"set output \"Frequency-Rfi.ps\"\n"
-		"set key inside top\n"
-		"set xrange [" << startChannel.frequencyHz/1000000.0 << ':' << endChannel.frequencyHz/1000000.0 << "]\n"
-		"plot \\\n"
-		"\"counts-subbands-cross.txt\" using ((column(2)+column(3))/2000000):(100*column(24)/column(4)):(100*column(26)/column(4)) title \"Total (quartiles)\" with filledcu lc rgbcolor \"#FF8080\", \\\n"
-		"\"counts-subbands-cross.txt\" using ((column(2)+column(3))/2000000):(100*column(25)/column(4)) title \"Total (median)\" with lines lw 2 lt 2 lc rgbcolor \"#800000\", \\\n"
-		"\"counts-subbands-cross.txt\" using ((column(2)+column(3))/2000000):(100*column(6)/column(4)) title \"Total (average)\" with lines lw 2 lt 1 lc rgbcolor \"#FF0000\", \\\n"
-		"\"counts-subbands-cross.txt\" using ((column(2)+column(3))/2000000):(100*column(8)/column(4)) title \"Broadband\" with lines lw 2 lt 3 lc rgbcolor \"#008000\", \\\n"
-		"\"counts-subbands-cross.txt\" using ((column(2)+column(3))/2000000):(100*column(9)/column(4)) title \"Spectral line\" with lines lw 2 lt 4 lc rgbcolor \"#0000FF\"\\\n";
-	freqPlot.close();
-
-	std::ostringstream timeStr;
-	timeStr << std::setprecision(14);
-	std::string timeAxisCaption;
-	double rangeEnd;
-	if(lastStep.time-firstStep.time > 60*120)
-	{
-		timeStr << "((column(1)-" << firstStep.time << ")/(60.0*60.0))";
-		timeAxisCaption = "Time (hrs)";
-		rangeEnd = (lastStep.time - firstStep.time) / (60.0*60.0);
-	} else if(lastStep.time-firstStep.time > 120)
-	{
-		timeStr << "((column(1)-" << firstStep.time << ")/60.0)";
-		timeAxisCaption = "Time (min)";
-		rangeEnd = (lastStep.time - firstStep.time) / 60.0;
-	} else {
-		timeStr << "(column(1)-" << firstStep.time << ")";
-		timeAxisCaption = "Time (s)";
-		rangeEnd = lastStep.time - firstStep.time;
-	}
-	const std::string timeAxis = timeStr.str();
-	std::ofstream timePlot((basename + "Time.plt").c_str());
-	timePlot << std::setprecision(14) <<
-		"set term postscript enhanced color font \"Helvetica,16\"\n"
-		"set title \"RFI statistics by time\"\n"
-		"set xlabel \"" << timeAxisCaption << "\"\n"
-		"set ylabel \"RFI (percentage)\"\n"
-		"set lmargin 2.5\n"
-		"set rmargin 0.5\n"
-		"set tmargin 0.3\n"
-		"set bmargin 0.1\n"
-		"set output \"Time-Rfi.ps\"\n"
-		"set key inside top\n"
-		"set xrange [0:" << rangeEnd << "]\n"
-		"plot \\\n";
-	if(_crossTimesteps.size() > 400)
-	{
-		timePlot << 
-			"\"counts-timeint-cross.txt\" using " << timeAxis << ":(100*column(17)/column(3)):(100*column(19)/column(3)) title \"Total (quartiles)\" with filledcu lc rgbcolor \"#FF8080\", \\\n"
-			"\"counts-timeint-cross.txt\" using " << timeAxis << ":(100*column(18)/column(3)) title \"Total (median)\" with lines lw 2 lt 2 lc rgbcolor \"#800000\", \\\n";
-	}
-	timePlot << 
-		"\"counts-timeint-cross.txt\" using " << timeAxis << ":(100*column(5)\
-/column(3)) title \"Total (average)\" with lines lw 2 lt 1 lc rgbcolor \"#FF0000\", \\\n"
-		"\"counts-timeint-cross.txt\" using " << timeAxis << ":(100*column(7)\
-/column(3)) title \"Broadband\" with lines lw 2 lt 3 lc rgbcolor \"#008000\", \\\n"
-		"\"counts-timeint-cross.txt\" using " << timeAxis << ":(100*column(8)\
-/column(3)) title \"Spectral line\" with lines lw 2 lt 4 lc rgbcolor \"#0000FF\"\n";
-
-	timePlot.close();
-}
diff --git a/CEP/DP3/AOFlagger/src/strategy/algorithms/sinusfitter.cpp b/CEP/DP3/AOFlagger/src/strategy/algorithms/sinusfitter.cpp
deleted file mode 100644
index e041c5d2f2d9dadf4d24948930fad09ef196c1cd..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/strategy/algorithms/sinusfitter.cpp
+++ /dev/null
@@ -1,84 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <AOFlagger/strategy/algorithms/sinusfitter.h>
-
-#include <cmath>
-
-SinusFitter::SinusFitter()
-{
-}
-
-SinusFitter::~SinusFitter()
-{
-}
-
-void SinusFitter::FindPhaseAndAmplitude(num_t &phase, num_t &amplitude, const num_t *dataX, const num_t *dataT, const size_t dataSize, const num_t frequency) const throw()
-{
-	// calculate 1/N * \sum_t x(t) e^{-i * frequency * t}
-	num_t sumR = 0.0L, sumI = 0.0L;
-	for(unsigned i=0;i<dataSize;++i)
-	{
-		const num_t t = dataT[i];
-		const num_t x = dataX[i];
-		
-		sumR += x * cosn(-t * frequency);
-		sumI += x * sinn(-t * frequency);
-	}
-
-	sumR /= (num_t) dataSize;
-	sumI /= (num_t) dataSize;
-
-	phase = Phase(sumR, sumI);
-	amplitude = 2.0L * sqrtn(sumR*sumR + sumI*sumI);
-}
-
-void SinusFitter::FindPhaseAndAmplitudeComplex(num_t &phase, num_t &amplitude, const num_t *dataR, const num_t *dataI, const num_t *dataT, const size_t dataSize, const num_t frequency) const throw()
-{
-	// calculate 1/N * \sum_t x(t) e^{-i * frequency * t}
-	num_t sumR = 0.0L, sumI = 0.0L;
-	for(unsigned i=0;i<dataSize;++i)
-	{
-		const num_t t = dataT[i];
-		const num_t xR = dataR[i];
-		const num_t xI = dataI[i];
-		
-		sumR += xR * cosn(-t * frequency);
-		sumR += xI * sinn(-t * frequency);
-
-		sumI += xR * sinn(-t * frequency);
-		sumI -= xI * cosn(-t * frequency);
-	}
-
-	sumR /= (num_t) dataSize;
-	sumI /= (num_t) dataSize;
-
-	phase = Phase(sumR, sumI);
-	amplitude = sqrtn(sumR*sumR + sumI*sumI);
-}
-
-num_t SinusFitter::FindMean(const num_t phase, const num_t amplitude, const num_t *dataX, const num_t *dataT, const size_t dataSize, const num_t frequency)
-{
-	num_t sum = 0.0L;
-	for(unsigned i=0;i<dataSize;++i)
-	{
-		sum += dataX[i] - Value(phase, amplitude, dataT[i], frequency, 0.0L);
-	}
-	return sum / dataSize;
-}
diff --git a/CEP/DP3/AOFlagger/src/strategy/algorithms/statisticalflagger.cpp b/CEP/DP3/AOFlagger/src/strategy/algorithms/statisticalflagger.cpp
deleted file mode 100644
index 422b91df470beaa1908ba518ac750ea5f405de28..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/strategy/algorithms/statisticalflagger.cpp
+++ /dev/null
@@ -1,563 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <AOFlagger/strategy/algorithms/statisticalflagger.h>
-
-StatisticalFlagger::StatisticalFlagger()
-{
-}
-
-
-StatisticalFlagger::~StatisticalFlagger()
-{
-}
-
-bool StatisticalFlagger::SquareContainsFlag(Mask2DCPtr mask, size_t xLeft, size_t yTop, size_t xRight, size_t yBottom)
-{
-	for(size_t y=yTop;y<=yBottom;++y)
-	{
-		for(size_t x=xLeft;x<=xRight;++x)
-		{
-			if(mask->Value(x, y))
-				return true;
-		}
-	}
-	return false;
-}
-
-void StatisticalFlagger::EnlargeFlags(Mask2DPtr mask, size_t timeSize, size_t frequencySize)
-{
-	Mask2DCPtr old = Mask2D::CreateCopy(mask);
-	for(size_t y=0;y<mask->Height();++y)
-	{
-		size_t top, bottom;
-		if(y > frequencySize)
-			top = y - frequencySize;
-		else
-			top = 0;
-		if(y + frequencySize < mask->Height() - 1)
-			bottom = y + frequencySize;
-		else
-			bottom = mask->Height() - 1;
-		
-		for(size_t x=0;x<mask->Width();++x)
-		{
-			size_t left, right;
-			if(x > timeSize)
-				left = x - timeSize;
-			else
-				left = 0;
-			if(x + timeSize < mask->Width() - 1)
-				right = x + timeSize;
-			else
-				right = mask->Width() - 1;
-			
-			if(SquareContainsFlag(old, left, top, right, bottom))
-				mask->SetValue(x, y, true);
-		}
-	}
-}
-
-void StatisticalFlagger::DilateFlagsHorizontally(Mask2DPtr mask, size_t timeSize)
-{
-	if(timeSize != 0)
-	{
-		Mask2DPtr destination = Mask2D::CreateUnsetMaskPtr(mask->Width(), mask->Height());
-		if(timeSize > mask->Width()) timeSize = mask->Width();
-		const int intSize = (int) timeSize;
-		
-		for(size_t y=0;y<mask->Height();++y)
-		{
-			int dist = intSize + 1;
-			for(size_t x=0;x<timeSize;++x)
-			{
-				if(mask->Value(x, y))
-					dist = - intSize;
-				dist++;
-			}
-			for(size_t x=0;x<mask->Width() - timeSize;++x)
-			{
-				if(mask->Value(x + timeSize, y))
-					dist = -intSize;
-				if(dist <= intSize)
-				{
-					destination->SetValue(x, y, true);
-					dist++;
-				} else {
-					destination->SetValue(x, y, false);
-				}
-			}
-			for(size_t x=mask->Width() - timeSize;x<mask->Width();++x)
-			{
-				if(dist <= intSize)
-				{
-					destination->SetValue(x, y, true);
-					dist++;
-				} else {
-					destination->SetValue(x, y, false);
-				}
-			}
-		}
-		mask->Swap(destination);
-	}
-}
-
-void StatisticalFlagger::DilateFlagsVertically(Mask2DPtr mask, size_t frequencySize)
-{
-	if(frequencySize != 0)
-	{
-		Mask2DPtr destination = Mask2D::CreateUnsetMaskPtr(mask->Width(), mask->Height());
-		if(frequencySize > mask->Height()) frequencySize = mask->Height();
-		const int intSize = (int) frequencySize;
-		
-		for(size_t x=0;x<mask->Width();++x)
-		{
-			int dist = intSize + 1;
-			for(size_t y=0;y<frequencySize;++y)
-			{
-				if(mask->Value(x, y))
-					dist = - intSize;
-				dist++;
-			}
-			for(size_t y=0;y<mask->Height() - frequencySize;++y)
-			{
-				if(mask->Value(x, y + frequencySize))
-					dist = -intSize;
-				if(dist <= intSize)
-				{
-					destination->SetValue(x, y, true);
-					dist++;
-				} else {
-					destination->SetValue(x, y, false);
-				}
-			}
-			for(size_t y=mask->Height() - frequencySize;y<mask->Height();++y)
-			{
-				if(dist <= intSize)
-				{
-					destination->SetValue(x, y, true);
-					dist++;
-				} else {
-					destination->SetValue(x, y, false);
-				}
-			}
-		}
-		mask->Swap(destination);
-	}
-}
-
-void StatisticalFlagger::LineRemover(Mask2DPtr mask, size_t maxTimeContamination, size_t maxFreqContamination)
-{
-	for(size_t x=0;x<mask->Width();++x)
-	{
-		size_t count = 0;
-		for(size_t y=0;y<mask->Height();++y)
-		{
-			if(mask->Value(x,y))
-				++count;
-		}
-		if(count > maxFreqContamination)
-			FlagTime(mask, x);
-	}
-
-	for(size_t y=0;y<mask->Height();++y)
-	{
-		size_t count = 0;
-		for(size_t x=0;x<mask->Width();++x)
-		{
-			if(mask->Value(x,y))
-				++count;
-		}
-		if(count > maxTimeContamination)
-			FlagFrequency(mask, y);
-	}
-}
-
-void StatisticalFlagger::FlagTime(Mask2DPtr mask, size_t x)
-{
-	for(size_t y=0;y<mask->Height();++y)
-	{
-		mask->SetValue(x, y, true);
-	}
-}
-
-void StatisticalFlagger::FlagFrequency(Mask2DPtr mask, size_t y)
-{
-	for(size_t x=0;x<mask->Width();++x)
-	{
-		mask->SetValue(x, y, true);
-	}
-}
-
-void StatisticalFlagger::MaskToInts(Mask2DCPtr mask, int **maskAsInt)
-{
-	for(size_t y=0;y<mask->Height();++y)
-	{
-		int *column = maskAsInt[y];
-		for(size_t x=0;x<mask->Width();++x)
-		{
-			column[x] = mask->Value(x, y) ? 1 : 0;
-		}
-	}
-}
-
-void StatisticalFlagger::SumToLeft(Mask2DCPtr mask, int **sums, size_t width, size_t step, bool reverse)
-{
-	if(reverse)
-	{
-		for(size_t y=0;y<mask->Height();++y)
-		{
-			int *column = sums[y];
-			for(size_t x=width;x<mask->Width();++x)
-			{
-				if(mask->Value(x - width/2, y))
-					column[x] += step;
-			}
-		}
-	} else {
-		for(size_t y=0;y<mask->Height();++y)
-		{
-			int *column = sums[y];
-			for(size_t x=0;x<mask->Width() - width;++x)
-			{
-				if(mask->Value(x + width/2, y))
-					column[x] += step;
-			}
-		}
-	}
-}
-
-void StatisticalFlagger::SumToTop(Mask2DCPtr mask, int **sums, size_t width, size_t step, bool reverse)
-{
-	if(reverse)
-	{
-		for(size_t y=width;y<mask->Height();++y)
-		{
-			int *column = sums[y];
-			for(size_t x=0;x<mask->Width();++x)
-			{
-				if(mask->Value(x, y - width/2))
-					column[x] += step;
-			}
-		}
-	} else {
-		for(size_t y=0;y<mask->Height() - width;++y)
-		{
-			int *column = sums[y];
-			for(size_t x=0;x<mask->Width();++x)
-			{
-				if(mask->Value(x, y + width/2))
-					column[x] += step;
-			}
-		}
-	}
-}
-
-void StatisticalFlagger::ThresholdTime(Mask2DCPtr mask, int **flagMarks, int **sums, int thresholdLevel, int width)
-{
-	int halfWidthL = (width-1) / 2;
-	int halfWidthR = (width-1) / 2;
-	for(size_t y=0;y<mask->Height();++y)
-	{
-		const int *column = sums[y];
-		for(size_t x=halfWidthL;x<mask->Width() - halfWidthR;++x)
-		{
-			if(column[x] > thresholdLevel)
-			{
-				const unsigned right = x+halfWidthR+1;
-				++flagMarks[y][x-halfWidthL];
-				if(right < mask->Width())
-					--flagMarks[y][right];
-			}
-		}
-	}
-}
-
-void StatisticalFlagger::ThresholdFrequency(Mask2DCPtr mask, int **flagMarks, int **sums, int thresholdLevel, int width)
-{
-	int halfWidthT = (width-1) / 2;
-	int halfWidthB = (width-1) / 2;
-	for(size_t y=halfWidthT;y<mask->Height() - halfWidthB;++y)
-	{
-		int *column = sums[y];
-		for(size_t x=0;x<mask->Width();++x)
-		{
-			if(column[x] > thresholdLevel)
-			{
-				const unsigned bottom = y+halfWidthB+1;
-				++flagMarks[y-halfWidthT][x];
-				if(bottom < mask->Height())
-					--flagMarks[bottom][x];
-			}
-		}
-	}
-}
-
-void StatisticalFlagger::ApplyMarksInTime(Mask2DPtr mask, int **flagMarks)
-{
-	for(size_t y=0;y<mask->Height();++y)
-	{
-		int startedCount = 0;
-		for(size_t x=0;x<mask->Width();++x)
-		{
-			startedCount += flagMarks[y][x];
-			if(startedCount > 0)
-				mask->SetValue(x, y, true);
-		}
-	}
-}
-
-void StatisticalFlagger::ApplyMarksInFrequency(Mask2DPtr mask, int **flagMarks)
-{
-	for(size_t x=0;x<mask->Width();++x)
-	{
-		int startedCount = 0;
-		for(size_t y=0;y<mask->Height();++y)
-		{
-			startedCount += flagMarks[y][x];
-			if(startedCount > 0)
-				mask->SetValue(x, y, true);
-		}
-	}
-}
-
-void StatisticalFlagger::DensityTimeFlagger(Mask2DPtr mask, num_t minimumGoodDataRatio)
-{
-	num_t width = 2.0;
-	size_t iterations = 0, step = 1;
-	bool reverse = false;
-	
-	//"sums represents the number of flags in a certain range
-	int **sums = new int*[mask->Height()];
-	
-	// flagMarks are integers that represent the number of times an area is marked as the
-	// start or end of a flagged area. For example, if flagMarks[0][0] = 0, it is not the start or
-	// end of an area. If it is 1, it is the start. If it is -1, it is the end. A range of
-	// [2 0 -1 -1 0] produces a flag mask [T T T T F].
-	int **flagMarks = new int*[mask->Height()];
-	
-	for(size_t y=0;y<mask->Height();++y)
-	{
-		sums[y] = new int[mask->Width()];
-		flagMarks[y] = new int[mask->Width()];
-		for(size_t x=0;x<mask->Width();++x)
-			flagMarks[y][x] = 0;
-	}
-	
-	MaskToInts(mask, sums);
-	
-	while(width < mask->Width())
-	{
-		++iterations;
-		SumToLeft(mask, sums, (size_t) width, step, reverse);
-		const int maxFlagged = (int) floor((1.0-minimumGoodDataRatio)*(num_t)(width));
-		ThresholdTime(mask, flagMarks, sums, maxFlagged, (size_t) width);
-	
-		num_t newWidth = width * 1.05;
-		if((size_t) newWidth == (size_t) width)
-			newWidth = width + 1.0;
-		step = (size_t) (newWidth - width);
-		width = newWidth;
-		reverse = !reverse;
-	}
-	
-	ApplyMarksInTime(mask, flagMarks);
-
-	for(size_t y=0;y<mask->Height();++y)
-	{
-		delete[] sums[y];
-		delete[] flagMarks[y];
-	}
-	delete[] sums;
-	delete[] flagMarks;
-}
-
-void StatisticalFlagger::DensityFrequencyFlagger(Mask2DPtr mask, num_t minimumGoodDataRatio)
-{
-	num_t width = 2.0;
-	size_t iterations = 0, step = 1;
-	bool reverse = false;
-	
-	Mask2DPtr newMask = Mask2D::CreateCopy(mask);
-	
-	int **sums = new int*[mask->Height()];
-	int **flagMarks = new int*[mask->Height()];
-	
-	for(size_t y=0;y<mask->Height();++y)
-	{
-		sums[y] = new int[mask->Width()];
-		flagMarks[y] = new int[mask->Width()];
-		for(size_t x=0;x<mask->Width();++x)
-			flagMarks[y][x] = 0;
-	}
-	
-	MaskToInts(mask, sums);
-	
-	while(width < mask->Height())
-	{
-		++iterations;
-		SumToTop(mask, sums, (size_t) width, step, reverse);
-		const int maxFlagged = (int) floor((1.0-minimumGoodDataRatio)*(num_t)(width));
-		ThresholdFrequency(mask, flagMarks, sums, maxFlagged, (size_t) width);
-	
-		num_t newWidth = width * 1.05;
-		if((size_t) newWidth == (size_t) width)
-			newWidth = width + 1.0;
-		step = (size_t) (newWidth - width);
-		width = newWidth;
-		reverse = !reverse;
-	}
-
-	ApplyMarksInFrequency(mask, flagMarks);
-
-	for(size_t y=0;y<mask->Height();++y)
-	{
-		delete[] sums[y];
-		delete[] flagMarks[y];
-	}
-	delete[] sums;
-	delete[] flagMarks;
-}
-
-void StatisticalFlagger::ScaleInvDilationFull(bool *flags, const unsigned n, num_t minimumGoodDataRatio)
-{
-	num_t width = 2.0;
-	bool reverse = false;
-	
-	int *sums = new int[n];
-	int *flagMarks = new int[n];
-	for(size_t x=0;x<n;++x)
-		flagMarks[x] = flags[x] ? 1 : 0;
-	
-	while(width < n)
-	{
-		// SumToLeft
-		if(reverse)
-		{
-			for(unsigned x=width;x<n;++x)
-			{
-				if(flags[x - ((unsigned) width)/2])
-					sums[x]++;
-			}
-		} else {
-			for(unsigned x=0;x<n - width;++x)
-			{
-				if(flags[x + ((unsigned) width)/2])
-					sums[x]++;
-			}
-		}
-		
-		const int maxFlagged = (int) floor((1.0-minimumGoodDataRatio)*(num_t)(width));
-		//ThresholdTime
-		int halfWidthL = (width-1) / 2;
-		int halfWidthR = (width-1) / 2;
-		for(unsigned x=halfWidthL;x<n - halfWidthR;++x)
-		{
-			if(sums[x] > maxFlagged)
-			{
-				const unsigned right = x+halfWidthR+1;
-				++flagMarks[x-halfWidthL];
-				if(right < n)
-					--flagMarks[right];
-			}
-		}
-	
-		++width;
-		reverse = !reverse;
-	}
-	
-	//ApplyMarksInTime
-	int startedCount = 0;
-	for(size_t x=0;x<n;++x)
-	{
-		startedCount += flagMarks[x];
-		if(startedCount > 0)
-			flags[x] = true;
-	}
-
-	delete[] sums;
-	delete[] flagMarks;
-}
-
-void StatisticalFlagger::ScaleInvDilationQuick(bool *flags, const unsigned n, num_t minimumGoodDataRatio)
-{
-	num_t width = 2.0;
-	unsigned iterations = 0, step = 1;
-	bool reverse = false;
-	
-	int *sums = new int[n];
-	int *flagMarks = new int[n];
-	for(size_t x=0;x<n;++x)
-		flagMarks[x] = flags[x] ? 1 : 0;
-	
-	while(width < n)
-	{
-		++iterations;
-		
-		// SumToLeft
-		if(reverse)
-		{
-			for(unsigned x=width;x<n;++x)
-			{
-				if(flags[x - ((unsigned) width)/2])
-					sums[x] += step;
-			}
-		} else {
-			for(unsigned x=0;x<n - width;++x)
-			{
-				if(flags[x + ((unsigned) width)/2])
-					sums[x] += step;
-			}
-		}
-		
-		const int maxFlagged = (int) floor((1.0-minimumGoodDataRatio)*(num_t)(width));
-		//ThresholdTime
-		int halfWidthL = (width-1) / 2;
-		int halfWidthR = (width-1) / 2;
-		for(unsigned x=halfWidthL;x<n - halfWidthR;++x)
-		{
-			if(sums[x] > maxFlagged)
-			{
-				const unsigned right = x+halfWidthR+1;
-				++flagMarks[x-halfWidthL];
-				if(right < n)
-					--flagMarks[right];
-			}
-		}
-	
-		num_t newWidth = width * 1.05;
-		if((unsigned) newWidth == width)
-			newWidth = width + 1.0;
-		step = (size_t) (newWidth - width);
-		width = newWidth;
-		reverse = !reverse;
-	}
-	
-	//ApplyMarksInTime
-	int startedCount = 0;
-	for(size_t x=0;x<n;++x)
-	{
-		startedCount += flagMarks[x];
-		if(startedCount > 0)
-			flags[x] = true;
-	}
-
-	delete[] sums;
-	delete[] flagMarks;
-}
diff --git a/CEP/DP3/AOFlagger/src/strategy/algorithms/sumthreshold.cpp b/CEP/DP3/AOFlagger/src/strategy/algorithms/sumthreshold.cpp
deleted file mode 100644
index dda7f2dce62d6a9b12969867ba5cf67fee86e366..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/strategy/algorithms/sumthreshold.cpp
+++ /dev/null
@@ -1,371 +0,0 @@
-#include <stdint.h>
-#include <xmmintrin.h>
-#include <emmintrin.h>
-
-#include <AOFlagger/msio/image2d.h>
-
-#include <AOFlagger/strategy/algorithms/thresholdmitigater.h>
-#include <AOFlagger/util/aologger.h>
-#include <boost/concept_check.hpp>
-
-/**
- * The SSE version of the Vertical SumThreshold algorithm using intrinsics.
- *
- * The SumThreshold algorithm is applied on 4 time steps at a time. Since the SSE has
- * instructions that operate on 4 floats at a time, this could in theory speed up the
- * processing with a factor of 4. However, a lot of time is lost shuffling the data in the
- * right order/registers, and since a timestep consists of 1 byte booleans and 4 byte
- * floats, there's a penalty. Finally, since the 4 timesteps have to be processed exactly
- * the same way, conditional branches had to be replaced by conditional moves.
- *
- * The average profit of SSE intrinsics vs no SSE seems to be about a factor of 1.5 to 2-3,
- * depending on the Length parameter, but also depending on the number of flags (With
- * Length=256, it can make a factor of 3 difference). It might also vary on different
- * processors; e.g. on my Desktop Xeon with older gcc, the profit was less pronounced,
- * while my Intel i5 at home showed an avg factor of over 2 difference.
- *
- * The algorithm works with Length=1, but since that is a normal thresholding operation,
- * computing a sumthreshold has a lot of overhead, hence is not optimal at that size.
- */
-template<size_t Length>
-void ThresholdMitigater::VerticalSumThresholdLargeSSE(Image2DCPtr input, Mask2DPtr mask, num_t threshold)
-{
-	Mask2D *maskCopy = Mask2D::CreateCopy(*mask);
-	const size_t width = mask->Width(), height = mask->Height();
-	const __m128 zero4 = _mm_set_ps(0.0, 0.0, 0.0, 0.0);
-	const __m128i zero4i = _mm_set_epi32(0, 0, 0, 0);
-	const __m128i ones4 = _mm_set_epi32(1, 1, 1, 1);
-	const __m128 threshold4Pos = _mm_set1_ps(threshold);
-	const __m128 threshold4Neg = _mm_set1_ps(-threshold); 
-	if(Length <= height)
-	{
-		for(size_t x=0;x<width;x += 4)
-		{
-			__m128 sum4 = _mm_set_ps(0.0, 0.0, 0.0, 0.0);
-			__m128i count4 = _mm_set_epi32(0, 0, 0, 0);
-			size_t yBottom;
-			
-			for(yBottom=0;yBottom<Length-1;++yBottom)
-			{
-				const bool *rowPtr = mask->ValuePtr(x, yBottom);
-				
-				// Assign each integer to one bool in the mask
-				// Convert true to 0xFFFFFFFF and false to 0
-				__m128 conditionMask = _mm_castsi128_ps(
-					_mm_cmpeq_epi32(_mm_set_epi32(rowPtr[3], rowPtr[2], rowPtr[1], rowPtr[0]),
-													zero4i));
-				
-				// Conditionally increment counters
-				count4 = _mm_add_epi32(count4, _mm_and_si128(_mm_castps_si128(conditionMask), ones4));
-				
-				// Add values with conditional move
-				__m128 m = _mm_and_ps(_mm_load_ps(input->ValuePtr(x, yBottom)), conditionMask);
-				sum4 = _mm_add_ps(sum4, _mm_or_ps(m, _mm_andnot_ps(conditionMask, zero4)));
-			}
-			
-			size_t yTop = 0;
-			while(yBottom < height)
-			{
-				// ** Add the 4 sample at the bottom **
-				
-				// get a ptr
-				const bool *rowPtr = mask->ValuePtr(x, yBottom);
-				
-				// Assign each integer to one bool in the mask
-				// Convert true to 0xFFFFFFFF and false to 0
-				__m128 conditionMask = _mm_castsi128_ps(
-					_mm_cmpeq_epi32(_mm_set_epi32(rowPtr[3], rowPtr[2], rowPtr[1], rowPtr[0]),
-													_mm_set_epi32(0, 0, 0, 0)));
-				
-				// Conditionally increment counters
-				count4 = _mm_add_epi32(count4, _mm_and_si128(_mm_castps_si128(conditionMask), ones4));
-				
-				// Add values with conditional move
-				sum4 = _mm_add_ps(sum4,
-					_mm_or_ps(_mm_and_ps(_mm_load_ps(input->ValuePtr(x, yBottom)), conditionMask),
-										_mm_andnot_ps(conditionMask, zero4)));
-				
-				// ** Check sum **
-				
-				// if sum/count > threshold || sum/count < -threshold
-				__m128 avg4 = _mm_div_ps(sum4, _mm_cvtepi32_ps(count4));
-				const unsigned flagConditions =
-					_mm_movemask_ps(_mm_cmpgt_ps(avg4, threshold4Pos)) |
-					_mm_movemask_ps(_mm_cmplt_ps(avg4, threshold4Neg));
-				// | _mm_movemask_ps(_mm_cmplt_ps(count4, zero4i));
-				
-				// The assumption is that most of the values are actually not thresholded, hence, if
-				// this is the case, we circumvent the whole loop at the cost of one extra comparison:
-				if(flagConditions != 0)
-				{
-					union
-					{
-						bool theChars[4];
-						unsigned theInt;
-					} outputValues = { {
-						(flagConditions&1)!=0,
-						(flagConditions&2)!=0,
-						(flagConditions&4)!=0,
-						(flagConditions&8)!=0 } };
-
-					for(size_t i=0;i<Length;++i)
-					{
-						unsigned *outputPtr = reinterpret_cast<unsigned*>(maskCopy->ValuePtr(x, yTop + i));
-						
-						*outputPtr |= outputValues.theInt;
-					}
-				}
-				
-				// ** Subtract the sample at the top **
-				
-				// get a ptr
-				const bool *tRowPtr = mask->ValuePtr(x, yTop);
-				
-				// Assign each integer to one bool in the mask
-				// Convert true to 0xFFFFFFFF and false to 0
-				conditionMask = _mm_castsi128_ps(
-					_mm_cmpeq_epi32(_mm_set_epi32(tRowPtr[3], tRowPtr[2], tRowPtr[1], tRowPtr[0]),
-													zero4i));
-				
-				// Conditionally decrement counters
-				count4 = _mm_sub_epi32(count4, _mm_and_si128(_mm_castps_si128(conditionMask), ones4));
-				
-				// Subtract values with conditional move
-				sum4 = _mm_sub_ps(sum4,
-					_mm_or_ps(_mm_and_ps(_mm_load_ps(input->ValuePtr(x, yTop)), conditionMask),
-										_mm_andnot_ps(conditionMask, zero4)));
-				
-				// ** Next... **
-				++yTop;
-				++yBottom;
-			}
-		}
-	}
-	mask->Swap(*maskCopy);
-	delete maskCopy;
-}
-
-template<size_t Length>
-void ThresholdMitigater::HorizontalSumThresholdLargeSSE(Image2DCPtr input, Mask2DPtr mask, num_t threshold)
-{
-	// The idea of the horizontal SSE version is to read four ('y') rows and
-	// process them simultaneously. 
-	
-	// Currently, this SSE horizontal version is not significant faster
-	// (less than ~3%) than the
-	// Non-SSE horizontal version. This has probably to do with 
-	// rather randomly reading through the set (first (0,0)-(0,3), then (1,0)-(1,3), etc)
-	// this introduces cache misses and/or many smaller reading requests
-	
-	
-	Mask2D *maskCopy = Mask2D::CreateCopy(*mask);
-	const size_t width = mask->Width(), height = mask->Height();
-	const __m128 zero4 = _mm_set_ps(0.0, 0.0, 0.0, 0.0);
-	const __m128i zero4i = _mm_set_epi32(0, 0, 0, 0);
-	const __m128i ones4 = _mm_set_epi32(1, 1, 1, 1);
-	const __m128 threshold4Pos = _mm_set1_ps(threshold);
-	const __m128 threshold4Neg = _mm_set1_ps(-threshold); 
-	if(Length <= width)
-	{
-		for(size_t y=0;y<height;y += 4)
-		{
-			__m128 sum4 = _mm_set_ps(0.0, 0.0, 0.0, 0.0);
-			__m128i count4 = _mm_set_epi32(0, 0, 0, 0);
-			size_t xRight;
-			
-			const bool
-				*rFlagPtrA = mask->ValuePtr(0, y+3),
-				*rFlagPtrB = mask->ValuePtr(0, y+2),
-				*rFlagPtrC = mask->ValuePtr(0, y+1),
-				*rFlagPtrD = mask->ValuePtr(0, y);
-			const num_t
-				*rValPtrA = input->ValuePtr(0, y+3),
-				*rValPtrB = input->ValuePtr(0, y+2),
-				*rValPtrC = input->ValuePtr(0, y+1),
-				*rValPtrD = input->ValuePtr(0, y);
-				
-			for(xRight=0;xRight<Length-1;++xRight)
-			{
-				// Assign each integer to one bool in the mask
-				// Convert true to 0xFFFFFFFF and false to 0
-				__m128 conditionMask = _mm_castsi128_ps(
-					_mm_cmpeq_epi32(_mm_set_epi32(*rFlagPtrA, *rFlagPtrB, *rFlagPtrC, *rFlagPtrD),
-													zero4i));
-				
-				// Conditionally increment counters (nr unflagged samples)
-				count4 = _mm_add_epi32(count4, _mm_and_si128(_mm_castps_si128(conditionMask), ones4));
-				
-				// Load 4 samples
-				__m128 v = _mm_set_ps(*rValPtrA,
-															*rValPtrB,
-															*rValPtrC,
-															*rValPtrD);
-				
-				// Add values with conditional move
-				sum4 = _mm_add_ps(sum4, _mm_or_ps(_mm_and_ps(v, conditionMask),
-																					_mm_andnot_ps(conditionMask, zero4)));
-				
-				++rFlagPtrA;
-				++rFlagPtrB;
-				++rFlagPtrC;
-				++rFlagPtrD;
-
-				++rValPtrA;
-				++rValPtrB;
-				++rValPtrC;
-				++rValPtrD;
-			}
-			
-			size_t xLeft = 0;
-			const bool
-				*lFlagPtrA = mask->ValuePtr(0, y+3),
-				*lFlagPtrB = mask->ValuePtr(0, y+2),
-				*lFlagPtrC = mask->ValuePtr(0, y+1),
-				*lFlagPtrD = mask->ValuePtr(0, y);
-			const num_t
-				*lValPtrA = input->ValuePtr(0, y+3),
-				*lValPtrB = input->ValuePtr(0, y+2),
-				*lValPtrC = input->ValuePtr(0, y+1),
-				*lValPtrD = input->ValuePtr(0, y);
-				
-			while(xRight < width)
-			{
-				// ** Add the sample at the right **
-				
-				// Assign each integer to one bool in the mask
-				// Convert true to 0xFFFFFFFF and false to 0
-				__m128 conditionMask = _mm_castsi128_ps(
-					_mm_cmpeq_epi32(_mm_set_epi32(*rFlagPtrA, *rFlagPtrB, *rFlagPtrC, *rFlagPtrD),
-													zero4i));
-				
-				// Conditionally increment counters
-				count4 = _mm_add_epi32(count4, _mm_and_si128(_mm_castps_si128(conditionMask), ones4));
-				
-				// Load 4 samples
-				__m128 v = _mm_set_ps(*rValPtrA,
-															*rValPtrB,
-															*rValPtrC,
-															*rValPtrD);
-				
-				// Add values with conditional move (sum4 += (v & m) | (m & ~0) ).
-				sum4 = _mm_add_ps(sum4, _mm_or_ps(_mm_and_ps(v, conditionMask), 
-																					_mm_andnot_ps(conditionMask, zero4)));
-				
-				// ** Check sum **
-				
-				// if sum/count > threshold || sum/count < -threshold
-				__m128 count4AsSingle = _mm_cvtepi32_ps(count4);
-				const unsigned flagConditions =
-					_mm_movemask_ps(_mm_cmpgt_ps(_mm_div_ps(sum4, count4AsSingle), threshold4Pos)) |
-					_mm_movemask_ps(_mm_cmplt_ps(_mm_div_ps(sum4, count4AsSingle), threshold4Neg));
-				
-				/*if((flagConditions & 8) != 0)
-				{
-					float vf;
-					_mm_store_ss(&vf, v);
-					std::cout << vf << "=" << input->Value(xRight, y+3) << '|';
-					float fsum;
-					_mm_store_ss(&fsum, sum4);
-					float f;
-					_mm_store_ss(&f, _mm_div_ps(sum4, count4AsSingle));
-					std::cout << xLeft << ":" << input->Value(xRight-1, y+3) << '+' << input->Value(xRight, y+3) << '=' << fsum << "/..=" << f << ',';
-				}*/
-					
-				if((flagConditions & 1) != 0)
-					maskCopy->SetHorizontalValues(xLeft, y, true, Length);
-				if((flagConditions & 2) != 0)
-					maskCopy->SetHorizontalValues(xLeft, y+1, true, Length);
-				if((flagConditions & 4) != 0)
-					maskCopy->SetHorizontalValues(xLeft, y+2, true, Length);
-				if((flagConditions & 8) != 0)
-					maskCopy->SetHorizontalValues(xLeft, y+3, true, Length);
-				
-				// ** Subtract the sample at the left **
-				
-				// Assign each integer to one bool in the mask
-				// Convert true to 0xFFFFFFFF and false to 0
-				conditionMask = _mm_castsi128_ps(
-					_mm_cmpeq_epi32(_mm_set_epi32(*lFlagPtrA, *lFlagPtrB, *lFlagPtrC, *lFlagPtrD),
-													zero4i));
-				
-				// Conditionally decrement counters
-				count4 = _mm_sub_epi32(count4, _mm_and_si128(_mm_castps_si128(conditionMask), ones4));
-				
-				// Load 4 samples
-				v = _mm_set_ps(*lValPtrA,
-											 *lValPtrB,
-											 *lValPtrC,
-											 *lValPtrD);
-				
-				// Subtract values with conditional move
-				sum4 = _mm_sub_ps(sum4,
-					_mm_or_ps(_mm_and_ps(v, conditionMask), _mm_andnot_ps(conditionMask, zero4)));
-				
-				// ** Next... **
-				++xLeft;
-				++xRight;
-				
-				++rFlagPtrA;
-				++rFlagPtrB;
-				++rFlagPtrC;
-				++rFlagPtrD;
-				
-				++lFlagPtrA;
-				++lFlagPtrB;
-				++lFlagPtrC;
-				++lFlagPtrD;
-
-				++rValPtrA;
-				++rValPtrB;
-				++rValPtrC;
-				++rValPtrD;
-				
-				++lValPtrA;
-				++lValPtrB;
-				++lValPtrC;
-				++lValPtrD;
-			}
-		}
-	}
-	mask->Swap(*maskCopy);
-	delete maskCopy;
-}
-
-template
-void ThresholdMitigater::VerticalSumThresholdLargeSSE<1>(Image2DCPtr input, Mask2DPtr mask, num_t threshold);
-template
-void ThresholdMitigater::VerticalSumThresholdLargeSSE<2>(Image2DCPtr input, Mask2DPtr mask, num_t threshold);
-template
-void ThresholdMitigater::VerticalSumThresholdLargeSSE<4>(Image2DCPtr input, Mask2DPtr mask, num_t threshold);
-template
-void ThresholdMitigater::VerticalSumThresholdLargeSSE<8>(Image2DCPtr input, Mask2DPtr mask, num_t threshold);
-template
-void ThresholdMitigater::VerticalSumThresholdLargeSSE<16>(Image2DCPtr input, Mask2DPtr mask, num_t threshold);
-template
-void ThresholdMitigater::VerticalSumThresholdLargeSSE<32>(Image2DCPtr input, Mask2DPtr mask, num_t threshold);
-template
-void ThresholdMitigater::VerticalSumThresholdLargeSSE<64>(Image2DCPtr input, Mask2DPtr mask, num_t threshold);
-template
-void ThresholdMitigater::VerticalSumThresholdLargeSSE<128>(Image2DCPtr input, Mask2DPtr mask, num_t threshold);
-template
-void ThresholdMitigater::VerticalSumThresholdLargeSSE<256>(Image2DCPtr input, Mask2DPtr mask, num_t threshold);
-
-
-template
-void ThresholdMitigater::HorizontalSumThresholdLargeSSE<1>(Image2DCPtr input, Mask2DPtr mask, num_t threshold);
-template
-void ThresholdMitigater::HorizontalSumThresholdLargeSSE<2>(Image2DCPtr input, Mask2DPtr mask, num_t threshold);
-template
-void ThresholdMitigater::HorizontalSumThresholdLargeSSE<4>(Image2DCPtr input, Mask2DPtr mask, num_t threshold);
-template
-void ThresholdMitigater::HorizontalSumThresholdLargeSSE<8>(Image2DCPtr input, Mask2DPtr mask, num_t threshold);
-template
-void ThresholdMitigater::HorizontalSumThresholdLargeSSE<16>(Image2DCPtr input, Mask2DPtr mask, num_t threshold);
-template
-void ThresholdMitigater::HorizontalSumThresholdLargeSSE<32>(Image2DCPtr input, Mask2DPtr mask, num_t threshold);
-template
-void ThresholdMitigater::HorizontalSumThresholdLargeSSE<64>(Image2DCPtr input, Mask2DPtr mask, num_t threshold);
-template
-void ThresholdMitigater::HorizontalSumThresholdLargeSSE<128>(Image2DCPtr input, Mask2DPtr mask, num_t threshold);
-template
-void ThresholdMitigater::HorizontalSumThresholdLargeSSE<256>(Image2DCPtr input, Mask2DPtr mask, num_t threshold);
diff --git a/CEP/DP3/AOFlagger/src/strategy/algorithms/svdmitigater.cpp b/CEP/DP3/AOFlagger/src/strategy/algorithms/svdmitigater.cpp
deleted file mode 100644
index 2bcc671ec0c1f1565265a9f43d53ab17462dece7..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/strategy/algorithms/svdmitigater.cpp
+++ /dev/null
@@ -1,197 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <lofar_config.h>
-#include <AOFlagger/util/stopwatch.h>
-
-#include <AOFlagger/strategy/algorithms/svdmitigater.h>
-
-#ifdef HAVE_GTKMM
- #include <AOFlagger/gui/plot/plot2d.h>
-#endif
-
-extern "C" {
-  int zgesvd_(char *jobu, char *jobvt, integer *m, integer *n, 
-	      doublecomplex *a, integer *lda, doublereal *s, doublecomplex *u, 
-	      integer *ldu, doublecomplex *vt, integer *ldvt, doublecomplex *work, 
-	      integer *lwork, doublereal *rwork, integer *info);
-}
-
-SVDMitigater::SVDMitigater() : _background(0), _singularValues(0), _leftSingularVectors(0), _rightSingularVectors(0), _iteration(0), _removeCount(10),  _verbose(false)
-{
-}
-
-
-SVDMitigater::~SVDMitigater()
-{
-	Clear();
-}
-
-void SVDMitigater::Clear()
-{
-	if(IsDecomposed()) {
-		delete[] _singularValues;
-		delete[] _leftSingularVectors;
-		delete[] _rightSingularVectors;
-		_singularValues = 0;
-		_leftSingularVectors = 0;
-		_rightSingularVectors = 0;
-	}
-	if(_background != 0)
-		delete _background;
-}
-
-// lda = leading dimension
-
-/*int cgebrd_(integer *m, integer *n, complex *a, integer *lda,
-         real *d__, real *e, complex *tauq, complex *taup, complex *work,
-        integer *lwork, integer *info);*/
-
-void SVDMitigater::Decompose()
-{
-	if(_verbose)
-		std::cout << "Decomposing..." << std::endl;
-	Stopwatch watch;
-	watch.Start();
-	Clear();
-
-	// Remember that the axes have to be turned; in 'a', time is along the vertical axis.
-	_m = _data.ImageHeight();
-	_n = _data.ImageWidth();
-	int minmn = _m<_n ? _m : _n;
-	char rowsOfU = 'A'; // all rows of u
-	char rowsOfVT = 'A'; // all rows of VT
-	doublecomplex *a = new doublecomplex[_m * _n];
-	Image2DCPtr
-		real = _data.GetRealPart(),
-		imaginary = _data.GetImaginaryPart();
-	for(int t=0;t<_n;++t) {
-		for(int f=0;f<_m; ++f) {
-			a[t*_m + f].r = real->Value(t, f);
-			a[t*_m + f].i = imaginary->Value(t, f);
-		}
-	}
-	long int lda = _m;
-	_singularValues = new double[minmn];
-	for(int i=0;i<minmn;++i)
-		_singularValues[i] = 0.0;
-	_leftSingularVectors = new doublecomplex[_m*_m];
-	for(int i=0;i<_m*_m;++i) {
-		_leftSingularVectors[i].r = 0.0;
-		_leftSingularVectors[i].i = 0.0;
-	}
-	_rightSingularVectors = new doublecomplex[_n*_n];
-	for(int i=0;i<_n*_n;++i) {
-		_rightSingularVectors[i].r = 0.0;
-		_rightSingularVectors[i].i = 0.0;
-	}
-	long int info = 0;
-	doublecomplex complexWorkAreaSize;
-	long int workAreaSize = -1;
-	double *workArea2 = new double[5 * minmn];
-
-	// Determine optimal workareasize
-	zgesvd_(&rowsOfU, &rowsOfVT, &_m, &_n, a, &lda, _singularValues, _leftSingularVectors, &_m, _rightSingularVectors, &_n, &complexWorkAreaSize, &workAreaSize, workArea2, &info);
-
-	if(info == 0)
-	{
-		if(_verbose)
-			std::cout << "zgesvd_..." << std::endl;
-		workAreaSize = (int) complexWorkAreaSize.r;
-		doublecomplex *workArea1 = new doublecomplex[workAreaSize];
-		zgesvd_(&rowsOfU, &rowsOfVT, &_m, &_n, a, &lda, _singularValues, _leftSingularVectors, &_m, _rightSingularVectors, &_n, workArea1, &workAreaSize, workArea2, &info);
-
-		delete[] workArea1;
-	}
-	delete[] workArea2;
-	delete[] a;
-
-	if(_verbose) {
-		for(int i=0;i<minmn;++i)
-			std::cout << _singularValues[i] << ",";
-		std::cout << std::endl;
-		std::cout << watch.ToString() << std::endl;
-	}
-}
-
-void SVDMitigater::Compose()
-{
-	if(_verbose)
-		std::cout << "Composing..." << std::endl;
-	Stopwatch watch;
-	watch.Start();
-	Image2DPtr real = Image2D::CreateUnsetImagePtr(_data.ImageWidth(), _data.ImageHeight());
-	Image2DPtr imaginary = Image2D::CreateUnsetImagePtr(_data.ImageWidth(), _data.ImageHeight());
-	int minmn = _m<_n ? _m : _n;
-	for(int t=0;t<_n;++t) {
-		for(int f=0;f<_m; ++f) {
-			double a_tf_r = 0.0;
-			double a_tf_i = 0.0;
-			// A = U S V^T , so:
-			// a_tf = \sum_{g=0}^{minmn} U_{gf} S_{gg} V^T_{tg}
-			// Note that _rightSingularVectors=V^T, thus is already stored rowwise
-			for(int g=0;g<minmn;++g) {
-				double u_r = _leftSingularVectors[g*_m + f].r;
-				double u_i = _leftSingularVectors[g*_m + f].i;
-				double s = _singularValues[g];
-				double v_r = _rightSingularVectors[t*_n + g].r;
-				double v_i = _rightSingularVectors[t*_n + g].i;
-				a_tf_r += s * (u_r * v_r - u_i * v_i);
-				a_tf_i += s * (u_r * v_i + u_i * v_r);
-			}
-			real->SetValue(t, f, a_tf_r);
-			imaginary->SetValue(t, f, a_tf_i);
-		}
-	}
-	if(_background != 0)
-		delete _background;
-	_background = new TimeFrequencyData(SinglePolarisation, real, imaginary);
-	if(_verbose)
-		std::cout << watch.ToString() << std::endl;
-}
-
-
-#ifdef HAVE_GTKMM
-
-void SVDMitigater::CreateSingularValueGraph(const TimeFrequencyData &data, Plot2D &plot)
-{
-	size_t polarisationCount = data.PolarisationCount();
-	plot.SetTitle("Distribution of singular values");
-	plot.SetLogarithmicYAxis(true);
-	for(size_t i=0;i<polarisationCount;++i)
-	{
-		TimeFrequencyData *polarizationData = data.CreateTFDataFromPolarisationIndex(i);
-		SVDMitigater svd;
-		svd.Initialize(*polarizationData);
-		svd.Decompose();
-		size_t minmn = svd._m<svd._n ? svd._m : svd._n;
-		
-		Plot2DPointSet &pointSet = plot.StartLine(polarizationData->Description());
-		pointSet.SetXDesc("Singular value index");
-		pointSet.SetYDesc("Singular value");
-		
-		for(size_t i=0;i<minmn;++i)
-			plot.PushDataPoint(i, svd.SingularValue(i));
-	}
-}
-
-#else
-void SVDMitigater::CreateSingularValueGraph(const TimeFrequencyData &, Plot2D &)
-{}
-#endif
diff --git a/CEP/DP3/AOFlagger/src/strategy/algorithms/thresholdconfig.cpp b/CEP/DP3/AOFlagger/src/strategy/algorithms/thresholdconfig.cpp
deleted file mode 100644
index 4409195cb76534af623e346fad30ea675e395b57..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/strategy/algorithms/thresholdconfig.cpp
+++ /dev/null
@@ -1,332 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <AOFlagger/strategy/algorithms/thresholdconfig.h>
-
-#include <iostream>
-#include <math.h>
-
-#include <AOFlagger/msio/image2d.h>
-
-#include <AOFlagger/util/rng.h>
-
-#include <AOFlagger/strategy/algorithms/localfitmethod.h>
-#include <AOFlagger/strategy/algorithms/thresholdmitigater.h>
-#include <AOFlagger/strategy/algorithms/thresholdtools.h>
-
-ThresholdConfig::ThresholdConfig() :
-	_method(SumThreshold), _distribution(Gaussian), _verbose(false), _expFactor(0.0L), _fitMethod(0), _minConnectedSamples(1)
-{
-}
-
-ThresholdConfig::~ThresholdConfig()
-{
-}
-
-void ThresholdConfig::InitializeLengthsFrom(unsigned count, unsigned startLength)
-{
-	if(count > 6 || count == 0)
-		count = 6;
-	if(startLength == 0)
-		startLength = 1;
-	struct ThresholdOperation o[6];
-	o[0].length = startLength;
-	o[1].length = startLength + 1;
-	o[2].length = startLength + 3;
-	o[3].length = startLength + 7;
-	o[4].length = startLength + 15;
-	o[5].length = startLength + 63;
-	_horizontalOperations.clear();
-	_verticalOperations.clear();
-	for(unsigned i=0;i<count;++i)
-	{
-		_horizontalOperations.push_back(o[i]);
-		_verticalOperations.push_back(o[i]);
-	}
-}
-
-void ThresholdConfig::InitializeLengthsDefault(unsigned count)
-{
-	if(count > 9 || count == 0)
-		count = 9;
-	struct ThresholdOperation o[9];
-	o[0].length = 1;
-	o[1].length = 2;
-	o[2].length = 4;
-	o[3].length = 8;
-	o[4].length = 16;
-	o[5].length = 32;
-	o[6].length = 64;
-	o[7].length = 128;
-	o[8].length = 256;
-	_horizontalOperations.clear();
-	_verticalOperations.clear();
-	for(unsigned i=0;i<count;++i)
-	{
-		_horizontalOperations.push_back(o[i]);
-		_verticalOperations.push_back(o[i]);
-	}
-}
-
-void ThresholdConfig::InitializeLengthsSingleSample()
-{
-	ThresholdOperation operation;
-	operation.length = 1;
-	_horizontalOperations.push_back(operation);
-	_verticalOperations.push_back(operation);
-}
-
-void ThresholdConfig::InitializeThresholdsFromFirstThreshold(num_t firstThreshold, enum Distribution noiseDistribution)
-{
-	// Previously:
-		//_operations[i].threshold = firstThreshold * powl(sqrtl(sqrtl(2.0))*sqrtl(2.0), logl(_operations[i].length)/logl(2.0)) / (long double) _operations[i].length;
-	num_t expFactor = _expFactor;
-	if(expFactor == 0.0L) {
-		switch(_method) {
-		default:
-		case SumThreshold:
-			expFactor = 1.5;
-			break;
-		case VarThreshold:
-			expFactor = 1.2;
-			break;
-		}
-	}
-	for(unsigned i=0;i<_horizontalOperations.size();++i)
-	{
-		_horizontalOperations[i].threshold = firstThreshold * pow(expFactor, logn(_horizontalOperations[i].length)/logn(2.0)) / (num_t) _horizontalOperations[i].length;
-	}
-	for(unsigned i=0;i<_verticalOperations.size();++i)
-	{
-		_verticalOperations[i].threshold = firstThreshold * pown(expFactor, logn(_verticalOperations[i].length)/logn(2.0)) / (num_t) _verticalOperations[i].length;
-	}
-	_distribution = noiseDistribution;
-}
-
-void ThresholdConfig::InitializeThresholdsWithFalseRate(size_t resolution, num_t falseAlarmRate, enum Distribution noiseDistribution)
-{
-	InitializeThresholdsFromFirstThreshold(1.0, noiseDistribution);
-	BinarySearch(falseAlarmRate, falseAlarmRate / 25.0, resolution);
-	for(unsigned i=0;i<_horizontalOperations.size();++i)
-		std::cout << "/ " << _horizontalOperations[i].threshold;
-	std::cout << std::endl;
-}
-
-void ThresholdConfig::BinarySearch(num_t probability, num_t accuracy, size_t resolution)
-{
-	num_t leftLimit = 0.0;
-	num_t rightLimit = 1.0;
-	for(unsigned i=0;i<_horizontalOperations.size();++i)
-		_horizontalOperations[i].threshold *= rightLimit;
-	for(unsigned i=0;i<_verticalOperations.size();++i)
-		_verticalOperations[i].threshold *= rightLimit;
-	num_t p = CalculateFalseAlarmRate(resolution, _distribution);
-	for(unsigned i=0;i<_horizontalOperations.size();++i)
-		_horizontalOperations[i].threshold /= rightLimit;
-	for(unsigned i=0;i<_verticalOperations.size();++i)
-		_verticalOperations[i].threshold /= rightLimit;
-	//cout << "P(" << rightLimit << "," << samples << ")=" << p << endl;
-	while(p > probability) {
-		rightLimit *= 2;
-
-		for(unsigned i=0;i<_horizontalOperations.size();++i)
-			_horizontalOperations[i].threshold *= rightLimit;
-		for(unsigned i=0;i<_verticalOperations.size();++i)
-			_verticalOperations[i].threshold *= rightLimit;
-		
-		p =  CalculateFalseAlarmRate(resolution, _distribution);
-		
-		for(unsigned i=0;i<_horizontalOperations.size();++i)
-			_horizontalOperations[i].threshold /= rightLimit;
-		for(unsigned i=0;i<_verticalOperations.size();++i)
-			_verticalOperations[i].threshold /= rightLimit;
-		//cout << "P(" << rightLimit << "," << samples << ")=" << p << endl;
-	}
-	num_t m = (rightLimit - leftLimit) / 2.0;
-
-	for(unsigned i=0;i<_horizontalOperations.size();++i)
-		_horizontalOperations[i].threshold *= m;
-	for(unsigned i=0;i<_verticalOperations.size();++i)
-		_verticalOperations[i].threshold *= m;
-	
-	p =  CalculateFalseAlarmRate(resolution, _distribution);
-	
-	for(unsigned i=0;i<_horizontalOperations.size();++i)
-		_horizontalOperations[i].threshold /= m;
-	for(unsigned i=0;i<_verticalOperations.size();++i)
-		_verticalOperations[i].threshold /= m;
-
-	//cout << "P(" << m << "," << samples << ")=" << p << endl;
-	int iterations = 0;
-	while(fabsf(p - probability) > accuracy && iterations < 15)
-	{
-		if(p > probability)
-			leftLimit = m;
-		else
-			rightLimit = m;
-		m = (rightLimit + leftLimit) / 2.0;
-
-		for(unsigned i=0;i<_horizontalOperations.size();++i)
-			_horizontalOperations[i].threshold *= m;
-		for(unsigned i=0;i<_verticalOperations.size();++i)
-			_verticalOperations[i].threshold *= m;
-		
-		p =  CalculateFalseAlarmRate(resolution, _distribution);
-		
-		for(unsigned i=0;i<_horizontalOperations.size();++i)
-			_horizontalOperations[i].threshold /= m;
-		for(unsigned i=0;i<_verticalOperations.size();++i)
-			_verticalOperations[i].threshold /= m;
-
-		std::cout << "P(" << m << ")=" << p << std::endl;
-		++iterations;
-	}
-	for(unsigned i=0;i<_horizontalOperations.size();++i)
-		_horizontalOperations[i].threshold *= m;
-	for(unsigned i=0;i<_verticalOperations.size();++i)
-		_verticalOperations[i].threshold *= m;
-}
-
-void ThresholdConfig::Execute(Image2DCPtr image, Mask2DPtr mask, bool additive, num_t sensitivity) const
-{
-	num_t factor;
-	
-	switch(_distribution) {
-		case Gaussian: {
-		num_t mean, stddev;
-		ThresholdTools::WinsorizedMeanAndStdDev(image, mask, mean, stddev);
-		if(stddev == 0.0L)
-			factor = sensitivity;
-		else
-			factor = stddev * sensitivity;
-		if(_verbose)
-			std::cout << "Stddev=" << stddev << " first threshold=" << _horizontalOperations[0].threshold*factor << std::endl; 
-		} break;
-		case Rayleigh: {
-		num_t mode = ThresholdTools::WinsorizedMode(image, mask);
-		if(mode == 0.0L)
-			factor = sensitivity;
-		else
-			factor = sensitivity * mode;
-		if(_verbose) {
-			num_t mean, stddev;
-			ThresholdTools::WinsorizedMeanAndStdDev(image, mask, mean, stddev);
-			std::cout << "Mode=" << mode << " first threshold=" << _horizontalOperations[0].threshold*factor << std::endl;
-			std::cout << "Stddev=" << stddev << std::endl; 
-		} 
-		} break;
-		default:
-		factor = sensitivity;
-		break;
-	}
-
-	if(!additive)
-		mask->SetAll<false>();
-
-	size_t operationCount = _horizontalOperations.size() > _verticalOperations.size() ?
-		_horizontalOperations.size() : _verticalOperations.size();
-	for(unsigned i=0;i<operationCount;++i) {
-		switch(_method) {
-			case SumThreshold:
-			
-			if(i < _horizontalOperations.size())
-			{
-				if(_verbose)
-					std::cout << "Performing SumThreshold with length " << _horizontalOperations[i].length 
-						<< ", threshold " << _horizontalOperations[i].threshold*factor << "..." << std::endl;
-				ThresholdMitigater::HorizontalSumThresholdLarge(image, mask, _horizontalOperations[i].length, _horizontalOperations[i].threshold*factor);
-			}
-			
-			if(i < _verticalOperations.size())
-				ThresholdMitigater::VerticalSumThresholdLarge(image, mask, _verticalOperations[i].length, _verticalOperations[i].threshold*factor);
-			break;
-			case VarThreshold:
-			if(i < _horizontalOperations.size())
-			{
-				if(_verbose)
-					std::cout << "Performing VarThreshold with length " << _horizontalOperations[i].length 
-						<< ", threshold " << _horizontalOperations[i].threshold*factor << "..." << std::endl;
-				ThresholdMitigater::HorizontalVarThreshold(image, mask, _horizontalOperations[i].length, _horizontalOperations[i].threshold*factor);
-			}
-			if(i < _verticalOperations.size())
-				ThresholdMitigater::HorizontalVarThreshold(image, mask, _verticalOperations[i].length, _verticalOperations[i].threshold*factor);
-			break;
-		}
-	}
-
-	if(_minConnectedSamples > 1)
-		ThresholdTools::FilterConnectedSamples(mask, _minConnectedSamples);
-} 
-
-num_t ThresholdConfig::CalculateFalseAlarmRate(size_t resolution, enum Distribution noiseDistribution)
-{
-	Image2DPtr image = Image2D::CreateZeroImagePtr(resolution, resolution);
-	Mask2DPtr mask = Mask2D::CreateSetMaskPtr<false>(resolution, resolution);
-	for(unsigned y=0;y<resolution;++y) {
-		for(unsigned x=0;x<resolution;++x) {
-			switch(noiseDistribution) {
-				case Uniform:
-				image->SetValue(x, y, RNG::Uniform());
-				break;
-				case Gaussian:
-				image->SetValue(x, y, RNG::Gaussian());
-				break;
-				case Rayleigh:
-				image->SetValue(x, y, RNG::Rayleigh());
-				break;
-			}
-		}
-	}
-	if(_fitMethod != 0)
-	{
-		TimeFrequencyData *data;
-		if(_fitMethod->PhaseRepresentation() == TimeFrequencyData::ComplexRepresentation) { 
-			data = new TimeFrequencyData(SinglePolarisation, image, image);
-		} else
-			data = new TimeFrequencyData(TimeFrequencyData::AmplitudePart, SinglePolarisation, image);
-		data->SetGlobalMask(mask);
-		_fitMethod->Initialize(*data);
-		for(unsigned i=0;i<_fitMethod->TaskCount();++i)
-			_fitMethod->PerformFit(i);
-		Image2D *diff = Image2D::CreateFromDiff(*image, *_fitMethod->Background().GetSingleImage());
-		image->SetValues(*diff);
-		delete diff;
-	}
-	Execute(image, mask, true, 1.0L);
-	num_t prob = (num_t) mask->GetCount<true>() / (resolution*resolution);
-	int lengths[32];
-	ThresholdTools::CountMaskLengths(mask, lengths, 32);
-	for(unsigned j=1;j<33;++j) {
-		if(_verbose)
-			std::cout << "," << (num_t)  lengths[j-1]*j / (resolution*resolution);
-		for(unsigned i=0;i<_horizontalOperations.size();++i) {
-			if(j == _horizontalOperations[i].length) {
-				_horizontalOperations[i].rate = (num_t) lengths[j-1]*j / (resolution*resolution*j);
-			}
-		}
-		for(unsigned i=0;i<_verticalOperations.size();++i) {
-			if(j == _verticalOperations[i].length) {
-				_verticalOperations[i].rate = (num_t) lengths[j-1]*j / (resolution*resolution*j);
-			}
-		}
-	}
-	if(_verbose)
-		std::cout << std::endl;
-	return prob;
-}
diff --git a/CEP/DP3/AOFlagger/src/strategy/algorithms/thresholdmitigater.cpp b/CEP/DP3/AOFlagger/src/strategy/algorithms/thresholdmitigater.cpp
deleted file mode 100644
index 5b0a5e3f934a5516895dc63bf0ca95b85206b08e..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/strategy/algorithms/thresholdmitigater.cpp
+++ /dev/null
@@ -1,286 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <AOFlagger/msio/image2d.h>
-
-#include <AOFlagger/strategy/algorithms/thresholdmitigater.h>
-#include <AOFlagger/strategy/algorithms/thresholdtools.h>
-
-template<size_t Length>
-void ThresholdMitigater::HorizontalSumThreshold(Image2DCPtr input, Mask2DPtr mask, num_t threshold)
-{
-	if(Length <= input->Width())
-	{
-		size_t width = input->Width()-Length+1; 
-		for(size_t y=0;y<input->Height();++y) {
-			for(size_t x=0;x<width;++x) {
-				num_t sum = 0.0;
-				size_t count = 0;
-				for(size_t i=0;i<Length;++i) {
-					if(!mask->Value(x+i, y)) {
-						sum += input->Value(x+i, y);
-						count++;
-					}
-				}
-				if(count>0 && fabs(sum/count) > threshold) {
-					for(size_t i=0;i<Length;++i)
-						mask->SetValue(x + i, y, true);
-				}
-			}
-		}
-	}
-}
-
-template<size_t Length>
-void ThresholdMitigater::VerticalSumThreshold(Image2DCPtr input, Mask2DPtr mask, num_t threshold)
-{
-	if(Length <= input->Height())
-	{
-		size_t height = input->Height()-Length+1; 
-		for(size_t y=0;y<height;++y) {
-			for(size_t x=0;x<input->Width();++x) {
-				num_t sum = 0.0;
-				size_t count = 0;
-				for(size_t i=0;i<Length;++i) {
-					if(!mask->Value(x, y+i)) {
-						sum += input->Value(x, y + i);
-						count++;
-					}
-				}
-				if(count>0 && fabs(sum/count) > threshold) {
-					for(size_t i=0;i<Length;++i)
-					mask->SetValue(x, y + i, true);
-				}
-			}
-		}
-	}
-}
-
-template<size_t Length>
-void ThresholdMitigater::HorizontalSumThresholdLarge(Image2DCPtr input, Mask2DPtr mask, num_t threshold)
-{
-	Mask2DPtr maskCopy = Mask2D::CreateCopy(mask);
-	const size_t width = mask->Width(), height = mask->Height();
-	if(Length <= width)
-	{
-		for(size_t y=0;y<height;++y)
-		{
-			num_t sum = 0.0;
-			size_t count = 0, xLeft, xRight;
-
-			for(xRight=0;xRight<Length-1;++xRight)
-			{
-				if(!mask->Value(xRight, y))
-				{
-					sum += input->Value(xRight, y);
-					count++;
-				}
-			}
-
-			xLeft = 0;
-			while(xRight < width)
-			{
-				// add the sample at the right
-				if(!mask->Value(xRight, y))
-				{
-					sum += input->Value(xRight, y);
-					++count;
-				}
-				// Check
-				if(count>0 && fabs(sum/count) > threshold)
-				{
-					maskCopy->SetHorizontalValues(xLeft, y, true, Length);
-				}
-				// subtract the sample at the left
-				if(!mask->Value(xLeft, y))
-				{
-					sum -= input->Value(xLeft, y);
-					--count;
-				}
-				++xLeft;
-				++xRight;
-			}
-		}
-	}
-	mask->Swap(maskCopy);
-}
-
-template<size_t Length>
-void ThresholdMitigater::VerticalSumThresholdLarge(Image2DCPtr input, Mask2DPtr mask, num_t threshold)
-{
-	Mask2DPtr maskCopy = Mask2D::CreateCopy(mask);
-	const size_t width = mask->Width(), height = mask->Height();
-	if(Length <= height)
-	{
-		for(size_t x=0;x<width;++x)
-		{
-			num_t sum = 0.0;
-			size_t count = 0, yTop, yBottom;
-
-			for(yBottom=0;yBottom<Length-1;++yBottom)
-			{
-				if(!mask->Value(x, yBottom))
-				{
-					sum += input->Value(x, yBottom);
-					++count;
-				}
-			}
-
-			yTop = 0;
-			while(yBottom < height)
-			{
-				// add the sample at the bottom
-				if(!mask->Value(x, yBottom))
-				{
-					sum += input->Value(x, yBottom);
-					++count;
-				}
-				// Check
-				if(count>0 && fabs(sum/count) > threshold)
-				{
-					for(size_t i=0;i<Length;++i)
-						maskCopy->SetValue(x, yTop + i, true);
-				}
-				// subtract the sample at the top
-				if(!mask->Value(x, yTop))
-				{
-					sum -= input->Value(x, yTop);
-					--count;
-				}
-				++yTop;
-				++yBottom;
-			}
-		}
-	}
-	mask->Swap(maskCopy);
-}
-
-void ThresholdMitigater::HorizontalSumThresholdLargeReference(Image2DCPtr input, Mask2DPtr mask, size_t length, num_t threshold)
-{
-	switch(length)
-	{
-		case 1: HorizontalSumThreshold<1>(input, mask, threshold); break;
-		case 2: HorizontalSumThresholdLarge<2>(input, mask, threshold); break;
-		case 4: HorizontalSumThresholdLarge<4>(input, mask, threshold); break;
-		case 8: HorizontalSumThresholdLarge<8>(input, mask, threshold); break;
-		case 16: HorizontalSumThresholdLarge<16>(input, mask, threshold); break;
-		case 32: HorizontalSumThresholdLarge<32>(input, mask, threshold); break;
-		case 64: HorizontalSumThresholdLarge<64>(input, mask, threshold); break;
-		case 128: HorizontalSumThresholdLarge<128>(input, mask, threshold); break;
-		case 256: HorizontalSumThresholdLarge<256>(input, mask, threshold); break;
-		default: throw BadUsageException("Invalid value for length");
-	}	
-}
-
-void ThresholdMitigater::VerticalSumThresholdLargeReference(Image2DCPtr input, Mask2DPtr mask, size_t length, num_t threshold)
-{
-	switch(length)
-	{
-		case 1: VerticalSumThreshold<1>(input, mask, threshold); break;
-		case 2: VerticalSumThresholdLarge<2>(input, mask, threshold); break;
-		case 4: VerticalSumThresholdLarge<4>(input, mask, threshold); break;
-		case 8: VerticalSumThresholdLarge<8>(input, mask, threshold); break;
-		case 16: VerticalSumThresholdLarge<16>(input, mask, threshold); break;
-		case 32: VerticalSumThresholdLarge<32>(input, mask, threshold); break;
-		case 64: VerticalSumThresholdLarge<64>(input, mask, threshold); break;
-		case 128: VerticalSumThresholdLarge<128>(input, mask, threshold); break;
-		case 256: VerticalSumThresholdLarge<256>(input, mask, threshold); break;
-		default: throw BadUsageException("Invalid value for length");
-	}
-}
-
-void ThresholdMitigater::VerticalSumThresholdLargeSSE(Image2DCPtr input, Mask2DPtr mask, size_t length, num_t threshold)
-{
-	switch(length)
-	{
-		case 1: VerticalSumThreshold<1>(input, mask, threshold); break;
-		case 2: VerticalSumThresholdLargeSSE<2>(input, mask, threshold); break;
-		case 4: VerticalSumThresholdLargeSSE<4>(input, mask, threshold); break;
-		case 8: VerticalSumThresholdLargeSSE<8>(input, mask, threshold); break;
-		case 16: VerticalSumThresholdLargeSSE<16>(input, mask, threshold); break;
-		case 32: VerticalSumThresholdLargeSSE<32>(input, mask, threshold); break;
-		case 64: VerticalSumThresholdLargeSSE<64>(input, mask, threshold); break;
-		case 128: VerticalSumThresholdLargeSSE<128>(input, mask, threshold); break;
-		case 256: VerticalSumThresholdLargeSSE<256>(input, mask, threshold); break;
-		default: throw BadUsageException("Invalid value for length");
-	}	
-}
-
-void ThresholdMitigater::HorizontalSumThresholdLargeSSE(Image2DCPtr input, Mask2DPtr mask, size_t length, num_t threshold)
-{
-	switch(length)
-	{
-		case 1: HorizontalSumThreshold<1>(input, mask, threshold); break;
-		case 2: HorizontalSumThresholdLargeSSE<2>(input, mask, threshold); break;
-		case 4: HorizontalSumThresholdLargeSSE<4>(input, mask, threshold); break;
-		case 8: HorizontalSumThresholdLargeSSE<8>(input, mask, threshold); break;
-		case 16: HorizontalSumThresholdLargeSSE<16>(input, mask, threshold); break;
-		case 32: HorizontalSumThresholdLargeSSE<32>(input, mask, threshold); break;
-		case 64: HorizontalSumThresholdLargeSSE<64>(input, mask, threshold); break;
-		case 128: HorizontalSumThresholdLargeSSE<128>(input, mask, threshold); break;
-		case 256: HorizontalSumThresholdLargeSSE<256>(input, mask, threshold); break;
-		default: throw BadUsageException("Invalid value for length");
-	}	
-}
-
-void ThresholdMitigater::HorizontalVarThreshold(Image2DCPtr input, Mask2DPtr mask, size_t length, num_t threshold)
-{
-	size_t width = input->Width()-length+1;
-	for(size_t y=0;y<input->Height();++y) {
-		for(size_t x=0;x<width;++x) {
-			bool flag = true;
-			for(size_t i=0;i<length;++i) {
-				if(input->Value(x+i, y) < threshold && input->Value(x+i, y) > -threshold) {
-					flag = false;
-					break;
-				}
-			}
-			if(flag) {
-				for(size_t i=0;i<length;++i)
-					mask->SetValue(x + i, y, true);
-			}
-		}
-	}
-}
-
-void ThresholdMitigater::VerticalVarThreshold(Image2DCPtr input, Mask2DPtr mask, size_t length, num_t threshold)
-{
-	size_t height = input->Height()-length+1; 
-	for(size_t y=0;y<height;++y) {
-		for(size_t x=0;x<input->Width();++x) {
-			bool flag = true;
-			for(size_t i=0;i<length;++i) {
-				if(input->Value(x, y+i) <= threshold && input->Value(x, y+i) >= -threshold) {
-					flag = false;
-					break;
-				}
-			}
-			if(flag) {
-				for(size_t i=0;i<length;++i)
-					mask->SetValue(x, y + i, true);
-			}
-		}
-	}
-}
-
-void ThresholdMitigater::VarThreshold(Image2DCPtr input, Mask2DPtr mask, size_t length, num_t threshold)
-{
-	HorizontalVarThreshold(input, mask, length, threshold);
-	VerticalVarThreshold(input, mask, length, threshold);
-}
diff --git a/CEP/DP3/AOFlagger/src/strategy/algorithms/thresholdtools.cpp b/CEP/DP3/AOFlagger/src/strategy/algorithms/thresholdtools.cpp
deleted file mode 100644
index 47de472952f3c3769d79e0ce3d27caf6e24846e3..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/strategy/algorithms/thresholdtools.cpp
+++ /dev/null
@@ -1,631 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <deque>
-
-#include <AOFlagger/util/rng.h>
-
-#include <AOFlagger/strategy/algorithms/thresholdtools.h>
-
-void ThresholdTools::MeanAndStdDev(Image2DCPtr image, Mask2DCPtr mask, num_t &mean, num_t &stddev)
-{
-	// Calculate mean
-	mean = 0.0;
-	size_t count = 0;
-	for(size_t y = 0;y<image->Height();++y) {
-		for(size_t x=0;x<image->Width(); ++x) {
-			if(!mask->Value(x, y) && std::isfinite(image->Value(x, y))) {
-				num_t value = image->Value(x, y);
-				mean += value;
-				count++; 
-			}
-		}
-	}
-	mean /= (num_t) count;
-	// Calculate variance
-	stddev = 0.0;
-	count = 0;
-	for(size_t y = 0;y<image->Height();++y) {
-		for(size_t x=0;x<image->Width(); ++x) {
-			if(!mask->Value(x, y) && std::isfinite(image->Value(x, y))) {
-				num_t value = image->Value(x, y);
-				stddev += (value-mean)*(value-mean);
-				count++; 
-			}
-		}
-	}
-	stddev = sqrtn(stddev / (num_t) count);
-}
-
-void ThresholdTools::WinsorizedMeanAndStdDev(Image2DCPtr image, num_t &mean, num_t &stddev)
-{
-	size_t size = image->Width() * image->Height();
-	num_t *data = new num_t[size];
-	image->CopyData(data);
-	std::sort(data, data + size, numLessThanOperator);
-	size_t lowIndex = (size_t) floor(0.1 * size);
-	size_t highIndex = (size_t) ceil(0.9 * size)-1;
-	num_t lowValue = data[lowIndex];
-	num_t highValue = data[highIndex];
-	delete[] data;
-
-	// Calculate mean
-	mean = 0.0;
-	size_t count = 0;
-	for(size_t y = 0;y<image->Height();++y) {
-		for(size_t x = 0;x<image->Width(); ++x) {
-			if(std::isfinite(image->Value(x, y))) {
-				num_t value = image->Value(x, y);
-				if(value < lowValue)
-					mean += lowValue;
-				else if(value > highValue)
-					mean += highValue;
-				else
-					mean += value;
-				count++; 
-			}
-		}
-	}
-	if(count > 0)
-		mean /= (num_t) count;
-	// Calculate variance
-	stddev = 0.0;
-	count = 0;
-	for(size_t y = 0;y<image->Height();++y) {
-		for(size_t x=0;x<image->Width(); ++x) {
-			if(std::isfinite(image->Value(x, y))) {
-				num_t value = image->Value(x, y);
-				if(value < lowValue)
-					stddev += (lowValue-mean)*(lowValue-mean);
-				else if(value > highValue)
-					stddev += (highValue-mean)*(highValue-mean);
-				else
-					stddev += (value-mean)*(value-mean);
-				count++; 
-			}
-		}
-	}
-	if(count > 0)
-		stddev = sqrtn(1.54 * stddev / (num_t) count);
-	else
-		stddev = 0.0;
-}
-
-template<typename T>
-void ThresholdTools::TrimmedMeanAndStdDev(const std::vector<T> input, T &mean, T &stddev)
-{
-	if(input.size() == 1)
-		{
-			mean = input[0];
-			stddev = 0.0;
-			return;
-		}
-	else if(input.size() == 0)
-		{
-			mean = 0;
-			stddev = 0.0;
-			return;
-		}
-	std::vector<T> data(input);
-	std::sort(data.begin(), data.end(), numLessThanOperator);
-	size_t lowIndex = (size_t) floor(0.25 * data.size());
-	size_t highIndex = (size_t) ceil(0.75 * data.size())-1;
-	T lowValue = data[lowIndex];
-	T highValue = data[highIndex];
-
-	// Calculate mean
-	mean = 0.0;
-	size_t count = 0;
-	for(typename std::vector<T>::const_iterator i=data.begin();
-		i!=data.end();++i) {
-		if(std::isfinite(*i) && *i > lowValue && *i < highValue)
-		{
-			mean += *i;
-			++count;
-		}
-	}
-	if(count > 0)
-		mean /= (T) count;
-	// Calculate variance
-	stddev = 0.0;
-	count = 0;
-	for(typename std::vector<T>::const_iterator i=data.begin();i!=data.end();++i) {
-		if(std::isfinite(*i) && *i >= lowValue && *i <= highValue)
-		{
-			stddev += (*i-mean)*(*i-mean);
-			++count;
-		}
-	}
-	if(count > 0)
-		stddev = sqrt(3.3 * stddev / (T) count);
-	else
-		stddev = 0.0;
-}
-
-template void ThresholdTools::TrimmedMeanAndStdDev(const std::vector<num_t> input, num_t &mean, num_t &stddev);
-template void ThresholdTools::TrimmedMeanAndStdDev(const std::vector<double> input, double &mean, double &stddev);
-
-template<typename T>
-void ThresholdTools::WinsorizedMeanAndStdDev(const std::vector<T> input, T &mean, T &stddev)
-{
-	std::vector<T> data(input);
-	std::sort(data.begin(), data.end(), numLessThanOperator);
-	size_t lowIndex = (size_t) floor(0.1 * data.size());
-	size_t highIndex = (size_t) ceil(0.9 * data.size())-1;
-	T lowValue = data[lowIndex];
-	T highValue = data[highIndex];
-
-	// Calculate mean
-	mean = 0.0;
-	size_t count = 0;
-	for(typename std::vector<T>::const_iterator i=data.begin();
-		i!=data.end();++i) {
-		if(std::isfinite(*i)) {
-			if(*i < lowValue)
-				mean += lowValue;
-			else if(*i > highValue)
-				mean += highValue;
-			else
-				mean += *i;
-			count++; 
-		}
-	}
-	if(count > 0)
-		mean /= (T) count;
-	// Calculate variance
-	stddev = 0.0;
-	count = 0;
-	for(typename std::vector<T>::const_iterator i=data.begin();i!=data.end();++i) {
-		if(std::isfinite(*i)) {
-			if(*i < lowValue)
-				stddev += (lowValue-mean)*(lowValue-mean);
-			else if(*i > highValue)
-				stddev += (highValue-mean)*(highValue-mean);
-			else
-				stddev += (*i-mean)*(*i-mean);
-			count++; 
-		}
-	}
-	if(count > 0)
-		stddev = sqrt(1.54 * stddev / (T) count);
-	else
-		stddev = 0.0;
-}
-
-template void ThresholdTools::WinsorizedMeanAndStdDev(const std::vector<num_t> input, num_t &mean, num_t &stddev);
-template void ThresholdTools::WinsorizedMeanAndStdDev(const std::vector<double> input, double &mean, double &stddev);
-
-void ThresholdTools::WinsorizedMeanAndStdDev(Image2DCPtr image, Mask2DCPtr mask, num_t &mean, num_t &stddev)
-{
-	num_t *data = new num_t[image->Width() * image->Height()];
-	size_t unflaggedCount = 0;
-	for(size_t y=0;y<image->Height();++y)
-	{
-		for(size_t x=0;x<image->Width();++x)
-		{
-			num_t val = image->Value(x, y);
-			if(!mask->Value(x, y) && std::isfinite(val))
-			{
-				data[unflaggedCount] = image->Value(x, y);
-				++unflaggedCount;
-			}
-		}
-	}
-	size_t lowIndex = (size_t) floor(0.1 * unflaggedCount);
-	size_t highIndex = (size_t) ceil(0.9 * unflaggedCount);
-	if(highIndex > 0) --highIndex;
-	std::nth_element(data, data + lowIndex, data + unflaggedCount, numLessThanOperator);
-	num_t lowValue = data[lowIndex];
-	std::nth_element(data, data + highIndex, data + unflaggedCount, numLessThanOperator);
-	num_t highValue = data[highIndex];
-
-	// Calculate mean
-	mean = 0.0;
-	for(size_t i = 0;i<unflaggedCount;++i) {
-		num_t value = data[i];
-		if(value < lowValue)
-			mean += lowValue;
-		else if(value > highValue)
-			mean += highValue;
-		else
-			mean += value;
-	}
-	if(unflaggedCount > 0)
-		mean /= (num_t) unflaggedCount;
-	// Calculate variance
-	stddev = 0.0;
-	for(size_t i = 0;i<unflaggedCount;++i) {
-		num_t value = data[i];
-		if(value < lowValue)
-			stddev += (lowValue-mean)*(lowValue-mean);
-		else if(value > highValue)
-			stddev += (highValue-mean)*(highValue-mean);
-		else
-			stddev += (value-mean)*(value-mean);
-	}
-	delete[] data;
-	if(unflaggedCount > 0)
-		stddev = sqrtn(1.54 * stddev / (num_t) unflaggedCount);
-	else
-		stddev = 0.0;
-}
-
-num_t ThresholdTools::MinValue(Image2DCPtr image, Mask2DCPtr mask)
-{
-	num_t minValue = 1e100;
-	for(size_t y=0;y<image->Height();++y) {
-		for(size_t x=0;x<image->Width();++x) {
-			if(!mask->Value(x, y) && std::isfinite(image->Value(x, y)) && image->Value(x, y) < minValue)
-				minValue = image->Value(x, y);
-		}
-	}
-	return minValue;
-}
-
-num_t ThresholdTools::MaxValue(Image2DCPtr image, Mask2DCPtr mask)
-{
-	num_t maxValue = -1e100;
-	for(size_t y=0;y<image->Height();++y) {
-		for(size_t x=0;x<image->Width();++x) {
-			if(!mask->Value(x, y) && std::isfinite(image->Value(x, y)) && image->Value(x, y) > maxValue)
-				maxValue = image->Value(x, y);
-		}
-	}
-	return maxValue;
-}
-
-void ThresholdTools::SetFlaggedValuesToZero(Image2DPtr dest, Mask2DCPtr mask)
-{
-	for(size_t y=0;y<dest->Height();++y) {
-		for(size_t x=0;x<dest->Width();++x) {
-			if(mask->Value(x, y)) dest->SetValue(x, y, 0.0);
-		}
-	}
-}
-
-void ThresholdTools::CountMaskLengths(Mask2DCPtr mask, int *lengths, size_t lengthsSize)
-{
-	for(size_t i=0;i<lengthsSize;++i)
-		lengths[i] = 0;
-	int *horizontal, *vertical;
-	horizontal = new int[mask->Width()*mask->Height()];
-	vertical = new int[mask->Width()*mask->Height()];
-	size_t y=0, index=0;
-	// Count horizontally lengths
-	while(y < mask->Height()) {
-		size_t x = 0;
-		while(x < mask->Width()) {
-			if(mask->Value(x, y)) {
-				size_t xStart = x;
-				do
-				{
-					++x;
-					++index;
-				} while(x < mask->Width() && mask->Value(x, y));
-				for(size_t i=0;i<x-xStart;++i)
-					horizontal[index-(x-xStart)+i] = x - xStart;
-			} else {
-				horizontal[index] = 0;
-				++x;
-				++index;
-			}
-		}
-		++y;
-	}
-	// Count vertically lengths
-	size_t x = 0;
-	while(x < mask->Width()) {
-		size_t y = 0;
-		while(y < mask->Height()) {
-			if(mask->Value(x, y)) {
-				size_t yStart = y;
-				while(y < mask->Height() && mask->Value(x, y))
-				{
-					++y;
-				}
-				for(size_t i=yStart;i<y;++i)
-					vertical[i*mask->Width()+x] = y - yStart;
-			} else {
-				vertical[y*mask->Width()+x] = 0;
-				++y;
-			}
-		}
-		++x;
-	}
-	// Count the horizontal distribution
-	index = 0;
-	for(size_t y=0;y<mask->Height();++y) {
-		size_t x=0;
-		while(x<mask->Width()) {
-			if(horizontal[index] != 0) {
-				int count = horizontal[index];
-				bool dominant = false;
-				for(int i=0;i<count;++i) {
-					if(count >= vertical[index+i]) {
-						dominant = true;
-						break;
-					}
-				}
-				if(dominant && (size_t) count-1 < lengthsSize)
-					++lengths[count-1];
-				x += count;
-				index += count;
-			} else {
-				++index;
-				++x;
-			}
-		}
-	}
-	// Count the vertical distribution
-	for(size_t x=0;x<mask->Width();++x) {
-		size_t y = 0;
-		while(y<mask->Height()) {
-			if(vertical[y*mask->Width() + x] != 0) {
-				int count = vertical[y*mask->Width() + x];
-				bool dominant = false;
-				for(int i=0;i<count;++i) {
-					if(count >= horizontal[(y+i)*mask->Width() + x]) {
-						dominant = true;
-						break;
-					}
-				}
-				if(dominant && (size_t) count-1 < lengthsSize)
-					++lengths[count-1];
-				y += count;
-			} else {
-				++y;
-			}
-		}
-	}
-	delete[] vertical;
-	delete[] horizontal;
-}
-
-num_t ThresholdTools::Mode(Image2DCPtr image, Mask2DCPtr mask)
-{
-	num_t mode = 0.0;
-	size_t count = 0;
-	for(size_t y = 0;y<image->Height();++y) {
-		for(size_t x=0;x<image->Width(); ++x) {
-			num_t value = image->Value(x, y);
-			if(!mask->Value(x, y) && std::isfinite(value)) {
-				mode += value*value;
-				count++; 
-			}
-		}
-	}
-	return sqrtn(mode / (2.0 * (num_t) count));
-}
-
-numl_t ThresholdTools::Sum(Image2DCPtr image, Mask2DCPtr mask)
-{
-	numl_t sum = 0.0;
-	for(size_t y = 0;y<image->Height();++y) {
-		for(size_t x=0;x<image->Width(); ++x) {
-			if(!mask->Value(x, y))
-				sum += image->Value(x, y);
-		}
-	}
-	return sum;
-}
-
-numl_t ThresholdTools::RMS(Image2DCPtr image, Mask2DCPtr mask)
-{
-	numl_t mode = 0.0;
-	size_t count = 0;
-	for(size_t y = 0;y<image->Height();++y) {
-		for(size_t x=0;x<image->Width(); ++x) {
-			num_t value = image->Value(x, y);
-			if(!mask->Value(x, y) && std::isfinite(value)) {
-				mode += (numl_t) value * (numl_t) value;
-				count++;
-			}
-		}
-	}
-	return sqrtnl(mode / (numl_t) count);
-}
-
-num_t ThresholdTools::WinsorizedMode(Image2DCPtr image, Mask2DCPtr mask)
-{
-	num_t *data = new num_t[image->Width() * image->Height()];
-	size_t unflaggedCount = 0;
-	for(size_t y=0;y<image->Height();++y)
-	{
-		for(size_t x=0;x<image->Width();++x)
-		{
-			num_t val = image->Value(x, y);
-			if(!mask->Value(x, y) && std::isfinite(val))
-			{
-				data[unflaggedCount] = val;
-				++unflaggedCount;
-			}
-		}
-	}
-	size_t highIndex = (size_t) floor(0.9 * unflaggedCount);
-	std::nth_element(data, data + highIndex, data + unflaggedCount);
-	num_t highValue = data[highIndex];
-	
-	num_t mode = 0.0;
-	for(size_t i = 0; i < unflaggedCount; ++i) {
-		num_t value = data[i];
-		if(value > highValue)
-			mode += highValue * highValue;
-		else
-			mode += value * value;
-	}
-	delete[] data;
-	// The correction factor 1.0541 was found by running simulations
-	// It corresponds with the correction factor needed when winsorizing 10% of the 
-	// data, meaning that the highest 10% is set to the value exactly at the
-	// 90%/10% limit.
-	if(unflaggedCount > 0)
-		return sqrtn(mode / (2.0 * (num_t) unflaggedCount)) * 1.0541;
-	else
-		return 0.0;
-}
-
-num_t ThresholdTools::WinsorizedMode(Image2DCPtr image)
-{
-	size_t size = image->Width() * image->Height();
-	num_t *data = new num_t[size];
-	image->CopyData(data);
-	std::sort(data, data + size, numLessThanOperator);
-	size_t highIndex = (size_t) ceil(0.9 * size)-1;
-	num_t highValue = data[highIndex];
-	delete[] data;
-
-	num_t mode = 0.0;
-	for(size_t y = 0;y<image->Height();++y) {
-		for(size_t x = 0;x<image->Width(); ++x) {
-			num_t value = image->Value(x, y);
-			if(value > highValue || -value > highValue)
-				mode += highValue * highValue;
-			else
-				mode += value * value;
-		}
-	}
-	// The correction factor 1.0541 was found by running simulations
-	// It corresponds with the correction factor needed when winsorizing 10% of the 
-	// data, meaning that the highest 10% is set to the value exactly at the
-	// 90%/10% limit.
-	if(size > 0)
-		return sqrtn(mode / (2.0L * (num_t) size)) * 1.0541L;
-	else
-		return 0.0;
-}
-
-void ThresholdTools::FilterConnectedSamples(Mask2DPtr mask, size_t minConnectedSampleArea, bool eightConnected)
-{
-	for(size_t y=0;y<mask->Height();++y) {
-		for(size_t x=0;x<mask->Width();++x)
-			if(mask->Value(x, y))
-				FilterConnectedSample(mask, x, y, minConnectedSampleArea, eightConnected);
-	}
-}
-
-struct ConnectedAreaCoord
-{
-	ConnectedAreaCoord(size_t _x, size_t _y) throw() { x=_x; y=_y; } 
-	size_t x, y;
-};
-
-void ThresholdTools::FilterConnectedSample(Mask2DPtr mask, size_t x, size_t y, size_t minConnectedSampleArea, bool eightConnected)
-{
-	std::deque<ConnectedAreaCoord> tosearch, changed;
-	tosearch.push_back(ConnectedAreaCoord(x, y));
-	size_t count = 0;
-
-	do
-	{
-		ConnectedAreaCoord c = tosearch.front();
-		tosearch.pop_front();
-		if(mask->Value(c.x, c.y))
-		{
-			mask->SetValue(c.x, c.y, false);
-			changed.push_back(ConnectedAreaCoord(c.x, c.y));
-			if(c.x>0)
-				tosearch.push_back(ConnectedAreaCoord(c.x-1, c.y));
-			if(c.x<mask->Width()-1)
-				tosearch.push_back(ConnectedAreaCoord(c.x+1, c.y));
-			if(c.y>0)
-				tosearch.push_back(ConnectedAreaCoord(c.x, c.y-1));
-			if(c.y<mask->Height()-1)
-				tosearch.push_back(ConnectedAreaCoord(c.x, c.y+1));
-			if(eightConnected) {
-			if(c.x>0 && c.y>0)
-				tosearch.push_back(ConnectedAreaCoord(c.x-1, c.y-1));
-			if(c.x<mask->Width()-1 && c.y<mask->Height()-1)
-				tosearch.push_back(ConnectedAreaCoord(c.x+1, c.y+1));
-			if(c.x<mask->Width()-1 && c.y>0)
-				tosearch.push_back(ConnectedAreaCoord(c.x+1, c.y-1));
-			if(c.x>0 && c.y<mask->Height()-1)
-				tosearch.push_back(ConnectedAreaCoord(c.x-1, c.y+1));
-			}
-			++count;
-		}
-	}
-	while(tosearch.size() != 0 && count < minConnectedSampleArea);
-
-	if(count >= minConnectedSampleArea) {
-		while(changed.size() != 0)
-		{
-			ConnectedAreaCoord c = changed.front();
-			changed.pop_front();
-			mask->SetValue(c.x, c.y, true);
-		}
-	}
-}
-
-void ThresholdTools::UnrollPhase(Image2DPtr image)
-{
-	for(size_t y=0;y<image->Height();++y)
-	{
-		num_t prev = image->Value(0, y);
-		for(size_t x=1;x<image->Width();++x)
-		{
-			num_t val = image->Value(x, y);
-			while(val - prev > M_PIn) val -= 2.0L * M_PIn;
-			while(prev - val > M_PIn) val += 2.0L * M_PIn;
-			image->SetValue(x, y, val);
-			prev = val;
-		}
-	}
-}
-
-Image2DPtr ThresholdTools::ShrinkHorizontally(size_t factor, Image2DCPtr input, Mask2DCPtr mask)
-{
-	size_t oldWidth = input->Width();
-	size_t newWidth = (oldWidth + factor - 1) / factor;
-
-	Image2D *newImage = Image2D::CreateUnsetImage(newWidth, input->Height());
-
-	for(size_t x=0;x<newWidth;++x)
-	{
-		size_t avgSize = factor;
-		if(avgSize + x*factor > oldWidth)
-			avgSize = oldWidth - x*factor;
-		size_t count = 0;
-
-		for(size_t y=0;y<input->Height();++y)
-		{
-			num_t sum = 0.0;
-			for(size_t binX=0;binX<avgSize;++binX)
-			{
-				size_t curX = x*factor + binX;
-				if(!mask->Value(curX, y))
-				{
-					sum += input->Value(curX, y);
-					++count;
-				}
-			}
-			if(count == 0)
-			{
-				sum = 0.0;
-				for(size_t binX=0;binX<avgSize;++binX)
-				{
-					size_t curX = x*factor + binX;
-					sum += input->Value(curX, y);
-					++count;
-				}
-			}
-			newImage->SetValue(x, y, sum / (num_t) count);
-		}
-	}
-	return Image2DPtr(newImage);
-}
diff --git a/CEP/DP3/AOFlagger/src/strategy/algorithms/tiledimage.cpp b/CEP/DP3/AOFlagger/src/strategy/algorithms/tiledimage.cpp
deleted file mode 100644
index 2376ece0db717fca605960f2892315527f59b2e8..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/strategy/algorithms/tiledimage.cpp
+++ /dev/null
@@ -1,167 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <AOFlagger/strategy/algorithms/tiledimage.h>
-
-#include <cmath>
-#include <vector>
-
-#include <AOFlagger/msio/image2d.h>
-#include <AOFlagger/msio/pngfile.h>
-
-#include <AOFlagger/strategy/algorithms/mitigationtester.h>
-#include <AOFlagger/strategy/algorithms/thresholdtools.h>
-
-TiledImage::TiledImage() : _tiles(0)
-{
-}
-
-TiledImage::~TiledImage()
-{
-	if(_tiles != 0) {
-		for(size_t j=0;j<_vTileCount;++j) {
-			for(size_t i=0;i<_hTileCount;++i) {
-				delete[] _tiles[j][i];
-			}
-			delete[] _tiles[j];
-		}
-		delete[] _tiles;
-	}
-}
-
-void TiledImage::SetParameters(int polynomialTimeOrder, int polynomialFequencyOrder, size_t scanTileSize, size_t frequencyTileSize)
-{
-	_scanTileSize = scanTileSize;
-	_frequencyTileSize = frequencyTileSize;
-	_polynomialTimeOrder = polynomialTimeOrder;
-	_polynomialFequencyOrder = polynomialFequencyOrder;
-}
-
-void TiledImage::Initialize(const TimeFrequencyData &data)
-{
-	_data = data;
-	_original = data.GetSingleImage();
-	_hTileCount = (size_t) ceil((double) _original->Width() / _frequencyTileSize);
-	_vTileCount = (size_t) ceil((double) _original->Height() / _scanTileSize);
-	_tiles = new ImageTile**[_vTileCount];
-	for(size_t j=0;j<_vTileCount;++j) {
-		_tiles[j] = new ImageTile*[_hTileCount];
-		size_t startFreq = StartFrequency(j);
-		size_t endFreq = EndFrequency(j);
-		for(size_t i=0;i<_hTileCount;++i) {
-			size_t startScan = StartScan(i);
-			size_t endScan = EndScan(i);
-			_tiles[j][i] = new ImageTile();
-			_tiles[j][i]->InitializeData(endFreq-startFreq, endScan-startScan, startFreq, startScan, *_original, _polynomialTimeOrder, _polynomialFequencyOrder);
-		}
-	}
-	_backgroundInitialized = false;
-	SetMask(data.GetSingleMask());
-}
-
-void TiledImage::SetMask(Mask2DCPtr mask)
-{
-	for(unsigned channel = 0;channel<_original->Height();++channel) {
-		size_t vIndex = VWindowIndex(channel);
-		for(unsigned scan=0;scan < _original->Width(); ++scan) {
-			size_t hIndex = HWindowIndex(scan);
-			_tiles[vIndex][hIndex]->SetWindowed(scan, channel, mask->Value(scan, channel) != 0.0);
-		}
-	}
-}
-
-void TiledImage::FitBackground(unsigned taskNumber)
-{
-	size_t j = taskNumber;
-	for(size_t i=0;i<_hTileCount;++i) {
-		_tiles[j][i]->FitBackground();
-	}
-	if(j+1 == _vTileCount)
-		_backgroundInitialized = true;
-}
-
-size_t TiledImage::StartScan(size_t hWindowIndex) const
-{
-	// Because of rounding, we calculate
-	// hWindowIndex * width / hTileCount  -  ((hWindowIndex * width) % hTileCount) / hTileCount
-	return (size_t) ((double) hWindowIndex * _original->Width() / _hTileCount);
-}
-
-size_t TiledImage::StartFrequency(size_t vWindowIndex) const
-{
-	return (size_t) ((double) vWindowIndex * _original->Height() / _vTileCount);
-}
-
-size_t TiledImage::HWindowIndex(size_t scan)
-{
-	size_t index = (size_t) ((double) scan * _hTileCount / _original->Width());
-	if(EndScan(index) > scan)
-		return index;
-	else
-		return index+1;
-}
-
-size_t TiledImage::VWindowIndex(size_t frequency)
-{
-	size_t index = (size_t) ((double) frequency * _vTileCount / _original->Height());
-	if(EndFrequency(index) > frequency)
-		return index;
-	else
-		return index+1;
-}
-
-TimeFrequencyData TiledImage::Background()
-{
-	_background = Image2D::CreateEmptyImagePtr(_original->Width(), _original->Height());
-	if(_backgroundInitialized) {
-		for(size_t j=0;j<_vTileCount;++j) {
-			for(size_t i=0;i<_hTileCount;++i) {
-				_tiles[j][i]->AddBaseline(*_background, 1.0);
-			}
-		}
-	} else {
-		Mask2DPtr mask = CreateFlagImage();
-		num_t mean, stddev;
-		ThresholdTools::WinsorizedMeanAndStdDev(_original, mask, mean, stddev);
-		mask.reset();
-
-		for(size_t j=0;j<_original->Height();++j) {
-			for(size_t i=0;i<_original->Width();++i) {
-				_background->SetValue(i, j, mean);
-			}
-		}
-	}
-	return TimeFrequencyData(_data.PhaseRepresentation(), _data.Polarisation(), _background);
-}
-
-Mask2DPtr TiledImage::CreateFlagImage()
-{
-	Mask2DPtr mask = Mask2D::CreateUnsetMaskPtr(_original->Width(), _original->Height());
-	for(unsigned channel = 0;channel<_original->Height();++channel) {
-		size_t vIndex = VWindowIndex(channel);
-		for(unsigned scan=0;scan < _original->Width(); ++scan) {
-			size_t hIndex = HWindowIndex(scan);
-			if(_tiles[vIndex][hIndex]->IsWindowed(scan, channel))
-				mask->SetValue(scan, channel, true);
-			else
-				mask->SetValue(scan, channel, false);
-		}
-	}
-	return mask;
-}
diff --git a/CEP/DP3/AOFlagger/src/strategy/algorithms/timefrequencystatistics.cpp b/CEP/DP3/AOFlagger/src/strategy/algorithms/timefrequencystatistics.cpp
deleted file mode 100644
index 2c983b61f30afc342e7f5c5deed4092da2ac77e4..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/strategy/algorithms/timefrequencystatistics.cpp
+++ /dev/null
@@ -1,59 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008-2010 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <AOFlagger/strategy/algorithms/timefrequencystatistics.h>
-
-#include <cmath>
-#include <string>
-#include <sstream>
-
-TimeFrequencyStatistics::TimeFrequencyStatistics(const TimeFrequencyData &data)
-  : _data(data)
-{
-}
-
-num_t TimeFrequencyStatistics::GetFlaggedRatio()
-{
-	size_t total = 0, flagged = 0;
-
-	for(size_t i=0;i<_data.MaskCount();++i)
-	{
-		Mask2DCPtr mask = _data.GetMask(i);
-		flagged += mask->GetCount<true>();
-		total += mask->Width() * mask->Height();
-	}
-	if(total != 0)
-		return (num_t) flagged / (num_t) total;
-	else
-		return 0;
-}
-
-std::string TimeFrequencyStatistics::FormatRatio(num_t ratio)
-{
-	std::stringstream s;
-	if(ratio > 0.01)
-		s << (round(ratio*10000.0)/100.0) << "%";
-	else if(ratio > 0.001)
-		s << (round(ratio*100000.0)/1000.0) << "%";
-	else if(ratio > 0.0001)
-		s << (round(ratio*1000000.0)/10000.0) << "%";
-	else
-		s << (ratio*100.0) << "%";
-	return s.str();
-}
diff --git a/CEP/DP3/AOFlagger/src/strategy/control/actionblock.cpp b/CEP/DP3/AOFlagger/src/strategy/control/actionblock.cpp
deleted file mode 100644
index cd23376a1bc8c6fc1a42d252bb69c9e84ade16fd..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/strategy/control/actionblock.cpp
+++ /dev/null
@@ -1,41 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#include <AOFlagger/strategy/control/actionblock.h>
-
-#include <AOFlagger/util/progresslistener.h>
-
-namespace rfiStrategy {
-
-	void ActionBlock::Perform(ArtifactSet &artifacts, ProgressListener &listener)
-	{
-		size_t nr = 0;
-		unsigned totalWeight = Weight();
-		for(const_iterator i=begin();i!=end();++i)
-		{
-			Action *action = *i;
-			unsigned weight = action->Weight();
-			listener.OnStartTask(*this, nr, totalWeight, action->Description(), weight);
-			action->Perform(artifacts, listener);
-			listener.OnEndTask(*this);
-			nr += weight;
-		}
-	}
-}
diff --git a/CEP/DP3/AOFlagger/src/strategy/control/actionfactory.cpp b/CEP/DP3/AOFlagger/src/strategy/control/actionfactory.cpp
deleted file mode 100644
index 4f7f3685392ca23bec37152fc0449df4c373bf67..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/strategy/control/actionfactory.cpp
+++ /dev/null
@@ -1,279 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <AOFlagger/strategy/control/actionfactory.h>
-
-#include <AOFlagger/strategy/actions/absthresholdaction.h>
-#include <AOFlagger/strategy/actions/action.h>
-#include <AOFlagger/strategy/actions/adapter.h>
-#include <AOFlagger/strategy/actions/addstatisticsaction.h>
-#include <AOFlagger/strategy/actions/baselineselectionaction.h>
-#include <AOFlagger/strategy/actions/changeresolutionaction.h>
-#include <AOFlagger/strategy/actions/collectnoisestatisticsaction.h>
-#include <AOFlagger/strategy/actions/combineflagresultsaction.h>
-#include <AOFlagger/strategy/actions/cutareaaction.h>
-#include <AOFlagger/strategy/actions/directionalcleanaction.h>
-#include <AOFlagger/strategy/actions/directionprofileaction.h>
-#include <AOFlagger/strategy/actions/eigenvalueverticalaction.h>
-#include <AOFlagger/strategy/actions/foreachbaselineaction.h>
-#include <AOFlagger/strategy/actions/foreachcomplexcomponentaction.h>
-#include <AOFlagger/strategy/actions/foreachpolarisationaction.h>
-#include <AOFlagger/strategy/actions/foreachsimulatedbaselineaction.h>
-#include <AOFlagger/strategy/actions/foreachmsaction.h>
-#include <AOFlagger/strategy/actions/fouriertransformaction.h>
-#include <AOFlagger/strategy/actions/frequencyconvolutionaction.h>
-#include <AOFlagger/strategy/actions/frequencyselectionaction.h>
-#include <AOFlagger/strategy/actions/fringestopaction.h>
-#include <AOFlagger/strategy/actions/imageraction.h>
-#include <AOFlagger/strategy/actions/iterationaction.h>
-#include <AOFlagger/strategy/actions/highpassfilteraction.h>
-#include <AOFlagger/strategy/actions/normalizevarianceaction.h>
-#include <AOFlagger/strategy/actions/plotaction.h>
-#include <AOFlagger/strategy/actions/quickcalibrateaction.h>
-#include <AOFlagger/strategy/actions/rawappenderaction.h>
-#include <AOFlagger/strategy/actions/resamplingaction.h>
-#include <AOFlagger/strategy/actions/setflaggingaction.h>
-#include <AOFlagger/strategy/actions/setimageaction.h>
-#include <AOFlagger/strategy/actions/slidingwindowfitaction.h>
-#include <AOFlagger/strategy/actions/spatialcompositionaction.h>
-#include <AOFlagger/strategy/actions/statisticalflagaction.h>
-#include <AOFlagger/strategy/actions/svdaction.h>
-#include <AOFlagger/strategy/actions/sumthresholdaction.h>
-#include <AOFlagger/strategy/actions/timeconvolutionaction.h>
-#include <AOFlagger/strategy/actions/timeselectionaction.h>
-#include <AOFlagger/strategy/actions/uvprojectaction.h>
-#include <AOFlagger/strategy/actions/writedataaction.h>
-#include <AOFlagger/strategy/actions/writeflagsaction.h>
-
-namespace rfiStrategy {
-
-const std::vector<std::string> ActionFactory::GetActionList()
-{
-	std::vector<std::string> list;
-	list.push_back("Absolute threshold");
-	list.push_back("Add to statistics");
-	list.push_back("Baseline selection");
-	list.push_back("Change resolution");
-	list.push_back("Collect noise statistics");
-	list.push_back("Combine flag results");
-	list.push_back("Cut area");
-	list.push_back("Directional CLEAN");
-	list.push_back("Direction profile");
-	list.push_back("Eigen value decompisition (vertical)");
-	list.push_back("For each baseline");
-	list.push_back("For each complex component");
-	list.push_back("For each polarisation");
-	list.push_back("For each simulated baseline");
-	list.push_back("For each measurement set");
-	list.push_back("Fourier transformation");
-	list.push_back("Frequency convolution");
-	list.push_back("Frequency selection");
-	list.push_back("Fringe stopping recovery");
-	list.push_back("High-pass filter");
-	list.push_back("Image");
-	list.push_back("Iteration");
-	list.push_back("Normalize variance");
-	list.push_back("Phase adapter");
-	list.push_back("Plot");
-	list.push_back("Quickly calibrate");
-	list.push_back("Raw appender");
-	list.push_back("Resample");
-	list.push_back("Set flagging");
-	list.push_back("Set image");
-	list.push_back("Singular value decomposition");
-	list.push_back("Sliding window fit");
-	list.push_back("Spatial composition");
-	list.push_back("Statistical flagging");
-	list.push_back("SumThreshold");
-	list.push_back("Time convolution");
-	list.push_back("Time selection");
-	list.push_back("UV-projection");
-	list.push_back("Write data");
-	list.push_back("Write flags");
-	return list;
-}
-
-Action *ActionFactory::CreateAction(const std::string &action)
-{
-	if(action == "Absolute threshold")
-		return new AbsThresholdAction();
-	else if(action == "Add to statistics")
-		return new AddStatisticsAction();
-	else if(action == "Baseline selection")
-		return new BaselineSelectionAction();
-	else if(action == "Change resolution")
-		return new ChangeResolutionAction();
-	else if(action == "Collect noise statistics")
-		return new CollectNoiseStatisticsAction();
-	else if(action == "Combine flag results")
-		return new CombineFlagResults();
-	else if(action == "Cut area")
-		return new CutAreaAction();
-	else if(action == "Directional CLEAN")
-		return new DirectionalCleanAction();
-	else if(action == "Direction profile")
-		return new DirectionProfileAction();
-	else if(action == "Eigen value decompisition (vertical)")
-		return new EigenValueVerticalAction();
-	else if(action == "For each baseline")
-		return new ForEachBaselineAction();
-	else if(action == "For each complex component")
-		return new ForEachComplexComponentAction();
-	else if(action == "For each measurement set")
-		return new ForEachMSAction();
-	else if(action == "For each polarisation")
-		return new ForEachPolarisationBlock();
-	else if(action == "For each simulated baseline")
-		return new ForEachSimulatedBaselineAction();
-	else if(action == "Frequency convolution")
-		return new FrequencyConvolutionAction();
-	else if(action == "Frequency selection")
-		return new FrequencySelectionAction();
-	else if(action == "Fringe stopping recovery")
-		return new FringeStopAction();
-	else if(action == "Fourier transformation")
-		return new FourierTransformAction();
-	else if(action == "High-pass filter")
-		return new HighPassFilterAction();
-	else if(action == "Image")
-		return new ImagerAction();
-	else if(action == "Iteration")
-		return new IterationBlock();
-	else if(action == "Normalize variance")
-		return new NormalizeVarianceAction();
-	else if(action == "Phase adapter")
-		return new Adapter();
-	else if(action == "Plot")
-		return new PlotAction();
-	else if(action == "Quickly calibrate")
-		return new QuickCalibrateAction();
-	else if(action == "Raw appender")
-		return new RawAppenderAction();
-	else if(action == "Resample")
-		return new ResamplingAction();
-	else if(action == "Set flagging")
-		return new SetFlaggingAction();
-	else if(action == "Set image")
-		return new SetImageAction();
-	else if(action == "Singular value decomposition")
-		return new SVDAction();
-	else if(action == "Sliding window fit")
-		return new SlidingWindowFitAction();
-	else if(action == "Spatial composition")
-		return new SpatialCompositionAction();
-	else if(action == "Statistical flagging")
-		return new StatisticalFlagAction();
-	else if(action == "SumThreshold")
-		return new SumThresholdAction();
-	else if(action == "Time convolution")
-		return new TimeConvolutionAction();
-	else if(action == "Time selection")
-		return new TimeSelectionAction();
-	else if(action == "UV-projection")
-		return new UVProjectAction();
-	else if(action == "Write data")
-		return new WriteDataAction();
-	else if(action == "Write flags")
-		return new WriteFlagsAction();
-	else
-		throw BadUsageException(std::string("Trying to create unknown action \"") + action + "\"");
-}
-
-const char *ActionFactory::GetDescription(ActionType action)
-{
-	switch(action)
-	{
-		case AdapterType:
-			return
-				"The adapter calculates the amplitude from the complex value. Most algorithmic "
-				"actions like the SumThreshold method work only on single values, not on complex "
-				"values, hence the need for this action. This should normally not be changed. It "
-				"has currently no parameters.";
-		case ChangeResolutionActionType:
-			return
-				"Changes the resolution of the time frequency data currently in memory. This is "
-				"part of the algorithm and should normally not be changed. Currently changes only "
-				"the time direction.";
-		case CombineFlagResultsType:
-			return
-				"Runs each of its children and combines the flags (by OR-ing) afterwards.";
-		case ForEachBaselineActionType:
-			return
-				"Iterate over baselines in the measurement set. Parameters: selection : which "
-				"baselines to iterate over (0. All, 1. CrossCorrelations, 2. AutoCorrelations, "
-				"3. Baselines that are redundant to current selected, 4. Auto correlations of "
-				"the current antenna, 5. don't iterate, only process current), thread-count : "
-				"number of threads to spawn simultaneously.";
-		case ForEachPolarisationBlockType:
-			return
-				"Iterate over the polarisations that are already in memory. Note that the "
-				"LoadImageAction actually defines which polarisations are read in memory in "
-				"the first place. This action has no parameters.";
-		case FrequencySelectionActionType:
-			return
-				"Flag frequency channels that are very different from other channels.";
-		case SetFlaggingActionType:
-			return
-				"This is an action that is part of the algorithm and should normally not be "
-				"changed. "
-				"It initializes or changes the flags in memory. Its single parameter new-flagging "
-				"defines how to initialize or set the flags (0. None, 1. Everything, 2. FromOriginal, "
-				"3. Invert, 4. PolarisationsEqual, 5. FlagZeros).";
-		case SetImageActionType:
-			return
-				"(Re-)initialize the time frequency data in memory. Parameter 'new-image' defines "
-				"how to initialize (0 means set the entire image to zero, 1 means that, if the "
-				"image has been changed by e.g. a surface fit, restore the image (a copy "
-				"of the original data is left in memory, so this does not perform IO). This is "
-				"part of the algorithm and should normally not be changed.";
-		case SlidingWindowFitActionType:
-			return
-				"Performs a surface fit / smoothing operation and subtracts the fit from the data. "
-				"The window size parameters are currently absolute values, and the default values "
-				"have been optimized for LOFAR 1 Hz 1 sec resolution. Nevertheless, these "
-				"settings work well for other configurations as well (and surface fitting is not "
-				"the most crucial part of the flagger - because of the SumThreshold method, even "
-				"bad fits produce reasonable results). Note that the ChangeResolutionAction"
-				"changes the meaning of these absolute values as well.";
-		case TimeSelectionActionType:
-			return
-				"Flag time scans that are very different from other time steps";
-		case SumThresholdActionType:
-			return
-				"This executes the SumThreshold method. It has parameters to change its sensitivity and "
-				"to set whether the method is allowed to look to combinations of time and frequency directions. "
-				"If you expect strong transient effects that you do not want to flag, set frequency-direction-flagging "
-				"to 0 to make sure that frequencies are not combined. Not that the algorithm normally iterates "
-				"and executes the SumThreshold method several times with different sensitivities. Therefore, if you "
-				"like to change the sensitivity "
-				"of the algorithm in order to flag less or more samples, you have to change the sensitivity of all "
-				"Threshold actions by the same factor. A higher sensitivity-value means that less values are flagged.";
-		case StatisticalFlagActionType:
-			return
-				"This action implements a novel and rather complex method to flag samples that are likely RFI "
-				"based on its surrounding flags. It is sort of a dillation.";
-		case WriteFlagsActionType:
-			return
-				"Write the newly constructed flags to the measurement set. Normally it is executed once at the end "
-				"of the algorithm.";
-		default: return 0;
-	}
-}
-
-} // namespace
diff --git a/CEP/DP3/AOFlagger/src/strategy/control/strategyreader.cpp b/CEP/DP3/AOFlagger/src/strategy/control/strategyreader.cpp
deleted file mode 100644
index 1c422ff7c7788801e8e5d71b300a59c95c9fb25c..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/strategy/control/strategyreader.cpp
+++ /dev/null
@@ -1,718 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <AOFlagger/strategy/control/strategyreader.h>
-
-#include <AOFlagger/util/numberparser.h>
-
-#include <AOFlagger/strategy/actions/absthresholdaction.h>
-#include <AOFlagger/strategy/actions/action.h>
-#include <AOFlagger/strategy/actions/adapter.h>
-#include <AOFlagger/strategy/actions/addstatisticsaction.h>
-#include <AOFlagger/strategy/actions/baselineselectionaction.h>
-#include <AOFlagger/strategy/actions/changeresolutionaction.h>
-#include <AOFlagger/strategy/actions/collectnoisestatisticsaction.h>
-#include <AOFlagger/strategy/actions/combineflagresultsaction.h>
-#include <AOFlagger/strategy/actions/cutareaaction.h>
-#include <AOFlagger/strategy/actions/directionalcleanaction.h>
-#include <AOFlagger/strategy/actions/directionprofileaction.h>
-#include <AOFlagger/strategy/actions/eigenvalueverticalaction.h>
-#include <AOFlagger/strategy/actions/foreachbaselineaction.h>
-#include <AOFlagger/strategy/actions/foreachcomplexcomponentaction.h>
-#include <AOFlagger/strategy/actions/foreachmsaction.h>
-#include <AOFlagger/strategy/actions/foreachpolarisationaction.h>
-#include <AOFlagger/strategy/actions/fouriertransformaction.h>
-#include <AOFlagger/strategy/actions/frequencyconvolutionaction.h>
-#include <AOFlagger/strategy/actions/frequencyselectionaction.h>
-#include <AOFlagger/strategy/actions/fringestopaction.h>
-#include <AOFlagger/strategy/actions/highpassfilteraction.h>
-#include <AOFlagger/strategy/actions/imageraction.h>
-#include <AOFlagger/strategy/actions/iterationaction.h>
-#include <AOFlagger/strategy/actions/normalizevarianceaction.h>
-#include <AOFlagger/strategy/actions/plotaction.h>
-#include <AOFlagger/strategy/actions/quickcalibrateaction.h>
-#include <AOFlagger/strategy/actions/rawappenderaction.h>
-#include <AOFlagger/strategy/actions/setflaggingaction.h>
-#include <AOFlagger/strategy/actions/setimageaction.h>
-#include <AOFlagger/strategy/actions/slidingwindowfitaction.h>
-#include <AOFlagger/strategy/actions/statisticalflagaction.h>
-#include <AOFlagger/strategy/actions/strategyaction.h>
-#include <AOFlagger/strategy/actions/svdaction.h>
-#include <AOFlagger/strategy/actions/sumthresholdaction.h>
-#include <AOFlagger/strategy/actions/timeconvolutionaction.h>
-#include <AOFlagger/strategy/actions/timeselectionaction.h>
-#include <AOFlagger/strategy/actions/uvprojectaction.h>
-#include <AOFlagger/strategy/actions/writedataaction.h>
-#include <AOFlagger/strategy/actions/writeflagsaction.h>
-
-#define ENCODING "UTF-8"
-
-namespace rfiStrategy {
-
-int StrategyReader::useCount = 0;
-
-StrategyReader::StrategyReader()
-{
-	if(useCount == 0)
-	{
-		LIBXML_TEST_VERSION ;
-	}
-	++useCount;
-}
-
-
-StrategyReader::~StrategyReader()
-{
-	if(useCount == 0)
-		xmlCleanupParser();
-}
-
-Strategy *StrategyReader::CreateStrategyFromFile(const std::string &filename)
-{
-	_xmlDocument = xmlReadFile(filename.c_str(), NULL, 0);
-	if (_xmlDocument == NULL)
-		throw StrategyReaderError("Failed to read file");
-
-	xmlNode *rootElement = xmlDocGetRootElement(_xmlDocument);
-	Strategy *strategy = 0;
-
-	for (xmlNode *curNode=rootElement; curNode!=NULL; curNode=curNode->next)
-	{
-		if(curNode->type == XML_ELEMENT_NODE)
-		{
-			if(strategy != 0)
-				throw StrategyReaderError("Multiple root elements found.");
-			if(std::string((const char *) curNode->name) != "rfi-strategy")
-				throw StrategyReaderError("Invalid structure in xml file: no rfi-strategy root node found. Maybe this is not an rfi strategy?");
-			
-			xmlChar *formatVersionCh = xmlGetProp(curNode, BAD_CAST "format-version");
-			if(formatVersionCh == 0)
-				throw StrategyReaderError("Missing attribute 'format-version'");
-			double formatVersion = NumberParser::ToDouble((const char*) formatVersionCh);
-			xmlFree(formatVersionCh);
-
-			xmlChar *readerVersionRequiredCh = xmlGetProp(curNode, BAD_CAST "reader-version-required");
-			if(readerVersionRequiredCh == 0)
-				throw StrategyReaderError("Missing attribute 'reader-version-required'");
-			double readerVersionRequired = NumberParser::ToDouble((const char*) readerVersionRequiredCh);
-			xmlFree(readerVersionRequiredCh);
-			
-			if(readerVersionRequired > STRATEGY_FILE_FORMAT_VERSION)
-				throw StrategyReaderError("This file requires a newer software version");
-			if(formatVersion < STRATEGY_FILE_FORMAT_VERSION_REQUIRED)
-			{
-				std::stringstream s;
-				s << "This file is too old for the software, please recreate the strategy. File format version: " << formatVersion << ", oldest version that this software understands: " << STRATEGY_FILE_FORMAT_VERSION_REQUIRED << " (these versions are numbered differently from the software).";
-				throw StrategyReaderError(s.str());
-			}
-			
-			strategy = parseRootChildren(curNode);
-		}
-	}
-	if(strategy == 0)
-		throw StrategyReaderError("Could not find root element in file.");
-
-	xmlFreeDoc(_xmlDocument);
-
-	return strategy;
-}
-
-Strategy *StrategyReader::parseRootChildren(xmlNode *rootNode)
-{
-	Strategy *strategy = 0;
-	for (xmlNode *curNode=rootNode->children; curNode!=NULL; curNode=curNode->next) {
-		if(curNode->type == XML_ELEMENT_NODE)
-		{
-			if(strategy != 0)
-				throw StrategyReaderError("More than one root element in file!");
-			strategy = dynamic_cast<Strategy*>(parseAction(curNode));
-			if(strategy == 0)
-				throw StrategyReaderError("Root element was not a strategy!");
-		}
-	}
-	if(strategy == 0)
-		throw StrategyReaderError("Root element not found.");
-
-	return strategy;
-}
-
-Action *StrategyReader::parseChild(xmlNode *node)
-{
-	if (node->type == XML_ELEMENT_NODE) {
-		std::string name((const char*) node->name);
-		if(name == "action")
-			return parseAction(node);
-	}
-	throw StrategyReaderError("Invalid structure in xml file: an action was expected");
-}
-
-class Strategy *StrategyReader::parseStrategy(xmlNode *node)
-{
-	Strategy *strategy = new Strategy();
-	parseChildren(node, strategy);
-	return strategy;
-}
-
-void StrategyReader::parseChildren(xmlNode *node, ActionContainer *parent) 
-{
-	for (xmlNode *curOuterNode=node->children; curOuterNode!=NULL; curOuterNode=curOuterNode->next) {
-		if(curOuterNode->type == XML_ELEMENT_NODE)
-		{
-			std::string nameStr((const char *) curOuterNode->name);
-			if(nameStr == "children")
-			{
-				for (xmlNode *curNode=curOuterNode->children; curNode!=NULL; curNode=curNode->next) {
-					if (curNode->type == XML_ELEMENT_NODE) {
-						parent->Add(parseChild(curNode));
-					}
-				}
-			}
-		}
-	}
-}
-
-xmlNode *StrategyReader::getTextNode(xmlNode *node, const char *subNodeName, bool allowEmpty) const 
-{
-	for (xmlNode *curNode=node->children; curNode!=NULL; curNode=curNode->next) {
-		if(curNode->type == XML_ELEMENT_NODE)
-		{
-			std::string nameStr((const char *) curNode->name);
-			if(nameStr == subNodeName)
-			{
-				curNode = curNode->children;
-				if(curNode == 0 || curNode->type != XML_TEXT_NODE)
-				{
-					if(allowEmpty)
-						return 0;
-					else
-						throw StrategyReaderError("Error occured in reading xml file: value node did not contain text");
-				}
-				return curNode;
-			}
-		}
-	}
-	std::ostringstream str;
-	str << "Error occured in reading xml file: could not find value node \"" << subNodeName << '\"';
-	throw StrategyReaderError(str.str());
-}
-
-int StrategyReader::getInt(xmlNode *node, const char *name) const 
-{
-	xmlNode *valNode = getTextNode(node, name);
-	return atoi((const char *) valNode->content);
-}
-
-double StrategyReader::getDouble(xmlNode *node, const char *name) const 
-{
-	xmlNode *valNode = getTextNode(node, name);
-	return NumberParser::ToDouble((const char *) valNode->content);
-}
-
-std::string StrategyReader::getString(xmlNode *node, const char *name) const 
-{
-	xmlNode *valNode = getTextNode(node, name, true);
-	if(valNode == 0)
-		return std::string();
-	else
-		return std::string((const char *) valNode->content);
-}
-
-Action *StrategyReader::parseAction(xmlNode *node)
-{
-	Action *newAction = 0;
-	xmlChar *typeCh = xmlGetProp(node, BAD_CAST "type");
-	if(typeCh == 0)
-		throw StrategyReaderError("Action tag did not have 'type' parameter");
-	std::string typeStr((const char*) typeCh);
-	if(typeStr == "AbsThresholdAction")
-		newAction = parseAbsThresholdAction(node);
-	else if(typeStr == "Adapter")
-		newAction = parseAdapter(node);
-	else if(typeStr == "AddStatisticsAction")
-		newAction = parseAddStatistics(node);
-	else if(typeStr == "BaselineSelectionAction")
-		newAction = parseBaselineSelectionAction(node);
-	else if(typeStr == "ChangeResolutionAction")
-		newAction = parseChangeResolutionAction(node);
-	else if(typeStr == "CollectNoiseStatisticsAction")
-		newAction = parseCollectNoiseStatisticsAction(node);
-	else if(typeStr == "CombineFlagResults")
-		newAction = parseCombineFlagResults(node);
-	else if(typeStr == "CutAreaAction")
-		newAction = parseCutAreaAction(node);
-	else if(typeStr == "DirectionalCleanAction")
-		newAction = parseDirectionalCleanAction(node);
-	else if(typeStr == "DirectionProfileAction")
-		newAction = parseDirectionProfileAction(node);
-	else if(typeStr == "EigenValueVerticalAction")
-	  newAction = parseEigenValueVerticalAction(node);
-	else if(typeStr == "ForEachBaselineAction")
-		newAction = parseForEachBaselineAction(node);
-	else if(typeStr == "ForEachComplexComponentAction")
-		newAction = parseForEachComplexComponentAction(node);
-	else if(typeStr == "ForEachMSAction")
-		newAction = parseForEachMSAction(node);
-	else if(typeStr == "ForEachPolarisationBlock")
-		newAction = parseForEachPolarisationBlock(node);
-	else if(typeStr == "FourierTransformAction")
-		newAction = parseFourierTransformAction(node);
-	else if(typeStr == "FrequencyConvolutionAction")
-		newAction = parseFrequencyConvolutionAction(node);
-	else if(typeStr == "FrequencySelectionAction")
-		newAction = parseFrequencySelectionAction(node);
-	else if(typeStr == "FringeStopAction")
-		newAction = parseFringeStopAction(node);
-	else if(typeStr == "HighPassFilterAction")
-		newAction = parseHighPassFilterAction(node);
-	else if(typeStr == "ImagerAction")
-		newAction = parseImagerAction(node);
-	else if(typeStr == "IterationBlock")
-		newAction = parseIterationBlock(node);
-	else if(typeStr == "NormalizeVarianceAction")
-		newAction = parseNormalizeVarianceAction(node);
-	else if(typeStr == "PlotAction")
-		newAction = parsePlotAction(node);
-	else if(typeStr == "QuickCalibrateAction")
-		newAction = parseQuickCalibrateAction(node);
-	else if(typeStr == "RawAppenderAction")
-		newAction = parseRawAppenderAction(node);
-	else if(typeStr == "SetFlaggingAction")
-		newAction = parseSetFlaggingAction(node);
-	else if(typeStr == "SetImageAction")
-		newAction = parseSetImageAction(node);
-	else if(typeStr == "SlidingWindowFitAction")
-		newAction = parseSlidingWindowFitAction(node);
-	else if(typeStr == "StatisticalFlagAction")
-		newAction = parseStatisticalFlagAction(node);
-	else if(typeStr == "SVDAction")
-		newAction = parseSVDAction(node);
-	else if(typeStr == "Strategy")
-		newAction = parseStrategy(node);
-	else if(typeStr == "SumThresholdAction")
-		newAction = parseSumThresholdAction(node);
-	else if(typeStr == "TimeConvolutionAction")
-		newAction = parseTimeConvolutionAction(node);
-	else if(typeStr == "TimeSelectionAction")
-		newAction = parseTimeSelectionAction(node);
-	else if(typeStr == "UVProjectAction")
-		newAction = parseUVProjectAction(node);
-	else if(typeStr == "WriteDataAction")
-		newAction = parseWriteDataAction(node);
-	else if(typeStr == "WriteFlagsAction")
-		newAction = parseWriteFlagsAction(node);
-	xmlFree(typeCh);
-	if(newAction == 0)
-	{
-		std::stringstream s;
-		s << "Unknown action type '" << typeStr << "' in xml file";
-		throw StrategyReaderError(s.str());
-	}
-	return newAction;
-}
-
-Action *StrategyReader::parseAbsThresholdAction(xmlNode *node)
-{
-	AbsThresholdAction *newAction = new AbsThresholdAction();
-	newAction->SetThreshold(getDouble(node, "threshold"));
-	return newAction;
-}
-
-Action *StrategyReader::parseAdapter(xmlNode *node)
-{
-	Adapter *newAction = new Adapter();
-	newAction->SetRestoreOriginals(getBool(node, "restore-originals"));
-	parseChildren(node, newAction);
-	return newAction;
-}
-
-Action *StrategyReader::parseAddStatistics(xmlNode *node)
-{
-	AddStatisticsAction *newAction = new AddStatisticsAction();
-	newAction->SetFilePrefix(getString(node, "file-prefix"));
-	newAction->SetCompareOriginalAndAlternative(getBool(node, "compare-original-and-alternative"));
-	newAction->SetSeparateBaselineStatistics(getBool(node, "separate-baseline-statistics"));
-	newAction->SetPerformClassification(getBool(node, "perform-classification"));
-	newAction->SetWriteImmediately(getBool(node, "write-immediately"));
-	return newAction;
-}
-
-Action *StrategyReader::parseBaselineSelectionAction(xmlNode *node)
-{
-	BaselineSelectionAction *newAction = new BaselineSelectionAction();
-	newAction->SetPreparationStep(getBool(node, "preparation-step"));
-	newAction->SetFlagBadBaselines(getBool(node, "flag-bad-baselines"));
-	newAction->SetThreshold(getDouble(node, "threshold"));
-	newAction->SetAbsThreshold(getDouble(node, "abs-threshold"));
-	newAction->SetSmoothingSigma(getDouble(node, "smoothing-sigma"));
-	newAction->SetMakePlot(getBool(node, "make-plot"));
-	return newAction;
-}
-
-Action *StrategyReader::parseChangeResolutionAction(xmlNode *node)
-{
-	ChangeResolutionAction *newAction = new ChangeResolutionAction();
-	newAction->SetTimeDecreaseFactor(getInt(node, "time-decrease-factor"));
-	newAction->SetFrequencyDecreaseFactor(getInt(node, "frequency-decrease-factor"));
-	newAction->SetRestoreRevised(getBool(node, "restore-revised"));
-	newAction->SetRestoreMasks(getBool(node, "restore-masks"));
-	parseChildren(node, newAction);
-	return newAction;
-}
-
-Action *StrategyReader::parseCollectNoiseStatisticsAction(xmlNode *node)
-{
-	CollectNoiseStatisticsAction *newAction = new CollectNoiseStatisticsAction();
-	newAction->SetFilename(getString(node, "filename"));
-	newAction->SetChannelDistance(getInt(node, "channel-distance"));
-	newAction->SetTileWidth(getInt(node, "tile-timestep-size"));
-	newAction->SetTileHeight(getInt(node, "tile-channels-size"));
-	return newAction;
-}
-
-Action *StrategyReader::parseCombineFlagResults(xmlNode *node)
-{
-	CombineFlagResults *newAction = new CombineFlagResults();
-	parseChildren(node, newAction);
-	return newAction;
-}
-
-Action *StrategyReader::parseCutAreaAction(xmlNode *node)
-{
-	CutAreaAction *newAction = new CutAreaAction();
-	newAction->SetStartTimeSteps(getInt(node, "start-time-steps"));
-	newAction->SetEndTimeSteps(getInt(node, "end-time-steps"));
-	newAction->SetTopChannels(getInt(node, "top-channels"));
-	newAction->SetBottomChannels(getInt(node, "bottom-channels"));
-	parseChildren(node, newAction);
-	return newAction;
-}
-
-Action *StrategyReader::parseDirectionalCleanAction(xmlNode *node)
-{
-	DirectionalCleanAction *newAction = new DirectionalCleanAction();
-	newAction->SetLimitingDistance(getDouble(node, "limiting-distance"));
-	newAction->SetChannelConvolutionSize(getInt(node, "channel-convolution-size"));
-	newAction->SetAttenuationOfCenter(getDouble(node, "attenuation-of-center"));
-	newAction->SetMakePlot(getBool(node, "make-plot"));
-	return newAction;
-}
-
-Action *StrategyReader::parseDirectionProfileAction(xmlNode *node)
-{
-	DirectionProfileAction *newAction = new DirectionProfileAction();
-	newAction->SetAxis((enum DirectionProfileAction::Axis) getInt(node, "axis"));
-	newAction->SetProfileAction((enum DirectionProfileAction::ProfileAction) getInt(node, "profile-action"));
-	return newAction;
-}
-
-Action *StrategyReader::parseEigenValueVerticalAction(xmlNode *)
-{
-  EigenValueVerticalAction *newAction = new EigenValueVerticalAction();
-  return newAction;
-}
-
-Action *StrategyReader::parseForEachBaselineAction(xmlNode *node)
-{
-	ForEachBaselineAction *newAction = new ForEachBaselineAction();
-	newAction->SetSelection((BaselineSelection) getInt(node, "selection"));
-	newAction->SetThreadCount(getInt(node, "thread-count"));
-
-	for (xmlNode *curNode=node->children; curNode!=NULL; curNode=curNode->next) {
-		if(curNode->type == XML_ELEMENT_NODE)
-		{
-			std::string nameStr((const char *) curNode->name);
-			if(nameStr == "antennae-to-skip")
-			{
-				for (xmlNode *curNode2=curNode->children; curNode2!=NULL; curNode2=curNode2->next) {
-					if (curNode2->type == XML_ELEMENT_NODE) {
-						std::string innerNameStr((const char *) curNode2->name);
-						if(innerNameStr != "antenna")
-							throw StrategyReaderError("Format of the for each baseline action is incorrect");
-						xmlNode *textNode = curNode2->children;
-						if(textNode->type != XML_TEXT_NODE)
-							throw StrategyReaderError("Error occured in reading xml file: value node did not contain text");
-						if(textNode->content != NULL)
-						{
-							newAction->AntennaeToSkip().insert(atoi((const char *) textNode->content));
-						}
-					}
-				}
-			}
-			if(nameStr == "antennae-to-include")
-			{
-				for (xmlNode *curNode2=curNode->children; curNode2!=NULL; curNode2=curNode2->next) {
-					if (curNode2->type == XML_ELEMENT_NODE) {
-						std::string innerNameStr((const char *) curNode2->name);
-						if(innerNameStr != "antenna")
-							throw StrategyReaderError("Format of the for each baseline action is incorrect");
-						xmlNode *textNode = curNode2->children;
-						if(textNode->type != XML_TEXT_NODE)
-							throw StrategyReaderError("Error occured in reading xml file: value node did not contain text");
-						if(textNode->content != NULL)
-						{
-							newAction->AntennaeToInclude().insert(atoi((const char *) textNode->content));
-						}
-					}
-				}
-			}
-		}
-	}
-	
-	parseChildren(node, newAction);
-	return newAction;
-}
-
-Action *StrategyReader::parseForEachComplexComponentAction(xmlNode *node)
-{
-	ForEachComplexComponentAction *newAction = new ForEachComplexComponentAction();
-	newAction->SetOnAmplitude(getBool(node, "on-amplitude"));
-	newAction->SetOnPhase(getBool(node, "on-phase"));
-	newAction->SetOnReal(getBool(node, "on-real"));
-	newAction->SetOnImaginary(getBool(node, "on-imaginary"));
-	newAction->SetRestoreFromAmplitude(getBool(node, "restore-from-amplitude"));
-	parseChildren(node, newAction);
-	return newAction;
-}
-
-Action *StrategyReader::parseForEachMSAction(xmlNode *node)
-{
-	ForEachMSAction *newAction = new ForEachMSAction();
-	newAction->SetDataColumnName(getString(node, "data-column-name"));
-	newAction->SetSubtractModel(getBool(node, "subtract-model"));
-
-	for (xmlNode *curNode=node->children; curNode!=NULL; curNode=curNode->next) {
-		if(curNode->type == XML_ELEMENT_NODE)
-		{
-			std::string nameStr((const char *) curNode->name);
-			if(nameStr == "filenames")
-			{
-				for (xmlNode *curNode2=curNode->children; curNode2!=NULL; curNode2=curNode2->next) {
-					if (curNode2->type == XML_ELEMENT_NODE) {
-						std::string innerNameStr((const char *) curNode2->name);
-						if(innerNameStr != "filename")
-							throw StrategyReaderError("Format of the for each MS action is incorrect");
-						newAction->Filenames().push_back((const char *) curNode2->content);
-					}
-				}
-			}
-		}
-	}
-	
-	parseChildren(node, newAction);
-	return newAction;
-}
-
-Action *StrategyReader::parseForEachPolarisationBlock(xmlNode *node)
-{
-	ForEachPolarisationBlock *newAction = new ForEachPolarisationBlock();
-	newAction->SetOnXX(getBool(node, "on-xx"));
-	newAction->SetOnXY(getBool(node, "on-xy"));
-	newAction->SetOnYX(getBool(node, "on-yx"));
-	newAction->SetOnYY(getBool(node, "on-yy"));
-	newAction->SetOnStokesI(getBool(node, "on-stokes-i"));
-	newAction->SetOnStokesQ(getBool(node, "on-stokes-q"));
-	newAction->SetOnStokesU(getBool(node, "on-stokes-u"));
-	newAction->SetOnStokesV(getBool(node, "on-stokes-v"));
-	parseChildren(node, newAction);
-	return newAction;
-}
-
-Action *StrategyReader::parseFourierTransformAction(xmlNode *)
-{
-	FourierTransformAction *newAction = new FourierTransformAction();
-	return newAction;
-}
-
-Action *StrategyReader::parseFrequencyConvolutionAction(xmlNode *node)
-{
-	FrequencyConvolutionAction *newAction = new FrequencyConvolutionAction();
-	newAction->SetConvolutionSize(getInt(node, "convolution-size"));
-	newAction->SetKernelKind((enum FrequencyConvolutionAction::KernelKind) getInt(node, "kernel-kind"));
-	return newAction;
-}
-
-Action *StrategyReader::parseFrequencySelectionAction(xmlNode *node)
-{
-	FrequencySelectionAction *newAction = new FrequencySelectionAction();
-	newAction->SetThreshold(getDouble(node, "threshold"));
-	return newAction;
-}
-
-Action *StrategyReader::parseFringeStopAction(xmlNode *node)
-{
-	FringeStopAction *newAction = new FringeStopAction();
-	newAction->SetFitChannelsIndividually(getBool(node, "fit-channels-individually"));
-	newAction->SetFringesToConsider(getDouble(node, "fringes-to-consider"));
-	newAction->SetOnlyFringeStop(getBool(node, "only-fringe-stop"));
-	newAction->SetMinWindowSize(getInt(node, "min-window-size"));
-	newAction->SetMaxWindowSize(getInt(node, "max-window-size"));
-	return newAction;
-}
-
-Action *StrategyReader::parseHighPassFilterAction(xmlNode *node)
-{
-	HighPassFilterAction *newAction = new HighPassFilterAction();
-	newAction->SetHKernelSigmaSq(getDouble(node, "horizontal-kernel-sigma-sq"));
-	newAction->SetVKernelSigmaSq(getDouble(node, "vertical-kernel-sigma-sq"));
-	newAction->SetWindowWidth(getInt(node, "window-width"));
-	newAction->SetWindowHeight(getInt(node, "window-height"));
-	newAction->SetMode((enum HighPassFilterAction::Mode) getInt(node, "mode"));
-	return newAction;
-}
-
-Action *StrategyReader::parseImagerAction(xmlNode *)
-{
-	ImagerAction *newAction = new ImagerAction();
-	return newAction;
-}
-
-Action *StrategyReader::parseIterationBlock(xmlNode *node)
-{
-	IterationBlock *newAction = new IterationBlock();
-	newAction->SetIterationCount(getInt(node, "iteration-count"));
-	newAction->SetSensitivityStart(getDouble(node, "sensitivity-start"));
-	parseChildren(node, newAction);
-	return newAction;
-}
-
-Action *StrategyReader::parseNormalizeVarianceAction(xmlNode *node)
-{
-	NormalizeVarianceAction *newAction = new NormalizeVarianceAction();
-	newAction->SetMedianFilterSizeInS(getDouble(node, "median-filter-size-in-s"));
-	return newAction;
-}
-
-Action *StrategyReader::parseSetFlaggingAction(xmlNode *node)
-{
-	SetFlaggingAction *newAction = new SetFlaggingAction();
-	newAction->SetNewFlagging((enum SetFlaggingAction::NewFlagging) getInt(node, "new-flagging"));
-	return newAction;
-}
-
-Action *StrategyReader::parsePlotAction(xmlNode *node)
-{
-	PlotAction *newAction = new PlotAction();
-	newAction->SetPlotKind((enum PlotAction::PlotKind) getInt(node, "plot-kind"));
-	newAction->SetLogarithmicYAxis(getBool(node, "logarithmic-y-axis"));
-	return newAction;
-}
-
-Action *StrategyReader::parseQuickCalibrateAction(xmlNode *)
-{
-	QuickCalibrateAction *newAction = new QuickCalibrateAction();
-	return newAction;
-}
-
-Action *StrategyReader::parseRawAppenderAction(xmlNode *)
-{
-	RawAppenderAction *newAction = new RawAppenderAction();
-	return newAction;
-}
-
-class Action *StrategyReader::parseSetImageAction(xmlNode *node)
-{
-	SetImageAction *newAction = new SetImageAction();
-	newAction->SetNewImage((enum SetImageAction::NewImage) getInt(node, "new-image"));
-	return newAction;
-}
-
-class Action *StrategyReader::parseSlidingWindowFitAction(xmlNode *node)
-{
-	SlidingWindowFitAction *newAction = new SlidingWindowFitAction();
-	newAction->Parameters().frequencyDirectionKernelSize = getDouble(node, "frequency-direction-kernel-size");
-	newAction->Parameters().frequencyDirectionWindowSize = getInt(node, "frequency-direction-window-size");
-	newAction->Parameters().method = (enum SlidingWindowFitParameters::Method) getInt(node, "method");
-	newAction->Parameters().timeDirectionKernelSize = getDouble(node, "time-direction-kernel-size");
-	newAction->Parameters().timeDirectionWindowSize = getInt(node, "time-direction-window-size");
-	return newAction;
-}
-
-class Action *StrategyReader::parseStatisticalFlagAction(xmlNode *node)
-{
-	StatisticalFlagAction *newAction = new StatisticalFlagAction();
-	newAction->SetEnlargeFrequencySize(getInt(node, "enlarge-frequency-size"));
-	newAction->SetEnlargeTimeSize(getInt(node, "enlarge-time-size"));
-	newAction->SetMaxContaminatedFrequenciesRatio(getDouble(node, "max-contaminated-frequencies-ratio"));
-	newAction->SetMaxContaminatedTimesRatio(getDouble(node, "max-contaminated-times-ratio"));
-	newAction->SetMinimumGoodFrequencyRatio(getDouble(node, "minimum-good-frequency-ratio"));
-	newAction->SetMinimumGoodTimeRatio(getDouble(node, "minimum-good-time-ratio"));
-	return newAction;
-}
-
-class Action *StrategyReader::parseSVDAction(xmlNode *node)
-{
-	SVDAction *newAction = new SVDAction();
-	newAction->SetSingularValueCount(getInt(node, "singular-value-count"));
-	return newAction;
-}
-
-class Action *StrategyReader::parseSumThresholdAction(xmlNode *node)
-{
-	SumThresholdAction *newAction = new SumThresholdAction();
-	newAction->SetBaseSensitivity(getDouble(node, "base-sensitivity"));
-	newAction->SetTimeDirectionFlagging(getBool(node, "time-direction-flagging"));
-	newAction->SetFrequencyDirectionFlagging(getBool(node, "frequency-direction-flagging"));
-	return newAction;
-}
-
-class Action *StrategyReader::parseTimeConvolutionAction(xmlNode *node)
-{
-	TimeConvolutionAction *newAction = new TimeConvolutionAction();
-	newAction->SetOperation((enum TimeConvolutionAction::Operation) getInt(node, "operation"));
-	newAction->SetSincScale(getDouble(node, "sinc-scale"));
-	newAction->SetIsSincScaleInSamples(getBool(node, "is-sinc-scale-in-samples"));
-	newAction->SetDirectionRad(getDouble(node, "direction-rad"));
-	newAction->SetEtaParameter(getDouble(node, "eta-parameter"));
-	newAction->SetAutoAngle(getBool(node, "auto-angle"));
-	newAction->SetIterations(getInt(node, "iterations"));
-	return newAction;
-}
-
-class Action *StrategyReader::parseTimeSelectionAction(xmlNode *node)
-{
-	TimeSelectionAction *newAction = new TimeSelectionAction();
-	newAction->SetThreshold(getDouble(node, "threshold"));
-	return newAction;
-}
-
-class Action *StrategyReader::parseUVProjectAction(xmlNode *node)
-{
-	UVProjectAction *newAction = new UVProjectAction();
-	newAction->SetDirectionRad(getDouble(node, "direction-rad"));
-	newAction->SetEtaParameter(getDouble(node, "eta-parameter"));
-	newAction->SetDestResolutionFactor(getDouble(node, "dest-resolution-factor"));
-	newAction->SetReverse(getBool(node, "reverse"));
-	newAction->SetOnRevised(getBool(node, "on-revised"));
-	newAction->SetOnContaminated(getBool(node, "on-contaminated"));
-	return newAction;
-}
-
-class Action *StrategyReader::parseWriteDataAction(xmlNode *)
-{
-	WriteDataAction *newAction = new WriteDataAction();
-	return newAction;
-}
-
-class Action *StrategyReader::parseWriteFlagsAction(xmlNode *)
-{
-	WriteFlagsAction *newAction = new WriteFlagsAction();
-	return newAction;
-}
-
-} // end of namespace
diff --git a/CEP/DP3/AOFlagger/src/strategy/control/strategywriter.cpp b/CEP/DP3/AOFlagger/src/strategy/control/strategywriter.cpp
deleted file mode 100644
index 744f493aa66d6aaefe15657346e101cb88236b28..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/strategy/control/strategywriter.cpp
+++ /dev/null
@@ -1,573 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <AOFlagger/strategy/control/strategywriter.h>
-
-#include <AOFlagger/strategy/actions/absthresholdaction.h>
-#include <AOFlagger/strategy/actions/adapter.h>
-#include <AOFlagger/strategy/actions/addstatisticsaction.h>
-#include <AOFlagger/strategy/actions/baselineselectionaction.h>
-#include <AOFlagger/strategy/actions/changeresolutionaction.h>
-#include <AOFlagger/strategy/actions/collectnoisestatisticsaction.h>
-#include <AOFlagger/strategy/actions/combineflagresultsaction.h>
-#include <AOFlagger/strategy/actions/cutareaaction.h>
-#include <AOFlagger/strategy/actions/directionalcleanaction.h>
-#include <AOFlagger/strategy/actions/directionprofileaction.h>
-#include <AOFlagger/strategy/actions/eigenvalueverticalaction.h>
-#include <AOFlagger/strategy/actions/foreachbaselineaction.h>
-#include <AOFlagger/strategy/actions/foreachcomplexcomponentaction.h>
-#include <AOFlagger/strategy/actions/foreachmsaction.h>
-#include <AOFlagger/strategy/actions/foreachpolarisationaction.h>
-#include <AOFlagger/strategy/actions/fouriertransformaction.h>
-#include <AOFlagger/strategy/actions/frequencyconvolutionaction.h>
-#include <AOFlagger/strategy/actions/frequencyselectionaction.h>
-#include <AOFlagger/strategy/actions/fringestopaction.h>
-#include <AOFlagger/strategy/actions/imageraction.h>
-#include <AOFlagger/strategy/actions/iterationaction.h>
-#include <AOFlagger/strategy/actions/highpassfilteraction.h>
-#include <AOFlagger/strategy/actions/normalizevarianceaction.h>
-#include <AOFlagger/strategy/actions/plotaction.h>
-#include <AOFlagger/strategy/actions/quickcalibrateaction.h>
-#include <AOFlagger/strategy/actions/rawappenderaction.h>
-#include <AOFlagger/strategy/actions/setflaggingaction.h>
-#include <AOFlagger/strategy/actions/setimageaction.h>
-#include <AOFlagger/strategy/actions/slidingwindowfitaction.h>
-#include <AOFlagger/strategy/actions/statisticalflagaction.h>
-#include <AOFlagger/strategy/actions/strategyaction.h>
-#include <AOFlagger/strategy/actions/svdaction.h>
-#include <AOFlagger/strategy/actions/sumthresholdaction.h>
-#include <AOFlagger/strategy/actions/timeconvolutionaction.h>
-#include <AOFlagger/strategy/actions/timeselectionaction.h>
-#include <AOFlagger/strategy/actions/uvprojectaction.h>
-#include <AOFlagger/strategy/actions/writedataaction.h>
-#include <AOFlagger/strategy/actions/writeflagsaction.h>
-
-namespace rfiStrategy {
-
-	void StrategyWriter::write(const Strategy &strategy)
-	{
-		_describedActions.clear();
-
-		std::string commentStr = 
-			"This is a Strategy configuration file for the\n"
-			"rfi detector by André Offringa (offringa@astro.rug.nl).\n";
-		if(_writeDescriptions)
-			commentStr += "\nIf you like to take a look at the structure of this file,\n"
-				"try opening it in e.g. Firefox.\n";
-
-		Comment(commentStr.c_str());
-
-		Start("rfi-strategy");
-		Attribute("format-version", STRATEGY_FILE_FORMAT_VERSION);
-		Attribute("reader-version-required", STRATEGY_FILE_READER_VERSION_REQUIRED);
-		writeAction(strategy);
-		End();
-
-		Close();
-	}
-	
-	void StrategyWriter::writeAction(const Action &action)
-	{
-		if(_writeDescriptions)
-		{
-			if(_describedActions.count(action.Type()) == 0)
-			{
-				const char *description = ActionFactory::GetDescription(action.Type());
-				if(description != 0)
-					Comment(wrap(description, 70).c_str());
-				_describedActions.insert(action.Type());
-			}
-		}
-
-		Start("action");
-		switch(action.Type())
-		{
-			case AbsThresholdActionType:
-				writeAbsThresholdAction(static_cast<const AbsThresholdAction&>(action));
-				break;
-			case ActionBlockType:
-				throw std::runtime_error("Can not store action blocks");
-			case AdapterType:
-				writeAdapter(static_cast<const Adapter&>(action));
-				break;
-			case AddStatisticsActionType:
-				writeAddStatisticsAction(static_cast<const AddStatisticsAction&>(action));
-				break;
-			case BaselineSelectionActionType:
-				writeBaselineSelectionAction(static_cast<const BaselineSelectionAction&>(action));
-				break;
-			case ChangeResolutionActionType:
-				writeChangeResolutionAction(static_cast<const ChangeResolutionAction&>(action));
-				break;
-			case CollectNoiseStatisticsActionType:
-				writeCollectNoiseStatisticsAction(static_cast<const CollectNoiseStatisticsAction&>(action));
-				break;
-			case CombineFlagResultsType:
-				writeCombineFlagResults(static_cast<const CombineFlagResults&>(action));
-				break;
-			case CutAreaActionType:
-				writeCutAreaAction(static_cast<const CutAreaAction&>(action));
-				break;
-			case DirectionalCleanActionType:
-				writeDirectionalCleanAction(static_cast<const DirectionalCleanAction&>(action));
-				break;
-			case DirectionProfileActionType:
-				writeDirectionProfileAction(static_cast<const DirectionProfileAction&>(action));
-				break;
-				case EigenValueVerticalActionType:
-				writeEigenValueVerticalAction(static_cast<const EigenValueVerticalAction&>(action));
-				break;
-			case ForEachBaselineActionType:
-				writeForEachBaselineAction(static_cast<const ForEachBaselineAction&>(action));
-				break;
-			case ForEachComplexComponentActionType:
-				writeForEachComplexComponentAction(static_cast<const ForEachComplexComponentAction&>(action));
-				break;
-			case ForEachMSActionType:
-				writeForEachMSAction(static_cast<const ForEachMSAction&>(action));
-				break;
-			case ForEachPolarisationBlockType:
-				writeForEachPolarisationBlock(static_cast<const ForEachPolarisationBlock&>(action));
-				break;
-			case FourierTransformActionType:
-				writeFourierTransformAction(static_cast<const FourierTransformAction&>(action));
-				break;
-			case FrequencyConvolutionActionType:
-				writeFrequencyConvolutionAction(static_cast<const FrequencyConvolutionAction&>(action));
-				break;
-			case FrequencySelectionActionType:
-				writeFrequencySelectionAction(static_cast<const FrequencySelectionAction&>(action));
-				break;
-			case FringeStopActionType:
-				writeFringeStopAction(static_cast<const FringeStopAction&>(action));
-				break;
-			case HighPassFilterActionType:
-				writeHighPassFilterAction(static_cast<const HighPassFilterAction&>(action));
-				break;
-			case ImagerActionType:
-				writeImagerAction(static_cast<const ImagerAction&>(action));
-				break;
-			case IterationBlockType:
-				writeIterationBlock(static_cast<const IterationBlock&>(action));
-				break;
-			case NormalizeVarianceActionType:
-				writeNormalizeVarianceAction(static_cast<const NormalizeVarianceAction&>(action));
-				break;
-			case PlotActionType:
-				writePlotAction(static_cast<const PlotAction&>(action));
-				break;
-			case QuickCalibrateActionType:
-				writeQuickCalibrateAction(static_cast<const QuickCalibrateAction&>(action));
-				break;
-			case RawAppenderActionType:
-				writeRawAppenderAction(static_cast<const RawAppenderAction&>(action));
-				break;
-			case SetFlaggingActionType:
-				writeSetFlaggingAction(static_cast<const SetFlaggingAction&>(action));
-				break;
-			case SetImageActionType:
-				writeSetImageAction(static_cast<const SetImageAction&>(action));
-				break;
-			case SlidingWindowFitActionType:
-				writeSlidingWindowFitAction(static_cast<const SlidingWindowFitAction&>(action));
-				break;
-			case StatisticalFlagActionType:
-				writeStatisticalFlagAction(static_cast<const StatisticalFlagAction&>(action));
-				break;
-			case StrategyType:
-				writeStrategy(static_cast<const Strategy&>(action));
-				break;
-			case SVDActionType:
-				writeSVDAction(static_cast<const SVDAction&>(action));
-				break;
-			case SumThresholdActionType:
-				writeSumThresholdAction(static_cast<const SumThresholdAction&>(action));
-				break;
-			case TimeConvolutionActionType:
-				writeTimeConvolutionAction(static_cast<const TimeConvolutionAction&>(action));
-			break;
-			case TimeSelectionActionType:
-				writeTimeSelectionAction(static_cast<const TimeSelectionAction&>(action));
-				break;
-			case UVProjectActionType:
-				writeUVProjectAction(static_cast<const UVProjectAction&>(action));
-				break;
-			case WriteDataActionType:
-				writeWriteDataAction(static_cast<const WriteDataAction&>(action));
-				break;
-			case WriteFlagsActionType:
-				writeWriteFlagsAction(static_cast<const WriteFlagsAction&>(action));
-				break;
-			case ForEachSimulatedBaselineActionType:
-			case ResamplingActionType:
-			case SpatialCompositionActionType:
-				throw std::runtime_error("Strategy contains an action for which saving is not supported");
-				break;
-		}
-		End();
-	}
-	
-	void StrategyWriter::writeContainerItems(const ActionContainer &actionContainer)
-	{
-		Start("children");
-		for(size_t i=0;i<actionContainer.GetChildCount();++i)
-		{
-			writeAction(actionContainer.GetChild(i));
-		}
-		End();
-	}
-	
-	void StrategyWriter::writeAbsThresholdAction(const AbsThresholdAction &action)
-	{
-		Attribute("type", "AbsThreshold");
-		Write<num_t>("threshold", action.Threshold());
-	}
-	
-	void StrategyWriter::writeAdapter(const Adapter &action)
-	{
-		Attribute("type", "Adapter");
-		Write<bool>("restore-originals", action.RestoreOriginals());
-		writeContainerItems(action);
-	}
-
-	void StrategyWriter::writeAddStatisticsAction(const AddStatisticsAction &action)
-	{
-		Attribute("type", "AddStatisticsAction");
-		Write("file-prefix", action.FilePrefix().c_str());
-		Write("compare-original-and-alternative", action.CompareOriginalAndAlternative());
-		Write("separate-baseline-statistics", action.SeparateBaselineStatistics());
-		Write("perform-classification", action.PerformClassification());
-		Write("write-immediately", action.WriteImmediately());
-	}
-
-	void StrategyWriter::writeBaselineSelectionAction(const class BaselineSelectionAction &action)
-	{
-		Attribute("type", "BaselineSelectionAction");
-		Write<bool>("preparation-step", action.PreparationStep());
-		Write<bool>("flag-bad-baselines", action.FlagBadBaselines());
-		Write<num_t>("threshold", action.Threshold());
-		Write<num_t>("smoothing-sigma", action.SmoothingSigma());
-		Write<num_t>("abs-threshold", action.AbsThreshold());
-		Write<bool>("make-plot", action.MakePlot());
-	}
-
-	void StrategyWriter::writeChangeResolutionAction(const ChangeResolutionAction &action)
-	{
-		Attribute("type", "ChangeResolutionAction");
-		Write<int>("time-decrease-factor", action.TimeDecreaseFactor());
-		Write<int>("frequency-decrease-factor", action.FrequencyDecreaseFactor());
-		Write<bool>("restore-revised", action.RestoreRevised());
-		Write<bool>("restore-masks", action.RestoreMasks());
-		writeContainerItems(action);
-	}
-
-	void StrategyWriter::writeCollectNoiseStatisticsAction(const CollectNoiseStatisticsAction &action)
-	{
-		Attribute("type", "CollectNoiseStatisticsAction");
-		Write("filename", action.Filename().c_str());
-		Write<int>("channel-distance", action.ChannelDistance());
-		Write<int>("tile-timestep-size", action.TileWidth());
-		Write<int>("tile-channels-size", action.TileHeight());
-	}
-
-	void StrategyWriter::writeCombineFlagResults(const CombineFlagResults &action)
-	{
-		Attribute("type", "CombineFlagResults");
-		writeContainerItems(action);
-	}
-
-	void StrategyWriter::writeCutAreaAction(const CutAreaAction &action)
-	{
-		Attribute("type", "CutAreaAction");
-		Write<int>("start-time-steps", action.StartTimeSteps());
-		Write<int>("end-time-steps", action.EndTimeSteps());
-		Write<int>("top-channels", action.TopChannels());
-		Write<int>("bottom-channels", action.BottomChannels());
-		writeContainerItems(action);
-	}
-
-	void StrategyWriter::writeDirectionalCleanAction(const DirectionalCleanAction &action)
-	{
-		Attribute("type", "DirectionalCleanAction");
-		Write<double>("limiting-distance", action.LimitingDistance());
-		Write<int>("channel-convolution-size", action.ChannelConvolutionSize());
-		Write<double>("attenuation-of-center", action.AttenuationOfCenter());
-		Write<bool>("make-plot", action.MakePlot());
-	}
-
-	void StrategyWriter::writeDirectionProfileAction(const DirectionProfileAction &action)
-	{
-		Attribute("type", "DirectionProfileAction");
-		Write<int>("axis", (int) action.Axis());
-		Write<int>("profile-action", (int) action.ProfileAction());
-	}
-
-  void StrategyWriter::writeEigenValueVerticalAction(const EigenValueVerticalAction &)
-  {
-    Attribute("type", "EigenValueVerticalAction");
-  }
-
-	void StrategyWriter::writeForEachBaselineAction(const ForEachBaselineAction &action)
-	{
-		Attribute("type", "ForEachBaselineAction");
-		Write<int>("selection", action.Selection());
-		Write<int>("thread-count", action.ThreadCount());
-		writeContainerItems(action);
-	}
-
-	void StrategyWriter::writeForEachComplexComponentAction(const ForEachComplexComponentAction &action)
-	{
-		Attribute("type", "ForEachComplexComponentAction");
-		Write<bool>("on-amplitude", action.OnAmplitude());
-		Write<bool>("on-phase", action.OnPhase());
-		Write<bool>("on-real", action.OnReal());
-		Write<bool>("on-imaginary", action.OnImaginary());
-		Write<bool>("restore-from-amplitude", action.RestoreFromAmplitude());
-		writeContainerItems(action);
-	}
-
-	void StrategyWriter::writeForEachMSAction(const ForEachMSAction &action)
-	{
-		Attribute("type", "ForEachMSAction");
-		Start("filenames");
-		Write("data-column-name", action.DataColumnName());
-		Write<bool>("subtract-model", action.SubtractModel());
-		const std::vector<std::string> &filenames = action.Filenames();
-		for(std::vector<std::string>::const_iterator i=filenames.begin();i!=filenames.end();++i)
-		{
-			Write("filename", i->c_str());
-		}
-		End();
-		writeContainerItems(action);
-	}
-
-	void StrategyWriter::writeForEachPolarisationBlock(const ForEachPolarisationBlock &action)
-	{
-		Attribute("type", "ForEachPolarisationBlock");
-		Write<bool>("on-xx", action.OnXX());
-		Write<bool>("on-xy", action.OnXY());
-		Write<bool>("on-yx", action.OnYX());
-		Write<bool>("on-yy", action.OnYY());
-		Write<bool>("on-stokes-i", action.OnStokesI());
-		Write<bool>("on-stokes-q", action.OnStokesQ());
-		Write<bool>("on-stokes-u", action.OnStokesU());
-		Write<bool>("on-stokes-v", action.OnStokesV());
-		writeContainerItems(action);
-	}
-
-	void StrategyWriter::writeFourierTransformAction(const FourierTransformAction &)
-	{
-		Attribute("type", "FourierTransformAction");
-	}
-
-	void StrategyWriter::writeFrequencyConvolutionAction(const FrequencyConvolutionAction &action)
-	{
-		Attribute("type", "FrequencyConvolutionAction");
-		Write<double>("convolution-size", action.ConvolutionSize());
-		Write<int>("kernel-kind", (int) action.KernelKind());
-	}
-
-	void StrategyWriter::writeFrequencySelectionAction(const FrequencySelectionAction &action)
-	{
-		Attribute("type", "FrequencySelectionAction");
-		Write<double>("threshold", action.Threshold());
-	}
-
-	void StrategyWriter::writeFringeStopAction(const FringeStopAction &action)
-	{
-		Attribute("type", "FringeStopAction");
-		Write<bool>("fit-channels-individually", action.FitChannelsIndividually());
-		Write<num_t>("fringes-to-consider", action.FringesToConsider());
-		Write<bool>("only-fringe-stop", action.OnlyFringeStop());
-		Write<int>("min-window-size", action.MinWindowSize());
-		Write<int>("max-window-size", action.MaxWindowSize());
-	}
-
-	void StrategyWriter::writeHighPassFilterAction(const HighPassFilterAction &action)
-	{
-		Attribute("type", "HighPassFilterAction");
-		Write<num_t>("horizontal-kernel-sigma-sq", action.HKernelSigmaSq());
-		Write<num_t>("vertical-kernel-sigma-sq", action.VKernelSigmaSq());
-		Write<int>("window-width", action.WindowWidth());
-		Write<int>("window-height", action.WindowHeight());
-		Write<int>("mode", action.Mode());
-	}
-
-	void StrategyWriter::writeImagerAction(const ImagerAction &)
-	{
-		Attribute("type", "ImagerAction");
-	}
-
-	void StrategyWriter::writeIterationBlock(const IterationBlock &action)
-	{
-		Attribute("type", "IterationBlock");
-		Write<int>("iteration-count", action.IterationCount());
-		Write<double>("sensitivity-start", action.SensitivityStart());
-		writeContainerItems(action);
-	}
-
-	void StrategyWriter::writeNormalizeVarianceAction(const NormalizeVarianceAction &action)
-	{
-		Attribute("type", "NormalizeVarianceAction");
-		Write<double>("median-filter-size-in-s", action.MedianFilterSizeInS());
-	}
-
-	void StrategyWriter::writePlotAction(const PlotAction &action)
-	{
-		Attribute("type", "PlotAction");
-		Write<int>("plot-kind", action.PlotKind());
-		Write<bool>("logarithmic-y-axis", action.LogarithmicYAxis());
-	}
-
-	void StrategyWriter::writeQuickCalibrateAction(const QuickCalibrateAction &)
-	{
-		Attribute("type", "QuickCalibrateAction");
-	}
-
-	void StrategyWriter::writeRawAppenderAction(const RawAppenderAction &)
-	{
-		Attribute("type", "RawAppenderAction");
-	}
-
-	void StrategyWriter::writeSetFlaggingAction(const SetFlaggingAction &action)
-	{
-		Attribute("type", "SetFlaggingAction");
-		Write<int>("new-flagging", action.NewFlagging());
-	}
-
-	void StrategyWriter::writeSetImageAction(const SetImageAction &action)
-	{
-		Attribute("type", "SetImageAction");
-		Write<int>("new-image", action.NewImage());
-	}
-
-	void StrategyWriter::writeSlidingWindowFitAction(const SlidingWindowFitAction &action)
-	{
-		Attribute("type", "SlidingWindowFitAction");
-		Write<num_t>("frequency-direction-kernel-size", action.Parameters().frequencyDirectionKernelSize);
-		Write<int>("frequency-direction-window-size", action.Parameters().frequencyDirectionWindowSize);
-		Write<int>("method", action.Parameters().method);
-		Write<num_t>("time-direction-kernel-size", action.Parameters().timeDirectionKernelSize);
-		Write<int>("time-direction-window-size", action.Parameters().timeDirectionWindowSize);
-	}
-
-	void StrategyWriter::writeStatisticalFlagAction(const StatisticalFlagAction &action)
-	{
-		Attribute("type", "StatisticalFlagAction");
-		Write<size_t>("enlarge-frequency-size", action.EnlargeFrequencySize());
-		Write<size_t>("enlarge-time-size", action.EnlargeTimeSize());
-		Write<num_t>("max-contaminated-frequencies-ratio", action.MaxContaminatedFrequenciesRatio());
-		Write<num_t>("max-contaminated-times-ratio", action.MaxContaminatedTimesRatio());
-		Write<num_t>("minimum-good-frequency-ratio", action.MinimumGoodFrequencyRatio());
-		Write<num_t>("minimum-good-time-ratio", action.MinimumGoodTimeRatio());
-	}
-
-	void StrategyWriter::writeStrategy(const class Strategy &action)
-	{
-		Attribute("type", "Strategy");
-		writeContainerItems(action);
-	}
-
-	void StrategyWriter::writeSVDAction(const SVDAction &action)
-	{
-		Attribute("type", "SVDAction");
-		Write<int>("singular-value-count", action.SingularValueCount());
-	}
-
-	void StrategyWriter::writeSumThresholdAction(const SumThresholdAction &action)
-	{
-		Attribute("type", "SumThresholdAction");
-		Write<num_t>("base-sensitivity", action.BaseSensitivity());
-		Write<bool>("time-direction-flagging", action.TimeDirectionFlagging());
-		Write<bool>("frequency-direction-flagging", action.FrequencyDirectionFlagging());
-	}
-
-	void StrategyWriter::writeTimeConvolutionAction(const TimeConvolutionAction &action)
-	{
-		Attribute("type", "TimeConvolutionAction");
-		Write<int>("operation", (int) action.Operation());
-		Write<num_t>("sinc-scale", action.SincScale());
-		Write<bool>("is-sinc-scale-in-samples", action.IsSincScaleInSamples());
-		Write<num_t>("direction-rad", action.DirectionRad());
-		Write<num_t>("eta-parameter", action.EtaParameter());
-		Write<bool>("auto-angle", action.AutoAngle());
-		Write<unsigned>("iterations", action.Iterations());
-	}
-
-	void StrategyWriter::writeTimeSelectionAction(const TimeSelectionAction &action)
-	{
-		Attribute("type", "TimeSelectionAction");
-		Write<double>("threshold", action.Threshold());
-	}
-
-	void StrategyWriter::writeUVProjectAction(const UVProjectAction &action)
-	{
-		Attribute("type", "UVProjectAction");
-		Write<numl_t>("direction-rad", action.DirectionRad());
-		Write<numl_t>("eta-parameter", action.EtaParameter());
-		Write<num_t>("dest-resolution-factor", action.DestResolutionFactor());
-		Write<bool>("reverse", action.Reverse());
-		Write<bool>("on-revised", action.OnRevised());
-		Write<bool>("on-contaminated", action.OnContaminated());
-	}
-	
-	void StrategyWriter::writeWriteDataAction(const WriteDataAction &)
-	{
-		Attribute("type", "WriteDataAction");
-	}
-
-	void StrategyWriter::writeWriteFlagsAction(const WriteFlagsAction &)
-	{
-		Attribute("type", "WriteFlagsAction");
-	}
-
-	std::string StrategyWriter::wrap(const std::string &input, size_t max) const
-	{
-		int start = 0;
-		bool first = true;
-		std::stringstream s;
-		int length = input.size();
-		while(start < length)
-		{
-			int end = start + max;
-			if(end > length)
-				end = length;
-			else {
-				do {
-					--end;
-				} while(end > start && input[end] != ' ');
-				if(end <= start)
-					end = start + max;
-				else
-					++end;
-			}
-			int nextStart = end;
-			while(end > start && input[end-1] == ' ') --end;
-
-			if(!first)
-				s << "\n";
-			for(int i=start;i<end;++i)
-				s << input[i];
-				
-			first = false;
-			start = nextStart;
-		}
-		return s.str();
-	}
-}
diff --git a/CEP/DP3/AOFlagger/src/strategy/imagesets/fitsimageset.cpp b/CEP/DP3/AOFlagger/src/strategy/imagesets/fitsimageset.cpp
deleted file mode 100644
index e042f5c357cf29f5eaf3d9165709ad34fbc5089d..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/strategy/imagesets/fitsimageset.cpp
+++ /dev/null
@@ -1,597 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <AOFlagger/strategy/imagesets/fitsimageset.h>
-
-#include <iostream>
-#include <sstream>
-
-#include <AOFlagger/msio/date.h>
-#include <AOFlagger/msio/fitsfile.h>
-#include <AOFlagger/msio/image2d.h>
-#include <AOFlagger/msio/timefrequencydata.h>
-
-namespace rfiStrategy {
-	
-	FitsImageSet::FitsImageSet(const std::string &file)
-	: ImageSet(), _currentBaselineIndex(0), _frequencyOffset(0.0)
-	{
-		_file = new FitsFile(file);
-		_file->Open(FitsFile::ReadWriteMode);
-	}
-	
-	FitsImageSet::~FitsImageSet()
-	{
-		delete _file;
-	}
-	
-	FitsImageSet *FitsImageSet::Copy()
-	{
-		FitsImageSet *newSet = new FitsImageSet(_file->Filename());
-		newSet->_baselines = _baselines;
-		newSet->_bandCount = _bandCount;
-		newSet->_antennaInfos = _antennaInfos;
-		return newSet;
-	}
-
-	void FitsImageSet::Initialize()
-	{
-		std::cout << "Keyword count: " << _file->GetKeywordCount() << std::endl;
-		if(_file->HasGroups())
-		{
-			std::cout << "This file has " << _file->GetGroupCount() << " groups with " << _file->GetParameterCount() << " parameters." << std::endl;
-			std::cout << "Group size: " << _file->GetGroupSize() << std::endl;
-			_file->MoveToHDU(1);
-			if(_file->GetCurrentHDUType() != FitsFile::ImageHDUType)
-				throw FitsIOException("Primary table is not a grouped image");
-			long double *parameters = new long double[_file->GetParameterCount()];
-			int baselineIndex = _file->GetGroupParameterIndex("BASELINE");
-			size_t groupCount = _file->GetGroupCount();
-			std::set<std::pair<size_t,size_t> > baselineSet;
-			for(size_t g=0;g<groupCount;++g)
-			{
-				_file->ReadGroupParameters(g, parameters);
-				int a1 = ((int) parameters[baselineIndex]) & 255;
-				int a2 = ((int) parameters[baselineIndex] >> 8) & 255;
-				baselineSet.insert(std::pair<size_t,size_t>(a1,a2));
-			}
-			delete[] parameters;
-			std::cout << "Baselines in file: " << baselineSet.size() << std::endl;
-			for(std::set<std::pair<size_t,size_t> >::const_iterator i=baselineSet.begin();i!=baselineSet.end();++i)
-				_baselines.push_back(*i);
-			_bandCount = _file->GetCurrentImageSize(5);
-		} else {
-			_baselines.push_back(std::pair<size_t,size_t>(0, 0));
-			_antennaInfos.push_back(AntennaInfo());
-			
-			// find number of bands
-			_file->MoveToHDU(2);
-			int ifColumn = _file->GetTableColumnIndex("IF");
-			int rowCount = _file->GetRowCount();
-			int ifIndex = 0;
-			for(int i=1;i<=rowCount;++i)
-			{
-				double thisIndex;
-				_file->ReadTableCell(i, ifColumn, &thisIndex, 1);
-				if((int) thisIndex > ifIndex)
-					ifIndex = (int) thisIndex;
-				else break;
-			}
-			_bandCount = ifIndex;
-			_bandInfos.resize(_bandCount);
-		}
-	}
-
-	BaselineData FitsImageSet::loadData(const ImageSetIndex &index)
-	{
-		const FitsImageSetIndex &fitsIndex = static_cast<const FitsImageSetIndex&>(index);
-		_frequencyOffset = 0.0;
-
-		_file->MoveToHDU(1);
-		TimeFrequencyMetaDataPtr metaData(new TimeFrequencyMetaData());
-		TimeFrequencyData data;
-		if(_file->HasGroups())
-			data = ReadPrimaryGroupTable(fitsIndex._baselineIndex, fitsIndex._band, 0, *metaData);
-		else
-			ReadPrimarySingleTable(data, *metaData);
-		for(int hduIndex=2;hduIndex <= _file->GetHDUCount();hduIndex++)
-		{
-			_file->MoveToHDU(hduIndex);
-			switch(_file->GetCurrentHDUType())
-			{
-				case FitsFile::BinaryTableHDUType:
-					std::cout << "Binary table found." << std::endl;
-					ReadTable(data, *metaData, fitsIndex._band);
-					break;
-				case FitsFile::ASCIITableHDUType:
-					std::cout << "ASCII table found." << std::endl;
-					ReadTable(data, *metaData, fitsIndex._band);
-					break;
-				case FitsFile::ImageHDUType:
-					std::cout << "Image found." << std::endl;
-					break;
-			}
-		}
-		
-		if(_file->HasGroups())
-		{
-			_currentBaselineIndex = fitsIndex._baselineIndex;
-			_currentBandIndex = fitsIndex._band;
-
-			metaData->SetBand(_bandInfos[fitsIndex._band]);
-			std::cout << "Loaded metadata for: " << Date::AipsMJDToString(metaData->ObservationTimes()[0]) << ", band " << fitsIndex._band << " (" << Frequency::ToString(_bandInfos[fitsIndex._band].channels[0].frequencyHz) << " - " << Frequency::ToString(_bandInfos[fitsIndex._band].channels.rbegin()->frequencyHz) << ")" << std::endl;
-
-		}
-		return BaselineData(data, metaData, index);
-	}
-
-	TimeFrequencyData FitsImageSet::ReadPrimaryGroupTable(size_t baselineIndex, int band, int stokes, TimeFrequencyMetaData &metaData)
-	{
-		if(!_file->HasGroups() || _file->GetCurrentHDUType() != FitsFile::ImageHDUType)
-			throw FitsIOException("Primary table is not a grouped image");
-
-		std::vector<double> observationTimes;
-		std::vector<UVW> uvws;
-
-		int keywordCount = _file->GetKeywordCount();
-		for(int i=1;i<=keywordCount;++i)
-			std::cout << "Keyword " << i << ": " << _file->GetKeyword(i) << "=" << _file->GetKeywordValue(i) << " ("  << _file->GetKeywordComment(i) << ")" << std::endl;
-
-		std::vector<long double> parameters(_file->GetParameterCount());
-		int baseline = _baselines[baselineIndex].first + (_baselines[baselineIndex].second<<8);
-		int baselineColumn = _file->GetGroupParameterIndex("BASELINE");
-		size_t
-			complexCount = _file->GetCurrentImageSize(2),
-			stokesStep = complexCount,
-			stokesCount = _file->GetCurrentImageSize(3),
-			frequencyStep = stokesCount*complexCount,
-			frequencyCount = _file->GetCurrentImageSize(4),
-			bandStep = frequencyStep*frequencyCount;
-                std::vector<std::vector<long double> > valuesR(frequencyCount);
-                std::vector<std::vector<long double> > valuesI(frequencyCount);
-		std::vector<long double> data(_file->GetImageSize());
-		size_t groupCount = _file->GetGroupCount();
-		bool hasDate2 = _file->HasGroupParameter("DATE", 2);
-		int date2Index = 0, date1Index = _file->GetGroupParameterIndex("DATE");
-		if(hasDate2)
-		{
-			date2Index = _file->GetGroupParameterIndex("DATE", 2);
-		}
-		int uuIndex, vvIndex, wwIndex;
-		if(_file->HasGroupParameter("UU"))
-		{
-			uuIndex = _file->GetGroupParameterIndex("UU");
-			vvIndex = _file->GetGroupParameterIndex("VV");
-			wwIndex = _file->GetGroupParameterIndex("WW");
-		} else {
-			uuIndex = _file->GetGroupParameterIndex("UU---SIN");
-			vvIndex = _file->GetGroupParameterIndex("VV---SIN");
-			wwIndex = _file->GetGroupParameterIndex("WW---SIN");
-		}
-		size_t match = 0;
-		double frequencyFactor = 1.0;
-		if(_frequencyOffset != 0.0)
-			frequencyFactor = _frequencyOffset;
-		for(size_t g=0;g<groupCount;++g)
-		{
-			_file->ReadGroupParameters(g, &parameters[0]);
-			if(parameters[baselineColumn] == baseline)
-			{
-				double date;
-				if(hasDate2)
-					date = parameters[date1Index] + parameters[date2Index];
-				else
-					date = parameters[date1Index];
-				UVW uvw;
-				uvw.u = parameters[uuIndex] * frequencyFactor;
-				uvw.v = parameters[vvIndex] * frequencyFactor;
-				uvw.w = parameters[wwIndex] * frequencyFactor;
-
-				_file->ReadGroupData(g, &data[0]);
-				for(size_t f=0;f<frequencyCount;++f)
-				{
-					size_t index = stokes*stokesStep + frequencyStep*f + bandStep*band;
-					long double r = data[index];
-					long double i = data[index + 1];
-					valuesR[f].push_back(r);
-					valuesI[f].push_back(i);
-				}
-				observationTimes.push_back(Date::JDToAipsMJD(date));
-				uvws.push_back(uvw);
-				++match;
-			}
-		}
-		std::cout << match << " rows in table matched baseline." << std::endl;
-		data.clear();
-		parameters.clear();
-
-		std::cout << "Image is " << valuesR[0].size() << " x " << frequencyCount << std::endl;
-		if(valuesR[0].size() == 0)
-			throw BadUsageException("Baseline not found!");
-		Image2DPtr
-			real = Image2D::CreateUnsetImagePtr(valuesR[0].size(), frequencyCount),
-			imaginary = Image2D::CreateUnsetImagePtr(valuesR[0].size(), frequencyCount);
-		for(size_t i=0;i<valuesR[0].size();++i)
-		{
-			for(size_t f=0;f<frequencyCount;++f)
-			{
-				real->SetValue(i, f, valuesR[f][i]);
-				imaginary->SetValue(i, f, valuesI[f][i]);
-			}
-		}
-		
-		metaData.SetUVW(uvws);
-		metaData.SetObservationTimes(observationTimes);
-		return TimeFrequencyData(StokesIPolarisation, real, imaginary);
-	}
-
-	void FitsImageSet::ReadPrimarySingleTable(TimeFrequencyData &data, TimeFrequencyMetaData &metaData)
-	{
-		int keywordCount = _file->GetKeywordCount();
-		for(int i=1;i<=keywordCount;++i)
-			std::cout << "Keyword " << i << ": " << _file->GetKeyword(i) << "=" << _file->GetKeywordValue(i) << " ("  << _file->GetKeywordComment(i) << ")" << std::endl;
-	}
-	
-	void FitsImageSet::ReadTable(TimeFrequencyData &data, TimeFrequencyMetaData &metaData, size_t bandIndex)
-	{
-		std::cout << "Row count: " << _file->GetRowCount() << std::endl;
-		std::cout << "Column count: " << _file->GetColumnCount() << std::endl;
-		for(int i= 1;i <= _file->GetColumnCount(); ++i)
-		{
-			std::cout << "Column type " << i << ": " << _file->GetColumnType(i) << std::endl;
-		}
-		std::string extName = _file->GetKeywordValue("EXTNAME");
-		for(int i=1;i<=_file->GetKeywordCount();++i)
-			std::cout << "Keyword " << i << ": " << _file->GetKeyword(i) << "=" << _file->GetKeywordValue(i) << " ("  << _file->GetKeywordComment(i) << ")" << std::endl;
-		if(extName == "AIPS AN")
-			ReadAntennaTable(metaData);
-		else if(extName == "AIPS FQ")
-			ReadFrequencyTable(data, metaData);
-		else if(extName == "AIPS CL")
-			ReadCalibrationTable();
-		else if(extName == "SINGLE DISH")
-			ReadSingleDishTable(data, metaData, bandIndex);
-	}
-	
-	void FitsImageSet::ReadAntennaTable(TimeFrequencyMetaData &metaData)
-	{
-		std::cout << "Found antenna table" << std::endl;
-		_frequencyOffset = _file->GetDoubleKeywordValue("FREQ");
-		for(std::vector<BandInfo>::iterator i=_bandInfos.begin();i!=_bandInfos.end();++i)
-		{
-			for(std::vector<ChannelInfo>::iterator j=i->channels.begin();j!=i->channels.end();++j) {
-				j->frequencyHz += _frequencyOffset;
-			}
-		}
-		std::vector<UVW> uvws(metaData.UVW());
-		for(std::vector<UVW>::iterator i=uvws.begin();i!=uvws.end();++i)
-		{
-			i->u = i->u * _frequencyOffset;
-			i->v = i->v * _frequencyOffset;
-			i->w = i->w * _frequencyOffset;
-		}
-		metaData.SetUVW(uvws);
-		_antennaInfos.clear();
-		for(int i=1;i<=_file->GetRowCount();++i)
-		{
-			AntennaInfo info;
-			char name[9];
-			long double pos[3];
-			_file->ReadTableCell(i, 1, name);
-			_file->ReadTableCell(i, 2, pos, 3);
-			info.name = name;
-			info.position.x = pos[0];
-			info.position.y = pos[1];
-			info.position.z = pos[2];
-			_antennaInfos.push_back(info);
-		}
-	}
-
-	void FitsImageSet::ReadFrequencyTable(TimeFrequencyData &data, TimeFrequencyMetaData &metaData)
-	{
-		std::cout << "Found frequency table" << std::endl;
-		const size_t numberIfs = _file->GetIntKeywordValue("NO_IF");
-		std::cout << "Number of ifs: " << numberIfs << std::endl;
-		_bandInfos.clear();
-		BandInfo bandInfo;
-		for(int i=1;i<=_file->GetRowCount();++i)
-		{
-			long double freqSel, ifFreq[numberIfs], chWidth[numberIfs], totalBandwidth[numberIfs], sideband[numberIfs];
-			_file->ReadTableCell(i, 1, &freqSel, 1);
-			_file->ReadTableCell(i, 2, ifFreq, numberIfs);
-			_file->ReadTableCell(i, 3, chWidth, numberIfs);
-			_file->ReadTableCell(i, 4, totalBandwidth, numberIfs);
-			_file->ReadTableCell(i, 5, sideband, numberIfs);
-			for(size_t b=0;b<numberIfs;++b)
-			{
-				for(size_t channel=0;channel<data.ImageHeight();++channel)
-				{
-					ChannelInfo channelInfo;
-					channelInfo.channelWidthHz = chWidth[b];
-					channelInfo.effectiveBandWidthHz = chWidth[b];
-					channelInfo.frequencyHz = _frequencyOffset + ifFreq[b] + (chWidth[b] * channel);
-					channelInfo.frequencyIndex = channel;
-					channelInfo.resolutionHz = chWidth[b];
-					bandInfo.channels.push_back(channelInfo);
-				}
-
-				bandInfo.windowIndex = 0;
-				_bandInfos.push_back(bandInfo);
-			}
-		}
-	}
-
-	void FitsImageSet::ReadCalibrationTable()
-	{
-		std::cout << "Found calibration table with " << _file->GetRowCount() << " rows." << std::endl;
-	}
-	
-	void FitsImageSet::ReadSingleDishTable(TimeFrequencyData &data, TimeFrequencyMetaData &metaData, size_t ifIndex)
-	{
-		std::cout << "Found single dish table with " << _file->GetRowCount() << " rows." << std::endl;
-		const int
-			timeColumn = _file->GetTableColumnIndex("TIME"),
-			dateObsColumn = _file->GetTableColumnIndex("DATE-OBS"),
-			dataColumn = _file->GetTableColumnIndex("DATA"),
-			flagColumn = _file->GetTableColumnIndex("FLAGGED"),
-			freqValColumn = _file->GetTableColumnIndex("CRVAL1"),
-			freqRefPixColumn = _file->GetTableColumnIndex("CRPIX1"),
-			freqDeltaColumn = _file->GetTableColumnIndex("CDELT1"),
-			freqResColumn = _file->GetTableColumnIndex("FREQRES"),
-			freqBandwidthColumn = _file->GetTableColumnIndex("BANDWID"),
-			ifColumn = _file->GetTableColumnIndex("IF");
-		//int
-		//	beamColumn = 0;
-		//const bool hasBeamColumn = _file->HasTableColumn("BEAM", beamColumn);
-		const int
-			freqCount = _file->GetTableDimensionSize(dataColumn, 0),
-			polarizationCount = _file->GetTableDimensionSize(dataColumn, 1),
-			raCount = _file->GetTableDimensionSize(dataColumn, 2),
-			decCount = _file->GetTableDimensionSize(dataColumn, 3);
-			
-		const std::string telescopeName = _file->GetKeywordValue("TELESCOP");
-		_antennaInfos[0].name = telescopeName;
-			
-		const int totalSize = _file->GetTableColumnArraySize(dataColumn);
-		const int rowCount = _file->GetRowCount();
-		std::cout << "Shape of data cells: " << freqCount << " channels x " << polarizationCount << " pols x " << raCount << " RAs x " << decCount << " decs" << "=" << totalSize << '\n';
-		long double cellData[totalSize];
-		bool flagData[totalSize];
-                std::vector<Image2DPtr> images(polarizationCount);
-                std::vector<Mask2DPtr> masks(polarizationCount);
-		for(int i=0;i<polarizationCount;++i)
-		{
-			images[i] = Image2D::CreateZeroImagePtr(rowCount, freqCount);
-			masks[i] = Mask2D::CreateSetMaskPtr<true>(rowCount, freqCount);
-		}
-		std::vector<double> observationTimes(rowCount);
-		bool hasBand = false;
-		size_t timeIndex = 0;
-		for(int row=1;row<=rowCount;++row)
-		{
-			long double time, date, ifNumber;
-			_file->ReadTableCell(row, ifColumn, &ifNumber, 1);
-			
-			if(ifNumber == ifIndex+1)
-			{
-				_file->ReadTableCell(row, timeColumn, &time, 1);
-				_file->ReadTableCell(row, dateObsColumn, &date, 1);
-				_file->ReadTableCell(row, dataColumn, cellData, totalSize);
-				_file->ReadTableCell(row, flagColumn, flagData, totalSize);
-			
-				observationTimes[timeIndex] = time;
-				
-				if(!hasBand)
-				{
-					long double freqVal = 0.0, freqRefPix = 0.0, freqDelta = 0.0, freqRes = 0.0, freqBandwidth = 0.0;
-					_file->ReadTableCell(row, freqValColumn, &freqVal, 1);
-					_file->ReadTableCell(row, freqRefPixColumn, &freqRefPix, 1);
-					_file->ReadTableCell(row, freqDeltaColumn, &freqDelta, 1);
-					_file->ReadTableCell(row, freqResColumn, &freqRes, 1);
-					_file->ReadTableCell(row, freqBandwidthColumn, &freqBandwidth, 1);
-					if(freqBandwidth > 0.0)
-					{
-						std::cout << "Frequency info: " <<freqVal << " Hz at index " << freqRefPix << ", delta " << freqDelta << "\n";
-						std::cout << "Frequency res: " <<freqRes << " with bandwidth " << freqBandwidth << " Hz\n";
-						BandInfo bandInfo;
-						bandInfo.windowIndex = 0;
-						for(int i=0;i<freqCount;++i)
-						{
-							ChannelInfo c;
-							c.frequencyIndex = i;
-							c.frequencyHz = ((double) i-freqRefPix)*freqDelta + freqVal;
-							bandInfo.channels.push_back(c);
-						}
-						_bandInfos[0] = bandInfo;
-						metaData.SetBand(bandInfo);
-						hasBand = true;
-					}
-				}
-
-				long double *dataPtr = cellData;
-				bool *flagPtr = flagData;
-				for(int p=0;p<polarizationCount;++p)
-				{
-					for(int f=0;f<freqCount;++f)
-					{
-						images[p]->SetValue(timeIndex, f, *dataPtr);
-						masks[p]->SetValue(timeIndex, f, *flagPtr);
-						++dataPtr;
-						++flagPtr;
-					}
-				}
-				++timeIndex;
-			}
-			if(ifNumber > _bandCount) _bandCount = ifNumber;
-		}
-		for(int p=0;p<polarizationCount;++p)
-		{
-			images[p]->SetTrim(0, 0, timeIndex, images[p]->Height());
-			masks[p] = masks[p]->Trim(0, 0, timeIndex, images[p]->Height());
-		}
-		observationTimes.resize(timeIndex);
-		metaData.SetObservationTimes(observationTimes);
-		if(polarizationCount == 1)
-		{
-			data = TimeFrequencyData(TimeFrequencyData::AmplitudePart, StokesIPolarisation, images[0]);
-			data.SetGlobalMask(masks[0]);
-		} else if(polarizationCount == 2)
-		{
-			data = TimeFrequencyData(TimeFrequencyData::AmplitudePart, AutoDipolePolarisation, images[0], images[1]);
-			data.SetIndividualPolarisationMasks(masks[0], masks[1]);
-		}
-		else throw std::runtime_error("Don't know how to convert polarizations in file");
-	}
-	
-	void FitsImageSet::AddWriteFlagsTask(const ImageSetIndex &index, std::vector<Mask2DCPtr> &flags)
-	{
-		if(_file->HasGroups())
-			throw BadUsageException("Not implemented for grouped fits files");
-		else
-			saveSingleDishFlags(flags);
-	}
-
-	void FitsImageSet::PerformWriteFlagsTask()
-	{
-		if(_file->HasGroups())
-			throw BadUsageException("Not implemented for grouped fits files");
-		else {
-			// Nothing to be done; Add..Task already wrote the flags.
-		}
-	}
-	
-	void FitsImageSet::saveSingleDishFlags(std::vector<Mask2DCPtr> &flags)
-	{
-		_file->Close();
-		_file->Open(FitsFile::ReadWriteMode);
-		_file->MoveToHDU(2);
-		std::cout << "Writing single dish table with " << _file->GetRowCount() << " rows." << std::endl;
-		const int
-			dataColumn = _file->GetTableColumnIndex("DATA"),
-			flagColumn = _file->GetTableColumnIndex("FLAGGED");
-		const int
-			freqCount = _file->GetTableDimensionSize(dataColumn, 0),
-			polarizationCount = _file->GetTableDimensionSize(dataColumn, 1);
-			
-		const int totalSize = _file->GetTableColumnArraySize(dataColumn);
-		const int rowCount = _file->GetRowCount();
-		double cellData[totalSize];
-		bool flagData[totalSize];
-		std::vector<Mask2DCPtr> storedFlags = flags;
-		if(flags.size()==1)
-		{
-			while(storedFlags.size() < (unsigned) polarizationCount) storedFlags.push_back(flags[0]);
-		}
-		if(storedFlags.size() != (unsigned) polarizationCount)
-		{
-			std::stringstream s;
-			s << "saveSingleDishFlags() : mismatch in polarization count: the given vector contains " << flags.size() << " polarizations, the number of polarizations in the file is " << polarizationCount;
-			throw std::runtime_error(s.str());
-		}
-		for(std::vector<Mask2DCPtr>::const_iterator i=storedFlags.begin();i!=storedFlags.end();++i)
-		{
-			if((*i)->Height() != (unsigned) freqCount)
-				throw std::runtime_error("Frequency count in given mask does not match with the file");
-			if((*i)->Width() != (unsigned) rowCount)
-				throw std::runtime_error("Time step count in given mask does not match with the file");
-		}
-		for(int row=1;row<=rowCount;++row)
-		{
-			std::cout << row << "\n";
-			_file->ReadTableCell(row, dataColumn, cellData, totalSize);
-			double *dataPtr = cellData;
-			bool *flagPtr = flagData;
-			
-			for(int f=0;f<freqCount;++f)
-			{
-				for(int p=0;p<polarizationCount;++p)
-				{
-					if(storedFlags[p]->Value(row-1, f))
-					{
-						*flagPtr = true;
-						*dataPtr = 1e20;
-					} else {
-						*flagPtr = false;
-					}
-					++dataPtr;
-					++flagPtr;
-				}
-			}
-			
-			_file->WriteTableCell(row, dataColumn, cellData, totalSize);
-			_file->WriteTableCell(row, flagColumn, flagData, totalSize);
-		}
-	}
-	
-	void FitsImageSetIndex::Previous()
-	{
-		if(_baselineIndex > 0)
-			--_baselineIndex;
-		else {
-			_baselineIndex = static_cast<class FitsImageSet&>(imageSet()).Baselines().size() - 1;
-			LargeStepPrevious();
-		}
-	}
-	
-	void FitsImageSetIndex::Next()
-	{
-		++_baselineIndex;
-		if( _baselineIndex >= static_cast<class FitsImageSet&>(imageSet()).Baselines().size() )
-		{
-			_baselineIndex = 0;
-			LargeStepNext();
-		}
-	}
-
-	void FitsImageSetIndex::LargeStepPrevious()
-	{
-		if(_band > 0)
-			--_band;
-		else {
-			_band = static_cast<class FitsImageSet&>(imageSet()).BandCount() - 1;
-			_isValid = false;
-		}
-	}
-	
-	void FitsImageSetIndex::LargeStepNext()
-	{
-		++_band;
-		if(_band >= static_cast<class FitsImageSet&>(imageSet()).BandCount())
-		{
-			_band = 0;
-			_isValid = false;
-		}
-	}
-
-	std::string FitsImageSetIndex::Description() const {
-		FitsImageSet &set = static_cast<class FitsImageSet&>(imageSet());
-		int a1 = set.Baselines()[_baselineIndex].first;
-		int a2 = set.Baselines()[_baselineIndex].second;
-		AntennaInfo info1 = set.GetAntennaInfo(a1);
-		AntennaInfo info2 = set.GetAntennaInfo(a2);
-		std::stringstream s;
-		s << "fits correlation " << info1.name << " x " << info2.name << ", band " << _band;
-		return s.str();
-	}
-
-	std::string FitsImageSet::File()
-	{
-		return _file->Filename();
-	}
-}
diff --git a/CEP/DP3/AOFlagger/src/strategy/imagesets/imageset.cpp b/CEP/DP3/AOFlagger/src/strategy/imagesets/imageset.cpp
deleted file mode 100644
index 9f2fe57622266599c6683b01895c1890119523c8..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/strategy/imagesets/imageset.cpp
+++ /dev/null
@@ -1,113 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#include <AOFlagger/strategy/imagesets/imageset.h>
-
-#include <AOFlagger/strategy/imagesets/fitsimageset.h>
-#include <AOFlagger/strategy/imagesets/harishreader.h>
-#include <AOFlagger/strategy/imagesets/msimageset.h>
-#include <AOFlagger/strategy/imagesets/noisestatimageset.h>
-#include <AOFlagger/strategy/imagesets/parmimageset.h>
-#include <AOFlagger/strategy/imagesets/rawimageset.h>
-#include <AOFlagger/strategy/imagesets/rawdescimageset.h>
-#include <AOFlagger/strategy/imagesets/rspimageset.h>
-#include <AOFlagger/strategy/imagesets/timefrequencystatimageset.h>
-
-namespace rfiStrategy {
-	ImageSet *ImageSet::Create(const std::string &file, BaselineIOMode ioMode, bool readUVW)
-	{
-		if(IsFitsFile(file))
-			return new FitsImageSet(file);
-		else if(IsRCPRawFile(file))
-			return new RSPImageSet(file);
-		else if(IsTKPRawFile(file))
-			return new RawImageSet(file);
-		else if(IsRawDescFile(file))
-			return new RawDescImageSet(file);
-		else if(IsParmFile(file))
-			return new ParmImageSet(file);
-		else if(IsTimeFrequencyStatFile(file))
-			return new TimeFrequencyStatImageSet(file);
-		else if(IsNoiseStatFile(file))
-			return new NoiseStatImageSet(file);
-		else if(IsHarishFile(file))
-			return new HarishReader(file);
-		else {
-			MSImageSet *set = new MSImageSet(file, ioMode);
-			set->SetReadUVW(readUVW);
-			return set;
-		}
-	}
-	
-	bool ImageSet::IsFitsFile(const std::string &file)
-	{
-		return
-		(file.size() > 4 && file.substr(file.size()- 4) == ".UVF")
-		||
-		(file.size() > 5 && file.substr(file.size() - 5) == ".fits" )
-		||
-		(file.size() > 7 && file.substr(file.size() - 7) == ".sdfits" ); // Parkes raw files are named like this
-	}
-	
-	bool ImageSet::IsRCPRawFile(const std::string &file)
-	{
-		return file.size() > 4 && file.substr(file.size()-4) == ".raw";
-	}
-	
-	bool ImageSet::IsTKPRawFile(const std::string &file)
-	{
-		return file.size() > 4 && file.substr(file.size()-4) == ".1ch";
-	}
-	
-	bool ImageSet::IsRawDescFile(const std::string &file)
-	{
-		return file.size() > 8 && file.substr(file.size()-8) == ".rawdesc";
-	}
-	
-	bool ImageSet::IsParmFile(const std::string &file)
-	{
-		return file.size() >= 10 && file.substr(file.size()-10) == "instrument";
-	}
-	
-	bool ImageSet::IsTimeFrequencyStatFile(const std::string &file)
-	{
-		return
-		(file.size()>=24 && file.substr(file.size()-24) == "counts-timefreq-auto.txt")
-		||
-		(file.size()>=25 && file.substr(file.size()-25) == "counts-timefreq-cross.txt");
-	}
-	
-	bool ImageSet::IsNoiseStatFile(const std::string &file)
-	{
-		return
-		file.find("noise-statistics-tf") != std::string::npos &&
-		file.find("txt") != std::string::npos;
-	}
-	
-	bool ImageSet::IsHarishFile(const std::string &file)
-	{
-		return file.substr(file.size()-4) == ".har";
-	}
-	
-	bool ImageSet::IsMSFile(const std::string &file)
-	{
-		return (!IsFitsFile(file)) && (!IsRCPRawFile(file)) && (!IsTKPRawFile(file)) && (!IsRawDescFile(file)) && (!IsParmFile(file)) && (!IsTimeFrequencyStatFile(file)) && (!IsNoiseStatFile(file));
-	}
-}
diff --git a/CEP/DP3/AOFlagger/src/strategy/imagesets/msimageset.cpp b/CEP/DP3/AOFlagger/src/strategy/imagesets/msimageset.cpp
deleted file mode 100644
index b62cf10be1ce744f21d00eca5dcf096dbce614f0..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/strategy/imagesets/msimageset.cpp
+++ /dev/null
@@ -1,316 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#include <iostream>
-#include <sstream>
-#include <stdexcept>
-
-#include <AOFlagger/strategy/algorithms/timefrequencystatistics.h>
-
-#include <AOFlagger/strategy/imagesets/msimageset.h>
-
-#include <AOFlagger/msio/directbaselinereader.h>
-#include <AOFlagger/msio/indirectbaselinereader.h>
-#include <AOFlagger/msio/memorybaselinereader.h>
-
-#include <AOFlagger/util/aologger.h>
-
-namespace rfiStrategy {
-
-	void MSImageSet::Initialize()
-	{
-		AOLogger::Debug << "Initializing image set...\n";
-		AOLogger::Debug << "Antenna's: " << _set.AntennaCount() << '\n';
-		_set.GetBaselines(_baselines);
-		AOLogger::Debug << "Unique baselines: " << _baselines.size() << '\n';
-		initReader();
-		_reader->PartInfo(_maxScanCounts-_scanCountPartOverlap, _timeScanCount, _partCount);
-		AOLogger::Debug << "Unique time stamps: " << _timeScanCount << '\n';
-		_bandCount = _set.MaxSpectralBandIndex()+1;
-		AOLogger::Debug << "Bands: " << _bandCount << '\n';
-		AOLogger::Debug << "Number of parts: " << _partCount << '\n';
-	}
-	
-	void MSImageSetIndex::Previous()
-	{
-		if(_partIndex > 0)
-			--_partIndex;
-		else {
-			_partIndex = static_cast<class MSImageSet&>(imageSet()).PartCount() - 1;
-
-			if(_baselineIndex > 0)
-				--_baselineIndex;
-			else {
-				_baselineIndex = static_cast<class MSImageSet&>(imageSet()).Baselines().size() - 1;
-				LargeStepPrevious();
-			}
-		}
-	}
-	
-	void MSImageSetIndex::Next()
-	{
-		++_partIndex;
-		if(_partIndex >= static_cast<class MSImageSet&>(imageSet()).PartCount() )
-		{
-			_partIndex = 0;
-
-			++_baselineIndex;
-			if( _baselineIndex >= static_cast<class MSImageSet&>(imageSet()).Baselines().size() )
-			{
-				_baselineIndex = 0;
-				LargeStepNext();
-			}
-		}
-	}
-	
-	void MSImageSetIndex::LargeStepPrevious()
-	{
-		if(_band > 0)
-			--_band;
-		else {
-			_band = static_cast<class MSImageSet&>(imageSet()).BandCount() - 1;
-			_isValid = false;
-		}
-	}
-	
-	void MSImageSetIndex::LargeStepNext()
-	{
-		++_band;
-		if(_band >= static_cast<class MSImageSet&>(imageSet()).BandCount())
-		{
-			_band = 0;
-			_isValid = false;
-		}
-	}
-
-	void MSImageSet::initReader()
-	{
-		if(_reader == 0 )
-		{
-			switch(_ioMode)
-			{
-				case IndirectReadMode: {
-					IndirectBaselineReader *indirectReader = new IndirectBaselineReader(_msFile);
-					indirectReader->SetReadUVW(_readUVW);
-					_reader = BaselineReaderPtr(indirectReader);
-				} break;
-				case DirectReadMode:
-					_reader = BaselineReaderPtr(new DirectBaselineReader(_msFile));
-					break;
-				case MemoryReadMode:
-					_reader = BaselineReaderPtr(new MemoryBaselineReader(_msFile));
-					break;
-				case AutoReadMode:
-					if(MemoryBaselineReader::IsEnoughMemoryAvailable(_msFile))
-						_reader = BaselineReaderPtr(new MemoryBaselineReader(_msFile));
-					else
-						_reader = BaselineReaderPtr(new DirectBaselineReader(_msFile));
-					break;
-			}
-		}
-		_reader->SetDataColumnName(_dataColumnName);
-		_reader->SetSubtractModel(_subtractModel);
-		_reader->SetReadFlags(_readFlags);
-		_reader->SetReadData(true);
-	}
-
-	size_t MSImageSet::StartIndex(const MSImageSetIndex &index)
-	{
-		size_t startIndex =
-			(_timeScanCount * index._partIndex) / _partCount - LeftBorder(index);
-		return startIndex;
-	}
-
-	size_t MSImageSet::EndIndex(const MSImageSetIndex &index)
-	{
-		size_t endIndex =
-			(_timeScanCount * (index._partIndex+1)) / _partCount + RightBorder(index);
-		return endIndex;
-	}
-
-	size_t MSImageSet::LeftBorder(const MSImageSetIndex &index)
-	{
-		if(index._partIndex > 0)
-			return _scanCountPartOverlap/2;
-		else
-			return 0;
-	}
-
-	size_t MSImageSet::RightBorder(const MSImageSetIndex &index)
-	{
-		if(index._partIndex + 1 < _partCount)
-			return _scanCountPartOverlap/2 + _scanCountPartOverlap%2;
-		else
-			return 0;
-	}
-
-	class TimeFrequencyData *MSImageSet::LoadData(const ImageSetIndex &index)
-	{
-		const MSImageSetIndex &msIndex = static_cast<const MSImageSetIndex&>(index);
-		initReader();
-		size_t a1 = _baselines[msIndex._baselineIndex].first;
-		size_t a2 = _baselines[msIndex._baselineIndex].second;
-		size_t
-			startIndex = StartIndex(msIndex),
-			endIndex = EndIndex(msIndex);
-		AOLogger::Debug << "Loading baseline " << a1 << "x" << a2 << ", t=" << startIndex << "-" << endIndex << '\n';
-		_reader->AddReadRequest(a1, a2, msIndex._band, startIndex, endIndex);
-		_reader->PerformReadRequests();
-		std::vector<UVW> uvw;
-		TimeFrequencyData data = _reader->GetNextResult(uvw);
-		return new TimeFrequencyData(data);
-	}
-
-	TimeFrequencyMetaDataCPtr MSImageSet::createMetaData(const ImageSetIndex &index, std::vector<UVW> &uvw)
-	{
-		const MSImageSetIndex &msIndex = static_cast<const MSImageSetIndex&>(index);
-		TimeFrequencyMetaData *metaData = new TimeFrequencyMetaData();
-		metaData->SetAntenna1(_set.GetAntennaInfo(GetAntenna1(msIndex)));
-		metaData->SetAntenna2(_set.GetAntennaInfo(GetAntenna2(msIndex)));
-		metaData->SetBand(_set.GetBandInfo(msIndex._band));
-		metaData->SetField(_set.GetFieldInfo(msIndex._field));
-		metaData->SetObservationTimes(ObservationTimesVector(msIndex));
-		if(_reader != 0)
-		{
-			metaData->SetUVW(uvw);
-		}
-		return TimeFrequencyMetaDataCPtr(metaData);
-	}
-
-	std::string MSImageSetIndex::Description() const
-	{
-		std::stringstream sstream;
-		size_t
-			antenna1 = static_cast<class MSImageSet&>(imageSet()).Baselines()[_baselineIndex].first,
-			antenna2 = static_cast<class MSImageSet&>(imageSet()).Baselines()[_baselineIndex].second;
-		AntennaInfo info1 = static_cast<class MSImageSet&>(imageSet()).GetAntennaInfo(antenna1);
-		AntennaInfo info2 = static_cast<class MSImageSet&>(imageSet()).GetAntennaInfo(antenna2);
-		BandInfo bandInfo = static_cast<class MSImageSet&>(imageSet()).GetBandInfo(_band);
-		double bandStart = round(bandInfo.channels.front().frequencyHz/100000.0)/10.0;
-		double bandEnd = round(bandInfo.channels.back().frequencyHz/100000.0)/10.0;
-		sstream
-			<< info1.station << ' ' << info1.name << " x " << info2.station << ' ' << info2.name
-			<< ", spect window " << _band << " (" << bandStart
-			<< "MHz -" << bandEnd << "MHz)";
-		return sstream.str();
-	}
-
-	size_t MSImageSet::FindBaselineIndex(size_t a1, size_t a2)
-	{
-		size_t index = 0;
-		for(std::vector<std::pair<size_t,size_t> >::const_iterator i=_baselines.begin();
-			i != _baselines.end() ; ++i)
-		{
-			if((i->first == a1 && i->second == a2) || (i->first == a2 && i->second == a1))
-			{
-				return index;
-			}
-			++index;
-		}
-		throw BadUsageException("Baseline not found");
-	}
-
-	void MSImageSet::WriteFlags(const ImageSetIndex &index, TimeFrequencyData &data)
-	{
-		ImageSet::AddWriteFlagsTask(index, data);
-		_reader->PerformFlagWriteRequests();
-	}
-
-	void MSImageSet::AddReadRequest(const ImageSetIndex &index)
-	{
-		BaselineData newRequest(index);
-		_baselineData.push_back(newRequest);
-	}
-	
-	void MSImageSet::PerformReadRequests()
-	{
-		for(std::vector<BaselineData>::iterator i=_baselineData.begin();i!=_baselineData.end();++i)
-		{
-			MSImageSetIndex &index = static_cast<MSImageSetIndex&>(i->Index());
-			_reader->AddReadRequest(GetAntenna1(index), GetAntenna2(index), index._band, StartIndex(index), EndIndex(index));
-		}
-		
-		_reader->PerformReadRequests();
-		
-		for(std::vector<BaselineData>::iterator i=_baselineData.begin();i!=_baselineData.end();++i)
-		{
-			if(!i->Data().IsEmpty())
-				throw std::runtime_error("ReadRequest() called, but a previous read request was not completely processed by calling GetNextRequested().");
-			std::vector<UVW> uvw;
-			TimeFrequencyData data = _reader->GetNextResult(uvw);
-			i->SetData(data);
-			TimeFrequencyMetaDataCPtr metaData = createMetaData(i->Index(), uvw);
-			i->SetMetaData(metaData);
-		}
-	}
-	
-	BaselineData *MSImageSet::GetNextRequested()
-	{
-		BaselineData top = _baselineData.front();
-		_baselineData.erase(_baselineData.begin());
-		if(top.Data().IsEmpty())
-			throw std::runtime_error("Calling GetNextRequested(), but requests were not read with LoadRequests.");
-		return new BaselineData(top);
-	}
-	
-	void MSImageSet::AddWriteFlagsTask(const ImageSetIndex &index, std::vector<Mask2DCPtr> &flags)
-	{
-		const MSImageSetIndex &msIndex = static_cast<const MSImageSetIndex&>(index);
-		initReader();
-		size_t a1 = _baselines[msIndex._baselineIndex].first;
-		size_t a2 = _baselines[msIndex._baselineIndex].second;
-		size_t b = msIndex._band;
-		size_t
-			startIndex = StartIndex(msIndex),
-			endIndex = EndIndex(msIndex);
-
-		/*double ratio = 0.0;
-		for(std::vector<Mask2DCPtr>::const_iterator i=flags.begin();i!=flags.end();++i)
-		{
-			ratio += ((double) (*i)->GetCount<true>() / ((*i)->Width() * (*i)->Height() * flags.size()));
-		}*/
-			
-		std::vector<Mask2DCPtr> allFlags;
-		if(flags.size() > _reader->PolarizationCount())
-			throw std::runtime_error("Trying to write more polarizations to image set than available");
-		else if(flags.size() < _reader->PolarizationCount())
-		{
-			if(flags.size() == 1)
-				for(size_t i=0;i<_reader->PolarizationCount();++i)
-					allFlags.push_back(flags[0]);
-			else
-				throw std::runtime_error("Incorrect number of polarizations in write action");
-		}
-		else allFlags = flags;
-		
-		//const AntennaInfo
-		//	a1Info = GetAntennaInfo(a1),
-		//	a2Info = GetAntennaInfo(a2);
-		//AOLogger::Info << "Baseline " << a1Info.name << " x " << a2Info.name << " has " << TimeFrequencyStatistics::FormatRatio(ratio) << " of bad data.\n";
-	
-		_reader->AddWriteTask(allFlags, a1, a2, b, startIndex, endIndex, LeftBorder(msIndex), RightBorder(msIndex));
-	}
-	
-	void MSImageSet::PerformWriteFlagsTask()
-	{
-		_reader->PerformFlagWriteRequests();
-	}
-
-}
diff --git a/CEP/DP3/AOFlagger/src/strategy/imagesets/parmimageset.cpp b/CEP/DP3/AOFlagger/src/strategy/imagesets/parmimageset.cpp
deleted file mode 100644
index 214c8307067228033f9320508662259f7d2b920b..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/strategy/imagesets/parmimageset.cpp
+++ /dev/null
@@ -1,50 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#include <AOFlagger/strategy/imagesets/parmimageset.h>
-
-#include <set>
-
-#include <AOFlagger/msio/parmtable.h>
-
-namespace rfiStrategy
-{
-	ParmImageSet::~ParmImageSet()
-	{
-		if(_parmTable != 0)
-			delete _parmTable;
-	}
-			
-	void ParmImageSet::Initialize()
-	{
-		_parmTable = new ParmTable(_path);
-		const std::set<std::string> antennaSet = _parmTable->GetAntennas();
-		for(std::set<std::string>::const_iterator i=antennaSet.begin();i!=antennaSet.end();++i)
-			_antennas.push_back(*i);
-	}
-	
-	TimeFrequencyData *ParmImageSet::LoadData(const ImageSetIndex &index)
-	{
-		const ParmImageSetIndex parmIndex = static_cast<const ParmImageSetIndex &>(index);
-		const std::string antenna = _antennas[parmIndex.AntennaIndex()];
-		return new TimeFrequencyData(_parmTable->Read(antenna));
-	}
-}
-
diff --git a/CEP/DP3/AOFlagger/src/strategy/plots/antennaflagcountplot.cpp b/CEP/DP3/AOFlagger/src/strategy/plots/antennaflagcountplot.cpp
deleted file mode 100644
index 9cfb97c661bc9e41e8f0d4aa234c1bdcbfa4d810..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/strategy/plots/antennaflagcountplot.cpp
+++ /dev/null
@@ -1,142 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <AOFlagger/strategy/plots/antennaflagcountplot.h>
-
-#include <fstream>
-#include <iomanip>
-
-#include <AOFlagger/util/aologger.h>
-#include <AOFlagger/util/plot.h>
-
-#include <AOFlagger/msio/timefrequencydata.h>
-#include <AOFlagger/msio/timefrequencymetadata.h>
-
-void AntennaFlagCountPlot::Add(class TimeFrequencyData &data, TimeFrequencyMetaDataCPtr meta)
-{
-	for(size_t maskIndex=0;maskIndex<data.MaskCount();++maskIndex)
-	{
-		Mask2DCPtr mask = data.GetMask(maskIndex);
-		long long count = 0;
-
-		for(size_t y=0;y<mask->Height();++y)
-		{
-			for(size_t x=0;x<mask->Width();++x)
-			{
-				if(mask->Value(x, y))
-					++count;
-			}
-		}
-
-		long long total = (long long) mask->Width() * (long long) mask->Height();
-
-		MapItem item1;
-		if(_counts.count(meta->Antenna1().id)==0)
-			item1.name = meta->Antenna1().name;
-		else
-			item1 = _counts[meta->Antenna1().id];
-
-		if(meta->Antenna1().id == meta->Antenna2().id)
-		{
-			item1.autoTotal += total;
-			item1.autoCount += count;
-			_counts[meta->Antenna1().id] = item1;
-		} else {
-			MapItem item2;
-			if(_counts.count(meta->Antenna2().id)==0)
-				item2.name = meta->Antenna2().name;
-			else
-				item2 = _counts[meta->Antenna2().id];
-
-			item1.crossTotal += total;
-			item1.crossCount += count;
-			item2.crossTotal += total;
-			item2.crossCount += count;
-			_counts[meta->Antenna1().id] = item1;
-			_counts[meta->Antenna2().id] = item2;
-		}
-	}
-} 
-
-void AntennaFlagCountPlot::MakePlot()
-{
-	Plot plot("antenna-flag-counts.pdf");
-	plot.SetXAxisText("Antenna (index)");
-	plot.SetYAxisText("Flagged (%)");
-	plot.StartBoxes("Auto-correlation");
-	plot.SetXRangeAutoMax(0);
-	plot.SetYRangeAutoMax(0);
-	for(std::map<int, MapItem>::const_iterator i=_counts.begin();i!=_counts.end();++i)
-	{
-		plot.PushDataPoint(i->first, 100.0L * (long double) i->second.autoCount / (long double) i->second.autoTotal);
-	}
-	plot.StartBoxes("Cross-correlation");
-	for(std::map<int, MapItem>::const_iterator i=_counts.begin();i!=_counts.end();++i)
-	{
-		plot.PushDataPoint((long double) i->first + 0.3, 100.0L * (long double) i->second.crossCount / (long double) i->second.crossTotal);
-	}
-	plot.Close();
-	plot.Show();
-}
-
-void AntennaFlagCountPlot::WriteCounts()
-{
-	std::ofstream file("antenna-vs-counts.txt");
-	file << std::setprecision(14);
-	for(std::map<int, MapItem>::const_iterator i=_counts.begin();i!=_counts.end();++i)
-	{
-		file << i->second.name << "\t" << (100.0L * (long double) i->second.autoCount / (long double) i->second.autoTotal) << "\t" << (100.0L * (long double) i->second.crossCount / (long double) i->second.crossTotal) << "\n";
-	}
-	file.close();
-}
-
-void AntennaFlagCountPlot::Report()
-{
-	for(std::map<int, MapItem>::const_iterator i=_counts.begin();i!=_counts.end();++i)
-	{
-		if(i->second.autoTotal != 0)
-		{
-			AOLogger::Info
-				<< "Flagged in autocorrelations of antenna "
-				<< i->second.name << ": "
-				<< formatPercentage(100.0L * (long double) i->second.autoCount / (long double) i->second.autoTotal)
-				<< "%\n";
-		}
-		if(i->second.crossTotal != 0)
-		{
-			AOLogger::Info
-				<< "Flagged in cross correlations with antenna "
-				<< i->second.name << ": "
-				<< formatPercentage(100.0L * (long double) i->second.crossCount / (long double) i->second.crossTotal)
-				<< "%\n";
-		}
-	}
-}
-
-std::string AntennaFlagCountPlot::formatPercentage(double percentage)
-{
-	std::stringstream s;
-	if(percentage >= 1.0)
-		s << round(percentage*10.0)/10.0;
-	else if(percentage >= 0.1)
-		s << round(percentage*100.0)/100.0;
-	else
-		s << round(percentage*1000.0)/1000.0;
-	return s.str();
-}
diff --git a/CEP/DP3/AOFlagger/src/strategy/plots/frequencyflagcountplot.cpp b/CEP/DP3/AOFlagger/src/strategy/plots/frequencyflagcountplot.cpp
deleted file mode 100644
index 8d61d6424815a398af6f47a9e9e909cf7a2708a8..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/strategy/plots/frequencyflagcountplot.cpp
+++ /dev/null
@@ -1,166 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <AOFlagger/strategy/plots/frequencyflagcountplot.h>
-
-#include <fstream>
-#include <iomanip>
-
-#include <AOFlagger/util/aologger.h>
-#include <AOFlagger/util/plot.h>
-
-#include <AOFlagger/msio/timefrequencydata.h>
-#include <AOFlagger/msio/timefrequencymetadata.h>
-
-void FrequencyFlagCountPlot::Add(class TimeFrequencyData &data, TimeFrequencyMetaDataCPtr meta)
-{
-	_ignoreFirstChannel = _ignoreFirstChannel && data.ImageHeight() != 1;
-
-	size_t yStart = _ignoreFirstChannel ? 1 : 0;
-
-	for(size_t maskIndex=0;maskIndex<data.MaskCount();++maskIndex)
-	{
-		Mask2DCPtr mask = data.GetMask(maskIndex);
-		for(size_t y=yStart;y<mask->Height();++y)
-		{
-			double frequency = meta->Band().channels[y].frequencyHz;
-			size_t count = 0;
-
-			for(size_t x=0;x<mask->Width();++x)
-			{
-				if(mask->Value(x, y))
-					++count;
-			}
-			MapItem item = _counts[frequency];
-			item.count += count;
-			item.total += mask->Width();
-			_counts[frequency] = item;
-		}
-	}
-} 
-
-void FrequencyFlagCountPlot::WriteCounts()
-{
-	std::ofstream file("frequency-vs-counts.txt");
-	file << std::setprecision(14);
-	for(std::map<double, struct MapItem>::const_iterator i=_counts.begin();i!=_counts.end();++i)
-	{
-		file << i->first << "\t" << i->second.total << "\t" << i->second.count << "\t" << (100.0L * (long double) i->second.count / (long double) i->second.total) << "\n";
-	}
-	file.close();
-}
-
-void FrequencyFlagCountPlot::MakePlot()
-{
-	Plot plot("frequency-vs-counts.pdf");
-	plot.SetXAxisText("Frequency (MHz)");
-	plot.SetYAxisText("Flagged (%)");
-	plot.SetYRangeAutoMax(0);
-	plot.StartScatter();
-	for(std::map<double, struct MapItem>::const_iterator i=_counts.begin();i!=_counts.end();++i)
-	{
-		plot.PushDataPoint(i->first / 1000000.0L, 100.0L * (long double) i->second.count / (long double) i->second.total);
-	}
-	plot.Close();
-	plot.Show();
-}
-
-void FrequencyFlagCountPlot::Report()
-{
-	if(_counts.size() > 0)
-	{
-		size_t index = _ignoreFirstChannel ? 1 : 0;
-		size_t column = 0;
-		std::stringstream rowStr;
-		AOLogger::Info
-			<< "Summary of RFI per channel: ("
-			<< formatFrequency(_counts.begin()->first) << " Hz - "
-			<< formatFrequency(_counts.rbegin()->first) << " Hz)\n";
-		for(std::map<double, struct MapItem>::const_iterator i=_counts.begin();i!=_counts.end();++i)
-		{
-			if(column == 0)
-			{
-				AOLogger::Info << "Channel " << formatIndex(index) << "-";
-			}
-			std::string percString = formatPercentage(100.0L * (long double) i->second.count / (long double) i->second.total);
-			for(unsigned j=percString.size();j<6;++j)
-				rowStr << ' ';
-			rowStr << percString << '%';
-			++column;
-			if(column >= 8)
-			{
-				AOLogger::Info << formatIndex(index) << ":" << rowStr.str() << '\n';
-				rowStr.str(std::string());
-				column = 0;
-			}
-			++index;
-		}
-		if(column != 0)
-		{
-			AOLogger::Info << formatIndex(index-1) << ":" << rowStr.str() << '\n';
-		}
-	}
-}
-
-std::string FrequencyFlagCountPlot::formatPercentage(double percentage)
-{
-	std::stringstream s;
-	if(percentage >= 1.0)
-		s << round(percentage*10.0)/10.0;
-	else if(percentage >= 0.1)
-		s << round(percentage*100.0)/100.0;
-	else
-		s << round(percentage*1000.0)/1000.0;
-	if(s.str().find('.') == std::string::npos) s << ".0";
-	return s.str();
-}
-
-std::string FrequencyFlagCountPlot::formatFrequency(double frequencyHz)
-{
-	std::stringstream s;
-	bool commaPlaced = false;
-	if(frequencyHz > 1000000000.0)
-	{
-		s << (int) floor(frequencyHz / 1000000000.0) << ',';
-		commaPlaced = true;
-	}
-	if(frequencyHz > 1000000.0)
-	{
-		if(commaPlaced)
-			formatToThreeDigits(s, (int) floor(fmod(frequencyHz / 1000000.0, 1000.0)));
-		else
-			s << (int) floor(fmod(frequencyHz / 1000000.0, 1000.0));
-		s << ',';
-		commaPlaced = true;
-	}
-	if(frequencyHz > 1000.0)
-	{
-		if(commaPlaced)
-			formatToThreeDigits(s, (int) floor(fmod(frequencyHz / 1000.0, 1000.0)));
-		else
-			s << (int) floor(fmod(frequencyHz / 1000.0, 1000.0));
-		s << ',';
-		commaPlaced = true;
-	}
-	if(commaPlaced)
-		formatToThreeDigits(s, (int) floor(fmod(frequencyHz, 1000.0)));
-	else
-		s << (int) floor(fmod(frequencyHz, 1000.0));
-	return s.str();
-}
diff --git a/CEP/DP3/AOFlagger/src/strategy/plots/frequencypowerplot.cpp b/CEP/DP3/AOFlagger/src/strategy/plots/frequencypowerplot.cpp
deleted file mode 100644
index 81d64836367e8731a59a7d4154d68b795253bd30..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/strategy/plots/frequencypowerplot.cpp
+++ /dev/null
@@ -1,109 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <AOFlagger/strategy/plots/frequencypowerplot.h>
-
-#include <fstream>
-
-#include <AOFlagger/util/plot.h>
-
-#include <AOFlagger/msio/timefrequencydata.h>
-#include <AOFlagger/msio/timefrequencymetadata.h>
-
-FrequencyPowerPlot::~FrequencyPowerPlot()
-{
-	if(_plot != 0) delete _plot;
-}
-
-void FrequencyPowerPlot::Add(class TimeFrequencyData &data, TimeFrequencyMetaDataCPtr meta)
-{
-	Image2DCPtr image = data.GetSingleImage();
-	Mask2DCPtr mask = data.GetSingleMask();
-	for(size_t y=0;y<image->Height();++y)
-	{
-		double frequency = meta->Band().channels[y].frequencyHz;
-		size_t count = 0;
-		long double value = 0.0L;
-
-		for(size_t x=0;x<image->Width();++x)
-		{
-			if(!mask->Value(x, y))
-			{
-				++count;
-				value += image->Value(x, y);
-			}
-		}
-		MapItem &item = _values[frequency];
-		item.total += value;
-		item.count += count;
-	}
-} 
-
-void FrequencyPowerPlot::WriteToText()
-{
-	std::ofstream file("frequency-vs-counts.txt");
-	for(std::map<double, struct MapItem>::const_iterator i=_values.begin();i!=_values.end();++i)
-	{
-		file << i->first << "\t" << i->second.total << "\t" << i->second.count << "\n";
-	}
-	file.close();
-}
-
-void FrequencyPowerPlot::MakePlot()
-{
-	if(_plot == 0)
-	{
-		Plot plot("frequency-vs-power.pdf");
-		plot.SetXAxisText("Frequency (MHz)");
-		plot.SetYAxisText("Vis. power");
-		plot.SetLogScale(false, _logYAxis);
-		plot.StartScatter();
-		AddCurrentLine(plot);
-		plot.Close();
-		plot.Show();
-	} else {
-		_plot->Close();
-		_plot->Show();
-	}
-}
-
-void FrequencyPowerPlot::AddCurrentLine(class Plot &plot)
-{
-	for(std::map<double, struct MapItem>::const_iterator i=_values.begin();i!=_values.end();++i)
-	{
-		plot.PushDataPoint(i->first / 1000000.0L, (long double) i->second.total / (long double) i->second.count);
-	}
-}
-
-void FrequencyPowerPlot::StartNewLine(const std::string &lineTitle)
-{
-	if(_plot == 0)
-	{
-		_plot = new Plot("frequency-vs-power.pdf");
-		_plot->SetXAxisText("Frequency (MHz)");
-		_plot->SetYAxisText("Vis. power");
-		_plot->SetFontSize(12);
-		_plot->SetLogScale(false, _logYAxis);
-		_plot->StartLine(lineTitle);
-	} else {
-		AddCurrentLine(*_plot);
-		_values.clear();
-		_plot->StartLine(lineTitle);
-	}
-}
diff --git a/CEP/DP3/AOFlagger/src/strategy/plots/iterationsplot.cpp b/CEP/DP3/AOFlagger/src/strategy/plots/iterationsplot.cpp
deleted file mode 100644
index 1e4da532be765604f3ebcc0214765893b5903f52..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/strategy/plots/iterationsplot.cpp
+++ /dev/null
@@ -1,70 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <AOFlagger/strategy/plots/iterationsplot.h>
-
-#include <AOFlagger/util/aologger.h>
-#include <AOFlagger/util/plot.h>
-
-#include <AOFlagger/msio/timefrequencydata.h>
-#include <AOFlagger/msio/timefrequencymetadata.h>
-
-#include <AOFlagger/strategy/algorithms/thresholdtools.h>
-
-void IterationsPlot::Add(TimeFrequencyData &data, TimeFrequencyMetaDataCPtr)
-{
-	Item item;
-	Mask2DCPtr mask = data.GetSingleMask();
-	item.mode = ThresholdTools::Mode(data.GetSingleImage(), mask);
-	item.winsorizedMode = ThresholdTools::WinsorizedMode(data.GetSingleImage(), mask);
-	item.flaggedRatio = (double) mask->GetCount<true>() / ((double) mask->Width() * (double) mask->Height());
-	_stats.push_back(item);
-}
-
-void IterationsPlot::MakePlot()
-{
-	Plot plotA("iterations-flags.pdf");
-	plotA.SetXAxisText("Iteration number");
-	plotA.SetYAxisText("Flagged (%)");
-	plotA.StartLine();
-	plotA.SetXRange(1, _stats.size());
-	for(unsigned i=0;i<_stats.size();++i)
-	{
-		plotA.PushDataPoint(i+1, _stats[i].flaggedRatio * 100.0);
-	}
-	plotA.Close();
-	plotA.Show();
-
-	Plot plotB("iterations-modes.pdf");
-	plotB.SetXAxisText("Iteration number");
-	plotB.SetYAxisText("Mode");
-	plotB.StartLine("Normal mode");
-	plotB.SetXRange(1, _stats.size());
-	for(unsigned i=0;i<_stats.size();++i)
-	{
-		plotB.PushDataPoint(i+1, _stats[i].mode);
-	}
-	plotB.StartLine("Winsorized mode");
-	for(unsigned i=0;i<_stats.size();++i)
-	{
-		plotB.PushDataPoint(i+1, _stats[i].winsorizedMode);
-	}
-	plotB.Close();
-	plotB.Show();
-}
diff --git a/CEP/DP3/AOFlagger/src/strategy/plots/rfiplots.cpp b/CEP/DP3/AOFlagger/src/strategy/plots/rfiplots.cpp
deleted file mode 100644
index 5726381322cf798c1bf98983bed38c4922cbc67b..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/strategy/plots/rfiplots.cpp
+++ /dev/null
@@ -1,501 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <AOFlagger/strategy/plots/rfiplots.h>
-
-#include <cmath>
-#include <iostream>
-
-#include <AOFlagger/util/plot.h>
-#include <AOFlagger/util/multiplot.h>
-
-#include <AOFlagger/msio/timefrequencydata.h>
-#include <AOFlagger/msio/timefrequencymetadata.h>
-
-#include <AOFlagger/strategy/algorithms/sinusfitter.h>
-#include <AOFlagger/strategy/algorithms/thresholdtools.h>
-#include <AOFlagger/strategy/algorithms/rfistatistics.h>
-
-#include <AOFlagger/gui/plot/plot2d.h>
-
-void RFIPlots::Bin(Image2DCPtr image, Mask2DCPtr mask, std::vector<size_t> &valuesOutput, std::vector<long double> &binsOutput, size_t binCount, long double start, long double end, long double factor, long double stretch) throw()
-{
-	const long double min = start==end ? ThresholdTools::MinValue(image, mask) : start;
-	const long double max = start==end ? ThresholdTools::MaxValue(image, mask) : end;
-	const long double binsize = (max-min) / binCount;
-	valuesOutput.resize(binCount);
-	binsOutput.resize(binCount);
-	for(size_t i=0;i<binCount;++i) {
-		valuesOutput[i] = 0;
-		binsOutput[i] = (binsize * ((long double) i + 0.5)) + min;
-	}
-	for(size_t y=0;y<image->Height();++y) {
-		for(size_t x=0;x<image->Width();++x) {
-			if(!mask->Value(x, y)) {
-				long double value = image->Value(x, y);
-				size_t index = (size_t) ((value * stretch - min) / binsize);
-				if(index < binCount)
-					valuesOutput[index] += 1;
-			}
-		}
-	}
-	if(factor != 1.0) {
-		for(size_t i=0;i<binCount;++i) {
-			valuesOutput[i] = (size_t) (factor * valuesOutput[i]);
-		}
-	}
-}
-
-void RFIPlots::MakeDistPlot(Plot2DPointSet &pointSet, Image2DCPtr image, Mask2DCPtr mask)
-{
-	std::vector<size_t> valuesOutput;
-	std::vector<long double> binsOutput;
-	pointSet.SetXDesc("Visibility");
-	pointSet.SetYDesc("Occurences");
-
-	num_t mean, stddev;
-	num_t min = image->GetMinimum();
-	num_t max = image->GetMaximum();
-	ThresholdTools::WinsorizedMeanAndStdDev(image, mean, stddev);
-	if(min < mean-3.0L*stddev)
-		min = mean-3.0L*stddev;
-	if(max > mean+3.0L*stddev)
-		max = mean+3.0L*stddev;
-
-	Bin(image, mask, valuesOutput, binsOutput, 40, min, max);
-	for(unsigned i=0;i<valuesOutput.size();++i)
-		pointSet.PushDataPoint(binsOutput[i], valuesOutput[i]);
-}
-
-template <bool Weight>
-void RFIPlots::MakeMeanSpectrumPlot(Plot2DPointSet &pointSet, const TimeFrequencyData &data, const Mask2DCPtr &mask, const TimeFrequencyMetaDataCPtr &metaData)
-{
-	bool hasBandInfo = metaData != 0 && metaData->HasBand();
-	if(hasBandInfo)
-	{
-		pointSet.SetXDesc("Frequency (MHz)");
-		std::stringstream yDesc;
-		yDesc << metaData->DataDescription() << " (" << metaData->DataUnits() << ')';
-		pointSet.SetYDesc(yDesc.str());
-	} else {
-		pointSet.SetXDesc("Index");
-		pointSet.SetYDesc("Mean (undefined units)");
-	}
-	
-	TimeFrequencyData displayData = data;
-	if(displayData.PhaseRepresentation() == TimeFrequencyData::ComplexRepresentation)
-	{
-		TimeFrequencyData *newData = data.CreateTFData(TimeFrequencyData::AmplitudePart);
-		displayData = *newData;
-		delete newData;
-	}
-
-	long double min = 1e100, max = -1e100;
-	const size_t height = data.ImageHeight(), width = data.ImageWidth();
-
-	for(size_t y=0;y<height;++y) {
-		long double sum = 0.0L;
-		size_t count = 0;
-		for(size_t i=0;i<displayData.ImageCount();++i)
-		{
-			Image2DCPtr image = displayData.GetImage(i);
-			for(size_t x=0;x<width;++x) {
-				if(!mask->Value(x, y) && std::isnormal(image->Value(x, y))) {
-					sum += image->Value(x, y);
-					++count;
-				}
-			}
-		}
-		if(count > 0)
-		{
-			long double v;
-			if(Weight)
-				v = sum;
-			else
-				v = sum/count;
-			if(v < min) min = v;
-			if(v > max) max = v;
-			if(hasBandInfo)
-				pointSet.PushDataPoint(metaData->Band().channels[y].frequencyHz/1000000.0, v);
-			else
-				pointSet.PushDataPoint(y, v);
-		}
-	}
-	pointSet.SetYRange(min * 0.9, max / 0.9);
-}
-template void RFIPlots::MakeMeanSpectrumPlot<true>(class Plot2DPointSet &pointSet, const TimeFrequencyData &data, const Mask2DCPtr &mask, const TimeFrequencyMetaDataCPtr &metaData);
-template void RFIPlots::MakeMeanSpectrumPlot<false>(class Plot2DPointSet &pointSet, const TimeFrequencyData &data, const Mask2DCPtr &mask, const TimeFrequencyMetaDataCPtr &metaData);
-
-void RFIPlots::MakePowerSpectrumPlot(Plot2DPointSet &pointSet, Image2DCPtr image, Mask2DCPtr mask, TimeFrequencyMetaDataCPtr metaData)
-{
-	bool hasBandInfo = metaData != 0 && metaData->HasBand();
-	if(hasBandInfo)
-	{
-		pointSet.SetXDesc("Frequency (MHz)");
-		std::stringstream yDesc;
-		yDesc << metaData->DataDescription() << " (" << metaData->DataUnits() << ')';
-		pointSet.SetYDesc(yDesc.str());
-	} else {
-		pointSet.SetXDesc("Index");
-		pointSet.SetYDesc("Power (undefined units)");
-	}
-
-	long double min = 1e100, max = 0.0;
-
-	for(size_t y=0;y<image->Height();++y) {
-		long double sum = 0.0L;
-		size_t count = 0;
-		for(size_t x=0;x<image->Width();++x) {
-			if(!mask->Value(x, y) && std::isnormal(image->Value(x, y))) {
-				sum += image->Value(x, y);
-				++count;
-			}
-		}
-		if(count > 0)
-		{
-			long double v = sum/count;
-			if(v < min) min = v;
-			if(v > max) max = v;
-			if(hasBandInfo)
-				pointSet.PushDataPoint(metaData->Band().channels[y].frequencyHz/1000000.0, v);
-			else
-				pointSet.PushDataPoint(y, v);
-		}
-	}
-	pointSet.SetYRange(min * 0.9, max / 0.9);
-}
-
-void RFIPlots::MakePowerTimePlot(Plot2DPointSet &pointSet, Image2DCPtr image, Mask2DCPtr mask, TimeFrequencyMetaDataCPtr metaData)
-{
-	pointSet.SetXDesc("Time (s)");
-	pointSet.SetYDesc("Visibility");
-	bool useMeta;
-	if(metaData != 0 && metaData->HasObservationTimes())
-		useMeta = true;
-	else
-		useMeta = false;
-	double firstTimeStep;
-	if(useMeta)
-		firstTimeStep = metaData->ObservationTimes()[0];
-	else
-		firstTimeStep = 0;
-	
-	size_t binSize = (size_t) ceil(image->Width() / 256.0L);
-
-	unsigned index = 0;
-	for(size_t x=0;x<image->Width();x += binSize) {
-		long double sum = 0.0L;
-		size_t count = 0;
-		for(size_t binx=0;binx<binSize;++binx) {
-			for(size_t y=0;y<image->Height();++y) {
-				if(!mask->Value(x + binx, y) && std::isnormal(image->Value(x + binx, y))) {
-					sum += image->Value(x + binx, y);
-					++count;
-				}
-			}
-		}
-		if(useMeta)
-			pointSet.PushDataPoint(metaData->ObservationTimes()[x] - firstTimeStep, sum / count);
-		else
-			pointSet.PushDataPoint(index, sum / count);
-		++index;
-	}
-}
-
-void RFIPlots::MakeComplexPlanePlot(Plot2DPointSet &pointSet, const TimeFrequencyData &data, size_t xStart, size_t length, size_t y, size_t yAvgSize, Mask2DCPtr mask, bool realVersusImaginary, bool drawImaginary)
-{
-
-	if(realVersusImaginary)
-	{
-		pointSet.SetXDesc("real");
-		pointSet.SetYDesc("imaginary");
-	} else {
-		//pointSet.SetXRange(xStart, xStart+length-1);
-		pointSet.SetXDesc("time");
-		pointSet.SetYDesc("real/imaginary visibility");
-	}
-
-	Image2DCPtr real = data.GetRealPart();
-	Image2DCPtr imaginary = data.GetImaginaryPart();
-
-	for(size_t x=xStart;x<xStart + length;++x)
-	{
-		long double r = 0.0L, i = 0.0L;
-		for(size_t yi=y;yi<yAvgSize+y;++yi)
-		{
-			if(!mask->Value(x, yi) && std::isfinite(real->Value(x,yi)) && std::isfinite(imaginary->Value(x,yi)))
-			{
-				r += real->Value(x, yi);
-				i += imaginary->Value(x, yi);
-			}
-		}
-		if(realVersusImaginary)
-			pointSet.PushDataPoint(r, i);
-		else if(drawImaginary)
-			pointSet.PushDataPoint(x, i);
-		else
-			pointSet.PushDataPoint(x, r);
-	}
-}
-
-void RFIPlots::MakeFittedComplexPlot(Plot2DPointSet &pointSet, const TimeFrequencyData &data, size_t xStart, size_t length, size_t y, size_t yAvgSize, Mask2DCPtr mask, num_t frequency, bool realVersusImaginary, bool drawImaginary)
-{
-	if(realVersusImaginary)
-	{
-		pointSet.SetXDesc("real");
-		pointSet.SetYDesc("imaginary");
-	} else {
-		//plot.SetXRange(xStart, xStart+length-1);
-		pointSet.SetXDesc("time");
-		pointSet.SetYDesc("real/imaginary visibility");
-	}
-	Image2DCPtr real = data.GetRealPart();
-	Image2DCPtr imaginary = data.GetImaginaryPart();
-
-	num_t *xReal = new num_t[length];
-	num_t *xImag = new num_t[length];
-	num_t *t = new num_t[length];
-	size_t dataIndex = 0;
-
-	for(size_t x=xStart;x<xStart + length;++x)
-	{
-		num_t r = 0.0L, i = 0.0L;
-		size_t count = 0;
-		for(size_t yi=y;yi<yAvgSize+y;++yi)
-		{
-			if(!mask->Value(x, yi) && std::isfinite(real->Value(x,yi)) && std::isfinite(imaginary->Value(x,yi)) )
-			{
-				r += real->Value(x, yi);
-				i += imaginary->Value(x, yi);
-				++count;
-			}
-		}
-		if(count > 0)
-		{
-			t[dataIndex] = x;
-			xReal[dataIndex] = r;
-			xImag[dataIndex] = i;
-			++dataIndex;
-		}
-	}
-	if(dataIndex != length)
-		std::cout << "Warning: " << (length-dataIndex) << " time points were removed." << std::endl; 
-	SinusFitter fitter;
-	num_t
-		realPhase, realAmplitude, realMean,
-		imagPhase, imagAmplitude, imagMean;
-	const num_t twopi = 2.0*M_PIn;
-
-	//fitter.FindPhaseAndAmplitude(realPhase, realAmplitude, xReal, t, dataIndex, frequency*twopi);
-	//fitter.FindPhaseAndAmplitude(imagPhase, imagAmplitude, xImag, t, dataIndex, frequency*twopi);
-	//realMean = fitter.FindMean(realPhase, realAmplitude, xReal, t, dataIndex, frequency*twopi);
-	//imagMean = fitter.FindMean(imagPhase, imagAmplitude, xImag, t, dataIndex, frequency*twopi);
-	fitter.FindPhaseAndAmplitudeComplex(realPhase, realAmplitude, xReal, xImag, t, dataIndex, frequency*twopi);
-	imagPhase = realPhase + 0.5*M_PIn;
-	imagAmplitude = realAmplitude;
-	realMean = fitter.FindMean(realPhase, realAmplitude, xReal, t, dataIndex, frequency*twopi);
-	imagMean = fitter.FindMean(imagPhase, imagAmplitude, xImag, t, dataIndex, frequency*twopi);
-
-	std::cout << "Amplitude found: " << realAmplitude << " phase found: " << realPhase << std::endl;
-
-	for(size_t x=xStart;x<xStart + length;++x)
-	{
-		if(realVersusImaginary)
-			pointSet.PushDataPoint(
-				cosn(frequency*twopi*(long double) x + realPhase) * realAmplitude + realMean,
-				cosn(frequency*twopi*(long double) x + imagPhase) * imagAmplitude + imagMean);
-		else if(drawImaginary)
-			pointSet.PushDataPoint(x,
-				cosn(frequency*twopi*(long double) x + imagPhase) * imagAmplitude + imagMean);
-		else
-			pointSet.PushDataPoint(x,
-				cosn(frequency*twopi*(long double) x + realPhase) * realAmplitude + realMean);
-	}
-
-	delete t;
-	delete xReal;
-	delete xImag;
-}
-
-void RFIPlots::MakeScatterPlot(class MultiPlot &plot, size_t plotIndex, Image2DCPtr image, Mask2DCPtr mask, TimeFrequencyMetaDataCPtr metaData)
-{
-	plot.SetXAxisText("Time (s)");
-	plot.SetYAxisText("Visibility");
-	bool useMeta;
-	if(metaData != 0 && metaData->HasObservationTimes())
-		useMeta = true;
-	else
-		useMeta = false;
-	double firstTimeStep;
-	if(useMeta)
-		firstTimeStep = metaData->ObservationTimes()[0];
-	else
-		firstTimeStep = 0;
-
-	for(size_t x=0;x<image->Width();++x) {
-		size_t count = 0;
-		num_t sum = 0.0;
-		for(size_t y=0;y<image->Height();++y) {
-			if(!mask->Value(x, y) && std::isnormal(image->Value(x, y))) {
-				sum += image->Value(x, y);
-				++count;
-			}
-		}
-		if(count > 0)
-		{
-			if(useMeta)
-				plot.AddPoint(plotIndex, metaData->ObservationTimes()[x] - firstTimeStep, sum / count);
-			else
-				plot.AddPoint(plotIndex, x, sum / count);
-		}
-	}
-}
-
-void RFIPlots::MakeScatterPlot(class MultiPlot &plot, size_t plotIndex, SampleRowCPtr row)
-{
-	for(size_t x=0;x<row->Size();++x) {
-		if(!row->ValueIsMissing(x))
-			plot.AddPoint(plotIndex, x, row->Value(x));
-	}
-}
-
-void RFIPlots::MakeScatterPlot(class MultiPlot &plot, const TimeFrequencyData &data, TimeFrequencyMetaDataCPtr metaData, unsigned startIndex)
-{
-	switch(data.Polarisation())
-	{
-		case DipolePolarisation:
-		{
-			TimeFrequencyData
-				*xx = data.CreateTFData(XXPolarisation),
-				*xy = data.CreateTFData(XYPolarisation),
-				*yx = data.CreateTFData(YXPolarisation),
-				*yy = data.CreateTFData(YYPolarisation);
-			MakeScatterPlot(plot, startIndex+0, xx->GetSingleImage(), xx->GetSingleMask(), metaData);
-			MakeScatterPlot(plot, startIndex+1, xy->GetSingleImage(), xy->GetSingleMask(), metaData);
-			MakeScatterPlot(plot, startIndex+2, yx->GetSingleImage(), yx->GetSingleMask(), metaData);
-			MakeScatterPlot(plot, startIndex+3, yy->GetSingleImage(), yy->GetSingleMask(), metaData);
-			delete xx;
-			delete xy;
-			delete yx;
-			delete yy;
-			plot.SetLegend(startIndex+0, "XX");
-			plot.SetLegend(startIndex+1, "XY");
-			plot.SetLegend(startIndex+2, "YX");
-			plot.SetLegend(startIndex+3, "YY");
-			break;
-		}
-		case AutoDipolePolarisation:
-		{
-			TimeFrequencyData
-				*xx = data.CreateTFData(XXPolarisation),
-				*yy = data.CreateTFData(YYPolarisation);
-			MakeScatterPlot(plot, startIndex+0, xx->GetSingleImage(), xx->GetSingleMask(), metaData);
-			MakeScatterPlot(plot, startIndex+1, yy->GetSingleImage(), yy->GetSingleMask(), metaData);
-			plot.SetLegend(startIndex+0, "XX");
-			plot.SetLegend(startIndex+1, "YY");
-			delete xx;
-			delete yy;
-			break;
-		}
-		case CrossDipolePolarisation:
-		{
-			TimeFrequencyData
-				*xy = data.CreateTFData(XYPolarisation),
-				*yx = data.CreateTFData(YXPolarisation);
-			MakeScatterPlot(plot, startIndex+0, xy->GetSingleImage(), xy->GetSingleMask(), metaData);
-			MakeScatterPlot(plot, startIndex+1, yx->GetSingleImage(), yx->GetSingleMask(), metaData);
-			plot.SetLegend(startIndex+0, "XY");
-			plot.SetLegend(startIndex+1, "XY");
-			delete xy;
-			delete yx;
-			break;
-		}
-		case SinglePolarisation:
-		case StokesIPolarisation:
-		case StokesQPolarisation:
-		case StokesUPolarisation:
-		case StokesVPolarisation:
-		case XXPolarisation:
-		case XYPolarisation:
-		case YXPolarisation:
-		case YYPolarisation:
-			MakeScatterPlot(plot, startIndex+0, data.GetSingleImage(), data.GetSingleMask(), metaData);
-			plot.SetLegend(startIndex+0, data.Description());
-		break;
-	}
-}
-
-void RFIPlots::MakeQualityPlot(Plot2DPointSet &pointSet, const TimeFrequencyData &original, const TimeFrequencyData &model, size_t partCount)
-{
-	Image2DCPtr originalImg = original.GetSingleImage();
-	Image2DCPtr modelImg = model.GetSingleImage();
-	Mask2DCPtr mask = original.GetSingleMask();
-	for(unsigned p=0;p<=partCount;++p)
-	{
-		unsigned xStart = model.ImageWidth() * p / partCount;
-		unsigned xEnd = model.ImageWidth() * (p+1) / partCount;
-		double quality = RFIStatistics::DataQuality(originalImg, modelImg, mask, xStart, xEnd);
-		pointSet.PushDataPoint((xStart+xEnd)/2, quality);
-	}
-}
-
-void RFIPlots::MakeRMSSpectrumPlot(Plot2DPointSet &pointSet, Image2DCPtr image, Mask2DCPtr mask)
-{
-	pointSet.SetXDesc("Channel");
-	pointSet.SetYDesc("Visibility RMS");
-
-	long double min = 1e100, max = 0.0;
-
-	for(size_t y=0;y<image->Height();++y) {
-		long double sum = 0.0L;
-		size_t count = 0;
-		for(size_t x=0;x<image->Width();++x) {
-			if(!mask->Value(x, y) && std::isnormal(image->Value(x, y))) {
-				sum += image->Value(x, y) * image->Value(x, y);
-				++count;
-			}
-		}
-		if(count > 0)
-		{
-			num_t v = sqrtn(sum/count);
-
-			if(v < min) min = v;
-			if(v > max) max = v;
-			pointSet.PushDataPoint(y, v);
-		}
-	}
-	pointSet.SetYRange(min, max);
-}
-
-void RFIPlots::MakeSNRSpectrumPlot(Plot2DPointSet &plot, Image2DCPtr image, Image2DCPtr model, Mask2DCPtr mask)
-{
-	plot.SetXDesc("Channel");
-	plot.SetYDesc("Visibility RMS");
-
-	long double min = 1e100, max = 0.0;
-
-	for(size_t y=0;y<image->Height();++y) {
-		num_t v = RFIStatistics::FrequencySNR(image, model, mask, y);
-
-		if(v < min) min = v;
-		if(v > max) max = v;
-		plot.PushDataPoint(y, v);
-	}
-	plot.SetYRange(min, max);
-}
diff --git a/CEP/DP3/AOFlagger/src/strategy/plots/timeflagcountplot.cpp b/CEP/DP3/AOFlagger/src/strategy/plots/timeflagcountplot.cpp
deleted file mode 100644
index 03e5ea31aafc09d5584978e568cf237158ee6eee..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/strategy/plots/timeflagcountplot.cpp
+++ /dev/null
@@ -1,83 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <fstream>
-#include <iomanip>
-
-#include <AOFlagger/strategy/plots/timeflagcountplot.h>
-
-#include <AOFlagger/util/plot.h>
-
-#include <AOFlagger/msio/timefrequencydata.h>
-#include <AOFlagger/msio/timefrequencymetadata.h>
-
-void TimeFlagCountPlot::Add(class TimeFrequencyData &data, TimeFrequencyMetaDataCPtr meta)
-{
-	const std::vector<double> &times = meta->ObservationTimes();
-	if(!HasData())
-	{
-		_startTime = times[0];
-	}
-	for(size_t maskIndex=0;maskIndex<data.MaskCount();++maskIndex)
-	{
-		Mask2DCPtr mask = data.GetMask(maskIndex);
-		for(size_t x=0;x<mask->Width();++x)
-		{
-			double time = times[x] - _startTime;
-			size_t count = 0;
-
-			for(size_t y=0;y<mask->Height();++y)
-			{
-				if(mask->Value(x, y))
-					++count;
-			}
-			MapItem item = _counts[time];
-			item.count += count;
-			item.total += mask->Height();
-			_counts[time] = item;
-		}
-	}
-	WriteCounts();
-} 
-
-void TimeFlagCountPlot::WriteCounts()
-{
-	std::ofstream file("time-vs-counts.txt");
-	file << std::setprecision(14);
-	for(std::map<double, struct MapItem>::const_iterator i=_counts.begin();i!=_counts.end();++i)
-	{
-		file << i->first << "\t" << i->second.total << "\t" << i->second.count << "\t" << (100.0L * (long double) i->second.count / (long double) i->second.total) << "\n";
-	}
-	file.close();
-}
-
-void TimeFlagCountPlot::MakePlot()
-{
-	Plot plot("time-vs-counts.pdf");
-	plot.SetXAxisText("Time (s)");
-	plot.SetYAxisText("Flagged (%)");
-	plot.SetYRangeAutoMax(0);
-	plot.StartScatter();
-	for(std::map<double, struct MapItem>::const_iterator i=_counts.begin();i!=_counts.end();++i)
-	{
-		plot.PushDataPoint(i->first, 100.0L * (long double) i->second.count / (long double) i->second.total);
-	}
-	plot.Close();
-	plot.Show();
-}
diff --git a/CEP/DP3/AOFlagger/src/test.cpp b/CEP/DP3/AOFlagger/src/test.cpp
deleted file mode 100644
index 5f7822da178194c51072f8c06830cf856cd2c3d4..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/test.cpp
+++ /dev/null
@@ -1,144 +0,0 @@
-#include <iostream>
-#include <fstream>
-#include <sstream>
-
-#include <AOFlagger/msio/image2d.h>
-#include <AOFlagger/msio/measurementset.h>
-#include <AOFlagger/msio/timefrequencydata.h>
-#include <AOFlagger/msio/timefrequencyimager.h>
-
-#include <AOFlagger/strategy/algorithms/thresholdconfig.h>
-#include <AOFlagger/strategy/algorithms/thresholdtools.h>
-#include <AOFlagger/strategy/algorithms/sinusfitter.h>
-
-#include <AOFlagger/util/rng.h>
-
-using namespace std;
-
-void AssertEqual(int expected, int actual, const std::string description)
-{
-	if(expected!=actual)
-		cout << "Test failed: " << description << " (expected " << expected << ", was " << actual << ")" << endl;
-}
-
-int main(int argc, char *argv[])
-{
-	/*
-	// Small script for Parisa
-	MeasurementSet set(argv[1]);
-	TimeFrequencyImager imager(set);
-	size_t antennaCount = set.AntennaCount();
-	imager.SetReadData(true);
-	imager.SetReadFlags(false);
-	imager.SetReadStokesI(true);
-	imager.SetReadXX(false);
-	imager.SetReadXY(false);
-	imager.SetReadYX(false);
-	imager.SetReadYY(false);
-	size_t height = 0, count = 0;
-	for(size_t a1=0;a1<antennaCount;++a1) {
-		for(size_t a2=0;a2<antennaCount;++a2) {
-			imager.Image(a1, a2, 0, 10, 11);
-			TimeFrequencyData data = imager.GetData();
-			Image2DCPtr real = data.GetRealPart();
-			Image2DCPtr imaginary = data.GetImaginaryPart();
-			for(size_t y=0;y<real->Height();++y) {
-				std::cout << real->Value(0, y) << " " << imaginary->Value(0, y) << " ";
-				++count; }
-			height = real->Height();
-		}
-	}
-	std::cout << std::endl;
-	//std::cout << "File contains: " << antennaCount << " x " << antennaCount << " x " << height << " = " << count << " values." << std::endl; 
-	exit(0);
-
-
-	// Test the CountMaskLengths operation
-	Mask2DPtr mask = Mask2D::CreateSetMaskPtr<false>(1024, 1024);
-	int lengths[1024];
-
-	// Test when no samples are flagged
-	ThresholdTools::CountMaskLengths(mask, lengths, 1024);
-	for(unsigned x=0;x<1024;++x)
-		AssertEqual(0, lengths[x], "nothing flagged");
-
-	// Test when all samples are flagged
-	for(unsigned y=0;y<mask->Height();++y) {
-		for(unsigned x=0;x<mask->Width();++x) {
-			mask->SetValue(x, y, true);
-		}
-	}
-	ThresholdTools::CountMaskLengths(mask, lengths, 1024);
-	AssertEqual(lengths[1023], 2048, "everything flagged");
-	for(unsigned x=0;x<1023;++x)
-		AssertEqual(0, lengths[x], "everything flagged");
-
-	// Test single line of size 2
-	mask->SetAll<false>();
-	mask->SetValue(1,1, true);
-	mask->SetValue(1,2, true);
-	ThresholdTools::CountMaskLengths(mask, lengths, 1024);
-	for(unsigned x=0;x<1024;++x)
-		if(x == 1)
-			AssertEqual(1, lengths[x], "single line of size 2");
-		else
-			AssertEqual(0, lengths[x], "single line of size 2");
-
-	// Test single line of size 3
-	mask->SetValue(1,0, true);
-	ThresholdTools::CountMaskLengths(mask, lengths, 1024);
-	for(unsigned x=0;x<1024;++x)
-		if(x == 2)
-			AssertEqual(1, lengths[x], "single line of size 3");
-		else
-			AssertEqual(0, lengths[x], "single line of size 3");
-	
-	// Test combination of horizontal line of size 2 and vertical line of size 3
-	mask->SetValue(2,2, true);
-	ThresholdTools::CountMaskLengths(mask, lengths, 1024);
-	for(unsigned x=0;x<1024;++x)
-		if(x == 1)
-			AssertEqual(1, lengths[x], "two lines: number with length 2");
-		else if(x == 2)
-			AssertEqual(1, lengths[x], "two lines: number with length 3");
-		else {
-			stringstream s;
-			s << "two lines: number with length " << (x+1);
-			AssertEqual(0, lengths[x], s.str());
-		}
-
-	// Test yet another combination
-	mask->SetValue(2,3, true);
-	ThresholdTools::CountMaskLengths(mask, lengths, 1024);
-	for(unsigned x=0;x<1024;++x)
-		if(x == 1)
-			AssertEqual(2, lengths[x], "combinations: number with length 2");
-		else if(x == 2)
-			AssertEqual(1, lengths[x], "combinations: number with length 3");
-		else {
-			stringstream s;
-			s << "combinations: number with length " << (x+1);
-			AssertEqual(0, lengths[x], s.str());
-		}
-	
-	cout << "All tests were executed." << endl;*/
-
-	const size_t size = 100000;
-	num_t dataR[size], dataI[size], datat[size];
-	num_t frequency = -1.1L*2.0*M_PIn;
-	
-	for(num_t shift=0.0L;shift<6.4;shift+=0.1) {
-		for(unsigned i=0;i<size;++i) {
-			datat[i]=((double) i-size/2)/1000.0L;
-			dataR[i]=cosn(datat[i] * frequency + shift)*20.0L + 5.0L;
-			dataI[i]=-sinn(datat[i] * frequency + shift)*20.0L + 5.0L;
-		}
-		SinusFitter fitter;
-		num_t phase=0.0L, amplitude=0.0L;
-		//fitter.FindPhaseAndAmplitude(phase, amplitude, dataR, datat, size, frequency);
-		//long double mean = fitter.FindMean(phase, amplitude, dataR, datat, size, frequency);
-		//cout << "Single amplitude: " << amplitude << ", phase: " << phase << ", mean = " << mean << std::endl;
-		fitter.FindPhaseAndAmplitudeComplex(phase, amplitude, dataR, dataI, datat, size, frequency);
-		cout << "Complex amplitude: " << amplitude << ", phase: " << phase << std::endl;
-	}
-}
diff --git a/CEP/DP3/AOFlagger/src/util/aologger.cpp b/CEP/DP3/AOFlagger/src/util/aologger.cpp
deleted file mode 100644
index d466ec0fbc8a981edb93d1dd80bc01d0f137a474..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/util/aologger.cpp
+++ /dev/null
@@ -1,56 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-
-#include <AOFlagger/util/aologger.h>
-
-enum AOLogger::AOLoggerLevel AOLogger::_coutLevel = AOLogger::InfoLevel;
-
-AOLogger::LogWriter<AOLogger::DebugLevel> AOLogger::Debug;
-
-AOLogger::LogWriter<AOLogger::InfoLevel> AOLogger::Info;
-
-AOLogger::LogWriter<AOLogger::WarningLevel> AOLogger::Warn;
-
-AOLogger::LogWriter<AOLogger::ErrorLevel> AOLogger::Error;
-
-AOLogger::LogWriter<AOLogger::FatalLevel> AOLogger::Fatal;
-
-AOLogger::LogWriter<AOLogger::NoLevel, true> AOLogger::Progress;
-
-void AOLogger::Init(const std::string &name, bool useLogger, bool verbose)
-{
-	Debug.SetUseLogger(useLogger && verbose);
-	Info.SetUseLogger(useLogger);
-	Warn.SetUseLogger(useLogger);
-	Error.SetUseLogger(useLogger);
-	Fatal.SetUseLogger(useLogger);
-	Debug.SetUseLogger(useLogger && verbose);
-
-	if(useLogger) {
-		_coutLevel = ErrorLevel;
-		INIT_LOGGER(name);
-	}
-	else {
-		if(verbose)
-			_coutLevel = DebugLevel;
-		else
-			_coutLevel = InfoLevel;
-	}
-}
diff --git a/CEP/DP3/AOFlagger/src/util/compress.cpp b/CEP/DP3/AOFlagger/src/util/compress.cpp
deleted file mode 100644
index a3f53c3174ad72c9b1a3bb18b27fe06386627df0..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/util/compress.cpp
+++ /dev/null
@@ -1,193 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <stdint.h> 
-
-#include <AOFlagger/strategy/algorithms/thresholdtools.h>
-
-#include <AOFlagger/msio/samplerow.h>
-
-#include <AOFlagger/util/compress.h>
-
-void Compress::Initialize()
-{
-	if(!_isInitialized)
-	{
-		std::ofstream str("compress.bin");
-		for(unsigned i=0;i<_data.ImageCount();++i)
-		{
-			Write(str, _data.GetImage(i), _data.GetSingleMask());
-		}
-		_isInitialized = true;
-	}
-}
-
-void Compress::Deinitialize()
-{
-	if(_isInitialized)
-	{
-		//system("rm compress.bin");
-	}
-}
-
-void Compress::Write(std::ofstream &stream, Image2DCPtr image, Mask2DCPtr mask)
-{
-	const num_t
-		max = ThresholdTools::MaxValue(image, mask),
-		min = ThresholdTools::MinValue(image, mask),
-		mid = (min + max) / 2.0;
-	const num_t normalizeFactor = (num_t) ((2<<22) + ((2<<22)-1)) / (max - min);
-	const uint32_t
-		width = image->Width(),
-		height = image->Height();
-	const char mode = 0;
-
-	stream.write(reinterpret_cast<const char*>(&max), sizeof(max));
-	stream.write(reinterpret_cast<const char*>(&min), sizeof(min));
-	stream.write(reinterpret_cast<const char*>(&width), sizeof(width));
-	stream.write(reinterpret_cast<const char*>(&height), sizeof(height));
-	stream.write(&mode, sizeof(mode));
-
-	for(unsigned y=0;y<height;++y)
-	{
-		for(unsigned x=0;x<width;++x)
-		{
-			if(!mask->Value(x, y))
-			{
-				int32_t value = (int32_t) round((image->Value(x, y) - mid) * normalizeFactor);
-				stream.write(reinterpret_cast<char*>(&value)+1, 3);
-			}
-		}
-	}
-}
-
-void Compress::WriteSubtractFrequencies(std::ofstream &stream, Image2DCPtr image, Mask2DCPtr mask)
-{
-	const num_t
-		max = ThresholdTools::MaxValue(image, mask),
-		min = ThresholdTools::MinValue(image, mask);
-	const num_t normalizeFactor = (num_t) ((2<<22) + ((2<<22)-1)) / (max - min);
-	//const num_t normalizeFactor = 256.0;
-	const uint32_t
-		width = image->Width(),
-		height = image->Height();
-	const char mode = 1;
-
-	stream.write(reinterpret_cast<const char*>(&max), sizeof(max));
-	stream.write(reinterpret_cast<const char*>(&min), sizeof(min));
-	stream.write(reinterpret_cast<const char*>(&width), sizeof(width));
-	stream.write(reinterpret_cast<const char*>(&height), sizeof(height));
-	stream.write(&mode, sizeof(mode));
-
-	int32_t basis[width];
-	for(size_t x=0;x<width;++x)
-	{
-		SampleRowPtr row = SampleRow::CreateFromColumn(image, x);
-		basis[x] = (int32_t) round(row->Median() * normalizeFactor);
-	}
-	stream.write(reinterpret_cast<char*>(basis), sizeof(basis));
-
-	for(unsigned y=0;y<height;++y)
-	{
-		for(unsigned x=0;x<width;++x)
-		{
-			if(!mask->Value(x, y))
-			{
-				int32_t value = (int32_t) (round(image->Value(x, y) * normalizeFactor) - basis[x]);
-				stream.write(reinterpret_cast<char*>(&value)+1, 3);
-			}
-		}
-	}
-}
-
-Image2DPtr Compress::Read(std::ifstream &stream, Image2DPtr image, Mask2DCPtr mask)
-{
-	num_t max = 0.0, min = 0.0;
-	size_t width = 0, height = 0;
-	char mode = 0;
-	stream.read(reinterpret_cast<char*>(&max), sizeof(max));
-	stream.read(reinterpret_cast<char*>(&min), sizeof(min));
-	stream.read(reinterpret_cast<char*>(&width), sizeof(width));
-	stream.read(reinterpret_cast<char*>(&height), sizeof(height));
-	stream.read(&mode, sizeof(mode));
-	num_t normalizeFactor = (max - min) / (num_t) ((2<<22) + ((2<<22)-1));
-	for(unsigned y=0;y<height;++y)
-	{
-		for(unsigned x=0;x<width;++x)
-		{
-			if(!mask->Value(x, y))
-			{
-				int32_t value;
-				stream.read(reinterpret_cast<char*>(&value), 3);
-				value >>= 8;
-				image->SetValue(x, y, value / normalizeFactor + min);
-			}
-		}
-	}
-	return Image2DPtr();
-}
-
-unsigned long Compress::RawSize()
-{
-	Initialize();
-	ExecuteCmd("cp compress.bin compress.raw");
-	return Size("compress.raw");
-}
-
-unsigned long Compress::FlacSize()
-{
-	Initialize();
-	ExecuteCmd("flac -f -8 --bps=24 --endian=little --channels=1 --sample-rate=128000 --sign=signed --lax -o compress.flac compress.bin");
-	return Size("compress.flac");
-}
-
-unsigned long Compress::ZipSize()
-{
-	Initialize();
-	ExecuteCmd("zip -9 compress.zip compress.bin");
-	return Size("compress.zip");
-}
-
-unsigned long Compress::Size(const std::string &file)
-{
-	ExecuteCmd((std::string("ls -lh ") + file).c_str());
-	ExecuteCmd((std::string("rm ") + file).c_str());
-	return 0;
-}
-
-unsigned long Compress::GzSize()
-{
-	Initialize();
-	ExecuteCmd("gzip -9 -c compress.bin > compress.gz");
-	return Size("compress.gz");
-}
-
-unsigned long Compress::Bz2Size()
-{
-	Initialize();
-	ExecuteCmd("bzip2 -9 -c compress.bin > compress.bz2");
-	return Size("compress.bz2");
-}
-
-void Compress::ExecuteCmd(const std::string &str)
-{
-	if(system(str.c_str()) != 0)
-		throw std::runtime_error("system() returned non-zero");
-}
-
diff --git a/CEP/DP3/AOFlagger/src/util/ffttools.cpp b/CEP/DP3/AOFlagger/src/util/ffttools.cpp
deleted file mode 100644
index efa47fda12cc6e226a5b78aa25e7cd492f50d1c0..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/util/ffttools.cpp
+++ /dev/null
@@ -1,441 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2007 by Andre Offringa   *
- *   offringa@gmail.com   *
- *                                                                         *
- *   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.             *
- ***************************************************************************/
-#include <AOFlagger/util/ffttools.h>
-
-#include <fftw3.h>
-
-#include <AOFlagger/strategy/algorithms/sinusfitter.h>
-
-Image2D *FFTTools::CreateFFTImage(const Image2D &original, FFTOutputMethod method)
-{
-	Image2D *image;
-	if(method == Both)
-	 image = Image2D::CreateUnsetImage(original.Width()+2, original.Height());
-	else
-	 image = Image2D::CreateUnsetImage(original.Width()/2+1, original.Height());
-	unsigned long n_in = original.Width() * original.Height();
-	unsigned long n_out = original.Width() * (original.Height()/2+1);
-	
-	double *in = (double*) fftw_malloc(sizeof(double) * n_in);
-	fftw_complex *out = (fftw_complex*) fftw_malloc(sizeof(fftw_complex) * n_out);
-	
-	// According to the specification of fftw, the execute function might
-	// destroy the input array ("in"), wherefore we need to copy it.
-	unsigned long ptr = 0;
-	for(unsigned long y=0;y<original.Height();++y) {
-		for(unsigned long x=0;x<original.Width();++x) {
-			in[ptr] = original.Value(x, y);
-			++ptr;
-		}
-	}
-	
-	fftw_plan plan = fftw_plan_dft_r2c_2d(original.Width(), original.Height(),
-		in, out, FFTW_ESTIMATE);
-	
-	fftw_execute(plan);
-	
-	// Copy data to new image
-	if(method != Both) {
-		ptr = 0;
-		unsigned long halfwidth = original.Width()/2+1;
-		for(unsigned long y=0;y<image->Height();++y) {
-			for(unsigned long x=0;x<halfwidth;++x) {
-				switch(method) {
-					case Real: image->SetValue(x, y, out[ptr][0]); break;
-					case Imaginary: image->SetValue(x ,y, out[ptr][1]); break;
-					case Absolute:
-					default:
-						image->SetValue(x, y, sqrtl(out[ptr][0]*out[ptr][0] + out[ptr][1]*out[ptr][1]));
-						break;
-				}
-				ptr++;
-			}
-		}
-	} else {
-		unsigned out_ptr = 0;
-		unsigned long halfwidth = original.Width()/2+1;
-		for(unsigned long y=0;y<image->Height();++y) {
-			for(unsigned long x=0;x<halfwidth;++x) {
-				image->SetValue(x ,y, out[out_ptr][0]);
-				++out_ptr;
-			}
-			out_ptr -= halfwidth;
-			for(unsigned long x=0;x<halfwidth;++x) {
-				image->SetValue(x, y, out[out_ptr][1]);
-				++out_ptr;
-			}
-		}
-	}
-	
-	fftw_destroy_plan(plan);
-	fftw_free(in);
-	fftw_free(out);
-	
-	return image;
-}
-
-void FFTTools::CreateFFTImage(const Image2D &real, const Image2D &imaginary, Image2D &realOut, Image2D &imaginaryOut, bool centerAfter, bool negate)
-{
-	unsigned long n_in = real.Width() * real.Height();
-	fftw_complex *in = (fftw_complex*) fftw_malloc(sizeof(fftw_complex) * n_in);
-	fftw_complex *out = (fftw_complex*) fftw_malloc(sizeof(fftw_complex) * n_in);
-	
-	bool centerBefore = true;
-	if(centerBefore) {
-		Image2D *tmp = CreateShiftedImageFromFFT(real);
-		realOut.SetValues(*tmp);
-		delete tmp;
-		tmp = CreateShiftedImageFromFFT(imaginary);
-		imaginaryOut.SetValues(*tmp);
-		delete tmp;
-	} else {
-		realOut.SetValues(real);
-		imaginaryOut.SetValues(imaginary);
-	}
-
-	unsigned long ptr = 0;
-	for(unsigned long y=0;y<real.Height();y++) {
-		for(unsigned long x=0;x<real.Width();x++) {
-			in[ptr][0] = realOut.Value(x, y);
-			in[ptr][1] = imaginaryOut.Value(x, y);
-			ptr++;
-		}
-	}
-
-	int sign = 1;
-	if(negate)
-		sign = -1;
-	fftw_plan plan = fftw_plan_dft_2d(real.Width(), real.Height(),
-		in, out, sign, FFTW_ESTIMATE);
-	fftw_execute(plan);
-	
-	ptr = 0;
-	const num_t normFactor = 1.0/sqrtn((num_t) real.Width() * real.Height());
-	for(unsigned long y=0;y<real.Height();y++) {
-		for(unsigned long x=0;x<real.Width();x++) {
-			realOut.SetValue(x, y, out[ptr][0] * normFactor);
-			imaginaryOut.SetValue(x, y, out[ptr][1] * normFactor);
-			ptr++;
-		}
-	}
-	fftw_destroy_plan(plan);
-	fftw_free(in);
-	fftw_free(out);
-	if(centerAfter) {
-		Image2D *tmp = CreateShiftedImageFromFFT(realOut);
-		realOut.SetValues(*tmp);
-		delete tmp;
-		tmp = CreateShiftedImageFromFFT(imaginaryOut);
-		imaginaryOut.SetValues(*tmp);
-		delete tmp;
-	}
-}
-
-Image2D *FFTTools::CreateFullImageFromFFT(const Image2D &fft)
-{
-	int width = fft.Width()*2;
-	Image2D *image = Image2D::CreateUnsetImage(width, fft.Height());
-	for(unsigned y=0;y<fft.Height();++y) {
-		for(unsigned x=0;x<fft.Width();++x) {
-			image->SetValue(x, y, fft.Value(fft.Width()-x-1, (y+fft.Height()/2)%fft.Height()));
-			image->SetValue(fft.Width()*2 - x - 1, fft.Height() - y - 1, fft.Value(fft.Width()-x-1, (y+fft.Height()/2)%fft.Height()));
-		}
-	}
-	return image;
-}
-
-Image2D *FFTTools::CreateShiftedImageFromFFT(const Image2D &fft)
-{
-	Image2D *image = Image2D::CreateUnsetImage(fft.Width(), fft.Height());
-	for(unsigned y=0;y<fft.Height();++y) {
-		for(unsigned x=0;x<fft.Width();++x) {
-			image->SetValue(x, y, fft.Value((x+fft.Width()/2)%fft.Width(), (y+fft.Height()/2)%fft.Height()));
-		}
-	}
-	return image;
-}
-
-Image2D *FFTTools::CreateAbsoluteImage(const Image2D &real, const Image2D &imaginary)
-{
-	Image2D *image = Image2D::CreateUnsetImage(real.Width(), real.Height());
-	for(unsigned y=0;y<real.Height();++y) {
-		for(unsigned x=0;x<real.Width();++x)
-			image->SetValue(x, y, sqrtl(real.Value(x,y)*real.Value(x,y) + imaginary.Value(x,y)*imaginary.Value(x,y)));
-	}
-	return image;
-} 
-
-Image2DPtr FFTTools::CreatePhaseImage(Image2DCPtr real, Image2DCPtr imaginary)
-{
-	Image2DPtr image = Image2D::CreateUnsetImagePtr(real->Width(), real->Height());
-	for(unsigned y=0;y<real->Height();++y) {
-		for(unsigned x=0;x<real->Width();++x)
-			image->SetValue(x, y, SinusFitter::Phase(real->Value(x,y), imaginary->Value(x,y)));
-	}
-	return image;
-} 
-
-void FFTTools::FFTConvolve(const Image2D &realIn, const Image2D &imaginaryIn, const Image2D &realKernel, const Image2D &imaginaryKernel, Image2D &outReal, Image2D &outImaginary)
-{
-	Image2D
-		*realFFTIn = Image2D::CreateUnsetImage(realIn.Width(), realIn.Height()),
-		*imaginaryFFTIn = Image2D::CreateUnsetImage(imaginaryIn.Width(), imaginaryIn.Height());
-	CreateFFTImage(realIn, imaginaryIn, *realFFTIn, *imaginaryFFTIn); 
-	Image2D
-		*realFFTKernel = Image2D::CreateUnsetImage(realKernel.Width(), realKernel.Height()),
-		*imaginaryFFTKernel = Image2D::CreateUnsetImage(imaginaryKernel.Width(), imaginaryKernel.Height());
-	CreateFFTImage(realKernel, imaginaryKernel, *realFFTKernel, *imaginaryFFTKernel);
-
-	Multiply(*realFFTIn, *imaginaryFFTIn, *realFFTKernel, *imaginaryFFTKernel);
-
-	CreateFFTImage(*realFFTIn, *imaginaryFFTIn, outReal, outImaginary, true, true);
-	
-	delete imaginaryFFTKernel;
-	delete realFFTKernel;
-	delete imaginaryFFTIn;
-	delete realFFTIn;
-}
-
-/*void FFTTools::FFTConvolve(num_t *realValues, num_t *imagValues, num_t *realKernel, num_t *imagKernel, size_t count)
-{
-	fftw_complex
-		*in = (fftw_complex*) fftw_malloc(sizeof(fftw_complex) * count),
-		*out = (fftw_complex*) fftw_malloc(sizeof(fftw_complex) * count);
-	for(unsigned i=0;i<count;++i)
-	{
-		in[i][0] = realValues[i];
-		in[i][1] = imagValues[i];
-	}
-	fftw_plan p = fftw_plan_dft_1d(count, in, out, FFTW_FORWARD, FFTW_ESTIMATE);
-	fftw_execute(p);
-
-	fftw_free(out);
-	fftw_free(in);
-}*/
-
-void FFTTools::FFTConvolveFFTKernel(const Image2D &realIn, const Image2D &imaginaryIn, const Image2D &realFFTKernel, const Image2D &imaginaryFFTKernel, Image2D &outReal, Image2D &outImaginary)
-{
-	Image2D
-		*realFFTIn = Image2D::CreateUnsetImage(realIn.Width(), realIn.Height()),
-		*imaginaryFFTIn = Image2D::CreateUnsetImage(imaginaryIn.Width(), imaginaryIn.Height());
-	CreateFFTImage(realIn, imaginaryIn, *realFFTIn, *imaginaryFFTIn);
-
-	Multiply(*realFFTIn, *imaginaryFFTIn, realFFTKernel, imaginaryFFTKernel);
-
-	CreateFFTImage(*realFFTIn, *imaginaryFFTIn, outReal, outImaginary, true, true);
-	
-	delete imaginaryFFTIn;
-	delete realFFTIn;
-}
-
-void FFTTools::Multiply(Image2D &left, const Image2D &right)
-{
-	for(unsigned y=0;y<left.Height();++y)
-	{
-		for(unsigned x=0;x<left.Width();++x)
-			left.SetValue(x, y, left.Value(x,y)*right.Value(x,y));
-	}
-}
-
-void FFTTools::Divide(Image2D &left, const Image2D &right)
-{
-	for(unsigned y=0;y<left.Height();++y)
-	{
-		for(unsigned x=0;x<left.Width();++x)
-			left.SetValue(x, y, left.Value(x,y)/right.Value(x,y));
-	}
-}
- 
-void FFTTools::Multiply(Image2D &leftReal, Image2D &leftImaginary, const Image2D &rightReal, const Image2D &rightImaginary)
-{
-	for(unsigned y=0;y<leftReal.Height();++y)
-	{
-		for(unsigned x=0;x<leftReal.Width();++x) {
-			num_t r1 = leftReal.Value(x,y);
-			num_t i1 = leftImaginary.Value(x,y);
-			num_t r2 = rightReal.Value(x,y);
-			num_t i2 = rightImaginary.Value(x,y);
-			leftReal.SetValue(x, y, r1*r2 - i1*i2);
-			leftImaginary.SetValue(x, y, r1*i2 + r2*i1);
-		}
-	}
-}
-
-void FFTTools::Sqrt(Image2D &image)
-{
-	for(unsigned y=0;y<image.Height();++y) {
-		for(unsigned x=0;x<image.Width();++x) {
-			image.SetValue(x, y, sqrtn(fabs(image.Value(x, y))));
-		}
-	}
-}
-
-void FFTTools::SignedSqrt(Image2D &image)
-{
-	for(size_t y=0;y<image.Height();++y)
-	{
-		for(size_t x=0;x<image.Width();++x)
-		{
-			if(image.Value(x, y) >= 0.0)
-				image.SetValue(x, y, sqrt(image.Value(x, y)));
-			else
-				image.SetValue(x, y, -sqrt(-image.Value(x, y)));
-		}
-	}
-}
-
-void FFTTools::CreateHorizontalFFTImage(Image2D &real, Image2D &imaginary, bool inverse)
-{
-	if(real.Height() == 0) return;
-	unsigned long n_in = real.Width();
-	fftw_complex *in = (fftw_complex*) fftw_malloc(sizeof(fftw_complex) * n_in);
-	fftw_complex *out = (fftw_complex*) fftw_malloc(sizeof(fftw_complex) * n_in);
-
-	for(unsigned long x=0;x<real.Width();++x) {
-		in[x][0] = real.Value(x, 0);
-		in[x][1] = imaginary.Value(x, 0);
-	}
-
-	int sign = -1;
-	if(inverse)
-		sign = 1;
-
-	for(unsigned long y=0;y<real.Height();++y) {
-		for(unsigned long x=0;x<real.Width();++x) {
-			in[x][0] = real.Value(x, y);
-			in[x][1] = imaginary.Value(x, y);
-		}
-		fftw_plan plan = fftw_plan_dft_1d(real.Width(), in, out, sign, FFTW_ESTIMATE);
-		fftw_execute(plan);
-		fftw_destroy_plan(plan);
-		for(unsigned long x=0;x<real.Width();++x) {
-			real.SetValue(x, y, out[x][0]);
-			imaginary.SetValue(x, y, out[x][1]);
-		}
-	}
-	fftw_free(out);
-	fftw_free(in);
-}
-
-void FFTTools::CreateDynamicHorizontalFFTImage(Image2DPtr real, Image2DPtr imaginary, unsigned sections, bool inverse)
-{
-	const size_t width = real->Width();
-	if(real->Height() == 0 || width == 0) return;
-	SampleRowPtr
-		realRow = SampleRow::CreateFromRowSum(real, 0, real->Height()),
-		imaginaryRow = SampleRow::CreateFromRowSum(imaginary, 0, imaginary->Height());
-
-	Image2DPtr
-		destReal = Image2D::CreateUnsetImagePtr(real->Width(), real->Height()),
-		destImag = Image2D::CreateUnsetImagePtr(real->Width(), real->Height());
-	
-	unsigned long n_in = width;
-	fftw_complex *in = (fftw_complex*) fftw_malloc(sizeof(fftw_complex) * n_in);
-	fftw_complex *out = (fftw_complex*) fftw_malloc(sizeof(fftw_complex) * n_in);
-
-	int sign = -1;
-	if(inverse)
-		sign = 1;
-
-	for(unsigned sec=0;sec<sections;++sec)
-	{
-		const unsigned
-			secStart = width * sec / (sections + 1),
-			secEnd = width * (sec + 2) / (sections + 1);
-
-		for(unsigned x=secStart;x<secEnd;++x) {
-			in[x-secStart][0] = realRow->Value(x);
-			in[x-secStart][1] = imaginaryRow->Value(x);
-		}
-
-		fftw_plan plan = fftw_plan_dft_1d(secEnd - secStart, in, out, sign, FFTW_ESTIMATE);
-		fftw_execute(plan);
-		fftw_destroy_plan(plan);
-
-		size_t maxF = secEnd - secStart;
-		if(maxF > destReal->Height()) maxF = destReal->Height();
-		unsigned xEnd = width*(sec+1)/sections;
-		for(unsigned long x=width*sec/sections;x<xEnd;++x) {
-			for(unsigned long y=0;y<maxF;++y) {
-					destReal->SetValue(x, y, out[y][0]);
-					destImag->SetValue(x, y, out[y][1]);
-				}
-			for(unsigned long y=maxF;y<destReal->Height();++y)
-			{
-				destReal->SetValue(x, y, 0.0);
-				destImag->SetValue(x, y, 0.0);
-			}
-		}
-	}
-	fftw_free(out);
-	fftw_free(in);
-	real->SetValues(destReal);
-	imaginary->SetValues(destImag);
-}
-
-Image2DPtr FFTTools::AngularTransform(Image2DCPtr image)
-{
-	size_t minDim = image->Width() > image->Height() ? image->Height() : image->Width(); 
-	Image2D *transformedImage = Image2D::CreateUnsetImage(minDim, minDim);
-	numl_t
-		halfMinDim = (numl_t) minDim / 2.0,
-		halfWidth = (numl_t) image->Width()/2.0,
-		halfHeight = (numl_t) image->Height()/2.0;
-	for(size_t angleIndex=0;angleIndex<minDim;++angleIndex)
-	{
-		numl_t
-			angle = (numl_t) angleIndex * M_PInl / (numl_t) minDim,
-			cosAngle = cosnl(angle),
-			sinAngle = sinnl(angle);
-		for(unsigned offsetIndex = 0;offsetIndex<minDim;++offsetIndex)
-		{
-			numl_t
-				offset = (numl_t) (halfMinDim - offsetIndex),
-				x = halfWidth + offset * cosAngle,
-				y = halfHeight - offset * sinAngle;
-			transformedImage->SetValue(angleIndex, offsetIndex, image->Value((size_t) x, (size_t) y));
-		}
-	}
-	return Image2DPtr(transformedImage);
-}
-
-void FFTTools::FFT(SampleRowPtr realRow, SampleRowPtr imaginaryRow)
-{
-	size_t n = realRow->Size();
-	fftw_complex
-		*in = (fftw_complex*) fftw_malloc(sizeof(fftw_complex) * n),
-		*out = (fftw_complex*) fftw_malloc(sizeof(fftw_complex) * n);
-	for(unsigned i=0;i<n;++i)
-	{
-		in[i][0] = realRow->Value(i);
-		in[i][1] = imaginaryRow->Value(i);
-	}
-	fftw_plan p = fftw_plan_dft_1d(n, in, out, FFTW_FORWARD, FFTW_ESTIMATE);
-	fftw_execute(p);
-	fftw_destroy_plan(p);
-	for(unsigned i=0;i<n;++i)
-	{
-		realRow->SetValue(i, out[i][0]);
-		imaginaryRow->SetValue(i, out[i][0]);
-	}
-	fftw_free(in);
-	fftw_free(out);
-}
-
diff --git a/CEP/DP3/AOFlagger/src/util/integerdomain.cpp b/CEP/DP3/AOFlagger/src/util/integerdomain.cpp
deleted file mode 100644
index 3a33962472515d662bc9a3eb0fedf0c85ef7e8dc..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/util/integerdomain.cpp
+++ /dev/null
@@ -1,116 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <AOFlagger/util/integerdomain.h>
-
-#include <string>
-
-IntegerDomain::IntegerDomain(const IntegerDomain &source)
-{
-	for(std::vector<int>::const_iterator i=source._values.begin();i!=source._values.end();++i)
-		_values.push_back(*i);
-}
-
-IntegerDomain::IntegerDomain(int singleValue)
-{
-	_values.push_back(singleValue);
-}
-
-IntegerDomain::IntegerDomain(const int *values, unsigned count)
-{
-	for(unsigned i=0;i<count;++i)
-		_values.push_back(values[i]);
-}
-
-IntegerDomain::IntegerDomain(int first, unsigned count)
-{
-	for(int i=first;i<(int) (first+count);++i)
-		_values.push_back(i);
-}
-
-IntegerDomain::IntegerDomain(int first, unsigned step, unsigned count)
-{
-	for(unsigned i=0;i<count;++i)
-		_values.push_back(first + i*step);
-}
-
-IntegerDomain::IntegerDomain(const std::string &str) 
-{
-	enum State { Accepting, Number, Interval } state = Accepting;
-	int number, i1 = 0;
-	for(std::string::const_iterator i=str.begin();i!=str.end();++i) {
-		switch(state)
-		{
-			case Accepting:
-				if(*i >= '0' && *i <= '9') {
-					state = Number;
-					number = *i - '0';
-				}
-				break;
-			case Number:
-				if(*i >= '0' && *i <= '9') {
-					number = number * 10 + (*i - '0');
-				} else if(*i == '-') {
-					state = Interval; i1 = number; number = 0;
-				}
-				break;
-			case Interval:
-				if(*i >= '0' && *i <= '9') {
-					number = number*10 + (*i - '0');
-				}
-				break;
-		}
-	}
-	switch(state)
-	{
-		case Number:
-			_values.push_back(number);
-			break;
-		case Interval:
-			for(int n=i1;n<=number;++n) _values.push_back(n);
-			break;
-		case Accepting:
-			break;
-	}
-}
-
-void IntegerDomain::Join(const IntegerDomain &other) throw()
-{
-	for(std::vector<int>::const_iterator i=other._values.begin();i!=other._values.end();++i) {
-		bool found = false;
-		for(std::vector<int>::const_iterator j=_values.begin();j!=_values.end();++j) {
-			if(*i == *j) { found = true; break; }
-		}
-		if(!found)
-			_values.push_back(*i);
-	}
-}
-
-IntegerDomain IntegerDomain::Split(unsigned partCount, unsigned partIndex) const
-{
-	unsigned start = _values.size() * partIndex / partCount;
-	unsigned end = _values.size() * (partIndex+1) / partCount;
-	
-	int *values = new int[end-start];
-	for(unsigned i=start;i<end;++i)
-		values[i-start] = _values[i];
-	IntegerDomain domain(*values, end-start);
-	delete[] values;
-	return domain;
-}
diff --git a/CEP/DP3/AOFlagger/src/util/multiplot.cpp b/CEP/DP3/AOFlagger/src/util/multiplot.cpp
deleted file mode 100644
index 975b5f749538352820569274f5c7328afc046a5c..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/util/multiplot.cpp
+++ /dev/null
@@ -1,52 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <AOFlagger/util/multiplot.h>
-
-MultiPlot::MultiPlot(Plot2D &plot, size_t plotCount)
-	: _plotCount(plotCount), _plot(plot)
-{
-	_points = new PointList*[plotCount];
-	for(size_t i=0;i<plotCount;++i)
-		_points[i] = new PointList();
-	_legends = new std::string[plotCount];
-}
-
-MultiPlot::~MultiPlot()
-{
-	for(size_t i=0;i<_plotCount;++i)
-		delete _points[i];
-	delete[] _points;
-	delete[] _legends;
-}
-
-void MultiPlot::Finish()
-{
-	for(size_t i=0;i<_plotCount;++i)
-	{
-		_plot.StartLine(_legends[i], _xAxisText, _yAxisText, false, Plot2DPointSet::DrawPoints);
-		PointList &list = *_points[i];
-		for(PointList::const_iterator p=list.begin();p!=list.end();++p)
-		{
-			_plot.PushDataPoint(p->x, p->y);
-		}
-		list.clear();
-	}
-}
-
diff --git a/CEP/DP3/AOFlagger/src/util/plot.cpp b/CEP/DP3/AOFlagger/src/util/plot.cpp
deleted file mode 100644
index 53e9122f3a18672a68da52731b2964ae64869a49..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/util/plot.cpp
+++ /dev/null
@@ -1,295 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <AOFlagger/util/plot.h>
-
-#include <stdlib.h>
-#include <sstream>
-#include <iostream>
-
-Plot::Plot(const std::string &pdfFile)
-	: _pdfFile(pdfFile),
-		_xAxisText("x"),
-		_yAxisText("y"),
-		_zAxisText("z"),
-		_xRangeHasMin(false), _xRangeHasMax(false),
-		_yRangeHasMin(false), _yRangeHasMax(false),
-		_zRangeHasMin(false), _zRangeHasMax(false),
-		_cbRangeHasMin(false), _cbRangeHasMax(false),
-		_clipZ(false),
-		_logX(false), _logY(false), _logZ(false),
-		_hasBoxes(false),
-		_fontSize(24)
-{
-	_open = true;
-	_curLineFd = -1;
-}
-
-
-Plot::~Plot()
-{
-	Close();
-}
-
-void Plot::Close()
-{
-	if(_open)
-	{
-		CloseCurFd();
-		char tmpPlotFile[] = "/tmp/plot.plt-XXXXXX";
-		int fd = mkstemp(tmpPlotFile);
-		if(fd == -1)
-		{
-			std::cerr << "mkstemp returned -1" << std::endl;
-			throw;
-		}
-		std::stringstream header;
-		header
-			<< "set term postscript enhanced color"; // font \"Helvetica"; <-- that did not work with some gnuplots.
-		//if(_fontSize>0)
-		//	header << "," << _fontSize;
-		// header << "\"";
-		header
-			<< "\nset title \"" << _title << '\"'
-		  << "\nset pm3d map" // at s
-			<< "\nset palette rgbformulae 33,13,10"
-			<< "\nset xlabel \"" << _xAxisText << '\"'
-			<< "\nset ylabel \"" << _yAxisText << '\"'
-			<< "\nset cblabel \"" << _zAxisText << '\"'
-			<< "\nset datafile missing \"?\""
-			<< "\nset origin -0.05,-0.1"
-			<< "\nset size 1.0,1.2"
-			<< "\nset output \"" << _pdfFile << "\"";
-		for(std::vector<std::string>::const_iterator i=_extraHeaders.begin();i!=_extraHeaders.end();++i)
-			header << *i;
-		if(_logX)
-			header << "\nset log x";
-		if(_logY)
-			header << "\nset log y";
-		if(_logZ)
-			header << "\nset log z";
-		if(_xRangeHasMin || _xRangeHasMax)
-		{
-			header << "\nset xrange [";
-			if(_xRangeHasMin) header << _xRangeMin;
-			header << ":";
-			if(_xRangeHasMax) header << _xRangeMax;
-			header << "]";
-		}
-		if(_yRangeHasMin || _yRangeHasMax)
-		{
-			header << "\nset yrange [";
-			if(_yRangeHasMin) header << _yRangeMin;
-			header << ":";
-			if(_yRangeHasMax) header << _yRangeMax;
-			header << "]";
-		}
-		if(_zRangeHasMin || _zRangeHasMax)
-		{
-			header << "\nset zrange [";
-			if(_zRangeHasMin) header << _zRangeMin;
-			header << ":";
-			if(_zRangeHasMax) header << _zRangeMax;
-			header << "]";
-		}
-		if(_cbRangeHasMin || _cbRangeHasMax)
-		{
-			header << "\nset cbrange [";
-			if(_cbRangeHasMin) header << _cbRangeMin;
-			header << ":";
-			if(_cbRangeHasMax) header << _cbRangeMax;
-			header << "]";
-		}
-		if(_hasBoxes)
-		{
-			header << "\nset boxwidth 0.3";
-		}
-		if(_lineTypes.size() > 0)
-		{
-			switch(_lineTypes[0]) {
-				case Line:
-				case Scatter:
-				case Boxes:
-					header << "\nplot \\";
-					break;
-				case Grid:
-					header << "\nsplot \\";
-					break;
-			}
-			for(unsigned i=0;i<_lineFiles.size();++i)
-			{
-				if(i!=0) header << ",\\";
-				switch(_lineTypes[i]) {
-					case Line:
-						header << "\n\"" << _lineFiles[i] << "\" using 1:2 title \"" << _lineTitles[i] << "\" with lines lw 3";
-						break;
-					case Scatter:
-						header << "\n\"" << _lineFiles[i] << "\" using 1:2 title \"" << _lineTitles[i] << "\" with points";
-						break;
-					case Boxes:
-						header << "\n\"" << _lineFiles[i] << "\" using 1:2 title \"" << _lineTitles[i] << "\" with boxes fs solid 1.0";
-						break;
-					case Grid:
-						header << "\n\"" << _lineFiles[i] << "\" using ($1):($2):($3) title \"" << _lineTitles[i] << "\" with pm3d lw 3";
-						break;
-				}
-			}
-			header << "\n";
-			Write(fd, header.str());
-			std::cout << "gnuplot" << std::endl;
-			ExecuteCmd((std::string("gnuplot ") + tmpPlotFile).c_str());
-			std::cout << "mv" << std::endl;
-			ExecuteCmd((std::string("mv ") + _pdfFile + " " + _pdfFile + ".ps").c_str());
-			std::cout << "ps2pdf" << std::endl;
-			ExecuteCmd((std::string("ps2pdf ") + _pdfFile + ".ps " + _pdfFile).c_str());
-			std::cout << "rm" << std::endl;
-			ExecuteCmd((std::string("rm ") + _pdfFile + ".ps").c_str());
-		}
-		_open = false;
-	}
-}
-
-void Plot::Show()
-{
-	ExecuteCmd((std::string("./kpdf ") + _pdfFile).c_str());
-}
-
-void Plot::CloseCurFd()
-{
-	if(_curLineFd != -1)
-	{
-		close(_curLineFd);
-	}
-}
-
-void Plot::StartLine(const std::string &lineTitle)
-{
-	CloseCurFd();
-	char tmpLineFile[] = "/tmp/line.txt-XXXXXX";
-	_curLineFd = mkstemp(tmpLineFile);
-	if(_curLineFd == -1)
-	{
-		std::cerr << "mkstemp returned -1" << std::endl;
-		throw;
-	}
-	_lineFiles.push_back(tmpLineFile);
-	_lineTitles.push_back(lineTitle);
-	_lineTypes.push_back(Line);
-	_curType = Line;
-}
-
-void Plot::StartScatter(const std::string &lineTitle)
-{
-	CloseCurFd();
-	char tmpLineFile[] = "/tmp/line.txt-XXXXXX";
-	_curLineFd = mkstemp(tmpLineFile);
-	if(_curLineFd == -1)
-	{
-		std::cerr << "mkstemp returned -1" << std::endl;
-		throw;
-	}
-	_lineFiles.push_back(tmpLineFile);
-	_lineTitles.push_back(lineTitle);
-	_lineTypes.push_back(Scatter);
-	_curType = Scatter;
-}
-
-void Plot::StartBoxes(const std::string &lineTitle)
-{
-	_hasBoxes = true;
-	CloseCurFd();
-	char tmpLineFile[] = "/tmp/line.txt-XXXXXX";
-	_curLineFd = mkstemp(tmpLineFile);
-	if(_curLineFd == -1)
-	{
-		std::cerr << "mkstemp returned -1" << std::endl;
-		throw;
-	}
-	_lineFiles.push_back(tmpLineFile);
-	_lineTitles.push_back(lineTitle);
-	_lineTypes.push_back(Boxes);
-	_curType = Boxes;
-}
-
-void Plot::StartGrid(const std::string &lineTitle)
-{
-	CloseCurFd();
-	char tmpLineFile[] = "/tmp/line.txt-XXXXXX";
-	_curLineFd = mkstemp(tmpLineFile);
-	if(_curLineFd == -1)
-	{
-		std::cerr << "mkstemp returned -1" << std::endl;
-		throw;
-	}
-	_lineFiles.push_back(tmpLineFile);
-	_lineTitles.push_back(lineTitle);
-	_lineTypes.push_back(Grid);
-	_curType = Grid;
-}
-
-void Plot::PushDataPoint(long double x, long double y)
-{
-	if(_curLineFd == -1) throw;
-	std::stringstream s;
-	s << x << "\t" << y << std::endl;
-	Write(_curLineFd, s.str());
-}
-
-void Plot::PushDataPoint(long double x, long double y, long double z)
-{
-	if(_curLineFd == -1) throw;
-	if(_clipZ)
-	{
-		if(_zRangeHasMin && z < _zRangeMin)
-			z = _zRangeMin;
-		if(_zRangeHasMax && z > _zRangeMax)
-			z = _zRangeMax;
-	}
-	std::stringstream s;
-	s << x << "\t" << y << "\t" << z << std::endl;
-	Write(_curLineFd, s.str());
-}
-
-void Plot::PushUnknownDataPoint(long double x, long double y)
-{
-	if(_curLineFd == -1) throw;
-	std::stringstream s;
-	s << x << "\t" << y << "\t?" << std::endl;
-	Write(_curLineFd, s.str());
-}
-
-void Plot::PushDataBlockEnd()
-{
-	Write(_curLineFd, "\n");
-}
-
-void Plot::AddRectangle(long double x1, double y1, double x2, double y2)
-{
-	std::stringstream s;
-	s << "\nset object " << (_extraHeaders.size()+1) << " "
-		"rectangle from " << x1 << "," << y1 << " to " << x2 << "," << y2 << " front lw 0 fc rgb \"#FF00FF\" fillstyle solid 1.0 noborder";
-	_extraHeaders.push_back(s.str());
-}
-
-void Plot::ExecuteCmd(const std::string &cmd) const
-{
-	if(system(cmd.c_str()) != 0)
-		throw std::runtime_error("system() returned non-zero");
-}
-
diff --git a/CEP/DP3/AOFlagger/src/util/rng.cpp b/CEP/DP3/AOFlagger/src/util/rng.cpp
deleted file mode 100644
index 2d90cba3df3a56e325ca3465c006f574ece640a7..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/util/rng.cpp
+++ /dev/null
@@ -1,133 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <AOFlagger/util/rng.h>
-
-#include <stdlib.h>
-#include <cmath>
-
-#ifndef M_PIl
-#define M_PIl M_PI
-#endif
-
-RNG::RNG()
-{
-}
-
-double RNG::Uniform()
-{
-	return (long double) rand() / (long double) RAND_MAX;
-}
-
-double RNG::Gaussian()
-{
-	long double a, b;
-	DoubleGaussian(a, b);
-	return a;
-}
-
-double RNG::GaussianProduct()
-{
-	long double a, b;
-	DoubleGaussian(a, b);
-	return a * b;
-}
-
-double RNG::GaussianPartialProduct()
-{
-	long double a, b;
-	DoubleGaussian(a, b);
-	if(a >= 0.0)
-		a = pow(a, M_SQRT2/2.0);
-	else
-		a = -pow(-a, M_SQRT2/2.0);
-	if(b >= 0.0)
-		b = pow(b, M_SQRT2/2.0);
-	else
-		b = -pow(-b, M_SQRT2/2.0);
-	return a*b;
-}
-
-void RNG::DoubleGaussian(long double &a, long double &b)
-{
-	long double x1, x2, w;
-	
-	do {
-		long double r1 = (long double) rand() / (long double) RAND_MAX; 
-		long double r2 = (long double) rand() / (long double) RAND_MAX; 
-		x1 = 2.0 * r1 - 1.0;
-		x2 = 2.0 * r2 - 1.0;
-		w = x1 * x1 + x2 * x2;
-	} while ( w >= 1.0 );
-
-	w = std::sqrt( (-2.0 * std::log( w ) ) / w );
-	a = x1 * w;
-	b = x2 * w;
-}
-
-double RNG::Rayleigh()
-{
-	double x = Gaussian(), y = Gaussian();
-	return sqrt(x*x + y*y);
-}
-
-double RNG::EvaluateRayleigh(double x, double sigma)
-{
-	return x * exp(-x*x/(2.0*sigma*sigma)) / (sigma * sigma);
-}
-
-double RNG::IntegrateGaussian(long double upperLimit)
-{
-	long double integral = 0.0L, term = 0.0L, stepSize = 1e-4L;
-	upperLimit -= stepSize/2.0L;
-	do {
-		term = std::exp(-upperLimit * upperLimit / 2.0L);
-		upperLimit -= stepSize;
-		integral += term * stepSize;
-	} while(term >= 1e-6 || upperLimit >= 0);
-	return integral / std::sqrt(2.0L * M_PIl);
-}
-
-double RNG::EvaluateGaussian(double x, double sigmaSquared)
-{
-	return 1.0 / (sigmaSquared * std::sqrt(2.0L*M_PI)) * std::exp(-0.5*x*x/sigmaSquared);
-}
-
-long double RNG::EvaluateGaussian(long double x, long double sigmaSquared)
-{
-	return 1.0L / (sigmaSquared * std::sqrt(2.0L*M_PI)) * std::exp(-0.5L*x*x/sigmaSquared);
-}
-
-double RNG::EvaluateUnnormalizedGaussian(double x, double sigmaSquared)
-{
-	return std::exp(-0.5*x*x/sigmaSquared);
-}
-
-double RNG::EvaluateGaussian2D(long double x1, long double x2, long double sigmaX1, long double sigmaX2)
-{
-	return 1.0L / (2.0L*M_PI*sigmaX1*sigmaX2) * std::exp(-0.5L*(x1*(1.0L/sigmaX1)*x1 + x2*(1.0L/sigmaX2)*x2));
-}
-
-void RNG::ComplexGaussianAmplitude(num_t &r, num_t &i)
-{
-	num_t amplitude = Gaussian();
-	num_t phase = Uniform() * 2.0 * M_PIn;
-	r = amplitude * std::cos(phase);
-	i = amplitude * std::sin(phase);
-}
diff --git a/CEP/DP3/AOFlagger/src/util/roctree.cpp b/CEP/DP3/AOFlagger/src/util/roctree.cpp
deleted file mode 100644
index 6b543a8939b5b8144fff83897fdbcb30274215eb..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/util/roctree.cpp
+++ /dev/null
@@ -1,88 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <AOFlagger/util/roctree.h>
-
-#include <iostream>
-
-ROCTree::ROCTree(long double parameterRootValue, ROCTreeClassifier &classifier)
- : _tree(0), _parameterRootValue(parameterRootValue), _classifier(classifier)
-{
-}
-
-ROCTree::~ROCTree()
-{
-}
-
-ROCTree::ROCTreeNode *ROCTree::Find(ROCTreeNode **node, long double parameter, long double stepSize, long double falseRatioValue, long double falseRatioPrecision, int depth)
-{
-	if((*node) == 0)
-	{
-		ROCTreeNode *n = new ROCTreeNode();
-		n->parameter = parameter;
-		n->left = 0;
-		n->right = 0;
-		_classifier.Perform(n->falseRatio, n->trueRatio, parameter);
-		*node = n;
-	}
-	depth++;
-	if(depth == 20) {
-		return *node;
-	} 
-	// Are we within the desired precision?
-	if((*node)->falseRatio - falseRatioPrecision <= falseRatioValue && (*node)->falseRatio + falseRatioPrecision >= falseRatioValue)
-	{
-		std::cout << "+ found (" << depth << ",threshold=" << (*node)->parameter << ",searching=" << falseRatioValue << ",current=" << (*node)->falseRatio << ")" << std::endl;
-		// Precision reached
-		return *node;
-	} else {
-		// Precision not reached, traverse down the tree in the proper direction
-		if((*node)->falseRatio < falseRatioValue)
-		{
-			std::cout << "<-- left traversel (" << depth << ",threshold=" << (*node)->parameter << ",searching=" << falseRatioValue << ",current=" << (*node)->falseRatio << ")" << std::endl;
-			return Find(&(*node)->right, parameter-stepSize, stepSize/2.0L, falseRatioValue, falseRatioPrecision, depth);
-		}
-		else
-		{
-			std::cout << "--> right traversel (" << depth << ",threshold=" << (*node)->parameter << ",searching=" << falseRatioValue << ",current=" << (*node)->falseRatio << ")" << std::endl;
-			return Find(&(*node)->left, parameter+stepSize, stepSize/2.0L, falseRatioValue, falseRatioPrecision, depth);
-		}
-	}
-}
-
-void ROCTree::Save(const std::string &rocFilename)
-{
-	std::ofstream rocFile(rocFilename.c_str());
-	if(_tree != 0)
-		SaveNode(rocFile, *_tree);
-	rocFile.close();
-}
-
-void ROCTree::SaveNode(std::ofstream &file, ROCTree::ROCTreeNode &node)
-{
-	if(node.left != 0)
-		SaveNode(file, *node.left);
-	file
-		<< "\t" << node.falseRatio*100.0L
-		<< "\t" << node.trueRatio*100.0L
-		<< "\t" << node.parameter
-		<< std::endl;
-	if(node.right != 0)
-		SaveNode(file, *node.right);
-}
diff --git a/CEP/DP3/AOFlagger/src/util/statwriter.cpp b/CEP/DP3/AOFlagger/src/util/statwriter.cpp
deleted file mode 100644
index b0171287f2232e0a98883561950e23e2a5e10cd9..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/util/statwriter.cpp
+++ /dev/null
@@ -1,104 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <AOFlagger/util/statwriter.h>
-
-#include <math.h>
-#include <fstream>
-#include <sstream>
-
-StatWriter::StatWriter(const std::string &baseName) : _baseFilename(baseName), _activeColumn(0), _activeRow(0), _width(0), _height(0), _writeCount(0), _lazyWriteWait(8), _newMethodsStart(0), _lastActionWasNewMethod(true)
-{
-}
-
-
-StatWriter::~StatWriter()
-{
-	Save();
-
-	for(std::vector<std::vector<long double> *>::iterator i=_table.begin();i!=_table.end();++i)
-	{
-		delete *i;
-	}	
-}
-
-void StatWriter::AddColumn()
-{
-	for(std::vector<std::vector<long double> *>::iterator i=_table.begin();i!=_table.end();++i)
-	{
-		(*i)->push_back(0.0);
-	}
-	_width++;
-}
-
-void StatWriter::AddRow()
-{
-	std::vector<long double> *newRow = new std::vector<long double>();
-	for(unsigned i=0;i<_width;++i)
-		newRow->push_back(0.0);
-	_table.push_back(newRow);
-	_height++;
-}
-
-void StatWriter::SetValue(long double value)
-{
-	MakeAccessable(_activeColumn, _activeRow);
-	(*_table[_activeRow])[_activeColumn] = value;
-	_writeCount++;
-	if(_writeCount >= _lazyWriteWait)
-		Save();
-	_lastActionWasNewMethod = false;
-}
-
-long double StatWriter::Format(long double value, unsigned significantDigits)
-{
-	unsigned long base = 1;
-	while(significantDigits > 0) {
-		base *= 10;
-		significantDigits--;
-	}
-	return roundl(value * base) / base;
-}
-
-void StatWriter::Save()
-{
-	std::stringstream filename;
-	filename << _baseFilename << ".txt";
-	std::ofstream file(filename.str().c_str());
-
-	if(_methods.size() > 0) {
-		file << "#" << _methods[0];
-		for(std::vector<std::string>::const_iterator i=_methods.begin()+1;i!=_methods.end();++i) {
-			file << "\t" << *i; 
-		}
-		file << "\n";
-	}
-
-	for(std::vector<std::vector<long double> *>::const_iterator j=_table.begin();j!=_table.end();++j)
-	{
-		if((*j)->size()>0) {
-			file << (**j)[0];
-			for(std::vector<long double>::const_iterator i=(*j)->begin()+1;i!=(*j)->end();++i)
-				file << '\t' << (*i);
-		}
-		file << "\n";
-	}
-	file.close();
-	_writeCount = 0;
-}
diff --git a/CEP/DP3/AOFlagger/src/util/stopwatch.cpp b/CEP/DP3/AOFlagger/src/util/stopwatch.cpp
deleted file mode 100644
index 0cb4f89beeff47bb48cd5a3e484155f0da442deb..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/src/util/stopwatch.cpp
+++ /dev/null
@@ -1,178 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by A.R. Offringa   *
- *   offringa@astro.rug.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.             *
- ***************************************************************************/
-#include <AOFlagger/util/stopwatch.h>
-
-#include <cmath>
-#include <sstream>
-
-#include <boost/date_time/posix_time/posix_time.hpp>
-
-Stopwatch::Stopwatch() : _running(false), _sum(boost::posix_time::seconds(0))
-{
-}
-
-Stopwatch::Stopwatch(bool start) :
-	_running(start),
-	_startTime(boost::posix_time::microsec_clock::local_time()),
-	_sum(boost::posix_time::seconds(0))
-{
-}
-
-Stopwatch::~Stopwatch()
-{
-}
-
-void Stopwatch::Start()
-{
-	if(!_running) {
-		_startTime = boost::posix_time::microsec_clock::local_time();
-		_running = true;
-	}
-}
-
-void Stopwatch::Pause()
-{
-	if(_running) {
-		_sum += (boost::posix_time::microsec_clock::local_time() - _startTime);
-		_running = false;
-	}
-}
-
-void Stopwatch::Reset()
-{
-	_running = false;
-	_sum = boost::posix_time::seconds(0);
-}
-
-std::string Stopwatch::ToString() const
-{
-	if(_running) {
-		boost::posix_time::time_duration current = _sum + (boost::posix_time::microsec_clock::local_time() - _startTime);
-		return to_simple_string(current);
-	} else {
-		return to_simple_string(_sum);
-	}
-}
-
-std::string Stopwatch::ToShortString() const
-{
-	const long double seconds = Seconds();
-	if(seconds >= 60*60*24)
-		return ToDaysString();
-	else if(seconds >= 60*60)
-		return ToHoursString();
-	else if(seconds >= 60)
-		return ToMinutesString();
-	else if(seconds >= 1.0)
-		return ToSecondsString();
-	else if(seconds >= 0.001)
-		return ToMilliSecondsString();
-	else if(seconds >= 0.000001)
-		return ToMicroSecondsString();
-	else
-		return ToNanoSecondsString();
-}
-
-std::string Stopwatch::ToDaysString() const
-{
-	const long double days = roundl(Seconds() / (60.0*60.0))/24.0;
-	std::stringstream str;
-	if(days >= 10.0)
-		str << roundl(days) << " days";
-	else
-		str << floorl(days) << 'd' << (days*24.0) << 'h';
-	return str.str();
-}
-
-std::string Stopwatch::ToHoursString() const
-{
-	const long double hours = roundl(Seconds() / 60.0)/60.0;
-	std::stringstream str;
-	if(hours >= 10.0)
-		str << roundl(hours) << 'h';
-	else
-		str << floorl(hours) << 'h' << (hours*60.0) << 'm';
-	return str.str();
-}
-
-std::string Stopwatch::ToMinutesString() const
-{
-	const long double mins = roundl(Seconds())/60.0;
-	std::stringstream str;
-	if(mins >= 10.0)
-		str << roundl(mins) << " min";
-	else
-		str << floorl(mins) << 'm' << fmod(mins*60.0,60.0) << 's';
-	return str.str();
-}
-
-std::string Stopwatch::ToSecondsString() const
-{
-	const long double seconds = roundl(Seconds()*10.0)/10.0;
-	std::stringstream str;
-	if(seconds >= 10.0)
-		str << roundl(Seconds()) << 's';
-	else
-		str << seconds << 's';
-	return str.str();
-}
-
-std::string Stopwatch::ToMilliSecondsString() const
-{
-	const long double msec = roundl(Seconds()*10000.0)/10.0;
-	std::stringstream str;
-	if(msec >= 10.0)
-		str << roundl(Seconds()*1000.0) << "ms";
-	else
-		str << msec << "ms";
-	return str.str();
-}
-
-std::string Stopwatch::ToMicroSecondsString() const
-{
-	const long double usec = roundl(Seconds()*10000000.0)/10.0;
-	std::stringstream str;
-	if(usec >= 10.0)
-		str << roundl(Seconds()*1000000.0) << "µs";
-	else
-		str << usec << "µs";
-	return str.str();
-}
-
-std::string Stopwatch::ToNanoSecondsString() const
-{
-	const long double nsec = roundl(Seconds()*10000000000.0)/10.0;
-	std::stringstream str;
-	if(nsec >= 10.0)
-		str << roundl(Seconds()*1000000000.0) << "ns";
-	else
-		str << nsec << "ns";
-	return str.str();
-}
-
-long double Stopwatch::Seconds() const
-{
-	if(_running) {
-		boost::posix_time::time_duration current = _sum + (boost::posix_time::microsec_clock::local_time() - _startTime);
-		return (long double) current.total_milliseconds()/1000.0;
-	} else {
-		return (long double) _sum.total_milliseconds()/1000.0;
-	}
-}
diff --git a/CEP/DP3/AOFlagger/test/CMakeLists.txt b/CEP/DP3/AOFlagger/test/CMakeLists.txt
deleted file mode 100644
index eb2436c058940167119023f8cf441369ead2b01f..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/test/CMakeLists.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-include(LofarCTest)
-
-lofar_add_test(aotest aotest.cpp)
diff --git a/CEP/DP3/AOFlagger/test/aotest.cpp b/CEP/DP3/AOFlagger/test/aotest.cpp
deleted file mode 100644
index 3ecfc5be78a71dc9c94e9b9209579042b86f8545..0000000000000000000000000000000000000000
--- a/CEP/DP3/AOFlagger/test/aotest.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
-#include <iostream>
-
-#include <AOFlagger/test/strategy/algorithms/algorithmstestgroup.h>
-#include <AOFlagger/test/experiments/experimentstestgroup.h>
-#include <AOFlagger/test/msio/msiotestgroup.h>
-#include <AOFlagger/test/quality/qualitytestgroup.h>
-#include <AOFlagger/test/util/utiltestgroup.h>
-
-int main(int argc, char *argv[])
-{
-  unsigned successes = 0, failures = 0;
-	if(argc == 2 && std::string(argv[1])=="time")
-	{
-		ExperimentsTestGroup group;
-		group.Run();
-		successes += group.Successes();
-		failures += group.Failures();
-	}
-	
-	else if(argc == 1 || std::string(argv[1])!="only")
-	{
-		AlgorithmsTestGroup mainGroup;
-		mainGroup.Run();
-		successes += mainGroup.Successes();
-		failures += mainGroup.Failures();
-
-		MSIOTestGroup msioGroup;
-		msioGroup.Run();
-		successes += msioGroup.Successes();
-		failures += msioGroup.Failures();
-		
-		QualityTestGroup qualityGroup;
-		qualityGroup.Run();
-		successes += qualityGroup.Successes();
-		failures += qualityGroup.Failures();
-		
-		UtilTestGroup utilGroup;
-		utilGroup.Run();
-		successes += utilGroup.Successes();
-		failures += utilGroup.Failures();
-	}
-	
-	if(argc > 1 && (std::string(argv[1])=="all" || std::string(argv[1])=="only"))
-	{
-		ExperimentsTestGroup resultsGroup;
-		resultsGroup.Run();
-		successes += resultsGroup.Successes();
-		failures += resultsGroup.Failures();
-	}
-	
-	std::cout << "Succesful tests: " << successes << " / " << (successes + failures) << '\n';
-	
-	if(failures == 0)
-		return 0;
-	else
-		return 1;
-}
diff --git a/CEP/DP3/CMakeLists.txt b/CEP/DP3/CMakeLists.txt
index 818e6149230803d667ad73782887950846d6199e..e71ce7ee44ab4c75ee271dae06657761caaf6e9c 100644
--- a/CEP/DP3/CMakeLists.txt
+++ b/CEP/DP3/CMakeLists.txt
@@ -5,12 +5,14 @@ lofar_add_package(TestDynDPPP)
 lofar_add_package(PythonDPPP)
 lofar_add_package(DPPP_AOFlag)
 lofar_add_package(SPW_Combine SPWCombine)
-lofar_add_package(AOFlagger)
 
-# Disable DDECal for LOFAR release 2.21
-#lofar_find_package(Armadillo)
-#if(${ARMADILLO_FOUND})
-#  lofar_add_package(DPPP_DDECal)
-#else()
-#  message(WARNING "Armadillo was not found, NOT building DPPP_DDECal")
-#endif()
+lofar_find_package(Armadillo)
+if(${ARMADILLO_FOUND})
+  if(CMAKE_CXX_FLAGS MATCHES ".*\\+\\+11.*")
+    lofar_add_package(DPPP_DDECal)
+  else()
+    message(WARNING "DPPP_DDECal will not build if you have no C++11 support, please build in directory gnucxx11_opt")
+  endif()
+else()
+  message(WARNING "Armadillo was not found, NOT building DPPP_DDECal")
+endif()
diff --git a/CEP/DP3/DPPP/include/DPPP/ApplyCal.h b/CEP/DP3/DPPP/include/DPPP/ApplyCal.h
index e4c08521e317057d8460a243898889212685b336..e047a263b2378713310a719f268a75f6482c0f5f 100644
--- a/CEP/DP3/DPPP/include/DPPP/ApplyCal.h
+++ b/CEP/DP3/DPPP/include/DPPP/ApplyCal.h
@@ -29,6 +29,7 @@
 
 #include <DPPP/DPInput.h>
 #include <DPPP/DPBuffer.h>
+#include <DPPP/H5Parm.h>
 #include <ParmDB/ParmFacade.h>
 #include <ParmDB/ParmSet.h>
 #include <ParmDB/Parm.h>
@@ -41,14 +42,17 @@ namespace LOFAR {
     // @ingroup NDPPP
 
     // This class is a DPStep class applying calibration parameters to the data.
-
     class ApplyCal: public DPStep
     {
     public:
+
+      enum CorrectType {GAIN, FULLJONES, TEC, CLOCK, ROTATIONANGLE, SCALARPHASE, PHASE,
+                        ROTATIONMEASURE, SCALARAMPLITUDE, AMPLITUDE};
+
       // Construct the object.
       // Parameters are obtained from the parset using the given prefix.
       ApplyCal (DPInput*, const ParameterSet&, const string& prefix,
-                bool substep=false);
+                bool substep=false, std::string predictDirection="");
 
       ApplyCal();
 
@@ -121,13 +125,22 @@ namespace LOFAR {
 
       void initDataArrays();
 
+      // Check the number of polarizations in the parmdb or h5parm
+      uint nPol(const std::string& parmName);
+
+      static std::string correctTypeToString(CorrectType);
+      static CorrectType stringToCorrectType(const string&);
+
       //# Data members.
       DPInput*         itsInput;
       DPBuffer         itsBuffer;
-      string           itsName;
-      string           itsParmDBName;
+      string      itsName;
+      string      itsParmDBName;
+      bool             itsUseH5Parm;
       boost::shared_ptr<BBS::ParmFacade> itsParmDB;
-      string           itsCorrectType;
+      H5Parm           itsH5Parm;
+      H5Parm::SolTab   itsSolTab;
+      CorrectType      itsCorrectType;
       bool             itsInvert;
       uint             itsTimeSlotsPerParmUpdate;
       double           itsSigmaMMSE;
@@ -146,6 +159,7 @@ namespace LOFAR {
       double          itsLastTime; // last time of current chunk
       FlagCounter     itsFlagCounter;
       bool            itsUseAP;      //# use ampl/phase or real/imag
+      hsize_t         itsDirection;
       NSTimer         itsTimer;
     };
 
diff --git a/CEP/DP3/DPPP/include/DPPP/CMakeLists.txt b/CEP/DP3/DPPP/include/DPPP/CMakeLists.txt
index ef5138bba8c6d4ec8324ad83b3e951fc6a91c6f4..12ddf1a6b3e06286bcff33209af6b3987cd08b1a 100644
--- a/CEP/DP3/DPPP/include/DPPP/CMakeLists.txt
+++ b/CEP/DP3/DPPP/include/DPPP/CMakeLists.txt
@@ -16,8 +16,8 @@ set(inst_HEADERS
   DemixerNew.h DemixInfo.h DemixWorker.h
   ApplyBeam.h ApplyBeam.tcc
   Predict.h
-  GainCal.h StefCal.h phasefitter.h
-  StManParsetKeys.h H5Parm.h
+  GainCal.h StefCal.h PhaseFitter.h
+  StManParsetKeys.h H5Parm.h DummyStep.h H5ParmPredict.h
 )
 
 # Create symbolic link to include directory.
diff --git a/CEP/DP3/DPPP/include/DPPP/DummyStep.h b/CEP/DP3/DPPP/include/DPPP/DummyStep.h
new file mode 100644
index 0000000000000000000000000000000000000000..a7bd04060868104cc12646345ac0fce60330e5e1
--- /dev/null
+++ b/CEP/DP3/DPPP/include/DPPP/DummyStep.h
@@ -0,0 +1,94 @@
+//# DummyStep.h: DPPP step class to DummyStep visibilities from a source model
+//# Copyright (C) 2013
+//# ASTRON (Netherlands Institute for Radio Astronomy)
+//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
+//#
+//# This file is part of the LOFAR software suite.
+//# The LOFAR software suite 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 3 of the License, or
+//# (at your option) any later version.
+//#
+//# The LOFAR software suite 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 the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
+//#
+//# $Id:
+//#
+//# @author Tammo Jan Dijkema
+
+#ifndef DPPP_DummyStep_H
+#define DPPP_DummyStep_H
+
+// @file
+// @brief DPPP step class to DummyStep visibilities from a source model
+
+#include <DPPP/DPInput.h>
+#include <DPPP/DPBuffer.h>
+#include <DPPP/Patch.h>
+#include <DPPP/SourceDBUtil.h>
+#include <DPPP/ApplyBeam.h>
+#include <DPPP/ModelComponent.h>
+#include <StationResponse/Station.h>
+#include <StationResponse/Types.h>
+#include <casacore/casa/Arrays/Cube.h>
+#include <casacore/casa/Quanta/MVEpoch.h>
+#include <casacore/measures/Measures/MEpoch.h>
+#include <casacore/casa/Arrays/ArrayMath.h>
+#include <utility>
+
+namespace LOFAR {
+
+  class ParameterSet;
+
+  namespace DPPP {
+    // @ingroup NDPPP
+
+    // This class is a DPStep class to DummyStep visibilities with optionally beam
+
+    typedef std::pair<size_t, size_t> Baseline;
+    typedef std::pair<ModelComponent::ConstPtr, Patch::ConstPtr> Source;
+
+    class DummyStep: public DPStep
+    {
+    public:
+      // Construct the object.
+      // Parameters are obtained from the parset using the given prefix.
+      DummyStep (DPInput*, const ParameterSet&, const string& prefix);
+
+      virtual ~DummyStep();
+
+      // Process the data.
+      // It keeps the data.
+      // When processed, it invokes the process function of the next step.
+      virtual bool process (const DPBuffer&);
+
+      // Finish the processing of this step and subsequent steps.
+      virtual void finish();
+
+      // Update the general info.
+      virtual void updateInfo (const DPInfo&);
+
+      // Show the step parameters.
+      virtual void show (std::ostream&) const;
+
+      // Show the timings.
+      virtual void showTimings (std::ostream&, double duration) const;
+
+    private:
+      //# Data members.
+      DPInput*         itsInput;
+      string           itsName;
+      DPBuffer         itsBuffer;
+
+      NSTimer          itsTimer;
+    };
+
+  } //# end namespace
+}
+
+#endif
diff --git a/CEP/DP3/DPPP/include/DPPP/GainCal.h b/CEP/DP3/DPPP/include/DPPP/GainCal.h
index 8a4f6675028d172688419703f36df59d0ad5c6e5..cebd11b8d4d6796c9c8c35460af11605e02c1975 100644
--- a/CEP/DP3/DPPP/include/DPPP/GainCal.h
+++ b/CEP/DP3/DPPP/include/DPPP/GainCal.h
@@ -29,7 +29,7 @@
 
 #include <DPPP/DPInput.h>
 #include <DPPP/DPBuffer.h>
-#include <DPPP/phasefitter.h>
+#include <DPPP/PhaseFitter.h>
 #include <DPPP/BaselineSelection.h>
 #include <DPPP/StefCal.h>
 #include <DPPP/Patch.h>
@@ -69,7 +69,7 @@ namespace LOFAR {
     {
     public:
 
-      enum CalType {COMPLEXGAIN, PHASEONLY, FULLJONES, SCALARPHASE, AMPLITUDEONLY,
+      enum CalType {COMPLEXGAIN, SCALARCOMPLEXGAIN, FULLJONES, PHASEONLY, SCALARPHASE, AMPLITUDEONLY,
                     SCALARAMPLITUDE, TECANDPHASE, TEC, TECSCREEN};
 
       // Construct the object.
diff --git a/CEP/DP3/DPPP/include/DPPP/H5Parm.h b/CEP/DP3/DPPP/include/DPPP/H5Parm.h
index 772c785f766b32de0752b362093d9214324c8a1f..0b2423f09a57efa440ff6f104f08262d0ae22ce4 100644
--- a/CEP/DP3/DPPP/include/DPPP/H5Parm.h
+++ b/CEP/DP3/DPPP/include/DPPP/H5Parm.h
@@ -1,17 +1,17 @@
 #ifndef DPPP_H5PARM_H
 #define DPPP_H5PARM_H
 
-
 #include <string>
+#include <vector>
+#include <complex>
+#include <map>
 
 #include <H5Cpp.h>
 
 #include <utility>
-#include <casacore/casa/Arrays/Vector.h>
-#include <casacore/measures/Measures/MPosition.h>
 
 namespace LOFAR {
-  class H5Parm
+  class H5Parm : private H5::H5File
   {
     typedef struct antenna_t {
       char name[16];
@@ -22,50 +22,181 @@ namespace LOFAR {
       char name[128];
       float dir[2];
     } source_t;
+    
+    typedef struct polarization_t {
+      char name[2];
+    } polarization_t;
 
     public:
-      H5Parm(const std::string& name);
+    // A name and the length of an exis, e.g. ('freq', 800) for 800 frequencies
+    struct AxisInfo {
+      public: AxisInfo(const std::string& name, uint size) :
+        name(name), size(size) {};
+
+        std::string name;
+        uint size;
+      };
+
+      // SolTab is a solution table as defined in the H5Parm standard. It
+      // contains one solution, e.g. all TEC values, with different axes
+      // for that solution (e.g. time, freq, pol).
+      class SolTab : private H5::Group {
+        public:
+          // Default constructor
+          SolTab() {};
+
+          // Create a new soltab, add it to its parent
+          SolTab(H5::Group group,
+                 const std::string& type,
+                 const std::vector<AxisInfo> axes // Axes, fastest varying last
+                 );
+
+          // Create a soltab from a H5::Group (for reading existing files)
+          SolTab(H5::Group& group);
+
+          // The destructor could check for valid subtables
+          virtual ~SolTab();
+
+          SolTab operator=(H5::Group group);
+
+          std::vector<AxisInfo>& getAxes() {return _axes;}
+
+          AxisInfo getAxis(uint i);
+
+          // Get an axis, throw an exception if it does not exist
+          AxisInfo getAxis(const std::string& axisName);
+
+          size_t nAxes() { return _axes.size(); }
+
+          bool hasAxis(const std::string& axisName);
+
+          // Get the index of an axis
+          size_t getAxisIndex(const std::string& axisname);
+
+          void setAntennas(const std::vector<std::string>& solAntennas);
+
+          void setSources(const std::vector<std::string>& solSources);
+
+          void setFreqs(const std::vector<double>& freqs);
+
+          // Get the values of a real-valued axis (e.g. "time" or "freq")
+          std::vector<double> getRealAxis(const std::string& axisname) const;
+
+          // Get the values of a string-valued axis (e.g. "dir" or "pol")
+          std::vector<std::string> getStringAxis(const std::string& axisname);
+
+          // Get the index of freq, using nearest neighbor
+          // This assumes that the frequencies are in increasing order.
+          hsize_t getFreqIndex(double freq) const;
+
+          // Get the index of a time. Matches with 0.5*timeInterval
+          // This assumes that all times are regularly spaced
+          hsize_t getTimeIndex(double time) const;
 
-      ~H5Parm();
+          hsize_t getDirIndex(const std::string& dirName);
 
+          // Gets the interval (in s.) between the first and second time slot
+          // Throws error if there is only one time slot
+          double getTimeInterval() const {
+            return getInterval("time");
+          }
+
+          // Gets the interval (in s.) between the first and second frequency
+          // Throws error if there is only one frequency
+          double getFreqInterval() const {
+            return getInterval("freq");
+          }
+
+          void setTimes(const std::vector<double>& times);
+
+          // Set metadata about an axis
+          void setAxisMeta(const std::string& metaName,
+                           const std::vector<double>& metaVals);
+
+          // Adds a real solution.
+          // If weights are emtpy, write ones everywhere
+          void setValues(const std::vector<double>& vals,
+                         const std::vector<double>& weights);
+
+          // Add a complex solution, taking either amplitude or phase
+          void setComplexValues(const std::vector<std::complex<double> >& vals,
+                                const std::vector<double>& weights,
+                                bool toAmplitudes);
+
+          // Get the values of this SolTab for a given antenna.
+          std::vector<double> getValues(const std::string& antName,
+                                        uint starttimeslot, uint ntime, uint timestep=1,
+                                        uint startfreq=0, uint nfreq=1, uint freqstep=1,
+                                        uint pol=0, uint dir=0);
+
+          // Get the name of this SolTab
+          std::string getName() const;
+
+          std::string getType() const {return _type;}
+
+        private:
+          void readAxes();
+
+          void fillCache(std::map<std::string, hsize_t>& cache,
+                         const std::string& tableName);
+
+          // Get the interval of the axis axisName
+          double getInterval(const std::string& axisName) const;
+          hsize_t getAntIndex(const std::string& antName);
+          hsize_t getNamedIndex(std::map<std::string, hsize_t>& cache,
+                                const std::string& tableName,
+                                const std::string& elementName);
+
+          std::string _type;
+          std::vector<AxisInfo> _axes;
+          std::map<std::string, hsize_t> _antMap;
+          std::map<std::string, hsize_t> _dirMap;
+      };
+
+      // Open existing H5Parm or create a new one
+      // Default name is given by solSetName, if that does not exist continue
+      // searching for sol000, sol001, etc.
+      // Only one solset of an H5Parm can be opened at once; this object only
+      // provides info about one SolSet (even though the file can contain more).
+      H5Parm(const std::string& filename, bool forceNewSolSet=false,
+             const std::string& solSetName="");
+
+
+      H5Parm();
+
+      virtual ~H5Parm();
+
+      // Add metadata (directions on the sky in J2000) about named sources
       void addSources (const std::vector<std::string>& names,
                        const std::vector<std::pair<double, double> >& dirs);
 
+      // Add metadata (positions on earth in ITRF) about antennas
       void addAntennas(const std::vector<std::string>& names,
                        const std::vector<std::vector<double> >& positions);
+      
+      // Add metadata about polarizations
+      void addPolarizations(const std::vector<std::string>& polarizations);
 
-      // Add a solution
-      // If weights are emtpy, write ones everywhere
-      void addSolution(const std::string& solName,
-                       const std::string& solType,
-                       const std::string& axesstr, // String with axes names, fastest varying last
-                       const std::vector<hsize_t>& dims,
-                       const std::vector<double>& vals,
-                       const std::vector<double>& weights);
+      // Add a version stamp in the attributes of the group
+      static void addVersionStamp(H5::Group &node);
 
-      // Add a complex solution, taking either amplitude or phase
-      void addSolution(const std::string& solName,
-                       const std::string& solType,
-                       const std::string& axesstr, // String with axes names, fastest varying last
-                       const std::vector<hsize_t>& dims,
-                       const std::vector<std::complex<double> >& vals,
-                       const std::vector<double>& weights, 
-                       bool toAmplitudes);
+      // Create and return a new soltab. Type is the type as used in BBS
+      SolTab& createSolTab(const std::string& name,
+                           const std::string& type,
+                           const std::vector<AxisInfo> axes);
 
-      void setSolAntennas(const std::string& solName,
-                          const std::vector<std::string>& solAntennas);
+      SolTab& getSolTab(const std::string& name);
 
-      void setSolSources(const std::string& solName,
-                         const std::vector<std::string>& solSources);
+      // Get the name of the one SolSet used in this H5Parm
+      std::string getSolSetName() const ;
 
-      void setFreqs(const std::string& solName,
-                    const std::vector<double>& freqs);
-
-      void setTimes(const std::string& solName,
-                    const std::vector<double>& times);
+      // Get the number of SolTabs in the active solset of this h5parm
+      size_t nSolTabs() { return _solTabs.size(); }
 
+      // Is the given soltab resent in the active solset of this h5parm
+      bool hasSolTab(const std::string& solTabName) const;
     private:
-      void addVersionStamp(H5::Group &node);
+
       static double takeAbs(std::complex<double> c) {
         return std::abs(c);
       }
@@ -73,7 +204,7 @@ namespace LOFAR {
         return std::arg(c);
       }
 
-      H5::H5File _hdf5file;
+      std::map<std::string, SolTab> _solTabs;
       H5::Group _solSet;
   };
 }
diff --git a/CEP/DP3/DPPP/include/DPPP/H5ParmPredict.h b/CEP/DP3/DPPP/include/DPPP/H5ParmPredict.h
new file mode 100644
index 0000000000000000000000000000000000000000..a82968e6098fb4009de7882ddb94aecf7678b5dc
--- /dev/null
+++ b/CEP/DP3/DPPP/include/DPPP/H5ParmPredict.h
@@ -0,0 +1,91 @@
+//# H5ParmPredict.h: DPPP step class to H5ParmPredict visibilities from a source model
+//# Copyright (C) 2013
+//# ASTRON (Netherlands Institute for Radio Astronomy)
+//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
+//#
+//# This file is part of the LOFAR software suite.
+//# The LOFAR software suite 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 3 of the License, or
+//# (at your option) any later version.
+//#
+//# The LOFAR software suite 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 the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
+//#
+//# $Id:
+//#
+//# @author Tammo Jan Dijkema
+
+#ifndef DPPP_H5ParmPredict_H
+#define DPPP_H5ParmPredict_H
+
+// @file
+// @brief DPPP step class to H5ParmPredict visibilities from a source model
+
+#include <DPPP/DPInput.h>
+#include <DPPP/DPBuffer.h>
+#include <DPPP/Predict.h>
+#include <utility>
+
+namespace LOFAR {
+
+  class ParameterSet;
+
+  namespace DPPP {
+    // @ingroup NDPPP
+
+    // This class is a DPStep class to H5ParmPredict visibilities with optionally beam
+
+    typedef std::pair<size_t, size_t> Baseline;
+    typedef std::pair<ModelComponent::ConstPtr, Patch::ConstPtr> Source;
+
+    class H5ParmPredict: public DPStep
+    {
+    public:
+      // Construct the object.
+      // Parameters are obtained from the parset using the given prefix.
+      H5ParmPredict (DPInput*, const ParameterSet&, const string& prefix);
+
+      virtual ~H5ParmPredict();
+
+      // Process the data.
+      // It keeps the data.
+      // When processed, it invokes the process function of the next step.
+      virtual bool process (const DPBuffer&);
+
+      // Finish the processing of this step and subsequent steps.
+      virtual void finish();
+
+      // Update the general info.
+      virtual void updateInfo (const DPInfo&);
+
+      // Show the step parameters.
+      virtual void show (std::ostream&) const;
+
+      // Show the timings.
+      virtual void showTimings (std::ostream&, double duration) const;
+
+    private:
+      //# Data members.
+      DPInput*         itsInput;
+      string           itsName;
+      DPBuffer         itsBuffer;
+
+      std::vector<Predict::ShPtr> itsPredictSteps;
+      ResultStep*      itsResultStep;
+
+      std::string      itsH5ParmName;
+      std::vector<std::string> itsDirections;
+
+      NSTimer          itsTimer;
+    };
+
+  } //# end namespace
+}
+
+#endif
diff --git a/CEP/DP3/DPPP/include/DPPP/phasefitter.h b/CEP/DP3/DPPP/include/DPPP/PhaseFitter.h
similarity index 100%
rename from CEP/DP3/DPPP/include/DPPP/phasefitter.h
rename to CEP/DP3/DPPP/include/DPPP/PhaseFitter.h
diff --git a/CEP/DP3/DPPP/include/DPPP/Predict.h b/CEP/DP3/DPPP/include/DPPP/Predict.h
index 14b2c083322256d834d52e0dd0e2ac8d552c3804..378d56ca6b390dc601e2464c954b0e4371a96a8b 100644
--- a/CEP/DP3/DPPP/include/DPPP/Predict.h
+++ b/CEP/DP3/DPPP/include/DPPP/Predict.h
@@ -56,6 +56,8 @@ namespace LOFAR {
     class Predict: public DPStep
     {
     public:
+      typedef shared_ptr<Predict> ShPtr;
+
       // Construct the object.
       // Parameters are obtained from the parset using the given prefix.
       Predict (DPInput*, const ParameterSet&, const string& prefix);
@@ -68,6 +70,9 @@ namespace LOFAR {
       void init (DPInput*, const ParameterSet&, const string& prefix,
                  const vector<string>& sourcePatterns);
 
+      // Set the applycal substep
+      void setApplyCal(DPInput*, const ParameterSet&, const string& prefix);
+
       Predict();
 
       virtual ~Predict();
@@ -132,12 +137,12 @@ namespace LOFAR {
 
       // The info needed to calculate the station beams.
       vector<vector<StationResponse::Station::Ptr> > itsAntBeamInfo;
-      vector<casacore::MeasFrame>                       itsMeasFrames;
-      vector<casacore::MDirection::Convert>             itsMeasConverters;
-      vector<vector<StationResponse::matrix22c_t> > itsBeamValues;
-      ApplyBeam::BeamMode                           itsBeamMode;
+      vector<casacore::MeasFrame>                    itsMeasFrames;
+      vector<casacore::MDirection::Convert>          itsMeasConverters;
+      vector<vector<StationResponse::matrix22c_t> >  itsBeamValues;
+      ApplyBeam::BeamMode                            itsBeamMode;
 
-      // Vector of patches, and a bool indicating if it contains only one source
+      std::string itsDirectionsStr; // Definition of patches, to pass to applycal
       vector<Patch::ConstPtr> itsPatchList;
       vector<Source> itsSourceList;
 
diff --git a/CEP/DP3/DPPP/src/ApplyCal.cc b/CEP/DP3/DPPP/src/ApplyCal.cc
index 66d5f1a8af6d336162d9e8c5fddcdd285c8cf661..d4d450d31bcf0af43baebfa8726321a57ffab04e 100644
--- a/CEP/DP3/DPPP/src/ApplyCal.cc
+++ b/CEP/DP3/DPPP/src/ApplyCal.cc
@@ -45,11 +45,13 @@ namespace LOFAR {
     ApplyCal::ApplyCal (DPInput* input,
                         const ParameterSet& parset,
                         const string& prefix,
-                        bool substep)
+                        bool substep,
+                        string predictDirection
+                        )
       : itsInput       (input),
         itsName        (prefix),
         itsParmDBName  (parset.getString (prefix + "parmdb")),
-        itsCorrectType (toLower(parset.getString (prefix + "correction", "gain"))),
+        itsUseH5Parm   (itsParmDBName.find(".h5")!=string::npos),
         itsTimeSlotsPerParmUpdate (parset.getInt (prefix +
             "timeslotsperparmupdate", 500)),
         itsSigmaMMSE   (parset.getDouble (prefix + "MMSE.Sigma", 0)),
@@ -62,28 +64,78 @@ namespace LOFAR {
         itsUseAP       (false)
     {
       ASSERT (!itsParmDBName.empty());
+
       if (substep) {
         itsInvert=false;
       } else {
-        itsInvert=parset.getBool (prefix + "invert", true);
+        itsInvert = parset.getBool (prefix + "invert", true);
       }
-      if (itsCorrectType=="fulljones" && itsUpdateWeights) {
-        ASSERTSTR (itsInvert, "Updating weights has not been implemented for invert=false and fulljones");
+
+      if (itsUseH5Parm) {
+        string directionStr;
+        if (substep) {
+          directionStr = predictDirection;
+        } else {
+          directionStr = parset.getString (prefix + "direction", "");
+        }
+        itsH5Parm = H5Parm(itsParmDBName);
+        string solTabName = toLower(parset.getString (prefix + "correction"));
+        itsSolTab = itsH5Parm.getSolTab(solTabName);
+        itsCorrectType = stringToCorrectType(itsSolTab.getType());
+        if (itsCorrectType==PHASE && nPol("")==1) {
+          itsCorrectType = SCALARPHASE;
+        }
+        if (itsCorrectType==AMPLITUDE && nPol("")==1) {
+          itsCorrectType = SCALARAMPLITUDE;
+        }
+        if (directionStr=="") {
+          ASSERT(!itsSolTab.hasAxis("dir") || itsSolTab.getAxis("dir").size==1);
+        } else {
+          itsDirection = itsSolTab.getDirIndex(directionStr);
+        }
+      } else {
+        string correctTypeStr = toLower(parset.getString (prefix + "correction", "gain"));
+        itsCorrectType = stringToCorrectType(correctTypeStr);
       }
-      ASSERT(itsCorrectType=="gain" || itsCorrectType=="fulljones" || 
-             itsCorrectType=="tec" || itsCorrectType=="clock" ||
-             itsCorrectType=="scalarphase" || itsCorrectType=="commonscalarphase" ||
-             itsCorrectType=="scalaramplitude" || itsCorrectType=="commonscalaramplitude" ||
-             itsCorrectType=="rotationangle" || itsCorrectType=="commonrotationangle" ||
-             itsCorrectType=="rotationmeasure");
-      if (itsCorrectType.substr(0,6)=="common") {
-        itsCorrectType=itsCorrectType.substr(6);
+
+      if (itsCorrectType==FULLJONES && itsUpdateWeights) {
+        ASSERTSTR (itsInvert, "Updating weights has not been implemented for invert=false and fulljones");
       }
     }
 
     ApplyCal::ApplyCal()
     {}
 
+    string ApplyCal::correctTypeToString(CorrectType ct) {
+      if (ct==GAIN) return "gain";
+      if (ct==FULLJONES) return "fulljones";
+      if (ct==TEC) return "tec";
+      if (ct==CLOCK) return "clock";
+      if (ct==SCALARPHASE) return "scalarphase";
+      if (ct==SCALARAMPLITUDE) return "scalaramplitude";
+      if (ct==ROTATIONANGLE) return "rotationangle";
+      if (ct==ROTATIONMEASURE) return "rotationmeasure";
+      if (ct==PHASE) return "phase";
+      if (ct==AMPLITUDE) return "amplitude";
+      THROW(Exception, "Unknown correction type: "<<ct);
+      return "";
+    }
+
+    ApplyCal::CorrectType ApplyCal::stringToCorrectType(const string& ctStr) {
+      if (ctStr=="gain") return GAIN;
+      if (ctStr=="fulljones") return FULLJONES;
+      if (ctStr=="tec") return TEC;
+      if (ctStr=="clock") return CLOCK;
+      if (ctStr=="scalarphase" || ctStr=="commonscalarphase") return SCALARPHASE;
+      if (ctStr=="scalaramplitude" || ctStr=="commonscalaramplitude") return SCALARAMPLITUDE;
+      if (ctStr=="phase") return PHASE;
+      if (ctStr=="amplitude") return AMPLITUDE;
+      if (ctStr=="rotationangle" || ctStr=="commonrotationangle") return ROTATIONANGLE;
+      if (ctStr=="rotationmeasure") return ROTATIONMEASURE;
+      THROW(Exception, "Unknown correction type: "<<ctStr);
+      return GAIN;
+    }
+
     ApplyCal::~ApplyCal()
     {}
 
@@ -101,37 +153,46 @@ namespace LOFAR {
 
       ASSERT(itsNCorr==4);
 
-      itsParmDB.reset(new BBS::ParmFacade(itsParmDBName));
+      if (!itsUseH5Parm) { // Use ParmDB
+        itsParmDB.reset(new BBS::ParmFacade(itsParmDBName));
+      }
 
       // Detect if full jones solutions are present
-      if ((itsCorrectType == "gain" || itsCorrectType=="fulljones") &&
+      if (!itsUseH5Parm &&
+          (itsCorrectType == GAIN || itsCorrectType==FULLJONES) &&
           (itsParmDB->getNames("Gain:0:1:*").size() +
            itsParmDB->getDefNames("Gain:0:1:*").size() >0 )) {
-        itsCorrectType="fulljones";
+        itsCorrectType=FULLJONES;
       }
 
-      // Detect if solutions are saved as Real/Imag or Ampl/Phase 
-      if (itsCorrectType == "gain" || itsCorrectType == "fulljones" ){
-        if (!itsParmDB->getNames("Gain:0:0:Real*").empty()) {
-          // Values with :Real present
-          itsUseAP = false; 
-        } else if (!itsParmDB->getNames("Gain:0:0:Ampl*").empty() || 
-                   !itsParmDB->getNames("Phase:0:0:Ampl*").empty()) {
-          // Values with :Ampl present
-          itsUseAP = true;
-        } else if (!itsParmDB->getDefNames("Gain:0:0:Real*").empty()) {
-          // Defvalues with :Real present
-          itsUseAP = false;
-        } else if (!itsParmDB->getDefNames("Gain:0:0:Ampl*").empty() ||
-                   !itsParmDB->getDefNames("Gain:0:0:Phase*").empty()) {
-          // Defvalues with :Ampl present
+      // Detect if solutions are saved as Real/Imag or Ampl/Phase
+      if (itsCorrectType == GAIN || itsCorrectType == FULLJONES ){
+        if (itsUseH5Parm) {
+          // H5Parm uses amplitude / phase by definition
           itsUseAP = true;
         } else {
-          THROW (Exception, "No gains found in parmdb "+itsParmDBName);
+          // Determine from values present in parmdb what to use
+          if (!itsParmDB->getNames("Gain:0:0:Real*").empty()) {
+            // Values with :Real present
+            itsUseAP = false;
+          } else if (!itsParmDB->getNames("Gain:0:0:Ampl*").empty() ||
+                     !itsParmDB->getNames("Phase:0:0:Ampl*").empty()) {
+            // Values with :Ampl present
+            itsUseAP = true;
+          } else if (!itsParmDB->getDefNames("Gain:0:0:Real*").empty()) {
+            // Defvalues with :Real present
+            itsUseAP = false;
+          } else if (!itsParmDB->getDefNames("Gain:0:0:Ampl*").empty() ||
+                     !itsParmDB->getDefNames("Gain:0:0:Phase*").empty()) {
+            // Defvalues with :Ampl present
+            itsUseAP = true;
+          } else {
+            THROW (Exception, "No gains found in parmdb "+itsParmDBName);
+          }
         }
       }
 
-      if (itsCorrectType == "gain") {
+      if (itsCorrectType == GAIN) {
         if (itsUseAP) {
           itsParmExprs.push_back("Gain:0:0:Ampl");
           itsParmExprs.push_back("Gain:0:0:Phase");
@@ -143,7 +204,7 @@ namespace LOFAR {
           itsParmExprs.push_back("Gain:1:1:Real");
           itsParmExprs.push_back("Gain:1:1:Imag");
         }
-      } else if (itsCorrectType == "fulljones") {
+      } else if (itsCorrectType == FULLJONES) {
         if (itsUseAP) {
           itsParmExprs.push_back("Gain:0:0:Ampl");
           itsParmExprs.push_back("Gain:0:0:Phase");
@@ -163,36 +224,41 @@ namespace LOFAR {
           itsParmExprs.push_back("Gain:1:1:Real");
           itsParmExprs.push_back("Gain:1:1:Imag");
         }
-      } else if (itsCorrectType == "tec") {
-        if (itsParmDB->getNames("TEC:0:*").empty() &&
-                    itsParmDB->getDefNames("TEC:0:*").empty() ) {
+      } else if (itsCorrectType == TEC) {
+        if (nPol("TEC")==1) {
           itsParmExprs.push_back("TEC");
         }
         else {
           itsParmExprs.push_back("TEC:0");
           itsParmExprs.push_back("TEC:1");
         }
-      } else if (itsCorrectType == "clock") {
-        if (itsParmDB->getNames("Clock:0:*").empty() &&
-            itsParmDB->getDefNames("Clock:0:*").empty() ) {
+      } else if (itsCorrectType == CLOCK) {
+        if (nPol("Clock")==1) {
           itsParmExprs.push_back("Clock");
         }
         else {
           itsParmExprs.push_back("Clock:0");
           itsParmExprs.push_back("Clock:1");
         }
-      } else if (itsCorrectType == "rotationangle") {
+      } else if (itsCorrectType == ROTATIONANGLE) {
         itsParmExprs.push_back("{Common,}RotationAngle");
-      } else if (itsCorrectType == "scalarphase") {
+      } else if (itsCorrectType == SCALARPHASE) {
         itsParmExprs.push_back("{Common,}ScalarPhase");
-      } else if (itsCorrectType == "rotationmeasure") {
+      } else if (itsCorrectType == ROTATIONMEASURE) {
         itsParmExprs.push_back("RotationMeasure");
-      } else if (itsCorrectType == "scalaramplitude") {
+      } else if (itsCorrectType == SCALARAMPLITUDE) {
         itsParmExprs.push_back("{Common,}ScalarAmplitude");
-      }
-      else {
-        THROW (Exception, "Correction type " + itsCorrectType +
-                         " is unknown");
+      } else if (itsCorrectType == PHASE) {
+        ASSERT(itsUseH5Parm);
+        itsParmExprs.push_back("Phase:0");
+        itsParmExprs.push_back("Phase:1");
+      } else if (itsCorrectType == AMPLITUDE) {
+        ASSERT(itsUseH5Parm);
+        itsParmExprs.push_back("Amplitude:0");
+        itsParmExprs.push_back("Amplitude:1");
+      } else {
+        THROW (Exception, "Correction type "<<
+                          correctTypeToString(itsCorrectType)<<" is unknown");
       }
 
       initDataArrays();
@@ -219,9 +285,13 @@ namespace LOFAR {
     void ApplyCal::show (std::ostream& os) const
     {
       os << "ApplyCal " << itsName << std::endl;
-      os << "  parmdb:         " << itsParmDBName << endl;
-      os << "  correction:     " << itsCorrectType << endl;
-      if (itsCorrectType=="gain" || itsCorrectType=="fulljones") {
+      if (itsUseH5Parm) {
+        os << "  H5Parm:         " << itsParmDBName <<endl;
+      } else {
+        os << "  parmdb:         " << itsParmDBName << endl;
+      }
+      os << "  correction:     " << correctTypeToString(itsCorrectType) << endl;
+      if (itsCorrectType==GAIN || itsCorrectType==FULLJONES) {
         os << "    Ampl/Phase:   " << boolalpha << itsUseAP << endl;
       }
       os << "  update weights: " << boolalpha << itsUpdateWeights << endl;
@@ -241,10 +311,9 @@ namespace LOFAR {
     {
       itsTimer.start();
       itsBuffer.copy (bufin);
-      double bufStartTime = bufin.getTime() - 0.5*itsTimeInterval;
 
       if (bufin.getTime() > itsLastTime) {
-        updateParms(bufStartTime);
+        updateParms(bufin.getTime());
         itsTimeStep=0;
       }
       else {
@@ -304,7 +373,7 @@ namespace LOFAR {
 
     void ApplyCal::updateParms (const double bufStartTime)
     {
-      int numAnts = info().antennaNames().size();
+      uint numAnts = info().antennaNames().size();
 
       // itsParms contains the parameters to a grid, first for all parameters
       // (e.g. Gain:0:0 and Gain:1:1), next all antennas, next over freq * time
@@ -322,7 +391,8 @@ namespace LOFAR {
       }
       double minFreq       (info().chanFreqs()[0]-0.5*freqInterval);
       double maxFreq (info().chanFreqs()[numFreqs-1]+0.5*freqInterval);
-      itsLastTime = bufStartTime + itsTimeSlotsPerParmUpdate * itsTimeInterval;
+      itsLastTime = bufStartTime - 0.5*itsTimeInterval + 
+                    itsTimeSlotsPerParmUpdate * itsTimeInterval;
       uint numTimes = itsTimeSlotsPerParmUpdate;
 
       double lastMSTime = info().startTime() + info().ntime() * itsTimeInterval;
@@ -336,54 +406,104 @@ namespace LOFAR {
 
       uint tfDomainSize=numTimes*numFreqs;
 
-      for (uint parmExprNum = 0; parmExprNum<itsParmExprs.size();++parmExprNum) {
-        // parmMap contains parameter values for all antennas
-        parmMap = itsParmDB->getValuesMap( itsParmExprs[parmExprNum] + "*",
-                               minFreq, maxFreq, freqInterval,
-                               bufStartTime, itsLastTime, itsTimeInterval,
-                               true);
-
-        // Resolve {Common,}Bla to CommonBla or Bla
-        if (!parmMap.empty() &&
-            itsParmExprs[parmExprNum].find("{") != std::string::npos) {
-          uint colonPos = (parmMap.begin()->first).find(":");
-          itsParmExprs[parmExprNum] = (parmMap.begin()->first).substr(0, colonPos);
-        }
+      // Fill parmvalues here, get raw data from H5Parm or ParmDB
+      if (itsUseH5Parm) {
+        // TODO: understand polarization etc.
+        ASSERT(itsParmExprs.size()==1 || itsParmExprs.size()==2);
+        for (uint ant = 0; ant < numAnts; ++ant) {
+          hsize_t startTime = itsSolTab.getTimeIndex(bufStartTime);
+
+          uint freqUpsampleFactor = numFreqs;
+          if (itsSolTab.hasAxis("freq") && itsSolTab.getAxis("freq").size > 1) {
+            double h5freqinterval = itsSolTab.getFreqInterval();
+            freqUpsampleFactor = h5freqinterval/info().chanWidths()[0] + 0.5; // Round;
+            ASSERT(near(h5freqinterval, freqUpsampleFactor*info().chanWidths()[0],1.e-5));
+          }
 
-        for (int ant = 0; ant < numAnts; ++ant) {
-          parmIt = parmMap.find(
-                    itsParmExprs[parmExprNum] + ":" + info().antennaNames()[ant]);
-
-          if (parmIt != parmMap.end()) {
-            parmvalues[parmExprNum][ant].swap(parmIt->second);
-            ASSERT(parmvalues[parmExprNum][ant].size()==tfDomainSize);
-          } else {// No value found, try default
-            Array<double> defValues;
-            double defValue;
-
-            if (itsParmDB->getDefValues(itsParmExprs[parmExprNum] + ":" +
-                info().antennaNames()[ant]).size()==1) { // Default for antenna
-              itsParmDB->getDefValues(itsParmExprs[parmExprNum] + ":" +
-                  info().antennaNames()[ant]).get(0,defValues);
-              ASSERT(defValues.size()==1);
-              defValue=defValues.data()[0];
-            }
-            else if (itsParmDB->getDefValues(itsParmExprs[parmExprNum]).size()
-                == 1) { //Default value
-              itsParmDB->getDefValues(itsParmExprs[parmExprNum]).get(0,defValues);
-              ASSERT(defValues.size()==1);
-              defValue=defValues.data()[0];
-            } else if (itsParmExprs[parmExprNum].substr(0,5)=="Gain:") {
-              defValue=0.;
-            }
-            else {
-              THROW (Exception, "No parameter value found for "+
-                 itsParmExprs[parmExprNum]+":"+info().antennaNames()[ant]);
+          double h5timeInterval = itsSolTab.getTimeInterval();
+          uint timeUpsampleFactor = h5timeInterval/itsTimeInterval+0.5; // Round
+          ASSERT(near(h5timeInterval,timeUpsampleFactor*itsTimeInterval,1.e-5));
+          uint nfreqsinhdf5 = (!itsSolTab.hasAxis("freq")?1:itsSolTab.getAxis("freq").size);
+
+          // Figure out whether time or frequency is first axis
+          bool freqvariesfastest = true;
+          if (itsSolTab.hasAxis("freq") &&
+              itsSolTab.getAxisIndex("freq") < itsSolTab.getAxisIndex("time")) {
+            freqvariesfastest = false;
+          }
+          ASSERT(freqvariesfastest);
+
+          for (uint pol=0; pol<itsParmExprs.size(); ++pol) {
+            vector<double> rawsols = itsSolTab.getValues(info().antennaNames()[ant],
+                                        startTime, numTimes/timeUpsampleFactor, 1,
+                                        0, nfreqsinhdf5, 1, pol, itsDirection);
+
+            parmvalues[pol][ant].resize(tfDomainSize);
+
+            // TODO: upsample frequency properly
+            // Below just upsamples frequency from one to numfreqs or takes raw frequencies
+            size_t tf=0;
+            for (uint t=0; t<numTimes/timeUpsampleFactor; ++t) {
+              for (uint ti=0; ti<timeUpsampleFactor; ++ti) {
+                for (uint f=0; f<numFreqs/freqUpsampleFactor; ++f) {
+                  for (uint fi=0; fi<freqUpsampleFactor; ++fi) {
+                    parmvalues[pol][ant][tf++] = rawsols[t*nfreqsinhdf5 + f];
+                  }
+                }
+              }
             }
+          }
+        }
+      } else { // Use ParmDB
+        for (uint parmExprNum = 0; parmExprNum<itsParmExprs.size();++parmExprNum) {
+          // parmMap contains parameter values for all antennas
+          parmMap = itsParmDB->getValuesMap( itsParmExprs[parmExprNum] + "*",
+                                 minFreq, maxFreq, freqInterval,
+                                 bufStartTime-0.5*itsTimeInterval, itsLastTime,
+                                 itsTimeInterval, true);
+
+          // Resolve {Common,}Bla to CommonBla or Bla
+          if (!parmMap.empty() &&
+              itsParmExprs[parmExprNum].find("{") != std::string::npos) {
+            uint colonPos = (parmMap.begin()->first).find(":");
+            itsParmExprs[parmExprNum] = (parmMap.begin()->first).substr(0, colonPos);
+          }
 
-            parmvalues[parmExprNum][ant].resize(tfDomainSize);
-            for (uint tf=0; tf<tfDomainSize;++tf) {
-              parmvalues[parmExprNum][ant][tf]=defValue;
+          for (uint ant = 0; ant < numAnts; ++ant) {
+            parmIt = parmMap.find(
+                      itsParmExprs[parmExprNum] + ":" + info().antennaNames()[ant]);
+
+            if (parmIt != parmMap.end()) {
+              parmvalues[parmExprNum][ant].swap(parmIt->second);
+              ASSERT(parmvalues[parmExprNum][ant].size()==tfDomainSize);
+            } else {// No value found, try default
+              Array<double> defValues;
+              double defValue;
+
+              if (itsParmDB->getDefValues(itsParmExprs[parmExprNum] + ":" +
+                  info().antennaNames()[ant]).size()==1) { // Default for antenna
+                itsParmDB->getDefValues(itsParmExprs[parmExprNum] + ":" +
+                    info().antennaNames()[ant]).get(0,defValues);
+                ASSERT(defValues.size()==1);
+                defValue=defValues.data()[0];
+              }
+              else if (itsParmDB->getDefValues(itsParmExprs[parmExprNum]).size()
+                  == 1) { //Default value
+                itsParmDB->getDefValues(itsParmExprs[parmExprNum]).get(0,defValues);
+                ASSERT(defValues.size()==1);
+                defValue=defValues.data()[0];
+              } else if (itsParmExprs[parmExprNum].substr(0,5)=="Gain:") {
+                defValue=0.;
+              }
+              else {
+                THROW (Exception, "No parameter value found for "+
+                   itsParmExprs[parmExprNum]+":"+info().antennaNames()[ant]);
+              }
+
+              parmvalues[parmExprNum][ant].resize(tfDomainSize);
+              for (uint tf=0; tf<tfDomainSize;++tf) {
+                parmvalues[parmExprNum][ant][tf]=defValue;
+              }
             }
           }
         }
@@ -395,11 +515,11 @@ namespace LOFAR {
 
       // Make parameters complex
       for (uint tf=0;tf<tfDomainSize;++tf) {
-        for (int ant=0;ant<numAnts;++ant) {
+        for (uint ant=0;ant<numAnts;++ant) {
 
           freq=info().chanFreqs()[tf % numFreqs];
 
-          if (itsCorrectType=="gain") {
+          if (itsCorrectType==GAIN) {
             if (itsUseAP) { // Data as Amplitude / Phase
               itsParms(0, ant, tf) = polar(parmvalues[0][ant][tf],
                                            parmvalues[1][ant][tf]);
@@ -412,7 +532,7 @@ namespace LOFAR {
                                               parmvalues[3][ant][tf]);
             }
           }
-          else if (itsCorrectType=="fulljones") {
+          else if (itsCorrectType==FULLJONES) {
             if (itsUseAP) { // Data as Amplitude / Phase
               itsParms(0, ant, tf) = polar(parmvalues[0][ant][tf],
                                            parmvalues[1][ant][tf]);
@@ -433,7 +553,7 @@ namespace LOFAR {
                                               parmvalues[7][ant][tf]);
             }
           }
-          else if (itsCorrectType=="tec") {
+          else if (itsCorrectType==TEC) {
             itsParms(0, ant, tf)=polar(1.,
                 parmvalues[0][ant][tf] * -8.44797245e9 / freq);
             if (itsParmExprs.size() == 1) { // No TEC:0, only TEC:
@@ -445,7 +565,7 @@ namespace LOFAR {
                   parmvalues[1][ant][tf] * -8.44797245e9 / freq);
             }
           }
-          else if (itsCorrectType=="clock") {
+          else if (itsCorrectType==CLOCK) {
             itsParms(0, ant, tf)=polar(1.,
                 parmvalues[0][ant][tf] * freq * casacore::C::_2pi);
             if (itsParmExprs.size() == 1) { // No Clock:0, only Clock:
@@ -457,7 +577,7 @@ namespace LOFAR {
                   parmvalues[1][ant][tf] * freq * casacore::C::_2pi);
             }
           }
-          else if (itsCorrectType=="rotationangle") {
+          else if (itsCorrectType==ROTATIONANGLE) {
             double phi=parmvalues[0][ant][tf];
             if (itsInvert) {
               phi = -phi;
@@ -469,7 +589,7 @@ namespace LOFAR {
             itsParms(2, ant, tf) =  sinv;
             itsParms(3, ant, tf) =  cosv;
           }
-          else if (itsCorrectType=="rotationmeasure") {
+          else if (itsCorrectType==ROTATIONMEASURE) {
             double lambda2 = casacore::C::c / freq;
             lambda2 *= lambda2;
             double chi = parmvalues[0][ant][tf] * lambda2;
@@ -483,23 +603,52 @@ namespace LOFAR {
             itsParms(2, ant, tf) =  sinv;
             itsParms(3, ant, tf) =  cosv;
           }
-          else if (itsCorrectType=="scalarphase") {
+          else if (itsCorrectType==PHASE || itsCorrectType==SCALARPHASE) {
             itsParms(0, ant, tf) = polar(1., parmvalues[0][ant][tf]);
-            itsParms(1, ant, tf) = polar(1., parmvalues[0][ant][tf]);
+            if (itsCorrectType==SCALARPHASE) { // Same value for x and y
+              itsParms(1, ant, tf) = polar(1., parmvalues[0][ant][tf]);
+            } else { // Different value for x and y
+              itsParms(1, ant, tf) = polar(1., parmvalues[1][ant][tf]);
+            }
           }
-          else if (itsCorrectType=="scalaramplitude") {
+          else if (itsCorrectType==AMPLITUDE || itsCorrectType==SCALARAMPLITUDE) {
             itsParms(0, ant, tf) = parmvalues[0][ant][tf];
-            itsParms(1, ant, tf) = parmvalues[0][ant][tf];
+            if (itsCorrectType==SCALARAMPLITUDE) { // Same value for x and y
+              itsParms(1, ant, tf) = parmvalues[0][ant][tf];
+            } else { // Different value for x and y
+              itsParms(1, ant, tf) = parmvalues[1][ant][tf];
+            }
           }
 
-          // Invert (rotationmeasure and commonrotationangle are already inverted)
-          if (itsInvert && itsParms.shape()[0]==2) {
+          // Invert
+          if (itsInvert) {
+            if (itsParms.shape()[0]==2) {
             itsParms(0, ant, tf) = 1./itsParms(0, ant, tf);
             itsParms(1, ant, tf) = 1./itsParms(1, ant, tf);
+            } else if (itsCorrectType==FULLJONES) {
+              invert(&itsParms(0, ant, tf),itsSigmaMMSE);
+            } else {
+              ASSERT (itsCorrectType==ROTATIONMEASURE || itsCorrectType==ROTATIONANGLE);
+              // rotationmeasure and commonrotationangle are already inverted above
+            }
           }
-          else if (itsInvert && itsCorrectType=="fulljones") {
-            invert(&itsParms(0, ant, tf),itsSigmaMMSE);
-          }
+        }
+      }
+    }
+
+    uint ApplyCal::nPol(const string& parmName) {
+      if (itsUseH5Parm) {
+        if (!itsSolTab.hasAxis("pol")) {
+          return 1;
+        } else {
+          return itsSolTab.getAxis("pol").size;
+        }
+      } else { // Use ParmDB
+        if (itsParmDB->getNames(parmName+":0:*").empty() &&
+                    itsParmDB->getDefNames(parmName+":0:*").empty() ) {
+          return 1;
+        } else {
+          return 2;
         }
       }
     }
@@ -509,9 +658,9 @@ namespace LOFAR {
       uint tfDomainSize=itsTimeSlotsPerParmUpdate*info().chanFreqs().size();
 
       uint numParms;
-      if (itsCorrectType=="fulljones" || 
-          itsCorrectType=="rotationangle" || 
-          itsCorrectType=="rotationmeasure") {
+      if (itsCorrectType==FULLJONES ||
+          itsCorrectType==ROTATIONANGLE ||
+          itsCorrectType==ROTATIONMEASURE) {
         numParms = 4;
       }
       else {
diff --git a/CEP/DP3/DPPP/src/CMakeLists.txt b/CEP/DP3/DPPP/src/CMakeLists.txt
index b6e884ff2d7636809b9921599403d4a67c9df7d4..b2d33f4dcf6c7781c849c34e23265db818acf5e7 100644
--- a/CEP/DP3/DPPP/src/CMakeLists.txt
+++ b/CEP/DP3/DPPP/src/CMakeLists.txt
@@ -20,7 +20,7 @@ lofar_add_library(dppp
   DemixerNew.cc DemixInfo.cc DemixWorker.cc
   Predict.cc
   ApplyBeam.cc
-  phasefitter.cc H5Parm.cc
+  PhaseFitter.cc H5Parm.cc SolTab.cc DummyStep.cc H5ParmPredict.cc
 )
 
 lofar_add_bin_program(NDPPP NDPPP.cc)
diff --git a/CEP/DP3/DPPP/src/DPRun.cc b/CEP/DP3/DPPP/src/DPRun.cc
index 213a0e7c3f2ae0c834e9b5b091db917b14689f4b..b2c4c905dd29f9c989a9d6528287583e4087e918 100644
--- a/CEP/DP3/DPPP/src/DPRun.cc
+++ b/CEP/DP3/DPPP/src/DPRun.cc
@@ -41,6 +41,7 @@
 #include <DPPP/ScaleData.h>
 #include <DPPP/ApplyCal.h>
 #include <DPPP/Predict.h>
+#include <DPPP/H5ParmPredict.h>
 #include <DPPP/GainCal.h>
 #include <DPPP/Filter.h>
 #include <DPPP/Counter.h>
@@ -54,6 +55,7 @@
 #include <casacore/casa/OS/DirectoryIterator.h>
 #include <casacore/casa/OS/Timer.h>
 #include <casacore/casa/OS/DynLib.h>
+#include <casacore/casa/Utilities/Regex.h>
 
 namespace LOFAR {
   namespace DPPP {
@@ -280,8 +282,12 @@ namespace LOFAR {
       for (vector<string>::const_iterator iter = steps.begin();
            iter != steps.end(); ++iter) {
         string prefix(*iter + '.');
-        // The name is the default step type.
-        string type = toLower(parset.getString (prefix+"type", *iter));
+        // The alphabetic part of the name is the default step type.
+        // This allows names like average1, out3.
+        int res = casacore::Regex("[a-z]+").match((*iter).c_str(), (*iter).size());
+        string defaulttype = (*iter).substr(0,res);
+
+        string type = toLower(parset.getString (prefix+"type", defaulttype));
         // Define correct name for AOFlagger synonyms.
         if (type == "aoflagger"  ||  type == "rficonsole") {
           type = "aoflag";
@@ -312,6 +318,8 @@ namespace LOFAR {
           step = DPStep::ShPtr(new ApplyCal (reader, parset, prefix));
         } else if (type == "predict") {
           step = DPStep::ShPtr(new Predict (reader, parset, prefix));
+        } else if (type == "h5parmpredict") {
+          step = DPStep::ShPtr(new H5ParmPredict (reader, parset, prefix));
         } else if (type == "applybeam") {
           step = DPStep::ShPtr(new ApplyBeam (reader, parset, prefix));
         } else if (type == "gaincal"  ||  type == "calibrate") {
diff --git a/CEP/DP3/DPPP/src/DummyStep.cc b/CEP/DP3/DPPP/src/DummyStep.cc
new file mode 100644
index 0000000000000000000000000000000000000000..68bab17a8685e76a142d4f8756ee4edf50017c3b
--- /dev/null
+++ b/CEP/DP3/DPPP/src/DummyStep.cc
@@ -0,0 +1,91 @@
+//# GainCal.cc: DPPP step class to DummyStep visibilities
+//# Copyright (C) 2013
+//# ASTRON (Netherlands Institute for Radio Astronomy)
+//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
+//#
+//# This file is part of the LOFAR software suite.
+//# The LOFAR software suite 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 3 of the License, or
+//# (at your option) any later version.
+//#
+//# The LOFAR software suite 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 the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
+//#
+//# $Id: GainCal.cc 21598 2012-07-16 08:07:34Z diepen $
+//#
+//# @author Tammo Jan Dijkema
+
+#include <lofar_config.h>
+#include <DPPP/DummyStep.h>
+
+#include <iostream>
+#include <Common/ParameterSet.h>
+#include <Common/Timer.h>
+
+#include <stddef.h>
+#include <string>
+#include <sstream>
+#include <utility>
+#include <vector>
+
+using namespace casacore;
+using namespace LOFAR::BBS;
+
+namespace LOFAR {
+  namespace DPPP {
+
+    DummyStep::DummyStep (DPInput* input,
+                      const ParameterSet& parset,
+                      const string& prefix)
+    {
+
+    }
+
+    DummyStep::~DummyStep()
+    {}
+
+    void DummyStep::updateInfo (const DPInfo& infoIn)
+    {
+      info() = infoIn;
+      info().setNeedVisData();
+      info().setWriteData();
+    }
+
+    void DummyStep::show (std::ostream& os) const
+    {
+      os << "DummyStep " << itsName << endl;
+    }
+
+    void DummyStep::showTimings (std::ostream& os, double duration) const
+    {
+      os << "  ";
+      FlagCounter::showPerc1 (os, itsTimer.getElapsed(), duration);
+      os << " DummyStep " << itsName << endl;
+    }
+
+    bool DummyStep::process (const DPBuffer& bufin)
+    {
+      itsTimer.start();
+      itsBuffer.copy (bufin);
+      itsInput->fetchUVW(bufin, itsBuffer, itsTimer);
+      itsInput->fetchWeights(bufin, itsBuffer, itsTimer);
+
+      itsTimer.stop();
+      getNextStep()->process(itsBuffer);
+      return false;
+    }
+
+
+    void DummyStep::finish()
+    {
+      // Let the next steps finish.
+      getNextStep()->finish();
+    }
+  } //# end namespace
+}
diff --git a/CEP/DP3/DPPP/src/GainCal.cc b/CEP/DP3/DPPP/src/GainCal.cc
index ee6570a9f2e43121ee4d0fe1a4b82433a0d370f1..967ab895d59ce5ecf221a727788d2bfd21b80335 100644
--- a/CEP/DP3/DPPP/src/GainCal.cc
+++ b/CEP/DP3/DPPP/src/GainCal.cc
@@ -25,7 +25,7 @@
 #include <DPPP/GainCal.h>
 #include <DPPP/Simulate.h>
 #include <DPPP/ApplyCal.h>
-#include <DPPP/phasefitter.h>
+#include <DPPP/PhaseFitter.h>
 #include <DPPP/CursorUtilCasa.h>
 #include <DPPP/DPBuffer.h>
 #include <DPPP/DPInfo.h>
@@ -133,8 +133,9 @@ namespace LOFAR {
 
     GainCal::CalType GainCal::stringToCalType(const string &modestr) {
       if (modestr=="diagonal"||modestr=="complexgain") return COMPLEXGAIN;
-      else if (modestr=="phaseonly") return PHASEONLY;
+      else if (modestr=="scalarcomplexgain") return SCALARCOMPLEXGAIN;
       else if (modestr=="fulljones") return FULLJONES;
+      else if (modestr=="phaseonly") return PHASEONLY;
       else if (modestr=="scalarphase") return SCALARPHASE;
       else if (modestr=="amplitudeonly") return AMPLITUDEONLY;
       else if (modestr=="scalaramplitude") return SCALARAMPLITUDE;
@@ -145,16 +146,20 @@ namespace LOFAR {
     }
 
     string GainCal::calTypeToString(GainCal::CalType caltype) {
-      if (caltype==COMPLEXGAIN) return "complexgain";
-      else if (caltype==PHASEONLY) return "phaseonly";
-      else if (caltype==FULLJONES) return "fulljones";
-      else if (caltype==SCALARPHASE) return "scalarphase";
-      else if (caltype==AMPLITUDEONLY) return "amplitudeonly";
-      else if (caltype==SCALARAMPLITUDE) return "scalaramplitude";
-      else if (caltype==TECANDPHASE) return "tecandphase";
-      else if (caltype==TEC) return "tec";
-      else if (caltype==TECSCREEN) return "tecscreen";
-      THROW(Exception, "Unknown caltype: "<< caltype);
+      switch(caltype)
+      {
+        case COMPLEXGAIN: return "complexgain";
+        case SCALARCOMPLEXGAIN: return "scalarcomplexgain";
+        case FULLJONES: return "fulljones";
+        case PHASEONLY: return "phaseonly";
+        case SCALARPHASE: return "scalarphase";
+        case AMPLITUDEONLY: return "amplitudeonly";
+        case SCALARAMPLITUDE: return "scalaramplitude";
+        case TECANDPHASE: return "tecandphase";
+        case TEC: return "tec";
+        case TECSCREEN: return "tecscreen";
+        default: THROW(Exception, "Unknown caltype: "<< caltype);
+      }
     }
 
     void GainCal::setAntennaUsed() {
@@ -510,7 +515,8 @@ namespace LOFAR {
                                 const casacore::Bool* flag) {
       const size_t nBl = info().nbaselines();
       const size_t nCh = info().nchan();
-      const size_t nCr = 4;
+      const size_t nCr = info().ncorr();
+      ASSERT(nCr==4 || nCr==2 || nCr==1);
 
       for (uint ch=0;ch<nCh;++ch) {
         for (uint bl=0;bl<nBl;++bl) {
@@ -530,18 +536,20 @@ namespace LOFAR {
             }
 
             for (uint cr=0;cr<nCr;++cr) {
-              iS[ch/itsNChan].getVis() (IPosition(6,ant1,cr/2,itsStepInSolInt,ch%itsNChan,cr%2,ant2)) =
+              // The nCrDiv is there such that for nCr==2 the visibilities end up at (0,0) for cr==0, (1,1) for cr==1
+              uint nCrDiv = (nCr==4?2:1);
+              iS[ch/itsNChan].getVis() (IPosition(6,ant1,cr/nCrDiv,itsStepInSolInt,ch%itsNChan,cr%2,ant2)) =
                   DComplex(data [bl*nCr*nCh+ch*nCr+cr]) *
                   DComplex(sqrt(weight[bl*nCr*nCh+ch*nCr+cr]));
-              iS[ch/itsNChan].getMVis()(IPosition(6,ant1,cr/2,itsStepInSolInt,ch%itsNChan,cr%2,ant2)) =
+              iS[ch/itsNChan].getMVis()(IPosition(6,ant1,cr/nCrDiv,itsStepInSolInt,ch%itsNChan,cr%2,ant2)) =
                   DComplex(model[bl*nCr*nCh+ch*nCr+cr]) *
                   DComplex(sqrt(weight[bl*nCr*nCh+ch*nCr+cr]));
 
               // conjugate transpose
-              iS[ch/itsNChan].getVis() (IPosition(6,ant2,cr%2,itsStepInSolInt,ch%itsNChan,cr/2,ant1)) =
+              iS[ch/itsNChan].getVis() (IPosition(6,ant2,cr%2,itsStepInSolInt,ch%itsNChan,cr/nCrDiv,ant1)) =
                   DComplex(conj(data [bl*nCr*nCh+ch*nCr+cr])) *
                   DComplex(sqrt(weight[bl*nCr*nCh+ch*nCr+cr]));
-              iS[ch/itsNChan].getMVis()(IPosition(6,ant2,cr%2,itsStepInSolInt,ch%itsNChan,cr/2,ant1)) =
+              iS[ch/itsNChan].getMVis()(IPosition(6,ant2,cr%2,itsStepInSolInt,ch%itsNChan,cr/nCrDiv,ant1)) =
                   DComplex(conj(model[bl*nCr*nCh+ch*nCr+cr] )) *
                   DComplex(sqrt(weight[bl*nCr*nCh+ch*nCr+cr]));
             }
diff --git a/CEP/DP3/DPPP/src/H5Parm.cc b/CEP/DP3/DPPP/src/H5Parm.cc
index 472ce230dff59a43f9fc29c9b04be9b09af55611..16b0573c0222bc084a563fdc10d8ff9cf5fba390 100644
--- a/CEP/DP3/DPPP/src/H5Parm.cc
+++ b/CEP/DP3/DPPP/src/H5Parm.cc
@@ -1,29 +1,95 @@
 #include <lofar_config.h>
 #include <DPPP/H5Parm.h>
 #include <Common/Exception.h>
+#include <Common/StringUtil.h>
+#include <Common/LofarLogger.h>
 #include <cstring>
-#include <iostream>
+#include <complex>
+#include <sstream>
+#include <iomanip>
+#include <sys/stat.h>
+
+#include <hdf5.h>
+
+using namespace std;
 
 namespace LOFAR {
-  H5Parm::H5Parm(const std::string& filename) {
-    // ACC_EXCL to give error when file already exists.
-    try {
-//      H5::Exception::dontPrint();
-      _hdf5file = H5::H5File(filename, H5F_ACC_TRUNC);
-    }
-    catch (H5::FileIException err) {
-      throw Exception ("H5Parm: not able to open file "+filename+" for writing, does it exist already?");
+  H5Parm::H5Parm(const std::string& filename, bool forceNewSolSet,
+                 const std::string& solSetName):
+      H5::H5File(filename,
+                 access(filename.c_str(),F_OK)!=-1?H5F_ACC_RDWR:H5F_ACC_TRUNC
+                )
+  {
+    if (forceNewSolSet || getNumObjs()==0) { // Create a new solSet
+      if (solSetName=="") {
+        // Get the name of first non-existing solset
+        stringstream newSolSetName;
+        H5::Group tryGroup;
+        for (uint solSetNum=0; solSetNum<100; ++solSetNum) {
+          try {
+            H5::Exception::dontPrint();
+            newSolSetName<<"sol"<<setfill('0')<<setw(3)<<solSetNum;
+            tryGroup = openGroup(newSolSetName.str());
+            newSolSetName.str("");
+          }
+          catch (H5::FileIException& not_found_error ) {
+            // solSetName does not exist yet
+            break;
+          }
+          tryGroup.close();
+        }
+        _solSet = createGroup("/"+newSolSetName.str(), H5P_DEFAULT);
+      } else {
+        // Create solset with the given name
+        _solSet = createGroup("/"+solSetName, H5P_DEFAULT);
+      }
+      addVersionStamp(_solSet);
+    } else {
+      string solSetNameToOpen=solSetName;
+      if (solSetNameToOpen=="") {
+        if (this->getNumObjs()==1) {
+          solSetNameToOpen=this->getObjnameByIdx(0);
+        } else {
+          THROW(Exception, "H5Parm "<<filename<<" contains more than one SolSet, "<<
+              "please specify which one to use.");
+        }
+      }
+
+      _solSet = openGroup(solSetNameToOpen);
+
+      vector<string> solTabNames;
+      for (uint i=0; i<_solSet.getNumObjs();++i) {
+        if (_solSet.getObjTypeByIdx(i)==H5G_GROUP) {
+          solTabNames.push_back(_solSet.getObjnameByIdx(i));
+        }
+      }
+
+      for (vector<string>::iterator solTabName=solTabNames.begin();
+           solTabName!=solTabNames.end(); ++solTabName) {
+        H5::Group group = _solSet.openGroup(*solTabName);
+        _solTabs.insert(
+            std::map<std::string, SolTab>::value_type (*solTabName, SolTab(group)));
+      }
     }
+  }
 
-    // Make a new group
-    _solSet = _hdf5file.createGroup("/sol000", H5P_DEFAULT);
 
-    addVersionStamp(_solSet);
+  H5Parm::H5Parm() {
   }
 
   H5Parm::~H5Parm() {
+    // Throw an error if the antenna or source table is not present
+    //_solSet.openDataSet("antenna");
+    //_solSet.openDataSet("source");
     _solSet.close();
-    _hdf5file.close();
+  }
+
+  string H5Parm::getSolSetName() const {
+    char buffer[100];
+    hsize_t namelen = H5Iget_name(_solSet.getId(),buffer,100);
+    buffer[namelen+1]=0;
+    // Strip leading '/'
+    return buffer+1;
   }
 
   void H5Parm::addVersionStamp(H5::Group &node) {
@@ -40,8 +106,7 @@ namespace LOFAR {
 
     // Create data type
     dims[0]=2;  // For ra, dec in directions
-    source_t tmp;
-    H5::CompType sourceType(sizeof tmp);
+    H5::CompType sourceType(sizeof(source_t));
     sourceType.insertMember("name", HOFFSET(antenna_t, name), H5::StrType(H5::PredType::C_S1, 128));
     sourceType.insertMember("dir", HOFFSET(source_t, dir), H5::ArrayType(H5::PredType::NATIVE_FLOAT, 1, dims));
 
@@ -68,8 +133,7 @@ namespace LOFAR {
 
     // Create data type
     dims[0]=3;  // For x,y,z in positions
-    antenna_t tmp;
-    H5::CompType antennaType(sizeof tmp);
+    H5::CompType antennaType(sizeof(antenna_t));
     antennaType.insertMember("name", HOFFSET(antenna_t, name), H5::StrType(H5::PredType::C_S1, 16));
     antennaType.insertMember("position", HOFFSET(antenna_t, position), H5::ArrayType(H5::PredType::NATIVE_FLOAT, 1, dims));
 
@@ -82,143 +146,57 @@ namespace LOFAR {
     vector<antenna_t> ants(names.size());
     for (uint ant=0; ant<ants.size(); ++ant) {
       std::strncpy(ants[ant].name, names[ant].c_str(), 16);
-      std::vector<double> pos = positions[ant];
-      ants[ant].position[0]=pos[0];
-      ants[ant].position[1]=pos[1];
-      ants[ant].position[2]=pos[2];
+      const std::vector<double>& pos = positions[ant];
+      ants[ant].position[0] = pos[0];
+      ants[ant].position[1] = pos[1];
+      ants[ant].position[2] = pos[2];
     }
 
     dataset.write(&(ants[0]), antennaType);
   }
 
-  void H5Parm::addSolution (const std::string& solName,
-                            const std::string& solType,
-                            const std::string& axesstr,
-                            const std::vector<hsize_t>& dims,
-                            const std::vector<double>& vals,
-                            const std::vector<double>& weights) {
-    H5::Group solTab = _solSet.createGroup(solName);
-    H5::Attribute attr = solTab.createAttribute("TITLE",
-                                H5::StrType(H5::PredType::C_S1, solType.size()),
-                                H5::DataSpace());
-    attr.write(H5::StrType(H5::PredType::C_S1, solType.size()), solType);
-    addVersionStamp(solTab);
-
-    // ASSERT dims product == vals.size()
-    // ASSERT dims.size() - 1 == aantal komma's in axesstr
-
-    H5::DataSpace dataspace(dims.size(), &(dims[0]), NULL);
-    H5::DataSet dataset = solTab.createDataSet("val", 
-                                           H5::PredType::IEEE_F64LE, dataspace);
-
-    dataset.write(&(vals[0]), H5::PredType::IEEE_F64LE);
-
-    // Write an attribute with the axes
-    attr = dataset.createAttribute("AXES",
-                             H5::StrType(H5::PredType::C_S1, axesstr.size()),
-                             H5::DataSpace());
-    attr.write(H5::StrType(H5::PredType::C_S1, axesstr.size()), axesstr);
-
-    // Add weights
-    H5::DataSet weightset = solTab.createDataSet("weight", H5::PredType::IEEE_F64LE, dataspace);
-
-    // If weights are empty, write ones everywhere
-    if (weights.empty()) {
-      vector<double> fullweights(vals.size(), 1);
-      weightset.write(&(fullweights[0]), H5::PredType::IEEE_F64LE);
-    } else {
-      weightset.write(&(weights[0]), H5::PredType::IEEE_F64LE);
-    }
-
-    attr = weightset.createAttribute("AXES",
-                             H5::StrType(H5::PredType::C_S1, axesstr.size()),
-                             H5::DataSpace());
-    attr.write(H5::StrType(H5::PredType::C_S1, axesstr.size()), axesstr);
-  }
-
-  void H5Parm::addSolution (const std::string& solName,
-                            const std::string& solType,
-                            const std::string& axesstr,
-                            const std::vector<hsize_t>& dims,
-                            const std::vector<std::complex<double> >& vals,
-                            const std::vector<double>& weights,
-                            bool toAmplitudes) {
-    // Convert values to real numbers by taking amplitude or argument
-    vector<double> realvals(vals.size());
-
-    if (toAmplitudes) {
-      transform(vals.begin(), vals.end(), realvals.begin(), takeAbs);
-    } else { // Phase only
-      transform(vals.begin(), vals.end(), realvals.begin(), takeArg);
-    }
-
-    addSolution(solName, solType, axesstr, dims, realvals, weights);
-  }
-
-  void H5Parm::setSolAntennas(const std::string& solName,
-                              const std::vector<std::string>& solAntennas) {
-    H5::Group solTab(_solSet.openGroup(solName));
-
-    // TODO: assert that antenna is present in antenna table in solution set
+  void H5Parm::addPolarizations (const std::vector<std::string>& polarizations) {
     hsize_t dims[1];
-    dims[0]=solAntennas.size();
+
+    // Create data type
+    dims[0]=1;  // Only a name
+    H5::CompType polarizationType(sizeof(polarization_t));
+    polarizationType.insertMember("name", HOFFSET(polarization_t, name), H5::StrType(H5::PredType::C_S1, 2));
 
     // Create dataset
+    dims[0] = polarizations.size();
     H5::DataSpace dataspace(1, dims, NULL);
-    H5::DataSet dataset = solTab.createDataSet("ant", H5::StrType(H5::PredType::C_S1, 16), dataspace);
+    H5::DataSet dataset = _solSet.createDataSet("polarization", polarizationType, dataspace);
 
     // Prepare data
-    char antArray[solAntennas.size()][16];
-    for (uint i=0; i<solAntennas.size(); ++i) {
-      std::strncpy(antArray[i], solAntennas[i].c_str(), 16);
+    vector<polarization_t> pols(polarizations.size());
+    for (uint p=0; p!=polarizations.size(); ++p) {
+      std::strncpy(pols[p].name, polarizations[p].c_str(), 2);
     }
 
-    dataset.write(antArray, H5::StrType(H5::PredType::C_S1, 16));
+    dataset.write(pols.data(), polarizationType);
   }
 
-  void H5Parm::setSolSources(const std::string& solName,
-                             const std::vector<std::string>& solSources) {
-    H5::Group solTab(_solSet.openGroup(solName));
-    // TODO: assert that source is present in source table of solution set
-    hsize_t dims[1];
-    dims[0]=solSources.size();
-
-    // Create dataset
-    H5::DataSpace dataspace(1, dims, NULL);
-    H5::DataSet dataset = solTab.createDataSet("dir", H5::StrType(H5::PredType::C_S1, 128), dataspace);
-
-    // Prepare data
-    char srcArray[solSources.size()][128];
-    for (uint i=0; i<solSources.size(); ++i) {
-      std::strncpy(srcArray[i], solSources[i].c_str(), 128);
+  H5Parm::SolTab& H5Parm::getSolTab(const std::string& name) {
+    std::map<std::string, SolTab>::iterator item =
+      _solTabs.find(name);
+    if (item == _solTabs.end()) {
+      THROW(Exception, "SolTab "<<name<<" does not exist in solset "<<
+                       getSolSetName());
     }
-
-    dataset.write(srcArray, H5::StrType(H5::PredType::C_S1, 128));
+    return item->second;
   }
 
-  void H5Parm::setFreqs(const std::string& solName,
-                        const std::vector<double>& freqs) {
-    H5::Group solTab(_solSet.openGroup(solName));
-    hsize_t dims[1];
-    dims[0]=freqs.size();
-
-    // Create dataset
-    H5::DataSpace dataspace(1, dims, NULL);
-    H5::DataSet dataset = solTab.createDataSet("freq", H5::PredType::IEEE_F64LE, dataspace);
-
-    dataset.write(&(freqs[0]), H5::PredType::IEEE_F64LE);
+  bool H5Parm::hasSolTab(const string& solTabName) const {
+    return _solTabs.find(solTabName) != _solTabs.end();
   }
 
-  void H5Parm::setTimes(const std::string& solName,
-                        const std::vector<double>& times) {
-    H5::Group solTab(_solSet.openGroup(solName));
-    hsize_t dims[1];
-    dims[0]=times.size();
-
-    // Create dataset
-    H5::DataSpace dataspace(1, dims, NULL);
-    H5::DataSet dataset = solTab.createDataSet("time", H5::PredType::IEEE_F64LE, dataspace);
-
-    dataset.write(&(times[0]), H5::PredType::IEEE_F64LE);
+  H5Parm::SolTab& H5Parm::createSolTab(const std::string& name,
+                                       const std::string& type,
+                                       const std::vector<H5Parm::AxisInfo> axes) {
+    H5::Group newgroup = _solSet.createGroup(name);
+    std::map<std::string, SolTab>::iterator newItem =
+      _solTabs.insert(std::make_pair(name, SolTab(newgroup, type, axes))).first;
+    return newItem->second;
   }
 }
diff --git a/CEP/DP3/DPPP/src/H5ParmPredict.cc b/CEP/DP3/DPPP/src/H5ParmPredict.cc
new file mode 100644
index 0000000000000000000000000000000000000000..8714455202a60bdbd2938acfe262fa0d0978d867
--- /dev/null
+++ b/CEP/DP3/DPPP/src/H5ParmPredict.cc
@@ -0,0 +1,143 @@
+//# GainCal.cc: DPPP step class to H5ParmPredict visibilities
+//# Copyright (C) 2013
+//# ASTRON (Netherlands Institute for Radio Astronomy)
+//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
+//#
+//# This file is part of the LOFAR software suite.
+//# The LOFAR software suite 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 3 of the License, or
+//# (at your option) any later version.
+//#
+//# The LOFAR software suite 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 the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
+//#
+//# $Id: GainCal.cc 21598 2012-07-16 08:07:34Z diepen $
+//#
+//# @author Tammo Jan Dijkema
+
+#include <lofar_config.h>
+#include <DPPP/H5ParmPredict.h>
+
+#include <iostream>
+#include <Common/ParameterSet.h>
+#include <Common/Timer.h>
+
+#include <stddef.h>
+#include <string>
+#include <sstream>
+#include <utility>
+#include <vector>
+
+#include <Common/StreamUtil.h>
+#include <Common/StringUtil.h>
+
+using namespace casacore;
+using namespace LOFAR::BBS;
+
+namespace LOFAR {
+  namespace DPPP {
+
+    H5ParmPredict::H5ParmPredict (DPInput* input,
+                      const ParameterSet& parset,
+                      const string& prefix):
+                          itsInput(input),
+                          itsH5ParmName(parset.getString(prefix+"applycal.parmdb")),
+                          itsDirections(parset.getStringVector(
+                              prefix+"directions", vector<string> ()))
+    {
+      H5Parm h5parm = H5Parm(itsH5ParmName, false);
+      H5Parm::SolTab soltab = h5parm.getSolTab(parset.getString(prefix+"applycal.correction"));
+
+      vector<string> h5directions = soltab.getStringAxis("dir");
+
+      if (itsDirections.empty()) {
+        itsDirections = h5directions;
+      } else {
+        for (vector<string>::iterator it = itsDirections.begin();
+          // Check that all specified directions are in the h5parm
+          it != itsDirections.end(); ++it) {
+          if (find(h5directions.begin(), h5directions.end(), *it) ==
+              h5directions.end()) {
+            THROW(Exception, "Direction "<<*it<<" not found in "<<itsH5ParmName);
+          }
+        }
+      }
+
+      for (uint i=0; i<itsDirections.size(); ++i) {
+        string directionStr = itsDirections[i];
+        vector<string> directionVec; // each direction should be like '[patch1,patch2]'
+        ASSERT(directionStr.size()>2 && directionStr[0]=='[' &&
+               directionStr[directionStr.size()-1]==']');
+        directionVec = StringUtil::tokenize(directionStr.substr(1, directionStr.size()-2), ",");
+        Predict* predictStep = new Predict(input, parset, prefix, directionVec);
+
+        itsPredictSteps.push_back(Predict::ShPtr(predictStep));
+        if (i>0) {
+          itsPredictSteps[i-1]->setNextStep(itsPredictSteps[i]);
+        }
+      }
+
+      itsResultStep=new ResultStep();
+      itsPredictSteps[itsPredictSteps.size()-1]->setNextStep(DPStep::ShPtr(itsResultStep));
+    }
+
+    H5ParmPredict::~H5ParmPredict()
+    {}
+
+    void H5ParmPredict::updateInfo (const DPInfo& infoIn)
+    {
+      info() = infoIn;
+      info().setNeedVisData();
+      info().setWriteData();
+
+      vector<Predict::ShPtr>::iterator predictstep;
+      for (predictstep=itsPredictSteps.begin();
+           predictstep!=itsPredictSteps.end();
+           predictstep++) {
+        (*predictstep)->updateInfo(infoIn);
+      }
+    }
+
+    void H5ParmPredict::show (std::ostream& os) const
+    {
+      os << "H5ParmPredict " << itsName << endl;
+      os << "  H5Parm:     " << itsH5ParmName << endl;
+      os << "  directions: " << itsDirections << endl;
+    }
+
+    void H5ParmPredict::showTimings (std::ostream& os, double duration) const
+    {
+      os << "  ";
+      FlagCounter::showPerc1 (os, itsTimer.getElapsed(), duration);
+      os << " H5ParmPredict " << itsName << endl;
+    }
+
+    bool H5ParmPredict::process (const DPBuffer& bufin)
+    {
+      itsTimer.start();
+      itsBuffer.copy (bufin);
+      itsInput->fetchUVW(bufin, itsBuffer, itsTimer);
+      itsInput->fetchWeights(bufin, itsBuffer, itsTimer);
+
+      itsPredictSteps[0]->process(itsBuffer);
+      itsBuffer = itsResultStep->get();
+
+      itsTimer.stop();
+      getNextStep()->process(itsBuffer);
+      return false;
+    }
+
+
+    void H5ParmPredict::finish()
+    {
+      // Let the next steps finish.
+      getNextStep()->finish();
+    }
+  } //# end namespace
+}
diff --git a/CEP/DP3/DPPP/src/NDPPP.cc b/CEP/DP3/DPPP/src/NDPPP.cc
index 94e70a024c9977485cd3dad6f453915de8516b68..17a3ad8ba7f9e12cb57abb2836401cd9ce5d6660 100644
--- a/CEP/DP3/DPPP/src/NDPPP.cc
+++ b/CEP/DP3/DPPP/src/NDPPP.cc
@@ -50,7 +50,7 @@ void showUsage() {
     "\"NDPPP.parset\" or \"DPPP.parset\" as a default."<<std::endl;
   std::cout<<"-v will show version info and exit."<<std::endl;
   std::cout<<"Documentation is at http://www.lofar.org/wiki/doku.php?id="<<
-    "public:user_software:ndppp"<<std::endl;
+    "public:user_software:documentation:ndppp"<<std::endl;
 }
 
 int main(int argc, char *argv[])
diff --git a/CEP/DP3/DPPP/src/phasefitter.cc b/CEP/DP3/DPPP/src/PhaseFitter.cc
similarity index 99%
rename from CEP/DP3/DPPP/src/phasefitter.cc
rename to CEP/DP3/DPPP/src/PhaseFitter.cc
index 116112adfb30e8bb56f5bf70ee53190718b8239d..2dedc40c0b1ce10b2db28b45208ca1b824721819 100644
--- a/CEP/DP3/DPPP/src/phasefitter.cc
+++ b/CEP/DP3/DPPP/src/PhaseFitter.cc
@@ -22,10 +22,10 @@
 //# @author Andre Offringa
 
 #ifdef AOPROJECT
-#include "phasefitter.h"
+#include "PhaseFitter.h"
 #else
 #include <lofar_config.h>
-#include <DPPP/phasefitter.h>
+#include <DPPP/PhaseFitter.h>
 #endif
 
 #include <limits>
diff --git a/CEP/DP3/DPPP/src/Predict.cc b/CEP/DP3/DPPP/src/Predict.cc
index 1603f950ac39067ed408a417a56318ad4ba32267..fe4019c9bb1549fd8c1c603d8fc16d432e5b22d0 100644
--- a/CEP/DP3/DPPP/src/Predict.cc
+++ b/CEP/DP3/DPPP/src/Predict.cc
@@ -29,6 +29,7 @@
 #include <Common/ParameterSet.h>
 #include <Common/Timer.h>
 #include <Common/OpenMP.h>
+#include <Common/StreamUtil.h>
 #include <ParmDB/ParmDBMeta.h>
 #include <ParmDB/PatchInfo.h>
 #include <DPPP/DPInfo.h>
@@ -92,6 +93,11 @@ namespace LOFAR {
       ASSERT(File(itsSourceDBName).exists());
       BBS::SourceDB sourceDB(BBS::ParmDBMeta("", itsSourceDBName), false);
 
+      // Save directions specifications to pass to applycal
+      stringstream ss;
+      ss << sourcePatterns;
+      itsDirectionsStr = ss.str();
+
       vector<string> patchNames=makePatchList(sourceDB, sourcePatterns);
       itsPatchList = makePatches (sourceDB, patchNames, patchNames.size());
 
@@ -120,13 +126,10 @@ namespace LOFAR {
         }
       }
 
+      // If called from h5parmpredict, applycal gets set by that step,
+      // so must not be read from parset
       if (parset.isDefined(prefix + "applycal.parmdb")) {
-        itsDoApplyCal=true;
-        itsApplyCalStep=ApplyCal(input, parset, prefix + "applycal.", true);
-        ASSERT(!(itsOperation!="replace" &&
-                 parset.getBool(prefix + "applycal.updateweights", false)));
-        itsResultStep=new ResultStep();
-        itsApplyCalStep.setNextStep(DPStep::ShPtr(itsResultStep));
+        setApplyCal(input, parset, prefix + "applycal.");
       } else {
         itsDoApplyCal=false;
       }
@@ -142,6 +145,18 @@ namespace LOFAR {
       }
     }
 
+    void Predict::setApplyCal(DPInput* input,
+                              const ParameterSet& parset,
+                              const string& prefix) {
+      itsDoApplyCal=true;
+      itsApplyCalStep=ApplyCal(input, parset, prefix, true,
+                               itsDirectionsStr);
+      ASSERT(!(itsOperation!="replace" &&
+               parset.getBool(prefix + "applycal.updateweights", false)));
+      itsResultStep=new ResultStep();
+      itsApplyCalStep.setNextStep(DPStep::ShPtr(itsResultStep));
+    }
+
     Predict::Predict()
     {}
 
@@ -260,7 +275,7 @@ namespace LOFAR {
       const size_t nSt = info().nantenna();
       const size_t nBl = info().nbaselines();
       const size_t nCh = info().nchan();
-      const size_t nCr = 4;
+      const size_t nCr = info().ncorr();
       const size_t nSamples = nBl * nCh * nCr;
 
       double time = itsTempBuffer.getTime();
diff --git a/CEP/DP3/DPPP/src/SolTab.cc b/CEP/DP3/DPPP/src/SolTab.cc
new file mode 100644
index 0000000000000000000000000000000000000000..6cfc6b139bf08d522cf3b70702c7b207ca90ec75
--- /dev/null
+++ b/CEP/DP3/DPPP/src/SolTab.cc
@@ -0,0 +1,456 @@
+#include <lofar_config.h>
+#include <DPPP/H5Parm.h>
+#include <Common/Exception.h>
+#include <Common/StringUtil.h>
+#include <Common/LofarLogger.h>
+#include <stdlib.h>
+#include <cstring>
+#include <iostream>
+#include <iomanip>
+
+#include <hdf5.h>
+
+using namespace std;
+
+namespace LOFAR {
+  H5Parm::SolTab::SolTab(H5::Group group,
+                         const std::string& type,
+                         const std::vector<AxisInfo> axes):
+                           H5::Group(group),
+                           _type(type),
+                           _axes(axes)
+  {
+    H5::Attribute attr = createAttribute("TITLE",
+                             H5::StrType(H5::PredType::C_S1, _type.size()),
+                             H5::DataSpace());
+    attr.write(H5::StrType(H5::PredType::C_S1, _type.size()), _type);
+    addVersionStamp(*this);
+  }
+
+  H5Parm::SolTab::SolTab(H5::Group& group):
+    H5::Group(group)
+  {
+    // Read the type from the "TITLE" attribute
+    H5::Attribute typeattr = openAttribute("TITLE");
+    hsize_t typenamelen = typeattr.getDataType().getSize();
+    char typecstr[typenamelen+1];
+    typecstr[typenamelen]='\0';
+    typeattr.read(typeattr.getDataType(), &typecstr);
+    _type = typecstr;
+
+    readAxes();
+  }
+
+  H5Parm::SolTab::~SolTab() {
+  }
+
+  H5Parm::AxisInfo H5Parm::SolTab::getAxis(uint i) {
+    return _axes[i];
+  }
+
+  H5Parm::AxisInfo H5Parm::SolTab::getAxis(const std::string& axisName) {
+    for (uint i=0; i<_axes.size(); ++i) {
+      if (_axes[i].name == axisName) {
+        return _axes[i];
+      }
+    }
+    THROW(Exception, "Axis "<<axisName<<" does not exist in "<<getName());
+  }
+
+  bool H5Parm::SolTab::hasAxis(const string& axisName) {
+    for (size_t i=0; i<_axes.size(); ++i) {
+      if (_axes[i].name==axisName)
+        return true;
+    }
+    return false;
+  }
+
+  size_t H5Parm::SolTab::getAxisIndex(const std::string& axisName) {
+    for (uint i=0; i<_axes.size(); ++i) {
+      if (_axes[i].name == axisName) {
+        return i;
+      }
+    }
+    THROW(Exception, "Axis "<<axisName<<" does not exist in "<<getName());
+  }
+
+  void H5Parm::SolTab::setValues(const std::vector<double>& vals,
+                                 const std::vector<double>& weights) {
+    // Convert axes to comma separated string, fill dims
+    size_t expectedsize = 1;
+    string axesstr = _axes[0].name;
+    vector<hsize_t> dims(_axes.size());
+    for (uint i=0; i<_axes.size(); ++i) {
+      dims[i] = _axes[i].size;
+      expectedsize *= dims[i];
+      if (i>0) {
+        axesstr += ","+_axes[i].name;
+      }
+    }
+
+    ASSERTSTR(expectedsize == vals.size(), "Values for H5Parm do not have the expected size: they have size "<<vals.size()<<", expected is "<<expectedsize);
+
+    H5::DataSpace dataspace(dims.size(), &(dims[0]), NULL);
+    H5::DataSet dataset = createDataSet("val", H5::PredType::IEEE_F64LE,
+                                        dataspace);
+
+    dataset.write(&(vals[0]), H5::PredType::IEEE_F64LE);
+
+    H5::Attribute attr = dataset.createAttribute("AXES",
+                             H5::StrType(H5::PredType::C_S1, axesstr.size()),
+                             H5::DataSpace());
+    attr.write(H5::StrType(H5::PredType::C_S1, axesstr.size()), axesstr);
+
+    // Add weights
+    H5::DataSet weightset = createDataSet("weight", H5::PredType::IEEE_F64LE,
+                                          dataspace);
+
+    // If weights are empty, write ones everywhere
+    if (weights.empty()) {
+      vector<double> fullweights(vals.size(), 1);
+      weightset.write(&(fullweights[0]), H5::PredType::IEEE_F64LE);
+    } else {
+      weightset.write(&(weights[0]), H5::PredType::IEEE_F64LE);
+    }
+
+    attr = weightset.createAttribute("AXES",
+                             H5::StrType(H5::PredType::C_S1, axesstr.size()),
+                             H5::DataSpace());
+    attr.write(H5::StrType(H5::PredType::C_S1, axesstr.size()), axesstr);
+  }
+
+  void H5Parm::SolTab::setComplexValues(const std::vector<std::complex<double> >& vals,
+                                       const std::vector<double>& weights,
+                                       bool toAmplitudes) {
+    // Convert values to real numbers by taking amplitude or argument
+    vector<double> realvals(vals.size());
+
+    if (toAmplitudes) {
+      transform(vals.begin(), vals.end(), realvals.begin(), takeAbs);
+    } else { // Phase only
+      transform(vals.begin(), vals.end(), realvals.begin(), takeArg);
+    }
+
+    setValues(realvals, weights);
+  }
+
+  void H5Parm::SolTab::readAxes() {
+    H5::DataSet val;
+    try {
+      val = openDataSet("val");
+    } catch (H5::GroupIException& e) {
+      THROW(Exception, "SolTab "<<getName()<<" has no values");
+    }
+
+    H5::Attribute axesattr;
+    try {
+      axesattr = val.openAttribute("AXES");
+    } catch (H5::AttributeIException& e) {
+      THROW(Exception, "Values of SolTab "<<getName()<<" has no AXIS attribute");
+    }
+
+    hsize_t axesstrlen = axesattr.getDataType().getSize();
+    char axescstr[axesstrlen+1];
+    axescstr[axesstrlen]='\0';
+    axesattr.read(axesattr.getDataType(), &axescstr);
+    vector<string> axesnames = StringUtil::tokenize(axescstr,",");
+
+    uint ndims = axesnames.size();
+
+    // Get number of dimensions and size of all dimensions
+    H5::DataSpace ds = val.getSpace();
+    ASSERT (ds.getSimpleExtentNdims() == int(ndims));
+    hsize_t dims_out[ndims];
+    ds.getSimpleExtentDims(dims_out);
+
+    for (uint i=0; i<axesnames.size(); ++i) {
+      AxisInfo a(axesnames[i], dims_out[i]);
+      _axes.push_back(a);
+    }
+  }
+
+  string H5Parm::SolTab::getName() const {
+    size_t len = H5Iget_name(getId(),NULL,0);
+    char buffer[len];
+    H5Iget_name(getId(),buffer,len+1);
+    // Strip leading /
+    return buffer+1;
+  }
+
+  vector<double> H5Parm::SolTab::getValues(
+              const std::string& antName,
+              uint starttimeslot, uint ntime, uint timestep,
+              uint startfreq, uint nfreq, uint freqstep,
+              uint pol, uint dir) {
+    vector<double> res(ntime*nfreq);
+    H5::DataSet val = openDataSet("val");
+
+    // Set offsets and strides
+    hsize_t memdims[_axes.size()];
+    hsize_t offset[_axes.size()];
+    hsize_t count[_axes.size()];
+    hsize_t stride[_axes.size()];
+
+    bool timeAxisFound = false;
+    for (uint i=0; i<_axes.size(); ++i) {
+      stride[i] = 1;
+      count[i] = 1;
+      memdims[i] = 1;
+      if (_axes[i].name=="time") {
+        offset[i] = starttimeslot;
+        stride[i] = timestep;
+        count[i] = ntime;
+        memdims[i] = ntime;
+        timeAxisFound = true;
+      } else if (_axes[i].name=="freq") {
+        offset[i] = startfreq;
+        stride[i] = freqstep;
+        count[i] = nfreq;
+        memdims[i] = nfreq;
+      } else if (_axes[i].name=="ant") {
+        offset[i] = getAntIndex(antName);
+      } else if (_axes[i].name=="dir") {
+        offset[i] = dir;
+      } else if (_axes[i].name=="pol") {
+        offset[i] = pol;
+      } else {
+        ASSERT(_axes[i].size == 1);
+        offset[i] = 0;
+      }
+    }
+
+    ASSERT(timeAxisFound);
+
+    H5::DataSpace dataspace = val.getSpace();
+
+    dataspace.selectHyperslab(H5S_SELECT_SET, count, offset, stride);
+
+    // Setup memory dataspace
+    H5::DataSpace memspace(_axes.size(), memdims);
+    try {
+      val.read(&(res[0]), H5::PredType::NATIVE_DOUBLE, memspace, dataspace);
+    } catch (H5::DataSetIException& e) {
+      e.printError();
+      THROW(Exception, "Could not read data");
+    }
+    return res;
+  }
+
+  void H5Parm::SolTab::setAntennas(const std::vector<std::string>& solAntennas) {
+    // TODO: assert that antenna is present in antenna table in solset
+    hsize_t dims[1];
+    dims[0]=solAntennas.size();
+
+    // Create dataset
+    H5::DataSpace dataspace(1, dims, NULL);
+    H5::DataSet dataset = createDataSet("ant", H5::StrType(H5::PredType::C_S1, 16), dataspace);
+
+    // Prepare data
+    char antArray[solAntennas.size()][16];
+    for (uint i=0; i<solAntennas.size(); ++i) {
+      std::strncpy(antArray[i], solAntennas[i].c_str(), 16);
+    }
+
+    dataset.write(antArray, H5::StrType(H5::PredType::C_S1, 16));
+  }
+
+  void H5Parm::SolTab::setSources(const std::vector<std::string>& solSources) {
+    // TODO: assert that source is present in source table of solset
+    hsize_t dims[1];
+    dims[0]=solSources.size();
+
+    // Create dataset
+    H5::DataSpace dataspace(1, dims, NULL);
+    H5::DataSet dataset = createDataSet("dir",
+                                        H5::StrType(H5::PredType::C_S1, 128),
+                                        dataspace);
+
+    // Prepare data
+    char srcArray[solSources.size()][128];
+    for (uint i=0; i<solSources.size(); ++i) {
+      std::strncpy(srcArray[i], solSources[i].c_str(), 128);
+    }
+
+    dataset.write(srcArray, H5::StrType(H5::PredType::C_S1, 128));
+  }
+
+  void H5Parm::SolTab::setFreqs(const std::vector<double>& freqs) {
+    setAxisMeta("freq", freqs);
+  }
+
+  void H5Parm::SolTab::setTimes(const std::vector<double>& times) {
+    setAxisMeta("time", times);
+  }
+
+  void H5Parm::SolTab::setAxisMeta(const std::string& metaName,
+                                   const std::vector<double>& metaVals) {
+    hsize_t dims[1];
+    dims[0]=metaVals.size();
+
+    // Create dataset
+    H5::DataSpace dataspace(1, dims, NULL);
+    H5::DataSet dataset = createDataSet(metaName,
+                                        H5::PredType::IEEE_F64LE, dataspace);
+
+    dataset.write(&(metaVals[0]), H5::PredType::IEEE_F64LE);
+  }
+
+  hsize_t H5Parm::SolTab::getAntIndex(const string& antName) {
+    return getNamedIndex(_antMap, "ant", antName);
+  }
+
+  void H5Parm::SolTab::fillCache(map<string, hsize_t>& cache,
+                                 const string& tableName) {
+    H5::DataSet dataset;
+    H5::DataSpace dataspace;
+    try {
+      dataset = openDataSet(tableName);
+      dataspace = dataset.getSpace();
+    } catch (H5::GroupIException& e) {
+      THROW(Exception, "SolTab has no table "<<tableName);
+    }
+    ASSERT(dataspace.getSimpleExtentNdims()==1);
+    hsize_t dims[1];
+    dataspace.getSimpleExtentDims(dims);
+
+    // TODO: assert that DataType is String
+    hsize_t strLen = dataset.getDataType().getSize();
+
+    char elNames[strLen*dims[0]];
+    dataset.read(elNames, H5::StrType(H5::PredType::C_S1, strLen));
+
+    for (hsize_t elNum=0; elNum<dims[0];++elNum) {
+      char elNamecstr[strLen+1];
+      std::copy(elNames+elNum*strLen,elNames+(elNum+1)*strLen, elNamecstr);
+      elNamecstr[strLen]='\0';
+      cache[elNamecstr]=elNum;
+    }
+  }
+
+  hsize_t H5Parm::SolTab::getNamedIndex(map<string, hsize_t>& cache,
+                                        const string& tableName,
+                                        const string& elementName) {
+    // Initialize _antMap on first use
+    if (cache.empty()) {
+      fillCache(cache, tableName);
+    }
+    map<string, hsize_t>::iterator it = cache.find(elementName);
+    if (it == cache.end()) {
+      THROW(Exception, "SolTab has no element "<<elementName <<
+                       " in "<<tableName);
+    }
+    return cache.find(elementName)->second;
+  }
+
+  hsize_t H5Parm::SolTab::getFreqIndex(double freq) const {
+    vector<double> freqs = getRealAxis("freq");
+
+    if (freqs.size()==1) {
+      return 0;
+    }
+
+    for (size_t i = 0; i<freqs.size()-1; ++i) {
+      if (freq>freqs[i] && freq<freqs[i+1]) {
+        // Nearest neighbor: i or i+1
+        if (freq-freqs[i] < freqs[i+1]-freq) {
+          return i;
+        }
+        else {
+          return i+1;
+        }
+      }
+    }
+    THROW(Exception,"Frequency "<<fixed<<freq<<" not found in "<<getName());
+    return 0;
+  }
+
+  vector<double> H5Parm::SolTab::getRealAxis(const string& axisname) const {
+    H5::DataSet dataset;
+    H5::DataSpace dataspace;
+    try {
+      dataset = openDataSet(axisname);
+      dataspace = dataset.getSpace();
+    } catch (H5::GroupIException& e) {
+      THROW(Exception, "SolTab "<<getName()<<" has no axis '"<<axisname<<"'");
+    }
+    ASSERT(dataspace.getSimpleExtentNdims()==1);
+
+    hsize_t dims[1];
+    dataspace.getSimpleExtentDims(dims);
+
+    vector<double> data(dims[0]);
+    dataset.read(&(data[0]), H5::PredType::NATIVE_DOUBLE);
+
+    return data;
+  }
+
+  vector<string> H5Parm::SolTab::getStringAxis(const string& axisName) {
+    map<string, hsize_t> cachemap;
+
+    if (axisName=="dir") {
+      if (_dirMap.empty()) {
+        fillCache(_dirMap, "dir");
+      }
+      cachemap = _dirMap;
+    } else if (axisName=="ant") {
+      if (_antMap.empty()) {
+        fillCache(_antMap, "ant");
+      }
+      cachemap = _antMap;
+    } else {
+      THROW(Exception, "Only string axes 'ant' and 'dir' supported for now.");
+    }
+
+    // Get the keys of the cache map and put them in a vector
+    vector<string> res;
+    for(map<string,hsize_t>::iterator it = cachemap.begin();
+        it != cachemap.end(); ++it) {
+      res.push_back(it->first);
+    }
+    return res;
+  }
+
+
+  hsize_t H5Parm::SolTab::getTimeIndex(double time) const {
+    vector<double> times = getRealAxis("time");
+
+    double timeInterval = getTimeInterval();
+
+    for (size_t i = 0; i<times.size(); ++i) {
+      if (abs(times[i]-time)<timeInterval*0.5)
+        return i;
+    }
+    THROW(Exception,"Time "<<fixed<<time<<" not found in "<<getName());
+    return 0;
+  }
+
+  hsize_t H5Parm::SolTab::getDirIndex(const string& dirName) {
+    return getNamedIndex(_dirMap, "dir", dirName);
+  }
+
+  double H5Parm::SolTab::getInterval(const std::string& axisName) const {
+    H5::DataSet dataset;
+    H5::DataSpace dataspace;
+    try {
+      dataset = openDataSet(axisName);
+      dataspace = dataset.getSpace();
+    } catch (H5::GroupIException& e) {
+      THROW(Exception, "SolTab "<<getName()<<" has no axis table for "<<axisName);
+    }
+    ASSERT(dataspace.getSimpleExtentNdims()==1);
+
+    hsize_t dims[1];
+    dataspace.getSimpleExtentDims(dims);
+    ASSERTSTR(dims[0]>1, "For reading the interval, more than one value is required.");
+
+    hsize_t count[1], offset[1];
+    count[0]=2; offset[0]=0;
+    dataspace.selectHyperslab(H5S_SELECT_SET, count, offset);
+
+    // Get only two values
+    vector<double> values(2);
+    dataset.read(&(values[0]), H5::PredType::NATIVE_DOUBLE, dataspace, dataspace);
+
+    return values[1]-values[0];
+  }
+}
diff --git a/CEP/DP3/DPPP/src/StefCal.cc b/CEP/DP3/DPPP/src/StefCal.cc
index 55dc0795a98ffa6b1eff296b32f10c70e44cbce5..0df7cca267481f61532a219e80c78c6aa6f0fb2b 100644
--- a/CEP/DP3/DPPP/src/StefCal.cc
+++ b/CEP/DP3/DPPP/src/StefCal.cc
@@ -332,7 +332,8 @@ namespace LOFAR {
           }
         }
 
-        if (ww==0) {
+        // Flag a station if all baselines are flagged or all data is zero
+        if (ww==0 || abs(tt)==0) {
           _stationFlagged[st1%_nSt]=true;
           _g(st1,0)=0;
           continue;
diff --git a/CEP/DP3/DPPP/test/CMakeLists.txt b/CEP/DP3/DPPP/test/CMakeLists.txt
index a7bb9a38c97ceebcf9438ae9ae8e6af4650e9774..5a8912b708dc2651e500f7e8bd3ebd5409529d60 100644
--- a/CEP/DP3/DPPP/test/CMakeLists.txt
+++ b/CEP/DP3/DPPP/test/CMakeLists.txt
@@ -27,7 +27,7 @@ lofar_add_test(tDemix)
 lofar_add_test(tPredict)
 lofar_add_test(tApplyBeam)
 lofar_add_test(tGainCal)
-lofar_add_test(tH5Parm tH5Parm.cc)
+lofar_add_test(tH5Parm tH5Parm)
 # lofar_add_test(tExpr tExpr.cc)
 # lofar_add_test(tmeqarray tmeqarray.cc)
 # lofar_add_test(test_flaggers test_flaggers.cc)
diff --git a/CEP/DP3/DPPP/test/tH5Parm.cc b/CEP/DP3/DPPP/test/tH5Parm.cc
index cd82f5f4cd81016ce595918ff24b7d107b739c97..1296264c5194c2d1071d356667fb20b38c1e1602 100644
--- a/CEP/DP3/DPPP/test/tH5Parm.cc
+++ b/CEP/DP3/DPPP/test/tH5Parm.cc
@@ -1,10 +1,145 @@
 #include <DPPP/H5Parm.h>
+#include <iostream>
+#include <sstream>
+#include <stdio.h>
+#include <vector>
+#include <Common/LofarLogger.h>
+#include <casacore/casa/BasicMath/Math.h>
 
 using namespace std;
 using namespace LOFAR;
 
+void checkAxes(H5Parm::SolTab& soltab) {
+  ASSERT(soltab.nAxes()==3);
+  ASSERT(soltab.hasAxis("ant"));
+  ASSERT(soltab.hasAxis("time"));
+  ASSERT(soltab.hasAxis("bla"));
+  ASSERT(soltab.getAxis(0).name=="ant");
+  ASSERT(soltab.getAxis(1).name=="time");
+  ASSERT(soltab.getAxis(2).name=="bla");
+  ASSERT(soltab.getAxis(0).size==3);
+  ASSERT(soltab.getAxis(1).size==4);
+  ASSERT(soltab.getAxis(2).size==1);
+}
+
 int main(int, char**) {
-  H5Parm myh5parm("h5parmtest.h5");
-//  myh5parm.addAntennas();
+  {
+    {
+      // Create a new H5Parm
+      cout<<"Create tH5Parm_tmp.h5"<<endl;
+      H5Parm h5parm("tH5Parm_tmp.h5");
+
+      // Check that something is created
+      ASSERT(((H5::H5File&)(h5parm)).getNumObjs()==1);
+
+      // Check the name of the new solset "sol000"
+      ASSERT(h5parm.getSolSetName()=="sol000");
+
+      // Add some metadata
+      vector<string> antNames;
+      vector<double> oneAntPos(3);
+      vector<vector<double> > antPositions;
+      for (uint i=0; i<5; ++i) {
+        stringstream antNameStr;
+        antNameStr<<"Antenna"<<i;
+        antNames.push_back(antNameStr.str());
+        antPositions.push_back(oneAntPos);
+      }
+      h5parm.addAntennas(antNames, antPositions);
+
+      vector<H5Parm::AxisInfo> axes;
+      axes.push_back(H5Parm::AxisInfo("ant",3));
+      axes.push_back(H5Parm::AxisInfo("time",4));
+      axes.push_back(H5Parm::AxisInfo("bla",1));
+
+      cout<<"Create new SolTab"<<endl;
+      H5Parm::SolTab a = h5parm.createSolTab("mysol","mytype",axes);
+
+      // Check that the soltab exists
+      ASSERT(h5parm.nSolTabs() == 1);
+      ASSERT(h5parm.hasSolTab("mysol"));
+
+      // Check the axes
+      H5Parm::SolTab soltab = h5parm.getSolTab("mysol");
+      ASSERT(soltab.getType()=="mytype");
+      checkAxes(soltab);
+
+      // Add some data
+      vector<double> vals(3*4);
+      for (size_t ant=0; ant<3; ++ant)
+        for (size_t time=0; time<4; ++time)
+          vals[ant*4+time]=10*ant+time;
+      soltab.setValues(vals, vector<double>());
+
+      // Add metadata for stations
+      vector<string> someAntNames;
+      someAntNames.push_back("Antenna1");
+      someAntNames.push_back("Antenna2");
+      someAntNames.push_back("Antenna3");
+      soltab.setAntennas(someAntNames);
+
+      // Add metadata for times
+      vector<double> times;
+      times.push_back(57878.5);
+      times.push_back(57880.5);
+      times.push_back(57882.5);
+      soltab.setTimes(times);
+    }
+
+    {
+      cout<<"opening tH5Parm_tmp.h5 again, force a new soltab"<<endl;
+      H5Parm h5parm("tH5Parm_tmp.h5", true);
+      ASSERT(h5parm.getSolSetName()=="sol001");
+    }
+
+    {
+      cout<<"opening tH5Parm_tmp.h5 again, force a new solset with name"<<endl;
+      H5Parm h5parm("tH5Parm_tmp.h5", true, "harry");
+      ASSERT(h5parm.getSolSetName()=="harry");
+    }
+
+    {
+      cout<<"opening tH5Parm_tmp.h5 again, read existing soltab"<<endl;
+      H5Parm h5parm("tH5Parm_tmp.h5", false, "sol000");
+      ASSERT(h5parm.getSolSetName()=="sol000");
+      ASSERT(h5parm.nSolTabs() == 1);
+      ASSERT(h5parm.hasSolTab("mysol"));
+      ASSERT(!h5parm.hasSolTab("nonexistingsol"));
+
+      // Check the axes
+      H5Parm::SolTab soltab = h5parm.getSolTab("mysol");
+      ASSERT(soltab.getType()=="mytype");
+      checkAxes(soltab);
+
+      cout<<"read some data"<<endl;
+      double starttime = 57878.49999;
+      hsize_t starttimeindex = soltab.getTimeIndex(starttime);
+      cout<<"starttimeindex="<<starttimeindex<<endl;
+      vector<double> val = soltab.getValues("Antenna2", starttimeindex, 4);
+      ASSERT(casa::near(val[0],10.));
+      ASSERT(casa::near(val[1],11.));
+      ASSERT(casa::near(val[2],12.));
+      ASSERT(casa::near(val[3],13.));
+      cout<<"read some data with stride 2"<<endl;
+      starttime = 57880.5;
+      starttimeindex = soltab.getTimeIndex(starttime);
+      ASSERT(starttimeindex==1);
+      vector<double> val2 = soltab.getValues("Antenna3", starttimeindex, 2, 2);
+      ASSERT(casa::near(val2[0],21.));
+      ASSERT(casa::near(val2[1],23.));
+      cout<<"testing stride"<<endl;
+      ASSERT(casa::near(soltab.getTimeInterval(),2.));
+      vector<string> antennas = soltab.getStringAxis("ant");
+      cout<<"reading the antennas into a vector"<<endl;
+      ASSERT(antennas.size()==3);
+      ASSERT(antennas[0]=="Antenna1");
+      ASSERT(antennas[1]=="Antenna2");
+      ASSERT(antennas[2]=="Antenna3");
+    }
+
+    // Remove the file
+//    remove("tH5Parm_tmp.h5");
+  }
+
   return 0;
 }
diff --git a/CEP/DP3/DPPP/test/tH5Parm.sh b/CEP/DP3/DPPP/test/tH5Parm.sh
new file mode 100755
index 0000000000000000000000000000000000000000..dacccfa6967e51e30a9e9464f4f981f8c9fa7472
--- /dev/null
+++ b/CEP/DP3/DPPP/test/tH5Parm.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+rm -f tH5Parm_tmp.h5
+./runctest.sh tH5Parm
diff --git a/CEP/DP3/DPPP_AOFlag/test/tAOFlaggerStep.run b/CEP/DP3/DPPP_AOFlag/test/tAOFlaggerStep.run
index f56191fcce6c1419554ccab8242e16e69642e0e4..1678dd86f1ef83692797986a4d3a9af784c456cd 100755
--- a/CEP/DP3/DPPP_AOFlag/test/tAOFlaggerStep.run
+++ b/CEP/DP3/DPPP_AOFlag/test/tAOFlaggerStep.run
@@ -3,8 +3,8 @@
 # Define the path for finding the library.
 #LD_LIBRARY_PATH=../src:/Users/diepen/external/lib:$LD_LIBRARYPATH
 #DYLD_LIBRARY_PATH=../src:/Users/diepen/external/lib:$DYLD_LIBRARYPATH
-LD_LIBRARY_PATH=../src:$LD_LIBRARYPATH
-DYLD_LIBRARY_PATH=../src:$DYLD_LIBRARYPATH
+LD_LIBRARY_PATH=../src:$LD_LIBRARY_PATH
+DYLD_LIBRARY_PATH=../src:$DYLD_LIBRARY_PATH
 export LD_LIBRARY_PATH
 export DYLD_LIBRARY_PATH
 echo $LD_LIBRARY_PATH
diff --git a/CEP/DP3/DPPP_DDECal/CMakeLists.txt b/CEP/DP3/DPPP_DDECal/CMakeLists.txt
index 4ebe58fb959493d58ee634ba7cb2042a53513919..3f59150da175f5927d7cd85d3305a3a54b2194e8 100644
--- a/CEP/DP3/DPPP_DDECal/CMakeLists.txt
+++ b/CEP/DP3/DPPP_DDECal/CMakeLists.txt
@@ -8,4 +8,4 @@ lofar_find_package(Armadillo REQUIRED)
 
 add_subdirectory(include/DPPP_DDECal)
 add_subdirectory(src)
-# add_subdirectory(test)
+add_subdirectory(test)
diff --git a/CEP/DP3/DPPP_DDECal/include/DPPP_DDECal/CMakeLists.txt b/CEP/DP3/DPPP_DDECal/include/DPPP_DDECal/CMakeLists.txt
index 4abee5ccfdd27dadbe040382636d792b1ec7b9d5..51d2e6c16a0c83a9e0696ae5e2b2ef7c7253102f 100644
--- a/CEP/DP3/DPPP_DDECal/include/DPPP_DDECal/CMakeLists.txt
+++ b/CEP/DP3/DPPP_DDECal/include/DPPP_DDECal/CMakeLists.txt
@@ -1,7 +1,7 @@
 # $Id: CMakeLists.txt 30990 2015-02-12 12:27:47Z diepen $
 
 # List of header files that will be installed.
-set(inst_HEADERS Register.h DDECal.h multidirsolver.h H5Parm.h Constraint.h ScreenConstraint.h PiercePoint.h)
+set(inst_HEADERS Register.h DDECal.h MultiDirSolver.h H5Parm.h Constraint.h ScreenConstraint.h TECConstraint.h PiercePoint.h Matrix2x2.h PieceWisePhaseFitter.h)
 
 # Create symbolic link to include directory.
 execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
diff --git a/CEP/DP3/DPPP_DDECal/include/DPPP_DDECal/Constraint.h b/CEP/DP3/DPPP_DDECal/include/DPPP_DDECal/Constraint.h
index e3a42b03ebe5af7e0da5c9f6fc614f692c245423..ce11dbee521f1a7369a193ce93f8bcf08c3137a6 100644
--- a/CEP/DP3/DPPP_DDECal/include/DPPP_DDECal/Constraint.h
+++ b/CEP/DP3/DPPP_DDECal/include/DPPP_DDECal/Constraint.h
@@ -1,14 +1,6 @@
 #ifndef CONSTRAINT_H
 #define CONSTRAINT_H
 
-#ifdef AOPROJECT
-#include "phasefitter.h"
-#define UPTR std::unique_ptr
-#else
-#include <DPPP/phasefitter.h>
-#define UPTR std::auto_ptr
-#endif
-
 #include <complex>
 #include <memory>
 #include <set>
@@ -29,21 +21,41 @@ public:
   {
   public:
     std::vector<double> vals;
-    std::string axes; // Comma-separated string with axes names, fastest varying last
+    std::string axes; // Comma-separated string with axis names, fastest varying last
     std::vector<size_t> dims;
     std::string name;
   };
 
   virtual ~Constraint() { }
-   
+
   /**
-   * TODO To be removed: constraints should have their own init specific initialization methods.
+   * Function that initializes the constraint for the next calibration iteration.
+   * It should be called each time all antenna solutions have been calculated,
+   * but before the constraint has been applied to all those antenna solutions.
+   * 
+   * Unlike Apply(), this method is not thread safe.
+   * 
+   * @param bool This can be used to specify whether the previous solution "step" is
+   * smaller than the requested precision, i.e. calibration with the constrained
+   * has converged. This allows a constraint to apply
+   * its constraint in steps: apply a better-converging constraint as long as the
+   * solutions are far from the correct answer, then switch to a different constraint
+   * when hasReachedPrecision=true.
    */
-  virtual void init(size_t nAntennas, size_t nDirections, 
-                    size_t nChannelBlocks, const double* frequencies) = 0;
-
+  virtual void PrepareIteration(bool /*hasReachedPrecision*/, size_t /*iteration*/, bool /*finalIter*/) { }
+  
   /**
-   * This method applies the constraints to the solutions.
+   * Whether the constraint has been satisfied. The calibration process will continue
+   * at least as long as Satisfied()=false, and performs at least one more iteration
+   * after Satisfied()=true. Together with SetPrecisionReached(), this
+   * can make the algorithm change the constraining method based on amount of
+   * convergence.
+   */
+  virtual bool Satisfied() const { return true; }
+   
+  /**
+   * This method applies the constraints to the solutions. It should be implemented in
+   * a thread safe manner, allowing multiple Apply() calls to run in parallel.
    * @param solutions is an array of array, such that:
    * - solutions[ch] is a pointer for channelblock ch to antenna x directions solutions.
    * - directions is the dimension with the fastest changing index.
@@ -55,55 +67,52 @@ public:
 };
 
 /**
- * Awkwardly named, this class constraints the amplitudes of the solution to be unity, but
+ * This class constraints the amplitudes of the solution to be unity, but
  * keeps the phase.
  */
-class PhaseConstraint : public Constraint
+class PhaseOnlyConstraint : public Constraint
 {
 public:
-  PhaseConstraint() {};
-
-  virtual void init(size_t, size_t, size_t, const double*) {};
+  PhaseOnlyConstraint() {};
 
   virtual std::vector<Result> Apply(
                     std::vector<std::vector<dcomplex> >& solutions,
                     double time);
 };
 
-class TECConstraint : public Constraint
+/**
+ * This class constraints the phases of the solution to be zero, but
+ * keeps the amplitude information.
+ */
+class AmplitudeOnlyConstraint : public Constraint
 {
 public:
-  enum Mode {
-    /** Solve for both a (differential) TEC and an XX/YY-common scalar */
-    TECAndCommonScalarMode,
-    /** Solve only for a (differential) TEC value */
-    TECOnlyMode
-  };
-  
-  TECConstraint(Mode mode, size_t nAntennas, size_t nDirections, 
-                size_t nChannelBlocks, const double* frequencies);
-  TECConstraint(Mode mode);
+  AmplitudeOnlyConstraint() {};
 
-  virtual void init(size_t nAntennas, size_t nDirections, 
-                    size_t nChannelBlocks, const double* frequencies);
-  
   virtual std::vector<Result> Apply(
                     std::vector<std::vector<dcomplex> >& solutions,
-                       double time);
+                    double time);
+};
+
+class DiagonalConstraint : public Constraint
+{
+public:
+  DiagonalConstraint(size_t polsPerSolution) : _polsPerSolution(polsPerSolution) {};
   
+  virtual std::vector<Result> Apply(
+                    std::vector<std::vector<dcomplex> >& solutions,
+                    double time);
 private:
-  Mode _mode;
-  size_t _nAntennas, _nDirections, _nChannelBlocks;
-  std::vector<PhaseFitter> _phaseFitters;
+  const size_t _polsPerSolution;
 };
 
 /**
- * This constraint limits averages the solutions of a given list of antennas,
+ * This constraint averages the solutions of a given list of antennas,
  * so that they have equal solutions.
  * 
  * The DDE solver uses this constraint to average the solutions of the core
- * antennas. Core antennas are there defined by a given maximum distance from
- * a reference antenna. In that case, the reference antenna is by default the first
+ * antennas. Core antennas are determined by a given maximum distance from
+ * a reference antenna. The reference antenna is by default the first
  * antenna. This constraint is meant to force all core stations to
  * have the same solution, thereby decreasing the noise in their solutions.
  */
@@ -112,16 +121,11 @@ class CoreConstraint : public Constraint
 public:
   CoreConstraint() { }
 
-  virtual void init(size_t nAntennas, size_t nDirections, 
-                    size_t nChannelBlocks, const double*)
+  void initialize(size_t nAntennas, size_t nDirections, size_t nChannelBlocks, const std::set<size_t>& coreAntennas)
   {
     _nAntennas = nAntennas;
     _nDirections = nDirections;
     _nChannelBlocks = nChannelBlocks;
-  }
-                     
-  void setCoreAntennas(const std::set<size_t>& coreAntennas)
-  {
     _coreAntennas = coreAntennas;
   }
   
diff --git a/CEP/DP3/DPPP_DDECal/include/DPPP_DDECal/DDECal.h b/CEP/DP3/DPPP_DDECal/include/DPPP_DDECal/DDECal.h
index 3369e8d73fbcbd1c6133a0a7881e133f02aa740f..327ea5819d475c313a5d4195f19191f04cc7befe 100644
--- a/CEP/DP3/DPPP_DDECal/include/DPPP_DDECal/DDECal.h
+++ b/CEP/DP3/DPPP_DDECal/include/DPPP_DDECal/DDECal.h
@@ -36,7 +36,7 @@
 #include <DPPP/Predict.h>
 #include <DPPP/SourceDBUtil.h>
 #include <DPPP/ApplyBeam.h>
-#include <DPPP_DDECal/multidirsolver.h>
+#include <DPPP_DDECal/MultiDirSolver.h>
 #include <DPPP_DDECal/Constraint.h>
 #include <StationResponse/Station.h>
 #include <StationResponse/Types.h>
@@ -56,7 +56,7 @@ namespace LOFAR {
     // This class is a DPStep class to calibrate (direction independent) gains.
 
     typedef vector<Patch::ConstPtr> PatchList;
-    typedef std::pair<size_t, size_t >Baseline;
+    typedef std::pair<size_t, size_t> Baseline;
 
     class DDECal: public DPStep
     {
@@ -97,7 +97,13 @@ namespace LOFAR {
 
     private:
       // Initialize solutions
-      void initializeSolutions();
+      void initializeScalarSolutions();
+      
+      void initializeFullMatrixSolutions();
+
+      // Convert itsDirections to a vector of strings like "[Patch1, Patch2]"
+      // Used for setting source names.
+      std::vector<std::string> getDirectionNames();
 
       //# Data members.
       DPInput*         itsInput;
@@ -113,7 +119,9 @@ namespace LOFAR {
 
       // For each time, for each channel block, a vector of size nAntennas * nDirections
       std::vector<std::vector<std::vector<casacore::DComplex> > > itsSols;
-      std::vector<uint> itsNIter; // Number of iterations taken
+      std::vector<uint>
+        itsNIter, // Number of iterations taken
+        itsNApproxIter;
 
       // For each time, for each constraint, a vector of results (e.g. tec and phase)
       std::vector<std::vector<std::vector<Constraint::Result> > > itsConstraintSols;
@@ -143,6 +151,8 @@ namespace LOFAR {
       double           itsScreenCoreConstraint;
 
       MultiDirSolver   itsMultiDirSolver;
+      bool itsFullMatrixMinimalization;
+      bool itsApproximateTEC;
     };
 
   } //# end namespace
diff --git a/CEP/DP3/DPPP_DDECal/include/DPPP_DDECal/Matrix2x2.h b/CEP/DP3/DPPP_DDECal/include/DPPP_DDECal/Matrix2x2.h
new file mode 100644
index 0000000000000000000000000000000000000000..2e27c1e45b0a4e2db3f748fb111b2077739c4381
--- /dev/null
+++ b/CEP/DP3/DPPP_DDECal/include/DPPP_DDECal/Matrix2x2.h
@@ -0,0 +1,414 @@
+#ifndef MATRIX_2X2_H
+#define MATRIX_2X2_H
+
+#include <complex>
+#include <limits>
+#include <sstream>
+
+class Matrix2x2
+{
+public:
+	template<typename LHS_T, typename RHS_T>
+	static void Assign(std::complex<LHS_T>* dest, const std::complex<RHS_T>* source)
+	{
+		for(size_t p=0; p!=4; ++p)
+			dest[p] = source[p];
+	}
+	
+	template<typename LHS_T, typename RHS_T>
+	static void Assign(LHS_T* dest, const RHS_T* source)
+	{
+		for(size_t p=0; p!=4; ++p)
+			dest[p] = source[p];
+	}
+	
+	template<typename T, typename RHS_T>
+	static void Add(std::complex<T>* dest, const RHS_T * rhs)
+	{
+		for(size_t p=0; p!=4; ++p)
+			dest[p] += rhs[p];
+	}
+	
+	template<typename T>
+	static void Subtract(std::complex<T>* dest, const std::complex<T>* rhs)
+	{
+		for(size_t p=0; p!=4; ++p)
+			dest[p] -= rhs[p];
+	}
+	
+	template<typename T>
+	static bool IsFinite(const std::complex<T>* matrix)
+	{
+		return
+			std::isfinite(matrix[0].real()) && std::isfinite(matrix[0].imag()) &&
+			std::isfinite(matrix[1].real()) && std::isfinite(matrix[1].imag()) &&
+			std::isfinite(matrix[2].real()) && std::isfinite(matrix[2].imag()) &&
+			std::isfinite(matrix[3].real()) && std::isfinite(matrix[3].imag());
+	}
+	
+	template<typename T>
+	static void ScalarMultiply(std::complex<T>* dest, T factor)
+	{
+		for(size_t p=0; p!=4; ++p)
+			dest[p] *= factor;
+	}
+	
+	template<typename T>
+	static void ScalarMultiply(T* dest, T factor)
+	{
+		for(size_t p=0; p!=4; ++p)
+			dest[p] *= factor;
+	}
+	
+	template<typename T, typename RHS>
+	static void MultiplyAdd(std::complex<T>* dest, const RHS* rhs, T factor)
+	{
+		for(size_t p=0; p!=4; ++p)
+			dest[p] += rhs[p] * factor;
+	}
+	
+	template<typename ComplType, typename LHS_T, typename RHS_T>
+	static void ATimesB(std::complex<ComplType>* dest, const LHS_T* lhs, const RHS_T* rhs)
+	{
+		dest[0] = lhs[0] * rhs[0] + lhs[1] * rhs[2];
+		dest[1] = lhs[0] * rhs[1] + lhs[1] * rhs[3];
+		dest[2] = lhs[2] * rhs[0] + lhs[3] * rhs[2];
+		dest[3] = lhs[2] * rhs[1] + lhs[3] * rhs[3];
+	}
+	
+	static void PlusATimesB(std::complex<double> *dest, const std::complex<double> *lhs, const std::complex<double> *rhs)
+	{
+		dest[0] += lhs[0] * rhs[0] + lhs[1] * rhs[2];
+		dest[1] += lhs[0] * rhs[1] + lhs[1] * rhs[3];
+		dest[2] += lhs[2] * rhs[0] + lhs[3] * rhs[2];
+		dest[3] += lhs[2] * rhs[1] + lhs[3] * rhs[3];
+	}
+	
+	template<typename ComplType, typename LHS_T, typename RHS_T>
+	static void ATimesHermB(std::complex<ComplType> *dest, const LHS_T* lhs, const RHS_T* rhs)
+	{
+		dest[0] = lhs[0] * std::conj(rhs[0]) + lhs[1] * std::conj(rhs[1]);
+		dest[1] = lhs[0] * std::conj(rhs[2]) + lhs[1] * std::conj(rhs[3]);
+		dest[2] = lhs[2] * std::conj(rhs[0]) + lhs[3] * std::conj(rhs[1]);
+		dest[3] = lhs[2] * std::conj(rhs[2]) + lhs[3] * std::conj(rhs[3]);
+	}
+
+	template<typename ComplType, typename LHS_T, typename RHS_T>
+	static void PlusATimesHermB(std::complex<ComplType> *dest, const LHS_T* lhs, const RHS_T* rhs)
+	{
+		dest[0] += lhs[0] * std::conj(rhs[0]) + lhs[1] * std::conj(rhs[1]);
+		dest[1] += lhs[0] * std::conj(rhs[2]) + lhs[1] * std::conj(rhs[3]);
+		dest[2] += lhs[2] * std::conj(rhs[0]) + lhs[3] * std::conj(rhs[1]);
+		dest[3] += lhs[2] * std::conj(rhs[2]) + lhs[3] * std::conj(rhs[3]);
+	}
+
+	template<typename ComplType, typename LHS_T, typename RHS_T>
+	static void HermATimesB(std::complex<ComplType> *dest, const LHS_T* lhs, const RHS_T* rhs)
+	{
+		dest[0] = std::conj(lhs[0]) * rhs[0] + std::conj(lhs[2]) * rhs[2];
+		dest[1] = std::conj(lhs[0]) * rhs[1] + std::conj(lhs[2]) * rhs[3];
+		dest[2] = std::conj(lhs[1]) * rhs[0] + std::conj(lhs[3]) * rhs[2];
+		dest[3] = std::conj(lhs[1]) * rhs[1] + std::conj(lhs[3]) * rhs[3];
+	}
+
+	static void HermATimesHermB(std::complex<double> *dest, const std::complex<double> *lhs, const std::complex<double> *rhs)
+	{
+		dest[0] = std::conj(lhs[0]) * std::conj(rhs[0]) + std::conj(lhs[2]) * std::conj(rhs[1]);
+		dest[1] = std::conj(lhs[0]) * std::conj(rhs[2]) + std::conj(lhs[2]) * std::conj(rhs[3]);
+		dest[2] = std::conj(lhs[1]) * std::conj(rhs[0]) + std::conj(lhs[3]) * std::conj(rhs[1]);
+		dest[3] = std::conj(lhs[1]) * std::conj(rhs[2]) + std::conj(lhs[3]) * std::conj(rhs[3]);
+	}
+	
+	template<typename ComplType, typename LHS_T, typename RHS_T>
+	static void PlusHermATimesB(std::complex<ComplType> *dest, const LHS_T* lhs, const RHS_T* rhs)
+	{
+		dest[0] += std::conj(lhs[0]) * rhs[0] + std::conj(lhs[2]) * rhs[2];
+		dest[1] += std::conj(lhs[0]) * rhs[1] + std::conj(lhs[2]) * rhs[3];
+		dest[2] += std::conj(lhs[1]) * rhs[0] + std::conj(lhs[3]) * rhs[2];
+		dest[3] += std::conj(lhs[1]) * rhs[1] + std::conj(lhs[3]) * rhs[3];
+	}
+
+	template<typename T>
+	static bool Invert(T* matrix)
+	{
+		T d = ((matrix[0]*matrix[3]) - (matrix[1]*matrix[2]));
+		if(d == 0.0)
+			return false;
+		T oneOverDeterminant = 1.0 / d;
+		T temp;
+		temp      = matrix[3] * oneOverDeterminant;
+		matrix[1] = -matrix[1] * oneOverDeterminant;
+		matrix[2] = -matrix[2] * oneOverDeterminant;
+		matrix[3] = matrix[0] * oneOverDeterminant;
+		matrix[0] = temp;
+		return true;
+	}
+
+	static bool MultiplyWithInverse(std::complex<double>* lhs, const std::complex<double>* rhs)
+	{
+		std::complex<double> d = ((rhs[0]*rhs[3]) - (rhs[1]*rhs[2]));
+		if(d == 0.0) return false;
+		std::complex<double> oneOverDeterminant = 1.0 / d;
+		std::complex<double> temp[4];
+		temp[0] = rhs[3] * oneOverDeterminant;
+		temp[1] = -rhs[1] * oneOverDeterminant;
+		temp[2] = -rhs[2] * oneOverDeterminant;
+		temp[3] = rhs[0] * oneOverDeterminant;
+		
+		std::complex<double> temp2 = lhs[0];
+		lhs[0] = lhs[0] * temp[0] + lhs[1] * temp[2];
+		lhs[1] =  temp2 * temp[1] + lhs[1] * temp[3];
+		
+		temp2 = lhs[2];
+		lhs[2] = lhs[2] * temp[0] + lhs[3] * temp[2];
+		lhs[3] = temp2 * temp[1] + lhs[3] * temp[3];
+		return true;
+	}
+
+	static void SingularValues(const std::complex<double>* matrix, double &e1, double &e2)
+	{
+		// This is not the ultimate fastest method, since we
+		// don't need to calculate the imaginary values of b,c at all.
+		// Calculate M M^H
+		std::complex<double> temp[4] = {
+			matrix[0] * std::conj(matrix[0]) + matrix[1] * std::conj(matrix[1]),
+			matrix[0] * std::conj(matrix[2]) + matrix[1] * std::conj(matrix[3]),
+			matrix[2] * std::conj(matrix[0]) + matrix[3] * std::conj(matrix[1]),
+			matrix[2] * std::conj(matrix[2]) + matrix[3] * std::conj(matrix[3])
+		};
+		// Use quadratic formula, with a=1.
+		double
+			b = -temp[0].real() - temp[3].real(),
+			c = temp[0].real()*temp[3].real() - (temp[1]*temp[2]).real(),
+			d = b*b - (4.0*1.0)*c,
+			sqrtd = sqrt(d);
+
+		e1 = sqrt((-b + sqrtd) * 0.5);
+		e2 = sqrt((-b - sqrtd) * 0.5);
+	}
+	
+	static void EigenValues(const double* matrix, double &e1, double &e2)
+	{
+		double tr = matrix[0] + matrix[3];
+		double d = matrix[0]*matrix[3] - matrix[1]*matrix[2];
+		double term = sqrt(tr*tr*0.25-d);
+		double trHalf = tr*0.5;
+		e1 = trHalf + term;
+		e2 = trHalf - term;
+	}
+	
+	static void EigenValues(const std::complex<double>* matrix, std::complex<double> &e1, std::complex<double> &e2)
+	{
+		std::complex<double> tr = matrix[0] + matrix[3];
+		std::complex<double> d = matrix[0]*matrix[3] - matrix[1]*matrix[2];
+		std::complex<double> term = sqrt(tr*tr*0.25-d);
+		std::complex<double> trHalf = tr*0.5;
+		e1 = trHalf + term;
+		e2 = trHalf - term;
+	}
+	
+	static void EigenValuesAndVectors(const double* matrix, double &e1, double &e2, double* vec1, double* vec2)
+	{
+		double tr = matrix[0] + matrix[3];
+		double d = matrix[0]*matrix[3] - matrix[1]*matrix[2];
+		double term = sqrt(tr*tr*0.25-d);
+		double trHalf = tr*0.5;
+		e1 = trHalf + term;
+		e2 = trHalf - term;
+		if(matrix[2] != 0.0)
+		{
+			vec1[0] = matrix[3] - e1;
+			vec1[1] = -matrix[2];
+			vec2[0] = matrix[3] - e2;
+			vec2[1] = -matrix[2];
+		}
+		else if(matrix[1] != 0.0)
+		{
+			vec1[0] = -matrix[1];
+			vec1[1] = matrix[0] - e1;
+			vec2[0] = -matrix[1];
+			vec2[1] = matrix[0] - e2;
+		}
+		else {
+			vec1[0] = 1.0;
+			vec1[1] = 0.0;
+			vec2[0] = 0.0;
+			vec2[1] = 1.0;
+		}
+	}
+	
+	static void SquareRoot(double* matrix)
+	{
+		double tr = matrix[0] + matrix[3];
+		double d = matrix[0]*matrix[3] - matrix[1]*matrix[2];
+		double s = /*+/-*/ sqrt(d);
+		double t = /*+/-*/ sqrt(tr + 2.0*s);
+		if(t != 0.0)
+		{
+			matrix[0] = (matrix[0]+s ) / t;
+			matrix[1] = (matrix[1] / t);
+			matrix[2] = (matrix[2] / t);
+			matrix[3] = (matrix[3]+s) / t;
+		}
+		else {
+			if(matrix[0] == 0.0 && matrix[1] == 0.0 &&
+				matrix[2] == 0.0 && matrix[3] == 0.0)
+			{
+				// done: it's the zero matrix
+			} else {
+				for(size_t i=0; i!=4; ++i)
+					matrix[i] = std::numeric_limits<double>::quiet_NaN();
+			}
+		}
+	}
+	
+	template<typename T>
+	static T RotationAngle(const std::complex<T>* matrix)
+	{
+		return std::atan2((matrix[2].real()-matrix[1].real())*0.5, (matrix[0].real()+matrix[3].real())*0.5);
+	}
+	
+	template<typename T>
+	static void RotationMatrix(std::complex<T>* matrix, double alpha)
+	{
+		T cosAlpha, sinAlpha;
+		sincos(alpha, &sinAlpha, &cosAlpha);
+		matrix[0] = cosAlpha; matrix[1] = -sinAlpha;
+		matrix[2] = sinAlpha; matrix[3] = cosAlpha;
+	}
+};
+
+class MC2x2
+{
+public:
+	MC2x2() { }
+	MC2x2(const MC2x2& source) { Matrix2x2::Assign(_values, source._values); }
+	template<typename T>
+	explicit MC2x2(const T source[4]) { Matrix2x2::Assign(_values, source); }
+	MC2x2(double m00, double m01, double m10, double m11) {
+		_values[0] = m00; _values[1] = m01;
+		_values[2] = m10; _values[3] = m11;
+	}
+	MC2x2(std::complex<double> m00, std::complex<double> m01, std::complex<double> m10, std::complex<double> m11) {
+		_values[0] = m00; _values[1] = m01;
+		_values[2] = m10; _values[3] = m11;
+	}
+	MC2x2& operator=(const MC2x2& source)
+	{
+		Matrix2x2::Assign(_values, source._values);
+		return *this;
+	}
+	MC2x2& operator+=(const MC2x2& rhs)
+	{
+		Matrix2x2::Add(_values, rhs._values);
+		return *this;
+	}
+	MC2x2& operator*=(double rhs)
+	{
+		Matrix2x2::ScalarMultiply(_values, rhs);
+		return *this;
+	}
+	MC2x2& operator/=(double rhs)
+	{
+		Matrix2x2::ScalarMultiply(_values, 1.0/rhs);
+		return *this;
+	}
+	const std::complex<double>& operator[](size_t index) const { return _values[index]; }
+	std::complex<double>& operator[](size_t index) { return _values[index]; }
+	const double& IndexReal(size_t index) const { return reinterpret_cast<const double(&)[2]>(_values[index/2])[index%2]; }
+	double& IndexReal(size_t index) { return reinterpret_cast<double(&)[2]>(_values[index/2])[index%2]; }
+	static MC2x2 Zero()
+	{
+		return MC2x2(0.0, 0.0, 0.0, 0.0);
+	}
+	static MC2x2 Unity()
+	{
+		return MC2x2(1.0, 0.0, 0.0, 1.0);
+	}
+	static MC2x2 NaN()
+	{
+		return MC2x2(
+			std::complex<double>(std::numeric_limits<double>::quiet_NaN(), std::numeric_limits<double>::quiet_NaN()),
+			std::complex<double>(std::numeric_limits<double>::quiet_NaN(), std::numeric_limits<double>::quiet_NaN()),
+			std::complex<double>(std::numeric_limits<double>::quiet_NaN(), std::numeric_limits<double>::quiet_NaN()),
+			std::complex<double>(std::numeric_limits<double>::quiet_NaN(), std::numeric_limits<double>::quiet_NaN()));
+	}
+	std::complex<double>* Data() { return _values; }
+	const std::complex<double>* Data() const { return _values; }
+	MC2x2 Multiply(const MC2x2& rhs) const
+	{
+		MC2x2 dest;
+		Matrix2x2::ATimesB(dest._values, _values, rhs._values);
+		return dest;
+	}
+	MC2x2 MultiplyHerm(const MC2x2& rhs) const
+	{
+		MC2x2 dest;
+		Matrix2x2::ATimesHermB(dest._values, _values, rhs._values);
+		return dest;
+	}
+	MC2x2 HermThenMultiply(const MC2x2& rhs) const
+	{
+		MC2x2 dest;
+		Matrix2x2::HermATimesB(dest._values, _values, rhs._values);
+		return dest;
+	}
+	MC2x2 HermThenMultiplyHerm(const MC2x2& rhs) const
+	{
+		MC2x2 dest;
+		Matrix2x2::HermATimesHermB(dest._values, _values, rhs._values);
+		return dest;
+	}
+	void AddWithFactorAndAssign(const MC2x2& rhs, double factor)
+	{
+		Matrix2x2::MultiplyAdd(_values, rhs._values, factor);
+	}
+	bool Invert()
+	{
+		return Matrix2x2::Invert(_values);
+	}
+	static void ATimesB(MC2x2& dest, const MC2x2& lhs, const MC2x2& rhs)
+	{
+		Matrix2x2::ATimesB(dest._values, lhs._values, rhs._values);
+	}
+	static void ATimesHermB(MC2x2& dest, const MC2x2& lhs, const MC2x2& rhs)
+	{
+		Matrix2x2::ATimesHermB(dest._values, lhs._values, rhs._values);
+	}
+	static void HermATimesB(MC2x2& dest, const MC2x2& lhs, const MC2x2& rhs)
+	{
+		Matrix2x2::HermATimesB(dest._values, lhs._values, rhs._values);
+	}
+	static void HermATimesHermB(MC2x2& dest, const MC2x2& lhs, const MC2x2& rhs)
+	{
+		Matrix2x2::HermATimesHermB(dest._values, lhs._values, rhs._values);
+	}
+	std::string ToString() const
+	{
+		std::stringstream str;
+		str << _values[0] << ", " << _values[1] << "; "
+			<< _values[2] << ", " << _values[3];
+		return str.str();
+	}
+	void CopyValues(std::complex<double>* values) const
+	{
+		Matrix2x2::Assign(values, _values);
+	}
+	void EigenValues(std::complex<double> &e1, std::complex<double> &e2) const
+	{
+		Matrix2x2::EigenValues(_values, e1, e2);
+	}
+	bool HasNaN() const
+	{
+		return !(
+			std::isfinite(_values[0].real()) && std::isfinite(_values[0].imag()) &&
+			std::isfinite(_values[1].real()) && std::isfinite(_values[1].imag()) &&
+			std::isfinite(_values[2].real()) && std::isfinite(_values[2].imag()) &&
+			std::isfinite(_values[3].real()) && std::isfinite(_values[3].imag())
+		);
+	}
+private:
+	std::complex<double> _values[4];
+};
+
+#endif
diff --git a/CEP/DP3/DPPP_DDECal/include/DPPP_DDECal/MultiDirSolver.h b/CEP/DP3/DPPP_DDECal/include/DPPP_DDECal/MultiDirSolver.h
new file mode 100644
index 0000000000000000000000000000000000000000..47d474c8e71f3c4018e6c21088fe0be9870b6863
--- /dev/null
+++ b/CEP/DP3/DPPP_DDECal/include/DPPP_DDECal/MultiDirSolver.h
@@ -0,0 +1,110 @@
+#ifndef MULTI_DIR_SOLVER_H
+#define MULTI_DIR_SOLVER_H
+
+#ifdef AOPROJECT
+#include "PhaseFitter.h"
+#include "Constraint.h"
+#define UPTR std::unique_ptr
+#else
+#include <DPPP/PhaseFitter.h>
+#include <DPPP_DDECal/Constraint.h>
+#define UPTR std::auto_ptr
+#endif
+
+#include <armadillo>
+
+#include <complex>
+#include <vector>
+#include <memory>
+
+class MultiDirSolver
+{
+public:
+  typedef std::complex<double> DComplex;
+  typedef std::complex<float> Complex;
+  
+  struct SolveResult {
+    size_t iterations, constraintIterations;
+    std::vector<std::vector<Constraint::Result> > _results;
+  };
+  
+  MultiDirSolver();
+  
+  void init(size_t nAntennas, size_t nDirections, size_t nChannels, 
+            const std::vector<int>& ant1, const std::vector<int>& ant2);
+  
+  // data[i] is een pointer naar de data voor tijdstap i, vanaf die pointer staat het in volgorde als in MS (bl, chan, pol)
+  // mdata[i] is een pointer voor tijdstap i naar arrays van ndir model data pointers (elk van die data pointers staat in zelfde volgorde als data)
+  // solutions[ch] is een pointer voor channelblock ch naar antenna x directions oplossingen.
+  SolveResult processScalar(std::vector<Complex*>& data, std::vector<std::vector<Complex* > >& modelData,
+    std::vector<std::vector<DComplex> >& solutions, double time) const;
+  
+  /**
+   * Same as @ref processScalar(), but solves full Jones matrices.
+   * @param data als in @ref processScalar()
+   * @param modelData als in @ref processScalar()
+   * @param solutions An array, where @c solutions[ch] is a pointer to channelblock @c ch, that points to
+   * antenna x directions solutions. Each solution consists of 4 complex values forming the full Jones matrix.
+   */
+  SolveResult processFullMatrix(std::vector<Complex *>& data,
+    std::vector<std::vector<Complex *> >& modelData,
+    std::vector<std::vector<DComplex> >& solutions, double time) const;
+  
+  void set_phase_only(bool phaseOnly) { _phaseOnly = phaseOnly; }
+  
+  void set_channel_blocks(size_t nChannelBlocks) { _nChannelBlocks = nChannelBlocks; }
+  
+  size_t max_iterations() const { return _maxIterations; }
+  void set_max_iterations(size_t maxIterations) { _maxIterations = maxIterations; }
+  
+  void set_accuracy(double accuracy) {
+    _accuracy = accuracy;
+  }
+  void set_constraint_accuracy(double constraintAccuracy) {
+    _constraintAccuracy = constraintAccuracy;
+  }
+  void set_step_size(double stepSize) { _stepSize = stepSize; }
+  
+  void add_constraint(Constraint* constraint) { _constraints.push_back(constraint); }
+  
+private:
+  void performScalarIteration(size_t channelBlockIndex,
+                             std::vector<arma::cx_mat>& gTimesCs,
+                             std::vector<arma::cx_vec>& vs,
+                             const std::vector<DComplex>& solutions,
+                             std::vector<DComplex>& nextSolutions,
+                             const std::vector<Complex *>& data,
+                             const std::vector<std::vector<Complex *> >& modelData) const;
+                             
+  void performFullMatrixIteration(size_t channelBlockIndex,
+                             std::vector<arma::cx_mat>& gTimesCs,
+                             std::vector<arma::cx_mat>& vs,
+                             const std::vector<DComplex>& solutions,
+                             std::vector<DComplex>& nextSolutions,
+                             const std::vector<Complex *>& data,
+                             const std::vector<std::vector<Complex *> >& modelData) const;
+
+  void makeStep(const std::vector<std::vector<DComplex> >& solutions,
+    std::vector<std::vector<DComplex> >& nextSolutions) const;
+                
+  void makeSolutionsFinite(std::vector<std::vector<DComplex> >& solutions, size_t perPol) const;
+                
+  /**
+   * Assign the solutions in nextSolutions to the solutions.
+   * @returns whether the solutions have been converged.
+   */
+  bool assignSolutions(std::vector<std::vector<DComplex> >& solutions,
+    std::vector<std::vector<DComplex> >& nextSolutions, bool useConstraintAccuracy) const;
+                             
+  size_t _nAntennas, _nDirections, _nChannels, _nChannelBlocks;
+  std::vector<int> _ant1, _ant2;
+  
+  // Calibration setup
+  size_t _maxIterations;
+  double _accuracy, _constraintAccuracy;
+  double _stepSize;
+  bool _phaseOnly;
+  std::vector<Constraint*> _constraints;
+};
+
+#endif
diff --git a/CEP/DP3/DPPP_DDECal/include/DPPP_DDECal/PieceWisePhaseFitter.h b/CEP/DP3/DPPP_DDECal/include/DPPP_DDECal/PieceWisePhaseFitter.h
new file mode 100644
index 0000000000000000000000000000000000000000..fa6631c22bfbe2173c8c803f7203e058e7d96ced
--- /dev/null
+++ b/CEP/DP3/DPPP_DDECal/include/DPPP_DDECal/PieceWisePhaseFitter.h
@@ -0,0 +1,292 @@
+#ifndef PIECE_WISE_PHASE_FITTER_H
+#define PIECE_WISE_PHASE_FITTER_H
+
+#include <algorithm>
+#include <iterator>
+#include <cmath>
+
+class PieceWisePhaseFitter
+{
+public:
+  PieceWisePhaseFitter() : _chunkSize(0) { }
+  
+  /**
+   * Constructor.
+   * @param chunkSize Size of chunk in number of samples.
+   */
+  PieceWisePhaseFitter(size_t chunkSize) : _chunkSize(chunkSize) { }
+  
+  size_t ChunkSize() const { return _chunkSize; }
+  void SetChunkSize(size_t chunkSize) { _chunkSize = chunkSize; }
+  
+  /**
+  * Unwrap a range of phase values.
+  */
+  template<typename Iter>
+  static void Unwrap(Iter first, Iter last)
+  {
+    for(Iter iter = first+1; iter!=last; ++iter)
+    {
+      while(*iter - (*(iter-1)) > M_PI)
+        *iter -= 2.0*M_PI;
+      while((*(iter-1) - *iter) > M_PI)
+        *iter += 2.0*M_PI;
+    }
+  }
+  
+  static size_t CalculateChunkSize(double startFrequencyHz, double endFrequencyHz, size_t channelCount)
+  {
+    // it seems that 10 chunks per octave seems reasonable
+    double nOctaves = (log(endFrequencyHz) - log(startFrequencyHz)) / M_LN2;
+    if(nOctaves > 0.0)
+      return std::min<size_t>(channelCount, ceil(channelCount / (10.0 * nOctaves)));
+    else
+      return channelCount;
+  }
+  
+  /**
+  * Perform a piece-wise fit of linear phase gradients.
+  * 
+  * The data is divided into chunks with given size, and in each chunk a line is fitted (offset & gradient).
+  * The fitted line of each chunk is written into fittedData. The resulting line will have a 'jump' between each
+  * chunk.
+  * @param nu Frequencies of the channels (in Hz).
+  * @param data The values, same size as @c nu.
+  * @param fittedData A vector of at least size @c nu.size(), in which the fitted lines are stored.
+  */
+  void PieceWiseFit(const std::vector<double>& nu, const std::vector<double>& data, std::vector<double>& fittedData)
+  {
+    size_t chunkSize = std::min(data.size(), _chunkSize);
+    for(size_t ch=0; ch<data.size(); ch+=chunkSize)
+    {
+      size_t pos = ch;
+      if(pos > data.size() - chunkSize)
+        pos = data.size() - chunkSize;
+      fitChunk(chunkSize, pos, nu, data, fittedData);
+    }
+  }
+  
+  void PieceWiseFit(const std::vector<double>& nu, const std::vector<double>& data, const double* weights, std::vector<double>& fittedData)
+  {
+    size_t chunkSize = std::min(data.size(), _chunkSize);
+    for(size_t ch=0; ch<data.size(); ch+=chunkSize)
+    {
+      size_t pos = ch;
+      if(pos > data.size() - chunkSize)
+        pos = data.size() - chunkSize;
+      fitChunk(chunkSize, pos, nu, data, weights, fittedData);
+    }
+  }
+  
+  /**
+  * Performs a sliding fit of linear phase gradients (without weighting).
+  * See other SlidingFit() overload.
+  */
+  void SlidingFit(const double* nu, const std::vector<double>& data, std::vector<double>& fittedData)
+  {
+    const size_t
+      chunkSize = std::min(_chunkSize, data.size()),
+      leftEdge = chunkSize/2,
+      rightEdge = data.size() - chunkSize + chunkSize/2;
+    
+    double a, b;
+    PieceWisePhaseFitter::fitSlope(&data[0], &nu[0], chunkSize, a, b);
+    for(size_t ch=0; ch!=leftEdge; ++ch)
+      fittedData[ch] = a + b * nu[ch];
+    
+    for(size_t ch=0; ch!=data.size() - chunkSize; ++ch)
+    {
+      PieceWisePhaseFitter::fitSlope(&data[ch], &nu[ch], chunkSize, a, b);
+      fittedData[ch + chunkSize/2] = a + b * nu[ch + chunkSize/2];
+    }
+    
+    PieceWisePhaseFitter::fitSlope(&data[data.size() - chunkSize], &nu[data.size() - chunkSize], chunkSize, a, b);
+    for(size_t ch=rightEdge; ch!=data.size(); ++ch)
+      fittedData[ch] = a + b * nu[ch];
+  }
+  
+  /**
+  * Performs a sliding fit of linear phase gradients (with weighting).
+  * 
+  * A window of size @c chunkSize is slid over the data, and a line is fitted at each position. The values near the left
+  * and right side of the border are evaluated with the fit to the most left/right window. This is slower than
+  * @ref PieceWiseFit(), but it produces a smoother & more accurate fit.
+  * The fit is not necessarily entirely smooth, because the line fit tries to guess the right wrapping of the samples.
+  * Since that is not a linear process, this can still cause slight jumps.
+  * 
+  * @param chunkSize Size of chunk in number of samples.
+  * @param nu Frequencies of the channels (in Hz).
+  * @param data The values, same size as @c nu.
+  * @param weights Inverse-variance weights.
+  * @param fittedData A vector of at least size @c nu.size(), in which the fitted lines are stored.
+  */
+  void SlidingFit(const double* nu, const std::vector<double>& data, const double* weights, std::vector<double>& fittedData)
+  {
+    const size_t
+      chunkSize = std::min(_chunkSize, data.size()),
+      leftEdge = chunkSize/2,
+      rightEdge = data.size() - chunkSize + chunkSize/2;
+    
+    double a, b;
+    PieceWisePhaseFitter::fitSlope(&data[0], &nu[0], &weights[0], chunkSize, a, b);
+    for(size_t ch=0; ch!=leftEdge; ++ch)
+      fittedData[ch] = a + b * nu[ch];
+    
+    for(size_t ch=0; ch!=data.size() - chunkSize; ++ch)
+    {
+      PieceWisePhaseFitter::fitSlope(&data[ch], &nu[ch], &weights[ch], chunkSize, a, b);
+      fittedData[ch + chunkSize/2] = a + b * nu[ch + chunkSize/2];
+    }
+    
+    PieceWisePhaseFitter::fitSlope(&data[data.size() - chunkSize], &nu[data.size() - chunkSize], &weights[data.size() - chunkSize], chunkSize, a, b);
+    for(size_t ch=rightEdge; ch!=data.size(); ++ch)
+      fittedData[ch] = a + b * nu[ch];
+  }
+  
+private:
+  size_t _chunkSize;
+  /**
+   * This is used to avoid having to reallocate data every fit
+   */
+  std::vector<double> _tempArray;
+  
+  /**
+  * Fit a + bx
+  */
+  void fitSlope(const double* data, const double* frequencies, size_t n, double& a, double& b)
+  {
+    double
+      sum_x = 0.0,
+      sum_xSq = 0.0,
+      mean_y = 0.0,
+      ss_xy = 0.0;
+    std::vector<double>& d = _tempArray;
+    d.assign(data, data+n);
+    std::nth_element(d.data(), d.data()+n/2, d.data()+n);
+    double wrapTo = d[n/2];
+    for(double& v : d)
+    {
+      if(v - wrapTo > M_PI)
+        v -= 2.0*M_PI;
+      else if(v - wrapTo < -M_PI)
+        v += 2.0*M_PI;
+    }
+    std::nth_element(d.data(), d.data()+n/2, d.data()+n);
+    wrapTo = d[n/2];
+    for(size_t i=0; i!=n; ++i)
+    {
+      double x = data[i];
+      if(x - wrapTo > M_PI)
+        x -= 2.0*M_PI;
+      else if(x - wrapTo < -M_PI)
+        x += 2.0*M_PI;
+      sum_x += frequencies[i];
+      sum_xSq += frequencies[i] * frequencies[i];
+      mean_y += x;
+      ss_xy += frequencies[i] * x;
+    }
+    mean_y /= n;
+    double mean_x = sum_x / n;
+    double ss_xx = sum_xSq - mean_x * sum_x;
+    ss_xy -= sum_x * mean_y;
+    b = ss_xy / ss_xx;
+    a = mean_y - b * mean_x;
+  }
+  
+  /**
+  * Fit a + bx with weights
+  */
+  void fitSlope(const double* data, const double* frequencies, const double* weights, size_t n, double& a, double& b)
+  {
+    std::vector<double>& d = _tempArray;
+    d.clear();
+    for(size_t i=0; i!=n; ++i)
+    {
+      if(weights[i] > 0.0)
+        d.push_back(data[i]);
+    }
+    std::nth_element(d.data(), d.data()+n/2, d.data()+n);
+    double wrapTo = d[n/2];
+    for(double& v : d)
+    {
+      if(v - wrapTo > M_PI)
+        v -= 2.0*M_PI;
+      else if(v - wrapTo < -M_PI)
+        v += 2.0*M_PI;
+    }
+    std::nth_element(d.data(), d.data()+n/2, d.data()+n);
+    wrapTo = d[n/2];
+    
+    double
+      sum_x = 0.0,
+      sum_xSq = 0.0,
+      mean_y = 0.0,
+      ss_xy = 0.0,
+      sum_weight = 0.0;
+      
+    for(size_t i=0; i!=n; ++i)
+    {
+      double x = data[i];
+      if(x - wrapTo > M_PI)
+        x -= 2.0*M_PI;
+      else if(x - wrapTo < -M_PI)
+        x += 2.0*M_PI;
+      sum_x += frequencies[i] * weights[i];
+      sum_xSq += frequencies[i] * frequencies[i] * weights[i];
+      mean_y += x * weights[i];
+      ss_xy += frequencies[i] * x * weights[i];
+      sum_weight += weights[i];
+    }
+    mean_y /= sum_weight;
+    double mean_x = sum_x / sum_weight;
+    double ss_xx = sum_xSq - mean_x * sum_x;
+    ss_xy -= sum_x * mean_y;
+    b = ss_xy / ss_xx;
+    a = mean_y - b * mean_x;
+  }
+  
+  void fitChunk(size_t chunkSize, size_t pos, const std::vector<double>& nu, const std::vector<double>& data, std::vector<double>& fittedData)
+  {
+    double a, b;
+    PieceWisePhaseFitter::fitSlope(&data[pos], &nu[pos], chunkSize, a, b);
+    for(size_t ch=0; ch!=chunkSize; ++ch)
+      fittedData[ch+pos] = a + b * nu[ch+pos];
+  }
+  
+  void fitChunk(size_t chunkSize, size_t pos, const std::vector<double>& nu, const std::vector<double>& data, const double* weights, std::vector<double>& fittedData)
+  {
+    double a, b;
+    PieceWisePhaseFitter::fitSlope(&data[pos], &nu[pos], &weights[pos], chunkSize, a, b);
+    for(size_t ch=0; ch!=chunkSize; ++ch)
+      fittedData[ch+pos] = a + b * nu[ch+pos];
+  }
+  
+  /**
+  * No longer used -- I tried removing samples that deviated far from the fitted line and refit, but this seemed not to help.
+  */
+  static bool removeDeviations(std::vector<double>& data, std::vector<double>& frequencies, double a, double b, double phaseThreshold)
+  {
+    if(data.empty())
+      return false;
+    double maxDev = 0.0;
+    size_t index = 0;
+    for(size_t i=0; i!=data.size(); ++i)
+    {
+      double deviation = std::fabs(data[i] - (a + b * frequencies[i]));
+      if(deviation >= maxDev)
+      {
+        maxDev = deviation;
+        index = i;
+      }
+    }
+    if(maxDev > phaseThreshold)
+    {
+      data.erase(data.begin() + index);
+      frequencies.erase(frequencies.begin() + index);
+      return true;
+    }
+    else return false;
+  }
+};
+
+#endif
diff --git a/CEP/DP3/DPPP_DDECal/include/DPPP_DDECal/ScreenConstraint.h b/CEP/DP3/DPPP_DDECal/include/DPPP_DDECal/ScreenConstraint.h
index fcd84eb33afbae6bd3e370908682f0252a696edf..4886d1ee5004dbe99625569ce2e2c3d95b576c4f 100644
--- a/CEP/DP3/DPPP_DDECal/include/DPPP_DDECal/ScreenConstraint.h
+++ b/CEP/DP3/DPPP_DDECal/include/DPPP_DDECal/ScreenConstraint.h
@@ -1,8 +1,8 @@
 #ifndef SCREEN_CONSTRAINT_H
 #define SCREEN_CONSTRAINT_H
-#include <DPPP/phasefitter.h>
+#include <DPPP/PhaseFitter.h>
 
-#include <DPPP_DDECal/multidirsolver.h>
+#include <DPPP_DDECal/MultiDirSolver.h>
 #include <DPPP_DDECal/PiercePoint.h>
 #include <DPPP_DDECal/KLFitter.h>
 #include <Common/ParameterSet.h>
@@ -21,8 +21,7 @@ class ScreenConstraint : public Constraint
 public:
   ScreenConstraint(const ParameterSet& parset,
                    const string& prefix);
-  virtual void init(size_t nAntennas, size_t nDirections, 
-                    size_t nChannelBlocks, const double* frequencies);
+  void initialize(size_t nAntennas, size_t nDirections, size_t nChannelBlocks, const double* frequencies);
   virtual std::vector<Constraint::Result> Apply(std::vector<std::vector<MultiDirSolver::DComplex> >& solutions,double time);
   virtual void CalculatePiercepoints();
 
diff --git a/CEP/DP3/DPPP_DDECal/include/DPPP_DDECal/TECConstraint.h b/CEP/DP3/DPPP_DDECal/include/DPPP_DDECal/TECConstraint.h
new file mode 100644
index 0000000000000000000000000000000000000000..647935622d96c3436e68d0bd1a14f6fdb469eb14
--- /dev/null
+++ b/CEP/DP3/DPPP_DDECal/include/DPPP_DDECal/TECConstraint.h
@@ -0,0 +1,89 @@
+#ifndef TEC_CONSTRAINT_H
+#define TEC_CONSTRAINT_H
+
+#ifdef AOPROJECT
+#include "Constraint.h"
+#include "PhaseFitter.h"
+#include "PieceWisePhaseFitter.h"
+#else
+#include <DPPP_DDECal/Constraint.h>
+#include <DPPP_DDECal/PieceWisePhaseFitter.h>
+#include <DPPP/PhaseFitter.h>
+#endif
+
+#include <vector>
+
+class TECConstraintBase : public Constraint
+{
+public:
+  enum Mode {
+    /** Solve for both a (differential) TEC and an XX/YY-common scalar */
+    TECAndCommonScalarMode,
+    /** Solve only for a (differential) TEC value */
+    TECOnlyMode
+  };
+  
+  TECConstraintBase(Mode mode);
+
+  void initialize(size_t nAntennas, size_t nDirections, 
+                  size_t nChannelBlocks, const double* frequencies);
+  
+protected:
+  virtual void initializeChild() { }
+  
+  void applyReferenceAntenna(std::vector<std::vector<dcomplex> >& solutions) const;
+  
+  Mode _mode;
+  size_t _nAntennas, _nDirections, _nChannelBlocks;
+  std::vector<PhaseFitter> _phaseFitters;
+};
+
+class TECConstraint : public TECConstraintBase
+{
+public:
+  TECConstraint(Mode mode) : TECConstraintBase(mode) { }
+
+  virtual std::vector<Result> Apply(
+                    std::vector<std::vector<dcomplex> >& solutions,
+                       double time);
+};
+
+class ApproximateTECConstraint : public TECConstraint
+{
+public:
+  ApproximateTECConstraint(Mode mode) :
+    TECConstraint(mode),
+    _finishedApproximateStage(false),
+    _fittingChunkSize(0),
+    _maxApproxIters(50)
+    { }
+
+  virtual void PrepareIteration(bool hasReachedPrecision, size_t iteration, bool finalIter) {
+    _finishedApproximateStage = hasReachedPrecision || finalIter || iteration >= _maxApproxIters;
+  }
+  
+  virtual bool Satisfied() const { return _finishedApproximateStage; }
+  
+  virtual std::vector<Result> Apply(
+                    std::vector<std::vector<dcomplex> >& solutions,
+                       double time);
+  
+  void SetFittingChunkSize(size_t fittingChunkSize)
+  { _fittingChunkSize = fittingChunkSize; }
+  
+  void SetMaxApproximatingIterations(size_t maxApproxIters)
+  { _maxApproxIters = maxApproxIters; }
+protected:
+  virtual void initializeChild();
+  
+private:
+  bool _finishedApproximateStage;
+  std::vector<PieceWisePhaseFitter> _pwFitters;
+  std::vector<std::vector<double> > _threadData;
+  std::vector<std::vector<double> > _threadFittedData;
+  std::vector<std::vector<double> > _threadWeights;
+  size_t _fittingChunkSize, _maxApproxIters;
+};
+
+#endif
+
diff --git a/CEP/DP3/DPPP_DDECal/include/DPPP_DDECal/multidirsolver.h b/CEP/DP3/DPPP_DDECal/include/DPPP_DDECal/multidirsolver.h
deleted file mode 100644
index 32af51b3c363a3cb5f2ed6bef37e64afb21d86d8..0000000000000000000000000000000000000000
--- a/CEP/DP3/DPPP_DDECal/include/DPPP_DDECal/multidirsolver.h
+++ /dev/null
@@ -1,79 +0,0 @@
-#ifndef MULTI_DIR_SOLVER_H
-#define MULTI_DIR_SOLVER_H
-
-#ifdef AOPROJECT
-#include "phasefitter.h"
-#include "Constraint.h"
-#define UPTR std::unique_ptr
-#else
-#include <DPPP/phasefitter.h>
-#include <DPPP_DDECal/Constraint.h>
-#define UPTR std::auto_ptr
-#endif
-
-#include <armadillo>
-
-#include <complex>
-#include <vector>
-#include <memory>
-
-class MultiDirSolver
-{
-public:
-  typedef std::complex<double> DComplex;
-  typedef std::complex<float> Complex;
-  
-  struct SolveResult {
-    size_t iterations;
-    std::vector<std::vector<Constraint::Result> > _results;
-  };
-  
-  enum CalibrationMode { CalibrateComplexGain, 
-                         CalibrateTEC1, 
-                         CalibrateTEC2, 
-                         CalibratePhase };
-  
-  MultiDirSolver(size_t maxIterations, double accuracy, double stepSize);
-  
-  void init(size_t nAntennas, size_t nDirections, size_t nChannels, 
-            const std::vector<int>& ant1, const std::vector<int>& ant2);
-  
-  // data[i] is een pointer naar de data voor tijdstap i, vanaf die pointer staat het in volgorde als in MS (bl, chan, pol)
-  // mdata[i] is een pointer voor tijdstap i naar arrays van ndir model data pointers (elk van die data pointers staat in zelfde volgorde als data)
-  // solutions[ch] is een pointer voor channelblock ch naar antenna x directions oplossingen.
-  SolveResult process(std::vector<Complex*>& data, std::vector<std::vector<Complex* > >& modelData,
-    std::vector<std::vector<DComplex> >& solutions, double time) const;
-  
-  void set_mode(CalibrationMode mode) { _mode = mode; }
-  
-  void set_channel_blocks(size_t nChannelBlocks) { _nChannelBlocks = nChannelBlocks; }
-  
-  void set_max_iterations(size_t maxIterations) { _maxIterations = maxIterations; }
-  
-  void set_accuracy(double accuracy) { _accuracy = accuracy; }
-  
-  void set_step_size(double stepSize) { _stepSize = stepSize; }
-  
-  void add_constraint(Constraint* constraint) { _constraints.push_back(constraint); }
-  
-private:
-  void performSolveIteration(size_t channelBlockIndex,
-                             std::vector<arma::cx_mat>& gTimesCs,
-                             std::vector<arma::cx_vec>& vs,
-                             const std::vector<DComplex>& solutions,
-                             std::vector<DComplex>& nextSolutions,
-                             const std::vector<Complex *>& data,
-                             const std::vector<std::vector<Complex *> >& modelData) const;
-  
-  size_t _nAntennas, _nDirections, _nChannels, _nChannelBlocks;
-  std::vector<int> _ant1, _ant2;
-  
-  // Calibration setup
-  enum CalibrationMode _mode;
-  size_t _maxIterations;
-  double _accuracy;
-  double _stepSize;
-  std::vector<Constraint*> _constraints;
-};
-
-#endif
diff --git a/CEP/DP3/DPPP_DDECal/src/CMakeLists.txt b/CEP/DP3/DPPP_DDECal/src/CMakeLists.txt
index 0e43f83595ff94ea052c261c1ce93f5dd47c54fd..8f2fdf937db7af4af1768f2766a8f42299739121 100644
--- a/CEP/DP3/DPPP_DDECal/src/CMakeLists.txt
+++ b/CEP/DP3/DPPP_DDECal/src/CMakeLists.txt
@@ -5,7 +5,7 @@ include(LofarPackageVersion)
 lofar_add_library(dppp_ddecal
   Package__Version.cc
   DDECal.cc Register.cc
-  KLFitter.cc DDECal.cc multidirsolver.cc Constraint.cc ScreenConstraint.cc PiercePoint.cc
+  KLFitter.cc DDECal.cc MultiDirSolver.cc Constraint.cc PiercePoint.cc ScreenConstraint.cc TECConstraint.cc
 )
 
 lofar_add_bin_program(versiondppp_ddecal versiondppp_ddecal.cc)
diff --git a/CEP/DP3/DPPP_DDECal/src/Constraint.cc b/CEP/DP3/DPPP_DDECal/src/Constraint.cc
index aa0dcdbc6b416b41454f5c5613658fc040203942..62bd04b7efa5c7120de1963e61621cf33c9e4fd5 100644
--- a/CEP/DP3/DPPP_DDECal/src/Constraint.cc
+++ b/CEP/DP3/DPPP_DDECal/src/Constraint.cc
@@ -1,17 +1,14 @@
 #ifdef AOPROJECT
 #include "Constraint.h"
-#include <omp.h> // for tec constraints
 #else
 #include <DPPP_DDECal/Constraint.h>
-#include <Common/OpenMP.h>
 #endif
 
-
-std::vector<Constraint::Result> PhaseConstraint::Apply(
+std::vector<Constraint::Result> PhaseOnlyConstraint::Apply(
     std::vector<std::vector<dcomplex> >& solutions, double)
 {
-  for (uint ch=0; ch<solutions.size(); ++ch) {
-    for (uint solIndex=0; solIndex<solutions[ch].size(); ++solIndex) {
+  for (size_t ch=0; ch<solutions.size(); ++ch) {
+    for (size_t solIndex=0; solIndex<solutions[ch].size(); ++solIndex) {
       solutions[ch][solIndex] /= std::abs(solutions[ch][solIndex]);
     }
   }
@@ -19,87 +16,32 @@ std::vector<Constraint::Result> PhaseConstraint::Apply(
   return std::vector<Constraint::Result>();
 }
 
-TECConstraint::TECConstraint(Mode mode) :
-  _mode(mode),
-  _nAntennas(0)
-  ,_nDirections(0),
-  _nChannelBlocks(0),
-  _phaseFitters()
-{
-}
-
-TECConstraint::TECConstraint(Mode mode, size_t nAntennas, size_t nDirections, 
-                             size_t nChannelBlocks, const double* frequencies) :
-  _mode(mode)
+std::vector<Constraint::Result> AmplitudeOnlyConstraint::Apply(
+    std::vector<std::vector<dcomplex> >& solutions, double)
 {
-  init(nAntennas, nDirections, nChannelBlocks, frequencies);
-}
-
-void TECConstraint::init(size_t nAntennas, size_t nDirections, 
-                         size_t nChannelBlocks, const double* frequencies) {
-  _nAntennas = nAntennas;
-  _nDirections = nDirections;
-  _nChannelBlocks = nChannelBlocks;
-  _phaseFitters.resize(
-#ifdef AOPROJECT
-      omp_get_max_threads()
-#else
-      LOFAR::OpenMP::maxThreads()
-#endif
-   );
-
-  for(size_t i=0; i!=_phaseFitters.size(); ++i)
-  {
-    _phaseFitters[i].SetChannelCount(_nChannelBlocks);
-    std::memcpy(_phaseFitters[i].FrequencyData(), frequencies, sizeof(double) * _nChannelBlocks);
+  for (size_t ch=0; ch<solutions.size(); ++ch) {
+    for (size_t solIndex=0; solIndex<solutions[ch].size(); ++solIndex) {
+      solutions[ch][solIndex] = std::abs(solutions[ch][solIndex]);
+    }
   }
+
+  return std::vector<Constraint::Result>();
 }
 
-std::vector<Constraint::Result> TECConstraint::Apply(
+std::vector<Constraint::Result> DiagonalConstraint::Apply(
     std::vector<std::vector<dcomplex> >& solutions, double)
 {
-  std::vector<Constraint::Result> res(2);
-
-  res[0].vals.resize(_nAntennas*_nDirections);
-  res[0].axes="ant,dir,freq";
-  res[0].name="tec";
-  res[0].dims.resize(3);
-  res[0].dims[0]=_nAntennas;
-  res[0].dims[1]=_nDirections;
-  res[0].dims[2]=1;
-  res[1]=res[0];
-  res[1].name="scalarphase";
-  
-#pragma omp parallel for
-  for(size_t solutionIndex = 0; solutionIndex<_nAntennas*_nDirections; ++solutionIndex)
+  if(_polsPerSolution == 4)
   {
-    size_t thread =
-#ifdef AOPROJECT
-        omp_get_thread_num();
-#else
-        LOFAR::OpenMP::threadNum();
-#endif
-
-    for(size_t ch=0; ch!=_nChannelBlocks; ++ch) {
-      _phaseFitters[thread].PhaseData()[ch] = std::arg(solutions[ch][solutionIndex]);
-    }
-    
-    double alpha, beta=0.0;
-    if(_mode == TECOnlyMode) {
-      _phaseFitters[thread].FitDataToTEC1Model(alpha);
-    } else {
-      _phaseFitters[thread].FitDataToTEC2Model(alpha, beta);
-    }
-
-    res[0].vals[solutionIndex] = alpha / -8.44797245e9;
-    res[1].vals[solutionIndex] = beta;
-    
-    for(size_t ch=0; ch!=_nChannelBlocks; ++ch) {
-     solutions[ch][solutionIndex] = std::polar<double>(1.0, _phaseFitters[thread].PhaseData()[ch]);
+    for (size_t ch=0; ch<solutions.size(); ++ch) {
+      for (size_t solIndex=0; solIndex<solutions[ch].size(); solIndex += 4) {
+        solutions[ch][solIndex+1] = 0.0;
+        solutions[ch][solIndex+2] = 0.0;
+      }
     }
   }
 
-  return res;
+  return std::vector<Constraint::Result>();
 }
 
 std::vector<Constraint::Result> CoreConstraint::Apply(
diff --git a/CEP/DP3/DPPP_DDECal/src/DDECal.cc b/CEP/DP3/DPPP_DDECal/src/DDECal.cc
index cf7e73e00816b92d753fd4458bf0d188c303a68d..be289dc3a1e4b629cff39e3069f1495f0d0148ac 100644
--- a/CEP/DP3/DPPP_DDECal/src/DDECal.cc
+++ b/CEP/DP3/DPPP_DDECal/src/DDECal.cc
@@ -23,21 +23,27 @@
 
 #include <lofar_config.h>
 #include <DPPP_DDECal/DDECal.h>
-#include <DPPP/Simulate.h>
+
 #include <DPPP/ApplyCal.h>
 #include <DPPP/DPBuffer.h>
 #include <DPPP/DPInfo.h>
-#include <DPPP/SourceDBUtil.h>
-#include <DPPP/MSReader.h>
 #include <DPPP/DPLogger.h>
+#include <DPPP/MSReader.h>
+#include <DPPP/Simulate.h>
+#include <DPPP/SourceDBUtil.h>
+
 #include <DPPP_DDECal/ScreenConstraint.h>
+#include <DPPP_DDECal/TECConstraint.h>
+
 #include <ParmDB/ParmDB.h>
 #include <ParmDB/ParmValue.h>
 #include <ParmDB/SourceDB.h>
-#include <Common/ParameterSet.h>
-#include <Common/StringUtil.h>
+
 #include <Common/LofarLogger.h>
 #include <Common/OpenMP.h>
+#include <Common/ParameterSet.h>
+#include <Common/StreamUtil.h>
+#include <Common/StringUtil.h>
 
 #include <fstream>
 #include <ctime>
@@ -56,6 +62,7 @@
 
 #include <limits>
 #include <iostream>
+#include <sstream>
 #include <iomanip>
 
 using namespace casacore;
@@ -84,13 +91,18 @@ namespace LOFAR {
         itsNFreqCells    (0),
         itsCoreConstraint(parset.getDouble (prefix + "coreconstraint", 0.0)),
         itsScreenCoreConstraint(parset.getDouble (prefix + "tecscreen.coreconstraint", 0.0)),
-        itsMultiDirSolver(parset.getInt (prefix + "maxiter", 50),
-                          parset.getDouble (prefix + "tolerance", 1.e-5),
-                          parset.getDouble (prefix + "stepsize", 0.2))
+        itsFullMatrixMinimalization(false),
+        itsApproximateTEC(false)
     {
       vector<string> strDirections = 
          parset.getStringVector (prefix + "directions",
                                  vector<string> ());
+         
+      itsMultiDirSolver.set_max_iterations(parset.getInt(prefix + "maxiter", 50));
+      double tolerance = parset.getDouble(prefix + "tolerance", 1.e-5);
+      itsMultiDirSolver.set_accuracy(tolerance);
+      itsMultiDirSolver.set_constraint_accuracy(parset.getDouble(prefix + "approxtolerance", tolerance*10.0));
+      itsMultiDirSolver.set_step_size(parset.getDouble(prefix + "stepsize", 0.2));
 
       // Default directions are all patches
       if (strDirections.empty()) {
@@ -116,22 +128,86 @@ namespace LOFAR {
         itsConstraints.push_back(casacore::CountedPtr<Constraint>(
           new CoreConstraint()));
       }
-      if (itsMode == GainCal::PHASEONLY) {
-        itsConstraints.push_back(casacore::CountedPtr<Constraint>(
-                  new PhaseConstraint()));
-      } else if (itsMode == GainCal::TEC) {
-        itsConstraints.push_back(casacore::CountedPtr<Constraint>(
-                  new TECConstraint(TECConstraint::TECOnlyMode)));
-      } else if (itsMode == GainCal::TECANDPHASE){
-        itsConstraints.push_back(casacore::CountedPtr<Constraint>(
-                  new TECConstraint(TECConstraint::TECAndCommonScalarMode)));
-      } else if (itsMode == GainCal::COMPLEXGAIN) {
-        // no constraints
-      } else if (itsMode == GainCal::TECSCREEN) {
-        itsConstraints.push_back(casacore::CountedPtr<Constraint>(
-		  new ScreenConstraint(parset, prefix+"tecscreen.")));
-      } else {
-        THROW (Exception, "Unexpected mode: " << 
+      switch(itsMode) {
+        case GainCal::COMPLEXGAIN:
+          itsConstraints.push_back(casacore::CountedPtr<Constraint>(
+                    new DiagonalConstraint(4)));
+          itsMultiDirSolver.set_phase_only(false);
+          itsFullMatrixMinimalization = true;
+          break;
+        case GainCal::SCALARCOMPLEXGAIN:
+          // no constraints
+          itsMultiDirSolver.set_phase_only(false);
+          itsFullMatrixMinimalization = false;
+          break;
+        case GainCal::FULLJONES:
+          // no constraints
+          itsMultiDirSolver.set_phase_only(false);
+          itsFullMatrixMinimalization = true;
+          break;
+        case GainCal::PHASEONLY:
+          itsConstraints.push_back(casacore::CountedPtr<Constraint>(
+                    new PhaseOnlyConstraint()));
+          itsConstraints.push_back(casacore::CountedPtr<Constraint>(
+                    new DiagonalConstraint(4)));
+          itsMultiDirSolver.set_phase_only(true);
+          itsFullMatrixMinimalization = true;
+          break;
+        case GainCal::SCALARPHASE:
+          itsConstraints.push_back(casacore::CountedPtr<Constraint>(
+                    new PhaseOnlyConstraint()));
+          itsMultiDirSolver.set_phase_only(true);
+          break;
+        case GainCal::AMPLITUDEONLY:
+          itsConstraints.push_back(casacore::CountedPtr<Constraint>(
+                    new DiagonalConstraint(4)));
+          itsConstraints.push_back(casacore::CountedPtr<Constraint>(
+                    new AmplitudeOnlyConstraint()));
+          itsMultiDirSolver.set_phase_only(false);
+          itsFullMatrixMinimalization = true;
+          break;
+        case GainCal::SCALARAMPLITUDE:
+          itsConstraints.push_back(casacore::CountedPtr<Constraint>(
+                    new AmplitudeOnlyConstraint()));
+          itsMultiDirSolver.set_phase_only(false);
+          itsFullMatrixMinimalization = false;
+          break;
+        case GainCal::TEC:
+        case GainCal::TECANDPHASE:
+          itsApproximateTEC = parset.getBool(prefix + "approximatetec", false);
+          if(itsApproximateTEC)
+          {
+            int iters = parset.getInt(prefix + "maxapproxiter", itsMultiDirSolver.max_iterations()/2);
+            casacore::CountedPtr<ApproximateTECConstraint> ptr;
+            if(itsMode == GainCal::TEC)
+              ptr = casacore::CountedPtr<ApproximateTECConstraint>(
+                new ApproximateTECConstraint(TECConstraint::TECOnlyMode));
+            else
+              ptr = casacore::CountedPtr<ApproximateTECConstraint>(
+                new ApproximateTECConstraint(TECConstraint::TECAndCommonScalarMode));
+            // user setting? : ptr->SetFittingChunkSize(fittingChunkSize);
+            ptr->SetMaxApproximatingIterations(iters);
+            itsConstraints.push_back(ptr);
+          }
+          else {
+            if(itsMode == GainCal::TEC)
+              itsConstraints.push_back(casacore::CountedPtr<Constraint>(
+                new TECConstraint(TECConstraint::TECOnlyMode)));
+              else
+              itsConstraints.push_back(casacore::CountedPtr<Constraint>(
+                new TECConstraint(TECConstraint::TECAndCommonScalarMode)));
+          }
+          itsMultiDirSolver.set_phase_only(true);
+          itsFullMatrixMinimalization = false;
+          break;
+        case GainCal::TECSCREEN:
+          itsConstraints.push_back(casacore::CountedPtr<Constraint>(
+                    new ScreenConstraint(parset, prefix+"tecscreen.")));
+          itsMultiDirSolver.set_phase_only(true);
+          itsFullMatrixMinimalization = false;
+          break;
+        default:
+          THROW (Exception, "Unexpected mode: " << 
                           GainCal::calTypeToString(itsMode));
       }
 
@@ -216,17 +292,16 @@ namespace LOFAR {
 
       itsH5Parm.addAntennas(antennaNames, antennaPos);
 
-      std::vector<std::string> sourceNames(itsDirections.size());
       std::vector<std::pair<double, double> > sourcePositions(itsDirections.size());
       for (uint i=0; i<itsDirections.size(); ++i) {
-        sourceNames[i]=itsDirections[i][0]; // This only gives the name of the first patch
-        sourcePositions[i]=itsPredictSteps[i].getFirstDirection();
+        sourcePositions[i] = itsPredictSteps[i].getFirstDirection();
       }
-      itsH5Parm.addSources(sourceNames, sourcePositions);
+      itsH5Parm.addSources(getDirectionNames(), sourcePositions);
 
       uint nSolTimes = (info().ntime()+itsSolInt-1)/itsSolInt;
       itsSols.resize(nSolTimes);
       itsNIter.resize(nSolTimes);
+      itsNApproxIter.resize(nSolTimes);
       itsConstraintSols.resize(nSolTimes);
 
       vector<double> chanFreqs(info().nchan());  //nChannelBlocks
@@ -235,13 +310,8 @@ namespace LOFAR {
       }
 
       for (uint i=0; i<itsConstraints.size();++i) {
-        itsConstraints[i]->init(
-            info().antennaNames().size(),
-            itsDirections.size(),
-            info().nchan(), //nChannelBlocks
-            &(chanFreqs[0])
-        );
-        
+        // Different constraints need different information. Determine if the constraint is
+        // of a type that needs more information, and if so initialize the constraint.
         CoreConstraint* coreConstraint = dynamic_cast<CoreConstraint*>(itsConstraints[i].get());
         if(coreConstraint != 0)
         {
@@ -261,12 +331,21 @@ namespace LOFAR {
             if(distSq <= coreDistSq)
               coreAntennaIndices.insert(ant);
           }
-          coreConstraint->setCoreAntennas(coreAntennaIndices);
+          coreConstraint->initialize(info().antennaNames().size(),
+            itsDirections.size(),
+            info().nchan(),
+            coreAntennaIndices);
         }
         
         ScreenConstraint* screenConstraint = dynamic_cast<ScreenConstraint*>(itsConstraints[i].get());
         if(screenConstraint != 0)
         {
+          screenConstraint->initialize(
+              info().antennaNames().size(),
+              itsDirections.size(),
+              info().nchan(), //nChannelBlocks
+              &(chanFreqs[0])
+          );
           screenConstraint->setAntennaPositions(antennaPos);
           screenConstraint->setDirections(sourcePositions);
           screenConstraint->initPiercePoints();
@@ -286,12 +365,21 @@ namespace LOFAR {
               distSq = dx*dx + dy*dy + dz*dz;
             if(distSq <= coreDistSq)
               coreAntennaIndices.push_back(ant);
-	    else
-	      otherAntennaIndices.push_back(ant);
+            else
+              otherAntennaIndices.push_back(ant);
           }
           screenConstraint->setCoreAntennas(coreAntennaIndices);
           screenConstraint->setOtherAntennas(otherAntennaIndices);
         }
+        
+        TECConstraintBase* tecConstraint = dynamic_cast<TECConstraintBase*>(itsConstraints[i].get());
+        if(tecConstraint != 0)
+        {
+          tecConstraint->initialize(info().antennaNames().size(),
+              itsDirections.size(),
+              info().nchan(), //nChannelBlocks
+              &(chanFreqs[0]));
+        }
       }
 
       uint nSt = info().antennaNames().size();
@@ -311,6 +399,7 @@ namespace LOFAR {
       os << "  mode (constraints):  " << GainCal::calTypeToString(itsMode) 
          << endl;
       os << "  coreconstraint:      " << itsCoreConstraint << endl;
+      os << "  approximate fitter:  " << itsApproximateTEC << endl;
       for (uint i=0; i<itsPredictSteps.size(); ++i) {
         itsPredictSteps[i].show(os);
       }
@@ -337,23 +426,62 @@ namespace LOFAR {
 
       os << "Iterations taken: [";
       for (uint i=0; i<itsNIter.size()-1; ++i) {
-        os<<itsNIter[i]<<",";
+        os<<itsNIter[i];
+        if(itsNApproxIter[i]!=0)
+          os << '|' << itsNApproxIter[i];
+        os<<",";
       }
-      os<<itsNIter[itsNIter.size()-1]<<"]"<<endl;
+      os<<itsNIter[itsNIter.size()-1];
+        if(itsNApproxIter[itsNIter.size()-1]!=0)
+          os << '|' << itsNApproxIter[itsNIter.size()-1];
+      os<<"]"<<endl;
     }
 
-    void DDECal::initializeSolutions() {
+    void DDECal::initializeScalarSolutions() {
       if (itsTimeStep/itsSolInt>0 && itsPropagateSolutions) {
         // initialize solutions with those of the previous step
         itsSols[itsTimeStep/itsSolInt] = itsSols[itsTimeStep/itsSolInt-1];
       } else {
         // initialize solutions with 1.
-        for (vector<vector<DComplex> >::iterator solveciter = itsSols[itsTimeStep/itsSolInt].begin();
-             solveciter != itsSols[itsTimeStep/itsSolInt].end(); ++solveciter) {
-           (*solveciter).assign(itsDirections.size()*info().antennaNames().size(), 1.0);
+        size_t n = itsDirections.size()*info().antennaNames().size();
+        for (vector<DComplex>& solvec : itsSols[itsTimeStep/itsSolInt]) {
+          solvec.assign(n, 1.0);
+        }
+      }
+    }
+
+    void DDECal::initializeFullMatrixSolutions() {
+      if (itsTimeStep/itsSolInt>0 && itsPropagateSolutions) {
+        // initialize solutions with those of the previous step
+        itsSols[itsTimeStep/itsSolInt] = itsSols[itsTimeStep/itsSolInt-1];
+      } else {
+        // initialize solutions with unity matrix [1 0 ; 0 1].
+        size_t n = itsDirections.size()*info().antennaNames().size();
+        for (vector<DComplex>& solvec : itsSols[itsTimeStep/itsSolInt]) {
+          solvec.resize(n*4);
+          for(size_t i=0; i!=n; ++i)
+          {
+            solvec[i*4 + 0] = 1.0;
+            solvec[i*4 + 1] = 0.0;
+            solvec[i*4 + 2] = 0.0;
+            solvec[i*4 + 3] = 1.0;
+          }
         }
       }
     }
+    
+    vector<string> DDECal::getDirectionNames() {
+      vector<string> res;
+      
+      for (vector<vector<string> >::iterator dirIter = itsDirections.begin();
+           dirIter != itsDirections.end();
+           dirIter++) {
+        stringstream ss;
+        ss << (*dirIter);
+        res.push_back(ss.str());
+      }
+      return res;
+    }
 
     bool DDECal::process (const DPBuffer& bufin)
     {
@@ -368,7 +496,9 @@ namespace LOFAR {
 
       itsTimerPredict.start();
 
-#pragma omp parallel for
+//      if(itsPredictSteps.size() < LOFAR::OpenMP::maxThreads())
+//        LOFAR::OpenMP::setNested(true);
+#pragma omp parallel for schedule(dynamic) if(itsPredictSteps.size()>1)
       for (size_t dir=0; dir<itsPredictSteps.size(); ++dir) {
         itsPredictSteps[dir].process(itsBufs[itsStepInSolInt]);
         itsModelDataPtrs[itsStepInSolInt][dir] =
@@ -406,18 +536,38 @@ namespace LOFAR {
       itsAvgTime += itsAvgTime + bufin.getTime();
 
       if (itsStepInSolInt==itsSolInt-1) {
-        initializeSolutions();
+        if(itsFullMatrixMinimalization)
+          initializeFullMatrixSolutions();
+        else
+          initializeScalarSolutions();
 
         itsTimerSolve.start();
-        MultiDirSolver::SolveResult solveResult = 
-                  itsMultiDirSolver.process(itsDataPtrs, itsModelDataPtrs,
-                  itsSols[itsTimeStep/itsSolInt],
-                  itsAvgTime / itsSolInt);
+        MultiDirSolver::SolveResult solveResult;
+        if(itsFullMatrixMinimalization)
+        {
+          solveResult = itsMultiDirSolver.processFullMatrix(itsDataPtrs, itsModelDataPtrs,
+            itsSols[itsTimeStep/itsSolInt],
+            itsAvgTime / itsSolInt);
+        }
+        else {
+          solveResult = itsMultiDirSolver.processScalar(itsDataPtrs, itsModelDataPtrs,
+            itsSols[itsTimeStep/itsSolInt],
+            itsAvgTime / itsSolInt);
+        }
         itsTimerSolve.stop();
 
         itsNIter[itsTimeStep/itsSolInt] = solveResult.iterations;
-        // Store constraint solutions
-        if (itsMode!=GainCal::COMPLEXGAIN && itsMode!=GainCal::PHASEONLY) {
+        itsNApproxIter[itsTimeStep/itsSolInt] = solveResult.constraintIterations;
+
+        // Store constraint solutions if any constaint has a non-empty result
+        bool someConstraintHasResult = false;
+        for (uint constraintnum=0; constraintnum<solveResult._results.size(); ++constraintnum) {
+          if (!solveResult._results[constraintnum].empty()) {
+            someConstraintHasResult = true;
+            break;
+          }
+        }
+        if (someConstraintHasResult) {
           itsConstraintSols[itsTimeStep/itsSolInt]=solveResult._results;
         }
 
@@ -443,52 +593,85 @@ namespace LOFAR {
       itsTimerWrite.start();
 
       uint nDir = itsDirections.size();
-
-      vector<double> weights(info().nchan()*info().nantenna()*info().ntime()*itsDirections.size(),1.);
+      uint nPol = 1;
+      if(itsMode == GainCal::COMPLEXGAIN ||
+         itsMode == GainCal::PHASEONLY ||
+         itsMode == GainCal::AMPLITUDEONLY ||
+         itsMode == GainCal::FULLJONES) {
+        nPol = 2;
+      } else if (itsMode == GainCal::FULLJONES) {
+        nPol = 4;
+      }
 
       if (itsConstraintSols[0].empty()) {
         // Record the actual iterands of the solver
-        vector<DComplex> sols(info().nchan()*info().nantenna()*info().ntime()*nDir);
+        vector<DComplex> sols(info().nchan()*info().nantenna()*info().ntime()*nDir*nPol);
         size_t i=0;
 
+        // For nPol=1, loop over pol runs just once
+        // For nPol=2, it runs over values 0 and 2 (picking diagonal elements from 4 pols)
+        // For nPol=4, it runs over 0, 1, 2, 3
+        uint polIncr= (itsMode==GainCal::FULLJONES?1:3);
+        uint maxPol = (nPol>1?4:1);
         // Put solutions in a contiguous piece of memory
-        for (uint dir=0; dir<nDir; ++dir) {
-          for (uint ant=0; ant<info().nantenna(); ++ant) {
-            for (uint chan=0; chan<info().nchan(); ++chan) {
-              for (uint time=0; time<itsSols.size(); ++time) {
-                ASSERT(!itsSols[time].empty());
-                sols[i] = itsSols[time][chan][ant*nDir+dir];
-                ++i;
+        for (uint time=0; time<itsSols.size(); ++time) {
+          for (uint chan=0; chan<info().nchan(); ++chan) {
+            for (uint ant=0; ant<info().nantenna(); ++ant) {
+              for (uint dir=0; dir<nDir; ++dir) {
+                for (uint pol=0; pol<maxPol; pol+=polIncr) {
+                  ASSERT(!itsSols[time].empty());
+                  sols[i] = itsSols[time][chan][ant*nDir*maxPol+dir*maxPol+pol];
+                  ++i;
+                }
               }
             }
           }
         }
-        string axesnames="dir,ant,freq,time";
-        vector<hsize_t> dims(4);
-        dims[0]=nDir;
-        dims[1]=info().nantenna();
-        dims[2]=info().nchan();
-        dims[3]=itsSols.size();
-
-        uint numsols=(itsMode==GainCal::COMPLEXGAIN?2:1);
+        vector<H5Parm::AxisInfo> axes;
+        axes.push_back(H5Parm::AxisInfo("time", itsSols.size()));
+        axes.push_back(H5Parm::AxisInfo("freq", info().nchan()));
+        axes.push_back(H5Parm::AxisInfo("ant", info().nantenna()));
+        axes.push_back(H5Parm::AxisInfo("dir", nDir));
+        if (nPol>1) {
+          axes.push_back(H5Parm::AxisInfo("pol", nPol));
+        }
+
+        uint numsols = 1;
+        // For [scalar]complexgain, store two soltabs: phase and amplitude
+        if (itsMode == GainCal::COMPLEXGAIN ||
+            itsMode == GainCal::SCALARCOMPLEXGAIN) {
+          numsols = 2;
+        }
         for (uint solnum=0; solnum<numsols; ++solnum) {
           string solTabName;
-          if (itsMode==GainCal::PHASEONLY) {
-            solTabName = "phaseonly000";
-            itsH5Parm.addSolution(solTabName, "scalarphase", axesnames,
-                                  dims, sols, weights, false);
-          } else if (itsMode==GainCal::COMPLEXGAIN) {
-            if (solnum==0) {
-              solTabName = "scalarphase000";
-              itsH5Parm.addSolution(solTabName, "scalarphase", axesnames,
-                                    dims, sols, weights, false);
-            } else {
-              solTabName = "scalaramplitude000";
-              itsH5Parm.addSolution(solTabName, "scalaramplitude", axesnames,
-                                    dims, sols, weights, true);
-            }
-          } else {
-            THROW(Exception, "Constraint should have produced output");
+          H5Parm::SolTab soltab;
+          switch (itsMode) {
+            case GainCal::SCALARPHASE:
+            case GainCal::PHASEONLY:
+              solTabName = "phase000";
+              soltab = itsH5Parm.createSolTab(solTabName, "phase", axes);
+              soltab.setComplexValues(sols, vector<double>(), false);
+              break;
+            case GainCal::SCALARCOMPLEXGAIN:
+            case GainCal::COMPLEXGAIN:
+              if (solnum==0) {
+                solTabName = "phase000";
+                soltab = itsH5Parm.createSolTab(solTabName, "phase", axes);
+                soltab.setComplexValues(sols, vector<double>(), false);
+              } else {
+                solTabName = "amplitude000";
+                soltab = itsH5Parm.createSolTab(solTabName, "amplitude", axes);
+                soltab.setComplexValues(sols, vector<double>(), true);
+              }
+              break;
+            case GainCal::SCALARAMPLITUDE:
+            case GainCal::AMPLITUDEONLY:
+              solTabName = "amplitude000";
+              soltab = itsH5Parm.createSolTab(solTabName, "amplitude", axes);
+              soltab.setComplexValues(sols, vector<double>(), true);
+              break;
+            default: 
+              THROW(Exception, "Constraint should have produced output");
           }
           // Tell H5Parm that all antennas and directions were used 
           // TODO: do this more cleanly
@@ -496,20 +679,16 @@ namespace LOFAR {
           for (uint i=0; i<info().antennaNames().size(); ++i) {
             antennaNames[i]=info().antennaNames()[i];
           }
-          itsH5Parm.setSolAntennas(solTabName, antennaNames);
+          soltab.setAntennas(antennaNames);
     
-          std::vector<std::string> sourceNames(itsDirections.size());
-          for (uint i=0; i<itsDirections.size(); ++i) {
-            sourceNames[i]=itsDirections[i][0]; // This only gives the name of the first patch
-          }
-          itsH5Parm.setSolSources(solTabName, sourceNames);
+          soltab.setSources(getDirectionNames());
    
           // Set channel to frequency of middle channel 
           vector<double> chanFreqs(info().nchan());
           for (uint chan=0; chan<info().nchan(); ++chan) {
             chanFreqs[chan] = info().chanFreqs()[chan];
           }
-          itsH5Parm.setFreqs(solTabName, chanFreqs);
+          soltab.setFreqs(chanFreqs);
     
           uint nSolTimes = (info().ntime()+itsSolInt-1)/itsSolInt;
           vector<double> solTimes(nSolTimes);
@@ -518,7 +697,7 @@ namespace LOFAR {
             solTimes[t] = starttime+t*info().timeInterval()*itsSolInt+0.5*info().timeInterval();
           }
           // End TODO
-          itsH5Parm.setTimes(solTabName, solTimes);
+          soltab.setTimes(solTimes);
         } // solnums loop
       } else {
         // Record the Constraint::Result in the H5Parm
@@ -532,29 +711,35 @@ namespace LOFAR {
             // Get the result of the constraint solution at first time to get metadata
             Constraint::Result firstResult = itsConstraintSols[0][constraintNum][solNameNum];
 
-            vector<hsize_t> dims(firstResult.dims.size()+1); // Add time dimension
-            dims[dims.size()-1]=itsConstraintSols.size();
-            size_t numSols=dims[dims.size()-1];
-            for (uint i=0; i<dims.size()-1; ++i) {
-              dims[i] = firstResult.dims[i]; 
+            vector<hsize_t> dims(firstResult.dims.size()+1); // Add time dimension at beginning
+            dims[0]=itsConstraintSols.size(); // Number of times
+            size_t numSols=dims[0];
+            for (uint i=1; i<dims.size(); ++i) {
+              dims[i] = firstResult.dims[i-1];
               numSols *= dims[i];
             }
 
-            string axesnames = firstResult.axes + ",time";
+            vector<string> firstaxesnames = StringUtil::tokenize(firstResult.axes,",");
+
+            vector<H5Parm::AxisInfo> axes;
+            axes.push_back(H5Parm::AxisInfo("time", itsConstraintSols.size()));
+            for (size_t axisNum=0; axisNum<firstaxesnames.size(); ++axisNum) {
+              axes.push_back(H5Parm::AxisInfo(firstaxesnames[axisNum], firstResult.dims[axisNum]));
+            }
 
             // Put solutions in a contiguous piece of memory
             vector<double> sols(numSols);
-            size_t posInFlatSol=0;
-            for (uint i=0; i<firstResult.vals.size(); ++i) {
-              for (uint time=0; time<itsSols.size(); ++time) {
-                sols[posInFlatSol++] = 
-                  itsConstraintSols[time][constraintNum][solNameNum].vals[i];
-              }
+            vector<double>::iterator nextpos = sols.begin();
+            for (uint time=0; time<itsSols.size(); ++time) {
+              nextpos = std::copy(
+                itsConstraintSols[time][constraintNum][solNameNum].vals.begin(),
+                itsConstraintSols[time][constraintNum][solNameNum].vals.end(),
+                nextpos);
             }
 
             string solTabName = firstResult.name+"000";
-            itsH5Parm.addSolution(solTabName, firstResult.name, 
-                                  axesnames, dims, sols, weights);
+            H5Parm::SolTab soltab = itsH5Parm.createSolTab(solTabName, firstResult.name, axes);
+            soltab.setValues(sols, vector<double>());
 
             // Tell H5Parm that all antennas and directions were used 
             // TODO: do this more cleanly
@@ -562,18 +747,14 @@ namespace LOFAR {
             for (uint i=0; i<info().antennaNames().size(); ++i) {
               antennaNames[i]=info().antennaNames()[i];
             }
-            itsH5Parm.setSolAntennas(solTabName, antennaNames);
+            soltab.setAntennas(antennaNames);
       
-            std::vector<std::string> sourceNames(itsDirections.size());
-            for (uint i=0; i<itsDirections.size(); ++i) {
-              sourceNames[i]=itsDirections[i][0]; // This only gives the name of the first patch
-            }
-            itsH5Parm.setSolSources(solTabName, sourceNames);
+            soltab.setSources(getDirectionNames());
      
             // Set channel to frequency of middle channel 
             vector<double> oneFreq(1);
             oneFreq[0] = info().chanFreqs()[info().nchan()/2];
-            itsH5Parm.setFreqs(solTabName, oneFreq);
+            soltab.setFreqs(oneFreq);
       
             uint nSolTimes = (info().ntime()+itsSolInt-1)/itsSolInt;
             vector<double> solTimes(nSolTimes);
@@ -581,13 +762,12 @@ namespace LOFAR {
             for (uint t=0; t<nSolTimes; ++t) {
               solTimes[t] = starttime+t*info().timeInterval()*itsSolInt+0.5*info().timeInterval();
             }
-            itsH5Parm.setTimes(solTabName, solTimes);
+            soltab.setTimes(solTimes);
             // End TODO 
           }
         }
       }
 
-
       itsTimerWrite.stop();
       itsTimer.stop();
     }
@@ -597,7 +777,10 @@ namespace LOFAR {
       itsTimer.start();
 
       if (itsStepInSolInt!=0) {
-         initializeSolutions();
+        if(itsFullMatrixMinimalization)
+          initializeFullMatrixSolutions();
+        else
+          initializeScalarSolutions();
 
         //shrink itsDataPtrs, itsModelDataPtrs
         std::vector<casacore::Complex*>(itsDataPtrs.begin(),
@@ -605,7 +788,7 @@ namespace LOFAR {
         std::vector<std::vector<casacore::Complex*> >(itsModelDataPtrs.begin(),
                     itsModelDataPtrs.begin()+itsStepInSolInt).swap(itsModelDataPtrs);
         itsTimerSolve.start();
-        itsMultiDirSolver.process(itsDataPtrs, itsModelDataPtrs,
+        itsMultiDirSolver.processScalar(itsDataPtrs, itsModelDataPtrs,
                                   itsSols[itsTimeStep/itsSolInt],
                                   itsAvgTime/itsStepInSolInt);
         itsTimerSolve.stop();
diff --git a/CEP/DP3/DPPP_DDECal/src/MultiDirSolver.cc b/CEP/DP3/DPPP_DDECal/src/MultiDirSolver.cc
new file mode 100644
index 0000000000000000000000000000000000000000..5b390b3d46ac4451d9a65f610bf7d0378e29e89f
--- /dev/null
+++ b/CEP/DP3/DPPP_DDECal/src/MultiDirSolver.cc
@@ -0,0 +1,525 @@
+
+#ifdef AOPROJECT
+#include "MultiDirSolver.h"
+#include "Matrix2x2.h"
+#else
+#include <DPPP_DDECal/MultiDirSolver.h>
+#include <DPPP_DDECal/Matrix2x2.h>
+#endif
+
+using namespace arma;
+
+MultiDirSolver::MultiDirSolver() :
+  _nAntennas(0),
+  _nDirections(0),
+  _nChannels(0),
+  _nChannelBlocks(0),
+  _maxIterations(100),
+  _accuracy(1e-5),
+  _constraintAccuracy(1e-4),
+  _stepSize(0.2),
+  _phaseOnly(false)
+{
+}
+
+void MultiDirSolver::init(size_t nAntennas,
+                          size_t nDirections,
+                          size_t nChannels,
+                          const std::vector<int>& ant1,
+                          const std::vector<int>& ant2)
+{
+  _nAntennas = nAntennas;
+  _nDirections = nDirections;
+  _nChannels = nChannels;
+  _nChannelBlocks = nChannels;
+  _ant1 = ant1;
+  _ant2 = ant2;
+}
+
+void MultiDirSolver::makeStep(const std::vector<std::vector<DComplex> >& solutions,
+                              std::vector<std::vector<DComplex> >& nextSolutions) const
+{
+  // Move the solutions towards nextSolutions
+  // (the moved solutions are stored in 'nextSolutions')
+#pragma omp parallel for
+  for(size_t chBlock=0; chBlock<_nChannelBlocks; ++chBlock)
+  {
+    for(size_t i=0; i!=nextSolutions[chBlock].size(); ++i)
+    {
+      if(_phaseOnly)
+      {
+        double ab = std::abs(nextSolutions[chBlock][i]);
+        if(ab != 0.0)
+          nextSolutions[chBlock][i] /= ab;
+      }
+      nextSolutions[chBlock][i] = solutions[chBlock][i]*(1.0-_stepSize) +
+        nextSolutions[chBlock][i] * _stepSize;
+    }
+  }
+}
+
+void MultiDirSolver::makeSolutionsFinite(std::vector<std::vector<DComplex> >& solutions, size_t perPol) const
+{
+  for(std::vector<DComplex>& solVector : solutions)
+  {
+    size_t n = solVector.size() / perPol;
+    std::vector<DComplex>::iterator iter = solVector.begin();
+    for(size_t i=0; i!=n; ++i)
+    {
+      for(size_t p=0; p!=perPol; ++p)
+      {
+        if(!std::isfinite(iter->real()) || !std::isfinite(iter->imag()))
+          *iter = DComplex(1.0, 0.0);
+        ++iter;
+      }
+    }
+  }
+}
+
+bool MultiDirSolver::assignSolutions(std::vector<std::vector<DComplex> >& solutions,
+  std::vector<std::vector<DComplex> >& nextSolutions, bool useConstraintAccuracy) const
+{
+  double normSum = 0.0, sum = 0.0;
+  //  Calculate the norm of the difference between the old and new solutions
+  size_t n = 0;
+#pragma omp parallel for
+  for(size_t chBlock=0; chBlock<_nChannelBlocks; ++chBlock)
+  {
+    n += solutions[chBlock].size();
+    for(size_t i=0; i!=solutions[chBlock].size(); ++i)
+    {
+      double e = std::norm(nextSolutions[chBlock][i] - solutions[chBlock][i]);
+      normSum += e;
+      sum += std::abs(solutions[chBlock][i]);
+      
+      solutions[chBlock][i] = nextSolutions[chBlock][i];
+    }
+  }
+  normSum /= n;
+  sum /= n;
+  if(useConstraintAccuracy)
+    return normSum/sum <= _constraintAccuracy;
+  else
+    return normSum/sum <= _accuracy;
+}
+
+MultiDirSolver::SolveResult MultiDirSolver::processScalar(std::vector<Complex *>& data,
+  std::vector<std::vector<Complex *> >& modelData,
+  std::vector<std::vector<DComplex> >& solutions, double time) const
+{
+  const size_t nTimes = data.size();
+  SolveResult result;
+  
+  for(size_t i=0; i!=_constraints.size(); ++i)
+    _constraints[i]->PrepareIteration(false, 0, false);
+  
+  std::vector<std::vector<DComplex> > nextSolutions(_nChannelBlocks);
+
+#ifndef NDEBUG
+  if (solutions.size() != _nChannelBlocks) {
+    cout << "Error: 'solutions' parameter does not have the right shape" << endl;
+    result.iterations = 0;
+    return result;
+  }
+#endif
+
+  result._results.resize(_constraints.size());
+  
+  // Model matrix ant x [N x D] and visibility vector ant x [N x 1],
+  // for each channelblock
+  // The following loop allocates all structures
+  std::vector<std::vector<cx_mat> > gTimesCs(_nChannelBlocks);
+  std::vector<std::vector<cx_vec> > vs(_nChannelBlocks);
+  for(size_t chBlock=0; chBlock!=_nChannelBlocks; ++chBlock)
+  {
+    nextSolutions[chBlock].resize(_nDirections * _nAntennas);
+    const size_t
+      channelIndexStart = chBlock * _nChannels / _nChannelBlocks,
+      channelIndexEnd = (chBlock+1) * _nChannels / _nChannelBlocks,
+      curChannelBlockSize = channelIndexEnd - channelIndexStart;
+    gTimesCs[chBlock].resize(_nAntennas);
+    vs[chBlock].resize(_nAntennas);
+    
+    for(size_t ant=0; ant!=_nAntennas; ++ant)
+    {
+      // Model matrix [N x D] and visibility vector [N x 1]
+      // Also space for the auto correlation is reserved, but they will be set to 0.
+      gTimesCs[chBlock][ant] = cx_mat(_nAntennas * nTimes * curChannelBlockSize * 4,
+                                      _nDirections, fill::zeros);
+      vs[chBlock][ant] = cx_vec(_nAntennas * nTimes * curChannelBlockSize * 4, fill::zeros);
+    }
+  }
+  
+  // TODO the data and model data needs to be preweighted.
+  // Maybe we can get a non-const pointer from DPPP, that saves copying/allocating
+  
+  ///
+  /// Start iterating
+  ///
+  size_t iteration = 0, constrainedIterations = 0;
+  bool
+    hasConverged = false,
+    hasPreviouslyConverged = false,
+    constraintsSatisfied = false;
+  do {
+    makeSolutionsFinite(solutions, 1);
+    
+#pragma omp parallel for
+    for(size_t chBlock=0; chBlock<_nChannelBlocks; ++chBlock)
+    {
+      performScalarIteration(chBlock, gTimesCs[chBlock], vs[chBlock],
+                            solutions[chBlock], nextSolutions[chBlock],
+                            data, modelData);
+    }
+      
+    makeStep(solutions, nextSolutions);
+    
+    constraintsSatisfied = true;
+    for(size_t i=0; i!=_constraints.size(); ++i)
+    {
+      // PrepareIteration() might change Satisfied(), and since we always want to
+      // iterate at least once more when a constraint is not yet satisfied, we
+      // evaluate Satisfied() before preparing.
+      constraintsSatisfied = _constraints[i]->Satisfied() && constraintsSatisfied;
+      _constraints[i]->PrepareIteration(hasPreviouslyConverged, iteration, iteration+1 >= _maxIterations);
+      result._results[i] = _constraints[i]->Apply(nextSolutions, time);
+    }
+    
+    if(!constraintsSatisfied)
+      constrainedIterations = iteration+1;
+    
+    hasConverged = assignSolutions(solutions, nextSolutions, !constraintsSatisfied);
+    iteration++;
+    
+    hasPreviouslyConverged = hasConverged || hasPreviouslyConverged;
+    
+  } while(iteration < _maxIterations && (!hasConverged || !constraintsSatisfied));
+  
+  if(hasConverged)
+    result.iterations = iteration;
+  else
+    result.iterations = _maxIterations+1;
+  result.constraintIterations = constrainedIterations;
+  return result;
+}
+
+void MultiDirSolver::performScalarIteration(size_t channelBlockIndex,
+                       std::vector<arma::cx_mat>& gTimesCs,
+                       std::vector<arma::cx_vec>& vs,
+                       const std::vector<DComplex>& solutions,
+                       std::vector<DComplex>& nextSolutions,
+                       const std::vector<Complex *>& data,
+                       const std::vector<std::vector<Complex *> >& modelData) const
+{
+  for(size_t ant=0; ant!=_nAntennas; ++ant)
+  {
+    gTimesCs[ant].zeros();
+    vs[ant].zeros();
+  }
+  
+  const size_t
+    channelIndexStart = channelBlockIndex * _nChannels / _nChannelBlocks,
+    channelIndexEnd = (channelBlockIndex+1) * _nChannels / _nChannelBlocks,
+    curChannelBlockSize = channelIndexEnd - channelIndexStart,
+    nTimes = data.size();
+  
+  // The following loop fills the matrices for all antennas
+  for(size_t timeIndex=0; timeIndex!=nTimes; ++timeIndex)
+  {
+    std::vector<const Complex*> modelPtrs(_nDirections);
+    for(size_t baseline=0; baseline!=_ant1.size(); ++baseline)
+    {
+      size_t antenna1 = _ant1[baseline];
+      size_t antenna2 = _ant2[baseline];
+      if(antenna1 != antenna2)
+      {
+        cx_mat& gTimesC1 = gTimesCs[antenna1];
+        cx_vec& v1 = vs[antenna1];
+        cx_mat& gTimesC2 = gTimesCs[antenna2];
+        cx_vec& v2 = vs[antenna2];
+        for(size_t d=0; d!=_nDirections; ++d)
+          modelPtrs[d] = modelData[timeIndex][d] + (channelIndexStart + baseline * _nChannels) * 4;
+        const Complex* dataPtr = data[timeIndex] + (channelIndexStart + baseline * _nChannels) * 4;
+        const size_t p1top2[4] = {0, 2, 1, 3};
+        for(size_t ch=channelIndexStart; ch!=channelIndexEnd; ++ch)
+        {
+          const size_t
+            dataIndex1 = ch-channelIndexStart + (timeIndex + antenna1 * nTimes) * curChannelBlockSize,
+            dataIndex2 = ch-channelIndexStart + (timeIndex + antenna2 * nTimes) * curChannelBlockSize;
+          for(size_t p1=0; p1!=4; ++p1)
+          {
+            size_t p2 = p1top2[p1];
+            for(size_t d=0; d!=_nDirections; ++d)
+            {
+              std::complex<double> predicted = *modelPtrs[d];
+              
+              size_t solIndex1 = antenna1*_nDirections + d;
+              size_t solIndex2 = antenna2*_nDirections + d;
+              gTimesC2(dataIndex1*4+p1, d) = std::conj(solutions[solIndex1] * predicted); // using a* b* = (ab)*
+              gTimesC1(dataIndex2*4+p2, d) = std::conj(solutions[solIndex2]) * predicted;
+              
+              ++modelPtrs[d]; // Goto the next polarization of this 2x2 matrix.
+            }
+            v1(dataIndex2*4+p2) = *dataPtr;
+            v2(dataIndex1*4+p1) = std::conj(*dataPtr);
+            ++dataPtr; // Goto the next polarization of this 2x2 matrix.
+          }
+        }
+      }
+    }
+  }
+  
+  // The matrices have been filled; compute the linear solution
+  // for each antenna.
+#pragma omp parallel for
+  for(size_t ant=0; ant<_nAntennas; ++ant)
+  {
+    cx_mat& gTimesC = gTimesCs[ant];
+    cx_vec& v = vs[ant];
+    // solve [g* C] x  = v
+    cx_vec x;
+    bool success = solve(x, gTimesC, v);
+    if(success)
+    {
+      for(size_t d=0; d!=_nDirections; ++d)
+        nextSolutions[ant*_nDirections + d] = x(d);
+    }
+    else {
+      for(size_t d=0; d!=_nDirections; ++d)
+        nextSolutions[ant*_nDirections + d] = std::numeric_limits<double>::quiet_NaN();
+    }
+  }
+}
+
+MultiDirSolver::SolveResult MultiDirSolver::processFullMatrix(std::vector<Complex *>& data,
+  std::vector<std::vector<Complex *> >& modelData,
+  std::vector<std::vector<DComplex> >& solutions, double time) const
+{
+  // This algorithm is basically the same as the scalar algorithm,
+  // but visibility values are extended to 2x2 matrices and concatenated
+  // in the matrix equations as block matrices. One difference is that
+  // order of operations are important because of the non-commutativity of
+  // matrix multiplication, as well as that A^H B^H = [BA]^H.
+  //  
+  // The approach:
+  // First we pre-apply the left-hand solutions to the model to make JM. Each
+  // 2x2 coherence matrix Ji is matrix-multied by the lh solutions, for all
+  // directions, and visibilities (times x channels).
+  //   JMi = Ji Mi
+  // These are stacked in matrix JM :
+  //        JM0_d0 JM1_d0 ...
+  //   JM = JM0_d1 JM1_d1 
+  //        ...          
+  // such that JM is a (2D) rows x (2N) col matrix, N=nvis, D=ndir.
+  // The solved 2D x 2 solution matrix is similarly formed with the solution
+  // values:
+  //       ( J0 )
+  //   J = ( J1 )
+  //       ( .. )
+  // And the 2N x 2 visibility matrix as well:
+  //       ( V0 )
+  //   V = ( V1 )
+  //       ( .. )
+  // And we solve the equation:
+  //   'JM' J^H = V
+  // With dimensions:
+  //   [ 2N x 2D ] [ 2D x 2 ] = [ 2N x 2 ]
+
+  const size_t nTimes = data.size();
+  SolveResult result;
+  
+  for(size_t i=0; i!=_constraints.size(); ++i)
+    _constraints[i]->PrepareIteration(false, 0, false);
+  
+  std::vector<std::vector<DComplex> > nextSolutions(_nChannelBlocks);
+
+#ifndef NDEBUG
+  if (solutions.size() != _nChannelBlocks) {
+    cout << "Error: 'solutions' parameter does not have the right shape" << endl;
+    result.iterations = 0;
+    return result;
+  }
+#endif
+
+  result._results.resize(_constraints.size());
+  
+  // Dimensions for each channelblock:
+  // Model matrix ant x [2N x 2D] and visibility matrix ant x [2N x 2],
+  // The following loop allocates all structures
+  std::vector<std::vector<cx_mat> > gTimesCs(_nChannelBlocks);
+  std::vector<std::vector<cx_mat> > vs(_nChannelBlocks);
+  for(size_t chBlock=0; chBlock!=_nChannelBlocks; ++chBlock)
+  {
+    nextSolutions[chBlock].resize(_nDirections * _nAntennas * 4);
+    const size_t
+      channelIndexStart = chBlock * _nChannels / _nChannelBlocks,
+      channelIndexEnd = (chBlock+1) * _nChannels / _nChannelBlocks,
+      curChannelBlockSize = channelIndexEnd - channelIndexStart;
+    gTimesCs[chBlock].resize(_nAntennas);
+    vs[chBlock].resize(_nAntennas);
+    
+    for(size_t ant=0; ant!=_nAntennas; ++ant)
+    {
+      // Model matrix [2N x 2D] and visibility matrix [2N x 2]
+      // Also space for the auto correlation is reserved, but they will be set to 0.
+      gTimesCs[chBlock][ant] = cx_mat(_nAntennas * nTimes * curChannelBlockSize * 2,
+                                      _nDirections * 2, fill::zeros);
+      vs[chBlock][ant] = cx_mat(_nAntennas * nTimes * curChannelBlockSize * 2, 2, fill::zeros);
+    }
+  }
+  
+  // TODO the data and model data needs to be preweighted.
+  // Maybe we can get a non-const pointer from DPPP, that saves copying/allocating
+  
+  ///
+  /// Start iterating
+  ///
+  size_t iteration = 0, constrainedIterations = 0;
+  bool hasConverged = false, hasPreviouslyConverged = false, constraintsSatisfied = false;
+  do {
+    makeSolutionsFinite(solutions, 4);
+    
+#pragma omp parallel for
+    for(size_t chBlock=0; chBlock<_nChannelBlocks; ++chBlock)
+    {
+      performFullMatrixIteration(chBlock, gTimesCs[chBlock], vs[chBlock],
+                                solutions[chBlock], nextSolutions[chBlock],
+                                data, modelData);
+    }
+      
+    makeStep(solutions, nextSolutions);
+    
+    constraintsSatisfied = true;
+    for(size_t i=0; i!=_constraints.size(); ++i)
+    {
+      constraintsSatisfied = _constraints[i]->Satisfied() && constraintsSatisfied;
+      _constraints[i]->PrepareIteration(hasPreviouslyConverged, iteration, iteration+1 >= _maxIterations);
+      result._results[i] = _constraints[i]->Apply(nextSolutions, time);
+    }
+    
+    if(!constraintsSatisfied)
+      constrainedIterations = iteration+1;
+    
+    hasConverged = assignSolutions(solutions, nextSolutions, !constraintsSatisfied);
+    iteration++;
+    
+    hasPreviouslyConverged = hasConverged || hasPreviouslyConverged;
+  } while(iteration < _maxIterations && (!hasConverged || !constraintsSatisfied));
+  
+  if(hasConverged)
+    result.iterations = iteration;
+  else
+    result.iterations = _maxIterations+1;
+  result.constraintIterations = constrainedIterations;
+  return result;
+}
+
+void MultiDirSolver::performFullMatrixIteration(size_t channelBlockIndex,
+                             std::vector<arma::cx_mat>& gTimesCs,
+                             std::vector<arma::cx_mat>& vs,
+                             const std::vector<DComplex>& solutions,
+                             std::vector<DComplex>& nextSolutions,
+                             const std::vector<Complex *>& data,
+                             const std::vector<std::vector<Complex *> >& modelData) const
+{
+  for(size_t ant=0; ant!=_nAntennas; ++ant)
+  {
+    gTimesCs[ant].zeros();
+    vs[ant].zeros();
+  }
+  
+  const size_t
+    channelIndexStart = channelBlockIndex * _nChannels / _nChannelBlocks,
+    channelIndexEnd = (channelBlockIndex+1) * _nChannels / _nChannelBlocks,
+    curChannelBlockSize = channelIndexEnd - channelIndexStart,
+    nTimes = data.size();
+  
+  // The following loop fills the matrices for all antennas
+  for(size_t timeIndex=0; timeIndex!=nTimes; ++timeIndex)
+  {
+    std::vector<const Complex*> modelPtrs(_nDirections);
+    for(size_t baseline=0; baseline!=_ant1.size(); ++baseline)
+    {
+      size_t antenna1 = _ant1[baseline];
+      size_t antenna2 = _ant2[baseline];
+      if(antenna1 != antenna2)
+      {
+        // This equation is solved:
+        //   J_1 M J_2^H = V
+        // for visibilities of the 'normal' correlation ant1 x ant2^H.
+        // Since in this equation antenna2 is solved, the solve matrices are
+        // called gTimesC2 and v2. The index into these matrices is depending
+        // on antenna1, hence the index is called dataIndex1.
+        //
+        // To use visibilities of correlation ant2 x ant1^H to solve ant1, an
+        // extra Herm transpose on M and V is required. The equation is:
+        //   J_2 M^H J_1^H = V^H,
+        // and the relevant matrices/index are called gTimesC1, v1 and dataIndex2.
+        cx_mat
+          &gTimesC1 = gTimesCs[antenna1],
+          &v1 = vs[antenna1],
+          &gTimesC2 = gTimesCs[antenna2],
+          &v2 = vs[antenna2];
+        for(size_t d=0; d!=_nDirections; ++d)
+          modelPtrs[d] = modelData[timeIndex][d] + (channelIndexStart + baseline * _nChannels) * 4;
+        const Complex* dataPtr = data[timeIndex] + (channelIndexStart + baseline * _nChannels) * 4;
+        for(size_t ch=channelIndexStart; ch!=channelIndexEnd; ++ch)
+        {
+          const size_t
+            dataIndex1 = 2 * (ch-channelIndexStart + (timeIndex + antenna1 * nTimes) * curChannelBlockSize),
+            dataIndex2 = 2 * (ch-channelIndexStart + (timeIndex + antenna2 * nTimes) * curChannelBlockSize);
+            
+          for(size_t d=0; d!=_nDirections; ++d)
+          {
+            MC2x2
+              modelMat(modelPtrs[d]),
+              gTimesC1Mat, gTimesC2Mat;
+            size_t solIndex1 = (antenna1*_nDirections + d) * 4;
+            size_t solIndex2 = (antenna2*_nDirections + d) * 4;
+            Matrix2x2::ATimesB(gTimesC2Mat.Data(), &solutions[solIndex1], modelMat.Data());
+            Matrix2x2::ATimesHermB(gTimesC1Mat.Data(), &solutions[solIndex2], modelMat.Data());
+            for(size_t p=0; p!=4; ++p)
+            {
+              gTimesC2(dataIndex1+(p/2), d*2+p%2) = gTimesC2Mat[p];
+              gTimesC1(dataIndex2+(p/2), d*2+p%2) = gTimesC1Mat[p];
+            }
+            
+            modelPtrs[d] += 4; // Goto the next 2x2 matrix.
+          }
+          for(size_t p=0; p!=4; ++p)
+          {
+            v1(dataIndex2+(p%2), p/2) = std::conj(*dataPtr);
+            v2(dataIndex1+(p/2), p%2) = *dataPtr; // note that this also performs the Herm transpose
+            ++dataPtr;  // Goto the next element of the 2x2 matrix.
+          }
+        }
+      }
+    }
+  }
+  
+  // The matrices have been filled; compute the linear solution
+  // for each antenna.
+#pragma omp parallel for
+  for(size_t ant=0; ant<_nAntennas; ++ant)
+  {
+    cx_mat& gTimesC = gTimesCs[ant];
+    cx_mat& v = vs[ant];
+    // solve x^H in [g C] x^H  = v
+    cx_mat x;
+    const bool success = solve(x, gTimesC, v);
+    if(success)
+    {
+      for(size_t d=0; d!=_nDirections; ++d)
+      {
+        for(size_t p=0; p!=4; ++p) {
+          // The conj transpose is also performed at this point (note swap of % and /)
+          nextSolutions[(ant*_nDirections + d)*4 + p] = std::conj(x(d*2+p%2, p/2));
+        }
+      }
+    }
+    else {
+      for(size_t i=0; i!=_nDirections*4; ++i)
+        nextSolutions[ant*_nDirections + i] = std::numeric_limits<double>::quiet_NaN();
+    }
+  }
+}
diff --git a/CEP/DP3/DPPP_DDECal/src/Register.cc b/CEP/DP3/DPPP_DDECal/src/Register.cc
index 856e6fdf3183f29e567ffd38b36d7b70ca697f20..b31ba20ca65c5f904b5dd6881582fb3c7589cee6 100644
--- a/CEP/DP3/DPPP_DDECal/src/Register.cc
+++ b/CEP/DP3/DPPP_DDECal/src/Register.cc
@@ -28,7 +28,6 @@
 
 // Define the function to make the DDECal 'constructor' known.
 // Its suffix must be the (lowercase) name of the package (library).
-// Also make the SlidingFlagger known.
 void register_ddecal()
 {
   LOFAR::DPPP::DPRun::registerStepCtor ("ddecal",
diff --git a/CEP/DP3/DPPP_DDECal/src/ScreenConstraint.cc b/CEP/DP3/DPPP_DDECal/src/ScreenConstraint.cc
index 86b69279fd92dcfe12082eac52945eff1fe7c0ae..c32512ba434682e53164cfc41921e6be563112f3 100644
--- a/CEP/DP3/DPPP_DDECal/src/ScreenConstraint.cc
+++ b/CEP/DP3/DPPP_DDECal/src/ScreenConstraint.cc
@@ -2,9 +2,11 @@
 #include <Common/OpenMP.h>
 
 namespace LOFAR{
+
 const  double ScreenConstraint::phtoTEC = 1./8.4479745e9;
 const  double ScreenConstraint::TECtoph = 8.4479745e9;
 const  size_t ScreenConstraint::maxIter=30;
+
 ScreenConstraint::ScreenConstraint(const ParameterSet& parset,
                       const string& prefix)
  :
@@ -13,7 +15,7 @@ ScreenConstraint::ScreenConstraint(const ParameterSet& parset,
   _nChannelBlocks(0),
   itsCurrentTime(0)
 {
-  cout<<"=========="<<(prefix + "order")<<"========"<<endl;
+  cout<<"=========="<<(prefix + "order")<<"========\n";
   itsBeta=parset.getDouble (prefix + "beta", 5./3.);
   itsHeight=parset.getDouble (prefix + "height", 400e3);
   itsOrder=parset.getInt(prefix + "order", 3);
@@ -23,7 +25,7 @@ ScreenConstraint::ScreenConstraint(const ParameterSet& parset,
   itsDebugMode=parset.getInt(prefix + "debug", 0);
 }
 
-void ScreenConstraint::init(size_t nAntennas, size_t nDirections, size_t nChannelBlocks, const double* frequencies) {
+void ScreenConstraint::initialize(size_t nAntennas, size_t nDirections, size_t nChannelBlocks, const double* frequencies) {
   _nAntennas = nAntennas;
   _nDirections = nDirections;
   _nChannelBlocks = nChannelBlocks;
@@ -56,18 +58,13 @@ void ScreenConstraint::init(size_t nAntennas, size_t nDirections, size_t nChanne
     
   }
   if (itsDebugMode>0)
-    {
-      _iterphases.resize(_nAntennas*_nDirections*_nChannelBlocks*maxIter);
-    }
-  
+  {
+    _iterphases.resize(_nAntennas*_nDirections*_nChannelBlocks*maxIter);
+  }
 }
 
 void ScreenConstraint::setAntennaPositions(const std::vector<std::vector<double> > antenna_pos) {
-  for(uint i=0;i<antenna_pos.size();i++){
-    itsAntennaPos[i].resize(3);
-    for(int j=0;j<3;j++)
-      itsAntennaPos[i][j]=antenna_pos[i][j];
-  }
+  itsAntennaPos = antenna_pos;
 }
 
 void ScreenConstraint::setDirections(const std::vector<std::pair<double, double> > source_pos) {
@@ -76,7 +73,6 @@ void ScreenConstraint::setDirections(const std::vector<std::pair<double, double>
     itsSourcePos[i][0]=source_pos[i].first;
     itsSourcePos[i][1]=source_pos[i].second;
   }
-
 }
 
 void ScreenConstraint::initPiercePoints(){
@@ -101,86 +97,87 @@ void ScreenConstraint::setTime(double time){
       CalculatePiercepoints();
       
       if (itsMode=="station")
+      {
 #pragma omp parallel for
-	for(uint ipos=0;ipos<_nAntennas;ipos++)
-	  _screenFitters[ipos].calculateCorrMatrix(itsPiercePoints[ipos]);
+        for(uint ipos=0;ipos<_nAntennas;ipos++)
+          _screenFitters[ipos].calculateCorrMatrix(itsPiercePoints[ipos]);
+      }
       else if (itsMode=="direction")
+      {
 #pragma omp parallel for
-	for(uint idir=0;idir<_nDirections;idir++){
-	  std::vector<PiercePoint *> tmpV(_nAntennas);
-	  for(uint ipos=0;ipos<_nAntennas;ipos++)
-	    tmpV[ipos]=&(itsPiercePoints[ipos][idir]);
-	  _screenFitters[idir].calculateCorrMatrix(tmpV);
-	}
+        for(uint idir=0;idir<_nDirections;idir++){
+          std::vector<PiercePoint *> tmpV(_nAntennas);
+          for(uint ipos=0;ipos<_nAntennas;ipos++)
+            tmpV[ipos]=&(itsPiercePoints[ipos][idir]);
+          _screenFitters[idir].calculateCorrMatrix(tmpV);
+        }
+      }
       else if (itsMode=="full")
-	{
-	  std::vector<PiercePoint *> tmpV(_nAntennas*_nDirections);
-	  size_t i=0;
-	  for(uint idir=0;idir<_nDirections;idir++)
-	    for(uint ipos=0;ipos<_nAntennas;ipos++)
-	      tmpV[i++]=&(itsPiercePoints[ipos][idir]);
-	  _screenFitters[0].calculateCorrMatrix(tmpV);
-	}
+      {
+        std::vector<PiercePoint *> tmpV(_nAntennas*_nDirections);
+        size_t i=0;
+        for(uint idir=0;idir<_nDirections;idir++)
+        {
+          for(uint ipos=0;ipos<_nAntennas;ipos++)
+            tmpV[i++]=&(itsPiercePoints[ipos][idir]);
+        }
+        _screenFitters[0].calculateCorrMatrix(tmpV);
+      }
       else if (itsMode=="csfull")
-	{
-	  std::vector<PiercePoint *> tmpV(_coreAntennas.size()*itsSourcePos.size());
-	  for(size_t iant=0; iant<_coreAntennas.size(); iant++){
-	    size_t ipos=_coreAntennas[iant];
-	    for(uint idir=0;idir<_nDirections;idir++)
-	      tmpV[iant*_nDirections+idir]=&(itsPiercePoints[ipos][idir]);
-	  }
-	  _screenFitters[0].calculateCorrMatrix(tmpV);
+      {
+        std::vector<PiercePoint *> tmpV(_coreAntennas.size()*itsSourcePos.size());
+        for(size_t iant=0; iant<_coreAntennas.size(); iant++){
+          size_t ipos=_coreAntennas[iant];
+          for(uint idir=0;idir<_nDirections;idir++)
+            tmpV[iant*_nDirections+idir]=&(itsPiercePoints[ipos][idir]);
+        }
+        _screenFitters[0].calculateCorrMatrix(tmpV);
 #pragma omp parallel for
-	  for(size_t iant=0; iant<_otherAntennas.size(); iant++){
-	    size_t ipos=_otherAntennas[iant];
-	    _screenFitters[iant+1].calculateCorrMatrix(itsPiercePoints[ipos]);
-	  }
-	}
+        for(size_t iant=0; iant<_otherAntennas.size(); iant++){
+          size_t ipos=_otherAntennas[iant];
+          _screenFitters[iant+1].calculateCorrMatrix(itsPiercePoints[ipos]);
+        }
+      }
       else
-	THROW (Exception, "Unexpected tecscreen mode: " << itsMode); 
+        THROW (Exception, "Unexpected tecscreen mode: " << itsMode); 
       
   }
   else
     itsIter+=1;
-  
 }
 
-
 void ScreenConstraint::CalculatePiercepoints(){
-   casacore::MEpoch time(casacore::MVEpoch(itsCurrentTime/(24.*3600.))); //convert to MJD
+  casacore::MEpoch time(casacore::MVEpoch(itsCurrentTime/(24.*3600.))); //convert to MJD
   for (uint i=0;i<itsPiercePoints.size();i++)
     for (uint j=0;j<itsPiercePoints[i].size();j++)
       itsPiercePoints[i][j].evaluate(time);
 }
 
-
-
-  void  ScreenConstraint::getPPValue(std::vector<std::vector<MultiDirSolver::DComplex> >& solutions,size_t solutionIndex,size_t dirIndex,double &avgTEC) const {
-    if (itsAVGMode=="simple"){
-      avgTEC=0;
-      for(size_t ch=0;ch<_nChannelBlocks; ++ch){
-	double refphase=std::arg(solutions[ch][dirIndex]);
-	//TODO: more advance frequency averaging...
-	avgTEC += std::arg(solutions[ch][solutionIndex]*std::polar<double>(1.0,-1*refphase))*itsFrequencies[ch]*phtoTEC;
-      }
-      avgTEC/=_nChannelBlocks;
+void  ScreenConstraint::getPPValue(std::vector<std::vector<MultiDirSolver::DComplex> >& solutions,size_t solutionIndex,size_t dirIndex,double &avgTEC) const {
+  if (itsAVGMode=="simple"){
+    avgTEC=0;
+    for(size_t ch=0;ch<_nChannelBlocks; ++ch){
+      double refphase=std::arg(solutions[ch][dirIndex]);
+      //TODO: more advance frequency averaging...
+      avgTEC += std::arg(solutions[ch][solutionIndex]*std::polar<double>(1.0,-1*refphase))*itsFrequencies[ch]*phtoTEC;
     }
-    else{
-      PhaseFitter phfit(_nChannelBlocks) ;
-      for(size_t ch=0;ch<_nChannelBlocks; ++ch){
-	phfit.FrequencyData()[ch]=itsFrequencies.data()[ch];
-	phfit.PhaseData()[ch] = std::arg(solutions[ch][solutionIndex]);
-      }
-      if (itsprevsol[solutionIndex]<-100)
-	phfit.FitTEC1ModelParameters(avgTEC);
-      else {
-	avgTEC=itsprevsol[solutionIndex]*TECtoph;
-	phfit.FitTEC1ModelParameters(avgTEC);
-      }
-	  
-      avgTEC*=phtoTEC;
+    avgTEC/=_nChannelBlocks;
+  }
+  else{
+    PhaseFitter phfit(_nChannelBlocks) ;
+    for(size_t ch=0;ch<_nChannelBlocks; ++ch){
+      phfit.FrequencyData()[ch]=itsFrequencies.data()[ch];
+      phfit.PhaseData()[ch] = std::arg(solutions[ch][solutionIndex]);
+    }
+    if (itsprevsol[solutionIndex]<-100)
+      phfit.FitTEC1ModelParameters(avgTEC);
+    else {
+      avgTEC=itsprevsol[solutionIndex]*TECtoph;
+      phfit.FitTEC1ModelParameters(avgTEC);
     }
 
+    avgTEC*=phtoTEC;
+  }
 }
 
 
@@ -234,131 +231,132 @@ std::vector<Constraint::Result> ScreenConstraint::Apply(std::vector<std::vector<
 
 #pragma omp parallel for
   for(size_t antIndex = 0; antIndex<_nAntennas; ++antIndex)
-    {
-
-      int foundantcs=-999;
-      int foundantoth=-999;
-      if (itsMode=="csfull"){
-	for(size_t iant=0; iant<_coreAntennas.size(); iant++){
-	  if (_coreAntennas[iant]==antIndex){
-	    foundantcs=iant;
-	    break;
-	  }
-	}
+  {
+    int foundantcs=-999;
+    int foundantoth=-999;
+    if (itsMode=="csfull"){
+      for(size_t iant=0; iant<_coreAntennas.size(); iant++){
+        if (_coreAntennas[iant]==antIndex){
+          foundantcs=iant;
+          break;
+        }
+      }
       if (foundantcs<0)
-	for(size_t iant=0; iant<_otherAntennas.size(); iant++){
-	  if(_otherAntennas[iant]==antIndex){
-	    foundantoth=iant;
-	    break;
-	  }
-	}
+      {
+        for(size_t iant=0; iant<_otherAntennas.size(); iant++){
+          if(_otherAntennas[iant]==antIndex){
+            foundantoth=iant;
+            break;
+          }
+        }
       }
-      for(size_t dirIndex = 0; dirIndex<_nDirections; ++dirIndex){
-	double avgTEC;
-	size_t solutionIndex=antIndex*_nDirections+dirIndex;
-	if (itsDebugMode>0 and itsIter<maxIter)
-	  for (size_t ch=0; ch<_nChannelBlocks;ch++)
-	    {
-	      //cout<<"writing "<<antIndex<<":"<<dirIndex<<":"<<ch<<":"<<itsIter<<":"<<antIndex*_nDirections*30*_nChannelBlocks+dirIndex*30*_nChannelBlocks+ch*30+itsIter<<" "<<res[4].vals.size()<<","<<solutionIndex<<":"<<solutions[ch].size()<<std::arg(solutions[ch][solutionIndex])<<endl;
-	      _iterphases[antIndex*_nDirections*maxIter*_nChannelBlocks+dirIndex*maxIter*_nChannelBlocks+ch*maxIter+itsIter]= std::arg(solutions[ch][solutionIndex]);
-	    }
-	getPPValue(solutions,solutionIndex,dirIndex,avgTEC);
-	if (itsMode=="station")
-	  _screenFitters[antIndex].PhaseData()[dirIndex] = avgTEC;
-	else if (itsMode=="direction")
-	  _screenFitters[dirIndex].PhaseData()[antIndex] = avgTEC;
-	else if (itsMode=="full")
-	  _screenFitters[0].PhaseData()[dirIndex*_nAntennas+antIndex] = avgTEC;
-	else
-	  {//csfull mode
-	    if (foundantcs>=0){
-	      _screenFitters[0].PhaseData()[foundantcs*_nDirections+dirIndex]= avgTEC;
-	    }
-	    else if (foundantoth>=0){
-	      _screenFitters[foundantoth+1].PhaseData()[dirIndex]= avgTEC;
-	    }
-	  }
+    }
+    for(size_t dirIndex = 0; dirIndex<_nDirections; ++dirIndex){
+      double avgTEC;
+      size_t solutionIndex=antIndex*_nDirections+dirIndex;
+      if (itsDebugMode>0 and itsIter<maxIter)
+      {
+        for (size_t ch=0; ch<_nChannelBlocks;ch++)
+        {
+          //cout<<"writing "<<antIndex<<":"<<dirIndex<<":"<<ch<<":"<<itsIter<<":"<<antIndex*_nDirections*30*_nChannelBlocks+dirIndex*30*_nChannelBlocks+ch*30+itsIter<<" "<<res[4].vals.size()<<","<<solutionIndex<<":"<<solutions[ch].size()<<std::arg(solutions[ch][solutionIndex])<<endl;
+          _iterphases[antIndex*_nDirections*maxIter*_nChannelBlocks+dirIndex*maxIter*_nChannelBlocks+ch*maxIter+itsIter]= std::arg(solutions[ch][solutionIndex]);
+        }
+      }
+      getPPValue(solutions,solutionIndex,dirIndex,avgTEC);
+      if (itsMode=="station")
+        _screenFitters[antIndex].PhaseData()[dirIndex] = avgTEC;
+      else if (itsMode=="direction")
+        _screenFitters[dirIndex].PhaseData()[antIndex] = avgTEC;
+      else if (itsMode=="full")
+        _screenFitters[0].PhaseData()[dirIndex*_nAntennas+antIndex] = avgTEC;
+      else
+      {//csfull mode
+        if (foundantcs>=0){
+          _screenFitters[0].PhaseData()[foundantcs*_nDirections+dirIndex]= avgTEC;
+        }
+        else if (foundantoth>=0){
+          _screenFitters[foundantoth+1].PhaseData()[dirIndex]= avgTEC;
+        }
       }
     }
+  }
 
 #pragma omp parallel for
   for(size_t isft=0;isft<_screenFitters.size();isft++)
     _screenFitters[isft].doFit();
- #pragma omp parallel for
+  
+#pragma omp parallel for
   for(size_t antIndex = 0; antIndex<_nAntennas; ++antIndex)
-    { 
-      int foundantcs=-999;
-      int foundantoth=-999;
-      if (itsMode=="csfull")
-	for(size_t iant=0; iant<_coreAntennas.size(); iant++){
-	  if (_coreAntennas[iant]==antIndex){
-	    foundantcs=iant;
-	    break;
-	  }
-	}
-      if (foundantcs<0)
-	for(size_t iant=0; iant<_otherAntennas.size(); iant++){
-	  if(_otherAntennas[iant]==antIndex){
-	    foundantoth=iant;
-	    break;
-	  }
-	}
-      for(size_t dirIndex = 0; dirIndex<_nDirections; ++dirIndex){
-	size_t solutionIndex=antIndex*_nDirections+dirIndex;
-	double avgTEC=0;
-	if (itsMode=="station")
-	  avgTEC=_screenFitters[antIndex].PhaseData()[dirIndex];
-	else if (itsMode=="direction")
-	  avgTEC=_screenFitters[dirIndex].PhaseData()[antIndex];
-	else if (itsMode=="full")
-	  avgTEC=_screenFitters[0].PhaseData()[dirIndex*_nAntennas+antIndex];
-	else
-	  {//csfull
-	    if (foundantcs>=0)
-	      avgTEC=_screenFitters[0].PhaseData()[foundantcs*_nDirections+dirIndex];
-	    else if (foundantoth>=0)
-	      avgTEC=_screenFitters[foundantoth+1].PhaseData()[dirIndex];
-	  
-	  
-	  }
-	
-      
- 	
-
-	for(size_t ch=0;ch<_nChannelBlocks; ++ch)
-	  solutions[ch][solutionIndex] = std::polar<double>(1.0, avgTEC*TECtoph/itsFrequencies[ch]);
-	
-	res[3].vals[antIndex*_nDirections+dirIndex]= avgTEC;
-	itsprevsol[antIndex*_nDirections+dirIndex]=avgTEC;
-	for (size_t i=0;i<3;i++)
-	  if (itsMode=="station")
-	    res[1].vals[antIndex*_nDirections*3+dirIndex*3+i]= _screenFitters[antIndex].PPData()[i*_nDirections+dirIndex]; 
-	  else if (itsMode=="direction")
-	    res[1].vals[antIndex*_nDirections*3+dirIndex*3+i]= _screenFitters[dirIndex].PPData()[i*_nAntennas+antIndex]; 
-	  else if (itsMode=="full")
-	    res[1].vals[antIndex*_nDirections*3+dirIndex*3+i]= _screenFitters[0].PPData()[i*_nDirections*_nAntennas+dirIndex*_nAntennas+antIndex]; 
-	    
-	  else
-	    {//csfull
-	      if (foundantcs>=0)
-		res[1].vals[antIndex*_nDirections*3+dirIndex*3+i]= _screenFitters[0].PPData()[i*_coreAntennas.size()*_nDirections+foundantcs*_nDirections+dirIndex]; 
-	      else if (foundantoth>=0)
-		res[1].vals[antIndex*_nDirections*3+dirIndex*3+i]= _screenFitters[foundantoth].PPData()[i*_nDirections+dirIndex]; 
-	    
-	  
-	    }
+  { 
+    int foundantcs=-999;
+    int foundantoth=-999;
+    if (itsMode=="csfull")
+    {
+      for(size_t iant=0; iant<_coreAntennas.size(); iant++){
+        if (_coreAntennas[iant]==antIndex){
+          foundantcs=iant;
+          break;
+        }
       }
-	    
-	
+    }
+    if (foundantcs<0)
+    {
+      for(size_t iant=0; iant<_otherAntennas.size(); iant++){
+        if(_otherAntennas[iant]==antIndex){
+          foundantoth=iant;
+          break;
+        }
+      }
+    }
+    for(size_t dirIndex = 0; dirIndex<_nDirections; ++dirIndex){
+      size_t solutionIndex=antIndex*_nDirections+dirIndex;
+      double avgTEC=0;
+      if (itsMode=="station")
+        avgTEC=_screenFitters[antIndex].PhaseData()[dirIndex];
+      else if (itsMode=="direction")
+        avgTEC=_screenFitters[dirIndex].PhaseData()[antIndex];
+      else if (itsMode=="full")
+        avgTEC=_screenFitters[0].PhaseData()[dirIndex*_nAntennas+antIndex];
+      else
+      {//csfull
+        if (foundantcs>=0)
+          avgTEC=_screenFitters[0].PhaseData()[foundantcs*_nDirections+dirIndex];
+        else if (foundantoth>=0)
+          avgTEC=_screenFitters[foundantoth+1].PhaseData()[dirIndex];
+      }
+
+      for(size_t ch=0;ch<_nChannelBlocks; ++ch)
+        solutions[ch][solutionIndex] = std::polar<double>(1.0, avgTEC*TECtoph/itsFrequencies[ch]);
       
-      for(size_t dirIndex = 0; dirIndex<_nDirections; ++dirIndex){
-	if (itsMode=="station")
-	  res[2].vals[antIndex*_nDirections+dirIndex]=
-	    _screenFitters[antIndex].TECFitWhiteData()[dirIndex];
-	else  //not implemented yet for other modes
-	  res[2].vals[antIndex*_nDirections+dirIndex]=0;
+      res[3].vals[antIndex*_nDirections+dirIndex]= avgTEC;
+      itsprevsol[antIndex*_nDirections+dirIndex]=avgTEC;
+      for (size_t i=0;i<3;i++)
+      {
+        if (itsMode=="station")
+          res[1].vals[antIndex*_nDirections*3+dirIndex*3+i]= _screenFitters[antIndex].PPData()[i*_nDirections+dirIndex]; 
+        else if (itsMode=="direction")
+          res[1].vals[antIndex*_nDirections*3+dirIndex*3+i]= _screenFitters[dirIndex].PPData()[i*_nAntennas+antIndex]; 
+        else if (itsMode=="full")
+          res[1].vals[antIndex*_nDirections*3+dirIndex*3+i]= _screenFitters[0].PPData()[i*_nDirections*_nAntennas+dirIndex*_nAntennas+antIndex]; 
+          
+        else
+        {//csfull
+          if (foundantcs>=0)
+            res[1].vals[antIndex*_nDirections*3+dirIndex*3+i]= _screenFitters[0].PPData()[i*_coreAntennas.size()*_nDirections+foundantcs*_nDirections+dirIndex]; 
+          else if (foundantoth>=0)
+            res[1].vals[antIndex*_nDirections*3+dirIndex*3+i]= _screenFitters[foundantoth].PPData()[i*_nDirections+dirIndex]; 
+        }
       }
     }
+      
+    for(size_t dirIndex = 0; dirIndex<_nDirections; ++dirIndex){
+      if (itsMode=="station")
+        res[2].vals[antIndex*_nDirections+dirIndex]=
+          _screenFitters[antIndex].TECFitWhiteData()[dirIndex];
+      else  //not implemented yet for other modes
+        res[2].vals[antIndex*_nDirections+dirIndex]=0;
+    }
+  }
   for(size_t i=0;i<_screenFitters.size();i++)
     for(size_t j=0;j<numberofPar;j++)
       res[0].vals[i*numberofPar+j]= _screenFitters[i].ParData()[j];
@@ -367,4 +365,5 @@ std::vector<Constraint::Result> ScreenConstraint::Apply(std::vector<std::vector<
     res[4].vals=_iterphases;
   return res;
 }
+  
 } //namespace LOFAR
diff --git a/CEP/DP3/DPPP_DDECal/src/TECConstraint.cc b/CEP/DP3/DPPP_DDECal/src/TECConstraint.cc
new file mode 100644
index 0000000000000000000000000000000000000000..74382e4435790f119bf221a58c10cb483c5bebfd
--- /dev/null
+++ b/CEP/DP3/DPPP_DDECal/src/TECConstraint.cc
@@ -0,0 +1,199 @@
+#ifdef AOPROJECT
+#include "TECConstraint.h"
+#include "omptools.h"
+#else
+#include <DPPP_DDECal/TECConstraint.h>
+#include <Common/OpenMP.h>
+#endif
+
+TECConstraintBase::TECConstraintBase(Mode mode) :
+  _mode(mode),
+  _nAntennas(0),
+  _nDirections(0),
+  _nChannelBlocks(0),
+  _phaseFitters()
+{
+}
+
+void TECConstraintBase::initialize(size_t nAntennas, size_t nDirections, size_t nChannelBlocks, const double* frequencies) {
+  _nAntennas = nAntennas;
+  _nDirections = nDirections;
+  _nChannelBlocks = nChannelBlocks;
+  _phaseFitters.resize(
+#ifdef AOPROJECT
+      omp_get_max_threads()
+#else
+      LOFAR::OpenMP::maxThreads()
+#endif
+   );
+
+  for(size_t i=0; i!=_phaseFitters.size(); ++i)
+  {
+    _phaseFitters[i].SetChannelCount(_nChannelBlocks);
+    std::memcpy(_phaseFitters[i].FrequencyData(), frequencies, sizeof(double) * _nChannelBlocks);
+    
+    // TODO this should set the weights of the phase fitter!
+  }
+  initializeChild();
+}
+
+void ApproximateTECConstraint::initializeChild()
+{
+  _pwFitters.resize(
+#ifdef AOPROJECT
+      omp_get_max_threads()
+#else
+      LOFAR::OpenMP::maxThreads()
+#endif
+   );
+  _threadData.resize(_pwFitters.size());
+  _threadFittedData.resize(_pwFitters.size());
+  _threadWeights.resize(_pwFitters.size());
+  for(size_t threadId=0; threadId!=_pwFitters.size(); ++threadId)
+  {
+    _threadData[threadId].resize(_nChannelBlocks);
+    _threadFittedData[threadId].resize(_nChannelBlocks);
+    _threadWeights[threadId].resize(_nChannelBlocks);
+  }
+  
+  if(_fittingChunkSize == 0)
+  {
+    size_t
+      n = _phaseFitters.front().Size();
+    const double
+      startFreq = _phaseFitters.front().FrequencyData()[0],
+      endFreq = _phaseFitters.front().FrequencyData()[n-1];
+      _fittingChunkSize = PieceWisePhaseFitter::CalculateChunkSize(startFreq, endFreq, n);
+    for(size_t i=0; i!=_pwFitters.size(); ++i)
+      _pwFitters[i].SetChunkSize(_fittingChunkSize);
+  }
+}
+
+void TECConstraintBase::applyReferenceAntenna(std::vector<std::vector<dcomplex> >& solutions) const
+{
+  // TODO chose this more cleverly?
+  size_t refAntenna = 0;
+
+  for(size_t ch=0; ch!=_nChannelBlocks; ++ch)
+  {
+    for(size_t antennaIndex=0; antennaIndex!=_nAntennas; ++antennaIndex)
+    {
+      for(size_t d=0; d!=_nDirections; ++d)
+      {
+        size_t solutionIndex = antennaIndex*_nDirections + d;
+        size_t refAntennaIndex = d + refAntenna*_nDirections;
+        if(antennaIndex != refAntenna)
+        {
+          solutions[ch][solutionIndex] = solutions[ch][solutionIndex] / solutions[ch][refAntennaIndex];
+        }
+      }
+    }
+    for(size_t d=0; d!=_nDirections; ++d)
+      solutions[ch][refAntenna*_nDirections + d] = 1.0;
+  }
+}
+
+std::vector<Constraint::Result> TECConstraint::Apply(
+    std::vector<std::vector<dcomplex> >& solutions, double)
+{
+  std::vector<Constraint::Result> res(2);
+
+  res[0].vals.resize(_nAntennas*_nDirections);
+  res[0].axes="ant,dir,freq";
+  res[0].name="tec";
+  res[0].dims.resize(3);
+  res[0].dims[0]=_nAntennas;
+  res[0].dims[1]=_nDirections;
+  res[0].dims[2]=1;
+  res[1]=res[0];
+  res[1].name="scalarphase";
+
+  // Divide out the reference antenna
+  applyReferenceAntenna(solutions);
+  
+#pragma omp parallel for
+  for(size_t solutionIndex = 0; solutionIndex<_nAntennas*_nDirections; ++solutionIndex)
+  {
+    size_t thread =
+#ifdef AOPROJECT
+        omp_get_thread_num();
+#else
+        LOFAR::OpenMP::threadNum();
+#endif
+
+    for(size_t ch=0; ch!=_nChannelBlocks; ++ch) {
+      if(std::isfinite(solutions[ch][solutionIndex].real()) &&
+        std::isfinite(solutions[ch][solutionIndex].imag()))
+      {
+        _phaseFitters[thread].PhaseData()[ch] = std::arg(solutions[ch][solutionIndex]);
+        _phaseFitters[thread].WeightData()[ch] = 1.0;
+      }
+      else {
+        _phaseFitters[thread].PhaseData()[ch] = 0.0;
+        _phaseFitters[thread].WeightData()[ch] = 0.0;
+      }
+    }
+    
+    double alpha, beta=0.0;
+    if(_mode == TECOnlyMode) {
+      _phaseFitters[thread].FitDataToTEC1Model(alpha);
+    } else {
+      _phaseFitters[thread].FitDataToTEC2Model(alpha, beta);
+    }
+
+    res[0].vals[solutionIndex] = alpha / -8.44797245e9;
+    res[1].vals[solutionIndex] = beta;
+    
+    for(size_t ch=0; ch!=_nChannelBlocks; ++ch) 
+    {
+      solutions[ch][solutionIndex] = std::polar<double>(1.0, _phaseFitters[thread].PhaseData()[ch]);
+    }
+  }
+
+  return res;
+}
+
+std::vector<Constraint::Result> ApproximateTECConstraint::Apply(
+    std::vector<std::vector<dcomplex> >& solutions, double time)
+{
+  if(_finishedApproximateStage)
+    return TECConstraint::Apply(solutions, time);
+  else {
+    applyReferenceAntenna(solutions);
+    
+#pragma omp parallel for
+    for(size_t solutionIndex = 0; solutionIndex<_nAntennas*_nDirections; ++solutionIndex)
+    {
+#ifdef AOPROJECT
+      size_t thread = omp_get_thread_num();
+#else
+      size_t thread = LOFAR::OpenMP::threadNum();
+#endif
+      std::vector<double>& data = _threadData[thread];
+      std::vector<double>& fittedData = _threadFittedData[thread];
+      std::vector<double>& weights = _threadWeights[thread];
+      
+      for(size_t ch=0; ch!=_nChannelBlocks; ++ch) {
+        if(std::isfinite(solutions[ch][solutionIndex].real()) &&
+          std::isfinite(solutions[ch][solutionIndex].imag()))
+        {
+          data[ch] = std::arg(solutions[ch][solutionIndex]);
+          weights[ch] = 1.0;
+        }
+        else {
+          data[ch] = 0.0;
+          weights[ch] = 0.0;
+        }
+      }
+      
+      _pwFitters[thread].SlidingFit(_phaseFitters[thread].FrequencyData(), data, weights.data(), fittedData);
+
+      for(size_t ch=0; ch!=_nChannelBlocks; ++ch) 
+      {
+        solutions[ch][solutionIndex] = std::polar<double>(1.0, fittedData[ch]);
+      }
+    }
+
+    return std::vector<Constraint::Result>();
+  }
+}
diff --git a/CEP/DP3/DPPP_DDECal/src/multidirsolver.cc b/CEP/DP3/DPPP_DDECal/src/multidirsolver.cc
deleted file mode 100644
index d192567a9ba16d6c9abbdf1b1ade404515b0af0b..0000000000000000000000000000000000000000
--- a/CEP/DP3/DPPP_DDECal/src/multidirsolver.cc
+++ /dev/null
@@ -1,209 +0,0 @@
-#ifdef AOPROJECT
-#include "multidirsolver.h"
-#else
-#include <DPPP_DDECal/multidirsolver.h>
-#endif
-
-using namespace arma;
-
-MultiDirSolver::MultiDirSolver(size_t maxIterations, double accuracy, double stepSize) :
-  _nAntennas(0),
-  _nDirections(0),
-  _nChannels(0),
-  _nChannelBlocks(0),
-  _mode(CalibrateComplexGain),
-  _maxIterations(maxIterations),
-  _accuracy(accuracy),
-  _stepSize(stepSize)
-{
-}
-
-void MultiDirSolver::init(size_t nAntennas,
-                          size_t nDirections,
-                          size_t nChannels,
-                          const std::vector<int>& ant1,
-                          const std::vector<int>& ant2)
-{
-  _nAntennas = nAntennas;
-  _nDirections = nDirections;
-  _nChannels = nChannels;
-  _nChannelBlocks = nChannels;
-  _ant1 = ant1;
-  _ant2 = ant2;
-}
-
-MultiDirSolver::SolveResult MultiDirSolver::process(std::vector<Complex *>& data,
-  std::vector<std::vector<Complex *> >& modelData,
-  std::vector<std::vector<DComplex> >& solutions, double time) const
-{
-  const size_t nTimes = data.size();
-  SolveResult result;
-  
-  std::vector<std::vector<DComplex> > nextSolutions(_nChannelBlocks);
-  if (solutions.size() != _nChannelBlocks) {
-    cout << "Error: 'solutions' parameter does not have the right shape" << endl;
-    result.iterations = 0;
-    return result;
-  }
-
-  result._results.resize(_constraints.size());
-  
-  // Model matrix ant x [N x D] and visibility matrix ant x [N x 1],
-  // for each channelblock
-  // The following loop allocates all structures
-  std::vector<std::vector<cx_mat> > gTimesCs(_nChannelBlocks);
-  std::vector<std::vector<cx_vec> > vs(_nChannelBlocks);
-  for(size_t chBlock=0; chBlock!=_nChannelBlocks; ++chBlock)
-  {
-    //solutions[chBlock].assign(_nDirections * _nAntennas, 1.0);
-    nextSolutions[chBlock].resize(_nDirections * _nAntennas);
-    const size_t
-      channelIndexStart = chBlock * _nChannels / _nChannelBlocks,
-      channelIndexEnd = (chBlock+1) * _nChannels / _nChannelBlocks,
-      curChannelBlockSize = channelIndexEnd - channelIndexStart;
-    gTimesCs[chBlock].resize(_nAntennas);
-    vs[chBlock].resize(_nAntennas);
-    
-    for(size_t ant=0; ant!=_nAntennas; ++ant)
-    {
-      // Model matrix [N x D] and visibility matrix x [N x 1]
-      // Also space for the auto correlation is reserved, but it will be set to 0.
-      gTimesCs[chBlock][ant] = cx_mat(_nAntennas * nTimes * curChannelBlockSize,
-                                      _nDirections, fill::zeros);
-      vs[chBlock][ant] = cx_vec(_nAntennas * nTimes * curChannelBlockSize, fill::zeros);
-    }
-  }
-  
-  // TODO the data and model data needs to be preweighted.
-  // Maybe we can get a non-const pointer from DPPP, that saves copying/allocating
-  
-  ///
-  /// Start iterating
-  ///
-  size_t iteration = 0;
-  double normSum = 0.0, sum = 0.0;
-  do {
-#pragma omp parallel for
-    for(size_t chBlock=0; chBlock<_nChannelBlocks; ++chBlock)
-    {
-      performSolveIteration(chBlock, gTimesCs[chBlock], vs[chBlock],
-                            solutions[chBlock], nextSolutions[chBlock],
-                            data, modelData);
-    }
-      
-    // Move the solutions towards nextSolutions
-    // (the moved solutions are stored in 'nextSolutions')
-    for(size_t chBlock=0; chBlock!=_nChannelBlocks; ++chBlock)
-    {
-      for(size_t i=0; i!=_nAntennas*_nDirections; ++i)
-      {
-        nextSolutions[chBlock][i] = solutions[chBlock][i]*(1.0-_stepSize) +
-          nextSolutions[chBlock][i] * _stepSize;
-      }
-    }
-    for(size_t i=0; i!=_constraints.size(); ++i)
-    {
-      result._results[i] = _constraints[i]->Apply(nextSolutions, time);
-    }
-    
-    //  Calculate the norm of the difference between the old and new solutions
-    for(size_t chBlock=0; chBlock!=_nChannelBlocks; ++chBlock)
-    {
-      for(size_t i=0; i!=_nAntennas*_nDirections; ++i)
-      {
-        double e = std::norm(nextSolutions[chBlock][i] - solutions[chBlock][i]);
-        normSum += e;
-        sum += std::abs(solutions[chBlock][i]);
-        
-        solutions[chBlock][i] = nextSolutions[chBlock][i];
-        
-        // For debug: output the solutions of the first antenna
-        if(i<_nDirections && false)
-        {
-          std::cout << " |s_" << i << "|=|" << solutions[chBlock][i] << "|="
-                    << std::abs(solutions[chBlock][i]);
-        }
-      }
-    }
-    normSum /= _nChannelBlocks*_nAntennas*_nDirections;
-    sum /= _nChannelBlocks*_nAntennas*_nDirections;
-    iteration++;
-    
-  } while(iteration < _maxIterations && normSum/sum > _accuracy);
-  
-  if(normSum/sum <= _accuracy)
-    result.iterations = iteration;
-  else
-    result.iterations = _maxIterations+1;
-  return result;
-}
-
-void MultiDirSolver::performSolveIteration(size_t channelBlockIndex,
-                       std::vector<arma::cx_mat>& gTimesCs,
-                       std::vector<arma::cx_vec>& vs,
-                       const std::vector<DComplex>& solutions,
-                       std::vector<DComplex>& nextSolutions,
-                       const std::vector<Complex *>& data,
-                       const std::vector<std::vector<Complex *> >& modelData) const
-{
-  const size_t
-    channelIndexStart = channelBlockIndex * _nChannels / _nChannelBlocks,
-    channelIndexEnd = (channelBlockIndex+1) * _nChannels / _nChannelBlocks,
-    curChannelBlockSize = channelIndexEnd - channelIndexStart,
-    nTimes = data.size();
-  
-  // The following loop fills the matrices for all antennas
-  for(size_t timeIndex=0; timeIndex!=nTimes; ++timeIndex)
-  {
-    std::vector<const Complex*> modelPtrs(_nDirections);
-    for(size_t baseline=0; baseline!=_ant1.size(); ++baseline)
-    {
-      size_t antenna1 = _ant1[baseline];
-      size_t antenna2 = _ant2[baseline];
-      if(antenna1 != antenna2)
-      {
-        cx_mat& gTimesC1 = gTimesCs[antenna1];
-        cx_vec& v1 = vs[antenna1];
-        cx_mat& gTimesC2 = gTimesCs[antenna2];
-        cx_vec& v2 = vs[antenna2];
-        for(size_t d=0; d!=_nDirections; ++d)
-          modelPtrs[d] = modelData[timeIndex][d] + (channelIndexStart + baseline * _nChannels) * 4;
-        const Complex* dataPtr = data[timeIndex] + (channelIndexStart + baseline * _nChannels) * 4;
-        for(size_t ch=channelIndexStart; ch!=channelIndexEnd; ++ch)
-        {
-          size_t dataIndex1 = ch-channelIndexStart + (timeIndex + antenna1 * nTimes) * curChannelBlockSize;
-          size_t dataIndex2 = ch-channelIndexStart + (timeIndex + antenna2 * nTimes) * curChannelBlockSize;
-          //std::cout << "timeindex" << timeIndex << ' ';
-          for(size_t d=0; d!=_nDirections; ++d)
-          {
-            std::complex<double> predicted = modelPtrs[d][0] + modelPtrs[d][3];
-            //std::cout << predicted << ' ';
-            
-            size_t solIndex1 = antenna1*_nDirections + d;
-            size_t solIndex2 = antenna2*_nDirections + d;
-            gTimesC2(dataIndex1, d) = std::conj(solutions[solIndex1] * predicted); // using a* b* = (ab)*
-            gTimesC1(dataIndex2, d) = std::conj(solutions[solIndex2]) * predicted;
-            
-            modelPtrs[d] += 4; // Goto the next 2x2 matrix.
-          }
-          v1(dataIndex2) = dataPtr[0] + dataPtr[3]; // Solve using Stokes I
-          v2(dataIndex1) = std::conj(v1(dataIndex2));
-          dataPtr += 4; // Goto the next 2x2 matrix.
-        }
-      }
-    }
-  }
-  
-  // The matrices have been filled; compute the linear solution
-  // for each antenna.
-  for(size_t ant=0; ant!=_nAntennas; ++ant)
-  {
-    //std::cout << ant << '\n';
-    cx_mat& gTimesC = gTimesCs[ant];
-    cx_vec& v = vs[ant];
-    // solve [g* C] x  = v
-    cx_vec x = solve(gTimesC, v);
-    for(size_t d=0; d!=_nDirections; ++d)
-      nextSolutions[ant*_nDirections + d] = x(d);
-  }
-}
diff --git a/CEP/DP3/DPPP_DDECal/test/CMakeLists.txt b/CEP/DP3/DPPP_DDECal/test/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..4e67a4885a164addcaf8ceed735fbd5ab01f76e3
--- /dev/null
+++ b/CEP/DP3/DPPP_DDECal/test/CMakeLists.txt
@@ -0,0 +1,9 @@
+# $Id: CMakeLists.txt 38047 2017-07-26 12:49:53Z dijkema $
+
+# Run script to find current directory (needed for getting a tarball from
+# the source directory).
+configure_file(findenv.run_tmpl findenv.run_script)
+
+include(LofarCTest)
+
+lofar_add_test(tDDECal)
diff --git a/CEP/DP3/DPPP_DDECal/test/findenv.run_tmpl b/CEP/DP3/DPPP_DDECal/test/findenv.run_tmpl
new file mode 100644
index 0000000000000000000000000000000000000000..ca6b5eaf16fdc7f764abd8c53447fa495523cdb9
--- /dev/null
+++ b/CEP/DP3/DPPP_DDECal/test/findenv.run_tmpl
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+# Find taql program.
+taqlexe=@TAQL_EXECUTABLE@
+# Find srcdir in the runctest file.
+if test -f runctest.sh; then
+  rt_srcdir=`grep 'srcdir=' runctest.sh | sed -e 's/srcdir="//' -e 's/";.*//'`
+fi
diff --git a/CEP/DP3/DPPP_DDECal/test/tDDECal.in_MS.tgz b/CEP/DP3/DPPP_DDECal/test/tDDECal.in_MS.tgz
new file mode 100644
index 0000000000000000000000000000000000000000..bbaf4898f3f8483129e2be6a59d00b67e1194f3e
Binary files /dev/null and b/CEP/DP3/DPPP_DDECal/test/tDDECal.in_MS.tgz differ
diff --git a/CEP/DP3/DPPP_DDECal/test/tDDECal.run b/CEP/DP3/DPPP_DDECal/test/tDDECal.run
new file mode 100755
index 0000000000000000000000000000000000000000..7613cdfe14e8a4611930fc8c3908703ff6b837cc
--- /dev/null
+++ b/CEP/DP3/DPPP_DDECal/test/tDDECal.run
@@ -0,0 +1,102 @@
+#!/bin/bash
+
+# Get the taql executable and srcdir (script created by cmake's CONFIGURE_FILE).
+set -e
+source findenv.run_script
+echo "srcdirx=$rt_srcdir"
+
+# The lofar cmake logic for finding shared libraries at test time does not
+# work well on Darwin, work around this
+if [[ $(uname) == 'Darwin' ]]; then
+  DYLD_LIBRARY_PATH=$(realpath ../../../../lib):$DYLD_LIBRARY_PATH
+  export DYLD_LIBRARY_PATH
+  echo $DYLD_LIBRARY_PATH
+fi
+
+if test ! -f ${srcdir}/tDDECal.in_MS.tgz; then
+  exit 3   # untested
+fi
+
+mkdir -p tDDECal_tmp
+# Unpack the MS and other files and do the DPPP run.
+cd tDDECal_tmp
+rm -rf instrument2.h5 # Remove h5parm if it exists
+tar zxf ${srcdir}/tDDECal.in_MS.tgz
+
+echo "Running tDDECal"
+
+$taqlexe 'update tDDECal.MS set WEIGHT_SPECTRUM=1, FLAG=False'
+
+# Create expected taql output.
+echo "    select result of 0 rows" > taql.ref
+
+echo "Predict corrupted visibilities"
+cmd="NDPPP checkparset=1 msin=tDDECal.MS msout=. msout.datacolumn=DATA\
+  steps=[predict] predict.sourcedb=tDDECal.MS/sky_corrupted"
+echo $cmd
+$cmd
+
+for caltype in complexgain scalarcomplexgain amplitudeonly scalaramplitude
+do
+  rm -rf instrument.h5 # Remove h5parm if it exists
+  echo "Calibrate on the original sources, caltype=$caltype"
+  cmd="NDPPP checkparset=1 msin=tDDECal.MS msout=. steps=[ddecal]\
+    ddecal.sourcedb=tDDECal.MS/sky \
+     ddecal.directions=[[center,dec_off],[ra_off],[radec_off]] \
+     ddecal.h5parm=instrument.h5 ddecal.mode=$caltype"
+  echo $cmd
+  $cmd
+
+  echo "Apply solutions with multiple predict steps, caltype=$caltype"
+  cmd="NDPPP checkparset=1 msin=tDDECal.MS msout=. msout.datacolumn=SUBTRACTED_DATA\
+    steps=[predict1,predict2,predict3]\
+      predict1.sourcedb=tDDECal.MS/sky\
+      predict1.applycal.parmdb=instrument.h5 predict1.sources=[center,dec_off]\
+      predict1.operation=subtract predict1.applycal.correction=amplitude000 \
+      predict2.sourcedb=tDDECal.MS/sky\
+      predict2.applycal.parmdb=instrument.h5 predict2.sources=[radec_off]\
+      predict2.operation=subtract predict2.applycal.correction=amplitude000 \
+      predict3.sourcedb=tDDECal.MS/sky\
+      predict3.applycal.parmdb=instrument.h5 predict3.sources=[ra_off]\
+      predict3.operation=subtract predict3.applycal.correction=amplitude000"
+  echo $cmd
+  $cmd
+
+  echo "Check that residual is small, caltype=$caltype"
+  cmd="$taqlexe 'select norm_residual/norm_data FROM (select sqrt(abs(gsumsqr(WEIGHT_SPECTRUM*DATA[FLAG]))) as norm_data, sqrt(abs(gsumsqr(WEIGHT_SPECTRUM*SUBTRACTED_DATA[FLAG]))) as norm_residual from tDDECal.MS)'"
+  echo $cmd
+  eval $cmd
+  cmd="$taqlexe 'select FROM (select sqrt(abs(gsumsqr(WEIGHT_SPECTRUM*DATA[FLAG]))) as norm_data, sqrt(abs(gsumsqr(WEIGHT_SPECTRUM*SUBTRACTED_DATA[FLAG]))) as norm_residual from tDDECal.MS) where norm_residual/norm_data > 0.005' > taql.out"
+  echo $cmd
+  eval $cmd
+  diff taql.out taql.ref || exit 1
+done # Loop over caltype
+
+echo "Apply solutions with h5parmpredict"
+cmd="NDPPP checkparset=1 msin=tDDECal.MS msout=. msout.datacolumn=SUBTRACTED_DATA_H5PARM\
+  steps=[predict]\
+    predict.type=h5parmpredict\
+    predict.sourcedb=tDDECal.MS/sky\
+    predict.applycal.parmdb=instrument.h5\
+    predict.operation=subtract predict.applycal.correction=amplitude000"
+echo $cmd
+$cmd
+
+echo "Check that h5parmpredict creates the same output as multiple predict steps"
+cmd="$taqlexe 'select abs(gsumsqr(SUBTRACTED_DATA-SUBTRACTED_DATA)) as diff from tDDECal.MS'"
+echo $cmd
+eval $cmd
+cmd="$taqlexe 'select from (select abs(gsumsqr(SUBTRACTED_DATA-SUBTRACTED_DATA)) as diff from tDDECal.MS) where diff>1.e-6' > taql.out"
+echo $cmd
+eval $cmd
+diff taql.out taql.ref || exit 1
+
+echo "Check pre-apply"
+cmd="NDPPP checkparset=1 msin=tDDECal.MS msout=. numthreads=1\
+  steps=[ddecal]\
+    ddecal.sourcedb=tDDECal.MS/sky\
+    ddecal.directions=[[center,dec_off],[ra_off],[radec_off]]\
+    ddecal.applycal.parmdb=instrument.h5 ddecal.applycal.correction=amplitude000\
+    ddecal.h5parm=instrument2.h5 ddecal.mode=scalarcomplexgain"
+echo $cmd
+$cmd
diff --git a/CEP/DP3/DPPP_DDECal/test/tDDECal.sh b/CEP/DP3/DPPP_DDECal/test/tDDECal.sh
new file mode 100755
index 0000000000000000000000000000000000000000..c6f56dae9703623be7973f13a501161a47198a57
--- /dev/null
+++ b/CEP/DP3/DPPP_DDECal/test/tDDECal.sh
@@ -0,0 +1,2 @@
+#!/bin/sh
+./runctest.sh tDDECal
diff --git a/CEP/DP3/DPPP_DDECal/test/tDDECal_ref b/CEP/DP3/DPPP_DDECal/test/tDDECal_ref
new file mode 100755
index 0000000000000000000000000000000000000000..b052afc7813889d9e06e14c6cec30b489e21636d
--- /dev/null
+++ b/CEP/DP3/DPPP_DDECal/test/tDDECal_ref
@@ -0,0 +1,33 @@
+#!/bin/bash
+
+cat << EOF > tDDECal_tmp.skymodel
+FORMAT = Name, Type, Ra, Dec, I
+
+radec_off, POINT, 01:33:40,        +32.09.0,        10
+ra_off,    POINT, 01:29:40,        +33.09.35.13240, 20
+dec_off,   POINT, 01:37:41.299440, +32.09.0,        20
+center,    POINT, 01:37:41.299440, +33.09.35.13240, 10
+EOF
+
+# Corruptions:
+# [center, dec_off] :  5
+# [radec_off] :       13
+# [ra_off] :           9
+
+cat << EOF > tDDECal_tmp_corrupted.skymodel
+FORMAT = Name, Type, Ra, Dec, I
+
+radec_off, POINT, 01:33:40,        +32.09.0,        130
+ra_off,    POINT, 01:29:40,        +33.09.35.13240, 180
+dec_off,   POINT, 01:37:41.299440, +32.09.0,        100
+center,    POINT, 01:37:41.299440, +33.09.35.13240,  50
+EOF
+
+rm -rf tDDECal.MS/sky
+rm -rf tDDECal.MS/sky_corrupted
+makesourcedb in=tDDECal_tmp.skymodel out=tDDECal.MS/sky format='<'
+makesourcedb in=tDDECal_tmp_corrupted.skymodel out=tDDECal.MS/sky_corrupted format='<'
+rm tDDECal_tmp.skymodel
+rm tDDECal_tmp_corrupted.skymodel
+
+tar czf tDDECal.in_MS.tgz tDDECal.MS
diff --git a/CEP/DP3/PythonDPPP/test/tPythonStep.run b/CEP/DP3/PythonDPPP/test/tPythonStep.run
index e5dc9ba0b0d718c0a35a6450d17c632c89614eb9..3d7416429f9567f36e4acab05f74843784fe7536 100755
--- a/CEP/DP3/PythonDPPP/test/tPythonStep.run
+++ b/CEP/DP3/PythonDPPP/test/tPythonStep.run
@@ -14,8 +14,8 @@ tar zxf $srcdir/../../DPPP/test/tNDPPP.in_MS.tgz
 mv tNDPPP_tmp.MS tPythonStep_tmp.MS
 
 # Define the path for finding the library.
-LD_LIBRARY_PATH=../src:$LD_LIBRARYPATH
-DYLD_LIBRARY_PATH=../src:$DYLD_LIBRARYPATH
+LD_LIBRARY_PATH=../src:$LD_LIBRARY_PATH
+DYLD_LIBRARY_PATH=../src:$DYLD_LIBRARY_PATH
 export LD_LIBRARY_PATH
 export DYLD_LIBRARY_PATH
 
diff --git a/CEP/DP3/TestDynDPPP/test/tTestDynStep.run b/CEP/DP3/TestDynDPPP/test/tTestDynStep.run
index f23bb3595c4b27321cc7870ec7e8c1555a3322ef..2987402091ea6f4e39ffab738e382cd9cad22d98 100755
--- a/CEP/DP3/TestDynDPPP/test/tTestDynStep.run
+++ b/CEP/DP3/TestDynDPPP/test/tTestDynStep.run
@@ -1,8 +1,8 @@
 #!/bin/sh
 
 # Define the path for finding the library.
-LD_LIBRARY_PATH=../src:$LD_LIBRARYPATH
-DYLD_LIBRARY_PATH=../src:$DYLD_LIBRARYPATH
+LD_LIBRARY_PATH=../src:$LD_LIBRARY_PATH
+DYLD_LIBRARY_PATH=../src:$DYLD_LIBRARY_PATH
 export LD_LIBRARY_PATH
 export DYLD_LIBRARY_PATH
 
diff --git a/CEP/Imager/LofarFT/src/LofarFTMachine.cc b/CEP/Imager/LofarFT/src/LofarFTMachine.cc
index 09e8d4a0e3916dc276160a98d800145ff620a0e0..3f8da662609d3c9aecb86fb9bb0ada8b166f54b4 100644
--- a/CEP/Imager/LofarFT/src/LofarFTMachine.cc
+++ b/CEP/Imager/LofarFT/src/LofarFTMachine.cc
@@ -441,7 +441,7 @@ void LofarFTMachine::init() {
   uvOffset(2)=0;
 
   // Now set up the gridder. The possibilities are BOX and SF
-  if(gridder) delete gridder; gridder=0;
+  if(gridder) delete gridder;
   gridder = new ConvolveGridder<Double, Complex>(IPosition(2, nx, ny),
 						 uvScale, uvOffset,
 						 convType);
@@ -527,7 +527,8 @@ void LofarFTMachine::init() {
   // to a tile are written.
   its_Already_Initialized=true;
 
-  if(imageCache) delete imageCache; imageCache=0;
+  if(imageCache) delete imageCache;
+  imageCache=0;
 
   if(isTiled) {
     Float tileOverlap=0.5;
@@ -560,9 +561,11 @@ void LofarFTMachine::init() {
 // This is nasty, we should use CountedPointers here.
 LofarFTMachine::~LofarFTMachine()
 {
-  if(imageCache) delete imageCache; imageCache=0;
+  if(imageCache) delete imageCache;
+  imageCache=0;
   //if(arrayLattice) delete arrayLattice; arrayLattice=0;
-  if(gridder) delete gridder; gridder=0;
+  if(gridder) delete gridder;
+  gridder=0;
 //  delete itsConvFunc;
 }
 
diff --git a/CEP/Imager/LofarFT/src/LofarFTMachineOld.cc b/CEP/Imager/LofarFT/src/LofarFTMachineOld.cc
index 64080d693f3280c407c2a2c9b9c90261a10be37b..b5b980461a06eddc1196f06d3de0602def5c046d 100644
--- a/CEP/Imager/LofarFT/src/LofarFTMachineOld.cc
+++ b/CEP/Imager/LofarFT/src/LofarFTMachineOld.cc
@@ -311,7 +311,7 @@ void LofarFTMachineOld::init() {
   uvOffset(2)=0;
 
   // Now set up the gridder. The possibilities are BOX and SF
-  if(gridder) delete gridder; gridder=0;
+  if(gridder) delete gridder;
   gridder = new ConvolveGridder<Double, Complex>(IPosition(2, nx, ny),
 						 uvScale, uvOffset,
 						 convType);
@@ -347,7 +347,8 @@ void LofarFTMachineOld::init() {
   // we can use non-overlapped tiles. Otherwise we need to use
   // overlapped tiles and additive gridding so that only increments
   // to a tile are written.
-  if(imageCache) delete imageCache; imageCache=0;
+  if(imageCache) delete imageCache;
+  imageCache=0;
 
   if(isTiled) {
     Float tileOverlap=0.5;
@@ -374,9 +375,11 @@ void LofarFTMachineOld::init() {
 // This is nasty, we should use CountedPointers here.
 LofarFTMachineOld::~LofarFTMachineOld()
 {
-  if(imageCache) delete imageCache; imageCache=0;
+  if(imageCache) delete imageCache;
+  imageCache=0;
   //if(arrayLattice) delete arrayLattice; arrayLattice=0;
-  if(gridder) delete gridder; gridder=0;
+  if(gridder) delete gridder;
+  gridder=0;
 //  delete itsConvFunc;
 }
 
diff --git a/CMake/LofarMacros.cmake b/CMake/LofarMacros.cmake
index 7995cc094c79f6ee0607e7df796869b1224f2767..9b6fd9db69b2fe8ef90d36ab54312855e77d2d7d 100644
--- a/CMake/LofarMacros.cmake
+++ b/CMake/LofarMacros.cmake
@@ -178,22 +178,40 @@ if(NOT DEFINED LOFAR_MACROS_INCLUDED)
 
 
   # --------------------------------------------------------------------------
-  # lofar_add_sysconf_files([name1 [name2 ..]])
+  # lofar_add_sysconf_files([name1 [name2 ..]] [DESTINATION subdir])
   #
   # Add system configuration files (read-only single machine data) that need
   # to be installed into the <prefix>/etc directory. Also create a symbolic
   # link in <build-dir>/etc to each of these files. The file names may contain
   # a relative(!) path.
+  #
+  # The mentioned files are installed in the same relative path as provided,
+  # that is:
+  #     lofar_add_sysconf_files(foo/bar)
+  # installs "etc/foo/bar". To override this behaviour use:
+  #     lofar_add_sysconf_files(foo/bar DESTINATION .)
+  # installs "etc/bar".
   # --------------------------------------------------------------------------
   macro(lofar_add_sysconf_files)
-    foreach(_name ${ARGN})
-      get_filename_component(_path ${_name} PATH)
-      get_filename_component(_abs_name ${_name} ABSOLUTE)
-      file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/etc/${_path})
+    string(REGEX REPLACE ";?DESTINATION.*" "" _src_names "${ARGN}")
+    string(REGEX MATCH "DESTINATION;.*" _destination "${ARGN}")
+    string(REGEX REPLACE "^DESTINATION;" "" _destination "${_destination}")
+    foreach(_src_name ${_src_names})
+      if(_destination MATCHES ".+")
+        get_filename_component(_src_filename ${_src_name} NAME)
+        set(_dest_name ${_destination}/${_src_filename})
+      else(_destination MATCHES ".+")
+        set(_dest_name ${_src_name})
+      endif(_destination MATCHES ".+")
+
+      get_filename_component(_abs_name ${_src_name} ABSOLUTE)
+      get_filename_component(_dest_path ${_dest_name} PATH)
+
+      file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/etc/${_dest_path})
       execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
-        ${_abs_name} ${CMAKE_BINARY_DIR}/etc/${_name})
-      install(FILES ${_name} DESTINATION etc/${_path})
-    endforeach(_name ${ARGN})
+        ${_abs_name} ${CMAKE_BINARY_DIR}/etc/${_dest_name})
+      install(FILES ${_src_name} DESTINATION etc/${_dest_path})
+    endforeach(_src_name ${_src_names})
   endmacro(lofar_add_sysconf_files)
 
 
diff --git a/CMake/LofarPackageList.cmake b/CMake/LofarPackageList.cmake
index e493558f47d12355edd7945f823aa2e16f9229d1..ecbb7808261108628e29333691365dbe672edac1 100644
--- a/CMake/LofarPackageList.cmake
+++ b/CMake/LofarPackageList.cmake
@@ -1,7 +1,7 @@
 # - Create for each LOFAR package a variable containing the absolute path to
 # its source directory. 
 #
-# Generated by gen_LofarPackageList_cmake.sh at wo 12 jul 2017 13:22:27 CEST
+# Generated by gen_LofarPackageList_cmake.sh at Mon Sep  4 11:22:44 CEST 2017
 #
 #                      ---- DO NOT EDIT ----
 #
@@ -37,7 +37,7 @@ if(NOT DEFINED LOFAR_PACKAGE_LIST_INCLUDED)
   set(PythonDPPP_SOURCE_DIR ${CMAKE_SOURCE_DIR}/CEP/DP3/PythonDPPP)
   set(DPPP_AOFlag_SOURCE_DIR ${CMAKE_SOURCE_DIR}/CEP/DP3/DPPP_AOFlag)
   set(SPW_Combine_SOURCE_DIR ${CMAKE_SOURCE_DIR}/CEP/DP3/SPWCombine)
-  set(AOFlagger_SOURCE_DIR ${CMAKE_SOURCE_DIR}/CEP/DP3/AOFlagger)
+  set(DPPP_DDECal_SOURCE_DIR ${CMAKE_SOURCE_DIR}/CEP/DP3/DPPP_DDECal)
   set(LofarFT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/CEP/Imager/LofarFT)
   set(AWImager2_SOURCE_DIR ${CMAKE_SOURCE_DIR}/CEP/Imager/AWImager2)
   set(Laps-GRIDInterface_SOURCE_DIR ${CMAKE_SOURCE_DIR}/CEP/LAPS/GRIDInterface)
@@ -134,7 +134,7 @@ if(NOT DEFINED LOFAR_PACKAGE_LIST_INCLUDED)
   set(Navigator2_SOURCE_DIR ${CMAKE_SOURCE_DIR}/MAC/Navigator2)
   set(MACTools_SOURCE_DIR ${CMAKE_SOURCE_DIR}/MAC/Tools)
   set(MAC_Services_SOURCE_DIR ${CMAKE_SOURCE_DIR}/MAC/Services)
-  set(PVSS_Datapoints_SOURCE_DIR ${CMAKE_SOURCE_DIR}/MAC/Deployment/data/PVSS)
+  set(WinCC_Datapoints_SOURCE_DIR ${CMAKE_SOURCE_DIR}/MAC/Deployment/data/PVSS)
   set(OTDB_Comps_SOURCE_DIR ${CMAKE_SOURCE_DIR}/MAC/Deployment/data/OTDB)
   set(StaticMetaData_SOURCE_DIR ${CMAKE_SOURCE_DIR}/MAC/Deployment/data/StaticMetaData)
   set(WinCC_Services_SOURCE_DIR ${CMAKE_SOURCE_DIR}/MAC/WinCCServices)
@@ -168,6 +168,7 @@ if(NOT DEFINED LOFAR_PACKAGE_LIST_INCLUDED)
   set(DataManagementCommon_SOURCE_DIR ${CMAKE_SOURCE_DIR}/SAS/DataManagement/DataManagementCommon)
   set(StorageQueryService_SOURCE_DIR ${CMAKE_SOURCE_DIR}/SAS/DataManagement/StorageQueryService)
   set(Cleanup_SOURCE_DIR ${CMAKE_SOURCE_DIR}/SAS/DataManagement/Cleanup)
+  set(ResourceTool_SOURCE_DIR ${CMAKE_SOURCE_DIR}/SAS/DataManagement/ResourceTool)
   set(CleanupCommon_SOURCE_DIR ${CMAKE_SOURCE_DIR}/SAS/DataManagement/Cleanup/CleanupCommon)
   set(CleanupService_SOURCE_DIR ${CMAKE_SOURCE_DIR}/SAS/DataManagement/Cleanup/CleanupService)
   set(CleanupClient_SOURCE_DIR ${CMAKE_SOURCE_DIR}/SAS/DataManagement/Cleanup/CleanupClient)
@@ -202,7 +203,7 @@ if(NOT DEFINED LOFAR_PACKAGE_LIST_INCLUDED)
   set(Offline_SOURCE_DIR ${CMAKE_SOURCE_DIR}/SubSystems/Offline)
   set(SAS_OTDB_SOURCE_DIR ${CMAKE_SOURCE_DIR}/SubSystems/SAS_OTDB)
   set(SAS_Tools_SOURCE_DIR ${CMAKE_SOURCE_DIR}/SubSystems/SAS_Tools)
-  set(PVSS_DB_SOURCE_DIR ${CMAKE_SOURCE_DIR}/SubSystems/PVSS_DB)
+  set(WinCC_DB_SOURCE_DIR ${CMAKE_SOURCE_DIR}/SubSystems/WinCC_DB)
   set(RAServices_SOURCE_DIR ${CMAKE_SOURCE_DIR}/SubSystems/RAServices)
   set(DataManagement_SOURCE_DIR ${CMAKE_SOURCE_DIR}/SubSystems/DataManagement)
   set(Dragnet_SOURCE_DIR ${CMAKE_SOURCE_DIR}/SubSystems/Dragnet)
diff --git a/CMake/variants/variants.dragnet b/CMake/variants/variants.dragnet
index 93f6de5ed56effd37a6895ea4dfb022efe304a36..84bb41c6e2a30f7d6f9e9b0fe844b8fcd56de336 100644
--- a/CMake/variants/variants.dragnet
+++ b/CMake/variants/variants.dragnet
@@ -14,8 +14,8 @@ option(USE_CUDA      "Use CUDA"      ON)
 set(LOG4CPLUS_ROOT_DIR    /opt/log4cplus-1.1.2)  # RHEL/CentOS 7 has log4cxx in the repo, but LOFAR log4cxx is dodgy, so install log4cplus from CentOS 6 rpm pkgs.
 set(BLITZ_ROOT_DIR        /opt/blitz-0.10)
 set(CUDA_TOOLKIT_ROOT_DIR /opt/cuda-7.5)   # libcuda.so on CentOS 7 w/ CUDA driver from ElRepo resides under /usr/lib64/nvidia/
-set(CASACORE_ROOT_DIR     /opt/casacore-2.1.0)
-set(CASAREST_ROOT_DIR     /opt/casarest-1.4.1)
+set(CASACORE_ROOT_DIR     /opt/casacore-2.3.0)
+set(CASAREST_ROOT_DIR     /opt/casarest-1.4.2)
 set(CASA_ROOT_DIR         /opt/casasynthesis)  # for awimager2; pkg has no releases; it's a chunk of CASA, so var name is misleading, since it'll fail on the real CASA root dir
 set(DAL_ROOT_DIR          /opt/lofardal-2.5.0)
 set(AOFLAGGER_ROOT_DIR    /opt/aoflagger-2.9.0)
diff --git a/CMake/variants/variants.fs5 b/CMake/variants/variants.fs5
new file mode 100644
index 0000000000000000000000000000000000000000..cb8823233188a0927e50224b4e64c20e66c0510d
--- /dev/null
+++ b/CMake/variants/variants.fs5
@@ -0,0 +1,67 @@
+# Definitions file for DAS5 compiler suite.
+#
+# Compiler suite
+set(LOFAR_COMPILER_SUITES GNU)
+
+# Build variants
+set(LOFAR_BUILD_VARIANTS DEBUG OPT OPT3 OPTARCH)
+
+# After loading the right gcc version module (not tested with other compilers)
+if(NOT (DEFINED ENV{CC} AND DEFINED ENV{CXX} AND DEFINED ENV{FC}))
+   message(FATAL_ERROR "CC, CXX and FC environment variables are required. Have you loaded the compile module?")
+endif()
+
+set(GNU_COMPILERS GNU_C GNU_CXX GNU_Fortran GNU_ASM)
+set(GNU_C         $ENV{CC}  )      # C compiler
+set(GNU_CXX       $ENV{CXX} )      # C++ compiler
+set(GNU_Fortran   $ENV{FC}  )      # Fortran compiler
+set(GNU_ASM       $ENV{CC}  )      # assembler
+
+message(WARNING "Building using fs5 variants file. Compilers picked based on environment variables, flags are based on directory name (e.g. gnu_opt assumes gnu compiler suite). This could be inconsistent and cause problems.")
+
+# if(NOT ENV{FOO_HOME})
+#   message(FATAL_ERROR "Could not find FOO_HOME environment variable")
+#   endif(NOT ENV{FOO_HOME}))
+#
+#
+#
+# DAS5 specific settings
+option(USE_QPID         "Use Qpid"            OFF)
+option(USE_OPENMP       "Use OpenMP"           ON)
+set(WCSLIB_ROOT_DIR     $ENV{WCSLIB_ROOT_DIR}    )
+set(CFITSIO_ROOT_DIR    $ENV{CFITSIO_ROOT_DIR}   )
+set(CASAREST_ROOT_DIR   $ENV{CASAREST_ROOT_DIR}  )
+set(CASACORE_ROOT_DIR   $ENV{CASACORE_ROOT_DIR}  )
+set(LOG4CPLUS_ROOT_DIR  $ENV{LOG4CPLUS_ROOT_DIR} )
+set(PYTHON_BDSF         $ENV{PYBDSF_ROOT_DIR}    )
+set(AOFLAGGER_ROOT_DIR  $ENV{AOFLAGGER_ROOT_DIR} )
+
+set(GNU_C_FLAGS          "-W -Wall -Wno-unknown-pragmas")
+set(GNU_C_FLAGS_DEBUG    "-g")
+set(GNU_C_FLAGS_OPT      "-g -O2")
+set(GNU_C_FLAGS_OPT3     "-g -O3")
+set(GNU_C_FLAGS_OPTARCH  "-g -O3 -march=native")
+set(GNU_CXX_FLAGS        "-W -Wall -Woverloaded-virtual -Wno-unknown-pragmas")
+set(GNU_CXX_FLAGS_DEBUG  "-g")
+set(GNU_CXX_FLAGS_OPT    "-g -O2")
+set(GNU_CXX_FLAGS_OPT3   "-g -O3")
+set(GNU_CXX_FLAGS_OPTARCH "-g -O3 -march=native")
+set(GNU_EXE_LINKER_FLAGS)
+set(GNU_EXE_LINKER_FLAGS_DEBUG)
+set(GNU_EXE_LINKER_FLAGS_OPT)
+set(GNU_EXE_LINKER_FLAGS_OPT3)
+set(GNU_EXE_LINKER_FLAGS_OPTARCH)
+set(GNU_SHARED_LINKER_FLAGS)
+set(GNU_SHARED_LINKER_FLAGS_DEBUG)
+set(GNU_SHARED_LINKER_FLAGS_OPT)
+set(GNU_SHARED_LINKER_FLAGS_OPT3)
+set(GNU_SHARED_LINKER_FLAGS_OPTARCH)
+set(GNU_COMPILE_DEFINITIONS)
+set(GNU_COMPILE_DEFINITIONS_DEBUG 
+                         "-DLOFAR_DEBUG -DENABLE_DBGASSERT -DENABLE_TRACER")
+set(GNU_COMPILE_DEFINITIONS_OPT)
+set(GNU_COMPILE_DEFINITIONS_OPT3
+                         "-DNDEBUG -DDISABLE_DEBUG_OUTPUT")
+set(GNU_COMPILE_DEFINITIONS_OPTARCH
+                         "-DNDEBUG -DDISABLE_DEBUG_OUTPUT")
+
diff --git a/Docker/dynspec/chuser.sh b/Docker/dynspec/chuser.sh
index 9ac3603c1a072dffff02461e9e8e59b1833b7f4f..718ad2aa9c65a88323006d0b3ab9593559e72aeb 100755
--- a/Docker/dynspec/chuser.sh
+++ b/Docker/dynspec/chuser.sh
@@ -14,10 +14,6 @@ if [ -z "${HOME}" ]; then
   mkdir -p $HOME && cd $HOME
 fi
 
-# Add user to system
-fgrep -q ":x:${UID}:" /etc/passwd || echo "${USER}:x:${UID}:${UID}::${HOME}:/bin/bash" >> /etc/passwd
-fgrep -q ":x:${UID}:" /etc/group  || echo "${USER}:x:${UID}:" >> /etc/group
-
 # Set the environment
 [ -e /opt/bashrc ] && source /opt/bashrc
 
diff --git a/Docker/lofar-base/Dockerfile.tmpl b/Docker/lofar-base/Dockerfile.tmpl
index d9faff3d377224be3fd6380151564527665f1326..0ee75ac6f6d957d39d2f3244210c8f3e41c52a7b 100644
--- a/Docker/lofar-base/Dockerfile.tmpl
+++ b/Docker/lofar-base/Dockerfile.tmpl
@@ -44,8 +44,7 @@ RUN apt-get update && \
 # open security holes (allow smooth user switching, allow sudo)
 #
 RUN echo 'ALL ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers && \
-    sed -i 's/requiretty/!requiretty/g' /etc/sudoers && \
-    chmod a+rw /etc/group /etc/passwd
+    sed -i 's/requiretty/!requiretty/g' /etc/sudoers 
 
 #
 # setup install dir
diff --git a/Docker/lofar-base/chuser.sh b/Docker/lofar-base/chuser.sh
index 46872545a87da2e2516bc3ab2e443644c8ee6281..4ba563587e590259db30f8cd5e60edfb9e07609e 100755
--- a/Docker/lofar-base/chuser.sh
+++ b/Docker/lofar-base/chuser.sh
@@ -11,10 +11,6 @@ if [ -z "${HOME}" ]; then
   mkdir -p $HOME && cd $HOME
 fi
 
-# Add user to system
-fgrep -q ":x:${UID}:" /etc/passwd || echo "${USER}:x:${UID}:${UID}::${HOME}:/bin/bash" >> /etc/passwd
-fgrep -q ":x:${UID}:" /etc/group  || echo "${USER}:x:${UID}:" >> /etc/group
-
 # Set the environment
 [ -e /opt/bashrc ] && source /opt/bashrc
 
diff --git a/Docker/lofar-outputproc/Dockerfile.tmpl b/Docker/lofar-outputproc/Dockerfile.tmpl
index 818e940c86158454f0585711c5af4a457b16f3c0..9b23d99fb7dd9ab89e9ad5f1e03de33485762e7f 100644
--- a/Docker/lofar-outputproc/Dockerfile.tmpl
+++ b/Docker/lofar-outputproc/Dockerfile.tmpl
@@ -32,6 +32,7 @@ RUN apt-get update && apt-get install -y subversion cmake g++ gfortran bison fle
     bash -c "strip ${INSTALLDIR}/lofar/{bin,sbin,lib64}/* || true" && \
     bash -c "rm -rf ${INSTALLDIR}/lofar/{build,src}" && \
     setcap cap_sys_nice,cap_sys_admin=ep ${INSTALLDIR}/lofar/bin/outputProc && \
+    setcap cap_sys_nice,cap_sys_admin=ep ${INSTALLDIR}/lofar/bin/TBB_Writer && \
     apt-get purge -y subversion cmake g++ gfortran bison flex autogen liblog4cplus-dev libhdf5-dev libblitz0-dev libboost-dev libboost-python${BOOST_VERSION}-dev libxml2-dev pkg-config libpng12-dev libfftw3-dev libunittest++-dev libxml++2.6-dev libboost-filesystem${BOOST_VERSION}-dev libboost-date-time${BOOST_VERSION}-dev libboost-thread${BOOST_VERSION}-dev binutils-dev libcfitsio3-dev wcslib-dev libopenblas-dev && \
     apt-get autoremove -y --purge
 
diff --git a/Docker/lofar-pipeline/Dockerfile.tmpl b/Docker/lofar-pipeline/Dockerfile.tmpl
index 5f84716396a799bfe5869122ff8cadaafdaae5c4..1ae4c72764b326465b629c86b2895bd0ae0c237b 100644
--- a/Docker/lofar-pipeline/Dockerfile.tmpl
+++ b/Docker/lofar-pipeline/Dockerfile.tmpl
@@ -18,7 +18,7 @@ RUN apt-get update && apt-get install -y python-xmlrunner python-scipy liblog4cp
 # *******************
 #
 
-ENV PYBDSF_VERSION=1.8.8
+ENV PYBDSF_VERSION=1.8.12
 
 RUN apt-get update && apt-get install -y git g++ gfortran libboost-python-dev python-setuptools && \
     mkdir ${INSTALLDIR}/pybdsf && \
diff --git a/INSTALL b/INSTALL
index ee42cb3f06825c5332eb08e7d374d6ef0888b73a..eb3dcd725af9098cfbcf423ef233c4e1874bd4f9 100644
--- a/INSTALL
+++ b/INSTALL
@@ -53,6 +53,7 @@ For Debian/Ubuntu (likely incomplete list, but goes a long way):
 	apt-get install libpng12-dev                         # or latest version; for AOFlagger
 	apt-get install libreadline-dev libpqxx-dev doxygen python-coverage  # optional
 	apt-get install libxml++2.6-dev                      # or newer
+        apt-get install libarmadillo-dev                     # optional, for DPPP_DDECal
 	apt-get install libunittest++-dev                    # optional, for tests that use UnitTest++
 	apt-get install python-xmlrunner                     # for some CEP/Pipeline/ tests
 	apt-get install python-pygresql python-psycopg2 python-mysql.connector  # python mysql and postgresql interfaces
@@ -67,6 +68,7 @@ For CentOS/Fedora (likely incomplete list, but goes a long way):
 	yum install boost-devel fftw-devel cfitsio-devel libxml2-devel libpng-devel
 	yum install readline-devel libpqxx-devel doxygen python-coverage  # optional
 	yum install libxml++-devel
+        yum install armadillo-devel                          # optional, for DPPP_DDECal
 	yum install PyGreSQL python-psycopg2 mysql-connector-python  # python mysql and postgresql interfaces
 	yum install python2-mock python-django               # for some SAS/ tests
 	yum install postgresql                               # optional, for some SAS/OTDB_Services/ tests
diff --git a/LCS/ApplCommon/src/PosixTime.cc b/LCS/ApplCommon/src/PosixTime.cc
index ef9a540310bf1773014ab53e7c91c93c40daee0a..c4913ba1f4978c496665259d403b219b9719e478 100644
--- a/LCS/ApplCommon/src/PosixTime.cc
+++ b/LCS/ApplCommon/src/PosixTime.cc
@@ -40,7 +40,7 @@ namespace LOFAR
     time_t sec(static_cast<time_t>(secsEpoch1970));
     long usec(static_cast<long>(1000000 * (secsEpoch1970 - sec)));
     return posix_time::from_time_t(sec) + posix_time::microseconds(usec);
-	}
+  }
 
 }
 
diff --git a/LCS/Common/include/Common/StringUtil.h b/LCS/Common/include/Common/StringUtil.h
index dd026da2e8b5ef51ca12233d61d8aaee477d8d81..13e5ebc85e4cf3a7b5596eafe2e7d8202ccdcb85 100644
--- a/LCS/Common/include/Common/StringUtil.h
+++ b/LCS/Common/include/Common/StringUtil.h
@@ -324,17 +324,17 @@ inline std::string toString(long double val, const char* fmt = 0)
 // \attention These functions will be deprecated in a next release.
 // @{
 
-bool   StringToBool  (const string& aString)                   throw(Exception);
-int16  StringToInt16 (const string& aString,const char* fmt=0) throw(Exception);
-uint16 StringToUint16(const string& aString,const char* fmt=0) throw(Exception);
-int32  StringToInt32 (const string& aString,const char* fmt=0) throw(Exception);
-uint32 StringToUint32(const string& aString,const char* fmt=0) throw(Exception);
+bool   StringToBool  (const string& aString)                   ;
+int16  StringToInt16 (const string& aString,const char* fmt=0) ;
+uint16 StringToUint16(const string& aString,const char* fmt=0) ;
+int32  StringToInt32 (const string& aString,const char* fmt=0) ;
+uint32 StringToUint32(const string& aString,const char* fmt=0) ;
 #if HAVE_LONG_LONG
-int64  StringToInt64 (const string& aString,const char* fmt=0) throw(Exception);
-uint64 StringToUint64(const string& aString,const char* fmt=0) throw(Exception);
+int64  StringToInt64 (const string& aString,const char* fmt=0) ;
+uint64 StringToUint64(const string& aString,const char* fmt=0) ;
 #endif
-float  StringToFloat (const string& aString,const char* fmt=0) throw(Exception);
-double StringToDouble(const string& aString,const char* fmt=0) throw(Exception);
+float  StringToFloat (const string& aString,const char* fmt=0) ;
+double StringToDouble(const string& aString,const char* fmt=0) ;
 
 // @}
 
@@ -345,21 +345,21 @@ double StringToDouble(const string& aString,const char* fmt=0) throw(Exception);
 // Leading and trailing whitespace is allowed.
 // It checks if an integer value does not exceed the data type range.
 // @{
-long          strToLong   (const string& aString) throw(Exception);
-int           strToInt    (const string& aString) throw(Exception);
-int32         strToInt32  (const string& aString) throw(Exception);
-int16         strToInt16  (const string& aString) throw(Exception);
-unsigned long strToUlong  (const string& aString) throw(Exception);
-uint          strToUint   (const string& aString) throw(Exception);
-uint32        strToUint32 (const string& aString) throw(Exception);
-uint16        strToUint16 (const string& aString) throw(Exception);
+long          strToLong   (const string& aString) ;
+int           strToInt    (const string& aString) ;
+int32         strToInt32  (const string& aString) ;
+int16         strToInt16  (const string& aString) ;
+unsigned long strToUlong  (const string& aString) ;
+uint          strToUint   (const string& aString) ;
+uint32        strToUint32 (const string& aString) ;
+uint16        strToUint16 (const string& aString) ;
 #if HAVE_LONG_LONG
-int64         strToInt64  (const string& aString) throw(Exception);
-uint64        strToUint64 (const string& aString) throw(Exception);
+int64         strToInt64  (const string& aString) ;
+uint64        strToUint64 (const string& aString) ;
 #endif
-float         strToFloat  (const string& aString) throw(Exception);
-double        strToDouble (const string& aString) throw(Exception);
-inline bool   strToBool   (const string& aString) throw(Exception)
+float         strToFloat  (const string& aString) ;
+double        strToDouble (const string& aString) ;
+inline bool   strToBool   (const string& aString) 
   { return StringToBool (aString); }
 // @}
 
diff --git a/LCS/Common/include/Common/Thread/Sem_t.h b/LCS/Common/include/Common/Thread/Sem_t.h
index 112be85166441a94e4bfecc7e6d34c4f2d542de4..5fcc2ebd6565f82d9ee62e7c37fa1f0b65849ee7 100644
--- a/LCS/Common/include/Common/Thread/Sem_t.h
+++ b/LCS/Common/include/Common/Thread/Sem_t.h
@@ -95,6 +95,7 @@ public:
     return true;
   }
 
+#if _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600  // OS X does not have sem_timedwait()
   bool timedwait(const struct timespec *abs_timeout) {
     if (::sem_timedwait(&sem, abs_timeout) < 0) {
       if (errno == ETIMEDOUT) {
@@ -104,6 +105,7 @@ public:
     }
     return true;
   }
+#endif
 
 private:
   Sem_t(const Sem_t&);
diff --git a/LCS/Common/include/Common/Thread/Semaphore.h b/LCS/Common/include/Common/Thread/Semaphore.h
index 3bb01ecadeebdebb1d0e520714a4a755e87ef65c..a9571e2e22b2d15808e4824fc98793d3d2b6f5be 100644
--- a/LCS/Common/include/Common/Thread/Semaphore.h
+++ b/LCS/Common/include/Common/Thread/Semaphore.h
@@ -42,6 +42,7 @@ class Semaphore
     bool tryDown(unsigned count = 1);
     bool tryDown(unsigned count, const struct timespec &timespec);
 
+    unsigned getValue();
     void noMore();
     
   private:
@@ -114,6 +115,13 @@ inline bool Semaphore::tryDown(unsigned count, const struct timespec &timespec)
 }
 
 
+inline unsigned Semaphore::getValue()
+{
+  ScopedLock lock(mutex); // w/ C++11, we can use memory_order_relaxed instead
+  return level;
+}
+
+
 inline void Semaphore::noMore()
 {
   ScopedLock lock(mutex);
diff --git a/LCS/Common/src/Net/Socket.cc b/LCS/Common/src/Net/Socket.cc
index 5c1fc9c9f012900405edb05d0e80439749ff737c..cc62629e632fb752e0ac46f1e1e69412da220c3c 100644
--- a/LCS/Common/src/Net/Socket.cc
+++ b/LCS/Common/src/Net/Socket.cc
@@ -387,17 +387,18 @@ int32 Socket::initTCPSocket(bool	asServer)
 		uint32				IPbytes;
 		// try if hostname is hard ip address
 		if ((IPbytes = inet_addr(itsHost.c_str())) == INADDR_NONE) {
-		  struct addrinfo*		hostEnt;		// server host entry
+		  struct addrinfo*		hostEnt = NULL;		// server host entry
 
 		  // No, try to resolve the name
 		  if (getaddrinfo(itsHost.c_str(), NULL, &hints, &hostEnt) != 0) {
 		    LOG_ERROR(formatString("Socket:Hostname (%s) can not be resolved",
 														itsHost.c_str()));
+            if (hostEnt)
+                freeaddrinfo(hostEnt);
 		    return (itsErrno = BADHOST);
 		  }
 
 		  memcpy (&IPbytes, &reinterpret_cast<struct sockaddr_in *>(hostEnt->ai_addr)->sin_addr, sizeof IPbytes);
-
           freeaddrinfo(hostEnt);
 		}
 		memcpy ((char*) &itsTCPAddr.sin_addr.s_addr, (char*) &IPbytes, 
@@ -405,12 +406,16 @@ int32 Socket::initTCPSocket(bool	asServer)
 	}
 			
 	// try to resolve the service
-	struct addrinfo*	servEnt;		// service info entry
+	struct addrinfo*	servEnt = NULL;		// service info entry
 
 	if (getaddrinfo(NULL, itsPort.c_str(), &hints, &servEnt) != 0) {
 		LOG_ERROR(formatString(
 					"Socket:Portnr/service(%s) can not be resolved",
 					itsPort.c_str()));
+
+        if (servEnt)
+            freeaddrinfo(servEnt);
+
 		return (itsErrno = PORT);
 	}
 
@@ -951,6 +956,7 @@ int32 Socket::write (const void*	buf, int32	nrBytes)
 		while (bytesLeft > 0 && !itsErrno && !sigpipe) {
 			errno = 0;								// reset system error
 			int32 oldCounter = *sigpipeCounter;
+
 			bytesWritten = ::write (itsSocketID, buf, bytesLeft);
 			//std::clog << "wrote " << bytesWritten << " from " << bytesLeft << " bytes" << std::endl;
 			sigpipe = (oldCounter != *sigpipeCounter); // check for SIGPIPE
diff --git a/LCS/Common/src/StringUtil.cc b/LCS/Common/src/StringUtil.cc
index 350d0f64f83335842ec23c509b41bdc58bfe562f..290b6b2993fb2e8a4421466cbf4a06926995ec4f 100644
--- a/LCS/Common/src/StringUtil.cc
+++ b/LCS/Common/src/StringUtil.cc
@@ -214,7 +214,7 @@ string	toLower(string str)
   return str;
 }
 
-bool	StringToBool(const string& aString) throw(Exception)
+bool	StringToBool(const string& aString) 
 {
 	char	firstChar = aString.c_str()[0];
 	if ((firstChar == 't') || (firstChar == 'T') || (firstChar == '1') || (firstChar == 'Y') || (firstChar == 'y'))
@@ -226,7 +226,7 @@ bool	StringToBool(const string& aString) throw(Exception)
 	THROW (Exception, aString + " is not a boolean value");
 }	
 
-int16	StringToInt16(const string& aString, const char* fmt) throw(Exception)
+int16	StringToInt16(const string& aString, const char* fmt) 
 {
 	int16		theShort;
 	if ((fmt ? sscanf(aString.c_str(), fmt, &theShort) : 
@@ -237,7 +237,7 @@ int16	StringToInt16(const string& aString, const char* fmt) throw(Exception)
 	return (theShort);
 }	
 
-uint16	StringToUint16(const string& aString, const char* fmt) throw(Exception)
+uint16	StringToUint16(const string& aString, const char* fmt) 
 {
 	uint16		theUshort;
 	if ((fmt ? sscanf(aString.c_str(), fmt, &theUshort) : 
@@ -248,7 +248,7 @@ uint16	StringToUint16(const string& aString, const char* fmt) throw(Exception)
 	return (theUshort);
 }	
 
-int32	StringToInt32(const string& aString, const char* fmt) throw(Exception)
+int32	StringToInt32(const string& aString, const char* fmt) 
 {
 	int32		theInt;
 	if ((fmt ? sscanf(aString.c_str(), fmt, &theInt) : 
@@ -258,7 +258,7 @@ int32	StringToInt32(const string& aString, const char* fmt) throw(Exception)
 	return (theInt);
 }	
 
-uint32	StringToUint32(const string& aString, const char* fmt) throw(Exception)
+uint32	StringToUint32(const string& aString, const char* fmt) 
 {
 	uint32		theUint;
 	if ((fmt ? sscanf(aString.c_str(), fmt, &theUint) : 
@@ -270,7 +270,7 @@ uint32	StringToUint32(const string& aString, const char* fmt) throw(Exception)
 }	
 
 #if HAVE_LONG_LONG
-int64	StringToInt64(const string& aString, const char* fmt) throw(Exception)
+int64	StringToInt64(const string& aString, const char* fmt) 
 {
 	int64		theLong;
 	if ((fmt ? sscanf(aString.c_str(), fmt, &theLong) : 
@@ -281,7 +281,7 @@ int64	StringToInt64(const string& aString, const char* fmt) throw(Exception)
 	return (theLong);
 }	
 
-uint64	StringToUint64(const string& aString, const char* fmt) throw(Exception)
+uint64	StringToUint64(const string& aString, const char* fmt) 
 {
 	uint64		theUlong;
 	if ((fmt ? sscanf(aString.c_str(), fmt, &theUlong) : 
@@ -293,7 +293,7 @@ uint64	StringToUint64(const string& aString, const char* fmt) throw(Exception)
 }	
 #endif
 
-float	StringToFloat(const string& aString, const char* fmt) throw(Exception)
+float	StringToFloat(const string& aString, const char* fmt) 
 {
 	float		theFloat;
 	if ((fmt ? sscanf(aString.c_str(), fmt, &theFloat) : 
@@ -305,7 +305,7 @@ float	StringToFloat(const string& aString, const char* fmt) throw(Exception)
 }	
 
 
-double	StringToDouble(const string& aString, const char* fmt) throw(Exception)
+double	StringToDouble(const string& aString, const char* fmt) 
 {
 	double		theDouble;
 	if ((fmt ? sscanf(aString.c_str(), fmt, &theDouble) : 
@@ -317,7 +317,7 @@ double	StringToDouble(const string& aString, const char* fmt) throw(Exception)
 }	
 
 
-long strToLong (const string& aString) throw(Exception)
+long strToLong (const string& aString) 
 {
   const char* str = aString.c_str();
   int st  = lskipws(aString, 0, aString.size());
@@ -338,7 +338,7 @@ long strToLong (const string& aString) throw(Exception)
   return val;
 }
 
-int strToInt (const string& aString) throw(Exception)
+int strToInt (const string& aString) 
 {
   long val = strToLong (aString);
   if (sizeof(int) != sizeof(long)) {
@@ -350,7 +350,7 @@ int strToInt (const string& aString) throw(Exception)
   return val;
 }
 
-int32 strToInt32 (const string& aString) throw(Exception)
+int32 strToInt32 (const string& aString) 
 {
   long val = strToLong (aString);
   if (sizeof(int32) != sizeof(long)) {
@@ -360,7 +360,7 @@ int32 strToInt32 (const string& aString) throw(Exception)
   return val;
 }
 
-int16 strToInt16 (const string& aString) throw(Exception)
+int16 strToInt16 (const string& aString) 
 {
   long val = strToLong (aString);
   ASSERTSTR (val >= -32768L  &&  val <= 32767L,
@@ -368,7 +368,7 @@ int16 strToInt16 (const string& aString) throw(Exception)
   return val;
 }
 
-unsigned long strToUlong (const string& aString) throw(Exception)
+unsigned long strToUlong (const string& aString) 
 {
   const char* str = aString.c_str();
   int st  = lskipws(aString, 0, aString.size());
@@ -389,7 +389,7 @@ unsigned long strToUlong (const string& aString) throw(Exception)
   return val;
 }
 
-uint strToUint (const string& aString) throw(Exception)
+uint strToUint (const string& aString) 
 {
   unsigned long val = strToUlong (aString);
   if (sizeof(uint) != sizeof(unsigned long)) {
@@ -401,7 +401,7 @@ uint strToUint (const string& aString) throw(Exception)
   return val;
 }
 
-uint32 strToUint32 (const string& aString) throw(Exception)
+uint32 strToUint32 (const string& aString) 
 {
   unsigned long val = strToUlong (aString);
   if (sizeof(uint32) != sizeof(unsigned long)) {
@@ -411,7 +411,7 @@ uint32 strToUint32 (const string& aString) throw(Exception)
   return val;
 }
 
-uint16 strToUint16 (const string& aString) throw(Exception)
+uint16 strToUint16 (const string& aString) 
 {
   unsigned long val = strToUlong (aString);
   ASSERTSTR (val <= 65535UL,
@@ -419,7 +419,7 @@ uint16 strToUint16 (const string& aString) throw(Exception)
   return val;
 }
 
-float strToFloat (const string& aString) throw(Exception)
+float strToFloat (const string& aString) 
 {
   const char* str = aString.c_str();
   int st  = lskipws(aString, 0, aString.size());
@@ -434,7 +434,7 @@ float strToFloat (const string& aString) throw(Exception)
   return val;
 }
 
-double strToDouble (const string& aString) throw(Exception)
+double strToDouble (const string& aString) 
 {
   const char* str = aString.c_str();
   int st  = lskipws(aString, 0, aString.size());
@@ -450,7 +450,7 @@ double strToDouble (const string& aString) throw(Exception)
 }
 
 #if HAVE_LONG_LONG
-int64 strToInt64  (const string& aString) throw(Exception)
+int64 strToInt64  (const string& aString) 
 {
   if (sizeof(int64) == sizeof(long)) return strToLong(aString);
   ASSERTSTR (sizeof(int64)==sizeof(long long),
@@ -474,7 +474,7 @@ int64 strToInt64  (const string& aString) throw(Exception)
   return val;
 }
 
-uint64 strToUint64 (const string& aString) throw(Exception)
+uint64 strToUint64 (const string& aString) 
 {
   if (sizeof(uint64) == sizeof(unsigned long)) return strToUlong(aString);
   ASSERTSTR (sizeof(uint64)==sizeof(unsigned long long),
diff --git a/LCS/Common/test/tSem_t.cc b/LCS/Common/test/tSem_t.cc
index 4e6947dba381daa5070be4f7474e20dca6688ede..79e3b42fc497cb89e9791696ec9a43246def06f9 100644
--- a/LCS/Common/test/tSem_t.cc
+++ b/LCS/Common/test/tSem_t.cc
@@ -81,6 +81,9 @@ static void testSimple() {
   sem.post();
   ASSERT(sem.trywait());
 
+#if _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600  // OS X does not have sem_timedwait()
+  LOG_INFO("Testing timedwait wrapper");
+
   // timedwait
   struct timespec ts1 = {::time(0), 0};
   ASSERT(!sem.timedwait(&ts1));
@@ -90,6 +93,7 @@ static void testSimple() {
   // underlying timedwait is specified to succeed if decr is possible immediately,
   // even if abs_timeout already passed
   ASSERT(sem.timedwait(&ts2));
+#endif
 }
 
 int main()
diff --git a/LCS/MessageBus/test/MessageFuncs.sh.in b/LCS/MessageBus/test/MessageFuncs.sh.in
index 68c93328f939ffc851765144a4cd2a93168a6b48..73aab099d6c076e54850cdd364f370a21f51e349 100755
--- a/LCS/MessageBus/test/MessageFuncs.sh.in
+++ b/LCS/MessageBus/test/MessageFuncs.sh.in
@@ -108,7 +108,8 @@ function create_queue() {
   #   create_queue [host:]queue
   HOSTQUEUE="$1"
 
-  echo "MessageBus: Creating queue $FULL_QUEUE_PREFIX$HOSTQUEUE" >&2
+  ts=`date '+%F %T.%N'`  # e.g. 2015-10-16 16:00:46.186
+  echo "$ts INFO - MessageFuncs.sh: Creating queue $FULL_QUEUE_PREFIX$HOSTQUEUE" >&2
 
   _qpid_receive "$HOSTQUEUE" "; { create: always }" --print-content no --ignore-reply-to
 
@@ -125,7 +126,8 @@ function delete_queue() {
   # Will not remove used queues
   HOSTQUEUE="$1"
 
-  echo "MessageBus: Deleting queue $FULL_QUEUE_PREFIX$HOSTQUEUE" >&2
+  ts=`date '+%F %T.%N'`  # e.g. 2015-10-16 16:00:46.186
+  echo "$ts INFO - MessageFuncs.sh: Deleting queue $FULL_QUEUE_PREFIX$HOSTQUEUE" >&2
 
   _qpid_receive "$HOSTQUEUE" "; { delete: always }" --print-content no --ignore-reply-to
 }
diff --git a/LCS/Messaging/python/messaging/Service.py b/LCS/Messaging/python/messaging/Service.py
index 034d2c835076b259352137a7512b7887ba0639aa..7efef0ee7051a00e81cf44751c40589ec5000b04 100644
--- a/LCS/Messaging/python/messaging/Service.py
+++ b/LCS/Messaging/python/messaging/Service.py
@@ -211,7 +211,9 @@ class Service(AbstractBusListener):
                     reply_msg.subject=subject
                     dest.send(reply_msg)
             except  MessageBusError as e:
-                logger.error("Failed to send reply message to reply address %s on messagebus %s" %(subject,reply_busname))
+                logger.error("Failed to send reply message to reply address %s on messagebus %s. Error: %s", subject,
+                                                                                                             reply_busname,
+                                                                                                             e)
             return
 
         if isinstance(self.reply_bus,ToBus):
@@ -219,7 +221,9 @@ class Service(AbstractBusListener):
             try:
                 self.reply_bus.send(reply_msg)
             except MessageBusError as e:
-                logger.error("Failed to send reply message to reply address %s on messagebus %s" %(reply_to,self.busname))
+                logger.error("Failed to send reply message to reply address %s on messagebus %s. Error: %s", reply_to,
+                                                                                                             self.busname,
+                                                                                                             e)
             return
         else:
             # the reply address is not in a default known format
@@ -229,7 +233,7 @@ class Service(AbstractBusListener):
                 with ToBus(reply_to) as dest:
                     dest.send(reply_msg)
             except MessageBusError as e:
-                logger.error("Failed to send reply messgage to reply address %s" %(reply_to))
+                logger.error("Failed to send reply messgage to reply address %s. Error: %s", reply_to, e)
 
     def _getServiceHandlerForCurrentThread(self):
         currentThread = threading.currentThread()
diff --git a/LCS/Messaging/python/messaging/test/CMakeLists.txt b/LCS/Messaging/python/messaging/test/CMakeLists.txt
index b4816dd96b7b390e47416c128a367e64345c46e6..361727be5357441a3abe5f8bf3a66c8853f99871 100644
--- a/LCS/Messaging/python/messaging/test/CMakeLists.txt
+++ b/LCS/Messaging/python/messaging/test/CMakeLists.txt
@@ -2,7 +2,18 @@
 
 include(LofarCTest)
 
-lofar_add_test(t_messages)
-lofar_add_test(t_messagebus)
-lofar_add_test(t_RPC)
-lofar_add_test(t_service_message_handler)
+set(_qpid_tests
+    t_messages
+    t_messagebus
+    t_RPC
+    t_service_message_handler)
+
+if(HAVE_QPID)
+ foreach(_test ${_qpid_tests})
+   lofar_add_test(${_test})
+ endforeach()
+else()
+  lofar_join_arguments(_qpid_tests)
+  message(WARNING "Qpid is not set."
+    "The following tests will not be run: ${_qpid_tests}")
+endif()
diff --git a/LCS/PyCommon/datetimeutils.py b/LCS/PyCommon/datetimeutils.py
index debf508809fd1954aaf4d52b024e8c43dc924f7d..6b32db4efa0caaf0aae442841ce54827d862794d 100644
--- a/LCS/PyCommon/datetimeutils.py
+++ b/LCS/PyCommon/datetimeutils.py
@@ -54,6 +54,15 @@ def totalSeconds(td_value):
 
     return (td_value.microseconds + (td_value.seconds + td_value.days * 86400) * 1000000) / 1000000.0
 
+def format_timedelta(td):
+    '''Return string representation of timedelta value td, which works even for negative values.
+    Normal python is weird: str(timedelta(hours=-1)) becomes '-1 day, 23:00:00'
+    With this function: format_timedelta(timedelta(hours=-1)) becomes '-1:00:00' which makes much more sense!
+    '''
+    if td < timedelta(0):
+        return '-' + str(-td)
+    return str(td)
+
 def parseDatetime(date_time):
     """ Parse the datetime format used in LOFAR parsets. """
-    return datetime.strptime(date_time, '%Y-%m-%d %H:%M:%S')
+    return datetime.strptime(date_time, ('%Y-%m-%d %H:%M:%S.%f' if '.' in date_time else '%Y-%m-%d %H:%M:%S'))
diff --git a/LCS/Stream/include/Stream/FileDescriptorBasedStream.h b/LCS/Stream/include/Stream/FileDescriptorBasedStream.h
index 8b46090e9478a413e17315aeed1944ef2d2d198b..1682651b1a0ac292ac9a1ebfded7b023acd20631 100644
--- a/LCS/Stream/include/Stream/FileDescriptorBasedStream.h
+++ b/LCS/Stream/include/Stream/FileDescriptorBasedStream.h
@@ -1,6 +1,6 @@
 //# FileDescriptorBasedStream.h: 
 //#
-//# Copyright (C) 2008
+//# Copyright (C) 2008, 2017
 //# ASTRON (Netherlands Institute for Radio Astronomy)
 //# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
 //#
@@ -37,8 +37,16 @@ class FileDescriptorBasedStream : public Stream
     virtual size_t tryRead(void *ptr, size_t size);
     virtual size_t tryWrite(const void *ptr, size_t size);
 
+    virtual size_t tryReadv(const struct iovec *iov, int iovcnt);
+    virtual size_t tryWritev(const struct iovec *iov, int iovcnt);
+
     virtual void   sync();
 
+    // Apart from int, fcntl can also be called with an arg of type struct flock *, or struct f_owner_ex *
+    int            fcntl(int cmd);
+    int            fcntl(int cmd, int arg);
+
+
     int		   fd;
 };
 
diff --git a/LCS/Stream/include/Stream/FileStream.h b/LCS/Stream/include/Stream/FileStream.h
index ee2cb7f3eebd57d7724cfba9a046467e5cdaf85c..5186659d04d02589edcf16384c25225df944ed02 100644
--- a/LCS/Stream/include/Stream/FileStream.h
+++ b/LCS/Stream/include/Stream/FileStream.h
@@ -1,6 +1,6 @@
 //# FileStream.h: 
 //#
-//# Copyright (C) 2008
+//# Copyright (C) 2008, 2015-2017
 //# ASTRON (Netherlands Institute for Radio Astronomy)
 //# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
 //#
diff --git a/LCS/Stream/include/Stream/FixedBufferStream.h b/LCS/Stream/include/Stream/FixedBufferStream.h
index 40d0763aeff618d534c9e7594edd2257f01a113f..1116043f876c71cee7a3b5ad0a8d76d1be18d3ea 100644
--- a/LCS/Stream/include/Stream/FixedBufferStream.h
+++ b/LCS/Stream/include/Stream/FixedBufferStream.h
@@ -1,6 +1,6 @@
 //# FixedBufferStream.h: 
 //#
-//# Copyright (C) 2008
+//# Copyright (C) 2008, 2017
 //# ASTRON (Netherlands Institute for Radio Astronomy)
 //# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
 //#
@@ -32,6 +32,10 @@ namespace LOFAR {
 // no wrap-around support!
 // not thread safe!
 
+// Note that an object represents a reader xor writer, not the buffer.
+//   which is passed in. To use it, reader and writer each create an object passing the same buffer.
+//   The reader may (at its own peril) overtake the writer. (I don't get what's the use of this semantic.)
+
 class FixedBufferStream : public Stream
 {
   public:
@@ -41,6 +45,9 @@ class FixedBufferStream : public Stream
     virtual size_t tryRead(void *ptr, size_t size);
     virtual size_t tryWrite(const void *ptr, size_t size);
 
+    virtual size_t tryReadv(const struct iovec *iov, int iovcnt);
+    virtual size_t tryWritev(const struct iovec *iov, int iovcnt);
+
   private:
     char * const itsEnd;
 
diff --git a/LCS/Stream/include/Stream/NamedPipeStream.h b/LCS/Stream/include/Stream/NamedPipeStream.h
index 2980859e041b5d868978f5c3c32ec3e8bc427eb3..4e820936b226ac2c94341a74b7dc8a1c31b28727 100644
--- a/LCS/Stream/include/Stream/NamedPipeStream.h
+++ b/LCS/Stream/include/Stream/NamedPipeStream.h
@@ -1,6 +1,6 @@
 //# NamedPipeStream.h: 
 //#
-//# Copyright (C) 2008
+//# Copyright (C) 2008, 2017
 //# ASTRON (Netherlands Institute for Radio Astronomy)
 //# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
 //#
@@ -36,7 +36,11 @@ class NamedPipeStream : public Stream
 		   NamedPipeStream(const char *name, bool serverSide);
     virtual	   ~NamedPipeStream();
 
-    virtual size_t tryRead(void *, size_t), tryWrite(const void *, size_t);
+    virtual size_t tryRead(void *ptr, size_t size);
+    virtual size_t tryWrite(const void *ptr, size_t size);
+
+    virtual size_t tryReadv(const struct iovec *iov, int iovcnt);
+    virtual size_t tryWritev(const struct iovec *iov, int iovcnt);
 
     virtual void   sync();
 
diff --git a/LCS/Stream/include/Stream/NullStream.h b/LCS/Stream/include/Stream/NullStream.h
index 96e5086bd2187610aa0344b4c2b480fd9936f064..5e373facb291302a69691f68b744f27f973248e2 100644
--- a/LCS/Stream/include/Stream/NullStream.h
+++ b/LCS/Stream/include/Stream/NullStream.h
@@ -1,6 +1,6 @@
 //# NullStream.h: 
 //#
-//# Copyright (C) 2008
+//# Copyright (C) 2008, 2017
 //# ASTRON (Netherlands Institute for Radio Astronomy)
 //# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
 //#
@@ -25,8 +25,6 @@
 
 #include <Stream/Stream.h>
 
-#include <errno.h>
-
 
 namespace LOFAR {
 
@@ -37,6 +35,9 @@ class NullStream : public Stream
 
     virtual size_t tryRead(void *ptr, size_t size);
     virtual size_t tryWrite(const void *ptr, size_t size);
+
+    virtual size_t tryReadv(const struct iovec *iov, int iovcnt);
+    virtual size_t tryWritev(const struct iovec *iov, int iovcnt);
 };
 
 } // namespace LOFAR
diff --git a/LCS/Stream/include/Stream/SharedMemoryStream.h b/LCS/Stream/include/Stream/SharedMemoryStream.h
index 90af7b832018d69b7c808196e301d0b9b09b91ca..cf259f5792107e9600af0b3d13e87368ff029722 100644
--- a/LCS/Stream/include/Stream/SharedMemoryStream.h
+++ b/LCS/Stream/include/Stream/SharedMemoryStream.h
@@ -1,6 +1,6 @@
 //# SharedMemoryStream.h: 
 //#
-//# Copyright (C) 2008
+//# Copyright (C) 2008, 2017
 //# ASTRON (Netherlands Institute for Radio Astronomy)
 //# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
 //#
@@ -39,6 +39,10 @@ class SharedMemoryStream : public Stream
     virtual size_t tryRead(void *ptr, size_t size);
     virtual size_t tryWrite(const void *ptr, size_t size);
 
+    // these 2 throw a NotImplemented exception
+    virtual size_t tryReadv(const struct iovec *iov, int iovcnt);
+    virtual size_t tryWritev(const struct iovec *iov, int iovcnt);
+
   private:
     Mutex      readLock, writeLock;
     Semaphore  readDone, writePosted;
diff --git a/LCS/Stream/include/Stream/SocketStream.h b/LCS/Stream/include/Stream/SocketStream.h
index d26495c1337d105d00b09a192e2c41e03fc0ab50..3749472e17f1b8a1bfa93a053017065e93e08e42 100644
--- a/LCS/Stream/include/Stream/SocketStream.h
+++ b/LCS/Stream/include/Stream/SocketStream.h
@@ -1,6 +1,6 @@
 //# SocketStream.h: 
 //#
-//# Copyright (C) 2008, 2015
+//# Copyright (C) 2008, 2015-2017
 //# ASTRON (Netherlands Institute for Radio Astronomy)
 //# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
 //#
@@ -59,21 +59,37 @@ class SocketStream : public FileDescriptorBasedStream
     const Protocol protocol;
     const Mode mode;
 
+    /*
+     * Send message(s). Note: only for UDP client socket!
+     *   @bufBase contains all messages to be sent. It may have gaps, but all of the same size.
+     *   @msgSize indicates the (common) size of each individual message. @msgSize <= @msgBufSize must hold.
+     *   @msgBufSize indicates the size of the buffer of each message, aka distance between the
+     *     start of two consecutive messages. Typically, same as @msgSize, unless a gap is not to be send.
+     *   @sentMsgSizes length indicates the (maximum) number of messages to send.
+     *     Note: the Linux sendmmsg(2) man page indicates this is capped to UIO_MAXIOV (1024).
+     *     The actually sent sizes per message will be written into this argument.
+     *   @flags: passed to sendmsg(2)/sendmmsg(2). For some of our cases, we want to always pass MSG_CONFIRM.
+     * Returns the number of messages sent if ok, or throws on syscall error.
+     */
+    unsigned sendmmsg( void *bufBase, size_t msgSize, size_t msgBufSize,
+                       std::vector<unsigned> &sentMsgSizes, int flags ) const;
+
     /*
      * Receive message(s). Note: only for UDP server socket!
      *   @bufBase is large enough to store all to be received messages
-     *   @maxMsgSize indicates the max size of _each_ (i.e. 1) message
-     *   @recvdMsgSizes is passed in with a size indicating the max number of
-     *     messages to receive. Actually received sizes will be written therein.
+     *   @maxMsgSize indicates the max size of each individual message
+     *   @recvdMsgSizes length indicates the maximum number of messages to receive.
+     *     The actually received sizes per message will be written into this argument.
      * Returns the number of messages received if ok, or throws on syscall error
      */
-    unsigned recvmmsg( void *bufBase, unsigned maxMsgSize,
+    unsigned recvmmsg( void *bufBase, size_t maxMsgSize,
                        std::vector<unsigned> &recvdMsgSizes ) const;
 
-    // Allow individual recv()/send() calls to last for 'timeout' seconds before returning EWOULDBLOCK
+    // Allow individual recv()/send() calls to last for 'timeout' seconds before returning EAGAIN (or EWOULDBLOCK)
     void setTimeout(double timeout);
 
-    int getPort() const { return port; }
+    std::string getHostname() const { return hostname; }
+    uint16 getPort() const { return port; }
 
   private:
     const std::string hostname;
diff --git a/LCS/Stream/include/Stream/Stream.h b/LCS/Stream/include/Stream/Stream.h
index 49cbf2465d2ff69dc349c22d3825ab104b620bc7..93b7ff703c23f34facd2cf743bd481ed1b3575ab 100644
--- a/LCS/Stream/include/Stream/Stream.h
+++ b/LCS/Stream/include/Stream/Stream.h
@@ -1,6 +1,6 @@
 //# Stream.h: 
 //#
-//# Copyright (C) 2008
+//# Copyright (C) 2008, 2017
 //# ASTRON (Netherlands Institute for Radio Astronomy)
 //# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
 //#
@@ -24,6 +24,7 @@
 #define LOFAR_LCS_STREAM_STREAM_H
 
 #include <cstddef>
+#include <sys/uio.h>
 #include <string>
 
 #include <Common/Exception.h>
@@ -42,6 +43,9 @@ class Stream
     virtual size_t tryWrite(const void *ptr, size_t size) = 0;
     void	   write(const void *ptr, size_t size); // does not return until all bytes are written
 
+    virtual size_t tryReadv(const struct iovec *iov, int iovcnt) = 0;
+    virtual size_t tryWritev(const struct iovec *iov, int iovcnt) = 0;
+
     std::string    readLine(); // excludes '\n'
 
     virtual void   sync();
diff --git a/LCS/Stream/include/Stream/StringStream.h b/LCS/Stream/include/Stream/StringStream.h
index c305d56a6402ded75a5150e65e9cd09f8ef28dba..ba43c9150dad5c0dfcb6713049c675aeb8b67834 100644
--- a/LCS/Stream/include/Stream/StringStream.h
+++ b/LCS/Stream/include/Stream/StringStream.h
@@ -1,6 +1,6 @@
 //# StringStream.h: 
 //#
-//# Copyright (C) 2008
+//# Copyright (C) 2008, 2017
 //# ASTRON (Netherlands Institute for Radio Astronomy)
 //# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
 //#
@@ -39,6 +39,9 @@ class StringStream : public Stream
     virtual size_t tryRead(void *ptr, size_t size);
     virtual size_t tryWrite(const void *ptr, size_t size);
 
+    virtual size_t tryReadv(const struct iovec *iov, int iovcnt);
+    virtual size_t tryWritev(const struct iovec *iov, int iovcnt);
+
     void close();
 
   private:
diff --git a/LCS/Stream/src/FileDescriptorBasedStream.cc b/LCS/Stream/src/FileDescriptorBasedStream.cc
index ebd7a2c9074b8a4affbab2981763ddb8b1708db8..5b6f338053346b01ad6b97530ed10f1cb867749f 100644
--- a/LCS/Stream/src/FileDescriptorBasedStream.cc
+++ b/LCS/Stream/src/FileDescriptorBasedStream.cc
@@ -1,6 +1,6 @@
 //# FileDescriptorBasedStream.cc: 
 //#
-//# Copyright (C) 2008
+//# Copyright (C) 2008, 2017
 //# ASTRON (Netherlands Institute for Radio Astronomy)
 //# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
 //#
@@ -25,6 +25,7 @@
 #include <Stream/FileDescriptorBasedStream.h>
 
 #include <unistd.h>
+#include <fcntl.h>
 
 #include <Common/SystemCallException.h>
 #include <Common/Thread/Cancellation.h>
@@ -82,10 +83,54 @@ size_t FileDescriptorBasedStream::tryWrite(const void *ptr, size_t size)
 }
 
 
+size_t FileDescriptorBasedStream::tryReadv(const struct iovec *iov, int iovcnt)
+{
+  ssize_t bytes = ::readv(fd, iov, iovcnt);
+
+  if (bytes < 0)
+    THROW_SYSCALL("readv");
+
+  return bytes;
+}
+
+
+size_t FileDescriptorBasedStream::tryWritev(const struct iovec *iov, int iovcnt)
+{
+  ssize_t bytes = ::writev(fd, iov, iovcnt);
+
+  if (bytes < 0)
+    THROW_SYSCALL("writev");
+
+  return bytes;
+}
+
+
 void FileDescriptorBasedStream::sync()
 {
   if (::fsync(fd) < 0)
     THROW_SYSCALL("fsync");
 }
 
+
+int FileDescriptorBasedStream::fcntl(int cmd)
+{
+  int rv = ::fcntl(fd, cmd);
+
+  if (rv < 0)
+    THROW_SYSCALL("fcntl");
+
+  return rv;
+}
+
+
+int FileDescriptorBasedStream::fcntl(int cmd, int arg)
+{
+  int rv = ::fcntl(fd, cmd, arg);
+
+  if (rv < 0)
+    THROW_SYSCALL("fcntl");
+
+  return rv;
+}
+
 } // namespace LOFAR
diff --git a/LCS/Stream/src/FixedBufferStream.cc b/LCS/Stream/src/FixedBufferStream.cc
index 1578ba4042b34d618d05cfaa9229e4ec70d3d0cd..43630a2e44a35ecc82cf4d5d9ebe903cb61e1d2d 100644
--- a/LCS/Stream/src/FixedBufferStream.cc
+++ b/LCS/Stream/src/FixedBufferStream.cc
@@ -1,6 +1,6 @@
 //# FixedBufferStream.cc: 
 //#
-//# Copyright (C) 2008
+//# Copyright (C) 2008, 2017
 //# ASTRON (Netherlands Institute for Radio Astronomy)
 //# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
 //#
@@ -48,6 +48,9 @@ size_t FixedBufferStream::tryRead(void *ptr, size_t size)
 {
   Cancellation::point(); // keep behaviour consistent with real I/O streams
 
+  if (size == 0)
+    return 0;
+
   size_t numBytes = std::min<size_t>(size, itsEnd - itsHead);
 
   if (numBytes == 0)
@@ -64,6 +67,9 @@ size_t FixedBufferStream::tryWrite(const void *ptr, size_t size)
 {
   Cancellation::point(); // keep behaviour consistent with real I/O streams
 
+  if (size == 0)
+    return 0;
+
   size_t numBytes = std::min<size_t>(size, itsEnd - itsHead);
 
   if (numBytes == 0)
@@ -75,4 +81,61 @@ size_t FixedBufferStream::tryWrite(const void *ptr, size_t size)
   return numBytes;
 }
 
+
+size_t FixedBufferStream::tryReadv(const struct iovec *iov, int iovcnt)
+{
+  Cancellation::point(); // keep behaviour consistent with real I/O streams
+
+  size_t nread = 0;
+
+  for (int i = 0; i < iovcnt; i++) {
+    if (iov[i].iov_len <= (size_t)(itsEnd - itsHead)) {
+      memcpy(iov[i].iov_base, itsHead, iov[i].iov_len);
+      itsHead += iov[i].iov_len;
+      nread += iov[i].iov_len;
+    } else {
+      if (itsEnd - itsHead == 0) {
+        if (nread == 0) // to be read > 0
+          THROW(EndOfStreamException, "No space left in buffer");
+      } else {
+        memcpy(iov[i].iov_base, itsHead, itsEnd - itsHead);
+        itsHead = itsEnd;
+        nread += itsEnd - itsHead;
+      }
+      break;
+    }
+  }
+
+  return nread;
+}
+
+
+size_t FixedBufferStream::tryWritev(const struct iovec *iov, int iovcnt)
+{
+  Cancellation::point(); // keep behaviour consistent with real I/O streams
+
+  size_t nwritten = 0;
+
+  for (int i = 0; i < iovcnt; i++) {
+    if (iov[i].iov_len <= (size_t)(itsEnd - itsHead)) {
+      memcpy(itsHead, iov[i].iov_base, iov[i].iov_len);
+      itsHead += iov[i].iov_len;
+      nwritten += iov[i].iov_len;
+    } else {
+      if (itsEnd - itsHead == 0) {
+        if (nwritten == 0) // to be written > 0
+          THROW(EndOfStreamException, "No space left in buffer");
+      } else {
+        memcpy(itsHead, iov[i].iov_base, itsEnd - itsHead);
+        itsHead = itsEnd;
+        nwritten += itsEnd - itsHead;
+      }
+      break;
+    }
+  }
+
+  return nwritten;
+}
+
+
 } // namespace LOFAR
diff --git a/LCS/Stream/src/NamedPipeStream.cc b/LCS/Stream/src/NamedPipeStream.cc
index 20d7d961a22891bc7a6690a9bc4d5bc2057d8647..2feca6038200628be12dd68bd552a1919cd4edd4 100644
--- a/LCS/Stream/src/NamedPipeStream.cc
+++ b/LCS/Stream/src/NamedPipeStream.cc
@@ -1,6 +1,6 @@
 //# NamedPipeStream.cc: 
 //#
-//# Copyright (C) 2008
+//# Copyright (C) 2008, 2017
 //# ASTRON (Netherlands Institute for Radio Astronomy)
 //# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
 //#
@@ -86,6 +86,18 @@ size_t NamedPipeStream::tryWrite(const void *ptr, size_t size)
 }
 
 
+size_t NamedPipeStream::tryReadv(const struct iovec *iov, int iovcnt)
+{
+  return itsReadStream->tryReadv(iov, iovcnt);
+}
+
+
+size_t NamedPipeStream::tryWritev(const struct iovec *iov, int iovcnt)
+{
+  return itsWriteStream->tryWritev(iov, iovcnt);
+}
+
+
 void NamedPipeStream::sync()
 {
   itsWriteStream->sync();
diff --git a/LCS/Stream/src/NetFuncs.cc b/LCS/Stream/src/NetFuncs.cc
index d843da657e3caf3cf8d4e4a1817f15f8f3812d07..b77fadb2cc5bfc0be2cdbe4cb9e5fa2fc380e67e 100644
--- a/LCS/Stream/src/NetFuncs.cc
+++ b/LCS/Stream/src/NetFuncs.cc
@@ -138,8 +138,8 @@ namespace LOFAR {
                                  NULL, 0, NI_NAMEREQD);
         if (retval != 0) {
           const std::string errorstr = gai_strerror(retval);
-          LOG_WARN_STR(str(format("myHostnames(): failed to getnameinfo() for some addr of type %d on interface %s: %s") %
-                           family % ap->ifa_name % errorstr));
+          LOG_DEBUG_STR(str(format("myHostnames(): failed to getnameinfo() for some addr of type %d on interface %s: %s") %
+                            family % ap->ifa_name % errorstr));
           continue;
         }
       }
diff --git a/LCS/Stream/src/NullStream.cc b/LCS/Stream/src/NullStream.cc
index 1b6c54b3e84fc28e87d0a827105d55f19955e27a..24e29d5e481d5a8a9185ebfe7ab9b4ed7fc14b50 100644
--- a/LCS/Stream/src/NullStream.cc
+++ b/LCS/Stream/src/NullStream.cc
@@ -1,6 +1,6 @@
 //# NullStream.cc: 
 //#
-//# Copyright (C) 2008
+//# Copyright (C) 2008, 2017
 //# ASTRON (Netherlands Institute for Radio Astronomy)
 //# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
 //#
@@ -23,10 +23,9 @@
 #include <lofar_config.h>
 
 #include <Stream/NullStream.h>
-#include <Common/Thread/Cancellation.h>
 
 #include <cstring>
-
+#include <Common/Thread/Cancellation.h>
 
 namespace LOFAR {
 
@@ -51,4 +50,34 @@ size_t NullStream::tryWrite(const void *, size_t size)
   return size;
 }
 
+
+size_t NullStream::tryReadv(const struct iovec *iov, int iovcnt)
+{
+  Cancellation::point(); // keep behaviour consistent with non-null streams
+
+  size_t size = 0;
+
+  for (int i = 0; i < iovcnt; i++) {
+    memset(iov[i].iov_base, 0, iov[i].iov_len);
+    size += iov[i].iov_len;
+  }
+
+  return size;
+}
+
+
+size_t NullStream::tryWritev(const struct iovec *iov, int iovcnt)
+{
+  Cancellation::point(); // keep behaviour consistent with non-null streams
+
+  size_t size = 0;
+
+  for (int i = 0; i < iovcnt; i++) {
+    size += iov[i].iov_len;
+  }
+
+  return size;
+}
+
+
 } // namespace LOFAR
diff --git a/LCS/Stream/src/SharedMemoryStream.cc b/LCS/Stream/src/SharedMemoryStream.cc
index e589c61da9a5aa59074d17b6c3d3cd53dfa93cc6..921efd1d450815fefa3e7b9bb59f5f2adabf6fef 100644
--- a/LCS/Stream/src/SharedMemoryStream.cc
+++ b/LCS/Stream/src/SharedMemoryStream.cc
@@ -1,6 +1,6 @@
 //# SharedMemoryStream.cc: 
 //#
-//# Copyright (C) 2012
+//# Copyright (C) 2012, 2017
 //# ASTRON (Netherlands Institute for Radio Astronomy)
 //# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
 //#
@@ -61,6 +61,18 @@ size_t SharedMemoryStream::tryWrite(const void *ptr, size_t size)
   return readSize;
 }
 
+
+size_t SharedMemoryStream::tryReadv(const struct iovec * /*iov*/, int /*iovcnt*/)
+{
+  THROW(NotImplemented, "SharedMemoryStream::tryReadv()");
+}
+
+
+size_t SharedMemoryStream::tryWritev(const struct iovec * /*iov*/, int /*iovcnt*/)
+{
+  THROW(NotImplemented, "SharedMemoryStream::tryWritev()");
+}
+
 } // namespace LOFAR
 
 #endif
diff --git a/LCS/Stream/src/SocketStream.cc b/LCS/Stream/src/SocketStream.cc
index 8afb6968e398f398d56683ec353852994aa90ec6..c37d12baf703b9b34bb59a3d2321ac6326b609b4 100644
--- a/LCS/Stream/src/SocketStream.cc
+++ b/LCS/Stream/src/SocketStream.cc
@@ -1,6 +1,6 @@
 //# SocketStream.cc: 
 //#
-//# Copyright (C) 2008, 2015
+//# Copyright (C) 2008, 2015-2017
 //# ASTRON (Netherlands Institute for Radio Astronomy)
 //# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
 //#
@@ -29,6 +29,7 @@
 #include <cstdio>
 #include <ctime>
 #include <cerrno>
+#include <cassert>
 #include <sys/types.h>
 #include <unistd.h>
 #include <sys/select.h>
@@ -282,8 +283,8 @@ void SocketStream::setTimeout(double timeout)
 
 
 #if defined __linux__ && __GLIBC_PREREQ(2,12)
-// Actually, recvmmsg is supported by Linux 2.6.32+ using glibc 2.12+
-#define HAVE_RECVMMSG
+// Actually, sendmmsg and recvmmsg are supported by Linux 2.6.32+ using glibc 2.12+
+#define HAVE_MMSG
 #else
 // Equalize data structures to share more code. Declared within LOFAR namespace.
 // Need it as vector template arg, so cannot be locally declared (ok w/ C++11).
@@ -292,17 +293,71 @@ struct mmsghdr {
 };
 #endif
 
-unsigned SocketStream::recvmmsg( void *bufBase, unsigned maxMsgSize,
+unsigned SocketStream::sendmmsg( void *bufBase, size_t msgSize, size_t msgBufSize,
+                                 std::vector<unsigned> &sentMsgSizes, int flags ) const
+{
+  ASSERT(protocol == UDP);
+  ASSERT(mode == Client);
+
+  // If sendmmsg() is not available, then use sendmsg() (1 call) as fall-back.
+#ifdef HAVE_MMSG
+  const unsigned numBufs = sentMsgSizes.size();
+#else
+  const unsigned numBufs = 1;
+  if (sentMsgSizes.empty()) {
+    return 0;
+  }
+#endif
+
+  // register our send buffer(s)
+  std::vector<struct iovec> iov(numBufs);
+  for (unsigned i = 0; i < numBufs; i++) {
+    iov[i].iov_base = (char*)bufBase + i * msgBufSize;
+    iov[i].iov_len  = msgSize;
+  }
+
+  std::vector<struct mmsghdr> msgs(numBufs);
+  for (unsigned i = 0; i < numBufs; ++i) {
+    msgs[i].msg_hdr.msg_name    = NULL; // dst address already set on socket via connect(2)
+    msgs[i].msg_hdr.msg_iov     = &iov[i];
+    msgs[i].msg_hdr.msg_iovlen  = 1;
+    msgs[i].msg_hdr.msg_control = NULL; // we're not interested in sending OoB data
+  }
+
+  int numSent;
+#ifdef HAVE_MMSG
+  numSent = ::sendmmsg(fd, &msgs[0], numBufs, flags);
+  if (numSent < 0)
+    THROW_SYSCALL("sendmmsg");
+
+  for (int i = 0; i < numSent; ++i) {
+    sentMsgSizes[i] = msgs[i].msg_len; // num bytes sent is stored in msg_len by sendmmsg()
+  }
+#else
+  numSent = ::sendmsg(fd, &msgs[0].msg_hdr, flags);
+  if (numSent < 0)
+    THROW_SYSCALL("sendmsg");
+
+  sentMsgSizes[0] = static_cast<unsigned>(numSent); // num bytes sent is returned by sendmsg()
+  numSent = 1; // equalize return val semantics to num msgs sent
+#endif
+  return static_cast<unsigned>(numSent);
+}
+
+unsigned SocketStream::recvmmsg( void *bufBase, size_t maxMsgSize,
                                  std::vector<unsigned> &recvdMsgSizes ) const
 {
   ASSERT(protocol == UDP);
   ASSERT(mode == Server);
 
   // If recvmmsg() is not available, then use recvmsg() (1 call) as fall-back.
-#ifdef HAVE_RECVMMSG
+#ifdef HAVE_MMSG
   const unsigned numBufs = recvdMsgSizes.size();
 #else
   const unsigned numBufs = 1;
+  if (recvdMsgSizes.empty()) {
+    return 0;
+  }
 #endif
 
   // register our receive buffer(s)
@@ -321,7 +376,7 @@ unsigned SocketStream::recvmmsg( void *bufBase, unsigned maxMsgSize,
   }
 
   int numRead;
-#ifdef HAVE_RECVMMSG
+#ifdef HAVE_MMSG
   // Note: the timeout parameter doesn't work as expected: only between datagrams
   // is the timeout checked, not when waiting for one (i.e. numBufs=1 or MSG_WAITFORONE).
   numRead = ::recvmmsg(fd, &msgs[0], numBufs, 0, NULL);
diff --git a/LCS/Stream/src/StringStream.cc b/LCS/Stream/src/StringStream.cc
index d629d6346878cea4fb02da93c409ca65db1357c5..709df466757c137b77ca60d57db71fc7686563de 100644
--- a/LCS/Stream/src/StringStream.cc
+++ b/LCS/Stream/src/StringStream.cc
@@ -1,6 +1,6 @@
 //# StringStream.cc: 
 //#
-//# Copyright (C) 2008
+//# Copyright (C) 2008, 2017
 //# ASTRON (Netherlands Institute for Radio Astronomy)
 //# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
 //#
@@ -40,9 +40,21 @@ size_t StringStream::tryRead(void *ptr, size_t size)
 {
   Cancellation::point(); // keep behaviour consistent with real I/O streams
 
+// NOTE: still wrong for !USE_THREADS and wrt less than size bytes avail and stringstream error vs EndOfStreamException, but !USE_THREADS is obsolete anyway. Need CondVar instead of Semaphore and drop !USE_THREADS.
 #ifdef USE_THREADS
-  if (!dataWritten.down(size))
-    THROW(EndOfStreamException, "Stream has been closed");
+  if (!dataWritten.down(size)) {
+    ScopedLock sl(itsMutex);
+    size_t avail = dataWritten.getValue();
+    if (avail == 0) // size > 0
+      THROW(EndOfStreamException, "Stream has been closed");
+
+    size = avail;
+    dataWritten.down(size);
+
+    itsBuffer.read(static_cast<char*>(ptr), size);
+
+    return size;
+  }
 #endif
 
   {
@@ -71,6 +83,71 @@ size_t StringStream::tryWrite(const void *ptr, size_t size)
 }
 
 
+size_t StringStream::tryReadv(const struct iovec *iov, int iovcnt)
+{
+  Cancellation::point(); // keep behaviour consistent with non-null streams
+
+  size_t size = 0;
+
+  for (int i = 0; i < iovcnt; i++) {
+    size += iov[i].iov_len;
+  }
+
+// NOTE: still wrong for !USE_THREADS and wrt less than size bytes avail and stringstream error vs EndOfStreamException, but !USE_THREADS is obsolete anyway. Need CondVar instead of Semaphore and drop !USE_THREADS.
+#ifdef USE_THREADS
+  if (!dataWritten.down(size)) {
+    ScopedLock sl(itsMutex);
+    // stream closed and avail < size
+    size_t avail = dataWritten.getValue();
+    if (avail == 0) // size > 0
+      THROW(EndOfStreamException, "Stream has been closed");
+
+    size = avail;
+    dataWritten.down(size);
+
+    for (int i = 0; i < iovcnt && avail > 0; i++) {
+      size_t len = avail < iov[i].iov_len ? avail : iov[i].iov_len;
+      itsBuffer.read(static_cast<char*>(iov[i].iov_base), len);
+      avail -= len;
+    }
+
+    return size;
+  }
+#endif
+
+  {
+    ScopedLock sl(itsMutex);
+    for (int i = 0; i < iovcnt; i++) {
+      itsBuffer.read(static_cast<char*>(iov[i].iov_base), iov[i].iov_len);
+    }
+  }
+
+  return size;
+}
+
+
+size_t StringStream::tryWritev(const struct iovec *iov, int iovcnt)
+{
+  Cancellation::point(); // keep behaviour consistent with non-null streams
+
+  size_t size = 0;
+
+  {
+    ScopedLock sl(itsMutex);
+    for (int i = 0; i < iovcnt; i++) {
+      itsBuffer.write(static_cast<const char*>(iov[i].iov_base), iov[i].iov_len);
+      size += iov[i].iov_len;
+    }
+  }
+
+#ifdef USE_THREADS
+  dataWritten.up(size);
+#endif
+
+  return size;
+}
+
+
 void StringStream::close()
 {
 #ifdef USE_THREADS
diff --git a/LCS/Stream/test/tSocketStream.cc b/LCS/Stream/test/tSocketStream.cc
index ed0e689be8ef06aebca0645db29405cb768a21b0..976caa6eece0b7043cb02ff7c4d584b6959840e4 100644
--- a/LCS/Stream/test/tSocketStream.cc
+++ b/LCS/Stream/test/tSocketStream.cc
@@ -52,7 +52,7 @@ public:
       ss.reaccept();
   }
 
-  int getPort() const { return ss.getPort(); }
+  uint16 getPort() const { return ss.getPort(); }
 
 private:
   SocketStream::Protocol protocol;
diff --git a/LCU/PPSTune/CMakeLists.txt b/LCU/PPSTune/CMakeLists.txt
index e70eac3a4392d43a2c914667d75ff52bdc246b86..0337b6dccebed187584b034908b3db8d5f158464 100644
--- a/LCU/PPSTune/CMakeLists.txt
+++ b/LCU/PPSTune/CMakeLists.txt
@@ -5,9 +5,12 @@ lofar_package(PPSTune 1.0)
 add_subdirectory(ppstune)
 
 # Install files matching regex pattern in current directory and below
+# Omit directories test and testdata from install
+
 install(DIRECTORY . 
   DESTINATION sbin
   USE_SOURCE_PERMISSIONS
   FILES_MATCHING REGEX "\\.(py|sh)$"
-  PATTERN ".svn" EXCLUDE)
+  PATTERN ".svn" EXCLUDE
+  PATTERN "test*" EXCLUDE)
 
diff --git a/LTA/LTAIngest/LTAIngestClient/lib/ingestbuslistener.py b/LTA/LTAIngest/LTAIngestClient/lib/ingestbuslistener.py
index a5244e59071d08451656168ca89a0d2305ed8af4..706c025c762c7b0d2096367920b6ded4105b99fa 100644
--- a/LTA/LTAIngest/LTAIngestClient/lib/ingestbuslistener.py
+++ b/LTA/LTAIngest/LTAIngestClient/lib/ingestbuslistener.py
@@ -114,14 +114,19 @@ class IngestBusListener(AbstractBusListener):
         :param task_dict: dictionary with the finished task'''
         pass
 
-
     def _logJobNotification(self, status, job_dict, level=logging.INFO):
-        msg = 'job %s: %s export_id: %s type: %s server: %s'% (status,
-                                                               job_dict.get('project'),
-                                                               job_dict.get('export_id'),
-                                                               job_dict.get('type'),
-                                                               job_dict.get('ingest_server'))
         try:
+            msg = 'job '
+
+            if status == 'progress':
+                msg += 'is transferring. '
+            else:
+                msg += 'status changed to %s. ' % (status,)
+
+            msg += 'project: %s export_id: %s type: %s server: %s'% (job_dict.get('project'),
+                                                                     job_dict.get('export_id'),
+                                                                     job_dict.get('type'),
+                                                                     job_dict.get('ingest_server'))
             if job_dict.get('archive_id'):
                 msg += ' archive_id: %s' % job_dict.get('archive_id')
 
@@ -142,11 +147,11 @@ class IngestBusListener(AbstractBusListener):
 
             if job_dict.get('message'):
                 msg += ' message: %s' % job_dict.get('message')
+
+            logger.log(level, msg)
         except Exception as e:
             logger.error(e)
 
-        logger.log(level, msg)
-
 
 class JobsMonitor(IngestBusListener):
     def __init__(self, busname=DEFAULT_INGEST_NOTIFICATION_BUSNAME, subjects=DEFAULT_INGEST_NOTIFICATION_SUBJECTS, broker=DEFAULT_BROKER, listen_for_all_jobs=True, **kwargs):
diff --git a/LTA/LTAIngest/LTAIngestServer/LTAIngestAdminServer/lib/ingestjobmanagementserver.py b/LTA/LTAIngest/LTAIngestServer/LTAIngestAdminServer/lib/ingestjobmanagementserver.py
index 1e1e831971da8f9df34dd096d064674da6811257..21882c173043e9dc0b4dfce6252bde515fa038e1 100644
--- a/LTA/LTAIngest/LTAIngestServer/LTAIngestAdminServer/lib/ingestjobmanagementserver.py
+++ b/LTA/LTAIngest/LTAIngestServer/LTAIngestAdminServer/lib/ingestjobmanagementserver.py
@@ -31,6 +31,9 @@ from lofar.messaging import CommandMessage, EventMessage, FromBus, ToBus
 from lofar.messaging import Service
 from lofar.messaging.Service import MessageHandlerInterface
 from lofar.common.util import convertIntKeysToString
+from lofar.mom.momqueryservice.momqueryrpc import MoMQueryRPC
+from lofar.mom.momqueryservice.config import DEFAULT_MOMQUERY_BUSNAME, DEFAULT_MOMQUERY_SERVICENAME
+from lofar.common import isProductionEnvironment
 
 import os
 import os.path
@@ -65,7 +68,10 @@ class IngestJobManager:
                  jobs_for_transfer_queue_name=DEFAULT_INGEST_JOBS_FOR_TRANSER_QUEUENAME,
                  jobs_dir=JOBS_DIR,
                  max_num_retries=MAX_NR_OF_RETRIES,
+                 mom_busname=DEFAULT_MOMQUERY_BUSNAME,
+                 mom_servicename=DEFAULT_MOMQUERY_SERVICENAME,
                  broker=None,
+                 mom_broker=None,
                  **kwargs):
 
         self.__notification_listener = IngestBusListener(busname=notification_listen_queue_name, subjects=notification_prefix+'*', broker=broker)
@@ -83,6 +89,9 @@ class IngestJobManager:
         self.notification_prefix = notification_prefix
         self.event_bus           = ToBus(notification_busname, broker=broker)
 
+        if not mom_broker:
+            mom_broker = broker
+        self.__momrpc = MoMQueryRPC(servicename=mom_servicename, busname=mom_busname, broker=mom_broker, timeout=180)
 
         self.service = Service(servicename,
                                IngestServiceMessageHandler,
@@ -1004,6 +1013,23 @@ Total Files: %(total)i
         submitters = [j['Submitter'] for j in done_group_jobs if 'Submitter' in j]
         extra_mail_addresses = [j['email'] for j in done_group_jobs if 'email' in j]
 
+        try:
+            if len(unfinished_group_jads) == 0:
+                # only for successful ingests,
+                # try to get the PI's email address for this export's projects
+                # and add these to the extra_mail_addresses
+                done_group_mom_jobs = [job for job in done_group_jobs if job.get('type','').lower() == 'mom']
+                mom_export_ids = set([job['JobId'].split('_')[1] for job in done_group_mom_jobs if 'JobId' in job])
+                project_mom2ids = set([self.__momrpc.getObjectDetails(mom_export_id).get('project_mom2id') for mom_export_id in mom_export_ids])
+                project_mom2ids = [x for x in project_mom2ids if x is not None]
+
+                for project_mom2id in project_mom2ids:
+                    project_details = self.__momrpc.get_project_details(project_mom2id)
+                    if project_details and 'pi_email' in project_details:
+                        extra_mail_addresses.append(project_details['pi_email'])
+        except Exception as e:
+            logger.error('error while trying to get PI\'s email address for %s: %s', job_group_id, e)
+
         #submitters might contain comma seperated strings
         #join all sumbitterstrings in one long csv string, split it, and get the unique submitters
         submitters = list(set([s.strip() for s in  ','.join(submitters).split(',') if '@' in s]))
@@ -1081,6 +1107,15 @@ def main():
                       type='string',
                       default=DEFAULT_INGEST_JOBS_FOR_TRANSER_QUEUENAME,
                       help='name of the managed job queue (which jobs are handled by the ingestservices), default: %default')
+    parser.add_option('--mom_query_busname', dest='mom_query_busname', type='string',
+                      default=DEFAULT_MOMQUERY_BUSNAME,
+                      help='Name of the bus exchange on the qpid broker on which the momqueryservice listens, default: %default')
+    parser.add_option('--mom_query_servicename', dest='mom_query_servicename', type='string',
+                      default=DEFAULT_MOMQUERY_SERVICENAME,
+                      help='Name of the momqueryservice, default: %default')
+    parser.add_option('--mom_query_service_broker', dest='mom_query_service_broker', type='string',
+                      default='scu001.control.lofar' if isProductionEnvironment() else 'scu199.control.lofar',
+                      help='Address of the qpid broker where the mom query service runs, default: %default')
     (options, args) = parser.parse_args()
 
     setQpidLogLevel(logging.INFO)
@@ -1100,7 +1135,10 @@ def main():
                                jobs_for_transfer_queue_name=options.jobs_for_transfer_queue_name,
                                jobs_dir=options.jobs_dir,
                                max_num_retries=options.max_num_retries,
-                               broker=options.broker)
+                               mom_busname=options.mom_query_busname,
+                               mom_servicename=options.mom_query_servicename,
+                               broker=options.broker,
+                               mom_broker=options.mom_query_service_broker)
     manager.run()
 
 if __name__ == '__main__':
diff --git a/MAC/APL/APLCommon/src/CMakeLists.txt b/MAC/APL/APLCommon/src/CMakeLists.txt
index cc0e8beef5b7440908e97778937e900db791ba15..c8e5c6f7885965835830c161b6f6b9111b023556 100644
--- a/MAC/APL/APLCommon/src/CMakeLists.txt
+++ b/MAC/APL/APLCommon/src/CMakeLists.txt
@@ -27,6 +27,7 @@ lofar_add_bin_program(versionaplcommon versionaplcommon.cc)
 
 lofar_add_bin_scripts(
   swlevel
+  warp
   run_timeout.sh)
 
 install(FILES
diff --git a/MAC/APL/APLCommon/src/swlevel b/MAC/APL/APLCommon/src/swlevel
index 1770d82c84eecd857ddf917f5fff61066123b5b1..10d5baca665750fc0d961f5cd2ed4531e555bc61 100755
--- a/MAC/APL/APLCommon/src/swlevel
+++ b/MAC/APL/APLCommon/src/swlevel
@@ -35,6 +35,12 @@ SBINDIR=$LOFARROOT/sbin
 LOGDIR=$LOFARROOT/var/log
 ETCDIR=$LOFARROOT/etc
 LEVELTABLE=${ETCDIR}/swlevel.conf
+# pidof is in /usr/sbin, usually; this is not added to PATH for non-interactive logins 
+# (in /etc/profile) so explicitly find location of executable pidof now.
+PIDOF=`whereis -b pidof | awk '{print $2}'`
+
+# Counter to indicate if 48V reset has been attempted
+has_been_reset=0
 
 # Make sure all files are user/group/other writeable (needed for Int.
 # Stations)
@@ -72,9 +78,24 @@ SyntaxError()
 	exit 0
 }
 
-# Method to run a command with a specified timeout in seconds
-# First argument is timeout, next arguments are the command and its parameters
-
+#
+# Reset the 48V power supply; this will reset all RSP boards. Only try this two times.
+# If still failing then, human intervention is required.
+#
+doReset()
+{
+if [ $has_been_reset -le  1 ]; then
+  echo "Could not load or check RSP images; Resetting RSP boards"
+  goto_level 1
+  ${SBINDIR}/reset_48v.py
+  sleep 5
+  let has_been_reset=$has_been_reset+1
+  goto_level 2
+else 
+   echo "Giving up after two resets"
+   kill $$ 0
+fi
+}
 
 # Find which image to load on a given station; uses file
 # ${ETCDIR}/RSPImage.conf
@@ -130,7 +151,7 @@ selectImage()
 		#   boardHex="1F"
                 #fi
                 ethport=`grep RSPDriver.IF_NAME /opt/lofar/etc/RSPDriver.conf | awk -F= '{print $2}'`
-		rsu=`run_timeout.sh 5 sudo ${SBINDIR}/rsuctl3 -i ${ethport} -m 10:fa:00:00:$boardHex:00 -qV 2>&1 | grep BP | cut -d':' -f2 | sed 's/ //g' | cut -d'.' -f1`
+		rsu=`timeout 5 sudo ${SBINDIR}/rsuctl3 -i ${ethport} -m 10:fa:00:00:$boardHex:00 -qV 2>&1 | grep BP | cut -d':' -f2 | sed 's/ //g' | cut -d'.' -f1`
 
 		# If not a single number, something weird  must have happened
 		if [ ${#rsu} -ne 1 ]; then 
@@ -139,7 +160,7 @@ selectImage()
 		  errorBoards=${errorBoards}${boardHex}","
                 else
   		  echo "Loading image $image on RSPboard $boardHex ..."
-		  run_timeout.sh 5 sudo ${SBINDIR}/rsuctl3_reset -i ${ethport} -m 10:fa:00:00:$boardHex:00 -q -x -p $image 1>/dev/null 2>&1
+		  timeout 5 sudo ${SBINDIR}/rsuctl3_reset -i ${ethport} -m 10:fa:00:00:$boardHex:00 -q -x -p $image 1>/dev/null 2>&1
                   if [ $? -ne 0 ]; then 
 		      boardError=1
                       errorBoards=${errorBoards}${boardHex}","
@@ -150,10 +171,13 @@ selectImage()
 	done
 
 	if [ $boardError -eq 1 ]; then
-		echo "Board(s) $errorBoards have a communication problem; try reset the 48V"
+	   echo "Board(s) $errorBoards have a communication problem"
+	   doReset
 	fi
 }
 
+
+
 #
 # Check if RSP images and TBB images are properly loaded, and start TBB
 # recording if they are
@@ -164,52 +188,60 @@ if [ -e $BINDIR/rspctl ]; then
 	# First make sure RSP images are properly loaded
 	# Introduce a timeout of 60 sec for images to initialize
 	echo "Waiting for RSP and TBB images to be initialized"
-	timeout=60
+        sleep 10
+	timeout=10
 	for (( s=0 ; s<timeout; s++ ))
 	do
-		rsu_ready=`( rspctl --version | grep "0.0" ) >& /dev/null; echo $?`
-		if [ $rsu_ready == 1 ]; then
+		rsp_ready_1=`( timeout 2 rspctl --version | grep "0.0" ) >& /dev/null; echo $?`
+                rsp_ready_2=`( timeout 2 rspctl --status | grep "PCB" ) >& /dev/null; echo $?`
+
+		if [ $rsp_ready_1 == 1 -a $rsp_ready_2 == 1 ]; then
+			echo "RSPDriver died; quitting now"
+			s=$timeout
+			break
+		fi
+		if [ $rsp_ready_1 == 1 -a $rsp_ready_2 == 0 ]; then
 			echo "RSP Images are loaded"
 			break
 		fi
-		sleep 1
+		sleep 5
 	done
-	if [ $s == $timeout ]; then
-		echo "Could not load RSP images in time; Reset RSP boards"
-		exit 1
+	if [ $s == $timeout ]; then 
+	    doReset
 	fi
 fi
 
 if [ -e $BINDIR/tbbctl ]; then
-	# Now make sure TBB images are properly loaded
-	# Introduce a timeout of 60 sec for images to initialize
-	echo "Waiting for TBB images to be initialized"
-	timeout=60
-	sleep 10
-	for (( s=0 ; s<timeout; s++ ))
-	do
-		tbb_respons=`tbbctl --version`
-        tbb_ready=`( echo $tbb_respons | grep "\ V\ " ) >& /dev/null; echo $?`
-		if [ $tbb_ready -eq 0 ]; then
-            sleep 10 # additional delay to let TBB boards end their init phase
-            echo "TBB Images are loaded"
-            break
-        fi
-        tbb_down=`( echo $tbb_respons | grep "TBBDriver is NOT responding" )>& /dev/null; echo $?`
-        if [ $tbb_down -eq 0 ]; then
+      # Now make sure TBB images are properly loaded
+      # Introduce a timeout of 60 sec for images to initialize
+      echo "Waiting for TBB images to be initialized"
+      timeout=60
+      sleep 10
+      for (( s=0 ; s<timeout; s++ ))
+      do
+	  tbb_respons=`timeout 2 tbbctl --version`
+          tbb_ready=`( echo $tbb_respons | grep "\ V\ " ) >& /dev/null; echo $?`
+	  if [ $tbb_ready -eq 0 ]; then
+               sleep 10 # additional delay to let TBB boards end their init phase
+               echo "TBB Images are loaded"
+               break
+          fi
+          tbb_down=`( echo $tbb_respons | grep "TBBDriver is NOT responding" )>& /dev/null; echo $?`
+          if [ $tbb_down -eq 0 ]; then
             echo "TBBDriver is not responding; cannot continue start of TBBs"
             # Trigger message furtheron in the code
             s=$timeout
             break
-        fi
-        sleep 1
+          fi
+          sleep 1
     done
     if [ $s == $timeout ]; then
-		 echo "Could not load TBB images; Reset TBB boards"
+        echo "Could not load TBB images; Reset TBB boards"
+        goto_level 1
     else
         # Start TBB recording mode
         if [ -e $SBINDIR/startTBB.sh ]; then
-            $SBINDIR/startTBB.sh
+            timeout 5 $SBINDIR/startTBB.sh
         fi
     fi
 fi
@@ -238,30 +270,19 @@ start_prog()
 	fi
 
 	# Check if program is already running
-        /sbin/pidof -x ${prog} 1>/dev/null 2>&1
+        $PIDOF -x ${prog} 1>/dev/null 2>&1
 	if [ $? -ne 0 ]; then
 		curdate=`date +%Y%m%dT%H%M%S`
-		# PVSS needs special treatment
-		if [ "$prog" = "PVSS00pmon" -o "$prog" = "WCCILpmon" ]; then 
+		# WinCC needs special treatment
+		if [ "$prog" = "WCCILpmon" ]; then 
     		   echo Starting $prog
 		   start_pvss2 1>/dev/null 2>&1 &
 		   sleep 3
-		elif [ "$prog" = "SASGateway" ]; then  
-		    # Foreign stations not under central control should not
-		    # connect to the SAS database; this prevents SAS main-
-		    # tenance etc.
-		    if [ "$user" = "lofarsys" ]; then
-			echo Starting $prog
-			rm -f $LOGDIR/$prog.log*.? 1>/dev/null 2>&1
-			$BINDIR/$prog 1>>${LOGDIR}/${prog}.stdout.${curdate} 2>&1 &
-                    else
-                        echo "Local use, not starting $prog"
-                    fi		    
   		else
 		    if [ -n "$asroot" ]; then
-		       	echo Starting $prog
 		       	sudo rm -f $LOGDIR/$prog.log.? 1>/dev/null 2>&1
 		       	if [ "$prog" = "RSPDriver" ]; then
+			   echo "Loading firmware on the RSP boards"
 			   selectImage
 			   if [ $boardError -eq 1 ]; then
 	 			exit
@@ -269,30 +290,25 @@ start_prog()
 		       	fi
                         if [ "$prog" = "TBBDriver" ]; then 
 			   # Check if RSPDriver is already running; if not, do not start either!
-			   /sbin/pidof RSPDriver 1>/dev/null 2>&1
+			   $PIDOF RSPDriver 1>/dev/null 2>&1
 			   if [ $? -ne 0 ]; then
 				echo "RSPDriver not running, so not starting TBBDriver either"
 				exit
 			   fi
                         fi
-			archtype=`uname -m`
-			if [ "$archtype" == "x86_64" ]; then 
-  		       	  sudo -b LD_LIBRARY_PATH=/opt/lofar/lib64:/opt/lofar/lib/:$LD_LIBRARY_PATH LOFARROOT=/opt/lofar $BINDIR/$prog 1>>$LOGDIR/$prog.stdout.${curdate} 
-2>&1
-                        else
-                          sudo -b $BINDIR/$prog 1>>$LOGDIR/$prog.stdout.${curdate} 2>&1
-                        fi
-                       if [ "$prog" = "TBBDriver" ]; then 
+			# Now start prog (RSPDriver or TBBDriver)
+		       	echo Starting $prog
+  		       	sudo -b LD_LIBRARY_PATH=/opt/lofar/lib64:/opt/lofar/lib/:$LD_LIBRARY_PATH LOFARROOT=/opt/lofar $BINDIR/$prog 1>>$LOGDIR/$prog.stdout.${curdate} 2>&1
+                        if [ "$prog" = "TBBDriver" ]; then 
                            check_images
-		       fi
+		        fi
 		    else
-
 			echo Starting $prog
 			rm -f $LOGDIR/$prog.log*.? 1>/dev/null 2>&1
 			$BINDIR/$prog 1>>$LOGDIR/$prog.stdout.${curdate} 2>&1 &
 		    fi
 		fi
-		usleep 250000
+		sleep 0.25
 		ps -ef | grep -v grep | egrep '[0-9][0-9] [a-zA-Z0-9/_.]*/'${prog}
 	fi
 }
@@ -321,88 +337,82 @@ stop_prog()
 	fi
 
 	# get processlist
-	/sbin/pidof -x ${prog} 1>/dev/null 2>&1
+	$PIDOF -x ${prog} 1>/dev/null 2>&1
 	if [ $? -ne 0 ]; then
 		return
 	fi
 
-    # if RSPDriver disable external clock first (use 125MHz board clock)
-    if [ "$prog" = "RSPDriver" ]; then
-        echo "disable clock output on clock board"
-        rspctl --clock=0 1>/dev/null 2>&1
-        # wait while setting is done
-        sleep 15
-    fi
+        # if RSPDriver disable external clock first (use 125MHz board clock)
+        if [ "$prog" = "RSPDriver" ]; then
+          echo "disable clock output on clock board"
+          timeout 5 rspctl --clock=0 1>/dev/null 2>&1
+          # wait while setting is done
+          sleep 15
+        fi
 
-	# PVSS needs special treatment
-	if [ "$prog" = "PVSS00pmon" -o "$prog" = "WCCILpmon" ]; then
-		echo "Stopping PVSS database"
+	# WinCC needs special treatment
+	if [ "$prog" = "WCCILpmon" ]; then
+		echo "Stopping WinCC"
 		start_pvss2 -stopWait
 		return
 	fi
 
-	# first handle mpi programs
-	if [ ! -z "$withmpi" ]; then
-		$asroot cexec :0-11 killall -9 ${prog}
-		return
-	fi
-
 	# first try normal kill
-	for pid in `/sbin/pidof -x ${prog}`
+	for pid in `$PIDOF -x ${prog}`
 	do
 		echo "Softly killing ${prog}(${pid})"
 		$asroot kill $pid 1>/dev/null 2>&1
-		usleep 500000
+		sleep 0.25
 	done
 
 	# when normal kill did not work, kill is with -9
-	for pid in `/sbin/pidof -x ${prog}`
+	for pid in `$PIDOF -x ${prog}`
 	do
 		echo "Hard killing ${prog}(${pid})"
 		$asroot kill -9 $pid 1>/dev/null 2>&1
-		usleep 500000
+		sleep 0.25
 	done
 	# if user0 or lofarsys, try normal kill as root
 
-	for pid in `/sbin/pidof -x ${prog}`
+	for pid in `$PIDOF -x ${prog}`
 	do
-        if [ "$user" == "user0" -o "$user" == "lofarsys" ]; then
-			sudo kill $pid 1>/dev/null 2>&1
-			usleep 50000
-		fi
+          if [ "$user" == "user0" -o "$user" == "lofarsys" ]; then
+	    sudo kill $pid 1>/dev/null 2>&1
+	    sleep 0.25
+	  fi
 	done
 
 	# if user0 or lofarsys, try hard kill as root
-	for pid in `/sbin/pidof -x ${prog}`
+	for pid in `$PIDOF -x ${prog}`
 	do
-		if [ "$user" == "user0" -o "$user" == "lofarsys" ]; then
+	  if [ "$user" == "user0" -o "$user" == "lofarsys" ]; then
             sudo kill -9 $pid 1>/dev/null 2>&1
-            usleep 50000
-        fi
+            sleep 0.25
+          fi
 	done
 
 	# if still alive, write a message
-	for pid in `/sbin/pidof -x ${prog}`
+	for pid in `$PIDOF -x ${prog}`
 	do
-		echo -n "Could not kill ${prog}(${pid}); "
-		if [ "$user" == "user0" -o "$user" == "lofarsys" ]; then
-			echo "tried it as root as well, giving up..."
-		else
-			echo "probably run by another user, contact your system administrator"
-		fi
+	  echo -n "Could not kill ${prog}(${pid}); "
+	  if [ "$user" == "user0" -o "$user" == "lofarsys" ]; then
+	     echo "tried it as root as well, giving up..."
+	  else
+	     echo "probably run by another user, contact your system administrator"
+	  fi
 	done
 
-    # if RSPDriver set rsp firmware to image 0 (factory image)
-    if [ "$prog" = "RSPDriver" ]; then
-        image=0
-        imageForced=1
-        selectImage
-        if [ $boardError -eq 1 ]; then
+        # if RSPDriver set rsp firmware to image 0 (factory image)
+        if [ "$prog" = "RSPDriver" ]; then
+          image=0
+          imageForced=1
+          selectImage
+          if [ $boardError -eq 1 ]; then
             exit
+          fi
+          echo "RSP image set to image 0, wait.."
+          sleep 12
         fi
-        echo "RSP image set to image 0, wait.."
-        sleep 12
-    fi
 }
 
 #
@@ -442,9 +452,9 @@ status_prog()
 		# find out the processID of the possibly (running) process
 		obsid=()
 		pid_user=()
-		/sbin/pidof -x ${prog} 1>/dev/null 2>&1
+		$PIDOF -x ${prog} 1>/dev/null 2>&1
 		if [ $? -eq 0 ]; then
-			pid=( `/sbin/pidof -x ${prog}` )
+			pid=( `$PIDOF -x ${prog}` )
 			i=0
 			for apid in ${pid[@]}
 			do
@@ -472,38 +482,36 @@ status_prog()
 		# Some Checks
 		# Controllers must have one instance, only. Some programs may have more instances.
 		if [ ${#pid[@]} -ge 2 ]; then
-			if [ "$prog" != "ObservationControl" \
-            -a "$prog" != "PythonControl" \
-            -a "$prog" != "OnlineControl" ]; then
-                toomany="$toomany ${prog}[$levelnr]"
-            fi
+		  if [ "$prog" != "ObservationControl" -a "$prog" != "OnlineControl" ]; then
+                     toomany="$toomany ${prog}[$levelnr]"
+                  fi
 		fi
 
 		# Check for missing controllers
 		if [ "$pid" = "DOWN" -o "$pid" = "0" ]; then
-			if [ $levelnr -le $level ]; then
-                if [ $levelnr -le 5 ]; then
-                    missing="$missing ${prog}[$levelnr]"
-				else
-                    # LCU level 6 has two permanent controllers running
-                    if [ "$prog" == "StationControl" \
-                    -o "$prog" == "ClockControl" ]; then
+		  if [ $levelnr -le $level ]; then
+                    if [ $levelnr -le 5 ]; then
+                      missing="$missing ${prog}[$levelnr]"
+		    else
+                      # LCU level 6 has two permanent controllers running
+                      if [ "$prog" == "StationControl" \
+                           -o "$prog" == "ClockControl" ]; then
                         missing="$missing ${prog}[$levelnr]"
-                    fi
-                    # MCU level 6 must have MACScheduler running
-                    if [ "$prog" == "MACScheduler" ]; then
+                      fi
+                      # MCU level 6 must have MACScheduler running
+                      if [ "$prog" == "MACScheduler" ]; then
                         missing="$missing ${prog}[$levelnr]"
-                    fi
-				fi
-			fi
+                      fi
+		    fi
+		  fi
 		fi
 	done
 	echo "---"
 	if [ "$missing" ]; then
-		echo "Missing :"$missing
+	  echo "Missing :"$missing
 	fi
 	if [ "$toomany" ]; then
-		echo "Too many:"$toomany
+	  echo "Too many:"$toomany
 	fi
 }
 
@@ -512,8 +520,8 @@ status_prog()
 #
 goto_level()
 {
-	#first power down to new level
-	newlevel=$1
+    #first power down to new level
+    newlevel=$1
     if [ -e /tmp/level.admin ]; then
         curlevel=`cat /tmp/level.admin`
     else
@@ -522,16 +530,17 @@ goto_level()
 	# set rcumode to 0 (power save) when entering level 1
 	if [ ${newlevel} -le 1 ]; then
 		if [ ${curlevel} -ge 2 ]; then
-			/sbin/pidof RSPDriver 1>/dev/null 2>&1
+			$PIDOF RSPDriver 1>/dev/null 2>&1
 			if [ $? -eq 0 ]; then
-				status=`( rspctl --version | grep "0.0" ) >& /dev/null; echo $?`
-				if [ $status == 1 ]; then
+				status_1=`( timeout 2 rspctl --version | grep "0.0" ) >& /dev/null; echo $?`
+                                status_2=`( timeout 2 rspctl --status | grep "PCB" ) >& /dev/null; echo $?`
+				if [ $status_1 == 1 -a $status_2 == 0 ]; then
 			 		echo "set rcumode to 0 (power save)"
-		rspctl --rcumode=0 1>/dev/null 2>&1
-		# Wait for setting to take effect before killing RSPDriver
-		sleep 2
+		                        timeout 5 rspctl --rcumode=0 1>/dev/null 2>&1
+		                        # Wait for setting to take effect before killing RSPDriver
+		                        sleep 2
 				else
-		echo "Beware: NOT going to rcumode 0 as images are still being initialized"
+		                        echo "Beware: NOT going to rcumode 0 as images are still being initialized"
 				fi
 			fi
 			if [ -e $SBINDIR/stopTBB.sh ]; then
@@ -543,11 +552,11 @@ goto_level()
 
 	for (( l=6 ; l > newlevel ; l-- ))
 	do
-		if [ $curlevel -gt $l ]; then
+	  if [ $curlevel -gt $l ]; then
             # echo "Write new swlevel $l to /tmp/level.admin"
             echo $l > /tmp/level.admin
-        fi
-        tac $LEVELTABLE | cut -d"#" -f1 | awk '{ if (NF>0) print $0 }' | \
+          fi
+          tac $LEVELTABLE | cut -d"#" -f1 | awk '{ if (NF>0) print $0 }' | \
 		grep "^${l}:" | grep ":d:" |  while read line
 		do
 			(
@@ -573,7 +582,7 @@ goto_level()
 			program=`echo $line | cut -d":" -f6`
 			start_prog $program x$asroot x$withmpi
 			) <&- # cant have programs reading from stdin
-						# as that would mess up 'while read line'
+			      # as that would mess up 'while read line'
         done
         if [ $curlevel -le $l ]; then
             # echo "Write new swlevel $l to /tmp/level.admin"
@@ -719,11 +728,6 @@ handle_args()
 		fi
 	fi
 
-	if [ "$user" != "lofarsys" -a $level -gt 3 ]; then
-			echo "Will only start up to level 3 as this appears to be local use"
-			level=3
-	fi
-
 	return
 }
 
@@ -738,7 +742,7 @@ handle_args()
 # On non-PVSS system LoggingProcessor.
 
 logProgToSkip=LoggingProcessor
-if [ -f ${BINDIR}/PVSS00pmon -o -f ${BINDIR}/WCCILpmon ]; then
+if [ -f ${BINDIR}/WCCILpmon ]; then
 	logProgToSkip=LoggingClient
 fi
 
@@ -773,6 +777,8 @@ cwd=`pwd`
 cd ${BINDIR}
 goto_level $level
 cd ${cwd}
+# Allow ClockControl to start properly before reporting status
+sleep 2 
 status_prog
 if [ $highest_level_running -gt $level ]; then
 	echo "Could not go to level $level. Level is $highest_level_running"
diff --git a/MAC/APL/APLCommon/src/warp b/MAC/APL/APLCommon/src/warp
new file mode 120000
index 0000000000000000000000000000000000000000..85bbe190c395b16cc9df28eab9b1d9dc3f547212
--- /dev/null
+++ b/MAC/APL/APLCommon/src/warp
@@ -0,0 +1 @@
+swlevel
\ No newline at end of file
diff --git a/MAC/APL/CURTDBDaemons/src/SoftwareMonitor/SoftwareMonitor.conf b/MAC/APL/CURTDBDaemons/src/SoftwareMonitor/SoftwareMonitor.conf
index ec4c6b2491cdccdbc6522874ef7d37b70c4ad523..014d8f833bdeaa1f998bab0ad799655b0c81e960 100644
--- a/MAC/APL/CURTDBDaemons/src/SoftwareMonitor/SoftwareMonitor.conf
+++ b/MAC/APL/CURTDBDaemons/src/SoftwareMonitor/SoftwareMonitor.conf
@@ -3,20 +3,19 @@
 #
 
 # After how many seconds the software monitor should start a new check.
-pollInterval			= 15
+pollInterval			= 30
 
 # The minimal number of times a program-state may differ from the requested state 
 # before the program is reported suspiscious.
-suspisciousThreshold	= 2
+suspisciousThreshold	= 3
 
 # The minimal number of times a program-state may differ from the requested state 
 # before the program is reported broken.
-brokenThreshold			= 4
+brokenThreshold			= 6
 
 # List of programs that the SoftwareMonitor may restart (by calling swlevel)
-restartablePrograms     = [MACScheduler,ServiceBroker,SASGateway,MessageRouter,FeedbackService,PVSSGateway,CTStartDaemon,StationControl,BeamServer,CalServer]
+restartablePrograms     = [MessageRouter,LogProcessor,ServiceBroker,SASGateway,PVSSGateway,FeedbackService,BeamServer,CalServer,HardwareMonitor,CTStartDaemon,MACScheduler,StationControl,ClockControl]
 
 # Restart of programs are done every poll during suspicious-mode. When program
 # reaches the broken state restarting is done less often.
-restartIntervalInPolls	= 4
-
+restartIntervalInPolls	= 8
diff --git a/MAC/APL/RTDBCommon/include/APL/RTDBCommon/RTDButilities.h b/MAC/APL/RTDBCommon/include/APL/RTDBCommon/RTDButilities.h
index 9c93ff2cca3d2635bcdd58de9c1e0238efe5a35d..8fc949b471d163ec5fa878c53ad5a48db9408bb3 100644
--- a/MAC/APL/RTDBCommon/include/APL/RTDBCommon/RTDButilities.h
+++ b/MAC/APL/RTDBCommon/include/APL/RTDBCommon/RTDButilities.h
@@ -56,6 +56,7 @@ enum {
 	RTDB_OBJ_STATE_TEST,
 	RTDB_OBJ_STATE_SUSPICIOUS,
 	RTDB_OBJ_STATE_BROKEN,
+	RTDB_OBJ_STATE_BEYOND_REPAIR,
 
 	RTDB_OBJ_STATE_NR_OF_VALUES
 };
diff --git a/MAC/APL/RTDBCommon/src/RTDButilities.cc b/MAC/APL/RTDBCommon/src/RTDButilities.cc
index bb1f9e5e4713e50fcfe9e279d5f36f6883ceed0c..787ba86264e82fc87e7e8c73e7004f8cf002085b 100644
--- a/MAC/APL/RTDBCommon/src/RTDButilities.cc
+++ b/MAC/APL/RTDBCommon/src/RTDButilities.cc
@@ -43,13 +43,14 @@ typedef struct RTDBObjState {
 } RTDBobjState_t;
 
 RTDBobjState_t	objStateTable[] = {
-	{	 0,	"'Off'"				},
+	{	 0,	"'Off'"			},
 	{	10,	"'Operational'"		},
 	{	20,	"'Maintenance'"		},
-	{	30,	"'Test'"			},
-	{	46,	"'Suspicious'"		},
-	{	56,	"'Broken'"			},
-	{	60,	"'Not available'"	}
+	{	30,	"'Test'"		},
+	{	40,	"'Suspicious'"		},
+	{	50,	"'Broken'"		},
+	{	60, "'Beyond_Repair'"		},
+	{	70, "'Not available'"   	}
 };
 
 // Every softwaremodule or hardwarecomponent has a color on the Navigator screens
diff --git a/MAC/APL/RTDBCommon/src/setObjectState.cc b/MAC/APL/RTDBCommon/src/setObjectState.cc
index a9d8c294bff9267953413fb1613baae11a7a2578..c56866c593402f62c55b6557962d97b4434522ed 100644
--- a/MAC/APL/RTDBCommon/src/setObjectState.cc
+++ b/MAC/APL/RTDBCommon/src/setObjectState.cc
@@ -212,6 +212,7 @@ int main(int argc, char* argv[])
 		cout << "               3 - Test" << endl;
 		cout << "               4 - Suspicious" << endl;
 		cout << "               5 - Broken" << endl;
+		cout << "               6 - Beyond_Repair" << endl;
 		return (1);
 	}
 
diff --git a/MAC/CMakeLists.txt b/MAC/CMakeLists.txt
index 11f1d2f17d076fe48e3e34dba212d456738df15f..ebded6965f686d641369b868a16ba2939ac4f1b8 100644
--- a/MAC/CMakeLists.txt
+++ b/MAC/CMakeLists.txt
@@ -7,7 +7,7 @@ lofar_add_package(Deployment)  # Deployment related functions
 lofar_add_package(Navigator2)
 lofar_add_package(MACTools Tools)
 lofar_add_package(MAC_Services Services)
-lofar_add_package(PVSS_Datapoints Deployment/data/PVSS)
+lofar_add_package(WinCC_Datapoints Deployment/data/PVSS)
 lofar_add_package(OTDB_Comps Deployment/data/OTDB)
 lofar_add_package(StaticMetaData Deployment/data/StaticMetaData)
 lofar_add_package(WinCC_Services WinCCServices)
diff --git a/MAC/Deployment/data/Coordinates/CoordMenu.py b/MAC/Deployment/data/Coordinates/CoordMenu.py
index 92d24e14c2e314630c4e27983e5a99016707d358..717b37f801163be634f1cee32b5a8a36a0052c63 100755
--- a/MAC/Deployment/data/Coordinates/CoordMenu.py
+++ b/MAC/Deployment/data/Coordinates/CoordMenu.py
@@ -195,7 +195,7 @@ if __name__ == "__main__":
         if sel == '9': transform_all()
         if sel == '10': transform_one()
         if sel == '11': make_all_conf_files()
-        if sel == '12': make_one_conf_files()
+        if sel == '12': make_one_conf_file()
         if sel == '0':
             create_CDB()
             create_CDB_objects()
diff --git a/MAC/Deployment/data/Coordinates/ETRF_FILES/IE613/ie613-antenna-positions-etrs.csv b/MAC/Deployment/data/Coordinates/ETRF_FILES/IE613/ie613-antenna-positions-etrs.csv
new file mode 100644
index 0000000000000000000000000000000000000000..56638e56abf42cc7c109e8c23e3486531746ed23
--- /dev/null
+++ b/MAC/Deployment/data/Coordinates/ETRF_FILES/IE613/ie613-antenna-positions-etrs.csv
@@ -0,0 +1,195 @@
+NAME,ETRS-X,ETRS-Y,ETRS-Z,STATION-P,STATION-Q,STATION-R,RCU-X,RCU-Y
+L0,3801624.10856,-529030.144321,5077003.33758,-6.735,12.389,0.0,0,1
+L1,3801623.20436,-529022.13332,5077004.87235,1.427,13.244,0.0,2,3
+L2,3801621.45091,-529028.364405,5077005.51374,-4.624,15.631,0.0,4,5
+L3,3801620.54284,-529021.553655,5077006.92265,2.332,16.531,0.0,6,7
+L4,3801646.30601,-529007.273462,5076989.20971,13.566,-15.953,0.0,8,9
+L5,3801645.03826,-529001.244225,5076990.80346,19.78,-14.58,0.0,10,11
+L6,3801652.84665,-529008.422381,5076984.20068,11.619,-24.04,0.0,12,13
+L7,3801652.74607,-529003.497071,5076984.80416,16.582,-24.08,0.0,14,15
+L8,3801619.70289,-529033.333371,5077006.28647,-9.407,17.969,0.0,16,17
+L9,3801618.94159,-529040.297502,5077006.1081,-16.315,19.148,0.0,18,19
+L10,3801615.72997,-529041.019718,5077008.42967,-16.652,23.162,0.0,20,21
+L11,3801613.76624,-529037.838023,5077010.23786,-13.216,25.495,0.0,22,23
+L12,3801636.91031,-529018.609654,5076995.01215,3.309,-3.901,0.0,24,25
+L13,3801632.34691,-529018.277046,5076998.45664,4.196,1.757,0.0,26,27
+L14,3801632.12168,-529014.908769,5076998.9862,7.609,1.924,0.0,28,29
+L15,3801635.60373,-529012.573157,5076996.63569,9.535,-2.48,0.0,30,31
+L16,3801629.76178,-529013.125808,5077000.94027,9.687,4.796,0.0,32,33
+L17,3801626.03464,-529015.35764,5077003.485,7.895,9.501,0.0,34,35
+L18,3801627.27955,-529006.775319,5077003.47569,16.371,7.667,0.0,36,37
+L19,3801623.62559,-529008.168631,5077006.05569,15.413,12.253,0.0,38,39
+L20,3801644.22642,-529038.251875,5076987.44007,-17.321,-12.332,0.0,40,41
+L21,3801639.14143,-529045.026625,5076990.51176,-23.515,-5.788,0.0,42,43
+L22,3801648.608,-529045.396223,5076983.4007,-25.033,-17.536,0.0,44,45
+L23,3801639.62259,-529050.69201,5076989.54462,-29.268,-6.196,0.0,46,47
+L24,3801629.11398,-529034.302583,5076999.15253,-11.521,6.31,0.0,48,49
+L25,3801625.8773,-529035.528226,5077001.43881,-12.361,10.372,0.0,50,51
+L26,3801630.28183,-529038.208913,5076997.86112,-15.589,4.99,0.0,52,53
+L27,3801629.81848,-529042.251094,5076997.77363,-19.596,5.701,0.0,54,55
+L28,3801650.29313,-529024.090486,5076984.4274,-3.821,-20.343,0.0,56,57
+L29,3801653.33369,-529022.845693,5076982.28967,-2.938,-24.162,0.0,58,59
+L30,3801652.0097,-529032.704977,5076982.22106,-12.688,-22.187,0.0,60,61
+L31,3801656.64085,-529030.683572,5076978.97849,-11.217,-28.008,0.0,62,63
+L32,3801628.1705,-529002.978084,5077003.2175,20.08,6.433,0.0,64,65
+L33,3801632.51999,-528998.929291,5077000.40279,23.623,0.894,0.0,66,67
+L34,3801630.89005,-528989.408004,5077002.64169,33.391,2.6,0.0,68,69
+L35,3801626.28903,-528992.815581,5077005.71307,30.523,8.43,0.0,70,71
+L36,3801639.72662,-529021.79607,5076992.56659,-0.235,-7.293,0.0,72,73
+L37,3801640.58541,-529016.119463,5076992.53402,5.367,-8.55,0.0,74,75
+L38,3801642.90324,-529022.164445,5076990.15417,-0.99,-11.227,0.0,76,77
+L39,3801644.07468,-529018.679621,5076989.65294,2.371,-12.799,0.0,78,79
+L40,3801613.49668,-529024.076941,5077011.91538,0.649,25.369,0.0,80,81
+L41,3801615.90945,-529014.325239,5077011.15914,10.159,22.045,0.0,82,83
+L42,3801609.21526,-529018.498353,5077015.71197,6.775,30.501,0.0,84,85
+L43,3801612.80684,-529008.729972,5077014.07696,16.159,25.712,0.0,86,87
+L44,3801637.52466,-529027.872277,5076993.55963,-6.076,-4.354,0.0,88,89
+L45,3801640.63597,-529028.684264,5076991.14841,-7.269,-8.192,0.0,90,91
+L46,3801635.83519,-529032.295976,5076994.34711,-10.318,-2.107,0.0,92,93
+L47,3801640.00113,-529032.814756,5076991.17955,-11.344,-7.265,0.0,94,95
+L48,3801640.9208,-529006.047012,5076993.36396,15.451,-9.304,0.0,96,97
+L49,3801647.49335,-529032.594521,5076985.60658,-12.03,-16.58,0.0,98,99
+L50,3801645.42222,-528996.287397,5076991.04837,24.716,-15.223,0.0,100,101
+L51,3801635.08021,-529000.140949,5076998.36036,22.095,-2.246,0.0,102,103
+L52,3801631.81261,-529047.246714,5076995.74816,-24.859,3.391,0.0,104,105
+L53,3801653.58056,-529040.482451,5076980.21336,-20.696,-23.878,0.0,106,107
+L54,3801637.70694,-528993.13014,5076997.15028,28.824,-5.744,0.0,108,109
+L55,3801637.90242,-529015.370278,5076994.61854,6.445,-5.242,0.0,110,111
+L56,3801610.8709,-529030.346475,5077013.20427,-5.335,28.841,0.0,112,113
+L57,3801635.61721,-529041.946393,5076993.47473,-19.992,-1.513,0.0,114,115
+L58,3801623.42751,-529038.204059,5077002.98174,-14.754,13.505,0.0,116,117
+L59,3801658.73619,-529021.130287,5076978.43808,-1.868,-30.931,0.0,118,119
+L60,3801645.9965,-529029.084979,5076987.10117,-8.321,-14.838,0.0,120,121
+L61,3801637.34139,-529038.630752,5076992.54246,-16.868,-3.766,0.0,122,123
+L62,3801619.08922,-529015.76568,5077008.62937,8.326,18.143,0.0,124,125
+L63,3801628.95572,-529019.802848,5077000.82614,3.073,6.021,0.0,126,127
+L64,3801642.93487,-529011.245167,5076991.30186,9.982,-11.632,0.0,128,129
+L65,3801628.70881,-529026.737833,5077000.26666,-3.868,6.56,0.0,130,131
+L66,3801652.47982,-529017.268988,5076983.52572,2.771,-23.288,0.0,132,133
+L67,3801646.87731,-529020.821106,5076987.32969,-0.121,-16.209,0.0,134,135
+L68,3801625.59651,-529044.132668,5077000.72556,-20.976,11.009,0.0,136,137
+L69,3801622.91188,-529044.606348,5077002.68014,-21.127,14.36,0.0,138,139
+L70,3801633.03757,-529026.906705,5076997.01501,-4.562,1.188,0.0,140,141
+L71,3801617.27327,-529024.366064,5077009.0633,-0.099,20.687,0.0,142,143
+L72,3801643.33709,-529026.941161,5076989.31769,-5.844,-11.606,0.0,144,145
+L73,3801634.63118,-529005.25186,5076998.14753,17.012,-1.517,0.0,146,147
+L74,3801645.36222,-529012.872763,5076989.31407,8.052,-14.593,0.0,148,149
+L75,3801640.32787,-528994.443917,5076995.05154,27.186,-8.956,0.0,150,151
+L76,3801630.13982,-529030.851219,5076998.75646,-8.176,4.92,0.0,152,153
+L77,3801643.29597,-529033.178836,5076988.67929,-12.109,-11.346,0.0,154,155
+L78,3801616.89089,-529032.068481,5077008.52269,-7.795,21.42,0.0,156,157
+L79,3801619.05996,-529006.708134,5077009.62284,17.434,17.876,0.0,158,159
+L80,3801622.89187,-529012.900981,5077006.09613,10.745,13.323,0.0,160,161
+L81,3801641.41074,-529001.736999,5076993.46032,19.724,-10.057,0.0,162,163
+L82,3801629.86911,-529008.686801,5077001.33628,14.136,4.514,0.0,164,165
+L83,3801630.20942,-529023.519762,5076999.49093,-0.815,4.588,0.0,166,167
+L84,3801648.23321,-529040.301998,5076984.22712,-19.867,-17.241,0.0,168,169
+L85,3801637.63669,-529024.324087,5076993.85656,-2.523,-4.612,0.0,170,171
+L86,3801658.30219,-529010.376544,5076979.91583,8.994,-30.752,0.0,172,173
+L87,3801651.29131,-529014.298313,5076984.73219,5.901,-21.911,0.0,174,175
+L88,3801626.41855,-529018.72968,5077002.8365,4.459,9.137,0.0,176,177
+L89,3801617.63711,-528999.314747,5077011.47878,25.038,19.396,0.0,178,179
+L90,3801625.93131,-529027.290351,5077002.28215,-4.087,10.029,0.0,180,181
+L91,3801633.67036,-529049.363758,5076994.13334,-27.212,1.154,0.0,182,183
+L92,3801624.37027,-529001.842209,5077006.17807,21.682,11.116,0.0,184,185
+L93,3801632.97145,-529030.365798,5076996.69334,-8.031,1.386,0.0,186,187
+L94,3801634.68204,-529035.563708,5076994.85797,-13.463,-0.565,0.0,188,189
+L95,3801635.94739,-529009.167177,5076996.74434,12.917,-3.021,0.0,190,191
+H0,3801681.27135,-528961.263437,5076968.37951,24.5318938806,12.9351607929,0.0,0,1
+H1,3801685.36841,-528960.233733,5076965.43346,25.0708938806,7.81316079291,0.0,2,3
+H2,3801689.46549,-528959.20502,5076962.48728,25.6088938806,2.69116079291,0.0,4,5
+H3,3801693.56178,-528958.176404,5076959.54169,26.1468938806,-2.42983920709,0.0,6,7
+H4,3801697.65884,-528957.1467,5076956.59564,26.6858938806,-7.55183920709,0.0,8,9
+H5,3801677.7386,-528967.318311,5076970.35376,18.8718938806,17.5181607929,0.0,10,11
+H6,3801681.83485,-528966.288703,5076967.4083,19.4108938806,12.3971607929,0.0,12,13
+H7,3801685.93194,-528965.25999,5076964.46212,19.9488938806,7.27516079291,0.0,14,15
+H8,3801690.02903,-528964.231277,5076961.51594,20.4868938806,2.15316079291,0.0,16,17
+H9,3801694.12609,-528963.201573,5076958.56989,21.0258938806,-2.96883920709,0.0,18,19
+H10,3801698.22237,-528962.172957,5076955.6243,21.5638938806,-8.08983920709,0.0,20,21
+H11,3801702.31946,-528961.144244,5076952.67813,22.1018938806,-13.2118392071,0.0,22,23
+H12,3801674.20504,-528973.373281,5076972.3286,13.2118938806,22.1021607929,0.0,24,25
+H13,3801678.3021,-528972.343577,5076969.38255,13.7508938806,16.9801607929,0.0,26,27
+H14,3801682.39919,-528971.314864,5076966.43637,14.2888938806,11.8581607929,0.0,28,29
+H15,3801686.49547,-528970.286248,5076963.49078,14.8268938806,6.73716079291,0.0,30,31
+H16,3801690.59256,-528969.257535,5076960.5446,15.3648938806,1.61516079291,0.0,32,33
+H17,3801694.68962,-528968.22783,5076957.59856,15.9038938806,-3.50683920709,0.0,34,35
+H18,3801698.78671,-528967.199118,5076954.65238,16.4418938806,-8.62883920709,0.0,36,37
+H19,3801702.88379,-528966.170405,5076951.7062,16.9798938806,-13.7508392071,0.0,38,39
+H20,3801706.98005,-528965.140797,5076948.76074,17.5188938806,-18.8718392071,0.0,40,41
+H21,3801670.67229,-528979.428154,5076974.30285,7.55189388057,26.6851607929,0.0,42,43
+H22,3801674.76857,-528978.399538,5076971.35726,8.08989388057,21.5641607929,0.0,44,45
+H23,3801678.86564,-528977.369834,5076968.41121,8.62889388057,16.4421607929,0.0,46,47
+H24,3801682.96272,-528976.341121,5076965.46503,9.16689388057,11.3201607929,0.0,48,49
+H25,3801687.05981,-528975.312408,5076962.51886,9.70489388057,6.19816079291,0.0,50,51
+H26,3801691.15687,-528974.282704,5076959.57281,10.2438938806,1.07616079291,0.0,52,53
+H27,3801695.25315,-528973.254088,5076956.62722,10.7818938806,-4.04483920709,0.0,54,55
+H28,3801699.35024,-528972.225375,5076953.68104,11.3198938806,-9.16683920709,0.0,56,57
+H29,3801703.4473,-528971.19567,5076950.73499,11.8588938806,-14.2888392071,0.0,58,59
+H30,3801707.54439,-528970.166958,5076947.78881,12.3968938806,-19.4108392071,0.0,60,61
+H31,3801711.64067,-528969.138341,5076944.84322,12.9348938806,-24.5318392071,0.0,62,63
+H32,3801671.23582,-528984.454412,5076973.33151,2.42989388057,26.1471607929,0.0,64,65
+H33,3801675.33288,-528983.424707,5076970.38546,2.96889388057,21.0251607929,0.0,66,67
+H34,3801679.42917,-528982.396091,5076967.43987,3.50689388057,15.9041607929,0.0,68,69
+H35,3801683.52625,-528981.367378,5076964.4937,4.04489388057,10.7821607929,0.0,70,71
+H36,3801687.62331,-528980.337674,5076961.54765,4.58389388057,5.66016079291,0.0,72,73
+H37,3801691.7204,-528979.308961,5076958.60147,5.12189388057,0.538160792914,0.0,74,75
+H38,3801695.81749,-528978.280248,5076955.65529,5.65989388057,-4.58383920709,0.0,76,77
+H39,3801699.91375,-528977.250641,5076952.70983,6.19889388057,-9.70483920709,0.0,78,79
+H40,3801704.01083,-528976.221928,5076949.76365,6.73689388057,-14.8268392071,0.0,80,81
+H41,3801708.10792,-528975.193215,5076946.81748,7.27489388057,-19.9488392071,0.0,82,83
+H42,3801712.20498,-528974.16351,5076943.87143,7.81389388057,-25.0708392071,0.0,84,85
+H43,3801671.79936,-528989.480669,5076972.36017,-2.69210611943,25.6091607929,0.0,86,87
+H44,3801675.89642,-528988.450965,5076969.41412,-2.15310611943,20.4871607929,0.0,88,89
+H45,3801679.9935,-528987.422252,5076966.46795,-1.61510611943,15.3651607929,0.0,90,91
+H46,3801684.09059,-528986.393539,5076963.52177,-1.07710611943,10.2431607929,0.0,92,93
+H47,3801688.18685,-528985.363931,5076960.57631,-0.538106119427,5.12216079291,0.0,94,95
+H48,3801696.38102,-528983.306505,5076954.68395,0.537893880573,-5.12183920709,0.0,96,97
+H49,3801700.47808,-528982.276801,5076951.7379,1.07689388057,-10.2438392071,0.0,98,99
+H50,3801704.57517,-528981.248088,5076948.79173,1.61489388057,-15.3658392071,0.0,100,101
+H51,3801708.67145,-528980.219472,5076945.84614,2.15289388057,-20.4868392071,0.0,102,103
+H52,3801712.76851,-528979.189768,5076942.90009,2.69189388057,-25.6088392071,0.0,104,105
+H53,3801672.36367,-528994.505838,5076971.38837,-7.81310611943,25.0701607929,0.0,106,107
+H54,3801676.45995,-528993.477222,5076968.44279,-7.27510611943,19.9491607929,0.0,108,109
+H55,3801680.55704,-528992.448509,5076965.49661,-6.73710611943,14.8271607929,0.0,110,111
+H56,3801684.6541,-528991.418805,5076962.55056,-6.19810611943,9.70516079291,0.0,112,113
+H57,3801688.75118,-528990.390092,5076959.60438,-5.66010611943,4.58316079291,0.0,114,115
+H58,3801692.84747,-528989.361475,5076956.65879,-5.12210611943,-0.537839207086,0.0,116,117
+H59,3801696.94453,-528988.331771,5076953.71274,-4.58310611943,-5.65983920709,0.0,118,119
+H60,3801701.04161,-528987.303058,5076950.76657,-4.04510611943,-10.7818392071,0.0,120,121
+H61,3801705.1387,-528986.274345,5076947.82039,-3.50710611943,-15.9038392071,0.0,122,123
+H62,3801709.23576,-528985.244641,5076944.87434,-2.96810611943,-21.0258392071,0.0,124,125
+H63,3801713.33204,-528984.216025,5076941.92875,-2.43010611943,-26.1468392071,0.0,126,127
+H64,3801672.9272,-528999.532095,5076970.41704,-12.9351061194,24.5321607929,0.0,128,129
+H65,3801677.02428,-528998.503382,5076967.47086,-12.3971061194,19.4101607929,0.0,130,131
+H66,3801681.12054,-528997.473775,5076964.5254,-11.8581061194,14.2891607929,0.0,132,133
+H67,3801685.21763,-528996.445062,5076961.57922,-11.3201061194,9.16716079291,0.0,134,135
+H68,3801689.31472,-528995.416349,5076958.63304,-10.7821061194,4.04516079291,0.0,136,137
+H69,3801693.41178,-528994.386645,5076955.68699,-10.2431061194,-1.07683920709,0.0,138,139
+H70,3801697.50886,-528993.357932,5076952.74082,-9.70510611943,-6.19883920709,0.0,140,141
+H71,3801701.60515,-528992.329315,5076949.79523,-9.16710611943,-11.3198392071,0.0,142,143
+H72,3801705.70223,-528991.300603,5076946.84905,-8.62910611943,-16.4418392071,0.0,144,145
+H73,3801709.79929,-528990.270898,5076943.903,-8.09010611943,-21.5638392071,0.0,146,147
+H74,3801713.89638,-528989.242185,5076940.95682,-7.55210611943,-26.6858392071,0.0,148,149
+H75,3801677.58782,-529003.52964,5076966.49952,-17.5191061194,18.8721607929,0.0,150,151
+H76,3801681.68488,-529002.499935,5076963.55347,-16.9801061194,13.7501607929,0.0,152,153
+H77,3801685.78196,-529001.471222,5076960.60729,-16.4421061194,8.62816079291,0.0,154,155
+H78,3801689.87825,-529000.442606,5076957.66171,-15.9041061194,3.50716079291,0.0,156,157
+H79,3801693.97531,-528999.412902,5076954.71566,-15.3651061194,-1.61483920709,0.0,158,159
+H80,3801698.07239,-528998.384189,5076951.76948,-14.8271061194,-6.73683920709,0.0,160,161
+H81,3801702.16948,-528997.355476,5076948.8233,-14.2891061194,-11.8588392071,0.0,162,163
+H82,3801706.26574,-528996.325868,5076945.87784,-13.7501061194,-16.9798392071,0.0,164,165
+H83,3801710.36283,-528995.297155,5076942.93166,-13.2121061194,-22.1018392071,0.0,166,167
+H84,3801682.24841,-529007.526192,5076962.58213,-22.1021061194,13.2121607929,0.0,168,169
+H85,3801686.3455,-529006.49748,5076959.63596,-21.5641061194,8.09016079291,0.0,170,171
+H86,3801690.44256,-529005.467775,5076956.68991,-21.0251061194,2.96816079291,0.0,172,173
+H87,3801694.53884,-529004.439159,5076953.74432,-20.4871061194,-2.15283920709,0.0,174,175
+H88,3801698.63593,-529003.410446,5076950.79814,-19.9491061194,-7.27483920709,0.0,176,177
+H89,3801702.73299,-529002.380742,5076947.85209,-19.4101061194,-12.3968392071,0.0,178,179
+H90,3801706.83007,-529001.352029,5076944.90591,-18.8721061194,-17.5188392071,0.0,180,181
+H91,3801686.909,-529011.522745,5076958.66475,-26.6851061194,7.55216079291,0.0,182,183
+H92,3801691.00609,-529010.494032,5076955.71857,-26.1471061194,2.43016079291,0.0,184,185
+H93,3801695.10318,-529009.46532,5076952.77239,-25.6091061194,-2.69183920709,0.0,186,187
+H94,3801699.20026,-529008.436607,5076949.82621,-25.0711061194,-7.81383920709,0.0,188,189
+H95,3801703.29652,-529007.406999,5076946.88075,-24.5321061194,-12.9348392071,0.0,190,191
+CLBA,3801633.86881,-529022.26806,5076996.89168,0.0,0.0,0.0,-1,-1
+CHBA,3801692.28406,-528984.335098,5076957.63005,0.0,0.0,0.0,-1,-1
diff --git a/MAC/Deployment/data/Coordinates/create_CDB_base_tables.sql b/MAC/Deployment/data/Coordinates/create_CDB_base_tables.sql
index 4ce7c62e32536a0db4a36eef2ca15e2604cb8c75..9ae27620e18c53e19e78cd32052c6e05dbc4502e 100644
--- a/MAC/Deployment/data/Coordinates/create_CDB_base_tables.sql
+++ b/MAC/Deployment/data/Coordinates/create_CDB_base_tables.sql
@@ -205,7 +205,8 @@ INSERT INTO station VALUES ('FR606', 'Nancy');
 INSERT INTO station VALUES ('SE607', 'Onsala');
 INSERT INTO station VALUES ('UK608', 'Chillbolton');
 INSERT INTO station VALUES ('FI609', 'Kaira');
-INSERT INTO station VALUES ('PL610', '');
-INSERT INTO station VALUES ('PL611', '');
+INSERT INTO station VALUES ('PL610', 'Borowiec');
+INSERT INTO station VALUES ('PL611', 'Lazy');
 INSERT INTO station VALUES ('PL612', 'Baldy');
+INSERT INTO station VALUES ('IE613', 'Birr');
 
diff --git a/MAC/Deployment/data/Coordinates/data/normal_vectors.dat b/MAC/Deployment/data/Coordinates/data/normal_vectors.dat
index 0bba676229bb9c33c94b94cfd4e097ac8d7a0cd5..18493be4204537ef3f37968ae47c65a8abc353cf 100644
--- a/MAC/Deployment/data/Coordinates/data/normal_vectors.dat
+++ b/MAC/Deployment/data/Coordinates/data/normal_vectors.dat
@@ -1,116 +1,82 @@
 #
 # station, type, normal-vector(3x float)
 #
-cs301, lba , 0.598753, 0.072099, 0.797682
-cs301, hba0, 0.598753, 0.072099, 0.797682
-cs301, hba1, 0.598753, 0.072099, 0.797682
-cs024, lba , 0.598753, 0.072099, 0.797682
-cs024, hba0, 0.598753, 0.072099, 0.797682
-cs024, hba1, 0.598753, 0.072099, 0.797682
-cs007, lba , 0.598753, 0.072099, 0.797682
-cs007, hba0, 0.598753, 0.072099, 0.797682
-cs007, hba1, 0.598753, 0.072099, 0.797682
-rs406, lba , 0.591206, 0.077240, 0.802814
-rs406, hba , 0.591206, 0.077240, 0.802814
-pl611, lba , 0.643193, 0.307002, 0.701465
-pl611, hba , 0.590360, 0.217723, 0.777220
-rs205, lba , 0.598753, 0.072099, 0.797682
-rs205, hba , 0.598753, 0.072099, 0.797682
-cs201, lba , 0.598753, 0.072099, 0.797682
-cs201, hba0, 0.598753, 0.072099, 0.797682
-cs201, hba1, 0.598753, 0.072099, 0.797682
-de604, lba , 0.601156, 0.153890, 0.784175
-de604, hba , 0.601146, 0.153897, 0.784181
-cs004, lba , 0.598753, 0.072099, 0.797682
-cs004, hba0, 0.598753, 0.072099, 0.797682
-cs004, hba1, 0.598753, 0.072099, 0.797682
-cs021, lba , 0.598753, 0.072099, 0.797682
-cs021, hba0, 0.598753, 0.072099, 0.797682
-cs021, hba1, 0.598753, 0.072099, 0.797682
+rs407, lba , 0.598753, 0.072099, 0.797682
+rs407, hba , 0.598753, 0.072099, 0.797682
+uk608, lba , 0.626845, -0.014960, 0.779000
+uk608, hba , 0.627506, -0.014332, 0.778480
 cs028, lba , 0.598753, 0.072099, 0.797682
 cs028, hba0, 0.598753, 0.072099, 0.797682
 cs028, hba1, 0.598753, 0.072099, 0.797682
-cs002, lba , 0.598753, 0.072099, 0.797682
-cs002, hba0, 0.598753, 0.072099, 0.797682
-cs002, hba1, 0.598753, 0.072099, 0.797682
-cs003, lba , 0.598753, 0.072099, 0.797682
-cs003, hba0, 0.598753, 0.072099, 0.797682
-cs003, hba1, 0.598753, 0.072099, 0.797682
-rs407, lba , 0.598753, 0.072099, 0.797682
-rs407, hba , 0.598753, 0.072099, 0.797682
-rs306, lba , 0.598753, 0.072099, 0.797682
-rs306, hba , 0.598753, 0.072099, 0.797682
+cs032, lba , 0.598753, 0.072099, 0.797682
+cs032, hba0, 0.598753, 0.072099, 0.797682
+cs032, hba1, 0.598753, 0.072099, 0.797682
+rs406, lba , 0.591206, 0.077240, 0.802814
+rs406, hba , 0.591206, 0.077240, 0.802814
+fr606, lba , 0.677163, 0.025597, 0.735388
+fr606, hba , 0.677451, 0.025924, 0.735111
 de605, lba , 0.628982, 0.049468, 0.775844
 de605, hba , 0.628965, 0.049472, 0.775858
-rs508, lba , 0.593792, 0.070643, 0.801512
-rs508, hba , 0.593792, 0.070643, 0.801512
-cs031, lba , 0.598753, 0.072099, 0.797682
-cs031, hba0, 0.598753, 0.072099, 0.797682
-cs031, hba1, 0.598753, 0.072099, 0.797682
-cs001, lba , 0.598753, 0.072099, 0.797682
-cs001, hba0, 0.598753, 0.072099, 0.797682
-cs001, hba1, 0.598753, 0.072099, 0.797682
-rs409, lba , 0.598753, 0.072099, 0.797682
-rs409, hba , 0.598753, 0.072099, 0.797682
-cs026, lba , 0.598753, 0.072099, 0.797682
-cs026, hba0, 0.598753, 0.072099, 0.797682
-cs026, hba1, 0.598753, 0.072099, 0.797682
-FI609, lba , 0.333971, 0.126638, 0.934037
-FI609, hba , 0.334119, 0.126625, 0.933987
-cs302, lba , 0.598753, 0.072099, 0.797682
-cs302, hba0, 0.598753, 0.072099, 0.797682
-cs302, hba1, 0.598753, 0.072099, 0.797682
-rs509, lba , 0.598753, 0.072099, 0.797682
-rs509, hba , 0.598753, 0.072099, 0.797682
-de602, lba , 0.662887, 0.109694, 0.740641
-de602, hba , 0.649782, 0.129703, 0.748973
 rs210, lba , 0.605061, 0.071517, 0.792961
 rs210, hba , 0.605027, 0.071493, 0.792989
-de601, lba , 0.632827, 0.078099, 0.770344
-de601, hba , 0.631584, 0.076814, 0.771493
-rs307, lba , 0.598753, 0.072099, 0.797682
-rs307, hba , 0.598753, 0.072099, 0.797682
-cs006, lba , 0.598753, 0.072099, 0.797682
-cs006, hba0, 0.598753, 0.072099, 0.797682
-cs006, hba1, 0.598753, 0.072099, 0.797682
+cs002, lba , 0.598753, 0.072099, 0.797682
+cs002, hba0, 0.598753, 0.072099, 0.797682
+cs002, hba1, 0.598753, 0.072099, 0.797682
+cs013, lba , 0.598753, 0.072099, 0.797682
+cs013, hba0, 0.598753, 0.072099, 0.797682
+cs013, hba1, 0.598753, 0.072099, 0.797682
 rs208, lba , 0.601735, 0.072879, 0.795364
 rs208, hba , 0.598753, 0.072099, 0.797682
+rs306, lba , 0.598753, 0.072099, 0.797682
+rs306, hba , 0.598753, 0.072099, 0.797682
 cs011, lba , 0.598753, 0.072099, 0.797682
 cs011, hba0, 0.598753, 0.072099, 0.797682
 cs011, hba1, 0.598753, 0.072099, 0.797682
-cs017, lba , 0.598753, 0.072099, 0.797682
-cs017, hba0, 0.598753, 0.072099, 0.797682
-cs017, hba1, 0.598753, 0.072099, 0.797682
-cs013, lba , 0.598753, 0.072099, 0.797682
-cs013, hba0, 0.598753, 0.072099, 0.797682
-cs013, hba1, 0.598753, 0.072099, 0.797682
+ie613, lba , 0.596257, -0.085625, 0.798214
+ie613, hba , 0.596257, -0.085625, 0.798214
+cs101, lba , 0.598753, 0.072099, 0.797682
+cs101, hba0, 0.598753, 0.072099, 0.797682
+cs101, hba1, 0.598753, 0.072099, 0.797682
+rs305, lba , 0.598460, 0.072037, 0.797907
+rs305, hba , 0.598753, 0.072099, 0.797682
 se607, lba , 0.530119, 0.108953, 0.840894
 se607, hba , 0.529311, 0.111871, 0.841020
-cs005, lba , 0.598753, 0.072099, 0.797682
-cs005, hba0, 0.598753, 0.072099, 0.797682
-cs005, hba1, 0.598753, 0.072099, 0.797682
-pl612, lba , 0.567718, 0.216143, 0.794341
-pl612, hba , 0.556866, 0.265184, 0.787133
-de603, lba , 0.601391, 0.095614, 0.793213
-de603, hba , 0.601456, 0.095645, 0.793160
-pl610, lba , 0.584455, 0.179760, 0.791264
-pl610, hba , 0.584455, 0.179760, 0.791264
+cs006, lba , 0.598753, 0.072099, 0.797682
+cs006, hba0, 0.598753, 0.072099, 0.797682
+cs006, hba1, 0.598753, 0.072099, 0.797682
+cs030, lba , 0.598753, 0.072099, 0.797682
+cs030, hba0, 0.598753, 0.072099, 0.797682
+cs030, hba1, 0.598753, 0.072099, 0.797682
+rs409, lba , 0.598753, 0.072099, 0.797682
+rs409, hba , 0.598753, 0.072099, 0.797682
+cs007, lba , 0.598753, 0.072099, 0.797682
+cs007, hba0, 0.598753, 0.072099, 0.797682
+cs007, hba1, 0.598753, 0.072099, 0.797682
 de609, lba , 0.582686, 0.102609, 0.806194
 de609, hba , 0.583126, 0.102326, 0.805912
-uk608, lba , 0.626845, -0.014960, 0.779000
-uk608, hba , 0.627506, -0.014332, 0.778480
-fr606, lba , 0.677163, 0.025597, 0.735388
-fr606, hba , 0.677451, 0.025924, 0.735111
+rs205, lba , 0.598753, 0.072099, 0.797682
+rs205, hba , 0.598753, 0.072099, 0.797682
+cs024, lba , 0.598753, 0.072099, 0.797682
+cs024, hba0, 0.598753, 0.072099, 0.797682
+cs024, hba1, 0.598753, 0.072099, 0.797682
+de604, lba , 0.601156, 0.153890, 0.784175
+de604, hba , 0.601146, 0.153897, 0.784181
+cs004, lba , 0.598753, 0.072099, 0.797682
+cs004, hba0, 0.598753, 0.072099, 0.797682
+cs004, hba1, 0.598753, 0.072099, 0.797682
+cs026, lba , 0.598753, 0.072099, 0.797682
+cs026, hba0, 0.598753, 0.072099, 0.797682
+cs026, hba1, 0.598753, 0.072099, 0.797682
 cs103, lba , 0.598753, 0.072099, 0.797682
 cs103, hba0, 0.598753, 0.072099, 0.797682
 cs103, hba1, 0.598753, 0.072099, 0.797682
-cs101, lba , 0.598753, 0.072099, 0.797682
-cs101, hba0, 0.598753, 0.072099, 0.797682
-cs101, hba1, 0.598753, 0.072099, 0.797682
-rs310, lba , 0.601869, 0.064948, 0.795949
-rs310, hba , 0.601934, 0.064739, 0.795917
-rs305, lba , 0.598460, 0.072037, 0.797907
-rs305, hba , 0.598753, 0.072099, 0.797682
+pl610, lba , 0.584455, 0.179760, 0.791264
+pl610, hba , 0.584455, 0.179760, 0.791264
+cs001, lba , 0.598753, 0.072099, 0.797682
+cs001, hba0, 0.598753, 0.072099, 0.797682
+cs001, hba1, 0.598753, 0.072099, 0.797682
+FI609, lba , 0.333971, 0.126638, 0.934037
+FI609, hba , 0.334119, 0.126625, 0.933987
 cs401, lba , 0.598753, 0.072099, 0.797682
 cs401, hba0, 0.598753, 0.072099, 0.797682
 cs401, hba1, 0.598753, 0.072099, 0.797682
@@ -119,11 +85,47 @@ cs501, hba0, 0.598753, 0.072099, 0.797682
 cs501, hba1, 0.598753, 0.072099, 0.797682
 rs503, lba , 0.598753, 0.072099, 0.797682
 rs503, hba , 0.598753, 0.072099, 0.797682
-cs030, lba , 0.598753, 0.072099, 0.797682
-cs030, hba0, 0.598753, 0.072099, 0.797682
-cs030, hba1, 0.598753, 0.072099, 0.797682
+cs301, lba , 0.598753, 0.072099, 0.797682
+cs301, hba0, 0.598753, 0.072099, 0.797682
+cs301, hba1, 0.598753, 0.072099, 0.797682
+cs021, lba , 0.598753, 0.072099, 0.797682
+cs021, hba0, 0.598753, 0.072099, 0.797682
+cs021, hba1, 0.598753, 0.072099, 0.797682
+cs003, lba , 0.598753, 0.072099, 0.797682
+cs003, hba0, 0.598753, 0.072099, 0.797682
+cs003, hba1, 0.598753, 0.072099, 0.797682
 rs106, lba , 0.598753, 0.072099, 0.797682
 rs106, hba , 0.598753, 0.072099, 0.797682
-cs032, lba , 0.598753, 0.072099, 0.797682
-cs032, hba0, 0.598753, 0.072099, 0.797682
-cs032, hba1, 0.598753, 0.072099, 0.797682
+rs307, lba , 0.598753, 0.072099, 0.797682
+rs307, hba , 0.598753, 0.072099, 0.797682
+de602, lba , 0.662887, 0.109694, 0.740641
+de602, hba , 0.649782, 0.129703, 0.748973
+de601, lba , 0.632827, 0.078099, 0.770344
+de601, hba , 0.631584, 0.076814, 0.771493
+rs310, lba , 0.601869, 0.064948, 0.795949
+rs310, hba , 0.601934, 0.064739, 0.795917
+rs509, lba , 0.598753, 0.072099, 0.797682
+rs509, hba , 0.598753, 0.072099, 0.797682
+cs031, lba , 0.598753, 0.072099, 0.797682
+cs031, hba0, 0.598753, 0.072099, 0.797682
+cs031, hba1, 0.598753, 0.072099, 0.797682
+pl612, lba , 0.567718, 0.216143, 0.794341
+pl612, hba , 0.556866, 0.265184, 0.787133
+cs302, lba , 0.598753, 0.072099, 0.797682
+cs302, hba0, 0.598753, 0.072099, 0.797682
+cs302, hba1, 0.598753, 0.072099, 0.797682
+cs005, lba , 0.598753, 0.072099, 0.797682
+cs005, hba0, 0.598753, 0.072099, 0.797682
+cs005, hba1, 0.598753, 0.072099, 0.797682
+cs017, lba , 0.598753, 0.072099, 0.797682
+cs017, hba0, 0.598753, 0.072099, 0.797682
+cs017, hba1, 0.598753, 0.072099, 0.797682
+de603, lba , 0.601391, 0.095614, 0.793213
+de603, hba , 0.601456, 0.095645, 0.793160
+pl611, lba , 0.643193, 0.307002, 0.701465
+pl611, hba , 0.590360, 0.217723, 0.777220
+cs201, lba , 0.598753, 0.072099, 0.797682
+cs201, hba0, 0.598753, 0.072099, 0.797682
+cs201, hba1, 0.598753, 0.072099, 0.797682
+rs508, lba , 0.593792, 0.070643, 0.801512
+rs508, hba , 0.593792, 0.070643, 0.801512
diff --git a/MAC/Deployment/data/Coordinates/data/rotation_matrices.dat b/MAC/Deployment/data/Coordinates/data/rotation_matrices.dat
index 7d0b523f582084df4c8e2fac30a9356a84c0b7fe..97297ac7a026d6c7fcc37640fa1c121e15fb6f94 100644
--- a/MAC/Deployment/data/Coordinates/data/rotation_matrices.dat
+++ b/MAC/Deployment/data/Coordinates/data/rotation_matrices.dat
@@ -1,116 +1,82 @@
 #
 # station, type, station-pqr-to-etrs-matrix(9x float)
 #
-cs301, lba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
-cs301, hba0, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
-cs301, hba1, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
-cs024, lba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
-cs024, hba0, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
-cs024, hba1, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
-cs007, lba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
-cs007, hba0, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
-cs007, hba1, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
-rs406, lba , -0.1231490036, -0.7970634976, 0.5912056357, 0.9923766349, -0.0960342438, 0.0772401358, -0.0047893066, 0.5962107051, 0.8028137130
-rs406, hba , -0.1231490036, -0.7970634976, 0.5912056357, 0.9923766349, -0.0960342438, 0.0772401358, -0.0047893066, 0.5962107051, 0.8028137130
-pl611, lba , -0.2733681404, -0.7152432670, 0.6431927618, 0.9477993701, -0.0861761283, 0.3070016758, -0.1641530196, 0.6935421717, 0.7014649258
-pl611, hba , -0.2077537076, -0.7799441347, 0.5903605201, 0.9714761732, -0.0939716163, 0.2177231734, -0.1143347798, 0.6187539754, 0.7772200950
-rs205, lba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
-rs205, hba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
-cs201, lba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
-cs201, hba0, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
-cs201, hba1, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
-de604, lba , -0.1687911945, -0.7811027607, 0.6011555621, 0.9835959335, -0.0941112134, 0.1538899575, -0.0636283913, 0.6172694361, 0.7841746433
-de604, hba , -0.1687955875, -0.7811092351, 0.6011459161, 0.9835947185, -0.0941119935, 0.1538972464, -0.0636355199, 0.6172611243, 0.7841806074
-cs004, lba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
-cs004, hba0, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
-cs004, hba1, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
-cs021, lba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
-cs021, hba0, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
-cs021, hba1, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
+rs407, lba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
+rs407, hba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
+uk608, lba , -0.0635635542, -0.7765468618, 0.6268449936, 0.9955010195, -0.0935622956, -0.0149605152, 0.0702665977, 0.6230738867, 0.7790003447
+uk608, hba , -0.0638438351, -0.7759896972, 0.6275061391, 0.9955165671, -0.0934951656, -0.0143324330, 0.0697906108, 0.6237777199, 0.7784796894
 cs028, lba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
 cs028, hba0, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
 cs028, hba1, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
-cs002, lba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
-cs002, hba0, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
-cs002, hba1, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
-cs003, lba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
-cs003, hba0, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
-cs003, hba1, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
-rs407, lba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
-rs407, hba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
-rs306, lba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
-rs306, hba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
+cs032, lba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
+cs032, hba0, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
+cs032, hba1, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
+rs406, lba , -0.1231490036, -0.7970634976, 0.5912056357, 0.9923766349, -0.0960342438, 0.0772401358, -0.0047893066, 0.5962107051, 0.8028137130
+rs406, hba , -0.1231490036, -0.7970634976, 0.5912056357, 0.9923766349, -0.0960342438, 0.0772401358, -0.0047893066, 0.5962107051, 0.8028137130
+fr606, lba , -0.0821044514, -0.7312384111, 0.6771626431, 0.9957823947, -0.0881033042, 0.0255974649, 0.0409424168, 0.6764083041, 0.7353880096
+fr606, hba , -0.0822838356, -0.7309509762, 0.6774511354, 0.9957770021, -0.0880686726, 0.0259243331, 0.0407128056, 0.6767234142, 0.7351107999
 de605, lba , -0.1032226072, -0.7705364038, 0.6289823080, 0.9944515889, -0.0928381253, 0.0494683717, 0.0202763571, 0.6305987099, 0.7758441444
 de605, hba , -0.1032262224, -0.7705496189, 0.6289655251, 0.9944512868, -0.0928397175, 0.0494714567, 0.0202727695, 0.6305823274, 0.7758575534
-rs508, lba , -0.1190892356, -0.7957570796, 0.5937915663, 0.9928832966, -0.0958768399, 0.0706426986, 0.0007164314, 0.5979785128, 0.8015118121
-rs508, hba , -0.1190892356, -0.7957570796, 0.5937915663, 0.9928832966, -0.0958768399, 0.0706426986, 0.0007164314, 0.5979785128, 0.8015118121
-cs031, lba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
-cs031, hba0, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
-cs031, hba1, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
-cs001, lba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
-cs001, hba0, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
-cs001, hba1, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
-rs409, lba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
-rs409, hba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
-cs026, lba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
-cs026, hba0, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
-cs026, hba1, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
-FI609, lba , -0.1488161195, -0.9307614981, 0.3339712506, 0.9855896004, -0.1121428554, 0.1266377496, -0.0804170519, 0.3480043299, 0.9340375175
-FI609, hba , -0.1488182628, -0.9307082344, 0.3341187022, 0.9855919695, -0.1121364380, 0.1266249936, -0.0803840431, 0.3481488213, 0.9339865116
-cs302, lba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
-cs302, hba0, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
-cs302, hba1, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
-rs509, lba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
-rs509, hba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
-de602, lba , -0.1393102433, -0.7356454341, 0.6628864544, 0.9900056752, -0.0886342847, 0.1096937857, -0.0219412659, 0.6715428198, 0.7406408185
-de602, hba , -0.1529874576, -0.7445656232, 0.6497821716, 0.9874864006, -0.0897090342, 0.1297031138, -0.0382811487, 0.6614940075, 0.7489727844
 rs210, lba , -0.1188558802, -0.7877090479, 0.6044731058, 0.9929110100, -0.0949071723, 0.0715566554, 0.0010030083, 0.6086929313, 0.7934052618
 rs210, hba , -0.1188956411, -0.7880868315, 0.6039726588, 0.9929062998, -0.0949526896, 0.0715616282, 0.0009520516, 0.6081966235, 0.7937858407
-de601, lba , -0.1214634323, -0.7647321881, 0.6328271882, 0.9925955423, -0.0928219139, 0.0780991312, -0.0008509017, 0.6376274561, 0.7703442292
-de601, hba , -0.1198066951, -0.7659948264, 0.6315838092, 0.9927969403, -0.0919453659, 0.0768144370, -0.0007688588, 0.6362373579, 0.7714929904
-rs307, lba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
-rs307, hba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
-cs006, lba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
-cs006, hba0, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
-cs006, hba1, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
+cs002, lba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
+cs002, hba0, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
+cs002, hba1, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
+cs013, lba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
+cs013, hba0, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
+cs013, hba1, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
 rs208, lba , -0.1198462583, -0.7896526923, 0.6017354069, 0.9927924178, -0.0951413524, 0.0728789281, -0.0002991213, 0.6061326163, 0.7953635407
 rs208, hba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
+rs306, lba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
+rs306, hba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
 cs011, lba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
 cs011, hba0, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
 cs011, hba1, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
-cs017, lba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
-cs017, hba0, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
-cs017, hba1, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
-cs013, lba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
-cs013, hba0, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
-cs013, hba1, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
+ie613, lba , -0.0267332400, -0.8023484800, 0.5962568600, 0.9916264900, -0.0966710100, -0.0856249300, 0.1263417800, 0.5889750600, 0.7982143400
+ie613, hba , -0.0267332400, -0.8023484800, 0.5962568600, 0.9916264900, -0.0966710100, -0.0856249300, 0.1263417800, 0.5889750600, 0.7982143400
+cs101, lba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
+cs101, hba0, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
+cs101, hba1, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
+rs305, lba , -0.1195794394, -0.7921780051, 0.5984603294, 0.9928246344, -0.0954456149, 0.0720373503, 0.0000540097, 0.6027803438, 0.7979071715
+rs305, hba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
 se607, lba , -0.1434910187, -0.8356935828, 0.5301193858, 0.9889342437, -0.1006885919, 0.1089535179, -0.0376747812, 0.5398870652, 0.8408939099
 se607, hba , -0.1450609384, -0.8359350936, 0.5293107248, 0.9886054814, -0.1007176904, 0.1118711263, -0.0402060468, 0.5395076145, 0.8410202184
-cs005, lba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
-cs005, hba0, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
-cs005, hba1, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
-pl612, lba , -0.2051115812, -0.7972609600, 0.5677184170, 0.9716250122, -0.0960580350, 0.2161427527, -0.1177882629, 0.5959427956, 0.7943413054
-pl612, hba , -0.2337017009, -0.7970471740, 0.5568656188, 0.9594035259, -0.0960322770, 0.2651842309, -0.1578872684, 0.5962328439, 0.7871327755
-de603, lba , -0.1334809156, -0.7877259031, 0.6013906773, 0.9908835110, -0.0949092031, 0.0956143863, -0.0182404188, 0.6086708016, 0.7932131759
-de603, hba , -0.1334960861, -0.7876731599, 0.6014563893, 0.9908811597, -0.0949028483, 0.0956450562, -0.0182571191, 0.6087400452, 0.7931596529
-pl610, lba , -0.1841550080, -0.7902527719, 0.5844548653, 0.9790917169, -0.0952136531, 0.1797603133, -0.0864080031, 0.6053386794, 0.7912640142
-pl610, hba , -0.1841550080, -0.7902527719, 0.5844548653, 0.9790917169, -0.0952136531, 0.1797603133, -0.0864080031, 0.6053386794, 0.7912640142
+cs006, lba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
+cs006, hba0, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
+cs006, hba1, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
+cs030, lba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
+cs030, hba0, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
+cs030, hba1, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
+rs409, lba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
+rs409, hba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
+cs007, lba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
+cs007, hba0, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
+cs007, hba1, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
 de609, lba , -0.1384372791, -0.8008196430, 0.5826860382, 0.9900311803, -0.0964868032, 0.1026087664, -0.0259496026, 0.5910822245, 0.8061937869
 de609, hba , -0.1382553622, -0.8005307052, 0.5831260969, 0.9900638564, -0.0964519905, 0.1023258219, -0.0256712897, 0.5914791658, 0.8059115220
-uk608, lba , -0.0635635542, -0.7765468618, 0.6268449936, 0.9955010195, -0.0935622956, -0.0149605152, 0.0702665977, 0.6230738867, 0.7790003447
-uk608, hba , -0.0638438351, -0.7759896972, 0.6275061391, 0.9955165671, -0.0934951656, -0.0143324330, 0.0697906108, 0.6237777199, 0.7784796894
-fr606, lba , -0.0821044514, -0.7312384111, 0.6771626431, 0.9957823947, -0.0881033042, 0.0255974649, 0.0409424168, 0.6764083041, 0.7353880096
-fr606, hba , -0.0822838356, -0.7309509762, 0.6774511354, 0.9957770021, -0.0880686726, 0.0259243331, 0.0407128056, 0.6767234142, 0.7351107999
+rs205, lba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
+rs205, hba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
+cs024, lba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
+cs024, hba0, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
+cs024, hba1, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
+de604, lba , -0.1687911945, -0.7811027607, 0.6011555621, 0.9835959335, -0.0941112134, 0.1538899575, -0.0636283913, 0.6172694361, 0.7841746433
+de604, hba , -0.1687955875, -0.7811092351, 0.6011459161, 0.9835947185, -0.0941119935, 0.1538972464, -0.0636355199, 0.6172611243, 0.7841806074
+cs004, lba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
+cs004, hba0, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
+cs004, hba1, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
+cs026, lba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
+cs026, hba0, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
+cs026, hba1, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
 cs103, lba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
 cs103, hba0, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
 cs103, hba1, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
-cs101, lba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
-cs101, hba0, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
-cs101, hba1, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
-rs310, lba , -0.1151008123, -0.7902562310, 0.6018694978, 0.9933358105, -0.0952140698, 0.0649480442, 0.0059808478, 0.6053340980, 0.7959490305
-rs310, hba , -0.1149710136, -0.7902260105, 0.6019340000, 0.9933497978, -0.0952104287, 0.0647391200, 0.0061518565, 0.6053741212, 0.7959173300
-rs305, lba , -0.1195794394, -0.7921780051, 0.5984603294, 0.9928246344, -0.0954456149, 0.0720373503, 0.0000540097, 0.6027803438, 0.7979071715
-rs305, hba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
+pl610, lba , -0.1841550080, -0.7902527719, 0.5844548653, 0.9790917169, -0.0952136531, 0.1797603133, -0.0864080031, 0.6053386794, 0.7912640142
+pl610, hba , -0.1841550080, -0.7902527719, 0.5844548653, 0.9790917169, -0.0952136531, 0.1797603133, -0.0864080031, 0.6053386794, 0.7912640142
+cs001, lba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
+cs001, hba0, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
+cs001, hba1, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
+FI609, lba , -0.1488161195, -0.9307614981, 0.3339712506, 0.9855896004, -0.1121428554, 0.1266377496, -0.0804170519, 0.3480043299, 0.9340375175
+FI609, hba , -0.1488182628, -0.9307082344, 0.3341187022, 0.9855919695, -0.1121364380, 0.1266249936, -0.0803840431, 0.3481488213, 0.9339865116
 cs401, lba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
 cs401, hba0, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
 cs401, hba1, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
@@ -119,11 +85,47 @@ cs501, hba0, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.095418
 cs501, hba1, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
 rs503, lba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
 rs503, hba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
-cs030, lba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
-cs030, hba0, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
-cs030, hba1, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
+cs301, lba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
+cs301, hba0, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
+cs301, hba1, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
+cs021, lba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
+cs021, hba0, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
+cs021, hba1, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
+cs003, lba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
+cs003, hba0, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
+cs003, hba1, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
 rs106, lba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
 rs106, hba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
-cs032, lba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
-cs032, hba0, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
-cs032, hba1, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
+rs307, lba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
+rs307, hba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
+de602, lba , -0.1393102433, -0.7356454341, 0.6628864544, 0.9900056752, -0.0886342847, 0.1096937857, -0.0219412659, 0.6715428198, 0.7406408185
+de602, hba , -0.1529874576, -0.7445656232, 0.6497821716, 0.9874864006, -0.0897090342, 0.1297031138, -0.0382811487, 0.6614940075, 0.7489727844
+de601, lba , -0.1214634323, -0.7647321881, 0.6328271882, 0.9925955423, -0.0928219139, 0.0780991312, -0.0008509017, 0.6376274561, 0.7703442292
+de601, hba , -0.1198066951, -0.7659948264, 0.6315838092, 0.9927969403, -0.0919453659, 0.0768144370, -0.0007688588, 0.6362373579, 0.7714929904
+rs310, lba , -0.1151008123, -0.7902562310, 0.6018694978, 0.9933358105, -0.0952140698, 0.0649480442, 0.0059808478, 0.6053340980, 0.7959490305
+rs310, hba , -0.1149710136, -0.7902260105, 0.6019340000, 0.9933497978, -0.0952104287, 0.0647391200, 0.0061518565, 0.6053741212, 0.7959173300
+rs509, lba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
+rs509, hba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
+cs031, lba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
+cs031, hba0, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
+cs031, hba1, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
+pl612, lba , -0.2051115812, -0.7972609600, 0.5677184170, 0.9716250122, -0.0960580350, 0.2161427527, -0.1177882629, 0.5959427956, 0.7943413054
+pl612, hba , -0.2337017009, -0.7970471740, 0.5568656188, 0.9594035259, -0.0960322770, 0.2651842309, -0.1578872684, 0.5962328439, 0.7871327755
+cs302, lba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
+cs302, hba0, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
+cs302, hba1, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
+cs005, lba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
+cs005, hba0, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
+cs005, hba1, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
+cs017, lba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
+cs017, hba0, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
+cs017, hba1, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
+de603, lba , -0.1334809156, -0.7877259031, 0.6013906773, 0.9908835110, -0.0949092031, 0.0956143863, -0.0182404188, 0.6086708016, 0.7932131759
+de603, hba , -0.1334960861, -0.7876731599, 0.6014563893, 0.9908811597, -0.0949028483, 0.0956450562, -0.0182571191, 0.6087400452, 0.7931596529
+pl611, lba , -0.2733681404, -0.7152432670, 0.6431927618, 0.9477993701, -0.0861761283, 0.3070016758, -0.1641530196, 0.6935421717, 0.7014649258
+pl611, hba , -0.2077537076, -0.7799441347, 0.5903605201, 0.9714761732, -0.0939716163, 0.2177231734, -0.1143347798, 0.6187539754, 0.7772200950
+cs201, lba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
+cs201, hba0, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
+cs201, hba1, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
+rs508, lba , -0.1190892356, -0.7957570796, 0.5937915663, 0.9928832966, -0.0958768399, 0.0706426986, 0.0007164314, 0.5979785128, 0.8015118121
+rs508, hba , -0.1190892356, -0.7957570796, 0.5937915663, 0.9928832966, -0.0958768399, 0.0706426986, 0.0007164314, 0.5979785128, 0.8015118121
diff --git a/MAC/Deployment/data/Coordinates/make_all_station_file.py b/MAC/Deployment/data/Coordinates/make_all_station_file.py
index b3b27b84ebe9fdf22aee7cc3f2ac15631d914abd..9d0fb231848fb549cd16fb823ccca3a1329e0df6 100755
--- a/MAC/Deployment/data/Coordinates/make_all_station_file.py
+++ b/MAC/Deployment/data/Coordinates/make_all_station_file.py
@@ -52,7 +52,7 @@ def writeAntennaFieldHeader(frame):
     return
 
 ##
-## write normal vector to antennaField file, in blitz format
+## write normal vector
 ##
 def writeNormalVector(station, anttype):
     try:
@@ -71,7 +71,7 @@ def writeNormalVector(station, anttype):
     return
 
 ##
-## write rotation matrix to antennaField file, in blitz format
+## write rotation matrix
 ##
 def writeRotationMatrix(station, anttype):
     try:
@@ -95,7 +95,7 @@ def writeRotationMatrix(station, anttype):
     return
 
 ##
-## write antenna positions to antennaField file, in blitz format
+## write antenna positions
 ##
 def writeAntennaField(station, anttype, aPos):
 
@@ -190,11 +190,8 @@ if __name__ == '__main__':
              
         # do something with the data
         print 'Making %s-AntennaField.conf with LBA shape=%s  HBA shape=%s' %(station, np.shape(aPosL), np.shape(aPosH))
-         
         aRef = None
-        
-   
-        
+
         # write LBA information to AntennaPos.conf
         writeNormalVector(station, 'LBA')
         writeRotationMatrix(station, 'LBA')
@@ -211,7 +208,6 @@ if __name__ == '__main__':
         aOffset = aPosH - [[aRefH,aRefH]]
         writeAntennaField(station, '', aOffset)
         
-        
         # if core station add also information for HBA0 and HBA1 fields 
         if station[0] == 'C':
             # write information for HBA0
@@ -227,4 +223,3 @@ if __name__ == '__main__':
     db1.close()
     db2.close()
     sys.exit(0)
-
diff --git a/MAC/Deployment/data/Coordinates/make_conf_files.py b/MAC/Deployment/data/Coordinates/make_conf_files.py
index f70c9b5e6800ef9cc853ca634d8cf91b9b172a3e..e542a8aa14e210c1e92cc958a1ac25dd43574b46 100755
--- a/MAC/Deployment/data/Coordinates/make_conf_files.py
+++ b/MAC/Deployment/data/Coordinates/make_conf_files.py
@@ -32,16 +32,18 @@ def print_help():
 
 ##
 ## write hba deltas to a File
+## Use new-style Blitz format (Blits 0.11) for array sizes, e.g. (0,2) x (0,3)
+## For a 3 by 4 array
 ##
 def writeHBADeltas(station,deltas):
     filename = '../StaticMetaData/iHBADeltas/%s-iHBADeltas.conf' %(str(station).upper())
     f = open(filename,'w')
     f.write('#\n')
-    f.write('# HBADeltas for %s\n' %(str(station).upper()))
+    f.write('# iHBADeltas for %s\n' %(str(station).upper()))
     f.write('# Created: %s\n' %(datetime.now().strftime("%Y-%m-%d %H:%M:%S")))
     f.write('#\n')
     f.write('HBADeltas\n')
-    f.write('%d x %d [\n' %(np.shape(deltas)[0],np.shape(deltas)[1]))
+    f.write('(0,%d) x (0,%d) [\n' %(np.shape(deltas)[0]-1,np.shape(deltas)[1]-1))
     for i in range(np.shape(deltas)[0]):
         f.write('  ')
         for j in range(np.shape(deltas)[1]):
@@ -72,6 +74,8 @@ def writeAntennaFieldHeader(station,frame):
 
 ##
 ## write normal vector to antennaField file, in blitz format
+## Use new-style Blitz format (Blits 0.11) for array sizes, e.g. (0,2) x (0,3)
+## For a 3 by 4 array
 ##
 def writeNormalVector(station, anttype):
     try:
@@ -89,9 +93,9 @@ def writeNormalVector(station, anttype):
         Shape = np.shape(vector)
         Dims = len(Shape)
     
-        dataStr += str(Shape[0])
+        dataStr += '(0,' + str(Shape[0]-1) + ')'
         for dim in range(1,Dims):
-            dataStr += ' x ' + str(Shape[dim])
+            dataStr += ' x (0,' + str(Shape[dim]-1) + ')'
 
         dataStr += ' [ %10.6f %10.6f %10.6f ]\n' %(vector[0], vector[1], vector[2])
         
@@ -103,6 +107,8 @@ def writeNormalVector(station, anttype):
 
 ##
 ## write rotation matrix to antennaField file, in blitz format
+## Use new-style Blitz format (Blits 0.11) for array sizes, e.g. (0,2) x (0,3)
+## For a 3 by 4 array
 ##
 def writeRotationMatrix(station, anttype):
     try:
@@ -119,9 +125,9 @@ def writeRotationMatrix(station, anttype):
         Shape = np.shape(matrix)
         Dims = len(Shape)
     
-        dataStr += str(Shape[0])
+        dataStr +=  '(0,' + str(Shape[0]-1) + ')'
         for dim in range(1,Dims):
-            dataStr += ' x ' + str(Shape[dim])
+            dataStr += ' x (0,' + str(Shape[dim]-1) + ')'
 
         dataStr += ' [\n'    
         for row in range(Shape[0]):
@@ -137,6 +143,8 @@ def writeRotationMatrix(station, anttype):
 
 ##
 ## write antenna positions to antennaField file, in blitz format
+## Use new-style Blitz format (Blits 0.11) for array sizes, e.g. (0,2) x (0,3)
+## For a 3 by 4 array
 ##
 def writeAntennaField(station, anttype, aPos):
     dataStr = ''
@@ -148,9 +156,9 @@ def writeAntennaField(station, anttype, aPos):
     Shape = np.shape(aPos)
     Dims = len(Shape)
     
-    dataStr += str(Shape[0])
+    dataStr += '(0,' + str(Shape[0]-1) + ')'
     for dim in range(1,Dims):
-        dataStr += ' x ' + str(Shape[dim])
+        dataStr += ' x (0,' + str(Shape[dim]-1) + ')'
 
     if Dims == 1:
         dataStr += ' [ %10.9f %10.9f %10.3f ]\n' %\
diff --git a/MAC/Deployment/data/Coordinates/vectors-and-matrices/IE613/ie613-hba-solution.lisp b/MAC/Deployment/data/Coordinates/vectors-and-matrices/IE613/ie613-hba-solution.lisp
new file mode 100644
index 0000000000000000000000000000000000000000..4d4615ef8cf05ae55007e2258ceaf00fde18783e
--- /dev/null
+++ b/MAC/Deployment/data/Coordinates/vectors-and-matrices/IE613/ie613-hba-solution.lisp
@@ -0,0 +1,7 @@
+(normal-vector ( 0.59625686 -0.08562493  0.79821434))
+(reference-point :etrs ( 3801633.86880742  -529022.2680597   5076996.89167604)
+                 :station-pqr ( 0.  0.  0.))
+(station-pqr-to-etrs-matrix
+#2A((-0.02673324 -0.80234848  0.59625686)
+ ( 0.99162649 -0.09667101 -0.08562493)
+ ( 0.12634178  0.58897506  0.79821434)))
diff --git a/MAC/Deployment/data/Coordinates/vectors-and-matrices/IE613/ie613-lba-solution.lisp b/MAC/Deployment/data/Coordinates/vectors-and-matrices/IE613/ie613-lba-solution.lisp
new file mode 100644
index 0000000000000000000000000000000000000000..4d4615ef8cf05ae55007e2258ceaf00fde18783e
--- /dev/null
+++ b/MAC/Deployment/data/Coordinates/vectors-and-matrices/IE613/ie613-lba-solution.lisp
@@ -0,0 +1,7 @@
+(normal-vector ( 0.59625686 -0.08562493  0.79821434))
+(reference-point :etrs ( 3801633.86880742  -529022.2680597   5076996.89167604)
+                 :station-pqr ( 0.  0.  0.))
+(station-pqr-to-etrs-matrix
+#2A((-0.02673324 -0.80234848  0.59625686)
+ ( 0.99162649 -0.09667101 -0.08562493)
+ ( 0.12634178  0.58897506  0.79821434)))
diff --git a/MAC/Deployment/data/PVSS/CMakeLists.txt b/MAC/Deployment/data/PVSS/CMakeLists.txt
index 094c8224339927bd189ac95070ec748b8864f066..8f2bcbc404f062167be4eb607e8b1ff53ac3b4a5 100644
--- a/MAC/Deployment/data/PVSS/CMakeLists.txt
+++ b/MAC/Deployment/data/PVSS/CMakeLists.txt
@@ -1,6 +1,6 @@
 # $Id$
 
-lofar_package(PVSS_Datapoints 1.0)
+lofar_package(WinCC_Datapoints 1.0)
 
 add_subdirectory(bin)
 add_subdirectory(data)
diff --git a/MAC/Deployment/data/PVSS/License/471_3031_Astron_Station_4.log b/MAC/Deployment/data/PVSS/License/471_3031_Astron_Station_4.log
index d1a47497cc7372c07f18b20e8213c5d6b1082a56..c9ac0df930da1bc2729993ea1291e88e5aef7fdf 100644
--- a/MAC/Deployment/data/PVSS/License/471_3031_Astron_Station_4.log
+++ b/MAC/Deployment/data/PVSS/License/471_3031_Astron_Station_4.log
@@ -60,3 +60,34 @@ pararemote  = 0
 ctrlext     = 1
 update      = 0
 
+
+---------------------------------------------------
+[license]
+code        = "IE613C 10255475959"
+version     = 31400002
+sn          = "471_3031_Astron_Station_4/3"
+date        = 2017.07.21;13:01:07,000 
+comment     = "International Station IE613"
+expire      = 0000.00.00;00:00:00,000 
+redundancy  = 0
+ui          = 2
+para        = 1
+dde         = 5
+event       = 1
+ios         = 4000
+ssi         = 0
+api         = 80
+excelreport = 5
+http        = 0
+infoserver  = 1000
+comcenter   = 5
+maintenance = 1
+scheduler   = 1
+recipe      = 1
+distributed = 255
+uifix       = 0
+parafix     = 0
+pararemote  = 0
+ctrlext     = 1
+update      = 0
+
diff --git a/MAC/Deployment/data/PVSS/License/Astron_Station_1_shield.txt b/MAC/Deployment/data/PVSS/License/Astron_Station_1_shield.txt
index babc43262cf7a1638711fb66a2044d985d1e8780..b8caed0a55141d7c534465f51d82e4d8432a232c 100644
--- a/MAC/Deployment/data/PVSS/License/Astron_Station_1_shield.txt
+++ b/MAC/Deployment/data/PVSS/License/Astron_Station_1_shield.txt
@@ -1,5 +1,5 @@
 [license]
-code        = "dongleHost 20421942958"
+code        = "dongleHost 10063956859"
 version     = 31500002
 sn          = "471_3031_Astron_Station_4"
 expire      = 0000.00.00;00:00:00,000 
@@ -28,5 +28,5 @@ pararemote  = 0
 ctrlext     = 1
 update      = 0
 licenseMax  = 100
-licenseLeft = 98
+licenseLeft = 97
 
diff --git a/MAC/Deployment/data/PVSS/License/IE613C-NewLCU_option.txt b/MAC/Deployment/data/PVSS/License/IE613C-NewLCU_option.txt
new file mode 100644
index 0000000000000000000000000000000000000000..fbdeae5410a8986a3acbc698e63fae4998137e00
--- /dev/null
+++ b/MAC/Deployment/data/PVSS/License/IE613C-NewLCU_option.txt
@@ -0,0 +1,29 @@
+[license]
+code        = "IE613C 20366292679"
+version     = 31400002
+comment       = "International Station IE613"
+sn            = "471_3031_2_Astron_Gen_II_1_38"
+expire        = 0000.00.00;00:00:00,000
+redundancy    = 0
+ui            = 2
+para          = 1
+dde           = 5
+event         = 1
+api           = 80
+excelreport   = 5
+http          = 0
+infoserver    = 1000
+ios           = 4000
+comcenter     = 5
+maintenance   = 1
+scheduler     = 1
+ssi           = 0
+recipe        = 1
+distributed   = 255
+uifix         = 0
+parafix       = 0
+pararemote    = 0
+ctrlext       = 1
+update        = 0
+
+
diff --git a/MAC/Deployment/data/PVSS/License/Readme.txt b/MAC/Deployment/data/PVSS/License/Readme.txt
index 0a8ed1c11bbc3a396c22f54eab14cd634bd15204..ee6bfc7fd8fa6a7d720c9742bb9731f5c00c5396 100644
--- a/MAC/Deployment/data/PVSS/License/Readme.txt
+++ b/MAC/Deployment/data/PVSS/License/Readme.txt
@@ -1,3 +1,3 @@
 Example command:
 
-PVSStoolLicense.exe -shield Astron_Station_1_shield.txt CCU001_option.txt > shield.CCU001.txt
\ No newline at end of file
+WCCILtoolLicense.exe -shield Astron_Station_1_shield.txt CCU001_option.txt > shield.CCU001.txt
\ No newline at end of file
diff --git a/MAC/Deployment/data/PVSS/License/shield.IE613C-NewLCU.txt b/MAC/Deployment/data/PVSS/License/shield.IE613C-NewLCU.txt
new file mode 100644
index 0000000000000000000000000000000000000000..c6e6f9215e44e498dbedc5136243b1b821cc0332
--- /dev/null
+++ b/MAC/Deployment/data/PVSS/License/shield.IE613C-NewLCU.txt
@@ -0,0 +1,29 @@
+[license]
+code        = "IE613C 10255475959"
+version     = 31400002
+sn          = "471_3031_Astron_Station_4/3"
+date        = 2017.07.21;13:01:07,000 
+comment     = "International Station IE613"
+expire      = 0000.00.00;00:00:00,000 
+redundancy  = 0
+ui          = 2
+para        = 1
+dde         = 5
+event       = 1
+ios         = 4000
+ssi         = 0
+api         = 80
+excelreport = 5
+http        = 0
+infoserver  = 1000
+comcenter   = 5
+maintenance = 1
+scheduler   = 1
+recipe      = 1
+distributed = 255
+uifix       = 0
+parafix     = 0
+pararemote  = 0
+ctrlext     = 1
+update      = 0
+
diff --git a/MAC/Deployment/data/PVSS/data/MCUbase.dpdef b/MAC/Deployment/data/PVSS/data/MCUbase.dpdef
index 5ce376b8362aaf3a9393ffcad8d9bbc9e582f012..6f9e08773f7ade48cebf1a976417580151700ac6 100644
--- a/MAC/Deployment/data/PVSS/data/MCUbase.dpdef
+++ b/MAC/Deployment/data/PVSS/data/MCUbase.dpdef
@@ -5,15 +5,9 @@
 TypeName
 Navigator.Navigator	1#
 	alarms	1#
-		time	10#
-		message	9#
-		datapoint	9#
-		state	5#
-		status	9#
 		dpResetList	9#
 		dpResetStates	5#
 		dpResetMsgs	9#
-		rereadAlarms	23#
 	alarmSettings	1#
 		emails	9#
 		
diff --git a/MAC/Deployment/data/PVSS/data/PVSSDataPoints.base b/MAC/Deployment/data/PVSS/data/PVSSDataPoints.base
index 5ba2a2c379d56b821e60fd00e6e62939d07a4bc0..96495c152a65a0d64c89a30c6bea26ba89347a83 100644
--- a/MAC/Deployment/data/PVSS/data/PVSSDataPoints.base
+++ b/MAC/Deployment/data/PVSS/data/PVSSDataPoints.base
@@ -32,8 +32,10 @@ Station				-		M	Y	LOFAR_PermSW_@ring@_@station@
 Cluster				-		M	N	LOFAR_PermSW_@cluster@
 Node				-		M	Y	LOFAR_PermSW_@cluster@_@node@
 Daemons				-		M	N	LOFAR_PermSW_Daemons
-PVSS00pmon			-		M	Y	LOFAR_PermSW_Daemons_PVSS00pmon		#obsolete in 3.14
-WCCILpmon			-		M	Y	LOFAR_PermSW_Daemons_WCCILpmon		#replacement for the PVSSpmon in 3.14
+#obsolete in 3.14
+#PVSS00pmon			-		M	Y	LOFAR_PermSW_Daemons_PVSS00pmon
+#replacement for the PVSSpmon in 3.14
+WCCILpmon			-		M	Y	LOFAR_PermSW_Daemons_WCCILpmon
 LogProcessor			-		M	Y	LOFAR_PermSW_Daemons_LogProcessor
 ServiceBroker			- 		M	Y	LOFAR_PermSW_Daemons_ServiceBroker
 SASGateway			-		M	Y	LOFAR_PermSW_Daemons_SASGateway
@@ -57,8 +59,10 @@ StorageHost			SHST		C	Y	LOFAR_PIC_@storagehost@
 CEPPermSW			-		C	N	LOFAR_PermSW
 CEPHardwareMonitor		CHM		C	Y	LOFAR_PermSW_CEPHardwareMonitor
 Daemons				-		C	N	LOFAR_PermSW_Daemons
-PVSS00pmon			-		C	Y	LOFAR_PermSW_Daemons_PVSS00pmon		#obsolete in 3.14
-WCCILpmon			-		C	Y	LOFAR_PermSW_Daemons_WCCILpmon		#replacement for the PVSSpmon in 3.14
+#obsolete in 3.14
+#PVSS00pmon			-		C	Y	LOFAR_PermSW_Daemons_PVSS00pmon
+#replacement for the PVSSpmon in 3.14
+WCCILpmon			-		C	Y	LOFAR_PermSW_Daemons_WCCILpmon
 LogProcessor			-		C	Y	LOFAR_PermSW_Daemons_LogProcessor
 ServiceBroker			- 		C	Y	LOFAR_PermSW_Daemons_ServiceBroker
 SoftwareMonitor			-		C	Y	LOFAR_PermSW_Daemons_SoftwareMonitor
@@ -99,8 +103,10 @@ StnPermSW			-		S	N	LOFAR_PermSW
 Cluster				-		S	N	LOFAR_PermSW_@cluster@
 Node				-		S	Y	LOFAR_PermSW_@cluster@_@node@
 Daemons				-		S	N	LOFAR_PermSW_Daemons
-PVSS00pmon			-		S	Y	LOFAR_PermSW_Daemons_PVSS00pmon		#obsolete in 3.14
-WCCILpmon			-		S	Y	LOFAR_PermSW_Daemons_WCCILpmon		#replacement for the PVSSpmon in 3.14
+#obsolete in 3.14
+#PVSS00pmon			-		S	Y	LOFAR_PermSW_Daemons_PVSS00pmon
+#replacement for the PVSSpmon in 3.14
+WCCILpmon			-		S	Y	LOFAR_PermSW_Daemons_WCCILpmon
 LogProcessor			LGP		S	Y	LOFAR_PermSW_Daemons_LogProcessor
 ServiceBroker			- 		S	Y	LOFAR_PermSW_Daemons_ServiceBroker
 SASGateway			SGW		S	Y	LOFAR_PermSW_Daemons_SASGateway
diff --git a/MAC/Deployment/data/PVSS/data/PVSSbase.dpdef b/MAC/Deployment/data/PVSS/data/PVSSbase.dpdef
index 8e993521a048204c9a36e9b51851fe72a67a0a7c..07258387fa93097c288c09b7df756ca6c205293e 100644
--- a/MAC/Deployment/data/PVSS/data/PVSSbase.dpdef
+++ b/MAC/Deployment/data/PVSS/data/PVSSbase.dpdef
@@ -124,15 +124,15 @@ ScriptInfo.ScriptInfo	1#
 TypeName
 ExampleDP_Bit.ExampleDP_Bit	23#
 
-DpName	TypeName	ID
+DpName	TypeName
 LOFAR_AlertClass_Off	_AlertClass
 LOFAR_AlertClass_Operational	_AlertClass
 LOFAR_AlertClass_Maintenance	_AlertClass
 LOFAR_AlertClass_Test	_AlertClass
 LOFAR_AlertClass_Suspicious	_AlertClass
 LOFAR_AlertClass_Broken	_AlertClass
-LOFAR_AlertClass_Beyond_Repair	_AlertClass
 LOFAR_AlertClass_DpOffline	_AlertClass
+LOFAR_AlertClass_Beyond_Repair	_AlertClass
 
 
 # create mp for ProcessStatus and attach an archive
@@ -176,8 +176,8 @@ _ValueArchive_2.size.maxValuesSet	_ValueArchive	1250
 _ValueArchive_2.size.maxValuesGet	_ValueArchive	1250
 _SNMP.Active	_PollGroup	1
 _SNMP.PollInterval	_PollGroup	20000
-_dt_ObjectStatus.Leaf	_DynamicDatapoints	"_mp_ObjectStatus.state:_alert_hdl", "_mp_ObjectStatus.childSumAlert:_alert_hdl"
-_dt_ObjectStatus.DynamicAttribute	_DynamicDatapoints	"_da_none", "_da_alert_hdl_sum"
+_dt_ObjectStatus.Leaf	_DynamicDatapoints	"_mp_ObjectStatus.state:_alert_hdl", "_mp_ObjectStatus.childSumAlert:_alert_hdl"	0x101	20.06.2016 08:46:58.057
+_dt_ObjectStatus.DynamicAttribute	_DynamicDatapoints	"_da_none", "_da_alert_hdl_sum"	0x101	20.06.2016 08:46:58.057
 
 # AlertClass
 ElementName	TypeName	_alert_class.._type	_alert_class.._prior	_alert_class.._abbr	_alert_class.._archive	_alert_class.._ack_type	_alert_class.._single_ack	_alert_class.._inact_ack	_alert_class.._color_none	_alert_class.._fore_color_none	_alert_class.._font_style_none	_alert_class.._color_c_nack	_alert_class.._fore_color_c_nack	_alert_class.._font_style_c_nack	_alert_class.._color_c_ack	_alert_class.._fore_color_c_ack	_alert_class.._font_style_c_ack	_alert_class.._color_g_nack	_alert_class.._fore_color_g_nack	_alert_class.._font_style_g_nack	_alert_class.._color_c_g_nack	_alert_class.._fore_color_c_g_nack	_alert_class.._font_style_c_g_nack	_alert_class.._ctrl_none	_alert_class.._ctrl_c_nack	_alert_class.._ctrl_c_ack	_alert_class.._ctrl_g_nack	_alert_class.._ctrl_c_g_nack	_alert_class.._arg_list	_alert_class.._perm
@@ -187,8 +187,8 @@ LOFAR_AlertClass_Maintenance.	_AlertClass	14	\20	lt:1 LANG:1 ""	1	1	0	0	""	""	""
 LOFAR_AlertClass_Test.	_AlertClass	14	\30	lt:1 LANG:1 ""	1	1	0	0	""	""	""	""	""	""	"Lofar_test"	""	""	""	""	""	""	""	""	""	""	""	""	""		\0
 LOFAR_AlertClass_Suspicious.	_AlertClass	14	\40	lt:1 LANG:1 ""	1	3	0	0	""	""	""	"Lofar_suspicious_came"	""	""	"Lofar_suspicious"	""	""	"Lofar_suspicious_went"	""	""	""	""	""	""	""	""	""	""		\0
 LOFAR_AlertClass_Broken.	_AlertClass	14	\50	lt:1 LANG:1 ""	1	3	0	0	""	""	""	"Lofar_broken_came"	""	""	"Lofar_broken"	""	""	"Lofar_broken_went"	""	""	""	""	""	""	""	""	""	""		\0
-LOFAR_AlertClass_Beyond_Repair.	_AlertClass	14	\60	lt:1 LANG:1 ""	1	1	0	0	""	""	""	""	""	""	"Lofar_beyond_repair"	""	""	""	""	""	""	""	""	""	""	""	""	""		\0
 LOFAR_AlertClass_DpOffline.	_AlertClass	14	\70	lt:1 LANG:1 ""	1	1	0	0	""	""	""	""	""	""	"Lofar_dpOffline"	""	""	""	""	""	""	""	""	""	""	""	""	""		\0
+LOFAR_AlertClass_Beyond_Repair.	_AlertClass	14	\60	lt:1 LANG:1 ""	1	1	0	0	""	""	""	""	""	""	"Lofar_beyond_repair"	""	""	""	""	""	""	""	""	""	""	""	""	""		\0
 
 # AlertValue
 ElementName	TypeName	DetailNr	_alert_hdl.._type	_alert_hdl.._l_limit	_alert_hdl.._u_limit	_alert_hdl.._l_incl	_alert_hdl.._u_incl	_alert_hdl.._panel	_alert_hdl.._panel_param	_alert_hdl.._help	_alert_hdl.._min_prio	_alert_hdl.._class	_alert_hdl.._text	_alert_hdl.._active	_alert_hdl.._orig_hdl	_alert_hdl.._ok_range	_alert_hdl.._hyst_type	_alert_hdl.._hyst_time	_alert_hdl.._multi_instance	_alert_hdl.._l_hyst_limit	_alert_hdl.._u_hyst_limit	_alert_hdl.._text1	_alert_hdl.._text0	_alert_hdl.._ack_has_prio	_alert_hdl.._order	_alert_hdl.._dp_pattern	_alert_hdl.._dp_list	_alert_hdl.._prio_pattern	_alert_hdl.._abbr_pattern	_alert_hdl.._ack_deletes	_alert_hdl.._non_ack	_alert_hdl.._came_ack	_alert_hdl.._pair_ack	_alert_hdl.._both_ack	_alert_hdl.._impulse	_alert_hdl.._filter_threshold	_alert_hdl.._went_text	_alert_hdl.._add_text	_alert_hdl.._status64_pattern	_alert_hdl.._neg	_alert_hdl.._status64_match	_alert_hdl.._match	_alert_hdl.._set
@@ -201,6 +201,6 @@ _mp_ObjectStatus.state	ObjectStatus	5	5									LOFAR_AlertClass_Test.	lt:1 LANG
 _mp_ObjectStatus.state	ObjectStatus	6	5									LOFAR_AlertClass_Suspicious.	lt:1 LANG:1 "Suspicious"				0	01.01.1970 00:00:00.000																			lt:1 LANG:1 ""		0x0	0	""	"40"	
 _mp_ObjectStatus.state	ObjectStatus	7	5									LOFAR_AlertClass_Broken.	lt:1 LANG:1 "Broken"				0	01.01.1970 00:00:00.000																			lt:1 LANG:1 ""		0x0	0	""	"50"	
 _mp_ObjectStatus.state	ObjectStatus	8	5									LOFAR_AlertClass_Beyond_Repair.	lt:1 LANG:1 "Beyond_Repair"				0	01.01.1970 00:00:00.000																			lt:1 LANG:1 ""		0x0	0	""	"60"	
-_mp_ObjectStatus.state	ObjectStatus	9	5									LOFAR_AlertClass_Off.	lt:1 LANG:1 "DP Offline"				0	01.01.1970 00:00:00.000																			lt:1 LANG:1 ""		0x0	0	""	"70"	
+_mp_ObjectStatus.state	ObjectStatus	9	5									LOFAR_AlertClass_DpOffline.	lt:1 LANG:1 "DP Offline"				0	01.01.1970 00:00:00.000																			lt:1 LANG:1 ""		0x0	0	""	"70"	
 _mp_ObjectStatus.childSumAlert	ObjectStatus		59					""		lt:1 LANG:1 ""				1								lt:1 LANG:1 ""	lt:1 LANG:1 ""	1	0	""	DummyBit.	""	""	1	1	1	1	1		0							
 
diff --git a/MAC/Deployment/data/PVSS/data/Stationbase.dpdef b/MAC/Deployment/data/PVSS/data/Stationbase.dpdef
index bb7ab9a69ca1813018307f146fa6bc30fb682558..557640c7addb5562e4aa70c433d5f8c6494a83f5 100644
--- a/MAC/Deployment/data/PVSS/data/Stationbase.dpdef
+++ b/MAC/Deployment/data/PVSS/data/Stationbase.dpdef
@@ -3,15 +3,9 @@
 TypeName
 Navigator.Navigator	1#
 	alarms	1#
-		time	10#
-		message	9#
-		datapoint	9#
-		state	5#
-		status	9#
 		dpResetList	9#
 		dpResetStates	5#
 		dpResetMsgs	9#
-		rereadAlarms	23#
 	alarmSettings	1#
 		emails	9#
 		
diff --git a/MAC/Deployment/data/StaticMetaData/AntennaFields/IE613-AntennaField.conf b/MAC/Deployment/data/StaticMetaData/AntennaFields/IE613-AntennaField.conf
new file mode 100644
index 0000000000000000000000000000000000000000..60f3d86c8d840ff3d583747a8ad6d746348c6604
--- /dev/null
+++ b/MAC/Deployment/data/StaticMetaData/AntennaFields/IE613-AntennaField.conf
@@ -0,0 +1,227 @@
+#
+# AntennaPositions for IE613
+# ITRF2005 target_date = 2015.5
+# Created: 2017-07-11 14:36:00
+#
+
+NORMAL_VECTOR LBA
+(0,2) [   0.596257  -0.085625   0.798214 ]
+
+ROTATION_MATRIX LBA
+(0,2) x (0,2) [
+ -0.0267330000  -0.8023480000   0.5962570000 
+  0.9916260000  -0.0966710000  -0.0856250000 
+  0.1263420000   0.5889750000   0.7982140000 
+]
+
+LBA
+(0,2) [ 3801633.528060000 -529021.899396000 5076997.185 ]
+(0,95) x (0,1) x (0,2) [
+ -9.760250  -7.876262   6.445900    -9.760250  -7.876262   6.445900 
+-10.664460   0.134739   7.980670   -10.664460   0.134739   7.980670 
+-12.417900  -6.096347   8.622060   -12.417900  -6.096347   8.622060 
+-13.325980   0.714403  10.030970   -13.325980   0.714403  10.030970 
+ 12.437190  14.994599  -7.681970    12.437190  14.994599  -7.681970 
+ 11.169440  21.023836  -6.088220    11.169440  21.023836  -6.088220 
+ 18.977830  13.845680 -12.691000    18.977830  13.845680 -12.691000 
+ 18.877250  18.770990 -12.087520    18.877250  18.770990 -12.087520 
+-14.165920 -11.065313   9.394790   -14.165920 -11.065313   9.394790 
+-14.927220 -18.029444   9.216420   -14.927220 -18.029444   9.216420 
+-18.138840 -18.751660  11.537990   -18.138840 -18.751660  11.537990 
+-20.102570 -15.569965  13.346180   -20.102570 -15.569965  13.346180 
+  3.041490   3.658406  -1.879530     3.041490   3.658406  -1.879530 
+ -1.521910   3.991014   1.564960    -1.521910   3.991014   1.564960 
+ -1.747140   7.359291   2.094520    -1.747140   7.359291   2.094520 
+  1.734910   9.694903  -0.255990     1.734910   9.694903  -0.255990 
+ -4.107040   9.142251   4.048590    -4.107040   9.142251   4.048590 
+ -7.834180   6.910419   6.593320    -7.834180   6.910419   6.593320 
+ -6.589270  15.492740   6.584010    -6.589270  15.492740   6.584010 
+-10.243230  14.099428   9.164010   -10.243230  14.099428   9.164010 
+ 10.357610 -15.983814  -9.451610    10.357610 -15.983814  -9.451610 
+  5.272620 -22.758565  -6.379920     5.272620 -22.758565  -6.379920 
+ 14.739190 -23.128162 -13.490980    14.739190 -23.128162 -13.490980 
+  5.753780 -28.423950  -7.347060     5.753780 -28.423950  -7.347060 
+ -4.754830 -12.034524   2.260850    -4.754830 -12.034524   2.260850 
+ -7.991510 -13.260167   4.547130    -7.991510 -13.260167   4.547130 
+ -3.586980 -15.940854   0.969440    -3.586980 -15.940854   0.969440 
+ -4.050330 -19.983035   0.881950    -4.050330 -19.983035   0.881950 
+ 16.424320  -1.822425 -12.464280    16.424320  -1.822425 -12.464280 
+ 19.464880  -0.577631 -14.602010    19.464880  -0.577631 -14.602010 
+ 18.140890 -10.436916 -14.670620    18.140890 -10.436916 -14.670620 
+ 22.772040  -8.415510 -17.913190    22.772040  -8.415510 -17.913190 
+ -5.698320  19.289975   6.325820    -5.698320  19.289975   6.325820 
+ -1.348830  23.338769   3.511110    -1.348830  23.338769   3.511110 
+ -2.978770  32.860055   5.750010    -2.978770  32.860055   5.750010 
+ -7.579790  29.452478   8.821390    -7.579790  29.452478   8.821390 
+  5.857810   0.471990  -4.325090     5.857810   0.471990  -4.325090 
+  6.716590   6.148597  -4.357660     6.716590   6.148597  -4.357660 
+  9.034430   0.103616  -6.737510     9.034430   0.103616  -6.737510 
+ 10.205870   3.588440  -7.238740    10.205870   3.588440  -7.238740 
+-20.372140  -1.808883  15.023700   -20.372140  -1.808883  15.023700 
+-17.959370   7.942819  14.267460   -17.959370   7.942819  14.267460 
+-24.653560   3.769704  18.820290   -24.653560   3.769704  18.820290 
+-21.061980  13.538086  17.185280   -21.061980  13.538086  17.185280 
+  3.655850  -5.604217  -3.332050     3.655850  -5.604217  -3.332050 
+  6.767160  -6.416204  -5.743270     6.767160  -6.416204  -5.743270 
+  1.966380 -10.027916  -2.544570     1.966380 -10.027916  -2.544570 
+  6.132320 -10.546696  -5.712130     6.132320 -10.546696  -5.712130 
+  7.051980  16.221048  -3.527720     7.051980  16.221048  -3.527720 
+ 13.624540 -10.326460 -11.285100    13.624540 -10.326460 -11.285100 
+ 11.553400  25.980664  -5.843310    11.553400  25.980664  -5.843310 
+  1.211390  22.127111   1.468680     1.211390  22.127111   1.468680 
+ -2.056200 -24.978655  -1.143520    -2.056200 -24.978655  -1.143520 
+ 19.711750 -18.214389 -16.678320    19.711750 -18.214389 -16.678320 
+  3.838120  29.137920   0.258600     3.838120  29.137920   0.258600 
+  4.033600   6.897782  -2.273140     4.033600   6.897782  -2.273140 
+-22.997920  -8.078418  16.312590   -22.997920  -8.078418  16.312590 
+  1.748400 -19.678333  -3.416950     1.748400 -19.678333  -3.416950 
+-10.441300 -15.936000   6.090060   -10.441300 -15.936000   6.090060 
+ 24.867380   1.137775 -18.453600    24.867380   1.137775 -18.453600 
+ 12.127690  -6.816918  -9.790510    12.127690  -6.816918  -9.790510 
+  3.472580 -16.362692  -4.349220     3.472580 -16.362692  -4.349220 
+-14.779600   6.502378  11.737690   -14.779600   6.502378  11.737690 
+ -4.913100   2.465211   3.934460    -4.913100   2.465211   3.934460 
+  9.066050  11.022894  -5.589820     9.066050  11.022894  -5.589820 
+ -5.160000  -4.469774   3.374980    -5.160000  -4.469774   3.374980 
+ 18.611010   4.999073 -13.365960    18.611010   4.999073 -13.365960 
+ 13.008500   1.446955  -9.561990    13.008500   1.446955  -9.561990 
+ -8.272300 -21.864609   3.833880    -8.272300 -21.864609   3.833880 
+-10.956930 -22.338289   5.788460   -10.956930 -22.338289   5.788460 
+ -0.831240  -4.638645   0.123330    -0.831240  -4.638645   0.123330 
+-16.595550  -2.098006  12.171620   -16.595550  -2.098006  12.171620 
+  9.468280  -4.673100  -7.573990     9.468280  -4.673100  -7.573990 
+  0.762360  17.016200   1.255850     0.762360  17.016200   1.255850 
+ 11.493400   9.395298  -7.577610    11.493400   9.395298  -7.577610 
+  6.459050  27.824143  -1.840140     6.459050  27.824143  -1.840140 
+ -3.728990  -8.583160   1.864780    -3.728990  -8.583160   1.864780 
+  9.427160 -10.910775  -8.212390     9.427160 -10.910775  -8.212390 
+-16.977920  -9.800423  11.631010   -16.977920  -9.800423  11.631010 
+-14.808860  15.559924  12.731160   -14.808860  15.559924  12.731160 
+-10.976950   9.367078   9.204450   -10.976950   9.367078   9.204450 
+  7.541920  20.531061  -3.431360     7.541920  20.531061  -3.431360 
+ -3.999710  13.581258   4.444600    -3.999710  13.581258   4.444600 
+ -3.659390  -1.251703   2.599250    -3.659390  -1.251703   2.599250 
+ 14.364400 -18.033937 -12.664560    14.364400 -18.033937 -12.664560 
+  3.767880  -2.056027  -3.035120     3.767880  -2.056027  -3.035120 
+ 24.433380  11.891518 -16.975850    24.433380  11.891518 -16.975850 
+ 17.422500   7.969748 -12.159490    17.422500   7.969748 -12.159490 
+ -7.450270   3.538379   5.944820    -7.450270   3.538379   5.944820 
+-16.231710  22.953311  14.587100   -16.231710  22.953311  14.587100 
+ -7.937500  -5.022292   5.390470    -7.937500  -5.022292   5.390470 
+ -0.198450 -27.095698  -2.758340    -0.198450 -27.095698  -2.758340 
+ -9.498550  20.425850   9.286390    -9.498550  20.425850   9.286390 
+ -0.897360  -8.097738  -0.198340    -0.897360  -8.097738  -0.198340 
+  0.813230 -13.295648  -2.033710     0.813230 -13.295648  -2.033710 
+  2.078570  13.100883  -0.147340     2.078570  13.100883  -0.147340 
+]
+
+NORMAL_VECTOR HBA
+(0,2) [   0.596257  -0.085625   0.798214 ]
+
+ROTATION_MATRIX HBA
+(0,2) x (0,2) [
+ -0.0267330000  -0.8023480000   0.5962570000 
+  0.9916260000  -0.0966710000  -0.0856250000 
+  0.1263420000   0.5889750000   0.7982140000 
+]
+
+HBA
+(0,2) [ 3801691.943300000 -528983.966429000 5076957.924 ]
+(0,95) x (0,1) x (0,2) [
+-11.012710  23.071660  10.749460   -11.012710  23.071660  10.749460 
+ -6.915650  24.101365   7.803410    -6.915650  24.101365   7.803410 
+ -2.818570  25.130078   4.857230    -2.818570  25.130078   4.857230 
+  1.277720  26.158694   1.911640     1.277720  26.158694   1.911640 
+  5.374780  27.188399  -1.034410     5.374780  27.188399  -1.034410 
+-14.545460  17.016786  12.723710   -14.545460  17.016786  12.723710 
+-10.449210  18.046394   9.778250   -10.449210  18.046394   9.778250 
+ -6.352120  19.075108   6.832070    -6.352120  19.075108   6.832070 
+ -2.255030  20.103821   3.885890    -2.255030  20.103821   3.885890 
+  1.842030  21.133525   0.939840     1.842030  21.133525   0.939840 
+  5.938310  22.162142  -2.005750     5.938310  22.162142  -2.005750 
+ 10.035400  23.190855  -4.951920    10.035400  23.190855  -4.951920 
+-18.079020  10.961816  14.698550   -18.079020  10.961816  14.698550 
+-13.981960  11.991520  11.752500   -13.981960  11.991520  11.752500 
+ -9.884870  13.020233   8.806320    -9.884870  13.020233   8.806320 
+ -5.788590  14.048850   5.860730    -5.788590  14.048850   5.860730 
+ -1.691500  15.077563   2.914550    -1.691500  15.077563   2.914550 
+  2.405560  16.107269  -0.031490     2.405560  16.107269  -0.031490 
+  6.502650  17.135981  -2.977670     6.502650  17.135981  -2.977670 
+ 10.599730  18.164694  -5.923850    10.599730  18.164694  -5.923850 
+ 14.695990  19.194303  -8.869310    14.695990  19.194303  -8.869310 
+-21.611770   4.906942  16.672800   -21.611770   4.906942  16.672800 
+-17.515490   5.935559  13.727210   -17.515490   5.935559  13.727210 
+-13.418420   6.965263  10.781160   -13.418420   6.965263  10.781160 
+ -9.321340   7.993976   7.834980    -9.321340   7.993976   7.834980 
+ -5.224250   9.022690   4.888810    -5.224250   9.022690   4.888810 
+ -1.127190  10.052394   1.942760    -1.127190  10.052394   1.942760 
+  2.969090  11.081011  -1.002830     2.969090  11.081011  -1.002830 
+  7.066180  12.109724  -3.949010     7.066180  12.109724  -3.949010 
+ 11.163240  13.139429  -6.895060    11.163240  13.139429  -6.895060 
+ 15.260330  14.168142  -9.841240    15.260330  14.168142  -9.841240 
+ 19.356610  15.196759 -12.786830    19.356610  15.196759 -12.786830 
+-21.048240  -0.119316  15.701460   -21.048240  -0.119316  15.701460 
+-16.951180   0.910390  12.755410   -16.951180   0.910390  12.755410 
+-12.854890   1.939006   9.809820   -12.854890   1.939006   9.809820 
+ -8.757810   2.967719   6.863650    -8.757810   2.967719   6.863650 
+ -4.660750   3.997424   3.917600    -4.660750   3.997424   3.917600 
+ -0.563660   5.026137   0.971420    -0.563660   5.026137   0.971420 
+  3.533430   6.054851  -1.974760     3.533430   6.054851  -1.974760 
+  7.629690   7.084458  -4.920220     7.629690   7.084458  -4.920220 
+ 11.726770   8.113171  -7.866400    11.726770   8.113171  -7.866400 
+ 15.823860   9.141885 -10.812570    15.823860   9.141885 -10.812570 
+ 19.920920  10.171590 -13.758620    19.920920  10.171590 -13.758620 
+-20.484700  -5.145573  14.730120   -20.484700  -5.145573  14.730120 
+-16.387640  -4.115868  11.784070   -16.387640  -4.115868  11.784070 
+-12.290560  -3.087155   8.837900   -12.290560  -3.087155   8.837900 
+ -8.193470  -2.058442   5.891720    -8.193470  -2.058442   5.891720 
+ -4.097210  -1.028833   2.946260    -4.097210  -1.028833   2.946260 
+  4.096960   1.028594  -2.946100     4.096960   1.028594  -2.946100 
+  8.194020   2.058298  -5.892150     8.194020   2.058298  -5.892150 
+ 12.291110   3.087011  -8.838320    12.291110   3.087011  -8.838320 
+ 16.387390   4.115628 -11.783910    16.387390   4.115628 -11.783910 
+ 20.484450   5.145332 -14.729960    20.484450   5.145332 -14.729960 
+-19.920390 -10.170742  13.758320   -19.920390 -10.170742  13.758320 
+-15.824110  -9.142125  10.812740   -15.824110  -9.142125  10.812740 
+-11.727020  -8.113412   7.866560   -11.727020  -8.113412   7.866560 
+ -7.629960  -7.083707   4.920510    -7.629960  -7.083707   4.920510 
+ -3.532880  -6.054994   1.974330    -3.532880  -6.054994   1.974330 
+  0.563410  -5.026377  -0.971260     0.563410  -5.026377  -0.971260 
+  4.660470  -3.996672  -3.917310     4.660470  -3.996672  -3.917310 
+  8.757550  -2.967959  -6.863480     8.757550  -2.967959  -6.863480 
+ 12.854640  -1.939246  -9.809660    12.854640  -1.939246  -9.809660 
+ 16.951700  -0.909541 -12.755710    16.951700  -0.909541 -12.755710 
+ 21.047990   0.119075 -15.701300    21.047990   0.119075 -15.701300 
+-19.356860 -15.196999  12.786990   -19.356860 -15.196999  12.786990 
+-15.259780 -14.168285   9.840810   -15.259780 -14.168285   9.840810 
+-11.163520 -13.138678   6.895350   -11.163520 -13.138678   6.895350 
+ -7.066430 -12.109964   3.949170    -7.066430 -12.109964   3.949170 
+ -2.969330 -11.081251   1.002990    -2.969330 -11.081251   1.002990 
+  1.127730 -10.051547  -1.943060     1.127730 -10.051547  -1.943060 
+  5.224810  -9.022833  -4.889230     5.224810  -9.022833  -4.889230 
+  9.321100  -7.994216  -7.834820     9.321100  -7.994216  -7.834820 
+ 13.418180  -6.965503 -10.781000    13.418180  -6.965503 -10.781000 
+ 17.515240  -5.935798 -13.727050    17.515240  -5.935798 -13.727050 
+ 21.612330  -4.907085 -16.673230    21.612330  -4.907085 -16.673230 
+-14.696230 -19.194543   8.869470   -14.696230 -19.194543   8.869470 
+-10.599170 -18.164838   5.923420   -10.599170 -18.164838   5.923420 
+ -6.502090 -17.136124   2.977240    -6.502090 -17.136124   2.977240 
+ -2.405800 -16.107508   0.031660    -2.405800 -16.107508   0.031660 
+  1.691260 -15.077804  -2.914390     1.691260 -15.077804  -2.914390 
+  5.788340 -14.049090  -5.860570     5.788340 -14.049090  -5.860570 
+  9.885430 -13.020377  -8.806750     9.885430 -13.020377  -8.806750 
+ 13.981690 -11.990768 -11.752210    13.981690 -11.990768 -11.752210 
+ 18.078780 -10.962055 -14.698390    18.078780 -10.962055 -14.698390 
+-10.035640 -23.191095   4.952080   -10.035640 -23.191095   4.952080 
+ -5.938550 -22.162382   2.005910    -5.938550 -22.162382   2.005910 
+ -1.841490 -21.132677  -0.940140    -1.841490 -21.132677  -0.940140 
+  2.254790 -20.104061  -3.885730     2.254790 -20.104061  -3.885730 
+  6.351880 -19.075347  -6.831910     6.351880 -19.075347  -6.831910 
+ 10.448940 -18.045643  -9.777960    10.448940 -18.045643  -9.777960 
+ 14.546020 -17.016929 -12.724140    14.546020 -17.016929 -12.724140 
+ -5.375050 -27.187647   1.034700    -5.375050 -27.187647   1.034700 
+ -1.277960 -26.158934  -1.911480    -1.277960 -26.158934  -1.911480 
+  2.819130 -25.130221  -4.857660     2.819130 -25.130221  -4.857660 
+  6.916210 -24.101508  -7.803840     6.916210 -24.101508  -7.803840 
+ 11.012470 -23.071900 -10.749300    11.012470 -23.071900 -10.749300 
+]
diff --git a/MAC/Deployment/data/StaticMetaData/CMakeLists.txt b/MAC/Deployment/data/StaticMetaData/CMakeLists.txt
index aa733c417f2e49ae031c393e2415ac3d22729706..71266e4b37742f126b5199dc2a608deb0495e90d 100644
--- a/MAC/Deployment/data/StaticMetaData/CMakeLists.txt
+++ b/MAC/Deployment/data/StaticMetaData/CMakeLists.txt
@@ -16,13 +16,13 @@ lofar_add_sysconf_files(
 # relative dir as in the source, hence we've put a symlink
 # StaticMetaData -> . in this directory.
 file(GLOB staticmeta_data RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"
-  StaticMetaData/*.tmpl 
-  StaticMetaData/*.test 
-  StaticMetaData/*.dat 
-  StaticMetaData/AntennaArrays/*.conf*
-  StaticMetaData/AntennaPos/*.conf*
-  StaticMetaData/CableDelays/*.conf*
-  StaticMetaData/iHBADeltas/*.conf*
-  StaticMetaData/AntennaFields/*.conf*
-  StaticMetaData/Attenuation/*.conf*)
-lofar_add_sysconf_files(${staticmeta_data})
+  *.tmpl 
+  *.test 
+  *.dat 
+  AntennaArrays/*.conf*
+  AntennaPos/*.conf*
+  CableDelays/*.conf*
+  iHBADeltas/*.conf*
+  AntennaFields/*.conf*
+  Attenuation/*.conf*)
+lofar_add_sysconf_files(${staticmeta_data} DESTINATION StaticMetaData)
diff --git a/MAC/Deployment/data/StaticMetaData/CableDelays/IE613-CableDelays.conf b/MAC/Deployment/data/StaticMetaData/CableDelays/IE613-CableDelays.conf
new file mode 100644
index 0000000000000000000000000000000000000000..772985418d6624b744caa87572b6c023908f6096
--- /dev/null
+++ b/MAC/Deployment/data/StaticMetaData/CableDelays/IE613-CableDelays.conf
@@ -0,0 +1,210 @@
+#
+# CableDelays.conf IE613
+#
+# This file contains for each input of each RCU the delay the length of the cable
+# connected to it adds to the signal path.
+#
+# Lenghts are in meters, delays are in ns.
+#
+# Note: The first order values are:
+#   50m     199.2573
+#   80m     326.9640
+#   85m     342.5133
+#   115m    465.5254
+#   130m    530.6981
+#
+#		LBL           		LBH             	HBA
+#RCUnr  len 	delay       	len 	delay       	len 	delay
+#-----------------------------------------------------------------------
+0	0	0		115	465.5254	85	342.5133
+1	0	0		115	465.5254	85	342.5133
+2	0	0		115	465.5254	85	342.5133
+3	0	0		115	465.5254	85	342.5133
+4	0	0		115	465.5254	85	342.5133
+5	0	0		115	465.5254	85	342.5133
+6	0	0		115	465.5254	85	342.5133
+7	0	0		115	465.5254	85	342.5133
+8	0	0		85	342.5133	85	342.5133
+9	0	0		85	342.5133	85	342.5133
+10	0	0		85	342.5133	85	342.5133
+11	0	0		85	342.5133	85	342.5133
+12	0	0		85	342.5133	85	342.5133
+13	0	0		85	342.5133	85	342.5133
+14	0	0		85	342.5133	85	342.5133
+15	0	0		85	342.5133	85	342.5133
+16	0	0		115	465.5254	85	342.5133
+17	0	0		115	465.5254	85	342.5133
+18	0	0		115	465.5254	85	342.5133
+19	0	0		115	465.5254	85	342.5133
+20	0	0		115	465.5254	85	342.5133
+21	0	0		115	465.5254	85	342.5133
+22	0	0		115	465.5254	115	465.5254
+23	0	0		115	465.5254	115	465.5254
+24	0	0		115	465.5254	85	342.5133
+25	0	0		115	465.5254	85	342.5133
+26	0	0		115	465.5254	85	342.5133
+27	0	0		115	465.5254	85	342.5133
+28	0	0		85	342.5133	85	342.5133
+29	0	0		85	342.5133	85	342.5133
+30	0	0		85	342.5133	85	342.5133
+31	0	0		85	342.5133	85	342.5133
+32	0	0		85	342.5133	85	342.5133
+33	0	0		85	342.5133	85	342.5133
+34	0	0		115	465.5254	85	342.5133
+35	0	0		115	465.5254	85	342.5133
+36	0	0		85	342.5133	85	342.5133
+37	0	0		85	342.5133	85	342.5133
+38	0	0		85	342.5133	85	342.5133
+39	0	0		85	342.5133	85	342.5133
+40	0	0		115	465.5254	115	465.5254
+41	0	0		115	465.5254	115	465.5254
+42	0	0		115	465.5254	85	342.5133
+43	0	0		115	465.5254	85	342.5133
+44	0	0		115	465.5254	85	342.5133
+45	0	0		115	465.5254	85	342.5133
+46	0	0		115	465.5254	85	342.5133
+47	0	0		115	465.5254	85	342.5133
+48	0	0		115	465.5254	85	342.5133
+49	0	0		115	465.5254	85	342.5133
+50	0	0		115	465.5254	85	342.5133
+51	0	0		115	465.5254	85	342.5133
+52	0	0		115	465.5254	85	342.5133
+53	0	0		115	465.5254	85	342.5133
+54	0	0		115	465.5254	85	342.5133
+55	0	0		115	465.5254	85	342.5133
+56	0	0		85	342.5133	85	342.5133
+57	0	0		85	342.5133	85	342.5133
+58	0	0		85	342.5133	115	465.5254
+59	0	0		85	342.5133	115	465.5254
+60	0	0		115	465.5254	115	465.5254
+61	0	0		115	465.5254	115	465.5254
+62	0	0		115	465.5254	115	465.5254
+63	0	0		115	465.5254	115	465.5254
+64	0	0		85	342.5133	85	342.5133
+65	0	0		85	342.5133	85	342.5133
+66	0	0		85	342.5133	85	342.5133
+67	0	0		85	342.5133	85	342.5133
+68	0	0		85	342.5133	85	342.5133
+69	0	0		85	342.5133	85	342.5133
+70	0	0		85	342.5133	85	342.5133
+71	0	0		85	342.5133	85	342.5133
+72	0	0		115	465.5254	85	342.5133
+73	0	0		115	465.5254	85	342.5133
+74	0	0		85	342.5133	85	342.5133
+75	0	0		85	342.5133	85	342.5133
+76	0	0		115	465.5254	85	342.5133
+77	0	0		115	465.5254	85	342.5133
+78	0	0		85	342.5133	115	465.5254
+79	0	0		85	342.5133	115	465.5254
+80	0	0		115	465.5254	115	465.5254
+81	0	0		115	465.5254	115	465.5254
+82	0	0		115	465.5254	115	465.5254
+83	0	0		115	465.5254	115	465.5254
+84	0	0		115	465.5254	115	465.5254
+85	0	0		115	465.5254	115	465.5254
+86	0	0		115	465.5254	85	342.5133
+87	0	0		115	465.5254	85	342.5133
+88	0	0		115	465.5254	85	342.5133
+89	0	0		115	465.5254	85	342.5133
+90	0	0		115	465.5254	85	342.5133
+91	0	0		115	465.5254	85	342.5133
+92	0	0		115	465.5254	85	342.5133
+93	0	0		115	465.5254	85	342.5133
+94	0	0		115	465.5254	85	342.5133
+95	0	0		115	465.5254	85	342.5133
+96	0	0		85	342.5133	115	465.5254
+97	0	0		85	342.5133	115	465.5254
+98	0	0		115	465.5254	115	465.5254
+99	0	0		115	465.5254	115	465.5254
+100	0	0		85	342.5133	115	465.5254
+101	0	0		85	342.5133	115	465.5254
+102	0	0		85	342.5133	115	465.5254
+103	0	0		85	342.5133	115	465.5254
+104	0	0		115	465.5254	130	530.6981
+105	0	0		115	465.5254	130	530.6981
+106	0	0		115	465.5254	85	342.5133
+107	0	0		115	465.5254	85	342.5133
+108	0	0		85	342.5133	85	342.5133
+109	0	0		85	342.5133	85	342.5133
+110	0	0		115	465.5254	85	342.5133
+111	0	0		115	465.5254	85	342.5133
+112	0	0		115	465.5254	85	342.5133
+113	0	0		115	465.5254	85	342.5133
+114	0	0		115	465.5254	85	342.5133
+115	0	0		115	465.5254	85	342.5133
+116	0	0		115	465.5254	115	465.5254
+117	0	0		115	465.5254	115	465.5254
+118	0	0		85	342.5133	115	465.5254
+119	0	0		85	342.5133	115	465.5254
+120	0	0		115	465.5254	115	465.5254
+121	0	0		115	465.5254	115	465.5254
+122	0	0		115	465.5254	115	465.5254
+123	0	0		115	465.5254	115	465.5254
+124	0	0		85	342.5133	130	530.6981
+125	0	0		85	342.5133	130	530.6981
+126	0	0		115	465.5254	130	530.6981
+127	0	0		115	465.5254	130	530.6981
+128	0	0		85	342.5133	85	342.5133
+129	0	0		85	342.5133	85	342.5133
+130	0	0		115	465.5254	85	342.5133
+131	0	0		115	465.5254	85	342.5133
+132	0	0		85	342.5133	85	342.5133
+133	0	0		85	342.5133	85	342.5133
+134	0	0		85	342.5133	85	342.5133
+135	0	0		85	342.5133	85	342.5133
+136	0	0		115	465.5254	115	465.5254
+137	0	0		115	465.5254	115	465.5254
+138	0	0		115	465.5254	115	465.5254
+139	0	0		115	465.5254	115	465.5254
+140	0	0		115	465.5254	115	465.5254
+141	0	0		115	465.5254	115	465.5254
+142	0	0		115	465.5254	115	465.5254
+143	0	0		115	465.5254	115	465.5254
+144	0	0		115	465.5254	130	530.6981
+145	0	0		115	465.5254	130	530.6981
+146	0	0		85	342.5133	130	530.6981
+147	0	0		85	342.5133	130	530.6981
+148	0	0		85	342.5133	130	530.6981
+149	0	0		85	342.5133	130	530.6981
+150	0	0		85	342.5133	85	342.5133
+151	0	0		85	342.5133	85	342.5133
+152	0	0		115	465.5254	85	342.5133
+153	0	0		115	465.5254	85	342.5133
+154	0	0		115	465.5254	115	465.5254
+155	0	0		115	465.5254	115	465.5254
+156	0	0		115	465.5254	115	465.5254
+157	0	0		115	465.5254	115	465.5254
+158	0	0		85	342.5133	115	465.5254
+159	0	0		85	342.5133	115	465.5254
+160	0	0		85	342.5133	115	465.5254
+161	0	0		85	342.5133	115	465.5254
+162	0	0		85	342.5133	115	465.5254
+163	0	0		85	342.5133	115	465.5254
+164	0	0		85	342.5133	130	530.6981
+165	0	0		85	342.5133	130	530.6981
+166	0	0		115	465.5254	130	530.6981
+167	0	0		115	465.5254	130	530.6981
+168	0	0		115	465.5254	85	342.5133
+169	0	0		115	465.5254	85	342.5133
+170	0	0		115	465.5254	115	465.5254
+171	0	0		115	465.5254	115	465.5254
+172	0	0		85	342.5133	115	465.5254
+173	0	0		85	342.5133	115	465.5254
+174	0	0		85	342.5133	115	465.5254
+175	0	0		85	342.5133	115	465.5254
+176	0	0		115	465.5254	115	465.5254
+177	0	0		115	465.5254	115	465.5254
+178	0	0		85	342.5133	115	465.5254
+179	0	0		85	342.5133	115	465.5254
+180	0	0		115	465.5254	130	530.6981
+181	0	0		115	465.5254	130	530.6981
+182	0	0		115	465.5254	115	465.5254
+183	0	0		115	465.5254	115	465.5254
+184	0	0		85	342.5133	115	465.5254
+185	0	0		115	465.5254	115	465.5254
+186	0	0		115	465.5254	115	465.5254
+187	0	0		115	465.5254	115	465.5254
+188	0	0		115	465.5254	115	465.5254
+189	0	0		115	465.5254	115	465.5254
+190	0	0		85	342.5133	130	530.6981
+191	0	0		85	342.5133	130	530.6981
diff --git a/MAC/Deployment/data/StaticMetaData/PVSSnumbers.dat b/MAC/Deployment/data/StaticMetaData/PVSSnumbers.dat
index 24320d97b564ccdd7fcfae4b9ab71a5644808567..8101e1de04aab614f5c549b0125af3a826e7ebc7 100644
--- a/MAC/Deployment/data/StaticMetaData/PVSSnumbers.dat
+++ b/MAC/Deployment/data/StaticMetaData/PVSSnumbers.dat
@@ -141,6 +141,7 @@ DE609   210
 PL610   211
 PL611   212
 PL612   213
+IE613   214
 #
 
 # Test Systems
diff --git a/MAC/Deployment/data/StaticMetaData/RSPBlet.dat b/MAC/Deployment/data/StaticMetaData/RSPBlet.dat
index d9dd3b4d008284ea78e60c21b0bd8742fcb7a779..7c1983eab83db5fc418c9c42079880ca819d45b1 100644
--- a/MAC/Deployment/data/StaticMetaData/RSPBlet.dat
+++ b/MAC/Deployment/data/StaticMetaData/RSPBlet.dat
@@ -60,5 +60,6 @@ DE609         0 1 2 3
 PL610         0 1 2 3
 PL611         0 1 2 3
 PL612         0 1 2 3
+IE613         0 1 2 3
 FI609         0 1 2 3
 RS511         0 1 2 3
diff --git a/MAC/Deployment/data/StaticMetaData/RSPConnections_Cobalt.dat b/MAC/Deployment/data/StaticMetaData/RSPConnections_Cobalt.dat
index 8b820e8011609889ab03e07ab2a03c0fdd676c2f..5ac07ccb90c4183302f0e023deeae056f92a5599 100644
--- a/MAC/Deployment/data/StaticMetaData/RSPConnections_Cobalt.dat
+++ b/MAC/Deployment/data/StaticMetaData/RSPConnections_Cobalt.dat
@@ -178,3 +178,6 @@ PL610 RSP_0 cbt003-10GB04 10.220.11.103 A0:36:9F:1F:7B:42
 PL611 RSP_0 cbt004-10GB04 10.220.41.104 A0:36:9F:1F:7A:06
 
 PL612 RSP_0 cbt005-10GB04 10.220.61.105 A0:36:9F:1F:79:E2
+
+IE613 RSP_0 cbt002-10GB04 10.220.81.102 A0:36:9F:1F:79:A2
+
diff --git a/MAC/Deployment/data/StaticMetaData/RSPConnections_local.dat b/MAC/Deployment/data/StaticMetaData/RSPConnections_local.dat
index 61454dd00f0b52b6f54b69b09336f21384bce1cc..27f5bb66ca09145c25d78c525efc78642d40a02a 100644
--- a/MAC/Deployment/data/StaticMetaData/RSPConnections_local.dat
+++ b/MAC/Deployment/data/StaticMetaData/RSPConnections_local.dat
@@ -72,4 +72,9 @@ PL611_03 10.170.0.30  00:12:F2:C6:BB:00   R00-BG1-PL611
 PL612_00 10.170.0.30  90:1B:0E:60:33:F4   LOFARPL612_1
 PL612_01 10.170.0.30  90:1B:0E:60:33:F4   LOFARPL612_1
 PL612_02 10.170.0.30  90:1B:0E:60:33:F4   LOFARPL612_1
-PL612_03 10.170.0.30  90:1B:0E:60:33:F4   LOFARPL612_1
\ No newline at end of file
+PL612_03 10.170.0.30  90:1B:0E:60:33:F4   LOFARPL612_1
+
+IE613_00 10.170.0.30  90:1B:0E:60:33:F4   R00-BG1-IE613
+IE613_00 10.170.0.30  90:1B:0E:60:33:F4   R00-BG1-IE613
+IE613_00 10.170.0.30  90:1B:0E:60:33:F4   R00-BG1-IE613
+IE613_00 10.170.0.30  90:1B:0E:60:33:F4   R00-BG1-IE613
diff --git a/MAC/Deployment/data/StaticMetaData/RSPImage.conf b/MAC/Deployment/data/StaticMetaData/RSPImage.conf
index 12ddc1f6c3c3daebb38397f215149e3642f245b3..7f94f57f57481a0f909891b7b1fe6dca930309af 100644
--- a/MAC/Deployment/data/StaticMetaData/RSPImage.conf
+++ b/MAC/Deployment/data/StaticMetaData/RSPImage.conf
@@ -58,3 +58,4 @@ FI609  4
 PL610  4
 PL611  4
 PL612  4
+IE613  4
diff --git a/MAC/Deployment/data/StaticMetaData/StationAttenuation.dat b/MAC/Deployment/data/StaticMetaData/StationAttenuation.dat
index d4f6462324eb54b2f2d3361588f9670da1d796e4..077c3b3a93b26ddbb61176f1908941d0d2fd419b 100644
--- a/MAC/Deployment/data/StaticMetaData/StationAttenuation.dat
+++ b/MAC/Deployment/data/StaticMetaData/StationAttenuation.dat
@@ -64,6 +64,7 @@ DE609         0.25         0.0     0.0     0.0     0.0     4.0     4.0     4.0
 PL610         0.25         0.0     0.0     0.0     0.0     0.0     0.0     0.0
 PL611         0.25         0.0     0.0     0.0     0.0     0.0     0.0     0.0
 PL612         0.25         0.0     0.0     0.0     0.0     0.0     0.0     0.0
+IE613         0.25         0.0     0.0     0.0     0.0     0.0     0.0     0.0
 FI609         0.25         0.0     0.0     0.0     0.0     0.0     0.0     0.0
 RS511         0.25         0.0     0.0     0.0     0.0     0.0     0.0     0.0
 
diff --git a/MAC/Deployment/data/StaticMetaData/StationInfo.dat b/MAC/Deployment/data/StaticMetaData/StationInfo.dat
index 018a86900e8fb5d44b33c67f0b7751c56f8f12c6..059a6d4ab52af2b45802fec1b7534090e9838ced 100644
--- a/MAC/Deployment/data/StaticMetaData/StationInfo.dat
+++ b/MAC/Deployment/data/StaticMetaData/StationInfo.dat
@@ -20,41 +20,25 @@
 #---------------------------------------------------------------------------------------------------------------
 ## core (1-59)
 CS001   1     C    6.8680483    52.9110414      54.43   12     6    96    48    1       Yes      Yes    Yes
-CS002	2     C    6.8693028    52.9148347      55.90   12     6    96    48    1       Yes      Yes    Yes
+CS002	2     C    6.8693028    52.9148472      55.90   12     6    96    48    1       Yes      Yes    Yes
 CS003	3     C    6.8693283    52.9159339      55.19   12     6    96    48    1       Yes      Yes    Yes
 CS004	4     C    6.8680911    52.9147486      55.94   12     6    96    48    1       Yes      Yes    Yes
 CS005	5     C    6.8696561    52.9141017      57.58   12     6    96    48    1       Yes      Yes    Yes
 CS006	6     C    6.87108883   52.9144497      57.78   12     6    96    48    1       Yes      Yes    Yes 
 CS007	7     C    6.8715772    52.9157881      56.56   12     6    96    48    1       Yes      Yes    Yes
-CS008	8     C    0.0          0.0             0       12     6    96    48    1       Yes      Yes    No
-CS009	9     C    0.0          0.0             0       12     6    96    48    1       Yes      Yes    No
-CS010   10    C    0.0          0.0             0       12     6    96    48    1       Yes      Yes    No
 CS011	11    C    6.8737881    52.9141903      53.68   12     6    96    48    1       Yes      Yes    Yes
-CS012	12    C    0.0          0.0             0       12     6    96    48    1       Yes      Yes    No
 CS013	13    C    6.8672969    52.9177144      54.98   12     6    96    48    1       Yes      Yes    Yes
-CS014	14    C    0.0          0.0             0       12     6    96    48    1       Yes      Yes    No
-CS015	15    C    0.0          0.0             0       12     6    96    48    1       Yes      Yes    No
-CS016   16    C    0.0          0.0             0       12     6    96    48    1       Yes      Yes    No
 CS017	17    C    6.8778067    52.9158697      59.23   12     6    96    48    1       Yes      Yes    Yes
-CS018	18    C    0.0          0.0             0       12     6    96    48    1       Yes      Yes    No
-CS019	19    C    0.0          0.0             0       12     6    96    48    1       Yes      Yes    No
-CS020	20    C    0.0          0.0             0       12     6    96    48    1       Yes      Yes    No
 CS021	21    C    6.8622447    52.9176275      52.73   12     6    96    48    1       Yes      Yes    Yes
-CS022	22    C    0.0          0.0             0       12     6    96    48    1       Yes      Yes    No
-CS023	23    C    0.0          0.0             0       12     6    96    48    1       Yes      Yes    No
 CS024	24    C    6.8738103    52.9080003      55.80   12     6    96    48    1       Yes      Yes    No
-CS025	25    C    0.0          0.0             0       12     6    96    48    1       Yes      Yes    No
 CS026	26    C    6.8821933    52.9163728      55.42   12     6    96    48    1       Yes      Yes    No
-CS027	27    C    0.0          0.0             0       12     6    96    48    1       Yes      Yes    No
 CS028	28    C    6.8755528    52.9254167      52.66   12     6    96    48    1       Yes      Yes    No
-CS029	29    C    0.0          0.0             0       12     6    96    48    1       Yes      Yes    No
 CS030	30    C    6.8609850    52.9225878      58.01   12     6    96    48    1       Yes      Yes    No
 CS031	31    C    6.8597219    52.9177706      53.61   12     6    96    48    1       Yes      Yes    No
-CS032	32    C    6.8603878    52.9121611      59.31   12     6    96    48    1       Yes      Yes    Yes
+CS032	32    C    6.8603725    52.9121544      60.55   12     6    96    48    1       Yes      Yes    Yes
 
 # The Remote stations with core station layout (i.e., with HBASplit set to 'yes')
 CS101	101   C    6.8805014    52.9223181      57.78   12     6    96    48    1       Yes      Yes    No
-CS102	102   C    0.0          0.0             0       12     6    96    48    1       Yes      Yes    No
 CS103	103   C    6.8963725    52.9160403      56.52   12     6    96    48    1       Yes      Yes    No
 CS201	121   C    6.8829719    52.9128547      56.08   12     6    96    48    1       Yes      Yes    No
 CS301	141   C    6.8677119    52.9054208      58.75   12     6    96    48    1       Yes      Yes    No
@@ -64,44 +48,11 @@ CS501	181   C    6.8665950    52.9263631      56.53   12     6    96    48    1
 ## 33 .. 59
 ##
 
-## central (60-69)
-## 60
-MCU001	61
-MCU099 62
-MCU002 63
-MCU199 64
-#MCU100 1063
-## 61 .. 69
-
-## wan (70-79)
-## 70
-#WCU001	71
-## 72 .. 79
-
-## cep (80-89)
-## 80
-CCU001 81
-CCU099 82
-#CCU100 83   # No numbers above 255
-CCU002 83
-CCU199 84
-## 82 .. 89
-
-## spare (90-99)
-## 90 .. 99
-#RS005	95
-#CS099	99
-
 ## arm 1 (100-119)
 ## 100
 # name  ID    ring  long         lat             height  nrRSP nrTBB nrLBA nrHBA nrPowec HBAsplit LBAcal Aartfaac
 #-----------------------------------------------------------------------------------------------------------------
-RS104	104    R    6.929932     52.943271       0       12     6    96    48    1       No       Yes    No
-RS105	105    R    0.0          0.0             0       12     6    96    48    1       No       Yes    No
 RS106	106    R    6.9854983    52.8744053      29.82   12     6    96    48    1       No       Yes    No
-RS107	107    R    7.103304     52.928932       0       12     6    96    48    1       No       Yes    No
-RS108	108    R    0.0          0.0             0       12     6    96    48    1       No       Yes    No
-RS109	109    R    0.0          0.0             0       12     6    96    48    1       No       Yes    No
 # 110 .. 119
 #
 
@@ -109,14 +60,8 @@ RS109	109    R    0.0          0.0             0       12     6    96    48    1
 # 120
 # name  ID    ring  long         lat             height  nrRSP nrTBB nrLBA nrHBA nrPowec HBAsplit LBAcal Aartfaac
 #----------------------------------------------------------------------------------------------------------------
-RS202	122    R    0.0          0.0             0       12     6    96    48    1       No       Yes    No
-RS203	123    R    0.0          0.0             0       12     6    96    48    1       No       Yes    No
-RS204	124    R    0.0          0.0             0       12     6    96    48    1       No       Yes    No
 RS205	125    R    6.8965411    52.8571108      59.79   12     6    96    48    1       No       Yes    No
-RS206	126    R    6.819885     52.808927       0       12     6    96    48    1       No       Yes    No
-RS207	127    R    6.974889     52.757463       0       12     6    96    48    1       No       Yes    No
 RS208	128    R    6.9196231    52.6695617      60.66   12     6    96    48    1       No       Yes    No
-RS209	129    R    0.0          0.0             0       12     6    96    48    1       No       Yes    No
 RS210   130    R    6.8742114    52.3310447      69.59   12     6    96    48    1       No       Yes    No
 ## 130 .. 139
 ##
@@ -125,13 +70,9 @@ RS210   130    R    6.8742114    52.3310447      69.59   12     6    96    48
 ## 140
 # name  ID    ring  long         lat             height  nrRSP nrTBB nrLBA nrHBA nrPowec HBAsplit LBAcal Aartfaac
 #--------------------------------------------------------------------------------------------------------------
-RS303	143    R    0.0          0.0             0       12     6    96    48    1       No       Yes    No
-RS304	144    R    0.0          0.0             0       12     6    96    48    1       No       Yes    No
 RS305	145    R    6.7732369    52.8995903      61.69   12     6    96    48    1       No       Yes    No
 RS306	146    R    6.7430722    52.8905881      61.76   12     6    96    48    1       No       Yes    No
 RS307	147    R    6.6816903    52.8033092      65.55   12     6    96    48    1       No       Yes    No
-RS308	148    R    6.539006     52.82659        0       12     6    96    48    1       No       Yes    No
-RS309	149    R    6.52464      52.532          0       12     6    96    48    1       No       Yes    No
 RS310	150    R    6.1386128    52.7648403      40.91   12     6    96    48    1       No       Yes    No
 ## 150 .. 159
 ##
@@ -140,18 +81,9 @@ RS310	150    R    6.1386128    52.7648403      40.91   12     6    96    48    1
 ## 160
 # name  ID    ring  long         lat             height  nrRSP nrTBB nrLBA nrHBA nrPowec HBAsplit LBAcal Aartfaac
 #--------------------------------------------------------------------------------------------------------------
-RS402	162    R    0.0          0.0             0       12     6    96    48    1       No       Yes    No
-RS403	163    R    0.0          0.0             0       12     6    96    48    1       No       Yes    No
-RS404	164    R    6.808886111  52.93291944     0       12     6    96    48    1       No       Yes    No
-RS405	165    R    0.0          0.0             0       12     6    96    48    1       No       Yes    No
 RS406	166    R    6.7505064    53.0183578      65.62   12     6    96    48    1       No       Yes    No
 RS407	167    R    6.7848725    53.0923619      49.64   12     6    96    48    1       No       Yes    No
-RS408	168    R    0.0          0.0             0       12     6    96    48    1       No       Yes    No
 RS409	169    R    6.3574842    52.9804722      59.65   12     6    96    48    1       No       Yes    No
-RS410	170    R    5.83021      52.99421        0       12     6    96    48    1       No       Yes    No
-RS411   171    R    6.692146     53.040486       0       12     6    96    48    1       No       Yes    No
-RS412   172    R    0.0          0.0             0       12     6    96    48    1       No       Yes    No
-RS413   173    R    6.106016     52.99816        0       12     6    96    48    1       No       Yes    No
 ## 170 .. 179
 ##
 
@@ -159,14 +91,9 @@ RS413   173    R    6.106016     52.99816        0       12     6    96    48
 ## 180
 # name  ID    ring  long         lat             height  nrRSP nrTBB nrLBA nrHBA nrPowec HBAsplit LBAcal Aartfaac
 #----------------------------------------------------------------------------------------------------------------
-RS502	182    R    0.0          0.0             0       12     6    96    48    1       No       Yes    No
 RS503	183    R    6.8506333    52.9445961      58.65   12     6    96    48    1       No       Yes    No
-RS504	184    R    0.0          0.0             0       12     6    96    48    1       No       Yes    No
-RS505	185    R    0.0          0.0             0       12     6    96    48    1       No       Yes    No
-RS506	186    R    7.03114      53.008596       0       12     6    96    48    1       No       Yes    No 
-RS507	187    R    7.02318      53.0722         0       12     6    96    48    1       No       Yes    No
 RS508	188    R    6.9536942    53.2403583      45.51   12     6    96    48    1       No       Yes    No
-RS509	189    R    6.7852089    53.4093164      51.53   12     6    96    48    1       No       Yes    No
+RS509	189    R    6.7851967    53.4093034      49.27   12     6    96    48    1       No       Yes    No
 # 190 .. 199
 #
 
@@ -175,11 +102,11 @@ RS509	189    R    6.7852089    53.4093164      51.53   12     6    96    48    1
 # name  ID    ring  long         lat             height  nrRSP nrTBB nrLBA nrHBA nrPowec HBAsplit LBAcal Aartfaac
 #----------------------------------------------------------------------------------------------------------------
 # effelsberg
-DE601   201    E    6.8835692    50.5229575      396.29  24    12    96    96    1       No       No    No
+DE601   201    E    6.8835694    50.5229575      396.30  24    12    96    96    1       No       No    No
 # garching
 DE602   202    E    11.2876647   48.5014758      515.20  24    12    96    96    1       No       No    No
 # Tautenburg
-DE603	203    E    11.7106958   50.9796781      385.41  24    12    96    96    1       No       No    No
+DE603	203    E    11.7106983   50.9796706      384.61  24    12    96    96    1       No       No    No
 # Potsdam
 DE604	204    E    13.0158897   52.4381292       87.02  24    12    96    96    1       No       No    No
 # Juelich
@@ -194,21 +121,39 @@ UK608	208    E    -1.4342539   51.1439472      137.66  24    12    96    96    1
 # WARNING: JUMP IN STATIONNUMBERS!!!! FI609 HAS NUMBER 209!!!!
 DE609   210    E     9.9692322   53.6988092       69.27  24    12    96    96    1       No       No    No       
 # Borowiec
-PL610   211    E     17.0741606  52.2759328      122.29  24    12    96    96    2       No       No    No
+PL610   211    E     17.0741692  52.2759289      120.82  24    12    96    96    2       No       No    No
 # Lazy
 PL611   212    E     20.4896131  49.9649386      305.42  24    12    96    48    2       No       No    No
 # Baldy
 PL612   213    E     20.5897506  53.5939042      178.38  24    12    96    96    2       No       No    No
+# Birr
+IE613   214    E     -7.9213656  53.0951167      105.99  24    12    96    96    2       No       No    No
 
 ## Non-ILT international
 ## 900
 # Finland (to be renamed when it becomes part of ILT)
 FI609	901    E     20.7609103  69.0714225      533.25  12    6     48    48    1       No       No    No
 
+## central systems (60-69)
+## 60
+MCU001 61
+MCU199 64
+## 61 .. 69
+
+## wan (70-79)
+## 70
+## 72 .. 79
+
+## cep (80-89)
+## 80
+CCU001 81
+CCU199 84
+## 82 .. 89
+
+## spare (90-99)
+## 90 .. 99
+
 ## Test systems
 # name  ID     ring long         lat             height  nrRSP nrTBB nrLBA nrHBA nrPowec HBAsplit LBAcal Aartfaac
 #----------------------------------------------------------------------------------------------------------------
-CS100  230     C    6.3952067    52.8121013      0       6     12     4    4     1       Yes       No    No
-#MCU099 231
-#CCU099 232
-RS511	301    R    6.7852089    53.4093164      51.53   12    6     96    48    1       No       Yes    No
+#RS511	301    R    6.7852089    53.4093164      51.53   12    6     96    48    1       No       Yes    No
diff --git a/MAC/Deployment/data/StaticMetaData/TBBConnections.dat b/MAC/Deployment/data/StaticMetaData/TBBConnections.dat
index ff258474a6858243669a134ad291db760456983c..07c4b7193b166664f17ca1084ea63c66c3ce3158 100644
--- a/MAC/Deployment/data/StaticMetaData/TBBConnections.dat
+++ b/MAC/Deployment/data/StaticMetaData/TBBConnections.dat
@@ -93,6 +93,7 @@ DE609      TBB_0      locus081
 PL610      TBB_0      locus082
 PL611      TBB_0      locus083
 PL612      TBB_0      locus084
+IE613      TBB_0      locus085
 
 # Non-ILT Stations (for completeness)
 FI609      TBB_0      locus081
diff --git a/MAC/Deployment/data/StaticMetaData/iHBADeltas/IE613-iHBADeltas.conf b/MAC/Deployment/data/StaticMetaData/iHBADeltas/IE613-iHBADeltas.conf
new file mode 100644
index 0000000000000000000000000000000000000000..65b8c278186d2bb9fa306b104e7fb32229a8e83c
--- /dev/null
+++ b/MAC/Deployment/data/StaticMetaData/iHBADeltas/IE613-iHBADeltas.conf
@@ -0,0 +1,23 @@
+#
+# iHBADeltas for IE613
+# Created: 2017-07-11 14:36:00
+#
+HBADeltas
+(0,15) x (0,2) [
+    -1.454  -2.041   0.867
+    -1.488  -0.801   1.025
+    -1.521   0.439   1.183
+    -1.555   1.678   1.341
+    -0.451  -1.920   0.131
+    -0.485  -0.680   0.289
+    -0.518   0.559   0.447
+    -0.552   1.799   0.605
+     0.552  -1.799  -0.605
+     0.518  -0.559  -0.447
+     0.485   0.680  -0.289
+     0.451   1.920  -0.131
+     1.555  -1.678  -1.341
+     1.521  -0.439  -1.183
+     1.488   0.801  -1.025
+     1.454   2.041  -0.867
+]
diff --git a/MAC/GCF/PVSS/test/testFuncs.sh b/MAC/GCF/PVSS/test/testFuncs.sh
index d155fbf850dcbca8f471a3266f6b2ea785b267b1..cefb0a5876466b407810348092555c728a0bf482 100755
--- a/MAC/GCF/PVSS/test/testFuncs.sh
+++ b/MAC/GCF/PVSS/test/testFuncs.sh
@@ -29,11 +29,17 @@ init()
     error "Global PVSS configuration file $PVSSINST_CONF does not exist."
 
   # Get PVSS installation directory from the global PVSS configuration file.
+  # in case there are more than one installation directories in the file, pick the oldest (sort|head)
+  # because sometimes a new wincc/pvss version is installed alongside the currect version for testing
+  # and we want the current code to be tested with the current pvss version.
+  # This is an arbitraty choice, but for now it works.
   pvsshome=$(
     sed -n '/^\[Software\\ETM\\PVSS II\\[0-9]\+\.[0-9]\+\]$/,/^\[/ { 
-           s,^InstallationDir *= *"\([^"]*\)"$,\1,p }' $PVSSINST_CONF
+           s,^InstallationDir *= *"\([^"]*\)"$,\1,p }' $PVSSINST_CONF | sort -u | head -n 1
   )
 
+  echo "Found pvsshome=$pvsshome in $PVSSINST_CONF"
+
   # Check if the install directory exists.
   [ -d $pvsshome ] || \
     error "PVSS installation directory $pvsshome does not exist."
@@ -50,11 +56,12 @@ init()
 
 # Determine the PVSS command prefix. PVSS versions <= 3.10 use "PVSS00" as
 # prefix for most commands; PVSS versions > 3.10 use "WCCOA" as prefix.
+# see comments above for pvsshome about which version to choose.
 pvss_cmdprefix()
 {
   pvss_version=$(
     sed -n 's,^\[Software\\ETM\\PVSS II\\\([0-9]\+\.[0-9]\+\)\]$,\1,p' \
-      $PVSSINST_CONF)
+      $PVSSINST_CONF | sort -u | head -n 1)
   pvss_version_major=$(echo $pvss_version | cut -d'.' -f1)
   pvss_version_minor=$(echo $pvss_version | cut -d'.' -f2)
 
diff --git a/MAC/MACIO/autogen/protocol.tpl b/MAC/MACIO/autogen/protocol.tpl
index df554fcc6bba796f9bd74de462f1c9ed3d724d1c..d7f43d54305ca3f1e7758b00e26a9747d707138c 100644
--- a/MAC/MACIO/autogen/protocol.tpl
+++ b/MAC/MACIO/autogen/protocol.tpl
@@ -179,6 +179,9 @@ void [+ event_class_name +]::pack()
   uint32 __offset = 0;
   [+ IF (not (exist? "noheader")) +]
   GCFEvent::pack();
+
+  ASSERTSTR(bufferSize() >= __requiredSize, "[+ event_class_name +]::pack() buffer is not large enough to pack all the event's values. signal=" << signal << " bufferSize=" << bufferSize());
+
   __offset = GCFEvent::sizePackedGCFEvent;[+ ENDIF +]
   [+ FOR param "" +]
   [+ IF (exist? "userdefined") +]
diff --git a/MAC/MACIO/include/MACIO/GCF_Event.h b/MAC/MACIO/include/MACIO/GCF_Event.h
index e084f8784c4b61e8f7462a9586128bcd368e33b7..1fa5c620d6d8dde3fe192448784dc4a92464c0d0 100644
--- a/MAC/MACIO/include/MACIO/GCF_Event.h
+++ b/MAC/MACIO/include/MACIO/GCF_Event.h
@@ -104,7 +104,6 @@ protected:
 	// helper methods
 	uint32 unpackString(string& value, char* buffer);   
 	uint32 packString  (char* buffer, const string& value);  
-	void   resizeBuf   (uint32 requiredSize);
 	void*  unpackMember(char* data, uint32& offset, uint32& memberNOE, uint32 sizeofMemberType);
 	uint32 packMember  (uint32 offset, const void* member, uint32 memberNOE, uint32 sizeofMemberType);
 
@@ -137,6 +136,10 @@ public:
 	// buffer is unpacked it is released. The first few bytes in the buffer are always the
 	// (packed) signal and length values.
 	char* _buffer;
+
+    //JS 20170704: made method resizeBuf also public since it's related data members _buffer and length are also (falsely) public.
+    //there are better ways to do this, but this class is already a bit broken anyway with it's public signal, lenght and _buffer.
+	void   resizeBuf   (uint32 requiredSize);
 };
 
 //#
diff --git a/MAC/MACIO/src/EventPort.cc b/MAC/MACIO/src/EventPort.cc
index 404ca21eea905a6bacf8926aac88f7ec830396b1..9d0b36e3807f5da06ea2b3c8355e31bda7760cf0 100644
--- a/MAC/MACIO/src/EventPort.cc
+++ b/MAC/MACIO/src/EventPort.cc
@@ -382,7 +382,7 @@ GCFEvent*	EventPort::receiveEvent(Socket*	aSocket)
 	if (itsReadState == 0) {
 		// cleanup old garbage if any
 		if (itsEventBuf) {
-			delete itsEventBuf;
+			delete [] itsEventBuf;
 			itsEventBuf = 0;
 		}
 		btsRead = aSocket->read((void*) &(itsEventHdr->signal), sizeof(itsEventHdr->signal));
@@ -451,7 +451,11 @@ GCFEvent*	EventPort::receiveEvent(Socket*	aSocket)
 			itsTotalBtsRead = 0;
 			itsBtsToRead    = 0;
 //			{ string s; hexdump(s, itsEventBuf, GCFEvent::sizePackedGCFEvent + itsEventHdr->length); LOG_DEBUG(s); }
-			itsEventHdr->_buffer = itsEventBuf; // attach buffer to event
+
+			// copy itsEventBuf into _buffer of itsEventHdr and return itsEventHdr
+			itsEventHdr->resizeBuf(GCFEvent::sizePackedGCFEvent + itsEventHdr->length);
+			memcpy(itsEventHdr->_buffer, itsEventBuf, GCFEvent::sizePackedGCFEvent + itsEventHdr->length);
+
 			return (itsEventHdr);
 		}
 	}
diff --git a/MAC/MACIO/src/GCF_Event.cc b/MAC/MACIO/src/GCF_Event.cc
index 4198d9d7f64bcd62eb40e29a8a05bc76be4564a3..b2732ac63285b078132896e9a8c0460b89055c7b 100644
--- a/MAC/MACIO/src/GCF_Event.cc
+++ b/MAC/MACIO/src/GCF_Event.cc
@@ -54,6 +54,8 @@ void GCFEvent::pack()
 		resizeBuf(sizePackedGCFEvent);
 	}
 
+	ASSERTSTR(bufferSize() >= sizePackedGCFEvent, "GCFEvent::pack() buffer is not large enough to pack all the event's values. signal=" << signal << " bufferSize=" << bufferSize());
+
 	// packs the GCF event fields in an existing buffer
 	memcpy(_buffer, &signal, sizeof(signal));
 	memcpy(_buffer + sizeof(signal), &length, sizeof(length));
@@ -72,7 +74,10 @@ void GCFEvent::resizeBuf(uint32 requiredSize)
 		_buffer = 0;
 	}
 
+ 	ASSERTSTR(requiredSize >= sizePackedGCFEvent, "Requested to few bytes while resizing the buffer of an event of type " << signal << ". minimum #bytes=" << sizePackedGCFEvent << ". requested #bytes=" << requiredSize);
+
 	_buffer = new char[requiredSize];
+    memset(_buffer, 0, requiredSize);
 	ASSERTSTR(_buffer, "Can not allocated " << requiredSize << 
 						" bytes for packing an event of type " << signal);
 	length = requiredSize - sizePackedGCFEvent;
@@ -94,7 +99,8 @@ GCFEvent* GCFEvent::clone()
 	GCFEvent*	clonedEvent = new GCFEvent(signal);
 	clonedEvent->resizeBuf(bufferSize());
 	memcpy (clonedEvent->_buffer, _buffer, bufferSize());
-	return (clonedEvent);
+
+        return (clonedEvent);
 }
 
 //
diff --git a/MAC/Navigator2/colorDB/CMakeLists.txt b/MAC/Navigator2/colorDB/CMakeLists.txt
index 18748286e5b8b4de5db905f87cdfed1a7d48fe60..7ae487b5f72db398a14f8d9484d216c209811fbd 100644
--- a/MAC/Navigator2/colorDB/CMakeLists.txt
+++ b/MAC/Navigator2/colorDB/CMakeLists.txt
@@ -1 +1,5 @@
-0
+# $Id: CMakeLists.txt 29470 2014-06-10 10:11:41Z coolen $ 
+
+install(FILES
+  Lofar\ colors
+DESTINATION pvss/colorDB)
diff --git a/MAC/Navigator2/config/config.ccu b/MAC/Navigator2/config/config.ccu
index 021a61018b38a0b5ebdc1387148998f443af14e4..dcfcda63c94a773ca388fad07bae6355f289ae02 100644
--- a/MAC/Navigator2/config/config.ccu
+++ b/MAC/Navigator2/config/config.ccu
@@ -12,3 +12,5 @@ ctrlMaxPendings = 7500
 [dist]
 distPeer = "mcu001" 61
 
+[ui]
+aesShowDistDisconnections = 0
\ No newline at end of file
diff --git a/MAC/Navigator2/config/config.dist.station b/MAC/Navigator2/config/config.dist.station
index 4b7a9954fac9e4e0769ac911d7d2ab9fc385a00f..632b3c27aaa3f5cd0976d110fd131ba35bdc98d2 100644
--- a/MAC/Navigator2/config/config.dist.station
+++ b/MAC/Navigator2/config/config.dist.station
@@ -11,3 +11,6 @@ ctrlMaxPendings = 7500
 
 [dist]
 distPeer = "mcu001" 61
+
+[ui]
+aesShowDistDisconnections = 0
\ No newline at end of file
diff --git a/MAC/Navigator2/config/config.dist_test.station b/MAC/Navigator2/config/config.dist_test.station
index 42504368b6c1d469a419ba1c562b2a3feec1605e..476afe9c7bb5f2ac3a0976da2076e5d6cc6312cf 100644
--- a/MAC/Navigator2/config/config.dist_test.station
+++ b/MAC/Navigator2/config/config.dist_test.station
@@ -11,3 +11,6 @@ ctrlMaxPendings = 7500
 
 [dist]
 distPeer = "mcu199" 64
+
+[ui]
+aesShowDistDisconnections = 0
\ No newline at end of file
diff --git a/MAC/Navigator2/config/config.kis001 b/MAC/Navigator2/config/config.kis001
index 3fd4c79ba95bd935f8fb5324206d313252fa98f5..2e6393926e65437682e7aba146a4a4c636a103ce 100644
--- a/MAC/Navigator2/config/config.kis001
+++ b/MAC/Navigator2/config/config.kis001
@@ -9,3 +9,6 @@ userName = "root"
 password = ""
 
 pmonPort = 4999
+
+[ui]
+aesShowDistDisconnections = 0
\ No newline at end of file
diff --git a/MAC/Navigator2/config/config.maincu b/MAC/Navigator2/config/config.maincu
index c2461f21c4bb4e666a63f8caeb4b34e79c23c37b..0ec1a02d3aaf9c9cf9f27b7759cbb7638f6464e6 100644
--- a/MAC/Navigator2/config/config.maincu
+++ b/MAC/Navigator2/config/config.maincu
@@ -9,4 +9,7 @@ distributed = 1
 ctrlMaxPendings = 7500
 connectRetries = 30
 connectDelay = 20
-#mxproxy = "none"
+mxproxy = "none"
+
+[ui]
+aesShowDistDisconnections = 0
\ No newline at end of file
diff --git a/MAC/Navigator2/config/config.navigator.3.14 b/MAC/Navigator2/config/config.navigator.3.14
index f7828eebc79c2222ee461bd1515f757feb1b7275..1da376e5013e76f344e68770499f331daf2c46fa 100644
--- a/MAC/Navigator2/config/config.navigator.3.14
+++ b/MAC/Navigator2/config/config.navigator.3.14
@@ -1,35 +1,37 @@
-[general]
-pvss_path = "D:/Siemens/Automation/WinCC_OA/3.10"
-proj_path = "D:/Data/TRUNK-MCU001"
-proj_path = "D:/Data/TRUNK-Navigator2"
-proj_version = "3.10"
-langs = "en_US.iso88591"
-distributed = 1
-ctrlMaxPendings = 2000
-# avoid proxyserver to be used for contacts between 3.12 onwards and 3.10
-# can be removed as soon as all installations are updated to 3.14
-mxProxy = "None"
-
-#Set maximum connect messages size to unlimmited (needed for version 3.12 onwards because of the huge amount of Cobalt processes to connect to
-maxConnectMessageSize = 0
-messageCompression = "zlib-bzip2"
-useValueArchive = 1
-
-
-#local via putty from home or if working with local instantations of mcu/ccc/cs001
-#data = "localhost"
-#event = "localhost"
-
-#mcu001
-#data = "10.149.96.3"
-#event = "10.149.96.3"
-data = "mcu001.control.lofar"
-event = "mcu001.control.lofar"
-
-#mcu099
-#data = "10.149.96.23"
-#event = "10.149.96.23"
-
-#eventPort = 5997
-#dataPort = 5998
-pmonPort = 2025
+[general]
+pvss_path = "D:/Siemens/Automation/WinCC_OA/3.14"
+proj_path = "D:/Data/TRUNK-MCU001"
+proj_path = "D:/Data/TRUNK-Navigator2"
+proj_version = "3.14"
+langs = "en_US.iso88591"
+distributed = 1
+ctrlMaxPendings = 2000
+# avoid proxyserver to be used for contacts between 3.12 onwards and 3.10
+# can be removed as soon as all installations are updated to 3.14
+mxProxy = "None"
+
+#Set maximum connect messages size to unlimmited (needed for version 3.12 onwards because of the huge amount of Cobalt processes to connect to
+maxConnectMessageSize = 0
+messageCompression = "zlib-bzip2"
+useValueArchive = 1
+
+[ui]
+aesShowDistDisconnections = 0
+
+#local via putty from home or if working with local instantations of mcu/ccc/cs001
+#data = "localhost"
+#event = "localhost"
+
+#mcu001
+#data = "10.149.96.3"
+#event = "10.149.96.3"
+data = "mcu001.control.lofar"
+event = "mcu001.control.lofar"
+
+#mcu099
+#data = "10.149.96.23"
+#event = "10.149.96.23"
+
+#eventPort = 5997
+#dataPort = 5998
+pmonPort = 2025
diff --git a/MAC/Navigator2/config/config.navigator.windows_3.14 b/MAC/Navigator2/config/config.navigator.windows_3.14
index 005b8157e5f490b1df66447d59d01292e166fef5..0f69cff5d79b909f4c0c930fcbae9cd74291eae2 100644
--- a/MAC/Navigator2/config/config.navigator.windows_3.14
+++ b/MAC/Navigator2/config/config.navigator.windows_3.14
@@ -1,32 +1,34 @@
-[general]
-pvss_path = "D:/Siemens/Automation/WinCC_OA/3.14"
-proj_path = "D:/Data/TRUNK-MCU001"
-proj_path = "D:/Data/TRUNK-Navigator2"
-proj_version = "3.14"
-langs = "en_US.iso88591"
-ctrlMaxPendings = 2000
-mxProxy = "none"
-
-#Set Maximum connect messages to unlimmited (needed for huge amount of Cobalt connect and after 3.12)
-maxConnectMessageSize = 0
-messageCompression = "zlib-bzip2"
-useValueArchive = 1
-
-
-#local via putty from home or if working with local instantations of mcu/ccc/cs001
-#data = "localhost"
-#event = "localhost"
-
-#mcu001
-#data = "10.149.96.3"
-#event = "10.149.96.3"
-data = "mcu001.control.lofar"
-event = "mcu001.control.lofar"
-
-#mcu099
-#data = "10.149.96.23"
-#event = "10.149.96.23"
-
-#eventPort = 5997
-#dataPort = 5998
-pmonPort = 2025
+[general]
+pvss_path = "D:/Siemens/Automation/WinCC_OA/3.14"
+proj_path = "D:/Data/TRUNK-MCU001"
+proj_path = "D:/Data/TRUNK-Navigator2"
+proj_version = "3.14"
+langs = "en_US.iso88591"
+ctrlMaxPendings = 2000
+mxProxy = "none"
+
+#Set Maximum connect messages to unlimmited (needed for huge amount of Cobalt connect and after 3.12)
+maxConnectMessageSize = 0
+messageCompression = "zlib-bzip2"
+useValueArchive = 1
+
+[ui]
+aesShowDistDisconnections = 0
+
+#local via putty from home or if working with local instantations of mcu/ccc/cs001
+#data = "localhost"
+#event = "localhost"
+
+#mcu001
+#data = "10.149.96.3"
+#event = "10.149.96.3"
+data = "mcu001.control.lofar"
+event = "mcu001.control.lofar"
+
+#mcu099
+#data = "10.149.96.23"
+#event = "10.149.96.23"
+
+#eventPort = 5997
+#dataPort = 5998
+pmonPort = 2025
diff --git a/MAC/Navigator2/data/ACC-old.mib b/MAC/Navigator2/data/ACC-old.mib
new file mode 100644
index 0000000000000000000000000000000000000000..417785ab3c0c68ab375a586c42823e093c122063
--- /dev/null
+++ b/MAC/Navigator2/data/ACC-old.mib
@@ -0,0 +1,221 @@
+
+-- ACC Mib v. 1.00
+
+--   powecMIB MODULE-IDENTITY
+--       LAST-UPDATED "0705111430Z"
+--       ORGANIZATION "Power-One, Powec"
+--       CONTACT-INFO "Arild Sageboe, arild.sageboe@power-one.com"
+--       DESCRIPTION "System Information, ACC Power Systems"
+--       ::= { enterprises 5961 }
+
+ACC-MIB DEFINITIONS ::= BEGIN
+
+    IMPORTS
+
+	enterprises, IpAddress			FROM RFC1155-SMI
+	DisplayString 					FROM RFC1213-MIB
+	OBJECT-TYPE           			FROM RFC-1212
+	TRAP-TYPE 	    				FROM RFC-1215;
+
+
+
+    powecMIB			OBJECT IDENTIFIER ::= { enterprises 5961 }
+    accPowerSystem 		OBJECT IDENTIFIER ::= { powecMIB 4 }
+    
+    systemInfo 			OBJECT IDENTIFIER ::= { accPowerSystem 1 } 
+    powerSystem			OBJECT IDENTIFIER ::= { accPowerSystem 2 }    
+    alarmInfo			OBJECT IDENTIFIER ::= { accPowerSystem 3 }
+    systemParameters		OBJECT IDENTIFIER ::= { accPowerSystem 4 }
+    powecTrap			OBJECT IDENTIFIER ::= { accPowerSystem 99 }
+    
+-- SYSTEM INFO variables
+
+systemName OBJECT-TYPE
+    SYNTAX  DisplayString
+    ACCESS  read-write
+    STATUS  mandatory
+    DESCRIPTION
+	"System Type String for the DC System Site"
+    ::= { systemInfo 1 }
+
+powerSystemType	OBJECT-TYPE
+    SYNTAX DisplayString
+    ACCESS read-only
+    STATUS mandatory
+    DESCRIPTION
+	"String containing the type of power supply control module (ACC)"
+    ::= { systemInfo 2 }
+
+powerSystemSoftVer	OBJECT-TYPE
+    SYNTAX DisplayString
+    ACCESS read-only
+    STATUS mandatory
+    DESCRIPTION
+	"String containing the software version of the control module"
+    ::= { systemInfo 3 }
+
+powerSystemSerialNo	OBJECT-TYPE
+    SYNTAX INTEGER
+    ACCESS read-only
+    STATUS mandatory
+    DESCRIPTION
+	"Serial Number of the control module"
+    ::= { systemInfo 4 }
+
+outputData OBJECT-TYPE
+    SYNTAX DisplayString
+    ACCESS read-write
+    STATUS mandatory
+    DESCRIPTION
+	"String containing a description of the DC Output"
+    ::= { systemInfo 5 }
+
+batteryDescript OBJECT-TYPE
+    SYNTAX DisplayString
+    ACCESS read-write
+    STATUS mandatory
+    DESCRIPTION
+	"String containing a description of the Battery"
+    ::= { systemInfo 6 }
+
+batteryCapacity OBJECT-TYPE
+    SYNTAX INTEGER(0..30000)
+    ACCESS read-write
+    STATUS mandatory
+    DESCRIPTION
+	"An integer containing battery capacity in Ah"
+    
+    ::= { systemInfo 7 }
+
+-- POWER SYSTEM variables
+
+systemVoltage		OBJECT-TYPE
+    SYNTAX INTEGER(0..30000)
+    ACCESS read-only
+    STATUS mandatory
+    DESCRIPTION
+	"A variable containing the system DC voltage (voltage * 100)"
+    ::= { powerSystem 1 }
+
+loadCurrent		OBJECT-TYPE
+    SYNTAX INTEGER
+    ACCESS read-only
+    STATUS mandatory
+    DESCRIPTION
+	"A variable containing the system load current (current * 10)"
+    ::= { powerSystem 2 }
+
+batteryCurrent		OBJECT-TYPE
+    SYNTAX INTEGER
+    ACCESS read-only
+    STATUS mandatory
+    DESCRIPTION
+	"A variable containing the battery current (current * 10)"
+    ::= { powerSystem 3 }
+
+
+rectifierCurrent	OBJECT-TYPE
+    SYNTAX INTEGER
+    ACCESS read-only
+    STATUS mandatory
+    DESCRIPTION
+	"A variable containing the rectifier current (current * 10)"
+    ::= { powerSystem 4 }  
+
+battTemperature	OBJECT-TYPE
+    SYNTAX INTEGER
+    ACCESS read-only
+    STATUS mandatory
+    DESCRIPTION
+	"A variable containing the battery temperature(Degree C)"
+    ::= { powerSystem 5 }  
+
+acPhase1Voltage	OBJECT-TYPE
+    SYNTAX INTEGER
+    ACCESS read-only
+    STATUS mandatory
+    DESCRIPTION
+	"A variable containing AC input voltage for phase 1 (Volt), (-1) means measurement not available"
+    ::= { powerSystem 6 }  
+
+acPhase2Voltage	OBJECT-TYPE
+    SYNTAX INTEGER
+    ACCESS read-only
+    STATUS mandatory
+    DESCRIPTION
+	"A variable containing AC input voltage for phase 2 (Volt), (-1) means measurement not available"
+    ::= { powerSystem 7 }  
+
+acPhase3Voltage	OBJECT-TYPE
+    SYNTAX INTEGER
+    ACCESS read-only
+    STATUS mandatory
+    DESCRIPTION
+	"A variable containing AC input voltage for phase 3 (Volt), (-1) means measurement not available"
+    ::= { powerSystem 8 }  
+
+remainBatteryTime	OBJECT-TYPE
+    SYNTAX INTEGER
+    ACCESS read-only
+    STATUS mandatory
+    DESCRIPTION
+	"A variable containing the remaining battery time in (minutes)"
+    ::= { powerSystem 9 }  
+
+-- ALARM INFO variables (Alarm and Status Information)
+-- The alarmData, extraAlarmData and statusData
+-- are integers from 0-255 containing th
+::= { systemParameters 20 }
+
+batType	OBJECT-TYPE
+    SYNTAX INTEGER(0..255)
+    ACCESS read-write
+    STATUS mandatory
+    DESCRIPTION
+	"A variable containing the Type Of Battery"
+    ::= { systemParameters 21 }
+
+symLimit	OBJECT-TYPE
+    SYNTAX INTEGER(0..255)
+    ACCESS read-write
+    STATUS mandatory
+    DESCRIPTION
+	"A variable containing the Symmetry Limit (Volt*10)"
+    ::= { systemParameters 22 }
+
+autoTestFlag	OBJECT-TYPE
+    SYNTAX INTEGER(0..255)
+    ACCESS read-write
+    STATUS mandatory
+    DESCRIPTION
+	"A variable containing the number of automatic battery tests performed per year."
+    ::= { systemParameters 23 }
+
+startHForTest	OBJECT-TYPE
+    SYNTAX INTEGER(0..255)
+    ACCESS read-write
+    STATUS mandatory
+    DESCRIPTION
+	"A variable containing the Start Hour for Automatic Test"
+    ::= { systemParameters 24 }
+
+voltLimForTest	OBJECT-TYPE
+    SYNTAX INTEGER(0..30000)
+    ACCESS read-write
+    STATUS mandatory
+    DESCRIPTION
+	"A variable containing the Voltage Limit for Battery Test (Volt*10)"
+    ::= { systemParameters 25 }
+
+timeLimForTest	OBJECT-TYPE
+    SYNTAX INTEGER(0..30000)
+    ACCESS read-write
+    STATUS mandatory
+    DESCRIPTION
+	"A variable containing the Time Limit For Test (minutes)"
+    ::= { systemParameters 26 }
+
+ampLimForTest	OBJECT-TYPE
+    S
+    SYNTAX INTEGER(0..30
+
diff --git a/MAC/Navigator2/data/ACC.mib b/MAC/Navigator2/data/ACC.mib
new file mode 100644
index 0000000000000000000000000000000000000000..1a387c8ff70fc564da784bc634749a61633fda5b
--- /dev/null
+++ b/MAC/Navigator2/data/ACC.mib
@@ -0,0 +1,1092 @@
+-- ACC Mib v. 1.00
+
+--   powecMIB MODULE-IDENTITY
+--       LAST-UPDATED "0705111430Z"
+--       ORGANIZATION "Power-One, Powec"
+--       CONTACT-INFO "Arild Sageboe, arild.sageboe@power-one.com"
+--       DESCRIPTION "System Information, ACC Power Systems"
+--       ::= { enterprises 5961 }
+	
+ACC-MIB DEFINITIONS ::= BEGIN
+
+	IMPORTS
+
+   	enterprises, IpAddress			FROM RFC1155-SMI
+	DisplayString 					FROM RFC1213-MIB
+   	OBJECT-TYPE           			FROM RFC-1212
+	TRAP-TYPE 	    				FROM RFC-1215;
+
+
+
+	powecMIB			OBJECT IDENTIFIER ::= { enterprises 5961 }
+	accPowerSystem 		OBJECT IDENTIFIER ::= { powecMIB 4 }
+		
+	systemInfo 			OBJECT IDENTIFIER ::= { accPowerSystem 1 } 
+	powerSystem			OBJECT IDENTIFIER ::= { accPowerSystem 2 }    
+	alarmInfo			OBJECT IDENTIFIER ::= { accPowerSystem 3 }
+	systemParameters		OBJECT IDENTIFIER ::= { accPowerSystem 4 }
+	powecTrap			OBJECT IDENTIFIER ::= { accPowerSystem 99 }
+	
+-- SYSTEM INFO variables
+
+systemName OBJECT-TYPE
+	SYNTAX  DisplayString
+	ACCESS  read-write
+	STATUS  mandatory
+	DESCRIPTION
+		"System Type String for the DC System Site"
+	::= { systemInfo 1 }
+
+powerSystemType	OBJECT-TYPE
+	SYNTAX DisplayString
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"String containing the type of power supply control module (ACC)"
+	::= { systemInfo 2 }
+
+powerSystemSoftVer	OBJECT-TYPE
+	SYNTAX DisplayString
+	ACCESS read-only
+    STATUS mandatory
+	DESCRIPTION
+		"String containing the software version of the control module"
+	::= { systemInfo 3 }
+
+powerSystemSerialNo	OBJECT-TYPE
+	SYNTAX INTEGER
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"Serial Number of the control module"
+	::= { systemInfo 4 }
+
+outputData OBJECT-TYPE
+	SYNTAX DisplayString
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"String containing a description of the DC Output"
+	::= { systemInfo 5 }
+
+batteryDescript OBJECT-TYPE
+	SYNTAX DisplayString
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"String containing a description of the Battery"
+	::= { systemInfo 6 }
+	
+batteryCapacity OBJECT-TYPE
+	SYNTAX INTEGER(0..30000)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"An integer containing battery capacity in Ah"
+		
+	::= { systemInfo 7 }
+	
+-- POWER SYSTEM variables
+
+systemVoltage		OBJECT-TYPE
+	SYNTAX INTEGER(0..30000)
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the system DC voltage (voltage * 100)"
+	::= { powerSystem 1 }
+
+loadCurrent		OBJECT-TYPE
+	SYNTAX INTEGER
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the system load current (current * 10)"
+	::= { powerSystem 2 }
+
+batteryCurrent		OBJECT-TYPE
+	SYNTAX INTEGER
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the battery current (current * 10)"
+	::= { powerSystem 3 }
+
+
+rectifierCurrent	OBJECT-TYPE
+	SYNTAX INTEGER
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the rectifier current (current * 10)"
+	::= { powerSystem 4 }  
+
+battTemperature	OBJECT-TYPE
+	SYNTAX INTEGER
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the battery temperature(Degree C)"
+	::= { powerSystem 5 }  
+	
+acPhase1Voltage	OBJECT-TYPE
+	SYNTAX INTEGER
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing AC input voltage for phase 1 (Volt), (-1) means measurement not available"
+	::= { powerSystem 6 }  
+
+acPhase2Voltage	OBJECT-TYPE
+	SYNTAX INTEGER
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing AC input voltage for phase 2 (Volt), (-1) means measurement not available"
+	::= { powerSystem 7 }  
+
+acPhase3Voltage	OBJECT-TYPE
+	SYNTAX INTEGER
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing AC input voltage for phase 3 (Volt), (-1) means measurement not available"
+	::= { powerSystem 8 }  
+
+remainBatteryTime	OBJECT-TYPE
+	SYNTAX INTEGER
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the remaining battery time in (minutes)"
+	::= { powerSystem 9 }  
+
+-- ALARM INFO variables (Alarm and Status Information)
+-- The alarmData, extraAlarmData and statusData
+-- are integers from 0-255 containing the byte value received 
+-- from the controlmodule. 
+
+numbOfAlarms	OBJECT-TYPE
+	SYNTAX INTEGER(0..100)
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"Variable containing the number of active alarms at the moment, when sent with a trap 1 indicate active, 0 indicate clear"
+	::= { alarmInfo 1 }
+
+alarmData1	OBJECT-TYPE
+	SYNTAX INTEGER(0..255)
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"A byte containing alarm data 1"
+	::= { alarmInfo 2 }
+
+alarmData2	OBJECT-TYPE
+	SYNTAX INTEGER(0..255)
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"A byte containing alarm data 2"
+	::= { alarmInfo 3 }
+
+alarmData3	OBJECT-TYPE
+	SYNTAX INTEGER(0..255)
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"A byte containing alarm data 3"
+	::= { alarmInfo 4 }
+	
+extraAlarmData1	OBJECT-TYPE
+	SYNTAX INTEGER(0..255)
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"A byte containing extra alarm data 1"
+	::= { alarmInfo 5 }
+	
+extraAlarmData2	OBJECT-TYPE
+	SYNTAX INTEGER(0..255)
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"A byte containing extra alarm data 2"
+	::= { alarmInfo 6 }
+
+statusData1	OBJECT-TYPE
+	SYNTAX INTEGER(0..255)
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"A byte containing status data 1"
+	::= { alarmInfo 7 }
+
+statusData2	OBJECT-TYPE
+	SYNTAX INTEGER(0..255)
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"A byte containing status data 2"
+	::= { alarmInfo 8 }
+
+statusData3	OBJECT-TYPE
+	SYNTAX INTEGER(0..255)
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"A byte containing status data 3"
+	::= { alarmInfo 9 }
+
+statusData4	OBJECT-TYPE
+	SYNTAX INTEGER(0..255)
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"A byte containing status data 4"
+	::= { alarmInfo 10 }
+
+extAlarm1Name OBJECT-TYPE
+	SYNTAX  DisplayString
+	ACCESS  read-only
+	STATUS  mandatory
+	DESCRIPTION
+		"Ext.alarm 1 name"
+	::= { alarmInfo 11 }
+
+extAlarm2Name OBJECT-TYPE
+	SYNTAX  DisplayString
+	ACCESS  read-only
+	STATUS  mandatory
+	DESCRIPTION
+		"Ext.alarm 2 name"
+	::= { alarmInfo 12 }
+
+extAlarm3Name OBJECT-TYPE
+	SYNTAX  DisplayString
+	ACCESS  read-only
+	STATUS  mandatory
+	DESCRIPTION
+		"Ext.alarm 3 name"
+	::= { alarmInfo 13 }
+
+extAlarm4Name OBJECT-TYPE
+	SYNTAX  DisplayString
+	ACCESS  read-only
+	STATUS  mandatory
+	DESCRIPTION
+		"Ext.alarm 4 name"
+	::= { alarmInfo 14 }
+
+extAlarm5Name OBJECT-TYPE
+	SYNTAX  DisplayString
+	ACCESS  read-only
+	STATUS  mandatory
+	DESCRIPTION
+		"Ext.alarm 5 name"
+	::= { alarmInfo 15 }
+
+extAlarm6Name OBJECT-TYPE
+	SYNTAX  DisplayString
+	ACCESS  read-only
+	STATUS  mandatory
+	DESCRIPTION
+		"Ext.alarm 6 name"
+	::= { alarmInfo 16 }
+
+extAlarm7Name OBJECT-TYPE
+	SYNTAX  DisplayString
+	ACCESS  read-only
+	STATUS  mandatory
+	DESCRIPTION
+		"Ext.alarm 7 name"
+	::= { alarmInfo 17 }
+
+extAlarm8Name OBJECT-TYPE
+	SYNTAX  DisplayString
+	ACCESS  read-only
+	STATUS  mandatory
+	DESCRIPTION
+		"Ext.alarm 8 name"
+	::= { alarmInfo 18 }
+
+extAlarm9Name OBJECT-TYPE
+	SYNTAX  DisplayString
+	ACCESS  read-only
+	STATUS  mandatory
+	DESCRIPTION
+		"Ext.alarm 9 name"
+	::= { alarmInfo 19 }
+
+extAlarm10Name OBJECT-TYPE
+	SYNTAX  DisplayString
+	ACCESS  read-only
+	STATUS  mandatory
+	DESCRIPTION
+		"Ext.alarm 10 name"
+	::= { alarmInfo 20 }
+
+extAlarm11Name OBJECT-TYPE
+	SYNTAX  DisplayString
+	ACCESS  read-only
+	STATUS  mandatory
+	DESCRIPTION
+		"Ext.alarm 11 name"
+	::= { alarmInfo 21 }
+
+extAlarm12Name OBJECT-TYPE
+	SYNTAX  DisplayString
+	ACCESS  read-only
+	STATUS  mandatory
+	DESCRIPTION
+		"Ext.alarm 12 name"
+	::= { alarmInfo 22 }
+
+extAlarm13Name OBJECT-TYPE
+	SYNTAX  DisplayString
+	ACCESS  read-only
+	STATUS  mandatory
+	DESCRIPTION
+		"Ext.alarm 13 name"
+	::= { alarmInfo 23 }
+
+extAlarm14Name OBJECT-TYPE
+	SYNTAX  DisplayString
+	ACCESS  read-only
+	STATUS  mandatory
+	DESCRIPTION
+		"Ext.alarm 14 name"
+	::= { alarmInfo 24 }
+
+extAlarm15Name OBJECT-TYPE
+	SYNTAX  DisplayString
+	ACCESS  read-only
+	STATUS  mandatory
+	DESCRIPTION
+		"Ext.alarm 15 name"
+	::= { alarmInfo 25 }
+
+extAlarm16Name OBJECT-TYPE
+	SYNTAX  DisplayString
+	ACCESS  read-only
+	STATUS  mandatory
+	DESCRIPTION
+		"Ext.alarm 16 name"
+	::= { alarmInfo 26 }
+
+-- SYSTEM PARAMETERS
+
+uFlag	OBJECT-TYPE
+	SYNTAX INTEGER(0..255)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the operation mode Flag (normal, boost charge, test, spare)"
+	::= { systemParameters 1 }
+
+u1NormalRef	OBJECT-TYPE
+	SYNTAX INTEGER(0..30000)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing U1 (Normal) Reference Voltage (Volt*10)"
+	::= { systemParameters 2 }
+
+u2BoostRef	OBJECT-TYPE
+	SYNTAX INTEGER(0..30000)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing U2 (Boost) Reference Voltage (Volt*10)"
+	::= { systemParameters 3 }
+
+u3TestRef	OBJECT-TYPE
+	SYNTAX INTEGER(0..30000)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing U3 (Test) Reference Voltage (Volt*10)"
+	::= { systemParameters 4 }
+
+u4SpareRef	OBJECT-TYPE
+	SYNTAX INTEGER(0..30000)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing U4 (Spare) Reference Voltage (Volt*10)"
+	::= { systemParameters 5 }
+
+
+lowVoltLim	OBJECT-TYPE
+	SYNTAX INTEGER(0..30000)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Low Voltage Limit (Volt*10)"
+	::= { systemParameters 6 }
+
+
+lowVoltDisconVoltLim	OBJECT-TYPE
+	SYNTAX INTEGER(0..30000)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Low Voltage Disconnect Limit (Volt*10)"
+	::= { systemParameters 7 }
+
+lowVoltReconLim	OBJECT-TYPE
+	SYNTAX INTEGER(0..30000)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Low Voltage Reconnect Limit (Volt*10)"
+	::= { systemParameters 8 }
+	
+partLoadDiscon1Limit	OBJECT-TYPE
+	SYNTAX INTEGER(0..30000)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Partial Load Disconnection Limit. The limit will be in (V*10), or
+		in (minutes) depending on the configuration of the ACC"
+	::= { systemParameters 9 }
+
+partLoadDiscon2Limit	OBJECT-TYPE
+	SYNTAX INTEGER(0..30000)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Partial Load Disconnection Limit. The limit will be in (V*10), or
+		in (minutes) depending on the configuration of the ACC"
+	::= { systemParameters 10 }
+
+partLoadDiscon3Limit	OBJECT-TYPE
+	SYNTAX INTEGER(0..30000)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Partial Load Disconnection Limit. The limit will be in (V*10), or
+		in (minutes) depending on the configuration of the ACC"
+	::= { systemParameters 11 }
+
+highVoltLim	OBJECT-TYPE
+	SYNTAX INTEGER(0..30000)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the High Voltage Limit (Volt*10)"
+	::= { systemParameters 12 }
+	
+highVoltDisconLim	OBJECT-TYPE
+	SYNTAX INTEGER(0..30000)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the High Voltage Shutdown Limit (Volt*10)"
+	::= { systemParameters 13 }
+
+autoBoostFlag	OBJECT-TYPE
+	SYNTAX INTEGER(0..255)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Auto Boost Flag(1 for auto boost enabled, 0 disabled)."
+	::= { systemParameters 14 }
+
+boostTime	OBJECT-TYPE
+	SYNTAX INTEGER(0..255)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Boost Time value (hour*10)"
+	::= { systemParameters 15 }
+
+boostInterval	OBJECT-TYPE
+	SYNTAX INTEGER(0..255)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Boost Interval value (weeks*10)"
+	::= { systemParameters 16 }
+
+boostTimeFactor	OBJECT-TYPE
+	SYNTAX INTEGER(0..255)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Boost Time Factor"
+	::= { systemParameters 17 }
+
+boostLimit1	OBJECT-TYPE
+	SYNTAX INTEGER(0..30000)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Boost Limit1 value (Volt*10)"
+	::= { systemParameters 18 }
+
+boostLimit2	OBJECT-TYPE
+	SYNTAX INTEGER(0..30000)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Boost Limit2 value (Volt*10)"
+	::= { systemParameters 19 }
+
+
+noOfBatteries	OBJECT-TYPE
+	SYNTAX INTEGER(0..255)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Number of Batteries"
+	::= { systemParameters 20 }
+
+batType	OBJECT-TYPE
+	SYNTAX INTEGER(0..255)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Type Of Battery"
+	::= { systemParameters 21 }
+
+symLimit	OBJECT-TYPE
+	SYNTAX INTEGER(0..255)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Symmetry Limit (Volt*10)"
+	::= { systemParameters 22 }
+
+autoTestFlag	OBJECT-TYPE
+	SYNTAX INTEGER(0..255)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the number of automatic battery tests performed per year."
+	::= { systemParameters 23 }
+
+startHForTest	OBJECT-TYPE
+	SYNTAX INTEGER(0..255)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Start Hour for Automatic Test"
+	::= { systemParameters 24 }
+
+voltLimForTest	OBJECT-TYPE
+	SYNTAX INTEGER(0..30000)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Voltage Limit for Battery Test (Volt*10)"
+	::= { systemParameters 25 }
+
+timeLimForTest	OBJECT-TYPE
+	SYNTAX INTEGER(0..30000)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Time Limit For Test (minutes)"
+	::= { systemParameters 26 }
+
+ampLimForTest	OBJECT-TYPE
+	SYNTAX INTEGER(0..30000)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Amphour Limit For Test (Ah)"
+	::= { systemParameters 27 }
+
+year	OBJECT-TYPE
+	SYNTAX INTEGER(0..255)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Year"
+	::= { systemParameters 28 }
+
+month	OBJECT-TYPE
+	SYNTAX INTEGER(0..255)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Month"
+	::= { systemParameters 29 }
+
+day	OBJECT-TYPE
+	SYNTAX INTEGER(0..255)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Day"
+	::= { systemParameters 30 }
+
+hour	OBJECT-TYPE
+	SYNTAX INTEGER(0..255)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Hour"
+	::= { systemParameters 31 }
+
+minute	OBJECT-TYPE
+	SYNTAX INTEGER(0..255)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Minute"
+	::= { systemParameters 32 }
+
+tempCompFlag	OBJECT-TYPE
+	SYNTAX INTEGER(0..255)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Temperature Compensation Flag"
+	::= { systemParameters 33 }
+
+tempCompFactor	OBJECT-TYPE
+	SYNTAX INTEGER(0..255)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Temperature Compensation Factor (Volt*10/10C)"
+	::= { systemParameters 34 }
+
+highTempLimit	OBJECT-TYPE
+	SYNTAX INTEGER(0..255)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the High Temperature Limit (C)"
+	::= { systemParameters 35 }
+
+lowTempLimit	OBJECT-TYPE
+	SYNTAX INTEGER(0..255)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Low Temperature Limit (C)"
+	::= { systemParameters 36 }
+
+highLoadLimit	OBJECT-TYPE
+	SYNTAX INTEGER(0..30000)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the High Load Limit (% of full capacity)"
+	::= { systemParameters 37 }
+
+signals	OBJECT-TYPE
+	SYNTAX INTEGER(0..255)
+	ACCESS write-only
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Signal byte
+			Bit 0 - Reset Alarms
+			Bit 1 - Reconfigure System"
+	::= { systemParameters 38 }
+
+shuntA	OBJECT-TYPE
+	SYNTAX INTEGER(0..30000)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Shunt Current Rating (A)"
+	::= { systemParameters 39 }
+
+shuntmV	OBJECT-TYPE
+	SYNTAX INTEGER(0..30000)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Shunt mV Rating (mV)"
+	::= { systemParameters 40 }
+
+batCurrLimEnabled	OBJECT-TYPE
+	SYNTAX INTEGER(0..255)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"Battery Current Limit Enabled
+		"
+	::= { systemParameters 41 }
+
+currLimRef	OBJECT-TYPE
+	SYNTAX INTEGER(0..30000)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the battery Current Limit reference (Amp*10)"
+	::= { systemParameters 42 }
+
+highACVoltLim	OBJECT-TYPE
+	SYNTAX INTEGER(0..30000)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the High AC Voltage Limit (Volt)"
+	::= { systemParameters 43 }
+
+lowACVoltLim	OBJECT-TYPE
+	SYNTAX INTEGER(0..30000)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Low AC Voltage Limit (Volt)"
+	::= { systemParameters 44 }
+
+
+-- Traps
+
+lowVoltTrap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		numbOfAlarms
+    }
+    DESCRIPTION
+            "Low DC Voltage Alarm "
+    ::= 1
+
+
+highVoltTrap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		numbOfAlarms
+    }
+    DESCRIPTION
+            "High DC Voltage Alarm"
+    ::= 2
+    
+loadBattDisconTrap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		numbOfAlarms
+    }
+    DESCRIPTION
+            "Load/Battery Disconnected"
+    ::= 3
+mainsFailTrap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		numbOfAlarms
+    }
+    DESCRIPTION
+            "Mains Failure Alarm"
+    ::= 4
+distrFuseTrap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		numbOfAlarms
+    }
+    DESCRIPTION
+            "Distribution Fuse Failure"
+    ::= 5
+lowACTrap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		numbOfAlarms
+    }
+    DESCRIPTION
+            "Low AC input voltage"
+    ::= 6
+battFailTrap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		numbOfAlarms
+    }
+    DESCRIPTION
+            "Battery Test Failure"
+    ::= 7
+rectifierFailTrap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		numbOfAlarms
+    }
+    DESCRIPTION
+            "Module Alarm"
+    ::= 8
+
+battTempTrap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		numbOfAlarms
+    }
+    DESCRIPTION
+            "High Battery Temperature Alarm"
+    ::= 9
+symmFailTrap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		numbOfAlarms
+    }
+    DESCRIPTION
+            "Battery Symmetry Alarm"
+    ::= 10
+battFuseTrap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		numbOfAlarms
+    }
+    DESCRIPTION
+            "Battery Fuse Failure"
+    ::= 11
+highLoadTrap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		numbOfAlarms
+    }
+    DESCRIPTION
+            "High Load"
+    ::= 12
+highACTrap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		numbOfAlarms
+    }
+    DESCRIPTION
+            "High AC input voltage"
+    ::= 13
+urgentModFailTrap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		numbOfAlarms
+    }
+    DESCRIPTION
+            "Urgent Module Alarm"
+    ::= 14
+comFailTrap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		numbOfAlarms
+    }
+    DESCRIPTION
+            "Communication Failure"
+    ::= 15
+partLoadDiscon1Trap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		numbOfAlarms
+    }
+    DESCRIPTION
+            "Partial Load Disconnect 1 Alarm"
+    ::= 16
+tempProbeTrap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		numbOfAlarms
+    }
+    DESCRIPTION
+            "Temperature probe fault"
+    ::= 17
+dischargingTrap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		numbOfAlarms
+    }
+    DESCRIPTION
+            "Battery on Discharge"
+    ::= 18
+ovShutdownTrap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		numbOfAlarms
+    }
+    DESCRIPTION
+            "Overvoltage Shutdown alarm"
+    ::= 19
+lowBattTempTrap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		numbOfAlarms
+    }
+    DESCRIPTION
+            "Low Battery Temperature"
+    ::= 20
+partLoadDiscon2Trap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		numbOfAlarms
+    }
+    DESCRIPTION
+            "Partial Load Disconnect 2 Alarm"
+    ::= 21
+partLoadDiscon3Trap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		numbOfAlarms
+    }
+    DESCRIPTION
+            "Partial Load Disconnect 3 Alarm"
+    ::= 22
+alarmsBlockedTrap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		numbOfAlarms
+    }
+    DESCRIPTION
+            "Alarms Blocked"
+    ::= 23
+extAlarm0Trap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		numbOfAlarms
+    }
+    DESCRIPTION
+            "Ext.alarm 0"
+    ::= 24
+extAlarm1Trap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		numbOfAlarms
+    }
+    DESCRIPTION
+            "Ext.alarm 1"
+    ::= 25
+extAlarm2Trap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		numbOfAlarms
+    }
+    DESCRIPTION
+            "Ext.alarm 2"
+    ::= 26
+extAlarm3Trap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		numbOfAlarms
+    }
+    DESCRIPTION
+            "Ext.alarm 3"
+    ::= 27
+extAlarm4Trap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		numbOfAlarms
+    }
+    DESCRIPTION
+            "Ext.alarm 4"
+    ::= 28
+extAlarm5Trap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		numbOfAlarms
+    }
+    DESCRIPTION
+            "Ext.alarm 5"
+    ::= 29
+extAlarm6Trap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		numbOfAlarms
+    }
+    DESCRIPTION
+            "Ext.alarm 6"
+    ::= 30
+extAlarm7Trap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		numbOfAlarms
+    }
+    DESCRIPTION
+            "Ext.alarm 7"
+    ::= 31
+extAlarm8Trap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		numbOfAlarms
+    }
+    DESCRIPTION
+            "Ext.alarm 8"
+    ::= 32
+extAlarm9Trap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		numbOfAlarms
+    }
+    DESCRIPTION
+            "Ext.alarm 9"
+    ::= 33
+extAlarm10Trap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		numbOfAlarms
+    }
+    DESCRIPTION
+            "Ext.alarm 10"
+    ::= 34
+extAlarm11Trap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		numbOfAlarms
+    }
+    DESCRIPTION
+            "Ext.alarm 11"
+    ::= 35
+extAlarm12Trap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		numbOfAlarms
+    }
+    DESCRIPTION
+            "Ext.alarm 12"
+    ::= 36
+extAlarm13Trap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		numbOfAlarms
+    }
+    DESCRIPTION
+            "Ext.alarm 13"
+    ::= 37
+extAlarm14Trap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		numbOfAlarms
+    }
+    DESCRIPTION
+            "Ext.alarm 14"
+    ::= 38
+extAlarm15Trap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		numbOfAlarms
+    }
+    DESCRIPTION
+            "Ext.alarm 15"
+    ::= 39
+u1NormalTrap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		numbOfAlarms
+    }
+    DESCRIPTION
+            "System output reference changed to Normal"
+    ::= 40
+u2BoostTrap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		numbOfAlarms
+    }
+    DESCRIPTION
+            "System output reference changed to Boost"
+    ::= 41
+u3TestTrap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		numbOfAlarms
+    }
+    DESCRIPTION
+            "System output reference changed to Test"
+    ::= 42
+u4SpareTrap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		numbOfAlarms
+    }
+    DESCRIPTION
+            "System output reference changed to Spare"
+    ::= 43
+ 
+END
diff --git a/MAC/Navigator2/data/ACX-MIB_1.10.mib b/MAC/Navigator2/data/ACX-MIB_1.10.mib
new file mode 100644
index 0000000000000000000000000000000000000000..97db47293d63918abef3b08b3ae6fa7eda8891e0
--- /dev/null
+++ b/MAC/Navigator2/data/ACX-MIB_1.10.mib
@@ -0,0 +1,2170 @@
+-- ACX Mib v. 1.10
+
+--   powecMIB MODULE-IDENTITY
+--       LAST-UPDATED "201509040000Z"
+-- 		 last modification by JM
+--       ORGANIZATION "Unipower"
+--       CONTACT-INFO "www.unipowerco.com"
+--       DESCRIPTION "System Information, ACX Power Systems"
+--       ::= { enterprises 5961 }
+	
+ACX-MIB DEFINITIONS ::= BEGIN
+
+	IMPORTS
+
+--   	enterprises, IpAddress		FROM RFC1155-SMI
+--	DisplayString 			FROM RFC1213-MIB
+--  	OBJECT-TYPE           		FROM RFC-1212
+--	TRAP-TYPE 	    		FROM RFC-1215;
+
+   MODULE-IDENTITY,enterprises, 
+   IpAddress ,Integer32		   				FROM SNMPv2-SMI
+   -- Gauge, TimeTicks     						FROM RFC1155-SMI
+   DisplayString                                FROM SNMPv2-TC
+   OBJECT-TYPE                                  FROM RFC-1212
+   NOTIFICATION-TYPE                        	FROM SNMPv2-SMI
+   -- TRAP-TYPE                                 FROM RFC-1215
+   SnmpSecurityModel,
+   SnmpMessageProcessingModel,
+   SnmpSecurityLevel,
+   SnmpAdminString				      			FROM SNMP-FRAMEWORK-MIB
+   KeyChange									FROM SNMP-USER-BASED-SM-MIB
+   TEXTUAL-CONVENTION							FROM SNMPv2-TC;
+ --  MODULE-COMPLIANCE, OBJECT-GROUP , 
+ --  NOTIFICATION-GROUP      						FROM SNMPv2-CONF;
+
+	powecMIB			OBJECT IDENTIFIER ::= { enterprises 5961 }
+	acxPowerSystem 			OBJECT IDENTIFIER ::= { powecMIB 5 }
+		
+	systemInfo 			OBJECT IDENTIFIER ::= { acxPowerSystem 1 } 
+	powerSystem			OBJECT IDENTIFIER ::= { acxPowerSystem 2 } 
+	systemParameters		OBJECT IDENTIFIER ::= { acxPowerSystem 3 }
+	agentSetup			OBJECT IDENTIFIER ::= { acxPowerSystem 4 }
+	alarmInfo			OBJECT IDENTIFIER ::= { acxPowerSystem 5 }
+	rectifierInfo			OBJECT IDENTIFIER ::= { acxPowerSystem 6 }
+	batteryInfo			OBJECT IDENTIFIER ::= { acxPowerSystem 7 }
+	alarmHistory			OBJECT IDENTIFIER ::= { acxPowerSystem 8 }
+	dcdcInfo			OBJECT IDENTIFIER ::= { acxPowerSystem 9 }
+	sliInfo				OBJECT IDENTIFIER ::= { acxPowerSystem 10 }
+	alarmTable				OBJECT IDENTIFIER ::= { acxPowerSystem 11 }
+	snmpV3USM				OBJECT IDENTIFIER ::= { acxPowerSystem 98 }
+	powecACXTrap			OBJECT IDENTIFIER ::= { acxPowerSystem 99 }
+
+
+UsmAuthProtocol ::=  TEXTUAL-CONVENTION
+       STATUS  current
+       DESCRIPTION
+           "This textual convention enumerates the authentication protocol for USM configuration."
+       SYNTAX    INTEGER
+ 			{
+				hmacMD5Auth(0),
+				hmacSHAAuth(1),
+				noAuthProtocol(2)
+			}
+
+UsmPrivProtocol ::=  TEXTUAL-CONVENTION
+       STATUS  current
+       DESCRIPTION
+           "This textual convention enumerates the privacy protocol for USM configuration."
+       SYNTAX    INTEGER
+ 			{
+				aesPrivProtocol(1),
+				noPrivProtocol(2)
+			}
+			
+-- SYSTEM INFO variables
+
+systemName OBJECT-TYPE
+	SYNTAX  DisplayString (SIZE (0..32))
+	ACCESS  read-write
+	STATUS  mandatory
+	DESCRIPTION
+		"System Type String for the DC System Site"
+	::= { systemInfo 1 }
+
+powerSystemType	OBJECT-TYPE
+	SYNTAX DisplayString
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"String containing the type of power supply control module (ACX)"
+	::= { systemInfo 2 }
+
+powerSystemSoftVer	OBJECT-TYPE
+	SYNTAX DisplayString
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"String containing the software version of the control module"
+	::= { systemInfo 3 }
+
+powerSystemSerialNo	OBJECT-TYPE
+	SYNTAX INTEGER(0..4294967295)
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"Serial Number of the control module"
+	::= { systemInfo 4 }
+
+outputData OBJECT-TYPE
+	SYNTAX DisplayString (SIZE (0..11))
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"String containing a description of the DC Output"
+	::= { systemInfo 5 }
+
+batteryDescript OBJECT-TYPE
+	SYNTAX DisplayString (SIZE (0..19))
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"String containing a description of the Battery"
+	::= { systemInfo 6 }
+	
+batteryCapacity OBJECT-TYPE
+	SYNTAX INTEGER(0..30000)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"An integer containing battery capacity in Ah"
+		
+	::= { systemInfo 7 }
+	
+installationDate OBJECT-TYPE
+	SYNTAX DisplayString
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"Installation date of the system of the form 'DD.MM.YY'"
+		
+	::= { systemInfo 8 }
+	
+updateDate OBJECT-TYPE
+	SYNTAX DisplayString
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"Last date of updating system of the form 'DD.MM.YY'"
+		
+	::= { systemInfo 9 }
+	
+powerSystemAddress OBJECT-TYPE
+	SYNTAX INTEGER (0..255)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"An integer containing the address of the System"
+		
+	::= { systemInfo 10 }	
+	
+-- POWER SYSTEM variables
+
+systemVoltage		OBJECT-TYPE
+	SYNTAX INTEGER(0..30000)
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the system DC voltage (V*100)"
+	::= { powerSystem 1 }
+
+loadCurrent		OBJECT-TYPE
+	SYNTAX INTEGER
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the system load current (A*10)"
+	::= { powerSystem 2 }
+
+batteryCurrent		OBJECT-TYPE
+	SYNTAX INTEGER
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the battery current (A*10)"
+	::= { powerSystem 3 }
+
+
+rectifierCurrent	OBJECT-TYPE
+	SYNTAX INTEGER
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the rectifier current (A*10)"
+	::= { powerSystem 4 }  
+
+battTemperature	OBJECT-TYPE
+	SYNTAX INTEGER
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the battery temperature(C)"
+	::= { powerSystem 5 }  
+	
+acPhase1Voltage	OBJECT-TYPE
+	SYNTAX INTEGER
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing AC input voltage for phase 1 (V), (-1) means measurement not available"
+	::= { powerSystem 6 }  
+
+acPhase2Voltage	OBJECT-TYPE
+	SYNTAX INTEGER
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing AC input voltage for phase 2 (V), (-1) means measurement not available"
+	::= { powerSystem 7 }  
+
+acPhase3Voltage	OBJECT-TYPE
+	SYNTAX INTEGER
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing AC input voltage for phase 3 (V), (-1) means measurement not available"
+	::= { powerSystem 8 }  
+
+remainBatteryTime	OBJECT-TYPE
+	SYNTAX INTEGER
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the remaining battery time in (minutes)"
+	::= { powerSystem 9 } 	
+
+dcdcCurrent	OBJECT-TYPE
+	SYNTAX INTEGER
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the DC/DC units total current (A*10)"
+	::= { powerSystem 10 }  
+	
+-- SYSTEM PARAMETERS
+
+uFlag	OBJECT-TYPE
+	SYNTAX INTEGER(0..255)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the operation mode Flag (normal, boost charge, test, spare)"
+	::= { systemParameters 1 }
+
+u1NormalRef	OBJECT-TYPE
+	SYNTAX INTEGER(0..30000)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing U1 (Normal) Reference Voltage (V*10)"
+	::= { systemParameters 2 }
+
+u2BoostRef	OBJECT-TYPE
+	SYNTAX INTEGER(0..30000)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing U2 (Boost) Reference Voltage (V*10)"
+	::= { systemParameters 3 }
+
+u3TestRef	OBJECT-TYPE
+	SYNTAX INTEGER(0..30000)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing U3 (Test) Reference Voltage (V*10)"
+	::= { systemParameters 4 }
+
+u4SpareRef	OBJECT-TYPE
+	SYNTAX INTEGER(0..30000)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing U4 (Spare) Reference Voltage (V*10)"
+	::= { systemParameters 5 }
+
+
+lowVoltLim OBJECT-TYPE
+	SYNTAX INTEGER(0..30000)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Low Voltage Limit (V*10)"
+	::= { systemParameters 6 }
+
+
+lowVoltDisconVoltLim	OBJECT-TYPE
+	SYNTAX INTEGER(0..30000)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Low Voltage Disconnect Limit (V*10)"
+	::= { systemParameters 7 }
+
+lowVoltReconLim	OBJECT-TYPE
+	SYNTAX INTEGER(0..30000)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Low Voltage Reconnect Limit (V*10)"
+	::= { systemParameters 8 }
+	
+partLoadDiscon1Limit	OBJECT-TYPE
+	SYNTAX INTEGER(0..30000)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Partial Load Disconnection Limit. The limit will be in (V*10), or
+		in (minutes) depending on the configuration of the ACX"
+	::= { systemParameters 9 }
+
+partLoadDiscon2Limit	OBJECT-TYPE
+	SYNTAX INTEGER(0..30000)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Partial Load Disconnection Limit. The limit will be in (V*10), or
+		in (minutes) depending on the configuration of the ACX"
+	::= { systemParameters 10 }
+
+partLoadDiscon3Limit	OBJECT-TYPE
+	SYNTAX INTEGER(0..30000)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Partial Load Disconnection Limit. The limit will be in (V*10), or
+		in (minutes) depending on the configuration of the ACX"
+	::= { systemParameters 11 }
+
+highVoltLim	OBJECT-TYPE
+	SYNTAX INTEGER(0..30000)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the High Voltage Limit (V*10)"
+	::= { systemParameters 12 }
+	
+highVoltDisconLim	OBJECT-TYPE
+	SYNTAX INTEGER(0..30000)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the High Voltage Shutdown Limit (V*10)"
+	::= { systemParameters 13 }
+
+autoBoostFlag	OBJECT-TYPE
+	SYNTAX INTEGER(0..255)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Auto Boost Flag(1 for auto boost enabled, 0 disabled)."
+	::= { systemParameters 14 }
+
+boostTime	OBJECT-TYPE
+	SYNTAX INTEGER (0..255)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Boost Time value (hour*10)"
+	::= { systemParameters 15 }
+
+boostInterval	OBJECT-TYPE
+	SYNTAX INTEGER(0..255)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Boost Interval value (weeks*10)"
+	::= { systemParameters 16 }
+
+boostTimeFactor	OBJECT-TYPE
+	SYNTAX INTEGER(0..255)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Boost Time Factor"
+	::= { systemParameters 17 }
+
+boostLimit1	OBJECT-TYPE
+	SYNTAX INTEGER(0..30000)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Boost Limit1 value (V*10)"
+	::= { systemParameters 18 }
+
+boostLimit2	OBJECT-TYPE
+	SYNTAX INTEGER(0..30000)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Boost Limit2 value (V*10)"
+	::= { systemParameters 19 }
+
+
+noOfBatteries	OBJECT-TYPE
+	SYNTAX INTEGER(0..255)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Number of Batteries"
+	::= { systemParameters 20 }
+
+batType	OBJECT-TYPE
+	SYNTAX INTEGER(0..255)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Type Of Battery"
+	::= { systemParameters 21 }
+
+symLimit	OBJECT-TYPE
+	SYNTAX INTEGER(0..255)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Symmetry Limit (V*10)"
+	::= { systemParameters 22 }
+
+autoTestFlag	OBJECT-TYPE
+	SYNTAX INTEGER(0..255)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the number of automatic battery tests performed per year."
+	::= { systemParameters 23 }
+
+startHForTest	OBJECT-TYPE
+	SYNTAX INTEGER(0..255)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Start Hour for Automatic Test"
+	::= { systemParameters 24 }
+
+voltLimForTest	OBJECT-TYPE
+	SYNTAX INTEGER(0..30000)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Voltage Limit for Battery Test (V*10)"
+	::= { systemParameters 25 }
+
+timeLimForTest	OBJECT-TYPE
+	SYNTAX INTEGER(0..30000)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Time Limit For Test (minutes)"
+	::= { systemParameters 26 }
+
+ampLimForTest	OBJECT-TYPE
+	SYNTAX INTEGER(0..30000)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Amphour Limit For Test (Ah)"
+	::= { systemParameters 27 }
+
+year	OBJECT-TYPE
+	SYNTAX INTEGER(0..255)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Year"
+	::= { systemParameters 28 }
+
+month	OBJECT-TYPE
+	SYNTAX INTEGER(0..255)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Month"
+	::= { systemParameters 29 }
+
+day	OBJECT-TYPE
+	SYNTAX INTEGER(0..255)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Day"
+	::= { systemParameters 30 }
+
+hour	OBJECT-TYPE
+	SYNTAX INTEGER(0..255)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Hour"
+	::= { systemParameters 31 }
+
+minute	OBJECT-TYPE
+	SYNTAX INTEGER(0..255)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Minute"
+	::= { systemParameters 32 }
+
+tempCompFlag	OBJECT-TYPE
+	SYNTAX INTEGER(0..255)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Temperature Compensation Flag"
+	::= { systemParameters 33 }
+
+tempCompFactor	OBJECT-TYPE
+	SYNTAX INTEGER(0..255)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Temperature Compensation Factor (V*10/10C)"
+	::= { systemParameters 34 }
+
+highTempLimit	OBJECT-TYPE
+	SYNTAX INTEGER(0..255)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the High Temperature Limit (C)"
+	::= { systemParameters 35 }
+
+lowTempLimit	OBJECT-TYPE
+	SYNTAX INTEGER(0..255)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Low Temperature Limit (C)"
+	::= { systemParameters 36 }
+
+highLoadLimit	OBJECT-TYPE
+	SYNTAX INTEGER(0..30000)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the High Load Limit (% of full capacity)"
+	::= { systemParameters 37 }
+
+signals	OBJECT-TYPE
+	SYNTAX INTEGER(0..255)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Signal byte
+			Bit 0 - Reset Alarms
+			Bit 1 - Reconfigure System"
+	::= { systemParameters 38 }
+
+shuntA	OBJECT-TYPE
+	SYNTAX INTEGER(0..30000)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Shunt Current Rating (A)"
+	::= { systemParameters 39 }
+
+shuntmV	OBJECT-TYPE
+	SYNTAX INTEGER(0..30000)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Shunt mV Rating (mV)"
+	::= { systemParameters 40 }
+
+batCurrLimEnabled	OBJECT-TYPE
+	SYNTAX INTEGER(0..255)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"Battery Current Limit Enabled
+		"
+	::= { systemParameters 41 }
+
+currLimRef	OBJECT-TYPE
+	SYNTAX INTEGER(0..30000)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the battery Current Limit reference (A*10)"
+	::= { systemParameters 42 }
+
+highACVoltLim	OBJECT-TYPE
+	SYNTAX INTEGER(0..30000)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the High AC Voltage Limit (V)"
+	::= { systemParameters 43 }
+
+lowACVoltLim OBJECT-TYPE
+	SYNTAX INTEGER(0..30000)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Low AC Voltage Limit (V)"
+	::= { systemParameters 44 }	
+	
+turnOnOffRecifiers OBJECT-TYPE
+	SYNTAX INTEGER { OFF(0), ON(1) }
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A switch for turning On/Off rectifiers, 
+		 NOTE: If system does not have another power source (e.g. battery),
+		 this will cause system shutdown"
+	::= { systemParameters 45 }	
+	
+-- AGENT SETUP
+trapReciepient1 OBJECT-TYPE
+	SYNTAX IpAddress
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"IP address of Trap Reciepient 1"
+	::= { agentSetup 1 }
+	
+trapReciepient2 OBJECT-TYPE
+	SYNTAX IpAddress
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"IP address of Trap Reciepient 2"
+	::= { agentSetup 2 }
+	
+trapReciepient3 OBJECT-TYPE
+	SYNTAX IpAddress
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"IP address of Trap Reciepient 3"
+	::= { agentSetup 3 }
+	
+trapReciepient4 OBJECT-TYPE
+	SYNTAX IpAddress
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"IP address of Trap Reciepient 4"
+	::= { agentSetup 4 }
+	
+trapReciepient5 OBJECT-TYPE
+	SYNTAX IpAddress
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"IP address of Trap Reciepient 5"
+	::= { agentSetup 5 }
+	
+trapReciepient6 OBJECT-TYPE
+	SYNTAX IpAddress
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"IP address of Trap Reciepient 6"
+	::= { agentSetup 6 }
+	
+trapReciepient7 OBJECT-TYPE
+	SYNTAX IpAddress
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"IP address of Trap Reciepient 7"
+	::= { agentSetup 7 }
+	
+trapReciepient8 OBJECT-TYPE
+	SYNTAX IpAddress
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"IP address of Trap Reciepient 8"
+	::= { agentSetup 8 }
+	
+trapCommunityName OBJECT-TYPE
+	SYNTAX DisplayString (SIZE (0..15))
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing Trap community name"
+	::= { agentSetup 9 }	
+	
+
+-- ALARM INFO variables (Alarm and Status Information)
+-- The alarmData, extraAlarmData and statusData
+-- are integers from 0-255 containing the byte value received 
+-- from the controlmodule. 
+
+numbOfAlarms	OBJECT-TYPE
+	SYNTAX INTEGER(0..100)
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"Variable containing the number of active alarms at the moment, when sent with a trap 1 indicate active, 0 indicate clear"
+	::= { alarmInfo 1 }
+
+alarmData1	OBJECT-TYPE
+	SYNTAX INTEGER (0..255)
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"A byte containing alarm data 1"
+	::= { alarmInfo 2 }
+
+alarmData2	OBJECT-TYPE
+	SYNTAX INTEGER (0..255)
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"A byte containing alarm data 2"
+	::= { alarmInfo 3 }
+
+alarmData3	OBJECT-TYPE
+	SYNTAX INTEGER (0..255)
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"A byte containing alarm data 3"
+	::= { alarmInfo 4 }
+	
+extraAlarmData1	OBJECT-TYPE
+	SYNTAX INTEGER (0..255)
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"A byte containing extra alarm data 1"
+	::= { alarmInfo 5 }
+	
+extraAlarmData2	OBJECT-TYPE
+	SYNTAX INTEGER (0..255)
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"A byte containing extra alarm data 2"
+	::= { alarmInfo 6 }
+
+statusData1	OBJECT-TYPE
+	SYNTAX INTEGER (0..255)
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"A byte containing status data 1"
+	::= { alarmInfo 7 }
+
+statusData2	OBJECT-TYPE
+	SYNTAX INTEGER (0..255)
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"A byte containing status data 2"
+	::= { alarmInfo 8 }
+
+statusData3	OBJECT-TYPE
+	SYNTAX INTEGER (0..255)
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"A byte containing status data 3"
+	::= { alarmInfo 9 }
+
+statusData4	OBJECT-TYPE
+	SYNTAX INTEGER (0..255)
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"A byte containing status data 4"
+	::= { alarmInfo 10 }
+
+extAlarm0Name OBJECT-TYPE
+	SYNTAX  DisplayString
+	ACCESS  read-only
+	STATUS  mandatory
+	DESCRIPTION
+		"Ext.alarm 0 name"
+	::= { alarmInfo 11 }
+
+extAlarm1Name OBJECT-TYPE
+	SYNTAX  DisplayString
+	ACCESS  read-only
+	STATUS  mandatory
+	DESCRIPTION
+		"Ext.alarm 1 name"
+	::= { alarmInfo 12 }
+
+extAlarm2Name OBJECT-TYPE
+	SYNTAX  DisplayString
+	ACCESS  read-only
+	STATUS  mandatory
+	DESCRIPTION
+		"Ext.alarm 2 name"
+	::= { alarmInfo 13 }
+
+extAlarm3Name OBJECT-TYPE
+	SYNTAX  DisplayString
+	ACCESS  read-only
+	STATUS  mandatory
+	DESCRIPTION
+		"Ext.alarm 3 name"
+	::= { alarmInfo 14 }
+
+extAlarm4Name OBJECT-TYPE
+	SYNTAX  DisplayString
+	ACCESS  read-only
+	STATUS  mandatory
+	DESCRIPTION
+		"Ext.alarm 4 name"
+	::= { alarmInfo 15 }
+
+extAlarm5Name OBJECT-TYPE
+	SYNTAX  DisplayString
+	ACCESS  read-only
+	STATUS  mandatory
+	DESCRIPTION
+		"Ext.alarm 5 name"
+	::= { alarmInfo 16 }
+
+extAlarm6Name OBJECT-TYPE
+	SYNTAX  DisplayString
+	ACCESS  read-only
+	STATUS  mandatory
+	DESCRIPTION
+		"Ext.alarm 6 name"
+	::= { alarmInfo 17 }
+
+extAlarm7Name OBJECT-TYPE
+	SYNTAX  DisplayString
+	ACCESS  read-only
+	STATUS  mandatory
+	DESCRIPTION
+		"Ext.alarm 7 name"
+	::= { alarmInfo 18 }
+
+extAlarm8Name OBJECT-TYPE
+	SYNTAX  DisplayString
+	ACCESS  read-only
+	STATUS  mandatory
+	DESCRIPTION
+		"Ext.alarm 8 name"
+	::= { alarmInfo 19 }
+
+extAlarm9Name OBJECT-TYPE
+	SYNTAX  DisplayString
+	ACCESS  read-only
+	STATUS  mandatory
+	DESCRIPTION
+		"Ext.alarm 9 name"
+	::= { alarmInfo 20 }
+
+extAlarm10Name OBJECT-TYPE
+	SYNTAX  DisplayString
+	ACCESS  read-only
+	STATUS  mandatory
+	DESCRIPTION
+		"Ext.alarm 10 name"
+	::= { alarmInfo 21 }
+
+extAlarm11Name OBJECT-TYPE
+	SYNTAX  DisplayString
+	ACCESS  read-only
+	STATUS  mandatory
+	DESCRIPTION
+		"Ext.alarm 11 name"
+	::= { alarmInfo 22 }
+
+extAlarm12Name OBJECT-TYPE
+	SYNTAX  DisplayString
+	ACCESS  read-only
+	STATUS  mandatory
+	DESCRIPTION
+		"Ext.alarm 12 name"
+	::= { alarmInfo 23 }
+
+extAlarm13Name OBJECT-TYPE
+	SYNTAX  DisplayString
+	ACCESS  read-only
+	STATUS  mandatory
+	DESCRIPTION
+		"Ext.alarm 13 name"
+	::= { alarmInfo 24 }
+
+extAlarm14Name OBJECT-TYPE
+	SYNTAX  DisplayString
+	ACCESS  read-only
+	STATUS  mandatory
+	DESCRIPTION
+		"Ext.alarm 14 name"
+	::= { alarmInfo 25 }
+
+extAlarm15Name OBJECT-TYPE
+	SYNTAX  DisplayString
+	ACCESS  read-only
+	STATUS  mandatory
+	DESCRIPTION
+		"Ext.alarm 15 name"
+	::= { alarmInfo 26 }
+	
+-- rectifierInfo
+numOfRectifiers OBJECT-TYPE
+    SYNTAX INTEGER(0..255)
+    ACCESS read-only
+    STATUS mandatory
+    DESCRIPTION
+        "Number of Rectifiers installed in the system"
+    ::= { rectifierInfo 1 }   
+
+numOfChannels OBJECT-TYPE
+    SYNTAX INTEGER(0..255)
+    ACCESS read-only
+    STATUS mandatory
+    DESCRIPTION
+        "Number of RS485 channels in the system"
+    ::= { rectifierInfo 3 }
+
+selectChannel OBJECT-TYPE
+    SYNTAX INTEGER(0..255)
+    ACCESS read-write
+    STATUS mandatory
+    DESCRIPTION
+        "Select actual channel for which module table will be displayed"
+    ::= { rectifierInfo 4 }
+
+moduleTable OBJECT-TYPE
+    SYNTAX SEQUENCE OF ModuleEntry
+    ACCESS not-accessible
+    STATUS mandatory
+    DESCRIPTION
+        "Module Information Table"
+    ::= { rectifierInfo 2 }        
+    
+moduleEntry OBJECT-TYPE
+    SYNTAX ModuleEntry
+    ACCESS not-accessible
+    STATUS mandatory
+    DESCRIPTION
+        "Queue of Module Table"
+    INDEX { moduleIndex }
+     ::= { moduleTable 1 }
+     
+ModuleEntry ::=
+    SEQUENCE {
+        moduleIndex
+            INTEGER,
+        moduleAddress
+            INTEGER,
+        moduleComStatus
+            INTEGER,
+        moduleOk
+            INTEGER,
+        moduleEnabled
+            INTEGER,
+        inputVoltage
+        	INTEGER,
+		outputVoltage
+			INTEGER,
+		outputCurrent
+			INTEGER,
+		meanCurrent
+			INTEGER,
+		temperature
+			INTEGER,
+		moduleStatus
+			INTEGER,
+		moduleFlag
+			INTEGER,
+		moduleConfig
+			INTEGER,
+		softVersion
+			 DisplayString,
+		serialNumber
+			INTEGER
+	}
+	
+moduleIndex OBJECT-TYPE
+	SYNTAX INTEGER(0..100)
+    ACCESS  read-only
+	STATUS  mandatory
+    DESCRIPTION
+        "Entry number in the Module Table"
+    ::= { moduleEntry 1 }
+
+moduleAddress OBJECT-TYPE
+	SYNTAX INTEGER (0..255)
+    ACCESS  read-only
+	STATUS  mandatory
+    DESCRIPTION
+        "Address of current module viewed in the Module Table, (-1) means this value is invalid"
+    ::= { moduleEntry 2 }
+	
+moduleComStatus	OBJECT-TYPE
+	SYNTAX INTEGER { OK(0), FAIL(1) }
+    ACCESS  read-only
+	STATUS  mandatory
+    DESCRIPTION
+        "Module Communication Status, 0-OK, 1-Failed, (-1) means this value is invalid"
+    ::= { moduleEntry 3 }
+    
+moduleOk OBJECT-TYPE
+	SYNTAX INTEGER { OK(0), ALM(1) }
+    ACCESS  read-only
+	STATUS  mandatory
+    DESCRIPTION
+        "Rectifier Module Ok or Alarm, 0-OK, 1-Alarm, (-1) means this value is invalid"
+    ::= { moduleEntry 4 }
+     
+moduleEnabled OBJECT-TYPE
+	SYNTAX INTEGER { DISABLE(0), ENABLE(1) }
+    ACCESS  read-write
+	STATUS  mandatory
+    DESCRIPTION
+        "Rectifier module is activated or not, 1-Activated, 0-Disable, (-1) means this value is invalid"
+    ::= { moduleEntry 5 }
+    
+inputVoltage OBJECT-TYPE
+	SYNTAX INTEGER(0..30000)
+    ACCESS  read-only
+	STATUS  mandatory
+    DESCRIPTION
+        "Module Input Voltage(V), (-1) means measurement not available"
+    ::= { moduleEntry 6 }
+    
+outputVoltage OBJECT-TYPE
+	SYNTAX INTEGER(0..30000)
+    ACCESS  read-only
+	STATUS  mandatory
+    DESCRIPTION
+        "Module Output Voltage(V*10), (-1) means measurement not available"
+    ::= { moduleEntry 7 }
+
+outputCurrent OBJECT-TYPE
+	SYNTAX INTEGER(0..30000)
+    ACCESS  read-only
+	STATUS  mandatory
+    DESCRIPTION
+        "Module Current (A*10), (-1) means measurement not available"
+    ::= { moduleEntry 8 }
+    
+meanCurrent	OBJECT-TYPE
+	SYNTAX INTEGER(0..30000)
+    ACCESS  read-only
+	STATUS  mandatory
+    DESCRIPTION
+        "Module MeanCurrent for current sharing (A*10), (-1) means measurement not available"
+    ::= { moduleEntry 9 }
+
+temperature	OBJECT-TYPE
+	SYNTAX INTEGER
+    ACCESS  read-only
+	STATUS  mandatory
+    DESCRIPTION
+        "Module internal temperature (C), (-1) means measurement not available"
+    ::= { moduleEntry 10 }
+
+moduleStatus OBJECT-TYPE
+	SYNTAX INTEGER (0..255)
+    ACCESS  read-only
+	STATUS  mandatory
+    DESCRIPTION
+        "Module status, (-1) means this value is invalid"
+    ::= { moduleEntry 11 }
+
+moduleFlag OBJECT-TYPE
+	SYNTAX INTEGER (0..255)
+    ACCESS  read-only
+	STATUS  mandatory
+    DESCRIPTION
+        "Module Flag, (-1) means this value is invalid"
+    ::= { moduleEntry 12 }
+
+moduleConfig OBJECT-TYPE
+	SYNTAX INTEGER (0..255)
+    ACCESS  read-only
+	STATUS  mandatory
+    DESCRIPTION
+        "Module Config, (-1) means this value is invalid"
+    ::= { moduleEntry 13 }
+
+softVersion	OBJECT-TYPE
+	SYNTAX DisplayString
+    ACCESS  read-only
+	STATUS  mandatory
+    DESCRIPTION
+        "Software version of the module, (-1) means this value is invalid"
+    ::= { moduleEntry 14 }
+
+serialNumber OBJECT-TYPE
+	SYNTAX INTEGER(0..4294967295)
+    ACCESS  read-only
+	STATUS  mandatory
+    DESCRIPTION
+        "Serial Number of the module, (-1) means this value is invalid"
+    ::= { moduleEntry 15 }
+    
+-- BATTERY INFORMATION
+numbOfBatteries OBJECT-TYPE
+    SYNTAX INTEGER(0..100)
+    ACCESS read-only
+    STATUS mandatory
+    DESCRIPTION
+        "Number of battery strings installed in the system"
+    ::= { batteryInfo 1 }
+    
+typeofBattery OBJECT-TYPE
+    SYNTAX INTEGER(0..100)
+    ACCESS read-only
+    STATUS mandatory
+    DESCRIPTION
+        "Type of battery installed in the system"
+    ::= { batteryInfo 2 }    
+
+symmetryTable OBJECT-TYPE
+    SYNTAX SEQUENCE OF SymmetryEntry
+    ACCESS not-accessible
+    STATUS mandatory
+    DESCRIPTION
+        "Symmetry Information Table"
+    ::= { batteryInfo 3 }        
+    
+symmetryEntry OBJECT-TYPE
+    SYNTAX SymmetryEntry
+    ACCESS not-accessible
+    STATUS mandatory
+    DESCRIPTION
+        "Queue of Symmetry Table"
+    INDEX { batteryIndex }
+     ::= { symmetryTable 1 }
+     
+SymmetryEntry ::=
+    SEQUENCE {
+        batteryIndex
+            INTEGER,
+        symmetry1
+            INTEGER,
+        symmetry2
+            INTEGER,
+        symmetry3
+            INTEGER,
+        symmetry4
+        	INTEGER
+	}
+	
+batteryIndex OBJECT-TYPE
+	SYNTAX INTEGER(0..100)
+    ACCESS  read-only
+	STATUS  mandatory
+    DESCRIPTION
+        "Index of current battery string viewed in the Symmetry Table"
+    ::= { symmetryEntry 1 }
+    
+symmetry1 OBJECT-TYPE
+	SYNTAX INTEGER(0..30000)
+    ACCESS  read-only
+	STATUS  mandatory
+    DESCRIPTION
+        "Symmetry Voltage in Block 1 (V*100), (-1) means this value is invalid"
+    ::= { symmetryEntry 2 }
+ 
+symmetry2 OBJECT-TYPE
+	SYNTAX INTEGER(0..30000)
+    ACCESS  read-only
+	STATUS  mandatory
+    DESCRIPTION
+        "Symmetry Voltage in Block 2 (V*100), (-1) means this value is invalid"
+    ::= { symmetryEntry 3 }    
+    
+symmetry3 OBJECT-TYPE
+	SYNTAX INTEGER(0..30000)
+    ACCESS  read-only
+	STATUS  mandatory
+    DESCRIPTION
+        "Symmetry Voltage in Block 3 (V*100), (-1) means this value is invalid for this battery type"
+    ::= { symmetryEntry 4 }
+    
+symmetry4 OBJECT-TYPE
+	SYNTAX INTEGER(0..30000)
+    ACCESS  read-only
+	STATUS  mandatory
+    DESCRIPTION
+        "Symmetry Voltage in Block 4 (V*100), (-1) means this value is invalid for this battery type"
+    ::= { symmetryEntry 5 }    
+
+-- ALARM HISTORY INFORMATION
+alarmHistoryCount OBJECT-TYPE
+    SYNTAX INTEGER
+    ACCESS read-only
+    STATUS mandatory
+    DESCRIPTION
+        "Number of Alarm History entries in the History Table"
+    ::= { alarmHistory 1 }  
+
+alarmHistoryTable OBJECT-TYPE
+    SYNTAX SEQUENCE OF AlarmHistoryEntry
+    ACCESS not-accessible
+    STATUS mandatory
+    DESCRIPTION
+        "Alarm History Table"
+    ::= { alarmHistory 2 }        
+    
+alarmHistoryEntry OBJECT-TYPE
+    SYNTAX SymmetryEntry
+    ACCESS not-accessible
+    STATUS mandatory
+    DESCRIPTION
+        "Queue of History Table"
+    INDEX { ahTableIndex }
+     ::= { alarmHistoryTable 1 }
+     
+AlarmHistoryEntry ::=
+    SEQUENCE {
+        ahTableIndex
+        	INTEGER,
+        ahTime
+            DisplayString,
+        ahData1
+            INTEGER,
+        ahData2
+            INTEGER,
+        ahData3
+        	INTEGER,
+        ahData4
+            INTEGER,
+        ahData5
+            INTEGER
+	}
+	
+ahTableIndex OBJECT-TYPE
+	SYNTAX INTEGER(0..100)
+    ACCESS  read-only
+	STATUS  mandatory
+    DESCRIPTION
+        "Entery Number in the History Table"
+    ::= { alarmHistoryEntry 1 }
+
+ahTime OBJECT-TYPE
+	SYNTAX DisplayString
+    ACCESS  read-only
+	STATUS  mandatory
+    DESCRIPTION
+        "Time and date of the History Table entry"
+    ::= { alarmHistoryEntry 2 }
+    
+ahData1 OBJECT-TYPE
+	SYNTAX INTEGER (0..255)
+    ACCESS  read-only
+	STATUS  mandatory
+    DESCRIPTION
+        "A byte containing alarm history data 1"
+    ::= { alarmHistoryEntry 3 }
+    
+ahData2 OBJECT-TYPE
+	SYNTAX INTEGER (0..255)
+    ACCESS  read-only
+	STATUS  mandatory
+    DESCRIPTION
+        "A byte containing alarm history data 2"
+    ::= { alarmHistoryEntry 4 }
+    
+ahData3 OBJECT-TYPE
+	SYNTAX INTEGER (0..255)
+    ACCESS  read-only
+	STATUS  mandatory
+    DESCRIPTION
+        "A byte containing alarm history data 3"
+    ::= { alarmHistoryEntry 5 }
+
+ahData4 OBJECT-TYPE
+	SYNTAX INTEGER (0..255)
+    ACCESS  read-only
+	STATUS  mandatory
+    DESCRIPTION
+        "A byte containing alarm history data 4"
+    ::= { alarmHistoryEntry 6 }
+    
+ahData5 OBJECT-TYPE
+	SYNTAX INTEGER (0..255)
+    ACCESS  read-only
+	STATUS  mandatory
+    DESCRIPTION
+        "A byte containing alarm history data 5"
+    ::= { alarmHistoryEntry 7 }    
+
+
+-- DCDCModuleInfo
+numOfDCDCUnits OBJECT-TYPE
+    SYNTAX INTEGER(0..255)
+    ACCESS read-only
+    STATUS mandatory
+    DESCRIPTION
+        "Number of DCDC Modules installed in the system"
+    ::= { dcdcInfo 1 }   
+
+dcdcTable OBJECT-TYPE
+    SYNTAX SEQUENCE OF DCDCModuleEntry
+    ACCESS not-accessible
+    STATUS mandatory
+    DESCRIPTION
+        "DCDC Module Information Table"
+    ::= { dcdcInfo 2 }        
+    
+dcdcModuleEntry OBJECT-TYPE
+    SYNTAX DCDCModuleEntry
+    ACCESS not-accessible
+    STATUS mandatory
+    DESCRIPTION
+        "Queue of DCDC Module Table"
+    INDEX { dcdcModuleIndex }
+     ::= { dcdcTable 1 }
+
+DCDCModuleEntry ::=
+    SEQUENCE {
+        dcdcModuleIndex
+            INTEGER,
+        dcdcModuleAddress
+            INTEGER,
+        dcdcModuleComStatus
+            INTEGER,
+        dcdcModuleOk
+            INTEGER,
+        dcdcModuleEnabled
+            INTEGER,
+        dcdcInputVoltage
+        	INTEGER,
+		dcdcOutputVoltage
+			INTEGER,
+		dcdcOutputCurrent
+			INTEGER,
+		dcdcMeanCurrent
+			INTEGER,
+		dcdcTemperature
+			INTEGER,
+		dcdcModuleStatus
+			INTEGER,
+		dcdcModuleFlag
+			INTEGER,
+		dcdcModuleConfig
+			INTEGER,
+		dcdcSoftVersion
+			 DisplayString,
+		dcdcSerialNumber
+			INTEGER
+	}
+	
+dcdcModuleIndex OBJECT-TYPE
+	SYNTAX INTEGER(0..100)
+    ACCESS  read-only
+	STATUS  mandatory
+    DESCRIPTION
+        "Entry number in the Module Table"
+    ::= { dcdcModuleEntry 1 }
+
+dcdcModuleAddress OBJECT-TYPE
+	SYNTAX INTEGER (0..255)
+    ACCESS  read-only
+	STATUS  mandatory
+    DESCRIPTION
+        "Address of current module viewed in the DCDC Module Table, (-1) means this value is invalid"
+    ::= { dcdcModuleEntry 2 }
+	
+dcdcModuleComStatus	OBJECT-TYPE
+	SYNTAX INTEGER { OK(0), FAIL(1) }
+    ACCESS  read-only
+	STATUS  mandatory
+    DESCRIPTION
+        "Module Communication Status, 0-OK, 1-Failed, (-1) means this value is invalid"
+    ::= { dcdcModuleEntry 3 }
+    
+dcdcModuleOk OBJECT-TYPE
+	SYNTAX INTEGER { OK(0), ALARM(1) }
+    ACCESS  read-only
+	STATUS  mandatory
+    DESCRIPTION
+        "DCDC Module Ok or Alarm, 0-OK, 1-Alarm, (-1) means this value is invalid"
+    ::= { dcdcModuleEntry 4 }
+     
+dcdcModuleEnabled OBJECT-TYPE
+	SYNTAX INTEGER { DISABLED(0), ENABLED(1) }
+    ACCESS  read-only
+	STATUS  mandatory
+    DESCRIPTION
+        "DCDC module is enabled or not, 1-Enabled, 0-Disabled, (-1) means this value is invalid"
+    ::= { dcdcModuleEntry 5 }
+    
+dcdcInputVoltage OBJECT-TYPE
+	SYNTAX INTEGER(0..30000)
+    ACCESS  read-only
+	STATUS  mandatory
+    DESCRIPTION
+        "Module Input Voltage(V), (-1) means measurement not available"
+    ::= { dcdcModuleEntry 6 }
+    
+dcdcOutputVoltage OBJECT-TYPE
+	SYNTAX INTEGER(0..30000)
+    ACCESS  read-only
+	STATUS  mandatory
+    DESCRIPTION
+        "Module Output Voltage(V*10), (-1) means measurement not available"
+    ::= { dcdcModuleEntry 7 }
+
+dcdcOutputCurrent OBJECT-TYPE
+	SYNTAX INTEGER(0..30000)
+    ACCESS  read-only
+	STATUS  mandatory
+    DESCRIPTION
+        "Module Current (A*10), (-1) means measurement not available"
+    ::= { dcdcModuleEntry 8 }
+    
+dcdcMeanCurrent	OBJECT-TYPE
+	SYNTAX INTEGER(0..30000)
+    ACCESS  read-only
+	STATUS  mandatory
+    DESCRIPTION
+        "Module MeanCurrent for current sharing (A*10), (-1) means measurement not available"
+    ::= { dcdcModuleEntry 9 }
+
+dcdcTemperature	OBJECT-TYPE
+	SYNTAX INTEGER
+    ACCESS  read-only
+	STATUS  mandatory
+    DESCRIPTION
+        "Module internal temperature (C), (-1) means measurement not available"
+    ::= { dcdcModuleEntry 10 }
+
+dcdcModuleStatus OBJECT-TYPE
+	SYNTAX INTEGER (0..255)
+    ACCESS  read-only
+	STATUS  mandatory
+    DESCRIPTION
+        "Module status, (-1) means this value is invalid"
+    ::= { dcdcModuleEntry 11 }
+
+dcdcModuleFlag OBJECT-TYPE
+	SYNTAX INTEGER (0..255)
+    ACCESS  read-only
+	STATUS  mandatory
+    DESCRIPTION
+        "Module Flag, (-1) means this value is invalid"
+    ::= { dcdcModuleEntry 12 }
+
+dcdcModuleConfig OBJECT-TYPE
+	SYNTAX INTEGER (0..255)
+    ACCESS  read-only
+	STATUS  mandatory
+    DESCRIPTION
+        "Module Config, (-1) means this value is invalid"
+    ::= { dcdcModuleEntry 13 }
+
+dcdcSoftVersion	OBJECT-TYPE
+	SYNTAX DisplayString
+    ACCESS  read-only
+	STATUS  mandatory
+    DESCRIPTION
+        "Software version of the module, (-1) means this value is invalid"
+    ::= { dcdcModuleEntry 14 }
+
+dcdcSerialNumber OBJECT-TYPE
+	SYNTAX INTEGER(0..4294967295)
+    ACCESS  read-only
+	STATUS  mandatory
+    DESCRIPTION
+        "Serial Number of the module, (-1) means this value is invalid"
+    ::= { dcdcModuleEntry 15 }
+    
+
+-- SLIInfo
+numOfSLIUnits OBJECT-TYPE
+    SYNTAX INTEGER(0..255)
+    ACCESS read-only
+    STATUS mandatory
+    DESCRIPTION
+        "Number of SLI inverters installed in the system"
+    ::= { sliInfo 1 }   
+
+sliTable OBJECT-TYPE
+    SYNTAX SEQUENCE OF SLIModuleEntry
+    ACCESS not-accessible
+    STATUS mandatory
+    DESCRIPTION
+        "SLI Module internal information table"
+    ::= { sliInfo 2 }        
+    
+sliModuleEntry OBJECT-TYPE
+    SYNTAX SLIModuleEntry
+    ACCESS not-accessible
+    STATUS mandatory
+    DESCRIPTION
+        "Queue of Module Table"
+    INDEX { sliModuleIndex }
+     ::= { sliTable 1 }
+
+SLIModuleEntry ::=
+    SEQUENCE {
+        sliModuleIndex
+            INTEGER,
+        sliModuleAddress
+            INTEGER,
+        sliModuleComStatus
+            INTEGER,
+        sliOutputVoltage
+            INTEGER,
+        sliOutputCurrent
+            INTEGER,
+        sliOutputPower
+        	INTEGER,
+		sliGridVoltage
+			INTEGER,
+		sliGridCurrent
+			INTEGER,
+		sliModuleGeneralFailure
+			INTEGER,
+		sliModuleStatus1
+			INTEGER,
+		sliModuleStatus2
+			INTEGER,
+		sliModuleStatus3
+			INTEGER,
+		sliTSStatus
+			INTEGER,
+		sliSerialNumber
+			INTEGER
+	}
+	
+sliModuleIndex OBJECT-TYPE
+	SYNTAX INTEGER(0..100)
+    ACCESS  read-only
+	STATUS  mandatory
+    DESCRIPTION
+        "Seqential number which determines entry position of thr SLI inverter in the SLI Table"
+    ::= { sliModuleEntry 1 }
+
+sliModuleAddress OBJECT-TYPE
+	SYNTAX INTEGER (0..255)
+    ACCESS  read-only
+	STATUS  mandatory
+    DESCRIPTION
+        "Communication address of current SLI inverter viewed in the current SLI Table, (-1) means this value is not available"
+    ::= { sliModuleEntry 2 }
+	
+sliModuleComStatus	OBJECT-TYPE
+	SYNTAX INTEGER { OK(0), FAIL(1) }
+    ACCESS  read-only
+	STATUS  mandatory
+    DESCRIPTION
+        "Sli inverter communication status, 0-OK, 1-Failed, (-1) means this value is not available"
+    ::= { sliModuleEntry 3 }
+    
+sliOutputVoltage OBJECT-TYPE
+	SYNTAX INTEGER
+    ACCESS  read-only
+	STATUS  mandatory
+    DESCRIPTION
+        "SLI inverter output voltage in tenth of Volts (V*10), (-1) means this value is not available"
+    ::= { sliModuleEntry 4 }
+
+sliOutputCurrent OBJECT-TYPE
+	SYNTAX INTEGER
+    ACCESS  read-only
+	STATUS  mandatory
+    DESCRIPTION
+        "SLI inverter output current in hundredths of A (A*100), (-1) means that this value is not available"
+    ::= { sliModuleEntry 5 }
+    
+sliOutputPower	OBJECT-TYPE
+	SYNTAX INTEGER
+    ACCESS  read-only
+	STATUS  mandatory
+    DESCRIPTION
+        "SLI inverter output power in tenths of Watts (W*10), (-1) means this value is not available"
+    ::= { sliModuleEntry 6 }
+
+sliGridVoltage	OBJECT-TYPE
+	SYNTAX INTEGER
+    ACCESS  read-only
+	STATUS  mandatory
+    DESCRIPTION
+        "SLI inverter AC Grid Output Voltage in tenths of Volts (V*10), (-1) means this value is not available"
+    ::= { sliModuleEntry 7 }
+
+sliGridCurrent	OBJECT-TYPE
+	SYNTAX INTEGER
+    ACCESS  read-only
+	STATUS  mandatory
+    DESCRIPTION
+        "SLI inverter AC Grid Output Current in hundredths of Amperes (A*100), (-1) means this value is not available"
+    ::= { sliModuleEntry 8 }
+	
+sliModuleGeneralFailure OBJECT-TYPE
+	SYNTAX INTEGER { OK(0), FAIL(1) }
+    ACCESS  read-only
+	STATUS  mandatory
+    DESCRIPTION
+        "SLI Failure flag which indicate general functionality of the unit, (-1) means this value is not available"
+    ::= { sliModuleEntry 9 }
+
+sliModuleStatus1 OBJECT-TYPE
+	SYNTAX INTEGER (0..255)
+    ACCESS  read-only
+	STATUS  mandatory
+    DESCRIPTION
+        "SLI Status 1 [uP Status], (-1) means this value is not available
+	Byte code description
+	00 standby
+	01 starting
+	02 run
+	03 bulk OverVoltage
+	04 master indicator error
+	05 input UnderVoltage
+	06 input OverVoltage
+	07 input Low
+	08 input OverCurrent
+	09 reserved
+	10 reserved
+	11 Ambient over temperature
+	12 Ambient under temperature
+	13 Reserved
+	14 Reserved
+	15 Reserved
+	16 Internal over temperature
+	17 Reserved
+	18 Reserved
+	19 Output OverCurrent
+	20 output UV
+	21 Reserved
+	22 breaker off
+	23 output OverVoltage
+	24 transfer sync error
+	"
+    ::= { sliModuleEntry 10 }
+
+sliModuleStatus2 OBJECT-TYPE
+	SYNTAX INTEGER (0..255)
+    ACCESS  read-only
+	STATUS  mandatory
+    DESCRIPTION
+        "SLI Status 2 [DSP Status], (-1) means this value is not available
+	Byte code dDescription
+	00 standby
+	01 starting
+	02 run
+	03 bulk OverVoltage
+	04 Out OverCurrent
+	05 Out UnderVoltage
+	06 Master Indicator ERROR
+	07 Internal DSP Error
+	08 Calibration not valid/received
+	09 V Bulk Low
+	10 bulk OverVoltage
+	"
+    ::= { sliModuleEntry 11 }
+
+sliModuleStatus3 OBJECT-TYPE
+	SYNTAX INTEGER (0..255)
+    ACCESS  read-only
+	STATUS  mandatory
+    DESCRIPTION
+        "SLI Status 3 [Fan Failure], (-1) means this value is not available
+	0 Initialization / fan is OK
+	any value between 1-128 is fan error
+	"
+    ::= { sliModuleEntry 12 }
+
+sliTSStatus OBJECT-TYPE
+	SYNTAX INTEGER (0..255)
+    ACCESS  read-only
+	STATUS  mandatory
+    DESCRIPTION
+        "Transfer switch status, (-1) means this value is not available"
+    ::= { sliModuleEntry 13 }
+	
+sliSerialNumber OBJECT-TYPE
+	SYNTAX INTEGER(0..4294967295)
+    ACCESS  read-only
+	STATUS  mandatory
+    DESCRIPTION
+        "Serial Number of the module, (-1) means value is not available"
+    ::= { sliModuleEntry 14 }
+
+
+-- Alarm Table
+alarmTTable OBJECT-TYPE
+    SYNTAX SEQUENCE OF AlarmTableEntry
+    ACCESS not-accessible
+    STATUS mandatory
+    DESCRIPTION
+        "Alarm state and trap setting table"
+    ::= { alarmTable 1 }
+    
+alarmTableEntry OBJECT-TYPE
+    SYNTAX AlarmTableEntry
+    ACCESS not-accessible
+    STATUS mandatory
+    DESCRIPTION
+        "Queue of Alarm Table"
+    INDEX { alarmTableIndex }
+     ::= { alarmTTable 1 }
+
+AlarmTableEntry ::=
+    SEQUENCE {
+        alarmTableIndex
+            INTEGER,
+        alarmDescription
+            DisplayString,
+        alarmStatus
+            INTEGER,
+        alarmTrapDisable
+            INTEGER
+	}
+	
+alarmTableIndex OBJECT-TYPE
+	SYNTAX INTEGER(0..100)
+    ACCESS  read-only
+	STATUS  mandatory
+    DESCRIPTION
+        "Seqential number of alarm"
+    ::= { alarmTableEntry 1 }
+
+alarmDescription OBJECT-TYPE
+	SYNTAX DisplayString
+    ACCESS  read-only
+	STATUS  mandatory
+    DESCRIPTION
+        "Alarm decription (Name)"
+    ::= { alarmTableEntry 2 }
+	
+alarmStatus	OBJECT-TYPE
+	SYNTAX INTEGER
+    ACCESS  read-only
+	STATUS  mandatory
+    DESCRIPTION
+        "Alarm Staus, 0-Off (Alarm is not active), 1-Active"
+    ::= { alarmTableEntry 3 }
+    
+alarmTrapDisable OBJECT-TYPE
+	SYNTAX INTEGER
+    ACCESS  read-write
+	STATUS  mandatory
+    DESCRIPTION
+        "Flag if trap is disabled or enabled for this alarm"
+    ::= { alarmTableEntry 4 }	
+
+-- SNMPv3 USM
+
+usmUserTable     OBJECT-TYPE
+    SYNTAX       SEQUENCE OF UsmUserEntry
+    MAX-ACCESS   not-accessible
+    STATUS       mandatory
+    DESCRIPTION "This table is used to configure ACX USM.
+				 To get the SNMPv3 access, user need to configure security 
+		         name,authentication,auth password,priv protocol and priv password.
+				 Table returns zero strings if SNMPv1/2c is selected in controller"
+    ::= { snmpV3USM 1 }
+
+usmUserEntry     OBJECT-TYPE
+    SYNTAX		UsmUserEntry
+    MAX-ACCESS	not-accessible
+    STATUS       	mandatory
+    DESCRIPTION 	
+				"User security configurations for USM."
+	INDEX   { usmIndex }
+    ::= { usmUserTable 1 }
+
+UsmUserEntry   ::= SEQUENCE {
+	    usmIndex		INTEGER (0),
+	    usmSecurityName	SnmpAdminString,
+        usmAuthProtocol UsmAuthProtocol,
+        usmAuthKey		KeyChange,
+        usmPrivProtocol UsmPrivProtocol,
+        usmPrivKey		KeyChange,
+		usmStorage		StorageType,
+		usmStatus		RowStatus
+		
+    }
+
+usmIndex	  	OBJECT-TYPE
+    SYNTAX 		 INTEGER (0)
+    MAX-ACCESS   read-only
+    STATUS       current
+    DESCRIPTION  "Usm configuration index. "
+    ::= { usmUserEntry 1 }
+
+
+usmSecurityName  OBJECT-TYPE
+    SYNTAX       SnmpAdminString
+    MAX-ACCESS   read-write
+    STATUS       current
+    DESCRIPTION "A human readable string representing the user in
+                 Security Model independent format."
+    ::= { usmUserEntry 2 }
+
+usmAuthProtocol OBJECT-TYPE
+    SYNTAX       UsmAuthProtocol
+    MAX-ACCESS   read-write
+    STATUS       current
+    DESCRIPTION  "Authentication support to the SNMPv3.
+		     If usmAuthProtocol == NoAuthProtocol, then SNMPv3 Stack does 
+		     not support/requires authentication.
+		     If usmAuthProtocol == HMACMD5Auth , supports MD5 auth
+		     If usmAuthProtocol == HMACSHAAuth, supports SHA Auth 	
+                 If a set operation tries to set value as
+                 NoAuthProtocol while the usmPrivProtocol value
+                 for the same userName is not equal to NoPrivProtocol,
+                 then an 'inconsistentValue' error must be returned.
+                 This implies that SNMP command generator (SNMP Manager)
+				 application must first ensure that the usmPrivProtocol is set
+                 to NoPrivProtocol value before it can set
+                 the usmAuthProtocol value to NoAuthProtocol."
+    ::= { usmUserEntry 3 }
+
+usmAuthKey OBJECT-TYPE
+    SYNTAX       KeyChange   -- typically (SIZE (0 | 32)) for HMACMD5
+                             -- typically (SIZE (0 | 40)) for HMACSHA
+    MAX-ACCESS   read-write
+    STATUS       current
+    DESCRIPTION  "This object in the MIB is associated to usmAuthProtocol.
+			A secret authentication key is required to establish a secure connection 
+			between snmp agent and manager."			
+    ::= { usmUserEntry 4 }
+
+usmPrivProtocol OBJECT-TYPE
+    SYNTAX       UsmPrivProtocol
+    MAX-ACCESS   read-write
+    STATUS       current
+    DESCRIPTION " A privacy protocol to provide encryption and decryption
+				  of SNMPv3 pdu."
+    ::= { usmUserEntry 5 }
+
+usmPrivKey OBJECT-TYPE
+    SYNTAX       KeyChange  -- typically (SIZE (0 | 32)) for AES
+    MAX-ACCESS   read-write
+    STATUS       current
+    DESCRIPTION "This object in the MIB is associated to usmPrivProtocol.
+			A secret privacy key is required to establish a secure connection 
+			between snmp agent and manager."
+    ::= { usmUserEntry 6 }
+	
+usmStorage OBJECT-TYPE
+    SYNTAX       StorageType
+    MAX-ACCESS   read-only
+    STATUS       current
+    DESCRIPTION 
+			"This object indicates storage type for user data (always nonVolatile)."
+    ::= { usmUserEntry 7 }
+	
+usmStatus OBJECT-TYPE
+    SYNTAX       RowStatus
+    MAX-ACCESS   read-only
+    STATUS       current
+    DESCRIPTION 
+			"This object indicates user status (always active)."
+    ::= { usmUserEntry 8 }
+	
+-- Traps
+-- As defined in RFC each TRAP V2 contains at least OBJECTS { snmpTrapOID }
+-- which is set to 1 at cleared to 0 during corresponding events
+
+lowVoltTrap NOTIFICATION-TYPE
+	OBJECTS { snmpTrapOID }
+	STATUS current
+    DESCRIPTION
+            "Low DC Voltage Alarm "
+    ::= { powecACXTrap 1 }
+
+
+highVoltTrap NOTIFICATION-TYPE
+	OBJECTS { snmpTrapOID }
+	STATUS current
+    DESCRIPTION
+            "High DC Voltage Alarm"
+    ::= { powecACXTrap 2 }
+    
+loadBattDisconTrap NOTIFICATION-TYPE
+	OBJECTS { snmpTrapOID }
+	STATUS current
+    DESCRIPTION
+            "Load/Battery Disconnected"
+    ::= { powecACXTrap 3 }
+	
+mainsFailTrap NOTIFICATION-TYPE
+	OBJECTS { snmpTrapOID }
+	STATUS current
+    DESCRIPTION
+            "Mains Failure Alarm"
+    ::= { powecACXTrap 4 }
+	
+distrFuseTrap NOTIFICATION-TYPE
+	OBJECTS { snmpTrapOID }
+	STATUS current
+    DESCRIPTION
+            "Distribution Fuse Failure"
+    ::= { powecACXTrap 5 }
+	
+lowACTrap NOTIFICATION-TYPE
+	OBJECTS { snmpTrapOID }
+	STATUS current
+    DESCRIPTION
+            "Low AC input voltage"
+    ::= { powecACXTrap 6 }
+	
+battFailTrap NOTIFICATION-TYPE
+	OBJECTS { snmpTrapOID }
+	STATUS current
+    DESCRIPTION
+            "Battery Test Failure"
+    ::= { powecACXTrap 7 }
+	
+moduleFailTrap NOTIFICATION-TYPE
+	OBJECTS { snmpTrapOID }
+	STATUS current
+    DESCRIPTION
+            "Module Alarm"
+    ::= { powecACXTrap 8 }
+
+battTempTrap NOTIFICATION-TYPE
+	OBJECTS { snmpTrapOID }
+	STATUS current
+    DESCRIPTION
+            "High Battery Temperature Alarm"
+    ::= { powecACXTrap 9 }
+	
+symmFailTrap NOTIFICATION-TYPE
+	OBJECTS { snmpTrapOID }
+	STATUS current
+    DESCRIPTION
+            "Battery Symmetry Alarm"
+    ::= { powecACXTrap 10 }
+	
+battFuseTrap NOTIFICATION-TYPE
+	OBJECTS { snmpTrapOID }
+	STATUS current
+    DESCRIPTION
+            "Battery Fuse Failure"
+    ::= { powecACXTrap 11 }
+	
+highLoadTrap NOTIFICATION-TYPE
+	OBJECTS { snmpTrapOID }	
+	STATUS current
+    DESCRIPTION
+            "High Load"
+    ::= { powecACXTrap 12 }
+	
+highACTrap NOTIFICATION-TYPE
+	OBJECTS { snmpTrapOID }
+	STATUS current
+    DESCRIPTION
+            "High AC input voltage"
+    ::= { powecACXTrap 13 }
+	
+urgentModFailTrap NOTIFICATION-TYPE
+	OBJECTS { snmpTrapOID }
+	STATUS current
+    DESCRIPTION
+            "Urgent Module Alarm"
+    ::= { powecACXTrap 14 }
+	
+comFailTrap NOTIFICATION-TYPE
+	OBJECTS { snmpTrapOID }
+	STATUS current
+    DESCRIPTION
+            "Communication Failure"
+    ::= { powecACXTrap 15 }
+	
+partLoadDiscon1Trap NOTIFICATION-TYPE
+	OBJECTS { snmpTrapOID }
+	STATUS current
+    DESCRIPTION
+            "Partial Load Disconnect 1 Alarm"
+    ::= { powecACXTrap 16 }
+	
+tempProbeTrap NOTIFICATION-TYPE
+	OBJECTS { snmpTrapOID }
+	STATUS current
+    DESCRIPTION
+            "Temperature probe fault"
+    ::= { powecACXTrap 17 }
+	
+dischargingTrap NOTIFICATION-TYPE
+	OBJECTS { snmpTrapOID }
+	STATUS current
+    DESCRIPTION
+            "Battery on Discharge"
+    ::= { powecACXTrap 18 }
+	
+ovShutdownTrap NOTIFICATION-TYPE
+	OBJECTS { snmpTrapOID }
+	STATUS current
+    DESCRIPTION
+            "Overvoltage Shutdown alarm"
+    ::= { powecACXTrap 19 }
+	
+lowBattTempTrap NOTIFICATION-TYPE
+	OBJECTS { snmpTrapOID }
+	STATUS current
+    DESCRIPTION
+            "Low Battery Temperature"
+    ::= { powecACXTrap 20 }
+	
+partLoadDiscon2Trap NOTIFICATION-TYPE
+	OBJECTS { snmpTrapOID }
+	STATUS current
+    DESCRIPTION
+            "Partial Load Disconnect 2 Alarm"
+    ::= { powecACXTrap 21 }
+	
+partLoadDiscon3Trap NOTIFICATION-TYPE
+	OBJECTS { snmpTrapOID }
+	STATUS current
+    DESCRIPTION
+            "Partial Load Disconnect 3 Alarm"
+    ::= { powecACXTrap 22 }
+	
+alarmsBlockedTrap NOTIFICATION-TYPE
+	OBJECTS { snmpTrapOID }
+	STATUS current
+    DESCRIPTION
+            "Alarms Blocked"
+    ::= { powecACXTrap 23 }
+	
+extAlarm0Trap NOTIFICATION-TYPE
+	OBJECTS { snmpTrapOID }
+	STATUS current
+    DESCRIPTION
+            "Ext.alarm 0"
+    ::= { powecACXTrap 24 }
+	
+extAlarm1Trap NOTIFICATION-TYPE
+	OBJECTS { snmpTrapOID }
+	STATUS current
+    DESCRIPTION
+            "Ext.alarm 1"
+    ::= { powecACXTrap 25 }
+	
+extAlarm2Trap NOTIFICATION-TYPE
+	OBJECTS { snmpTrapOID }
+	STATUS current
+    DESCRIPTION
+            "Ext.alarm 2"
+    ::= { powecACXTrap 26 }
+	
+extAlarm3Trap NOTIFICATION-TYPE
+	OBJECTS { snmpTrapOID }
+	STATUS current
+    DESCRIPTION
+            "Ext.alarm 3"
+    ::= { powecACXTrap 27 }
+	
+extAlarm4Trap NOTIFICATION-TYPE
+	OBJECTS { snmpTrapOID }
+	STATUS current
+    DESCRIPTION
+            "Ext.alarm 4"
+    ::= { powecACXTrap 28 }
+	
+extAlarm5Trap NOTIFICATION-TYPE
+	OBJECTS { snmpTrapOID }
+	STATUS current
+    DESCRIPTION
+            "Ext.alarm 5"
+    ::= { powecACXTrap 29 }
+	
+extAlarm6Trap NOTIFICATION-TYPE
+	OBJECTS { snmpTrapOID }
+	STATUS current
+    DESCRIPTION
+            "Ext.alarm 6"
+    ::= { powecACXTrap 30 }
+	
+extAlarm7Trap NOTIFICATION-TYPE
+	OBJECTS { snmpTrapOID }
+	STATUS current
+    DESCRIPTION
+            "Ext.alarm 7"
+    ::= { powecACXTrap 31 }
+	
+extAlarm8Trap NOTIFICATION-TYPE
+	OBJECTS { snmpTrapOID }
+	STATUS current
+    DESCRIPTION
+            "Ext.alarm 8"
+    ::= { powecACXTrap 32 }
+	
+extAlarm9Trap NOTIFICATION-TYPE
+	OBJECTS { snmpTrapOID }
+	STATUS current
+    DESCRIPTION
+            "Ext.alarm 9"
+    ::= { powecACXTrap 33 }
+	
+extAlarm10Trap NOTIFICATION-TYPE
+	OBJECTS { snmpTrapOID }
+	STATUS current
+    DESCRIPTION
+            "Ext.alarm 10"
+    ::= { powecACXTrap 34 }
+	
+extAlarm11Trap NOTIFICATION-TYPE
+	OBJECTS { snmpTrapOID }
+	STATUS current
+    DESCRIPTION
+            "Ext.alarm 11"
+    ::= { powecACXTrap 35 }
+	
+extAlarm12Trap NOTIFICATION-TYPE
+	OBJECTS { snmpTrapOID }
+	STATUS current
+    DESCRIPTION
+            "Ext.alarm 12"
+    ::= { powecACXTrap 36 }
+	
+extAlarm13Trap NOTIFICATION-TYPE
+	OBJECTS { snmpTrapOID }
+	STATUS current
+    DESCRIPTION
+            "Ext.alarm 13"
+    ::= { powecACXTrap 37 }
+	
+extAlarm14Trap NOTIFICATION-TYPE
+	OBJECTS { snmpTrapOID }
+	STATUS current
+    DESCRIPTION
+            "Ext.alarm 14"
+    ::= { powecACXTrap 38 }
+	
+extAlarm15Trap NOTIFICATION-TYPE
+	OBJECTS { snmpTrapOID }
+	STATUS current
+    DESCRIPTION
+            "Ext.alarm 15"
+    ::= { powecACXTrap 39 }
+	
+u1NormalTrap NOTIFICATION-TYPE
+	OBJECTS { snmpTrapOID }
+	STATUS current
+    DESCRIPTION
+            "System output reference changed to Normal"
+    ::= { powecACXTrap 40 }
+	
+u2BoostTrap NOTIFICATION-TYPE
+	OBJECTS { snmpTrapOID }
+	STATUS current
+    DESCRIPTION
+            "System output reference changed to Boost"
+    ::= { powecACXTrap 41 }
+	
+u3TestTrap NOTIFICATION-TYPE
+	OBJECTS { snmpTrapOID }
+	STATUS current
+    DESCRIPTION
+            "System output reference changed to Test"
+    ::= { powecACXTrap 42 }
+	
+u4SpareTrap NOTIFICATION-TYPE
+	OBJECTS { snmpTrapOID }
+	STATUS current
+    DESCRIPTION
+            "System output reference changed to Spare"
+    ::= { powecACXTrap 43 }
+ 
+snmpV3ReadyTrap NOTIFICATION-TYPE
+	OBJECTS { snmpTrapOID }
+	STATUS current
+    DESCRIPTION
+            "SNMPv3 Engine is ready"
+    ::= { powecACXTrap 44 }
+	
+END
diff --git a/MAC/Navigator2/data/pow.mib b/MAC/Navigator2/data/pow.mib
new file mode 100644
index 0000000000000000000000000000000000000000..06bc66aa8458383dc864353e4f21a4662312c63d
--- /dev/null
+++ b/MAC/Navigator2/data/pow.mib
@@ -0,0 +1,1596 @@
+
+-- Powec Mib v. 1.00
+
+--   powecMIB MODULE-IDENTITY
+--       LAST-UPDATED "0110171200Z"
+--       ORGANIZATION "Power-One, Powec"
+--       CONTACT-INFO "Marius Tannum, mariust@powec.no"
+--       DESCRIPTION "System Information, Powec Power Systems"
+--       ::= { enterprises 5961 }
+	
+POWEC-MIB DEFINITIONS ::= BEGIN
+
+	IMPORTS
+
+   	enterprises, IpAddress			FROM RFC1155-SMI
+	DisplayString 				FROM RFC1213-MIB
+   	OBJECT-TYPE           			FROM RFC-1212
+	TRAP-TYPE 	    				FROM RFC-1215;
+
+
+
+	powecMIB			OBJECT IDENTIFIER ::= { enterprises 5961 }
+	dcPowerSystem 		OBJECT IDENTIFIER ::= { powecMIB 1 }
+		
+	systemInfo 			OBJECT IDENTIFIER ::= { dcPowerSystem 1 } 
+	powerSystem			OBJECT IDENTIFIER ::= { dcPowerSystem 2 }    
+	rectifierInfo		OBJECT IDENTIFIER ::= { dcPowerSystem 3 }
+	alarmInfo			OBJECT IDENTIFIER ::= { dcPowerSystem 4 }
+	battery			OBJECT IDENTIFIER ::= { dcPowerSystem 5 }
+	agentSetup			OBJECT IDENTIFIER ::= { dcPowerSystem 6 }
+	systemParameters		OBJECT IDENTIFIER ::= { dcPowerSystem 10 }
+	alarmHistory		OBJECT IDENTIFIER ::= { dcPowerSystem 12 }
+	powecTrap			OBJECT IDENTIFIER ::= { dcPowerSystem 99 }
+	
+	
+-- SYSTEM INFO variables
+
+serverName OBJECT-TYPE
+	SYNTAX  DisplayString
+	ACCESS  read-only
+	STATUS  mandatory
+	DESCRIPTION
+		"Server Name String"
+	::= { systemInfo 1 }
+
+systemName OBJECT-TYPE
+	SYNTAX  DisplayString
+	ACCESS  read-write
+	STATUS  mandatory
+	DESCRIPTION
+		"System Type String for the DC System Site"
+	::= { systemInfo 2 }
+
+powerSystemType	OBJECT-TYPE
+	SYNTAX DisplayString
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"String containing the type of power supply control module"
+	::= { systemInfo 3 }
+
+powerSystemSoftVer	OBJECT-TYPE
+	SYNTAX DisplayString
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"String containing the software version of the control module"
+	::= { systemInfo 4 }
+
+powerSystemSerialNo	OBJECT-TYPE
+	SYNTAX INTEGER
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"Serial Number of the control module"
+	::= { systemInfo 5 }
+	
+
+powerSystemAddress	OBJECT-TYPE
+	SYNTAX INTEGER(0..30000)
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"An integer containing the address of the PCU/PCS"
+	::= { systemInfo 6 }
+
+installationDate OBJECT-TYPE
+	SYNTAX DisplayString
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"Installation date of the PCU/PCS of the form 'DD.MM.YY'"
+	::= { systemInfo 7 }	
+updated OBJECT-TYPE
+	SYNTAX DisplayString
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"Date of last update of the form 'DD.MM.YY'"
+	::= { systemInfo 8 }
+outputData OBJECT-TYPE
+	SYNTAX DisplayString
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"String containing a description of the DC Output"
+	::= { systemInfo 9 }
+batteryDescript OBJECT-TYPE
+	SYNTAX DisplayString
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"String containing a description of the Battery"
+	::= { systemInfo 10 }
+batteryCapacity OBJECT-TYPE
+	SYNTAX INTEGER(0..30000)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"An integer containing battery capacity in Ah"
+		
+	::= { systemInfo 11 }
+	
+	
+
+-- POWER SYSTEM variables
+
+systemVoltage1		OBJECT-TYPE
+	SYNTAX INTEGER(0..30000)
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the system DC voltage (voltage * 100)"
+	::= { powerSystem 1 }
+
+systemVoltage2		OBJECT-TYPE
+	SYNTAX INTEGER
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing an additional DC voltage (voltage * 100)"
+	::= { powerSystem 2 }
+
+
+
+loadCurrent		OBJECT-TYPE
+	SYNTAX INTEGER
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the system load current (current * 10)"
+	::= { powerSystem 3 }
+
+
+batteryCurrent		OBJECT-TYPE
+	SYNTAX INTEGER
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the battery current (current * 10)"
+	::= { powerSystem 4 }
+
+
+rectifierCurrent	OBJECT-TYPE
+	SYNTAX INTEGER
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the rectifier current (current * 10)"
+	::= { powerSystem 5}
+externalInput1 OBJECT-TYPE
+	SYNTAX INTEGER{
+		clear(1),
+		alarm(2)
+
+	}
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"External Input-to-trap 1"
+	::= { powerSystem 6 }
+	
+externalInput2 OBJECT-TYPE
+	SYNTAX INTEGER{
+		clear(1),
+		alarm(2)
+	}
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"External Input-to-trap 2"
+	::= { powerSystem 7 }
+
+comPcu OBJECT-TYPE
+	SYNTAX INTEGER{
+		comOk(1),
+		comFailed(2)
+
+	}
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"PCU Communication OK or Failed"
+	::= { powerSystem 8 }
+
+-- RECTIFIER INFO variables
+numRectifiers OBJECT-TYPE
+	SYNTAX INTEGER
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"Number of Rectifiers in the module table"
+	::= { rectifierInfo 1 }
+
+-- MODULE INFO variables
+
+moduleTable	OBJECT-TYPE
+	SYNTAX SEQUENCE OF ModuleTable
+	ACCESS not-accessible
+	STATUS mandatory
+	DESCRIPTION
+		"Module Information Table"
+	::= { rectifierInfo 2 }
+
+moduleEntry	OBJECT-TYPE
+	SYNTAX ModuleTable
+	ACCESS not-accessible
+	STATUS mandatory
+	DESCRIPTION
+		"Queue of Module Table"
+	INDEX { moduleIndex }
+	::= { moduleTable 1 }
+	
+moduleIndex	OBJECT-TYPE
+	SYNTAX INTEGER
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"Number of Entries in the Module Table"
+	::= { moduleEntry 1 }
+
+rectifierOk	OBJECT-TYPE
+	SYNTAX INTEGER
+ 	{
+		ok(1),
+		alarm(2)
+		
+	}
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"Rectifier Module Ok or Alarm"
+	::= { moduleEntry 2 }
+
+moduleVoltage	OBJECT-TYPE
+	SYNTAX INTEGER(0..255)
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"Module Voltage "
+	::= { moduleEntry 3 }
+
+moduleCurrent	OBJECT-TYPE
+	SYNTAX INTEGER(0..255)
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"Module Current (Amp*10)"
+	::= { moduleEntry 4 }
+
+meanCurrent	OBJECT-TYPE
+	SYNTAX INTEGER(0..255)
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"Module MeanCurrent for current sharing"
+	::= { moduleEntry 5 }
+
+temperature	OBJECT-TYPE
+	SYNTAX INTEGER(-40..127)
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"Module Temperature in celcius (modules without temperature
+		measurement will show -40)"
+	::= { moduleEntry 6 }
+
+moduleComStatus	OBJECT-TYPE
+	SYNTAX INTEGER
+ 	{
+		ok(1),
+		alarm(2)
+	}
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"Module Communication Status "
+	::= { moduleEntry 7 }
+
+
+moduleStatus	OBJECT-TYPE
+	SYNTAX INTEGER(0..255)
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"Module Status: 
+			Bit 0 - Input Voltage OK
+			Bit 1 - Low Voltage Alarm
+			Bit 2 - Module Alarm
+			Bit 3 - Overvoltage Shutdown
+			Bit 4 - Current Limiting
+			Bit 5 - Power On
+			Bit 6 - OVP Enabled
+		"
+	::= { moduleEntry 8 }
+
+moduleFlag		OBJECT-TYPE
+	SYNTAX INTEGER(0..255)
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"Module Flag "
+	::= { moduleEntry 9 }
+
+moduleConfig	OBJECT-TYPE
+	SYNTAX INTEGER
+ 	{
+		pmp30_48(1),
+		pmp30_110(2),
+		pmp30_220(3),
+		pmp15_48(5),
+		pmp10_24(7),
+		pmp10_48(9),
+		pmp30_24(17),
+		pmp25_24(22),
+		pmp25_48(24),
+		eqGroup1(33),
+		pmp5024(52),
+		pmp5048(54),
+		eqGroup2(65)
+
+	}
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"Module Config, Type of module installed: 
+			1	PMP 30.48
+			2	PMP 30.110
+			3	PMP 30.220
+			5	PMP 15.48
+			7	PMP 10.24
+			9	PMP 10.48
+			17	PMP 30.24
+			22	PMP 25.24
+			24	PMP 25.48
+			33	EQ Group 1
+			52	PMP 50.24
+			54	PMP 50.48
+			65	EQ Group 2
+			"
+	::= {moduleEntry 10 }
+	
+softVersion OBJECT-TYPE
+	SYNTAX DisplayString
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"Software version in the module"
+	::= { moduleEntry 11 }
+moduleSerialNo OBJECT-TYPE
+	SYNTAX INTEGER
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"Serial Number of the module"
+	::= { moduleEntry 12 }
+
+
+
+-- ALARM INFO variables (Alarm and Status Information)
+-- The alarmRelay, alarmData, extraAlarmData and statusData
+-- are integers from 0-255 containing the byte value received 
+-- from the controlmodule. The agent interprets these bytes and
+-- display them as text alarms in the "activeAlarmTable". 
+
+mainsFailureFlag	OBJECT-TYPE
+	SYNTAX INTEGER(0..255)
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the mains failure flag"
+	::= { alarmInfo 1 }
+
+alarmRelay1	OBJECT-TYPE
+	SYNTAX INTEGER(0..255)
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"A byte containing alarm relay status for relay 1 to 8 "
+	::= { alarmInfo 2 }
+
+alarmRelay2	OBJECT-TYPE
+	SYNTAX INTEGER(0..255)
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"A byte containing alarm relay status for relay 9 to 16 "
+	::= { alarmInfo 3 }
+
+alarmData1	OBJECT-TYPE
+	SYNTAX INTEGER(0..255)
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"A byte containing alarm data 1"
+	::= { alarmInfo 4 }
+
+alarmData2	OBJECT-TYPE
+	SYNTAX INTEGER(0..255)
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"A byte containing alarm data 2"
+	::= { alarmInfo 5 }
+
+alarmData3	OBJECT-TYPE
+	SYNTAX INTEGER(0..255)
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"A byte containing alarm data 3"
+	::= { alarmInfo 6 }
+	
+extraAlarmData1	OBJECT-TYPE
+	SYNTAX INTEGER(0..255)
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"A byte containing extra alarm data 1"
+	::= { alarmInfo 7 }
+	
+extraAlarmData2	OBJECT-TYPE
+	SYNTAX INTEGER(0..255)
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"A byte containing extra alarm data 2"
+	::= { alarmInfo 8 }
+
+
+statusData1	OBJECT-TYPE
+	SYNTAX INTEGER(0..255)
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"A byte containing status data 1"
+	::= { alarmInfo 9 }
+
+statusData2	OBJECT-TYPE
+	SYNTAX INTEGER(0..255)
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"A byte containing status data 2"
+	::= { alarmInfo 10 }
+
+statusData3	OBJECT-TYPE
+	SYNTAX INTEGER(0..255)
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"A byte containing status data 3"
+	::= { alarmInfo 11 }
+
+numbOfAlarms	OBJECT-TYPE
+	SYNTAX INTEGER(0..100)
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"Variable containing the number of active alarms at the moment"
+	::= { alarmInfo 12 }
+activeAlarmTable	OBJECT-TYPE
+	SYNTAX SEQUENCE OF ActiveAlarmTable
+	ACCESS not-accessible
+	STATUS mandatory
+	DESCRIPTION
+		"Active Alarm Table"
+	::= { alarmInfo 13 }
+
+activeAlarmEntry	OBJECT-TYPE
+	SYNTAX ActiveAlarmTable
+	ACCESS not-accessible
+	STATUS mandatory
+	DESCRIPTION
+		"Queue of Active Alarm Table"
+	INDEX { alarmIndex }
+	::= { activeAlarmTable 1 }
+	
+alarmIndex	OBJECT-TYPE
+	SYNTAX INTEGER
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"Entery Number in the Active Alarm Table"
+	::= { activeAlarmEntry 1 }
+
+alarmText	OBJECT-TYPE
+	SYNTAX DisplayString
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"Active Alarm Description String"
+	::= { activeAlarmEntry 2 }	
+
+alarmType	OBJECT-TYPE
+	SYNTAX INTEGER
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"Type Number of the Active Alarm"
+	::= { activeAlarmEntry 3 }	
+
+alarmDate	OBJECT-TYPE
+	SYNTAX DisplayString
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"Date and Time of the Active Alarm (syntax: hh:mm dd.mm.yy)"
+	::= { activeAlarmEntry 4 }	
+
+-- SYMMETRY
+
+battTemp OBJECT-TYPE
+	SYNTAX INTEGER
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"Battery Temperature"
+	::= { battery 1 }
+	
+numbOfBatteries OBJECT-TYPE
+	SYNTAX INTEGER(0..255)
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"Number of Battery strings"
+	::= { battery 2 }
+	
+
+symmetryTable	OBJECT-TYPE
+	SYNTAX SEQUENCE OF SymmetryTable
+	ACCESS not-accessible
+	STATUS mandatory
+	DESCRIPTION
+		"Battery Symmetry Voltage Table for up to 4 voltage measurements
+		for each battery string."
+	::= { battery 3 }
+
+symmetryEntry	OBJECT-TYPE
+	SYNTAX SymmetryTable
+	ACCESS not-accessible
+	STATUS mandatory
+	DESCRIPTION
+		"Queue of Symmetry Table"
+	INDEX { symmetryIndex }
+	::= { symmetryTable 1 }
+	
+symmetryIndex	OBJECT-TYPE
+	SYNTAX INTEGER
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"Entery Number in the Symmetry Table"
+	::= { symmetryEntry 1 }
+
+symmetry1	OBJECT-TYPE
+	SYNTAX INTEGER
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"Symmetry Voltage in Branch 1"
+	::= { symmetryEntry 2 }
+symmetry2	OBJECT-TYPE
+	SYNTAX INTEGER
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"Symmetry Voltage in Branch 2"
+	::= { symmetryEntry 3 }
+symmetry3	OBJECT-TYPE
+	SYNTAX INTEGER
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"Symmetry Voltage in Branch 3"
+	::= { symmetryEntry 4 }
+symmetry4	OBJECT-TYPE
+	SYNTAX INTEGER
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"Symmetry Voltage in Branch 4"
+	::= { symmetryEntry 5 }
+
+
+
+
+
+-- AGENT SETUP
+
+trapReciepient1	OBJECT-TYPE
+	SYNTAX IpAddress
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"IP address to Trap Reciepient 1"
+	::= { agentSetup 1 }
+
+trapReciepient2	OBJECT-TYPE
+	SYNTAX IpAddress
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"IP address to Trap Reciepient 2"
+	::= { agentSetup 2 }
+trapReciepient3	OBJECT-TYPE
+	SYNTAX IpAddress
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"IP address to Trap Reciepient 3"
+	::= { agentSetup 3 }
+trapReciepient4	OBJECT-TYPE
+	SYNTAX IpAddress
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"IP address to Trap Reciepient 4"
+	::= { agentSetup 4 }
+trapReciepient5	OBJECT-TYPE
+	SYNTAX IpAddress
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"IP address to Trap Reciepient 5"
+	::= { agentSetup 5 }
+trapReciepient6	OBJECT-TYPE
+	SYNTAX IpAddress
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"IP address to Trap Reciepient 6"
+	::= { agentSetup 6 }
+
+includeText	OBJECT-TYPE
+	SYNTAX INTEGER{
+		include(1),
+		notInclude(2),
+		onlyOneTrap(3)
+	}
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"Include text in the Trap
+			Trap syntax: ahText ahEntryType ahReason
+
+		 OnlyoneTrap syntax:
+			alarmData1 alarmData2 alarmData3 extraAlarmData1
+			extraAlarmData2 statusData1 statusData2 statusData3
+			externalInput1 externalInput2 comPcu
+		"
+	::= { agentSetup 7 }
+	
+trapOnClear	OBJECT-TYPE
+	SYNTAX INTEGER{
+		onClear(1),
+		notOnClear(2)
+	}
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"Send Trap when alarm Clears, applies only when includText is
+		 in the state inclued(1) or notInclued(2)
+		"
+	::= { agentSetup 8 }
+	
+externalInput1Text	OBJECT-TYPE
+	SYNTAX DisplayString
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"Text Description of External Input 1 "
+	::= { agentSetup 9 }	
+	
+externalInput2Text	OBJECT-TYPE
+	SYNTAX DisplayString
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"Text Description of External Input 2 "
+	::= { agentSetup 10 }	
+
+
+-- ALARM HISTORY
+
+alarmHistoryCount	OBJECT-TYPE
+	SYNTAX INTEGER
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"Number of Alarm History entries in the History Table"
+	::= { alarmHistory 1 }
+	
+alarmHistoryTable	OBJECT-TYPE
+	SYNTAX SEQUENCE OF HistoryTable
+	ACCESS not-accessible
+	STATUS mandatory
+	DESCRIPTION
+		"Alarm History Table"
+	::= { alarmHistory 2 }
+
+alarmHistoryEntry	OBJECT-TYPE
+	SYNTAX HistoryTable
+	ACCESS not-accessible
+	STATUS mandatory
+	DESCRIPTION
+		"Queue of History Table"
+	INDEX { ahTableIndex }
+	::= { alarmHistoryTable 1 }
+	
+ahTableIndex	OBJECT-TYPE
+	SYNTAX INTEGER
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"Entery Number in the History Table"
+	::= { alarmHistoryEntry 1 }
+
+ahEntryType	OBJECT-TYPE
+	SYNTAX INTEGER
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"Type of Alarm"
+	::= { alarmHistoryEntry 2 }
+
+ahReason	OBJECT-TYPE
+	SYNTAX INTEGER
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"Reason for the entry in the History Table
+			3 - Alarm Bytes Changed (only if 'oneTrap' enabled)
+			2 - Alarm Appeard
+			1 - Alarm Cleared
+		"
+	::= { alarmHistoryEntry 3 }
+
+ahTime	OBJECT-TYPE
+	SYNTAX DisplayString
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"Time and date of the History Table entry"
+	::= { alarmHistoryEntry 4 }
+
+ahText	OBJECT-TYPE
+	SYNTAX DisplayString
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"Alarm Text for this ahEntryType"
+	::= { alarmHistoryEntry 5 }
+
+	
+alarmHistoryTableClear	OBJECT-TYPE
+	SYNTAX INTEGER
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"Set of this OID will clear the alarm history "
+	::= { alarmHistory 3 }
+
+trapString	OBJECT-TYPE
+	SYNTAX DisplayString
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"Last Trap string
+		 If onlyOneTrap is set to 1 then the format of trapString is:
+			alarmData1 alarmData2 alarmData3 extraAlarmData1
+			extraAlarmData2 statusData1 statusData2 statusData3
+			externalInput1 externalInput2 comPCU
+		 
+		 If includeText is set to 1 then the format:
+		 	ahText ahEntryType ahReason
+
+		"
+	::= { alarmHistory 4 }
+
+
+-- SYSTEM PARAMETERS
+uFlag	OBJECT-TYPE
+	SYNTAX INTEGER{
+		u1normal(1),
+		u2boost(2),
+		u3test(3),
+		u4spare(4)
+	}
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the operation mode Flag (normal, boost charge, test, spare)"
+	::= { systemParameters 1 }
+
+u1NormalRef	OBJECT-TYPE
+	SYNTAX INTEGER(0..3000)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing U1 (Normal) Reference Voltage (Volt*10)"
+	::= { systemParameters 2 }
+
+u2BoostRef	OBJECT-TYPE
+	SYNTAX INTEGER(0..3000)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing U2 (Boost) Reference Voltage (Volt*10)"
+	::= { systemParameters 3 }
+
+u3TestRef	OBJECT-TYPE
+	SYNTAX INTEGER(0..3000)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing U3 (Test) Reference Voltage (Volt*10)"
+	::= { systemParameters 4 }
+
+u4SpareRef	OBJECT-TYPE
+	SYNTAX INTEGER(0..3000)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing U4 (Spare) Reference Voltage (Volt*10)"
+	::= { systemParameters 5 }
+
+
+lowVoltLim	OBJECT-TYPE
+	SYNTAX INTEGER(0..3000)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Low Voltage Limit (Volt*10)"
+	::= { systemParameters 6 }
+
+
+lowVoltDisconVoltLim	OBJECT-TYPE
+	SYNTAX INTEGER(0..3000)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Low Voltage Disconnect Limit (Volt*10)"
+	::= { systemParameters 7 }
+
+lowVoltDisconHourLim	OBJECT-TYPE
+	SYNTAX INTEGER(0..3000)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Low Voltage Disconnect Limit (Hour*10)"
+	::= { systemParameters 8 }
+
+lowVoltDisconMinuteLim	OBJECT-TYPE
+	SYNTAX INTEGER(0..3000)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Low Voltage Disconnect Limit (Minute*10)"
+	::= { systemParameters 9 }
+
+
+lowVoltReconLim	OBJECT-TYPE
+	SYNTAX INTEGER(0..3000)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Low Voltage Reconnect Limit (Volt*10)"
+	::= { systemParameters 10 }
+partLoadDisconVolt	OBJECT-TYPE
+	SYNTAX INTEGER(0..3000)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Partial Load Disconnection Limit (V*10)
+		Only one variable of partLoadDisconVolt, partLoadDisconHour or partLoadDisconMinute 
+		will be acive based on the configuration of the PCU/PCS"
+	::= { systemParameters 11 }
+
+partLoadDisconHour	OBJECT-TYPE
+	SYNTAX INTEGER(0..3000)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Partial Load Disconnection Limit (Hour*10)
+		Only one variable of partLoadDisconVolt, partLoadDisconHour or partLoadDisconMinute 
+		will be acive based on the configuration of the PCU/PCS"
+	::= { systemParameters 12 }
+
+partLoadDisconMinute	OBJECT-TYPE
+	SYNTAX INTEGER(0..3000)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Partial Load Disconnection Limit (Minute*10)
+		Only one variable of partLoadDisconVolt, partLoadDisconHour or partLoadDisconMinute 
+		will be acive based on the configuration of the PCU/PCS"
+	::= { systemParameters 13 }
+
+highVoltLim	OBJECT-TYPE
+	SYNTAX INTEGER(0..3000)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the High Voltage Limit (Volt*10)"
+	::= { systemParameters 14 }
+	
+highVoltDisconLim	OBJECT-TYPE
+	SYNTAX INTEGER(0..3000)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the High Voltage Disconnect Limit (Volt*10)"
+	::= { systemParameters 15 }
+
+autoBoostFlag	OBJECT-TYPE
+--	SYNTAX INTEGER(0..1)
+	SYNTAX INTEGER{
+		boostEnabled(1)
+	}
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Auto Boost Flag(1 for auto boost enabled, 0 disabled)."
+	::= { systemParameters 16 }
+
+boostTime	OBJECT-TYPE
+	SYNTAX INTEGER(0..200)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Boost Time value (hour*10)"
+	::= { systemParameters 17 }
+
+boostInterval	OBJECT-TYPE
+	SYNTAX INTEGER(30..160)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Boost Interval value (weeks*10)"
+	::= { systemParameters 18 }
+
+boostTimeFactor	OBJECT-TYPE
+	SYNTAX INTEGER(0..20)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Boost Time Factor"
+	::= { systemParameters 19 }
+
+boostLimit1	OBJECT-TYPE
+	SYNTAX INTEGER(0..3000)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Boost Limit1 value (Volt*10)"
+	::= { systemParameters 20 }
+
+boostLimit2	OBJECT-TYPE
+	SYNTAX INTEGER(0..3000)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Boost Limit2 value (Volt*10)"
+	::= { systemParameters 21 }
+
+
+
+noOfBatteries	OBJECT-TYPE
+	SYNTAX INTEGER(0..12)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Number of Batteries"
+	::= { systemParameters 22 }
+
+batType	OBJECT-TYPE
+	SYNTAX INTEGER{
+		a4Block(1),
+		a23CellsPositive(2),
+		a23CellsNegative(3),
+		a3Block(4),
+		a2Block(5)
+	}
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Type Of Battery"
+	::= { systemParameters 23 }
+
+symLimit	OBJECT-TYPE
+	SYNTAX INTEGER(0..50)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Symmetry Limit (Volt*10)"
+	::= { systemParameters 24 }
+
+autoTestFlag	OBJECT-TYPE
+	SYNTAX INTEGER(0..4)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the number of automatic battery tests
+		performed per year."
+	::= { systemParameters 25}
+
+startHForTest	OBJECT-TYPE
+	SYNTAX INTEGER(0..23)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Start Hour for Automatic Test"
+	::= { systemParameters 26 }
+
+voltLimForTest	OBJECT-TYPE
+	SYNTAX INTEGER(0..3000)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Voltage Limit for Battery Test (Volt*10)"
+	::= { systemParameters 27 }
+
+timeLimForTest	OBJECT-TYPE
+	SYNTAX INTEGER(0..600)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Time Limit For Test (minutes)"
+	::= { systemParameters 28 }
+
+ampLimForTest	OBJECT-TYPE
+	SYNTAX INTEGER(0..5000)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Amphour Limit For Test (Ah)"
+	::= { systemParameters 29 }
+
+year	OBJECT-TYPE
+	SYNTAX INTEGER(0..99)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Year"
+	::= { systemParameters 30 }
+
+month	OBJECT-TYPE
+	SYNTAX INTEGER(0..12)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Month"
+	::= { systemParameters 31 }
+
+day	OBJECT-TYPE
+	SYNTAX INTEGER(0..1)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Day"
+	::= { systemParameters 32 }
+
+hour	OBJECT-TYPE
+	SYNTAX INTEGER(0..23)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Hour"
+	::= { systemParameters 33 }
+
+minute	OBJECT-TYPE
+	SYNTAX INTEGER(0..60)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Minute"
+	::= { systemParameters 34 }
+
+tempCompFlag	OBJECT-TYPE
+	SYNTAX INTEGER(0..1)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Temperature Compensation Flag"
+	::= { systemParameters 35 }
+
+tempCompFactor	OBJECT-TYPE
+	SYNTAX INTEGER(0..20)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Temperature Compensation Factor (Volt*10/10C)"
+	::= { systemParameters 36 }
+
+
+tempLimit	OBJECT-TYPE
+	SYNTAX INTEGER(0..1000)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Temperature Limit (C*10)"
+	::= { systemParameters 37 }
+
+highLoadLimit	OBJECT-TYPE
+	SYNTAX INTEGER(0..100)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the High Load Limit (% of full capacity)"
+	::= { systemParameters 38 }
+
+signals	OBJECT-TYPE
+	SYNTAX INTEGER {
+		resetAlarms(1),
+		reconfigureSystem(2)
+	}
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Signal byte
+			Bit 0 - Reset Alarms
+			Bit 1 - Reconfigure System
+		
+		"
+	::= { systemParameters 39 }
+
+networkAdr	OBJECT-TYPE
+	SYNTAX INTEGER(1..255)
+	ACCESS read-only
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Network Address for the PCU/PCS"
+	::= { systemParameters 40 }
+
+shuntA	OBJECT-TYPE
+	SYNTAX INTEGER(0..5000)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Shunt Current Rating (A)"
+	::= { systemParameters 41 }
+
+shuntmV	OBJECT-TYPE
+	SYNTAX INTEGER(0..1000)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the Shunt mV Rating (mV)"
+	::= { systemParameters 42 }
+
+batCurrLimEnabled	OBJECT-TYPE
+	SYNTAX INTEGER {
+		enabled(1),
+		disabled(2)
+	}
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"Battery Current Limit Enabled
+		"
+	::= { systemParameters 43 }
+
+currLimRef	OBJECT-TYPE
+	SYNTAX INTEGER(50..30000)
+	ACCESS read-write
+	STATUS mandatory
+	DESCRIPTION
+		"A variable containing the battery Current Limit reference (Amp*10)"
+	::= { systemParameters 44 }
+
+
+
+
+
+-- Traps
+
+lowVoltTrap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		trapString
+    }
+    DESCRIPTION
+            "Low DC Voltage Alarm "
+    ::= 1
+
+
+highVoltTrap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		trapString
+    }
+    DESCRIPTION
+            "High DC Voltage Alarm"
+    ::= 2
+    
+loadBattDisconTrap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		trapString
+    }
+    DESCRIPTION
+            "Load/Battery Disconnected"
+    ::= 3
+mainsFailTrap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		trapString
+    }
+    DESCRIPTION
+            "Mains Failure Alarm"
+    ::= 4
+distrFuseTrap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		trapString
+    }
+    DESCRIPTION
+            "Distribution Fuse Failure"
+    ::= 5
+earthFailTrap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		trapString
+    }
+    DESCRIPTION
+            "Earth Failure Alarm"
+    ::= 6
+battFailTrap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		trapString
+    }
+    DESCRIPTION
+            "Battery Failure"
+    ::= 7
+rectifierFailTrap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		trapString
+    }
+    DESCRIPTION
+            "Rectifier Failure"
+    ::= 8
+
+battTempTrap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		trapString
+    }
+    DESCRIPTION
+            "Battery Temperature Alarm"
+    ::= 9
+symmFailTrap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		trapString
+    }
+    DESCRIPTION
+            "Symmetry Fault Alarm"
+    ::= 10
+battFuseTrap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		trapString
+    }
+    DESCRIPTION
+            "Battery Fuse Failure"
+    ::= 11
+highLoadTrap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		trapString
+    }
+    DESCRIPTION
+            "High Load"
+    ::= 12
+electrlLowTrap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		trapString
+    }
+    DESCRIPTION
+            "Electrolyte Low"
+    ::= 13
+urgentModFailTrap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		trapString
+    }
+    DESCRIPTION
+            "Urgent Module Failure"
+    ::= 14
+rectModRemTrap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		trapString
+    }
+    DESCRIPTION
+            "Rectifier Module Removed"
+    ::= 15
+partLoadDisconTrap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		trapString
+    }
+    DESCRIPTION
+            "Partial Load Disconnected"
+    ::= 16
+dischargingTrap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		trapString
+    }
+    DESCRIPTION
+            "Battery is Discharging"
+    ::= 17
+battTestTrap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		trapString
+    }
+    DESCRIPTION
+            "Battery Test in Progress"
+    ::= 18
+alarmsBlockedTrap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		trapString
+    }
+    DESCRIPTION
+            "Alarms Are Blocked"
+    ::= 19
+highBattTempTrap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		trapString
+    }
+    DESCRIPTION
+            "High Battery Temperature"
+    ::= 20
+battFuseDisconTrap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		trapString
+    }
+    DESCRIPTION
+            "Battery Fuse Disconnected"
+    ::= 21
+comFailTrap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		trapString
+    }
+    DESCRIPTION
+            "Communication Failure"
+    ::= 22
+tempProbeTrap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		trapString
+    }
+    DESCRIPTION
+            "Temperature Probe Failure"
+    ::= 23
+ovShutdownTrap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		trapString
+    }
+    DESCRIPTION
+            "Overvoltage Shutdown"
+    ::= 24
+commonAlarmTrap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		trapString
+    }
+    DESCRIPTION
+            "Common Alarm"
+    ::= 25
+intFuseTrap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		trapString
+    }
+    DESCRIPTION
+            "Internal Fuse Failure"
+    ::= 26
+loadDisconTrap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		trapString
+    }
+    DESCRIPTION
+            "Load Disconnected"
+    ::= 27
+pcuDeactivTrap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		trapString
+    }
+    DESCRIPTION
+            "PCU Deactivated"
+    ::= 28
+currLimRedTrap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		trapString
+    }
+    DESCRIPTION
+            "Current Limit Reduced"
+    ::= 29
+distBattFuseFailTrap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		trapString
+    }
+    DESCRIPTION
+            "Distribution/Battery Fuse Failure"
+    ::= 30
+blockedAlarmsTrap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		trapString
+    }
+    DESCRIPTION
+            "Alarms are Blocked"
+    ::= 31
+distHighLoadTrap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		trapString
+    }
+    DESCRIPTION
+            "Distribution Load High"
+    ::= 32
+u1NormalTrap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		trapString
+    }
+    DESCRIPTION
+            "System output reference changed to Normal"
+    ::= 33
+u2BoostTrap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		trapString
+    }
+    DESCRIPTION
+            "System output reference changed to Boost"
+    ::= 34
+u3TestTrap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		trapString
+    }
+    DESCRIPTION
+            "System output reference changed to Test"
+    ::= 35
+u4SpareTrap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		trapString
+    }
+    DESCRIPTION
+            "System output reference changed to Spare"
+    ::= 36
+externInput1Trap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		trapString
+    }
+    DESCRIPTION
+            "External Input Trap1  - 2 Alarm, 1 Clear"
+    ::= 80
+    
+externInput2Trap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		externalInput2
+    }
+    DESCRIPTION
+            "External Input Trap2 - 2 Alarm, 1 Clear"
+    ::= 81
+       
+pcuComTrap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		trapString
+    }
+    DESCRIPTION
+            "PCU/PCS Communication Fail - 2 Alarm, 1 Clear"
+    ::= 100
+    
+oneTrap TRAP-TYPE
+    ENTERPRISE powecTrap
+    VARIABLES {
+    		trapString
+    }
+    DESCRIPTION
+            "One Trap containing status and Alarm info of the format:
+		  	alarmData1 alarmData2 alarmData3 extraAlarmData1
+			extraAlarmData2 statusData1 statusData2 statusData3
+			externalInput1 externalInput2 comPCU
+		  "
+    ::= 110
+
+  HistoryTable ::= 
+   SEQUENCE { 
+      ahTableIndex
+          INTEGER,
+      ahEntryType
+          INTEGER,
+      ahReason
+          INTEGER,
+      ahTime
+          DisplayString,
+		ahText
+			 DisplayString
+ }
+   
+  SymmetryTable ::= 
+   SEQUENCE { 
+      symmetryIndex
+          INTEGER,
+      symmetry1
+          INTEGER,
+      symmetry2
+          INTEGER,
+      symmetry3
+          INTEGER,
+		symmetry4
+			 INTEGER
+ }
+  ModuleTable ::= 
+   SEQUENCE { 
+      moduleIndex
+          INTEGER,
+      rectifierOk
+          INTEGER,
+      moduleVoltage
+          INTEGER,
+      moduleCurrent
+          INTEGER,
+	 meanCurrent
+		INTEGER,
+	 temperature
+		INTEGER,
+	 moduleComStatus
+		INTEGER,
+	 moduleStatus
+		INTEGER,
+	 moduleFlag
+		INTEGER,
+	 moduleConfig
+		INTEGER,
+	 softVersion 
+	 	DisplayString,
+	 moduleSerialNo
+	 	INTEGER
+
+ }
+  ActiveAlarmTable ::= 
+   SEQUENCE { 
+      alarmIndex
+          INTEGER,
+      alarmText
+          DisplayString,
+      alarmType
+          INTEGER,
+      alarmDate
+          DisplayString
+ }	  
+END
diff --git a/MAC/Navigator2/panels/Alerts/lofar_alarms.pnl b/MAC/Navigator2/panels/Alerts/lofar_alarms.pnl
index 20d2b5d3ecd63ea9ec572b8d790e9032b4c6fe75..624d01881ad9a3d90c3a60df216d6ad1e045ca15 100644
--- a/MAC/Navigator2/panels/Alerts/lofar_alarms.pnl
+++ b/MAC/Navigator2/panels/Alerts/lofar_alarms.pnl
@@ -1,7 +1,7 @@
-V 11
+V 13
 1
 LANG:1 0 
-PANEL,-1 -1 1225 823 N "_3DFace" 0
+PANEL,-1 -1 1128 823 N "_3DFace" 0
 "main()
 {
    // Initialise the Panel
@@ -46,50 +46,18 @@ E "#uses \"navPanel.ctl\"
 string baseDP=\"\";
 
 " 0
- 2
+ 3
 "CBRef" "1"
 "EClose" E
+"dpi" "96"
+0 0 0
 ""
 DISPLAY_LAYER, 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
 LAYER, 0 
 1
 LANG:1 0 
-28 0
-"Alarms"
-""
-1 0 -3.11213968697036e-014 E E E 1 E 1 E N "_3DText" E N "_3DFace" E E
- E E
-0 0 0 0 0 0
-E E E
+1 1 0 "0" 26
 0
-1
-LANG:1 0 
-
-0
-1
-LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0
-0  -2 -2 1162 832
-E3 "New Alarms" 1
-LANG:1 10 New Alarms
-1 "objects/Alerts/alarms.pnl" 1
-LANG:1 0 
-1
-"$choice""New"
-
-"Old Alarms" 1
-LANG:1 10 Old Alarms
-1 "objects/Alerts/alarms.pnl" 1
-LANG:1 0 
-1
-"$choice""Old"
-
-"WinCCOA_Alarms" 1
-LANG:1 15 WinCC-OA Alarms
-1 "objects/Alerts/alarmsWinCCOA.pnl" 1
-LANG:1 0 
-0
-
-
 0
 LAYER, 1 
 1
@@ -119,4 +87,8 @@ LAYER, 7
 1
 LANG:1 0 
 0
+3 0 "PANEL_REF0" -1
+"" ""
+"objects/Alerts/alarmsWinCCOA.pnl" -340 1111.5 T 1 U 
+0
 0
diff --git a/MAC/Navigator2/panels/Hardware/LOFAR_Core.pnl b/MAC/Navigator2/panels/Hardware/LOFAR_Core.pnl
index 5e8c760b49e2e2f0a816e86d86797afec1739c18..67909759c7d84bf9a5e888fde6ddeee85bf47e85 100644
--- a/MAC/Navigator2/panels/Hardware/LOFAR_Core.pnl
+++ b/MAC/Navigator2/panels/Hardware/LOFAR_Core.pnl
@@ -1,4 +1,4 @@
-V 11
+V 13
 1
 LANG:1 8 (NoName)
 PANEL,-1 -1 1200 823 N "_3DFace" 0
@@ -55,9 +55,11 @@ void reload() {
 ""0  1
 E "#uses \"navPanel.ctl\"
 " 0
- 2
+ 3
 "CBRef" "1"
 "EClose" E
+"dpi" "96"
+0 0 0
 ""
 DISPLAY_LAYER, 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
 LAYER, 0 
@@ -74,153 +76,58 @@ E E E
 1
 LANG:1 0 
 
-1
+2
 "dashclr"N "_Transparent"
+"antiAliased" "0"
 E E 0 1 1 0 1 E U  2  1 0  "pictures/LOFAR_Core.jpg" 13434828 E 0 0 1199 822
 1 7 13 "" 2
 0
-1 8 13 "1" 1
-0
-1 9 13 "" 1
-0
 1 10 20 "" 2
 0
-1 11 20 "1" 1
-0
-1 12 20 "" 1
-0
 1 13 21 "" 2
 0
-1 14 21 "1" 1
-0
-1 15 21 "" 1
-0
 1 16 22 "" 2
 0
-1 17 22 "1" 1
-0
-1 18 22 "" 1
-0
 1 19 23 "" 2
 0
-1 20 23 "1" 1
-0
-1 21 23 "" 1
-0
 1 22 24 "" 2
 0
-1 23 24 "1" 1
-0
-1 24 24 "" 1
-0
 1 25 25 "" 2
 0
-1 26 25 "1" 1
-0
-1 27 25 "" 1
-0
 1 28 26 "" 2
 0
-1 29 26 "1" 1
-0
-1 30 26 "" 1
-0
 1 31 27 "" 2
 0
-1 32 27 "1" 1
-0
-1 33 27 "" 1
-0
 1 34 28 "" 2
 0
-1 35 28 "1" 1
-0
-1 36 28 "" 1
-0
 1 37 29 "" 2
 0
-1 38 29 "1" 1
-0
-1 39 29 "" 1
-0
 1 40 30 "" 2
 0
-1 41 30 "1" 1
-0
-1 42 30 "" 1
-0
 1 43 31 "" 2
 0
-1 44 31 "1" 1
-0
-1 45 31 "" 1
-0
 1 46 34 "" 2
 0
-1 47 34 "1" 1
-0
-1 48 34 "" 1
-0
 1 49 35 "" 2
 0
-1 50 35 "1" 1
-0
-1 51 35 "" 1
-0
 1 52 38 "" 2
 0
-1 53 38 "1" 1
-0
-1 54 38 "" 1
-0
 1 55 43 "" 2
 0
-1 56 43 "1" 1
-0
-1 57 43 "" 1
-0
 1 58 44 "" 2
 0
-1 59 44 "1" 1
-0
-1 60 44 "" 1
-0
 1 61 49 "" 2
 0
-1 62 49 "1" 1
-0
-1 63 49 "" 1
-0
 1 64 50 "" 2
 0
-1 65 50 "1" 1
-0
-1 66 50 "" 1
-0
 1 67 51 "" 2
 0
-1 68 51 "1" 1
-0
-1 69 51 "" 1
-0
 1 70 52 "" 2
 0
-1 71 52 "1" 1
-0
-1 72 52 "" 1
-0
 1 73 53 "" 2
 0
-1 74 53 "1" 1
-0
-1 75 53 "" 1
-0
 1 76 54 "" 2
 0
-1 77 54 "1" 1
-0
-1 78 54 "" 1
-0
 0
 LAYER, 1 
 1
@@ -251,99 +158,123 @@ LAYER, 7
 LANG:1 6 Layer8
 0
 3 13 "PANEL_REF14" -1
-"objects\\Hardware\\Station_small.pnl" 457 486 T 34 0.7424242424242424 0 0.7407407407407407 188.1779915092959 7.141558673925886
+"" ""
+"objects/Hardware/Station_small.pnl" 457 486 T 34 0.7424242424242424 0 0.7407407407407407 188.1779915092959 7.141558673925886
 1
 "$Station""CS004"
 3 20 "PANEL_REF21" -1
-"objects\\Hardware\\Station_small.pnl" 457 486 T 42 0.7424242424242424 0 0.7407407407407407 188.1779915092959 -32.85844132607411
+"" ""
+"objects/Hardware/Station_small.pnl" 457 486 T 42 0.7424242424242424 0 0.7407407407407407 188.1779915092959 -32.85844132607411
 1
 "$Station""CS003"
 3 21 "PANEL_REF22" -1
-"objects\\Hardware\\Station_small.pnl" 457 486 T 43 0.7424242424242424 0 0.7407407407407407 218.1779915092959 -12.8584413260741
+"" ""
+"objects/Hardware/Station_small.pnl" 457 486 T 43 0.7424242424242424 0 0.7407407407407407 218.1779915092959 -12.8584413260741
 1
 "$Station""CS002"
 3 22 "PANEL_REF23" -1
-"objects\\Hardware\\Station_small.pnl" 457 486 T 44 0.7424242424242424 0 0.7072354607860037 218.1779915092959 34.0067393950838
+"" ""
+"objects/Hardware/Station_small.pnl" 457 486 T 44 0.7424242424242424 0 0.7072354607860037 218.1779915092959 34.0067393950838
 1
 "$Station""CS005"
 3 23 "PANEL_REF24" -1
-"objects\\Hardware\\Station_small.pnl" 457 486 T 45 0.7424242424242424 0 0.7407407407407407 298.1779915092959 67.1415586739259
+"" ""
+"objects/Hardware/Station_small.pnl" 457 486 T 45 0.7424242424242424 0 0.7407407407407407 298.1779915092959 67.1415586739259
 1
 "$Station""CS011"
 3 24 "PANEL_REF25" -1
-"objects\\Hardware\\Station_small.pnl" 457 486 T 46 0.7424242424242424 0 0.7407407407407407 238.1779915092959 -32.8584413260741
+"" ""
+"objects/Hardware/Station_small.pnl" 457 486 T 46 0.7424242424242424 0 0.7407407407407407 238.1779915092959 -32.8584413260741
 1
 "$Station""CS007"
 3 25 "PANEL_REF26" -1
-"objects\\Hardware\\Station_small.pnl" 457 486 T 47 0.7424242424242424 0 0.7407407407407407 438.1779915092959 67.14155867392589
+"" ""
+"objects/Hardware/Station_small.pnl" 457 486 T 47 0.7424242424242424 0 0.7407407407407407 438.1779915092959 67.14155867392589
 1
 "$Station""CS201"
 3 26 "PANEL_REF27" -1
-"objects\\Hardware\\Station_small.pnl" 457 486 T 48 0.7424242424242424 0 0.7407407407407407 188.1779915092959 267.1415586739259
+"" ""
+"objects/Hardware/Station_small.pnl" 457 486 T 48 0.7424242424242424 0 0.7407407407407407 188.1779915092959 267.1415586739259
 1
 "$Station""CS301"
 3 27 "PANEL_REF28" -1
-"objects\\Hardware\\Station_small.pnl" 457 486 T 49 0.7424242424242424 0 0.7407407407407407 678.1779915092959 -32.85844132607414
+"" ""
+"objects/Hardware/Station_small.pnl" 457 486 T 49 0.7424242424242424 0 0.7407407407407407 678.1779915092959 -32.85844132607414
 1
 "$Station""CS103"
 3 28 "PANEL_REF29" -1
-"objects\\Hardware\\Station_small.pnl" 457 486 T 50 0.7424242424242424 0 0.7407407407407407 88.17799150929585 -82.85844132607411
+"" ""
+"objects/Hardware/Station_small.pnl" 457 486 T 50 0.7424242424242424 0 0.7407407407407407 88.17799150929585 -82.85844132607411
 1
 "$Station""CS021"
 3 29 "PANEL_REF30" -1
-"objects\\Hardware\\Station_small.pnl" 457 486 T 51 0.7424242424242424 0 0.7407407407407407 68.17799150929585 -222.8584413260741
+"" ""
+"objects/Hardware/Station_small.pnl" 457 486 T 51 0.7424242424242424 0 0.7407407407407407 68.17799150929585 -222.8584413260741
 1
 "$Station""CS030"
 3 30 "PANEL_REF31" -1
-"objects\\Hardware\\Station_small.pnl" 457 486 T 52 0.7424242424242424 0 0.7407407407407407 -31.82200849070415 17.14155867392589
+"" ""
+"objects/Hardware/Station_small.pnl" 457 486 T 52 0.7424242424242424 0 0.7407407407407407 -31.82200849070415 17.14155867392589
 1
 "$Station""CS401"
 3 31 "PANEL_REF32" -1
-"objects\\Hardware\\Station_small.pnl" 457 486 T 53 0.7424242424242424 0 0.7407407407407407 48.17799150929585 77.1415586739259
+"" ""
+"objects/Hardware/Station_small.pnl" 457 486 T 53 0.7424242424242424 0 0.7407407407407407 48.17799150929585 77.1415586739259
 1
 "$Station""CS032"
 3 34 "PANEL_REF35" -1
-"objects\\Hardware\\Station_small.pnl" 457 486 T 55 0.7424242424242424 0 0.7407407407407407 -151.8220084907042 387.1415586739259
+"" ""
+"objects/Hardware/Station_small.pnl" 457 486 T 55 0.7424242424242424 0 0.7407407407407407 -151.8220084907042 387.1415586739259
 1
 "$Station""CS302"
 3 35 "PANEL_REF36" -1
-"objects\\Hardware\\Station_small.pnl" 417 67 T 56 0.7241379310344828 0 0.7241379310344828 185.8090754622689 -31.08747626186907
+"" ""
+"objects/Hardware/Station_small.pnl" 417 67 T 56 0.7241379310344828 0 0.7241379310344828 185.8090754622689 -31.08747626186907
 1
 "$Station""CS501"
 3 38 "PANEL_REF39" -1
-"objects\\Hardware\\Station_small.pnl" 617 167 T 59 0.6879310344827586 0 0.7241379310344828 205.5465517241379 0.06896551724137368
+"" ""
+"objects/Hardware/Station_small.pnl" 617 167 T 59 0.6879310344827586 0 0.7241379310344828 322.5465517241379 12.06896551724137
 1
 "$Station""CS101"
 3 43 "PANEL_REF44" -1
-"objects\\Hardware\\Station_small.pnl" 577 317 T 64 0.7241379310344828 0 0.7241379310344828 259.9470064967516 97.8780409795103
+"" ""
+"objects/Hardware/Station_small.pnl" 577 317 T 64 0.7241379310344828 0 0.7241379310344828 259.9470064967516 97.8780409795103
 1
 "$Station""CS017"
 3 44 "PANEL_REF45" -1
-"objects\\Hardware\\Station_small.pnl" 657 307 T 65 0.7241379310344828 0 0.7241379310344828 302.015972013993 95.1194202898551
+"" ""
+"objects/Hardware/Station_small.pnl" 657 307 T 65 0.7241379310344828 0 0.7241379310344828 302.015972013993 95.1194202898551
 1
 "$Station""CS026"
 3 49 "PANEL_REF50" -1
-"objects\\Hardware\\Station_small.pnl" 447 447 T 70 0.7241379310344828 0 0.7241379310344828 194.0849375312344 133.7401099450276
+"" ""
+"objects/Hardware/Station_small.pnl" 447 447 T 70 0.7241379310344828 0 0.7241379310344828 194.0849375312344 133.7401099450276
 1
 "$Station""CS001"
 3 50 "PANEL_REF51" -1
-"objects\\Hardware\\Station_small.pnl" 527 527 T 71 0.7241379310344828 0 0.7241379310344828 256.1539030484758 175.8090754622688
+"" ""
+"objects/Hardware/Station_small.pnl" 527 527 T 71 0.7241379310344828 0 0.7241379310344828 256.1539030484758 175.8090754622688
 1
 "$Station""CS024"
 3 51 "PANEL_REF52" -1
-"objects\\Hardware\\Station_small.pnl" 487 357 T 71 0.7241379310344828 0 0.7241379310344828 235.119420289855 98.912523738131
+"" ""
+"objects/Hardware/Station_small.pnl" 487 357 T 71 0.7241379310344828 0 0.7241379310344828 235.119420289855 98.912523738131
 1
 "$Station""CS006"
 3 52 "PANEL_REF53" -1
-"objects\\Hardware\\Station_small.pnl" 387 257 T 72 0.7241379310344828 0 0.7241379310344828 227.5332133933033 81.3263168415792
+"" ""
+"objects/Hardware/Station_small.pnl" 387 257 T 72 0.7241379310344828 0 0.7241379310344828 227.5332133933033 81.3263168415792
 1
 "$Station""CS013"
 3 53 "PANEL_REF54" -1
-"objects\\Hardware\\Station_small.pnl" 517 47 T 73 0.7241379310344828 0 0.7241379310344828 273.3952823588206 3.395282358820587
+"" ""
+"objects/Hardware/Station_small.pnl" 517 47 T 73 0.7241379310344828 0 0.7241379310344828 273.3952823588206 3.395282358820587
 1
 "$Station""CS028"
 3 54 "PANEL_REF55" -1
-"objects\\Hardware\\Station_small.pnl" 277 257 T 74 0.7241379310344828 0 0.7241379310344828 167.1883858070964 91.3263168415792
+"" ""
+"objects/Hardware/Station_small.pnl" 277 257 T 74 0.7241379310344828 0 0.7241379310344828 167.1883858070964 91.3263168415792
 1
 "$Station""CS031"
 0
diff --git a/MAC/Navigator2/panels/Hardware/LOFAR_Europe.pnl b/MAC/Navigator2/panels/Hardware/LOFAR_Europe.pnl
index 30949378b93c988b3795f56f10f811ed66dd458c..98602edb2c24f62b011c45011aaff80bb6c66463 100644
--- a/MAC/Navigator2/panels/Hardware/LOFAR_Europe.pnl
+++ b/MAC/Navigator2/panels/Hardware/LOFAR_Europe.pnl
@@ -1,4 +1,4 @@
-V 11
+V 13
 1
 LANG:1 8 (NoName)
 PANEL,-1 -1 1201 823 N "_3DFace" 0
@@ -60,9 +60,11 @@ void reload() {
 ""0  1
 E "#uses \"navPanel.ctl\"
 " 0
- 2
+ 3
 "CBRef" "1"
 "EClose" E
+"dpi" "96"
+0 0 0
 ""
 DISPLAY_LAYER, 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
 LAYER, 0 
@@ -79,92 +81,39 @@ E E E
 1
 LANG:1 0 
 
-1
+2
 "dashclr"N "_Transparent"
+"antiAliased" "0"
 E E 0 1 1 0 1 E U  2  1 0  "pictures/LOFAR_Europe.jpg" 13434828 E 0 0 1199 822
 1 22 16 "" 2
 0
-1 23 16 "1" 1
-0
-1 24 16 "" 1
-0
 1 7 10 "" 2
 0
-1 8 10 "1" 1
-0
-1 9 10 "" 1
-0
 1 10 12 "" 2
 0
-1 11 12 "1" 1
-0
-1 12 12 "" 1
-0
 1 13 13 "" 2
 0
-1 14 13 "1" 1
-0
-1 15 13 "" 1
-0
 1 16 14 "" 2
 0
-1 17 14 "1" 1
-0
-1 18 14 "" 1
-0
 1 19 15 "" 2
 0
-1 20 15 "1" 1
-0
-1 21 15 "" 1
-0
 1 25 20 "" 2
 0
-1 26 20 "1" 1
-0
-1 27 20 "" 1
-0
 1 31 22 "" 2
 0
-1 32 22 "1" 1
-0
-1 33 22 "" 1
-0
 1 28 21 "" 2
 0
-1 29 21 "1" 1
-0
-1 30 21 "" 1
-0
 1 34 23 "" 2
 0
-1 35 23 "1" 1
-0
-1 36 23 "" 1
-0
 1 37 24 "" 2
 0
-1 38 24 "1" 1
-0
-1 39 24 "" 1
-0
 1 40 25 "" 2
 0
-1 41 25 "1" 1
-0
-1 42 25 "" 1
-0
 1 43 26 "" 2
 0
-1 44 26 "1" 1
-0
-1 45 26 "" 1
-0
 1 46 27 "" 2
 0
-1 47 27 "1" 1
-0
-1 48 27 "" 1
+1 50 28 "" 2
 0
 0
 LAYER, 1 
@@ -196,57 +145,76 @@ LAYER, 7
 LANG:1 6 Layer8
 0
 3 10 "PANEL_REF11" -1
-"objects\\Hardware\\Station_small.pnl" 457 486 T 29 0.7424242424242424 0 0.7407407407407407 408.1779915092959 157.1415586739259
+"" ""
+"objects/Hardware/Station_small.pnl" 457 486 T 29 0.7424242424242424 0 0.7407407407407407 408.1779915092959 157.1415586739259
 1
 "$Station""DE603"
 3 12 "PANEL_REF13" -1
-"objects\\Hardware\\Station_small.pnl" 457 486 T 33 0.7424242424242424 0 0.7407407407407407 398.1779915092959 307.1415586739259
+"" ""
+"objects/Hardware/Station_small.pnl" 457 486 T 33 0.7424242424242424 0 0.7407407407407407 398.1779915092959 307.1415586739259
 1
 "$Station""DE602"
 3 13 "PANEL_REF14" -1
-"objects\\Hardware\\Station_small.pnl" 457 486 T 34 0.7424242424242424 0 0.7407407407407407 438.1779915092959 67.14155867392589
+"" ""
+"objects/Hardware/Station_small.pnl" 457 486 T 34 0.7424242424242424 0 0.7407407407407407 438.1779915092959 67.14155867392589
 1
 "$Station""DE604"
 3 14 "PANEL_REF15" -1
-"objects\\Hardware\\Station_small.pnl" 457 486 T 35 0.7424242424242424 0 0.7407407407407407 398.1779915092959 -242.8584413260741
+"" ""
+"objects/Hardware/Station_small.pnl" 457 486 T 35 0.7424242424242424 0 0.7407407407407407 398.1779915092959 -242.8584413260741
 1
 "$Station""SE607"
 3 15 "PANEL_REF16" -1
-"objects\\Hardware\\Station_small.pnl" 457 486 T 36 0.7424242424242424 0 0.7407407407407407 78.17799150929585 367.1415586739259
+"" ""
+"objects/Hardware/Station_small.pnl" 457 486 T 36 0.7424242424242424 0 0.7407407407407407 78.17799150929585 367.1415586739259
 1
 "$Station""FR606"
 3 16 "PANEL_REF17" -1
-"objects\\Hardware\\Station_small.pnl" 457 486 T 37 0.7424242424242424 0 0.7407407407407407 248.1779915092959 187.1415586739259
+"" ""
+"objects/Hardware/Station_small.pnl" 457 486 T 37 0.7424242424242424 0 0.7407407407407407 248.1779915092959 187.1415586739259
 1
 "$Station""DE601"
 3 20 "PANEL_REF21" -1
-"objects\\Hardware\\Station_small.pnl" 457 486 T 41 0.7424242424242424 0 0.7407407407407407 -31.82200849070415 127.1415586739259
+"" ""
+"objects/Hardware/Station_small.pnl" 457 486 T 41 0.7424242424242424 0 0.7407407407407407 -31.82200849070415 127.1415586739259
 1
 "$Station""UK608"
 3 21 "PANEL_REF22" -1
-"objects\\Hardware\\Core_smalll.pnl" 366 255 T 42 0.6923076923076923 0 0.9818677161117382 324.6153846153847 141.5967162797437
+"" ""
+"objects/Hardware/Core_smalll.pnl" 366 255 T 42 0.6923076923076923 0 0.9818677161117382 324.6153846153847 141.5967162797437
 0
 3 22 "PANEL_REF23" -1
-"objects\\Hardware\\Remote_smalll.pnl" 346 224 T 43 0.7676208064019701 0 0.8026315789473684 300.6741088274606 194.9727582489898
+"" ""
+"objects/Hardware/Remote_smalll.pnl" 346 224 T 43 0.7676208064019701 0 0.8026315789473684 300.6741088274606 194.9727582489898
 0
 3 23 "PANEL_REF24" -1
-"objects\\Hardware\\Station_small.pnl" 457 486 T 44 0.7424242424242424 0 0.7407407407407407 228.1779915092959 167.1415586739259
+"" ""
+"objects/Hardware/Station_small.pnl" 457 486 T 44 0.7424242424242424 0 0.7407407407407407 228.1779915092959 167.1415586739259
 1
 "$Station""DE605"
 3 24 "PANEL_REF24" -1
-"objects\\Hardware\\Station_small.pnl" 457 486 T 44 0.7424242424242424 0 0.7407407407407407 343.7121212121213 -18
+"" ""
+"objects/Hardware/Station_small.pnl" 457 486 T 44 0.7424242424242424 0 0.7407407407407407 343.7121212121213 -18
 1
 "$Station""DE609"
 3 25 "PANEL_REF25" -1
-"objects\\Hardware\\Station_small.pnl" 457 486 T 44 0.7424242424242424 0 0.7407407407407407 668.1779915092959 167.1415586739259
+"" ""
+"objects/Hardware/Station_small.pnl" 457 486 T 44 0.7424242424242424 0 0.7407407407407407 668.1779915092959 167.1415586739259
 1
 "$Station""PL611"
 3 26 "PANEL_REF26" -1
-"objects\\Hardware\\Station_small.pnl" 457 486 T 45 0.7424242424242424 0 0.7407407407407407 538.1779915092959 57.14155867392589
+"" ""
+"objects/Hardware/Station_small.pnl" 457 486 T 45 0.7424242424242424 0 0.7407407407407407 538.1779915092959 57.14155867392589
 1
 "$Station""PL610"
 3 27 "PANEL_REF27" -1
-"objects\\Hardware\\Station_small.pnl" 457 486 T 46 0.7424242424242424 0 0.7407407407407407 658.1779915092959 -52.85844132607411
+"" ""
+"objects/Hardware/Station_small.pnl" 457 486 T 46 0.7424242424242424 0 0.7407407407407407 658.1779915092959 -52.85844132607411
 1
 "$Station""PL612"
+3 28 "PANEL_REF28" -1
+"" ""
+"objects/Hardware/Station_small.pnl" 127 314.4339419882356 T 47 0.75 0 0.75 37.47549239771755 85.1654557213153
+1
+"$Station""IE613"
 0
diff --git a/MAC/Navigator2/panels/Hardware/Station.pnl b/MAC/Navigator2/panels/Hardware/Station.pnl
index df293e855ec5857f9d861c11c3fd4f32b4c75340..6d6af281f5c8ea86250adbe7a6b6b48697fda555 100644
--- a/MAC/Navigator2/panels/Hardware/Station.pnl
+++ b/MAC/Navigator2/panels/Hardware/Station.pnl
@@ -1,4 +1,4 @@
-V 11
+V 13
 3
 LANG:1 12 antennaField
 LANG:6 8 (NoName)
@@ -407,9 +407,11 @@ void updateField() {
 }
 
 " 0
- 2
+ 3
 "CBRef" "1"
 "EClose" E
+"dpi" "96"
+0 0 0
 ""
 NC
 DISPLAY_LAYER, 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
@@ -429,8 +431,9 @@ LANG:1 0
 LANG:6 0 
 LANG:30 0 
 
-1
+2
 "dashclr"N "_Transparent"
+"antiAliased" "0"
 E E 0 1 1 0 1 E  100 1000 100 1
 4 2
 "Xaxis"
@@ -445,13 +448,14 @@ LANG:1 0
 LANG:6 0 
 LANG:30 0 
 
-1
+2
 "dashclr"N "_Transparent"
+"antiAliased" "0"
 E E 0 1 1 0 1 E  0 100 1499 100
 2 26
 "PRIMITIVE_TEXT1"
 ""
-1 1002 4 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E
+1 1002 23 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E
  E E
 11 0 0 0 0 0
 E E E
@@ -459,26 +463,22 @@ E E E
 1
 LANG:1 0 
 
-1
+3
+"sizePolicy" "Fixed Fixed"
 "dashclr"N "_Transparent"
-E E 0 1 1 2 1 E U  1 E 1002 4 1075 17
-0 2 2 "0s" 0 0 0 192 0 0  1002 4 1
+"antiAliased" "0"
+E E 0 1 1 2 1 E U  1 E 1002 23 1077 35
+0 2 2 "0s" 0 0 0 192 0 0  1002 23 1
 1
 LANG:1 33 MS Shell Dlg,-1,11,5,75,0,0,0,0,0
 0 1
 LANG:1 13 Select Array:
 1 167 5 "" 2190
 0
-1 168 5 "" 2188
-0
-1 169 5 "86" 1
-0
-1 170 5 "" 2192
-0
 19 53
 "arrayList"
 ""
-1 1095 0 E E E 1 E 1 E N "_3DText" E N "_3DFace" E E
+1 1095 19 E E E 1 E 1 E N "_3DText" E N "_3DFace" E E
  E E
 14 0 0 0 0 0
 E E E
@@ -489,7 +489,7 @@ LANG:1 0
 0
 1
 LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0
-0  1093 -2 1157 42
+0  1093 17 1157 61
 2
 T 
 1
@@ -538,7 +538,7 @@ E E
 13 80
 "zoomOut"
 ""
-1 1078 39 E E E 1 E 1 E N "_ButtonText" E N "_Button" E E
+1 1077 59 E E E 1 E 1 E N "_ButtonText" E N "_Button" E E
  E E
 15 0 0 0 0 0
 E E E
@@ -549,7 +549,7 @@ LANG:1 0
 0
 1
 LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0
-0  1076 37 1096 57
+0  1075 57 1095 77
 
 T 
 1
@@ -564,7 +564,7 @@ LANG:1 1 -
 13 107
 "zoomIn"
 ""
-1 1000 39 E E E 1 E 1 E N "_ButtonText" E N "_Button" E E
+1 999 59 E E E 1 E 1 E N "_ButtonText" E N "_Button" E E
  E E
 17 0 0 0 0 0
 E E E
@@ -575,7 +575,7 @@ LANG:1 0
 0
 1
 LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0
-0  1108 37 1128 57
+0  1107 57 1127 77
 
 T 
 1
@@ -590,7 +590,7 @@ LANG:1 1 +
 2 108
 "PRIMITIVE_TEXT2"
 ""
-1 1137 39 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E
+1 1136 59 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E
  E E
 18 0 0 0 0 0
 E E E
@@ -598,10 +598,12 @@ E E E
 1
 LANG:1 0 
 
-1
+3
+"sizePolicy" "Fixed Fixed"
 "dashclr"N "_Transparent"
-E E 0 1 1 2 1 E U  1 E 1137 39 1168 52
-0 2 2 "0s" 0 0 0 192 0 0  1137 39 1
+"antiAliased" "0"
+E E 0 1 1 2 1 E U  1 E 1136 59 1170 71
+0 2 2 "0s" 0 0 0 192 0 0  1136 59 1
 1
 LANG:1 33 MS Shell Dlg,-1,11,5,75,0,0,0,0,0
 0 1
@@ -609,7 +611,7 @@ LANG:1 4 Zoom
 13 136
 "shift_down"
 ""
-1 784 58 E E E 1 E 1 E N "_ButtonText" E N "_Button" E E
+1 783 78 E E E 1 E 1 E N "_ButtonText" E N "_Button" E E
  E E
 20 0 0 0 0 0
 E E E
@@ -620,7 +622,7 @@ LANG:1 0
 0
 1
 LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0
-0  1092 86 1112 106
+0  1091 106 1111 126
 
 P 
 4294967295
@@ -637,7 +639,7 @@ LANG:1 12 PUSH_BUTTON1
 13 137
 "shift_up"
 ""
-1 1094 56 E E E 1 E 1 E N "_ButtonText" E N "_Button" E E
+1 1093 76 E E E 1 E 1 E N "_ButtonText" E N "_Button" E E
  E E
 22 0 0 0 0 0
 E E E
@@ -648,7 +650,7 @@ LANG:1 0
 0
 1
 LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0
-0  1092 54 1112 74
+0  1091 74 1111 94
 
 P 
 4294967295
@@ -665,7 +667,7 @@ LANG:1 12 PUSH_BUTTON1
 13 138
 "shift_left"
 ""
-1 1078 72 E E E 1 E 1 E N "_ButtonText" E N "_Button" E E
+1 1077 92 E E E 1 E 1 E N "_ButtonText" E N "_Button" E E
  E E
 24 0 0 0 0 0
 E E E
@@ -676,7 +678,7 @@ LANG:1 0
 0
 1
 LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0
-0  1076 70 1096 90
+0  1075 90 1095 110
 
 P 
 4294967295
@@ -693,7 +695,7 @@ LANG:1 12 PUSH_BUTTON1
 13 139
 "shift_right"
 ""
-1 1110 72 E E E 1 E 1 E N "_ButtonText" E N "_Button" E E
+1 1109 92 E E E 1 E 1 E N "_ButtonText" E N "_Button" E E
  E E
 26 0 0 0 0 0
 E E E
@@ -704,7 +706,7 @@ LANG:1 0
 0
 1
 LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0
-0  1108 70 1128 90
+0  1107 90 1127 110
 
 P 
 4294967295
@@ -721,7 +723,7 @@ LANG:1 12 PUSH_BUTTON1
 13 140
 "PUSH_BUTTON5"
 ""
-1 1094 72 E E E 1 E 1 E N "_ButtonText" E N "_Button" E E
+1 1093 92 E E E 1 E 1 E N "_ButtonText" E N "_Button" E E
  E E
 28 0 0 0 0 0
 E E E
@@ -732,7 +734,7 @@ LANG:1 0
 0
 1
 LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0
-0  1092 70 1112 90
+0  1091 90 1111 110
 
 P 
 4294967295
@@ -750,7 +752,7 @@ LANG:1 12 PUSH_BUTTON1
 14 141
 "shift_value"
 ""
-1 1146 70 E E E 1 E 1 E N "_WindowText" E N "_Window" E E
+1 1145 90 E E E 1 E 1 E N "_WindowText" E N "_Window" E E
  E E
 29 0 0 0 0 0
 E E E
@@ -772,7 +774,7 @@ LANG:1 31 Give the shift value to be used
 }"
 1
 LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0
-0  1144 68 1197 89
+0  1143 88 1196 109
 3 "0d" 0 0 0 1 0 -1  E "main()
 {
   setValue(\"\",\"text\",shiftValue);
@@ -781,7 +783,7 @@ LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0
 13 143
 "originalSize"
 ""
-1 1094 39 E E E 1 E 1 E N "_ButtonText" E N "_Button" E E
+1 1093 59 E E E 1 E 1 E N "_ButtonText" E N "_Button" E E
  E E
 32 0 0 0 0 0
 E E E
@@ -792,7 +794,7 @@ LANG:1 26 set zoomsize to 100% again
 0
 1
 LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0
-0  1092 37 1112 57
+0  1091 57 1111 77
 
 P 
 4294967295
@@ -809,7 +811,7 @@ LANG:1 12 PUSH_BUTTON1
 2 144
 "PRIMITIVE_TEXT4"
 ""
-1 1137 57 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E
+1 1136 77 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E
  E E
 34 0 0 0 0 0
 E E E
@@ -817,10 +819,12 @@ E E E
 1
 LANG:1 0 
 
-1
+3
+"sizePolicy" "Fixed Fixed"
 "dashclr"N "_Transparent"
-E E 0 1 1 2 1 E U  1 E 1137 57 1199 70
-0 2 2 "0s" 0 0 0 192 0 0  1137 57 1
+"antiAliased" "0"
+E E 0 1 1 2 1 E U  1 E 1136 77 1200 89
+0 2 2 "0s" 0 0 0 192 0 0  1136 77 1
 1
 LANG:1 33 MS Shell Dlg,-1,11,5,75,0,0,0,0,0
 0 1
@@ -831,48 +835,6 @@ LAYER, 1
 LANG:1 6 Layer2
 1 145 2 "" 40
 0
-1 146 2 "" 41
-0
-1 147 2 "" 42
-0
-1 148 2 "" 43
-0
-1 149 2 "" 44
-0
-1 150 2 "" 45
-0
-1 151 2 "" 46
-0
-1 152 2 "" 47
-0
-1 153 2 "" 48
-0
-1 154 2 "" 49
-0
-1 155 2 "" 50
-0
-1 156 2 "" 51
-0
-1 157 2 "" 52
-0
-1 158 2 "" 53
-0
-1 159 2 "" 54
-0
-1 160 2 "" 55
-0
-1 161 2 "" 56
-0
-1 162 2 "" 57
-0
-1 163 2 "" 58
-0
-1 164 2 "" 59
-0
-1 165 2 "" 60
-0
-1 166 2 "" 61
-0
 0
 LAYER, 2 
 1
@@ -899,9 +861,11 @@ LAYER, 7
 LANG:1 6 Layer8
 0
 3 2 "PANEL_REF3" -1
-"objects\\compass.pnl" 212 350 T 12 0.742857142857143 0 0.752688172043011 -29.7142857142857 -52.6881720430108
+"" ""
+"objects/compass.pnl" 212 350 T 12 0.742857142857143 0 0.752688172043011 -29.7142857142857 -52.6881720430108
 0
 3 5 "PANEL_REF6" -1
-"objects\\Hardware\\Station_Cabinet_top.pnl" 298 258 T 13 1 0 1 40 -100
+"" ""
+"objects/Hardware/Station_Cabinet_top.pnl" 298 258 T 13 1 0 1 40 -100
 0
 0
diff --git a/MAC/Navigator2/panels/Hardware/Station_List.pnl b/MAC/Navigator2/panels/Hardware/Station_List.pnl
new file mode 100644
index 0000000000000000000000000000000000000000..d91fd47116d8bf7b2339be745f507d7ae493d75e
--- /dev/null
+++ b/MAC/Navigator2/panels/Hardware/Station_List.pnl
@@ -0,0 +1,391 @@
+V 13
+3
+LANG:1 12 antennaField
+LANG:6 8 (NoName)
+LANG:30 8 (NoName)
+PANEL,-1 -1 1200 823 N "_3DFace" 0
+"main()
+{     
+  // Initialise the Panel
+  navPanel_initPanel(\"fw_viewBox\");
+  
+  
+  baseDP=g_currentDatapoint;
+  sysName = dpSubStr(g_currentDatapoint,DPSUB_SYS);
+
+  
+  if (navFunct_getRingFromStation(sysName) == \"Core\") {
+    isCore=true;
+    isRemote=false;
+    isEurope=false;
+  } else if(navFunct_getRingFromStation(sysName) == \"Remote\") {
+    isCore=false;
+    isRemote=true;
+    isEurope=false;
+  } else {
+    isCore=false;
+    isRemote=false;
+    isEurope=true;
+  }
+  strPanelName    = \"antennaListField\";
+  strModuleName   = myModuleName();   
+  
+  // get PanelSize to determine scaling and offsets
+  if ( panelSize( \"\" , mainpanel_horSize , mainpanel_vertSize) != 0 ) {
+    LOG_FATAL(\"Station_list.pnl:initialize|Error: couldn't define the size of the mainPanel : \" + strPanelName);
+  } else {
+    calcViewboxSize();
+  
+
+    
+    // get all dps from the type AntennaPattern
+    // each DP represents a different type of Antennas
+    // we need the lot to give a pulldown window where the kind of 
+    // representation can be chosen.
+    //
+    // The first found will be drawn and will be the default choice.    
+
+    bool fill=true;
+    for (int i=0; i<=1;i++) {
+      if (dpConnect(\"updatePositions\",fill,sysName+\"LOFAR_PIC_StationInfo.N_RSPBoards\",        
+                                           sysName+\"LOFAR_PIC_StationInfo.N_TBBoards\",
+                                           sysName+\"LOFAR_PIC_StationInfo.N_LBAS\",
+                                           sysName+\"LOFAR_PIC_StationInfo.N_HBAS\",
+                                           sysName+\"LOFAR_PIC_StationInfo.HBA_Split\",         
+                                           sysName+\"LOFAR_PIC_StationInfo.wide_LBAS\",
+                                           sysName+\"LOFAR_PIC_StationInfo.N_HBAS:_online.._invalid\") == -1) {
+        LOG_DEBUG(\"Station_list.pnl:main| couldn't connect to \"+sysName+\"LOFAR_PIC_StationInfo.N_HBAS \"+ getLastError());
+      }  
+
+      if (fill) {
+        fill=false;
+      }
+    }
+  }
+}
+
+//
+// Callback for dpConnect to action point.
+// If there is an action required this point will tell so
+//
+void doAction(string aDP, string anAction) {
+  LOG_DEBUG(\"Station_list.pnl:doAction| Action required. found: \" + anAction);
+  // split action into essentials
+  dyn_string actionString;
+  if (!navFunct_splitAction(anAction,actionString)) {
+    return;
+  }
+  
+  LOG_DEBUG(\"Station_list.pnl:doAction|found actionString: \" + actionString);
+  
+  // Reload
+  if (actionString[1] == \"Reload\") {
+    redraw();
+    return;
+  } else if (actionString[1] == \"DistChanged\") {
+    // for dist system bound hardware only, if the distsystem went offline we need to replace 
+    // the screen with a broken connection screen.
+    if (!g_initializing) {
+    
+      // check if this syst is in the connectionlist and down
+      int iPos=dynContains(g_connections[\"NAME\"],sysName);
+      if (iPos > 0) {
+        if (!g_connections[\"UP\"][iPos]) {
+          navPanel_setEvent(\"invalid DP\",\"ChangePanel\");
+        }
+      }
+    }
+    return;
+  }
+}
+
+void updatePositions(string dp1, int nrsp,
+                     string dp2, int ntbb,
+                     string dp3, int nlbas,
+                     string dp4, int nhbas,
+                     string dp5, bool hbasplit,
+                     string dp6, bool widelbas,
+                     string dp7, bool invalid) {
+  
+  NRSP=nrsp;         
+  NTBB=ntbb;         
+  NLBA=nlbas;         
+  NHBA=nhbas;         
+  HBASplit=hbasplit;         
+  WideLBAs=widelbas;
+
+  redraw();
+}
+" 0
+ E E E E 1 0 0 0  20 20
+""0  1
+E "#uses \"navPanel.ctl\"
+
+string baseDP=\"\";
+string sysName = \"\";
+bool isCore=false;
+bool isRemote=false;
+bool isEurope=false;
+int mainpanel_midX;
+int mainpanel_midY;
+dyn_string refNames;
+dyn_string arrays;
+int mainpanel_horSize; 
+int mainpanel_vertSize;
+int symbolSize=44;
+float zoomFactor=1;
+
+int NRSP=-1;
+int NTBB=-1;
+int NLBA=-1;
+int NHBA=-1;
+bool HBASplit=false;
+bool WideLBAs=false;
+
+float HBA0Angle=0;
+float HBA1Angle=0;
+
+string strPanelName;
+string strModuleName;
+
+void clearRefNames() {
+  // remove all symbols because new ones will be added
+  for (int i=1; i <= dynlen(refNames); i++) {
+    removeSymbol(strModuleName,\"\",refNames[i]);
+  }
+  dynClear(refNames);
+}
+
+void calcViewboxSize() {
+    mainpanel_midX = floor( (mainpanel_horSize/2)-(symbolSize/2) );
+    mainpanel_midY = floor( (mainpanel_vertSize/2)-(symbolSize/2) );
+}
+
+void redraw() {
+  
+  
+  float maxXOffsetValue=1.;
+  float maxYOffsetValue=1.;
+  float expandFactorX;
+  float expandFactorY;
+  int   yStartPos = 100;
+  int   xPos_AddLBASymbol=40;
+  int   yPos_AddLBASymbol=yStartPos;
+  int   xPos_AddHBASymbol=590;
+  int   yPos_AddHBASymbol=yStartPos;
+  int   xOffSet = 50;
+  int   yOffSet = 50;
+  string addHBAPanelName = \"objects/Hardware/Station_HBA.pnl\";;
+  string addLBAPanelName = \"objects/Hardware/Station_LBA.pnl\";;
+  float angle=0;
+
+  
+  navFunct_clearGlobalLists();
+  
+  if (!undocked) g_stationList[1] = navFunct_bareDBName(sysName);
+  
+  LOG_DEBUG(\"Station_list.pnl:redraw\");
+
+  if (dynlen(refNames) > 0) {
+    clearRefNames();
+  }
+  
+  int largestAntNr = NLBA;
+  if (NHBA > NLBA) largestAntNr = NHBA;
+  
+  //  now start adding symbols to panel
+  int ref =   1;
+  for (int i = 0; i < largestAntNr; i++ ) {
+    int XRCU;
+    int YRCU;
+    if (i < NRSP*8/2) {
+      XRCU = 2 * (i);
+      YRCU = XRCU+1;
+    } else {
+      XRCU = 2*i+1 - NRSP*8;
+      YRCU = 2*i - NRSP*8;
+    }
+
+    if (fmod(i, 12) == 0 ) {
+      xPos_AddLBASymbol += xOffSet;
+      xPos_AddHBASymbol += xOffSet;
+      yPos_AddLBASymbol=yStartPos;
+      yPos_AddHBASymbol=yStartPos;
+    }
+    
+    string xDP=baseDP+\"_PIC_Cabinet\"+navFunct_receiver2Cabinet(XRCU)+\"_Subrack\"+
+               navFunct_receiver2Subrack(XRCU)+\"_RSPBoard\"+navFunct_receiver2RSP(XRCU)+\"_RCU\"+XRCU;
+    string yDP=baseDP+\"_PIC_Cabinet\"+navFunct_receiver2Cabinet(YRCU)+\"_Subrack\"+
+               navFunct_receiver2Subrack(YRCU)+\"_RSPBoard\"+navFunct_receiver2RSP(YRCU)+\"_RCU\"+YRCU;
+    if (i < NLBA && !undocked){
+      dynAppend(g_LBAList,i);
+      refNames[ref]=\"antLBA\"+(ref);
+      
+      if (  addSymbol(  strModuleName,                   // Stay in this modul
+                                    \"\",                  // Name of this panel
+  		      addLBAPanelName,                    // Panel to add
+  		      refNames[ref],                     // Ref of the addedPanel
+  		      makeDynString( \"$aNr:\" + (i) ,     // Define all $values
+  		                     \"$aX:-1\" ,
+  		                     \"$aY:-1\" ,
+  		                     \"$aZ:-1\" ,
+                          \"$sysName:\" + sysName) ,                  // of particular addedpanel
+  		      xPos_AddLBASymbol,                  // Xpos of the AddedSymbol
+  		      yPos_AddLBASymbol,                  // Ypos of the AddedSymbol
+  		      angle,                           // angle
+  		      1   ,1                          // zoomX , zoomY
+          ) < 0 ) {
+  	  LOG_ERROR(\"Station_list.pnl:redraw|Error Appending LBAantenna : \" + i + \" in this panel.\");
+            }
+      ref++;
+    }
+    
+    if (i < NHBA && !undocked) {
+      dynAppend(g_HBAList,i);
+      refNames[ref]=\"antHBA\"+(ref);
+      
+      if (  addSymbol(  strModuleName,                   // Stay in this modul
+                                    \"\",                  // Name of this panel
+  		      addHBAPanelName,                    // Panel to add
+  		      refNames[ref],                     // Ref of the addedPanel
+  		      makeDynString( \"$aNr:\" + (i) ,     // Define all $values
+  		                     \"$aX:-1\",    
+  		                     \"$aY:-1\",
+  		                     \"$aZ:-1\",
+                          \"$sysName:\" + sysName) ,                  // of particular addedpanel
+  		      xPos_AddHBASymbol,                  // Xpos of the AddedSymbol
+  		      yPos_AddHBASymbol,                  // Ypos of the AddedSymbol
+  		      angle,                           // angle
+  		      1 ,1                          // zoomX , zoomY
+          ) < 0 ) {
+  	  LOG_ERROR(\"Station_list.pnl:redraw|Error Appending HBAantenna : \" + i + \" in this panel.\");
+            }
+      ref++;
+    }
+    
+    yPos_AddLBASymbol += yOffSet;
+    yPos_AddHBASymbol += yOffSet;
+}
+ 
+  // trigger that the panel values are calculated and ready
+  dynClear(highlight);
+  dynClear(strHighlight);
+  
+  // set panel to ready
+  g_objectReady=true;
+  
+  navPanel_setEvent(\"Station_list.pnl\",\"Update\");
+}
+
+void updateField() {
+  
+  // Check if the update concerns the current view
+
+  sysName = dpSubStr(g_currentDatapoint,DPSUB_SYS);
+ 
+
+  string field=sysName+\"LOFAR_PIC_StationInfo.\";
+  if (dpExists(field+\".N_LBAS:_online.._value\")) {
+    dpGet(field+\"N_RSPBoards\",NRSP);         
+    dpGet(field+\"N_TBBoards\",NTBB);         
+    dpGet(field+\"N_LBAS\",NLBA);         
+    dpGet(field+\"N_HBAS\",NHBA);         
+    dpGet(field+\"HBA_Split\",HBASplit);         
+    dpGet(field+\"wide_LBAS\",WideLBAs);
+ 
+    redraw();
+  } else {
+    LOG_ERROR(\"Station_list.pnl:updateField|Error, couldn't find:\"+field+\".N_LBAS:_online.._value\");
+  }
+}
+
+" 0
+ 3
+"CBRef" "1"
+"EClose" E
+"dpi" "96"
+0 0 0
+""
+NC
+DISPLAY_LAYER, 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
+LAYER, 0 
+1
+LANG:1 6 Layer1
+1 1 5 "" 2190
+0
+2 5
+"PRIMITIVE_TEXT1"
+""
+1 200 70 E E E 1 E 1 E N "_WindowText" E N "_Window" E E
+ E E
+14 0 0 0 0 0
+E E E
+0
+1
+LANG:1 0 
+
+3
+"sizePolicy" "Fixed Fixed"
+"dashclr"N "_Transparent"
+"antiAliased" "0"
+E E 0 1 3 2 1 E 2.666666666666665 0 2.625000000000001 -287.2727272727269 -152.4999999999999 0 E 200 70 223 82
+0 2 2 "0s" 0 0 0 192 0 0  200 70 1
+1
+LANG:1 35 MS Shell Dlg 2,-1,11,5,75,0,0,0,0,0
+0 1
+LANG:1 3 LBA
+2 6
+"PRIMITIVE_TEXT2"
+""
+1 200 70 E E E 1 E 1 E N "_WindowText" E N "_Window" E E
+ E E
+15 0 0 0 0 0
+E E E
+0
+1
+LANG:1 0 
+
+3
+"sizePolicy" "Fixed Fixed"
+"dashclr"N "_Transparent"
+"antiAliased" "0"
+E E 0 1 3 2 1 E 2.666666666666665 0 2.625000000000001 233.0303030303033 -152.4999999999999 0 E 200 70 225 82
+0 2 2 "0s" 0 0 0 192 0 0  200 70 1
+1
+LANG:1 35 MS Shell Dlg 2,-1,11,5,75,0,0,0,0,0
+0 1
+LANG:1 3 HBA
+0
+LAYER, 1 
+1
+LANG:1 6 Layer2
+0
+LAYER, 2 
+1
+LANG:1 6 Layer3
+0
+LAYER, 3 
+1
+LANG:1 6 Layer4
+0
+LAYER, 4 
+1
+LANG:1 6 Layer5
+0
+LAYER, 5 
+1
+LANG:1 6 Layer6
+0
+LAYER, 6 
+1
+LANG:1 6 Layer7
+0
+LAYER, 7 
+1
+LANG:1 6 Layer8
+0
+3 5 "PANEL_REF6" -1
+"" ""
+"objects/Hardware/Station_Cabinet_top.pnl" 298 258 T 13 1 0 1 -118 -138
+0
+0
diff --git a/MAC/Navigator2/panels/Helper/set_powerunit_snmp.pnl b/MAC/Navigator2/panels/Helper/set_powerunit_snmp.pnl
index eccdc232609d40939a0a28b8072a07f9f7bf6efe..00c5a4e0e7f93d30dfaa0c2fc2105527b77edb6f 100644
--- a/MAC/Navigator2/panels/Helper/set_powerunit_snmp.pnl
+++ b/MAC/Navigator2/panels/Helper/set_powerunit_snmp.pnl
@@ -1,7 +1,7 @@
 V 13
 1
 LANG:1 0 
-PANEL,-1 -1 872 400 N "_3DFace" 0
+PANEL,-1 -1 872 391 N "_3DFace" 0
 "main()
 {
   navFunct_fillStationLists();
@@ -87,7 +87,7 @@ void setPCSAddresses()
 
 void setACXAddresses()
 {
-  dpSet(db+\"LOFAR_PIC_POWEC0.powerSystemType:_address.._reference\", \"1_1.3.6.1.4.1.5961.4.1.2.0\");
+  dpSet(db+\"LOFAR_PIC_POWEC0.powerSystemType:_address.._reference\", \"1_1.3.6.1.4.1.5961.5.1.2.0\");
   dpSet(db+\"LOFAR_PIC_POWEC0.nrOfModules:_address.._reference\", \"1_1.3.6.1.4.1.5961.5.6.1.0\");
   dpSet(db+\"LOFAR_PIC_POWEC0.voltage:_address.._reference\", \"1_1.3.6.1.4.1.5961.5.6.2.1.7B\");
   dpSet(db+\"LOFAR_PIC_POWEC0.current:_address.._reference\", \"1_1.3.6.1.4.1.5961.5.6.2.1.8B\");
@@ -99,7 +99,7 @@ void setACXAddresses()
   dpSet(db+\"LOFAR_PIC_POWEC0.alarmText:_address.._reference\", \"\");
   dpSet(db+\"LOFAR_PIC_POWEC0.alarmType:_address.._reference\", \"1_1.3.6.1.4.1.5961.5.8.2.1.3B\");
   dpSet(db+\"LOFAR_PIC_POWEC0.alarmTime:_address.._reference\", \"1_1.3.6.1.4.1.5961.5.8.2.1.2B\");  
-  dpSet(db+\"LOFAR_PIC_POWEC1.powerSystemType:_address.._reference\", \"1_1.3.6.1.4.1.5961.4.1.2.0\");
+  dpSet(db+\"LOFAR_PIC_POWEC1.powerSystemType:_address.._reference\", \"1_1.3.6.1.4.1.5961.5.1.2.0\");
   dpSet(db+\"LOFAR_PIC_POWEC1.nrOfModules:_address.._reference\", \"2_1.3.6.1.4.1.5961.5.6.1.0\");
   dpSet(db+\"LOFAR_PIC_POWEC1.voltage:_address.._reference\", \"2_1.3.6.1.4.1.5961.5.6.2.1.7B\");
   dpSet(db+\"LOFAR_PIC_POWEC1.current:_address.._reference\", \"2_1.3.6.1.4.1.5961.5.6.2.1.8B\");
diff --git a/MAC/Navigator2/panels/Popups/Popup_SetState.pnl b/MAC/Navigator2/panels/Popups/Popup_SetState.pnl
new file mode 100644
index 0000000000000000000000000000000000000000..15b1d2fa64ca20be5314787d70dae65c912a1f82
--- /dev/null
+++ b/MAC/Navigator2/panels/Popups/Popup_SetState.pnl
@@ -0,0 +1,524 @@
+V 13
+1
+LANG:1 0 
+PANEL,-1 -1 555 360 N "_3DFace" 1
+"$baseDP"
+"main()
+{
+  Init();
+}" 0
+ E "main(int x, int y)
+{
+  Check();
+}" 0
+ E E 1 -1 -1 0  25 43
+""0  1
+E "string _baseDP;
+bool isHBA = false;
+bool isLBA = false;
+mapping _mStateNr;
+string messageCode = \"\";
+
+dyn_string HBAmodes = makeDynString(\"Free choice\",
+                                    \"OSCILLATION (OSC)\",
+                                    \"FLAT (FLAT)\",
+                                    \"HIGH NOISE (HN)\",
+                                    \"SHORT  (SHORT)\",
+                                    \"SPURIOUS (SPUR)\",
+                                    \"LOW NOISE (LN)\",
+                                    \"SUMMATOR NOISE (SN)\",
+                                    \"C-SUMMATOR (CSUM)\",
+                                    \"JITTER > 3dB (JIT)\",
+                                    \"RF element FAIL (E_FAIL)\",
+                                    \"MODEM element FAIL (MODEM)\");
+
+dyn_string LBAmodes = makeDynString(\"Free choice\",
+                                    \"OSCILLATION (OSC)\",
+                                    \"FLAT (FLAT)\",
+                                    \"HIGH NOISE (HN)\",
+                                    \"SHORT  (SHORT)\",
+                                    \"SPURIOUS (SPUR)\",
+                                    \"LOW NOISE (LN)\",
+                                    \"DOWN (DOWN)\");
+
+
+void Init()
+{
+  _baseDP = $baseDP;
+  
+  // for HBA and LBA elements we have a fixed pile of errors, so we need to determine if we are dealing with
+  // HBAAntenna or LBAAntenna types. If we are, then we can enable a combobox with the available choices and
+ //  put these in the comment accordingly.
+  
+  if (dpTypeName(_baseDP) == \"HBAAntenna\") 
+  {
+    isHBA = true;
+    isLBA = false;
+    fill_cb_comment();
+  } 
+  else if (dpTypeName(_baseDP) == \"LBAAntenna\") 
+  {
+    isLBA = true;
+    isHBA = false;
+    fill_cb_comment();
+  }
+  else
+  {
+    isLBA = false;
+    isHBA = false;
+    txt_ant.visible(false);
+    cb_comment.visible(false);
+    cb_comment.enabled(false);
+  }
+  
+  setWindowTitle( myModuleName(), myPanelName(), \"Set state: \" + _baseDP );
+   
+  cb_state.appendItem( \"Select state...\" );
+  
+  // Fill dropdown with states
+  for (int i = 1; i <= mappinglen(stateName); i++)
+  {
+    string stateText = mappingGetValue(stateName,i);
+    int    stateNr   = mappingGetKey(stateName,i);
+    
+    if( patternMatch( \"*came*\", stateText ) ||
+        patternMatch( \"*went*\", stateText ) )
+    {
+      continue;
+    }
+    
+    cb_state.appendItem( stateText );
+    
+    // Store data in mapping with statetext as key to be able to get the statenr after selection
+    _mStateNr[stateText] = stateNr;
+  }
+ 
+}
+
+void fill_cb_comment() 
+{
+  cb_comment.enabled(true);
+  cb_comment.visible(true);
+  txt_ant.visible(true);
+  cb_comment.deleteAllItems();
+  if (isLBA)
+  {
+    for (int i = 1; i <= dynlen(LBAmodes); i++) 
+    {
+      cb_comment.appendItem(LBAmodes[i]);
+    }
+  }
+  else if (isHBA)
+  {
+    for (int i = 1; i <= dynlen(HBAmodes); i++) 
+    {
+      cb_comment.appendItem(HBAmodes[i]);
+    }
+  }
+}
+
+string strip_comment(string txt) {
+  string code = substr(txt,strpos(txt,\"(\")+1,(strpos(txt,\")\")) - (strpos(txt,\"(\")+1));
+  return code;  
+}
+  
+
+void Check_comment()
+{
+  if (cb_comment.selectedPos > 1)
+  {
+    message.enabled(false);
+    string txt = cb_comment.selectedText;
+    message.text(txt);
+    messageCode = strip_comment(txt);
+  }
+  else
+  {
+    message.text(\"\");
+    message.enabled(true);
+    messageCode = \"\";
+  }
+  
+  
+}
+
+void Check()
+{
+  // when a force of LBA/HBA broken to only the messages in the list is needed we can check for this here also
+  
+  // for now ok button is on when there is chosen a state and a message has been filled.
+  ok.enabled = ( cb_state.selectedPos > 1 ) && ( message.text != \"\" );
+}
+
+
+void Set()
+{
+  int stateNr;
+  string strAlertComment;
+  
+  // Run Check and evaluate if OK button is still enabled
+  Check();
+  
+  if( ok.enabled == false )
+    return;
+  
+  bool recursive = check_recursive.state(0);
+  
+  if( mappingHasKey( _mStateNr, cb_state.selectedText ) )
+  {
+    stateNr = _mStateNr[ cb_state.selectedText ];
+  }
+  else
+  {
+    return;
+  }
+  
+  LOG_DEBUG(\"navPanel.ctl:navPanel_statePopup|recursive=\"+recursive);
+  
+  string database = dpSubStr(_baseDP,DPSUB_SYS);
+  string DPName   = _baseDP + \".status.state\";
+  if (messageCode != \"\") 
+  {
+    strAlertComment = getUserName() + \"|\" + (string)getCurrentTime() + \"|\" + messageCode;
+  }
+  else
+  {
+    strAlertComment = getUserName() + \"|\" + (string)getCurrentTime() + \"|\" + message.text;
+  }
+  
+  if (!recursive)
+  {
+    LOG_DEBUG(\"navPanel.ctl:navPanel_statePopup|Operator sets \"+_baseDP+\".status.state to \"+getStateName(stateNr)+ \" (SINGLE) on database: \"+database);
+    dpSet(database+\"__navObjectState.DPName\",DPName,
+          database+\"__navObjectState.stateNr\",stateNr,
+          database+\"__navObjectState.message\",strAlertComment,
+          database+\"__navObjectState.force\",true);
+
+  } 
+  else
+  {
+    // we will write the info to the __resetObjectState point.
+    // All existing stations, CCU's and MCU's will be connected to this point
+    // via a ctl script that runs on each machine.
+    // that script will do an update (if needed) for their own Database.
+    LOG_DEBUG(\"navPanel.ctl:navPanel_statePopup|Operator sets \"+_baseDP+\".status.state to \"+getStateName(stateNr)+\" (RECURSIVE) on database: \"+database);
+    dpSet(database+\"__resetObjectState.DPName\",_baseDP,
+          database+\"__resetObjectState.stateNr\",stateNr,
+          database+\"__resetObjectState.message\",strAlertComment);
+  }
+  
+  /*
+  
+delay(0,100);  
+  string Query = \"SELECT ALERT '_alert_hdl.._prior' FROM '\" + dpSubStr( DPName, DPSUB_DP_EL ) + \"' REMOTE '\" + dpSubStr( DPName, DPSUB_SYS ) + \"'\";
+  dyn_dyn_anytype ddaAlerts;
+  dpQuery( Query, ddaAlerts );
+  if( dynlen(ddaAlerts) >= 2 )
+  {
+    // Sort on alerttime, descending
+    dynRemove( ddaAlerts, 1 );
+    dynDynSort( ddaAlerts, 2, false );
+    atime AlertTime = ddaAlerts[1][2];
+
+    // Get current comment of alert
+    string comment;
+    alertGet( (time)AlertTime, getACount(AlertTime), dpSubStr(getAIdentifier(AlertTime), DPSUB_SYS_DP_EL_CONF_DET) + \"._comment\", comment);
+    
+    // Add comment
+//    comment += getUserName() + \"|\" + (string)getCurrentTime() + \"|\" + message.text + \"\\uA7\";
+    comment += \"marcel\" + \"|\" + (string)getCurrentTime() + \"|\" + message.text + \"\\uA7\";
+
+    int ret = alertSet( (time)AlertTime, getACount(AlertTime), dpSubStr(getAIdentifier(AlertTime), DPSUB_SYS_DP_EL_CONF_DET) + \"._comment\", comment);
+
+    DebugN( ddaAlerts[1] );
+    
+  }
+//    return;
+  */
+  
+  delay(0,500);
+  PanelOff(); 
+}
+
+" 0
+ 3
+"CBRef" "1"
+"EClose" E
+"dpi" "96"
+0 0 0
+""
+NC
+DISPLAY_LAYER, 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
+LAYER, 0 
+1
+LANG:1 0 
+22 0
+"cb_state"
+""
+1 20 35 E E E 1 E 1 E N "_WindowText" E N "_Window" E E
+ E E
+0 0 0 0 0 0
+E E E
+0
+1
+LANG:1 0 
+
+0
+1
+LANG:1 26 Arial,-1,13,5,50,0,0,0,0,0
+0  18 35 242 64
+0
+
+E
+"main()
+{
+  Check();
+}" 0
+
+E
+ 0 0
+2 2
+"PRIMITIVE_TEXT2"
+""
+1 20 15 E E E 1 E 1 E N "_WindowText" E N "_Window" E E
+ E E
+2 0 0 0 0 0
+E E E
+0
+1
+LANG:1 0 
+
+3
+"sizePolicy" "Fixed Fixed"
+"dashclr"N "_Transparent"
+"antiAliased" "0"
+E E 0 2 3 2 1 E U  0 E 20 15 133 30
+0 2 2 "0s" 0 0 0 192 0 0  20 15 1
+1
+LANG:1 26 Arial,-1,13,5,50,0,0,0,0,0
+0 1
+LANG:1 20 Select state to set:
+20 3
+"check_recursive"
+""
+1 20 70 E E E 1 E 1 E N "_3DText" E N "_Transparent" E E
+ E E
+3 0 0 0 0 0
+E E E
+0
+1
+LANG:1 0 
+
+0
+1
+LANG:1 26 Arial,-1,13,5,50,0,0,0,0,0
+0  18 68 237 92
+1
+T 
+1
+LANG:1 29 Set recursive (to all childs)
+
+0 
+1
+LANG:1 0 
+E E
+0 0 0 0 0
+0
+E"main(int button, int state)
+{
+  Check();
+}" 0
+13 4
+"nok"
+""
+1 405 300.5 E E E 1 E 1 E N "_ButtonText" E N "_Button" E E
+ E E
+5 0 0 0 27 0
+E E E
+0
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0
+4
+LANG:1 26 arial,-1,13,5,50,0,0,0,0,0
+LANG:10000 26 arial,-1,13,5,50,0,0,0,0,0
+LANG:10001 26 arial,-1,13,5,50,0,0,0,0,0
+LANG:10027 26 arial,-1,13,5,50,0,0,0,0,0
+0  405 301 503 329
+
+T 
+4
+LANG:1 6 Cancel
+LANG:10000 9 Abbrechen
+LANG:10001 6 Cancel
+LANG:10027 16 Отменить
+"main()
+{
+  PanelOff();
+}
+" 0
+ E E E
+13 5
+"ok"
+""
+1 295 300.5 E E E 0 E 1 E N "_ButtonText" E N "_Button" E E
+ E E
+6 0 0 0 16777221 0
+E E E
+0
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0
+4
+LANG:1 26 arial,-1,13,5,50,0,0,0,0,0
+LANG:10000 26 arial,-1,13,5,50,0,0,0,0,0
+LANG:10001 26 arial,-1,13,5,50,0,0,0,0,0
+LANG:10027 26 arial,-1,13,5,50,0,0,0,0,0
+0  295 301 394 329
+
+T 
+4
+LANG:1 2 OK
+LANG:10000 2 OK
+LANG:10001 2 OK
+LANG:10027 2 OK
+"main()
+{
+  Set();
+}
+" 0
+ E E E
+1 19 0 "" 0
+0
+2 9
+"PRIMITIVE_TEXT3"
+""
+1 21.99999999999994 113 E E E 1 E 1 E N "_WindowText" E N "_Window" E E
+ E E
+8 0 0 0 0 0
+E E E
+0
+1
+LANG:1 0 
+
+3
+"sizePolicy" "Fixed Fixed"
+"dashclr"N "_Transparent"
+"antiAliased" "0"
+E E 0 2 3 2 1 E U  0 E 21.99999999999994 113 173 128
+0 2 2 "0s" 0 0 0 192 0 0  21.99999999999994 113 1
+1
+LANG:1 26 Arial,-1,13,5,50,0,0,0,0,0
+0 1
+LANG:1 22 Enter comment/message:
+29 12
+"message"
+""
+1 19.99999999999989 156 E E E 1 E 1 E N "_WindowText" E N "_Window" E E
+ E E
+11 0 0 0 0 0
+E E "main(bool enter)
+{
+  if( !enter )
+    Check();
+}" 0
+
+0
+1
+LANG:1 0 
+
+1
+"layoutAlignment" "AlignTop"
+1
+LANG:1 26 Arial,-1,13,5,50,0,0,0,0,0
+0  20 156 495 271
+15 PVSS.TextEdit.1
+0
+E22 15
+"cb_comment"
+""
+1 281 35 E E E 1 E 1 E N "_WindowText" E N "_Window" E E
+ E E
+12 0 0 0 0 0
+E E E
+0
+1
+LANG:1 0 
+
+0
+1
+LANG:1 26 Arial,-1,13,5,50,0,0,0,0,0
+0  279 35 503 64
+0
+
+E
+"main()
+{
+  Check_comment();
+}" 0
+
+E
+ 0 0
+2 18
+"txt_ant"
+""
+1 283 18 E E E 1 E 1 E N "_WindowText" E N "_Window" E E
+ E E
+13 0 0 0 0 0
+E E E
+0
+1
+LANG:1 0 
+
+3
+"sizePolicy" "Fixed Fixed"
+"dashclr"N "_Transparent"
+"antiAliased" "0"
+E E 0 2 3 2 1 E U  0 E 283 18 481 33
+0 2 2 "0s" 0 0 0 192 0 0  283 18 1
+1
+LANG:1 26 Arial,-1,13,5,50,0,0,0,0,0
+0 1
+LANG:1 30 Select LBA/HBA comment to set:
+0
+LAYER, 1 
+1
+LANG:1 0 
+0
+LAYER, 2 
+1
+LANG:1 0 
+0
+LAYER, 3 
+1
+LANG:1 0 
+0
+LAYER, 4 
+1
+LANG:1 0 
+0
+LAYER, 5 
+1
+LANG:1 0 
+0
+LAYER, 6 
+1
+LANG:1 0 
+0
+LAYER, 7 
+1
+LANG:1 0 
+0
+3 0 "PANEL_REF0" -1
+"" ""
+"objects_parts/STD_OBJECTS/ButtonBarBackground.pnl" 10 60 T 4 1.038076152304609 0 1.25 -4.380761523046093 212
+0
+0
diff --git a/MAC/Navigator2/panels/Test/Event_Viewer.pnl b/MAC/Navigator2/panels/Test/Event_Viewer.pnl
index b278abc59f4ecf6868cbd3c6135bc37fbe2d3833..f8fbe6b1db6f6c32bdd011078e1483e6aed19dc1 100644
--- a/MAC/Navigator2/panels/Test/Event_Viewer.pnl
+++ b/MAC/Navigator2/panels/Test/Event_Viewer.pnl
@@ -1,4 +1,4 @@
-V 11
+V 13
 1
 LANG:1 12 Event Viewer
 PANEL,-1 -1 1200 813 N "_3DFace" 0
@@ -65,9 +65,11 @@ string 	itsEventDp         = \"\";
 string 	itsSelectionDp     = \"\";
 string  itsInitiatorDp     = \"\";
 " 0
- 2
+ 3
 "CBRef" "1"
 "EClose" E
+"dpi" "96"
+0 0 0
 ""
 DISPLAY_LAYER, 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
 LAYER, 0 
@@ -84,8 +86,9 @@ E E E
 1
 LANG:1 0 
 
-1
+2
 "dashclr"N "_Transparent"
+"antiAliased" "0"
 E E 0 2 1 0 1 E 0.986193293885602 0 0.450511945392491 400.138067061144 249.5494880546075 0 E 10 1 518 295
 1
 LANG:1 32 Arial Black,-1,13,5,75,0,0,0,0,0
@@ -145,9 +148,11 @@ E E E
 1
 LANG:1 0 
 
-1
+3
+"sizePolicy" "Fixed Fixed"
 "dashclr"N "_Transparent"
-E E 0 1 1 2 1 E 1 0 1.00763358778626 139 -47.81679389312999 1 E 283 371 384 386
+"antiAliased" "0"
+E E 0 1 1 2 1 E 1 0 1.00763358778626 139 -47.81679389312999 1 E 283 371 386 385
 0 2 2 "0s" 0 0 0 192 0 0  283 371 1
 1
 LANG:1 32 Arial Black,-1,11,5,50,0,0,0,0,0
@@ -164,9 +169,11 @@ E E E
 1
 LANG:1 0 
 
-1
+3
+"sizePolicy" "Fixed Fixed"
 "dashclr"N "_Transparent"
-E E 0 1 1 2 1 E 1 0 1.00763358778626 140 -44.58015267175594 1 E 282 340 379 355
+"antiAliased" "0"
+E E 0 1 1 2 1 E 1 0 1.00763358778626 140 -44.58015267175594 1 E 282 340 381 354
 0 2 2 "0s" 0 0 0 192 0 0  282 340 1
 1
 LANG:1 32 Arial Black,-1,11,5,50,0,0,0,0,0
@@ -183,9 +190,11 @@ E E E
 1
 LANG:1 0 
 
-1
+3
+"sizePolicy" "Fixed Fixed"
 "dashclr"N "_Transparent"
-E E 0 1 1 2 1 E 1 0 1.00763358778626 140 -50.03816793893154 1 E 282 400 342 415
+"antiAliased" "0"
+E E 0 1 1 2 1 E 1 0 1.00763358778626 140 -50.03816793893154 1 E 282 400 344 414
 0 2 2 "0s" 0 0 0 192 0 0  282 400 1
 1
 LANG:1 32 Arial Black,-1,11,5,50,0,0,0,0,0
@@ -234,8 +243,9 @@ E E E
 1
 LANG:1 0 
 
-1
+2
 "dashclr"N "_Transparent"
+"antiAliased" "0"
 E E 0 3 1 2 1 E  441 304 179 90
 4 19
 "LINE5"
@@ -248,8 +258,9 @@ E E E
 1
 LANG:1 0 
 
-1
+2
 "dashclr"N "_Transparent"
+"antiAliased" "0"
 E E 0 3 1 2 1 E  171 104 178 90
 4 20
 "LINE6"
@@ -262,8 +273,9 @@ E E E
 1
 LANG:1 0 
 
-1
+2
 "dashclr"N "_Transparent"
+"antiAliased" "0"
 E E 0 3 1 2 1 E  182 91 201 94
 4 23
 "LINE7"
@@ -276,8 +288,9 @@ E E E
 1
 LANG:1 0 
 
-1
+2
 "dashclr"N "_Transparent"
+"antiAliased" "0"
 E E 0 3 1 2 1 E  523 90 523 260
 4 24
 "LINE8"
@@ -290,8 +303,9 @@ E E E
 1
 LANG:1 0 
 
-1
+2
 "dashclr"N "_Transparent"
+"antiAliased" "0"
 E E 0 3 1 2 1 E  525 90 510 100
 4 25
 "LINE9"
@@ -304,8 +318,9 @@ E E E
 1
 LANG:1 0 
 
-1
+2
 "dashclr"N "_Transparent"
+"antiAliased" "0"
 E E 0 3 1 2 1 E  526 91 534 102
 4 28
 "LINE10"
@@ -318,8 +333,9 @@ E E E
 1
 LANG:1 0 
 
-1
+2
 "dashclr"N "_Transparent"
+"antiAliased" "0"
 E E 0 3 1 2 1 E  710 280 751 186
 4 29
 "LINE11"
@@ -332,8 +348,9 @@ E E E
 1
 LANG:1 0 
 
-1
+2
 "dashclr"N "_Transparent"
+"antiAliased" "0"
 E E 0 3 1 2 1 E  749 188 735 192
 4 30
 "LINE12"
@@ -346,8 +363,9 @@ E E E
 1
 LANG:1 0 
 
-1
+2
 "dashclr"N "_Transparent"
+"antiAliased" "0"
 E E 0 3 1 2 1 E  752 188 756 199
 4 33
 "LINE13"
@@ -360,8 +378,9 @@ E E E
 1
 LANG:1 0 
 
-1
+2
 "dashclr"N "_Transparent"
+"antiAliased" "0"
 E E 0 3 1 2 1 E  700 380 767 488
 4 34
 "LINE14"
@@ -374,8 +393,9 @@ E E E
 1
 LANG:1 0 
 
-1
+2
 "dashclr"N "_Transparent"
+"antiAliased" "0"
 E E 0 3 1 2 1 E  768 492 772 480
 4 35
 "LINE15"
@@ -388,8 +408,9 @@ E E E
 1
 LANG:1 0 
 
-1
+2
 "dashclr"N "_Transparent"
+"antiAliased" "0"
 E E 0 3 1 2 1 E  764 493 750 486
 4 40
 "LINE16"
@@ -402,8 +423,9 @@ E E E
 1
 LANG:1 0 
 
-1
+2
 "dashclr"N "_Transparent"
+"antiAliased" "0"
 E E 0 3 1 2 1 E  530 390 530 740
 4 41
 "LINE17"
@@ -416,8 +438,9 @@ E E E
 1
 LANG:1 0 
 
-1
+2
 "dashclr"N "_Transparent"
+"antiAliased" "0"
 E E 0 3 1 2 1 E  538 722 529 737
 4 42
 "LINE18"
@@ -430,8 +453,9 @@ E E E
 1
 LANG:1 0 
 
-1
+2
 "dashclr"N "_Transparent"
+"antiAliased" "0"
 E E 0 3 1 2 1 E  520 726 529 736
 4 43
 "LINE19"
@@ -444,8 +468,9 @@ E E E
 1
 LANG:1 0 
 
-1
+2
 "dashclr"N "_Transparent"
+"antiAliased" "0"
 E E 0 3 1 2 1 E  470 390 260 648
 4 44
 "LINE20"
@@ -458,8 +483,9 @@ E E E
 1
 LANG:1 0 
 
-1
+2
 "dashclr"N "_Transparent"
+"antiAliased" "0"
 E E 0 3 1 2 1 E  261 644 279 642
 1 884 0 "" 0
 0
@@ -475,74 +501,18 @@ E E 0 3 1 2 1 E  261 644 279 642
 0
 1 890 7 "" 0
 0
-1 891 7 "" 1
-0
-1 892 7 "" 2
-0
-1 893 7 "" 3
-0
-1 894 7 "" 4
-0
 1 895 9 "" 0
 0
-1 896 9 "" 1
-0
-1 897 9 "" 2
-0
-1 898 9 "" 3
-0
-1 899 9 "" 4
-0
 1 900 12 "" 0
 0
-1 901 12 "" 1
-0
-1 902 12 "" 2
-0
-1 903 12 "" 3
-0
-1 904 12 "" 4
-0
 1 905 14 "" 0
 0
-1 906 14 "" 1
-0
-1 907 14 "" 2
-0
-1 908 14 "" 3
-0
-1 909 14 "" 4
-0
 1 910 17 "" 0
 0
-1 911 17 "" 1
-0
-1 912 17 "" 2
-0
-1 913 17 "" 3
-0
-1 914 17 "" 4
-0
 1 915 18 "" 0
 0
-1 916 18 "" 1
-0
-1 917 18 "" 2
-0
-1 918 18 "" 3
-0
-1 919 18 "" 4
-0
 1 920 19 "" 0
 0
-1 921 19 "" 1
-0
-1 922 19 "" 2
-0
-1 923 19 "" 3
-0
-1 924 19 "" 4
-0
 4 87
 "LINE21"
 ""
@@ -554,8 +524,9 @@ E E E
 1
 LANG:1 0 
 
-1
+2
 "dashclr"N "_Transparent"
+"antiAliased" "0"
 E E 0 3 1 2 1 E  260 650 266 630
 4 89
 "LINE23"
@@ -568,8 +539,9 @@ E E E
 1
 LANG:1 0 
 
-1
+2
 "dashclr"N "_Transparent"
+"antiAliased" "0"
 E E 0 3 1 2 1 E  181 293 400 370
 4 90
 "LINE24"
@@ -582,8 +554,9 @@ E E E
 1
 LANG:1 0 
 
-1
+2
 "dashclr"N "_Transparent"
+"antiAliased" "0"
 E E 0 3 1 2 1 E  180 296 184 318
 4 91
 "LINE25"
@@ -596,8 +569,9 @@ E E E
 1
 LANG:1 0 
 
-1
+2
 "dashclr"N "_Transparent"
+"antiAliased" "0"
 E E 0 3 1 2 1 E  184 290 196 290
 1 925 20 "" 0
 0
@@ -628,9 +602,11 @@ E E E
 1
 LANG:1 0 
 
-1
+3
+"sizePolicy" "Fixed Fixed"
 "dashclr"N "_Transparent"
-E E 0 1 1 2 1 E 1.06930693069307 0 1.00763358778626 118.4554455445543 -72.59541984732846 1 E 282 340 391 355
+"antiAliased" "0"
+E E 0 1 1 2 1 E 1.06930693069307 0 1.00763358778626 118.4554455445543 -72.59541984732846 1 E 282 340 393 354
 0 2 2 "0s" 0 0 0 192 0 0  282 340 1
 1
 LANG:1 32 Arial Black,-1,11,5,50,0,0,0,0,0
@@ -684,99 +660,6 @@ LANG:1 14 show highlight
     LOG_DEBUG(\"Event_Viewer.pnl strHighlight contains: \" + highlight);
 }" 0
  E E E
-13 180
-"PUSH_BUTTON3"
-""
-1 950 226 E E E 1 E 1 E N "_ButtonText" E N "_Button" E E
- E E
-131 0 0 0 0 0
-E E E
-0
-1
-LANG:1 0 
-
-0
-1
-LANG:1 32 Arial Black,-1,11,5,50,0,0,0,0,0
-0  948 224 1098 251
-
-T 
-1
-LANG:1 13 show g_alarms
-"main()
-{
-  LOG_DEBUG(\"Event_Viewer.pnl showMapping for g_alarms\");
-  showMapping(g_alarms,\"g_alarms\");
-}" 0
- E E E
-14 181
-"alarm_dp"
-""
-1 20 730 E E E 1 E 1 E N "_WindowText" E N "_Window" E E
- E E
-133 0 0 0 0 0
-E E E
-0
-1
-LANG:1 9 Datapoint
-
-0
-1
-LANG:1 32 Arial Black,-1,11,5,50,0,0,0,0,0
-0  18 728 305 751
-3 "0s" 0 0 0 0 0 -1  E E E
-13 182
-"PUSH_BUTTON4"
-""
-1 182 761 E E E 1 E 1 E N "_ButtonText" E N "_Button" E E
- E E
-135 0 0 0 0 0
-E E E
-0
-1
-LANG:1 0 
-
-0
-1
-LANG:1 32 Arial Black,-1,11,5,50,0,0,0,0,0
-0  180 759 304 786
-
-T 
-1
-LANG:1 8 setAlarm
-"main()
-{
-  string dp;
-  getValue(\"alarm_dp\",\"text\",dp);
-  int state;
-  getValue(\"alarm_state\",\"text\",state);
-  string message;
-  getValue(\"alarm_message\",\"text\",message);
-  bool force=false;
-  getValue(\"alarm_force\",\"state\",0,force);
-  
-  string syst = dpSubStr(dp,DPSUB_SYS);
-  
-  dpSet(syst+\"__navObjectState.DPName\",dp,syst+\"__navObjectState.stateNr\",state,
-        syst+\"__navObjectState.message\",message,syst+\"__navObjectState.force\",force);
-}" 0
- E E E
-14 183
-"alarm_state"
-""
-1 21 762 E E E 1 E 1 E N "_WindowText" E N "_Window" E E
- E E
-137 0 0 0 0 0
-E E E
-0
-1
-LANG:1 5 state
-
-0
-1
-LANG:1 32 Arial Black,-1,11,5,50,0,0,0,0,0
-0  19 760 71 783
-3 "4d" 4 0 0 0 0 -1  E E E
 13 227
 "PUSH_BUTTON5"
 ""
@@ -812,8 +695,9 @@ E E E
 1
 LANG:1 0 
 
-1
+2
 "dashclr"N "_Transparent"
+"antiAliased" "0"
 E E 1 3 1 2 1 E  940 10 940 570
 13 316
 "PUSH_BUTTON6"
@@ -1013,8 +897,10 @@ E E E
 1
 LANG:1 0 
 
-1
+3
+"sizePolicy" "Fixed Fixed"
 "dashclr"N "_Transparent"
+"antiAliased" "0"
 E E 2 1 1 2 1 E U  1 E 720 680 800 704
 0 2 2 "0s" 0 0 0 64 0 0  720 680 1
 1
@@ -1074,14 +960,6 @@ LANG:1 20 show g_processesList
  E E E
 1 926 21 "" 0
 0
-1 927 21 "" 1
-0
-1 928 21 "" 2
-0
-1 929 21 "" 3
-0
-1 930 21 "" 4
-0
 1 931 22 "" 0
 0
 4 685
@@ -1095,8 +973,9 @@ E E E
 1
 LANG:1 0 
 
-1
+2
 "dashclr"N "_Transparent"
+"antiAliased" "0"
 E E 0 3 1 2 1 E  151 462 400 390
 4 686
 "LINE29"
@@ -1109,8 +988,9 @@ E E E
 1
 LANG:1 0 
 
-1
+2
 "dashclr"N "_Transparent"
+"antiAliased" "0"
 E E 0 3 1 2 1 E  153 463 178 469
 4 687
 "LINE30"
@@ -1123,52 +1003,10 @@ E E E
 1
 LANG:1 0 
 
-1
+2
 "dashclr"N "_Transparent"
+"antiAliased" "0"
 E E 0 3 1 2 1 E  150 460 160 454
-20 736
-"alarm_force"
-""
-1 80 750 E E E 1 E 1 E N "_3DText" E N "_3DFace" E E
- E E
-207 0 0 0 0 0
-E E E
-0
-1
-LANG:1 0 
-
-0
-1
-LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0
-0  78 748 172 802
-1
-T 
-1
-LANG:1 5 force
-
-0 
-1
-LANG:1 0 
-E E
-0 0 0 0 0
-1
-E E
-EE14 184
-"alarm_message"
-""
-1 20 794 E E E 1 E 1 E N "_WindowText" E N "_Window" E E
- E E
-139 0 0 0 0 0
-E E E
-0
-1
-LANG:1 12 alarmmessage
-
-0
-1
-LANG:1 32 Arial Black,-1,11,5,50,0,0,0,0,0
-0  18 792 304 815
-3 "0s" 0 0 0 0 0 -1  E E E
 13 883
 "PUSH_BUTTON22"
 ""
@@ -1226,67 +1064,83 @@ LAYER, 7
 LANG:1 0 
 0
 3 0 "PANEL_REF1" -1
-"objects\\Test\\Action.pnl" 158 150 T 105 1 0 1 -81 -32
+"" ""
+"objects/Test/Action.pnl" 158 150 T 105 1 0 1 -81 -32
 1
 "$name""fw_viewSelection"
 3 1 "PANEL_REF2" -1
-"objects\\Test\\Action.pnl" 390 150 T 106 1 0 1 -10 32
+"" ""
+"objects/Test/Action.pnl" 390 150 T 106 1 0 1 -10 32
 1
 "$name""fw_topDetailSelection"
 3 2 "PANEL_REF3" -1
-"objects\\Test\\Action.pnl" 668 220 T 107 1 0 1 -78 -10
+"" ""
+"objects/Test/Action.pnl" 668 220 T 107 1 0 1 -78 -10
 1
 "$name""fw_bottomDetailSelection"
 3 4 "PANEL_REF5" -1
-"objects\\Test\\Action.pnl" 649 450 T 108 1 0 1 -49 -40
+"" ""
+"objects/Test/Action.pnl" 649 450 T 108 1 0 1 -49 -40
 1
 "$name""fw_locator"
 3 5 "PANEL_REF6" -1
-"objects\\Test\\Action.pnl" 413 460 T 109 1 0 1 -43 220
+"" ""
+"objects/Test/Action.pnl" 413 460 T 109 1 0 1 -43 220
 1
 "$name""fw_progressBar"
 3 6 "PANEL_REF7" -1
-"objects\\Test\\Action.pnl" 189 450 T 110 1 0 1 -39 130
+"" ""
+"objects/Test/Action.pnl" 189 450 T 110 1 0 1 -39 130
 1
 "$name""fw_headLines"
 3 7 "PANEL_REF8" -1
-"objects\\Test\\Event.pnl" 15 8 T 111 1 0 1 -5 0
+"" ""
+"objects/Test/Event.pnl" 15 8 T 111 1 0 1 -5 0
 1
 "$name""fw_viewSelection"
 3 9 "PANEL_REF10" -1
-"objects\\Test\\Event.pnl" 377 7 T 112 1 0 1 0 1
+"" ""
+"objects/Test/Event.pnl" 377 7 T 112 1 0 1 0 1
 1
 "$name""fw_topDetailSelection"
 3 12 "PANEL_REF13" -1
-"objects\\Test\\Event.pnl" 541 104 T 113 1 0 1 31 -1
+"" ""
+"objects/Test/Event.pnl" 541 104 T 113 1 0 1 31 -1
 1
 "$name""fw_bottomDetailSelection"
 3 14 "PANEL_REF15" -1
-"objects\\Test\\Event.pnl" 578 531 T 114 1 0 1 12 -43
+"" ""
+"objects/Test/Event.pnl" 578 531 T 114 1 0 1 12 -43
 1
 "$name""fw_locator"
 3 17 "PANEL_REF18" -1
-"objects\\Test\\Event.pnl" 334 642 T 115 1 0 1 -4 86
+"" ""
+"objects/Test/Event.pnl" 334 642 T 115 1 0 1 -4 86
 1
 "$name""fw_progressBar"
 3 18 "PANEL_REF19" -1
-"objects\\Test\\Event.pnl" -2 533 T 116 1 0 1 2 105
+"" ""
+"objects/Test/Event.pnl" -2 533 T 116 1 0 1 2 105
 1
 "$name""fw_headLines"
 3 19 "PANEL_REF20" -1
-"objects\\Test\\Event.pnl" 0 205 T 116 1 0 1 -10 3
+"" ""
+"objects/Test/Event.pnl" 0 205 T 116 1 0 1 -10 3
 1
 "$name""fw_viewBox"
 3 20 "PANEL_REF21" -1
-"objects\\Test\\Action.pnl" 207 346 T 122 1 0 1 -117 -26
+"" ""
+"objects/Test/Action.pnl" 207 346 T 122 1 0 1 -117 -26
 1
 "$name""fw_viewBox"
 3 21 "PANEL_REF22" -1
-"objects\\Test\\Event.pnl" 0 205 T 197 1 0 1 10 253
+"" ""
+"objects/Test/Event.pnl" 0 205 T 197 1 0 1 10 253
 1
 "$name""fw_fastJumper"
 3 22 "PANEL_REF23" -1
-"objects\\Test\\Action.pnl" 207 346 T 198 1 0 1 -117 64
+"" ""
+"objects/Test/Action.pnl" 207 346 T 198 1 0 1 -117 64
 1
 "$name""fw_fastJumper"
 0
diff --git a/MAC/Navigator2/panels/Test/test3.pnl b/MAC/Navigator2/panels/Test/test3.pnl
index 9e7ad3fdc6bf4bb5f48544033b500f2b34591cab..45f07cee5503afd34c43e5152116bb0e698e0dfd 100644
--- a/MAC/Navigator2/panels/Test/test3.pnl
+++ b/MAC/Navigator2/panels/Test/test3.pnl
@@ -1,25 +1,80 @@
-V 11
+V 13
 1
 LANG:1 0 
 PANEL,-1 -1 500 400 N "_3DFace" 0
 "main()
 {
-time resetDate,compareDate;
- 
- resetDate=makeTime(2013,5,27);
- compareDate = makeTime(2013,5,20);
- 
- int now = period(resetDate);
- int compare = period(compareDate);
- DebugN(resetDate);
- DebugN(compareDate);
- DebugN(\"diff:\"+(now-compare));
+    string query;
+    dyn_dyn_anytype tab;
+    int val;
+    dyn_string skipped;
+    
+    dyn_string distsystems = makeDynString(\"CS001\",\"CS002\",\"CS003\",\"CS004\",\"CS005\",\"CS006\",\"CS007\",
+                               \"CS011\",\"CS013\",\"CS017\",
+                               \"CS021\",\"CS024\",\"CS026\",\"CS028\",
+                               \"CS030\",\"CS031\",\"CS032\",
+                               \"CS101\",\"CS103\",
+                               \"CS201\",
+                               \"CS301\",\"CS302\",
+                               \"CS401\",
+                               \"CS501\",
+                               \"RS106\",
+                               \"RS205\",\"RS208\",\"RS210\",
+                               \"RS305\",\"RS306\",\"RS307\",\"RS310\",
+                               \"RS406\",\"RS407\",\"RS409\",
+                               \"RS503\",\"RS508\",\"RS509\",
+                               \"DE601\",\"DE602\",\"DE603\",\"DE604\",\"DE605\",\"DE609\",\"FR606\",\"PL610\",\"PL611\",\"PL612\",\"SE607\",\"UK608\",
+                               \"MCU001\",\"CCU001\");
+
+    
+    for (int i = 1; i <= dynlen(distsystems); i++) 
+    {  
+
+      if (dpExists(distsystems[i]+\":LOFAR\"))
+      {      
+        query = \"SELECT '_online.._value' FROM '*.**.status.state' REMOTE '\" + distsystems[i] + \"' WHERE '_online.._value' == 56 OR  '_online.._value' == 53 OR  '_online.._value' == 43 OR  '_online.._value' == 46 OR  '_online.._value' == 60\";
+  
+  
+        dpQuery(query,tab);
+  
+        for(int z=2;z<=dynlen(tab);z++)
+        {
+          int oldval = tab[z][2];
+          int newval;
+
+          if  (oldval == 43 || oldval == 46)
+          {
+            newval = 40;
+          }
+          else if  (oldval == 53 || oldval == 56)
+          {
+            newval = 50;
+          }
+          else if  (oldval == 60)
+          {
+            newval = 10;
+          }
+   
+          
+          dpSet(tab[z][1], newval);
+          DebugN(tab[z][1] + \"is set to \" + newval);
+        }
+      }
+      else
+      {
+        DebugN(\"System not online: \"+distsystems[i]);
+        dynAppend(skipped,distsystems[i]);
+      }
+    }
+    DebugN(\"skipped systems: \" + skipped);
 }" 0
  E E E E 1 -1 -1 0  -1 -1
 ""0  1
-E E 2
+E E 3
 "CBRef" "1"
 "EClose" E
+"dpi" "96"
+0 0 0
 ""
 DISPLAY_LAYER, 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
 LAYER, 0 
diff --git a/MAC/Navigator2/panels/Test/testStationSumAlertToMCUalert.pnl b/MAC/Navigator2/panels/Test/testStationSumAlertToMCUalert.pnl
index 970d3cf526bcf482e8597564b894c5c35ede56cd..2751aeaae16b3c35c4e49bd0f385d24faf203d5f 100644
--- a/MAC/Navigator2/panels/Test/testStationSumAlertToMCUalert.pnl
+++ b/MAC/Navigator2/panels/Test/testStationSumAlertToMCUalert.pnl
@@ -8,69 +8,226 @@ PANEL,-1 -1 500 400 N "_3DFace" 0
 }" 0
  E E E E 1 -1 -1 0  40 30
 ""0  1
-E "#uses \"navFunct.ctl\"
-
-string _strCurrentAlertClass;
-
+E "
 
 void Init()
 {
-//  string strQuery = \"SELECT ALERT '_alert_hdl.._direction', '_alert_hdl.._prior', '_alert_hdl.._class' FROM 'CS011_SumAlert'\";
-//  dpQueryConnectSingle( \"CallbackAlertMCU\", true, \"\", strQuery );
+  string strSysName;
   
+  strSysName = strrtrim( getSystemName(), \":\" );
+  
+  string strQuery = \"SELECT ALERT '_alert_hdl.._prior', '_alert_hdl.._ackable' \" + 
+                    \"FROM '{LOFAR_ObsSW.status.childSumAlert,LOFAR_PermSW.status.childSumAlert,LOFAR_PIC.status.childSumAlert}' \" +
+                    \"REMOTE ALL \" +
+                    \"WHERE _SYS != \\\"\" + strSysName + \"\\\"\"; 
   
-//  string strQuery = \"SELECT ALERT '_alert_hdl.._direction', '_alert_hdl.._prior', '_alert_hdl.._class' FROM 'LOFAR.status.childSumAlert' REMOTE 'CS011:'\";
-  string strQuery = \"SELECT ALERT '_alert_hdl.._direction', '_alert_hdl.._prior', '_alert_hdl.._class' FROM 'LOFAR_PIC.status.childSumAlert' REMOTE ALL\";
   dpQueryConnectSingle( \"CallbackAlertLCU\", true, \"\", strQuery );
 }
 
-/*
-void CallbackAlertMCU( string strIdent, dyn_dyn_anytype ddaAlerts )
+
+
+void CallbackAlertLCU( string strIdent, dyn_dyn_anytype ddaAlerts )
 {
-  DebugN( \"CallbackAlert:\" );
-  DebugN( ddaAlerts );
+  int x, y, iHighestPrio;
+  bool bCame, bRetVal;
+  string strHighestAlertClass;
+  
+  DebugTN( \"CallbackAlertLCU: =================================================\" );
 
+  
   for( x=2; x<=dynlen(ddaAlerts); x++ )
   {
-    strClass = ddaAlerts[x][5];
+    //DebugN( \" ---------------------------------------------------------------------------------------\" );
+    //DebugN( ddaAlerts[x] );
+        
+    // Declaration and initialization of variables
+    dyn_string dsStationDPEs;
+    string strStation, strStationDP, strStationDistChildSumAlertDPE;
+    int iActState ;       
+    dyn_int diPrios;
     
-    // Skip went alerts
-    if( !bDirection )
+    int iPrio        = ddaAlerts[x][3];
+    bool bAckable    = ddaAlerts[x][4];
+
+    // Get stationname and remove ':' on the end
+    strStation = dpSubStr( ddaAlerts[x][1], DPSUB_SYS );
+    strStation = strrtrim( strStation, \":\" );
+    
+    // Determine station DP to use, based on DPE name: LOFAR_ObsSW, LOFAR_PermSW or LOFAR_PIC
+    if( patternMatch( \"*LOFAR_ObsSW*\", ddaAlerts[x][1] ) )
+    {
+      dsStationDPEs = dpNames( \"LOFAR_ObsSW*\" + strStation, \"Station\"  );
+    }
+    else if( patternMatch( \"*LOFAR_PermSW*\", ddaAlerts[x][1] ) )
+    {
+      dsStationDPEs = dpNames( \"LOFAR_PermSW*\" + strStation, \"Station\"  );
+    }
+    else if( patternMatch( \"*LOFAR_PIC*\", ddaAlerts[x][1] ) )
+    {
+      dsStationDPEs = dpNames( \"LOFAR_PIC_*\" + strStation, \"Station\"  );
+    }
+    else
+    {
+      DebugTN( __FUNCTION__ + \"(): unrecognized alert '\" + ddaAlerts[x][1] + \"', skipp it !!\" );
       continue;
+    }
     
-    // Came alert, if prio heigher then takeover alertclass
-    if( iPrio >= iHighestPrio )
+    // Normally only one DPE should be found: take it
+    if( dynlen(dsStationDPEs) >= 1 )
     {
-      _strCurrentAlertClass = strClass;
+      strStationDP = dpSubStr( dsStationDPEs[1], DPSUB_DP );
+    }
+    else
+    {
+      DebugTN( __FUNCTION__ + \"(): strStationDP NOT FOUND FOR ALERT '\" + ddaAlerts[x][1] + \"' !!\" );
+      continue;
+    }
+    
+    strStationDistChildSumAlertDPE = strStationDP + \".dist_childSumAlert\";
+    
+    // Get actual state and list of summed-prios's (because they can't be get by the dpConnect)   
+    dpGet( ddaAlerts[x][1] + \":_alert_hdl.._act_state\",    iActState,
+           ddaAlerts[x][1] + \":_alert_hdl.._summed_prios\", diPrios );
+
+    
+    // First deactivate the alert to go to a 'default' state
+    dpSet( strStationDistChildSumAlertDPE, 0 );
+    dpDeactivateAlert( strStationDistChildSumAlertDPE, bRetVal );
+
+    // Now set the highest/actual prio of the sumalert as alert, this raises the alert
+    dpActivateAlert( strStationDistChildSumAlertDPE, bRetVal );        
+    dpSet( strStationDistChildSumAlertDPE, iPrio );
+   
+    // If sum-alert is acked: ack our alert also
+    if( iActState == DPATTR_ALERTSTATE_APP_ACK )
+    {
+      dpSet( strStationDistChildSumAlertDPE + \":_alert_hdl.._ack\", DPATTR_ACKTYPE_SINGLE );
+    }
+    
+    // If sum-alert is went-unacked: detect prio that cames below our prio and do dpSet, this causes the alert to go to the went-unacked state
+    if( ( iActState == DPATTR_ALERTSTATE_APP_DISAPP_NOT_ACK ) ||
+        ( iActState == DPATTR_ALERTSTATE_DISAPP_NOT_ACK ) )
+    {
+      int iNextPrio;
       
-      iHighestPrio = iPrio;
+      dynSort( diPrios );
+      
+      for( y=1; y<=dynlen(diPrios); y++ )
+      {
+        // If this is prio is higher or equal then our current sumalert prio: stop
+        if( diPrios[y] >= iPrio )
+        {
+          break;
+        }
+        
+        // If this prio is higher then the previous one: takeover
+        if( diPrios[y] > iNextPrio )
+        {
+          iNextPrio = diPrios[y];
+        }
+      }
+
+      // dpSet determined prio
+      dpSet( strStationDistChildSumAlertDPE, iNextPrio );
+
     }
+   
+    DebugTN( \"Copied alert '\" + ddaAlerts[x][1] + \"' to strStationDistChildSumAlertDPE '\" + strStationDistChildSumAlertDPE + \"'\" );
   }  
   
   
 }
 
-*/
 
 
-void CallbackAlertLCU( string strIdent, dyn_dyn_anytype ddaAlerts )
+
+
+void CallbackAlertLCU_TESTMvdJ( string strIdent, dyn_dyn_anytype ddaAlerts )
 {
-  int x, iHighestPrio;
+  int x, y, iHighestPrio;
   bool bCame, bRetVal;
   string strHighestAlertClass;
-  string db;
   
-  DebugN( \"CallbackAlertLCU:\" );
-  DebugN( \"Ident: \", strIdent );
-  DebugN( \"Alerts: \", ddaAlerts );
+  DebugTN( \"CallbackAlertLCU: =================================================\" );
+
   
   for( x=2; x<=dynlen(ddaAlerts); x++ )
   {
-    db = dpSubStr(ddaAlerts[x][1],DPSUB_SYS);
     bool bDirection  = ddaAlerts[x][3];
     int iPrio        = ddaAlerts[x][4];
-    string strClass  = ddaAlerts[x][5];
+    bool bAckable    = ddaAlerts[x][5];
+//    string strClass  = ddaAlerts[x][5];
+
     
+    // Get actuale state and list of summed-prios's (because they can't be get by the dpConnect)
+    int iActState ;       
+    dyn_int diPrios;
+    
+    dpGet( ddaAlerts[x][1] + \":_alert_hdl.._act_state\",    iActState,
+           ddaAlerts[x][1] + \":_alert_hdl.._summed_prios\", diPrios );
+
+    DebugTN( \"   \" + ddaAlerts[x][1] + \"  --------------------------------------\" );
+    DebugN( ddaAlerts );
+    DebugN( \"iActState = \" + iActState );
+/*
+    anytype at;
+    dpGet( ddaAlerts[x][1] + \":_alert_hdl.._summed_prios\", at );
+    DebugN( \"_summed_prios = \", at );
+    
+    anytype at;
+    dpGet( ddaAlerts[x][1] + \":_alert_hdl.._summed_states\", at );
+    DebugN( \"_summed_states = \", at );
+    
+    anytype at;
+    dpGet( ddaAlerts[x][1] + \":_alert_hdl.._summed_alerts\", at );
+    DebugN( \"_summed_alerts = \", at );
+*/    
+
+    // First deactivate the alert to go to a 'default' state
+    dpSet( \"MCU001:RS310_ChildSumAlert.\", 0 );
+    dpDeactivateAlert( \"MCU001:RS310_ChildSumAlert.\", bRetVal );
+
+    // Now set the highest/actual prio of the sumalert as alert, this raises the alert
+    dpActivateAlert( \"MCU001:RS310_ChildSumAlert.\", bRetVal );        
+    dpSet( \"MCU001:RS310_ChildSumAlert.\", iPrio );
+   
+    // If sum-alert is acked: ack our alert also
+    if( iActState == DPATTR_ALERTSTATE_APP_ACK )
+    {
+      dpSet( \"MCU001:RS310_ChildSumAlert.:_alert_hdl.._ack\", DPATTR_ACKTYPE_SINGLE );
+    }
+    
+    // If sum-alert is went-unacked: detect prio that cames below our prio and do dpSet, this causes the alert to go to the went-unacked state
+    if( ( iActState == DPATTR_ALERTSTATE_APP_DISAPP_NOT_ACK ) ||
+        ( iActState == DPATTR_ALERTSTATE_DISAPP_NOT_ACK ) )
+    {
+      int iNextPrio;
+      
+      dynSort( diPrios );
+      
+      for( y=1; y<=dynlen(diPrios); y++ )
+      {
+        // If this is prio is higher or equal then our current sumalert prio: stop
+        if( diPrios[y] >= iPrio )
+        {
+          break;
+        }
+        
+        // If this prio is higher then the previous one: takeover
+        if( diPrios[y] > iNextPrio )
+        {
+          iNextPrio = diPrios[y];
+        }
+      }
+
+      DebugTN( \"Next determined prio: \" + iNextPrio );
+      // dpSet determined prio
+      dpSet( \"MCU001:RS310_ChildSumAlert.\", iNextPrio );
+
+    }
+   
+    
+continue;    
     // Skip went alerts
     if( !bDirection )
       continue;
@@ -80,58 +237,71 @@ void CallbackAlertLCU( string strIdent, dyn_dyn_anytype ddaAlerts )
     // Came alert, if prio heigher then takeover alertclass
     if( iPrio >= iHighestPrio )
     {
-      strHighestAlertClass = strClass;
+ //     strHighestAlertClass = strClass;
       
       iHighestPrio = iPrio;
     }
-  }
+    
+    if( bAckable )
+    {
+      
+    }
+  }  
+  
+  return;
+  
   
-  // skip if no station 
-  if (db == MainDBName || db == CEPDBName) return;
   
-  DebugN( \"strHighestAlertClass = \" + strHighestAlertClass );
+  
+  
+//  DebugN( \"strHighestAlertClass = \" + strHighestAlertClass );
+  DebugN( \"iHighestPrio = \" + iHighestPrio );
 
-  string mainDP = MainDBName;
-  if (navFunct_isCoreStation(db))
-  {
-    mainDP+=\"LOFAR_PIC_Core_\"+navFunct_bareDBName(db)+\".status.childSumAlert\";
-  }
-  else if  (navFunct_isRemoteStation(db))
-  {
-    mainDP+=\"LOFAR_PIC_Remote_\"+navFunct_bareDBName(db)+\".status.childSumAlert\";
-  }   
-  else if  (navFunct_isInternationalStation(db))
-  {
-    mainDP+=\"LOFAR_PIC_Europe_\"+navFunct_bareDBName(db)+\".status._childSumAlert\";
-  }   
+//  dpDeactivateAlert( \"MCU001:RS310_ChildSumAlert.\", bRetVal );
+  
+  dpSet( \"MCU001:RS310_ChildSumAlert.\", iHighestPrio );
+  
+//  if( !bAckable )
+//  {
+//    dpSet( \"MCU001:RS310_ChildSumAlert.:_alert_hdl.._ack\", DPATTR_ACKTYPE_SINGLE );
+//  }
+ 
+
+  
+  
+  
+  
+  
+  
   
+  
+return;  
   // Now get state of alert
   if( bCame )
   {
     // Convert class from system to this sytem
-    strreplace( strHighestAlertClass, db, MainDBName );
+    strreplace( strHighestAlertClass, \"RS310:\", \"MCU001:\" );
     
     DebugTN( \"Setting alert to class: \" + strHighestAlertClass );
     
-    dpDeactivateAlert( mainDP, bRetVal );
+    dpDeactivateAlert( \"MCU001:RS310_SumAlert.\", bRetVal );
     
     // Change class and set alert to true
-    dpSet( mainDP+\":_alert_hdl.._class\", strHighestAlertClass,
-           mainDP, true );
+    dpSet( \"MCU001:RS310_SumAlert.:_alert_hdl.._class\", strHighestAlertClass,
+           \"MCU001:RS310_SumAlert.\", true );
     
-    dpActivateAlert( mainDP, bRetVal );
+    dpActivateAlert( \"MCU001:RS310_SumAlert.\", bRetVal );
   }  
   else
   {
     DebugTN( \"Reset alert\" );
-    dpDeactivateAlert( mainDP, bRetVal );
-    dpSet( mainDP, false );
+    dpDeactivateAlert( \"MCU001:RS310_SumAlert.\", bRetVal );
+    dpSet( \"MCU001:RS310_SumAlert.\", false );
   }
 }
 
 
 
-
 " 0
  3
 "CBRef" "1"
@@ -164,10 +334,27 @@ T
 LANG:1 12 PUSH_BUTTON2
 "main()
 {
+  
+ // just a testbutton....  
+  
+return;
+
+
+
   int iState;
-  dpGet( \"MCU001:LOFAR_PIC_Europe_PL611.status.childSumAlert:_alert_hdl.._act_state\", iState );
+//  dpGet( \"MCU001:RS310_SumAlert.:_alert_hdl.._act_state\", iState );
+//  dpGet( \"MCU001:RS310_SumAlert.:_alert_hdl.._act_state\", iState );
+  dpGet( \"RS310:LOFAR_PIC.status.childSumAlert:_alert_hdl.._act_state\", iState );
+  
   DebugN( \"iState = \" + iState );
-}" 0
+
+  string strColor;
+//  dpGet( \"MCU001:RS310_SumAlert.:_alert_hdl.._act_state_color\", strColor );
+  anytype at;
+  dpGet( \"RS310:LOFAR_PIC.status.childSumAlert:_alert_hdl.._summed_alerts\", at );
+  DebugN( at );
+}
+" 0
  E E E
 0
 LAYER, 1 
diff --git a/MAC/Navigator2/panels/Test/testdpnames.pnl b/MAC/Navigator2/panels/Test/testdpnames.pnl
index f69401ca38febc241bf1fdf759c8fc9a62620fb5..50c4e8b08e63c6ffd1a7fd836e1abc0d0bc5054a 100644
--- a/MAC/Navigator2/panels/Test/testdpnames.pnl
+++ b/MAC/Navigator2/panels/Test/testdpnames.pnl
@@ -1,4 +1,4 @@
-V 10
+V 13
 1
 LANG:1 0 
 PANEL,-1 -1 400 400 N "_3DFace" 0
@@ -11,9 +11,11 @@ PANEL,-1 -1 400 400 N "_3DFace" 0
  E E E E 1 -1 -1 0  10 20
 ""0  1
 E "string aS=\"\";" 0
- 2
+ 3
 "CBRef" "1"
 "EClose" E
+"dpi" "96"
+0 0 0
 ""
 DISPLAY_LAYER, 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
 LAYER, 0 
@@ -32,9 +34,8 @@ LANG:1 0
 
 0
 1
-LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg
-0 ""
- 8 18 382 52
+LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0
+0  8 18 382 52
 3 "0s" 0 0 0 0 0 -1  E E E
 13 1
 "PUSH_BUTTON1"
@@ -49,9 +50,8 @@ LANG:1 0
 
 0
 1
-LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg
-0 ""
- 148 128 272 154
+LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0
+0  148 128 272 154
 
 T 
 1
@@ -59,11 +59,11 @@ LANG:1 12 PUSH_BUTTON1
 "main()
 {
   getValue(\"TEXT_FIELD1\",\"text\",aS);
-  string aS1=\"\";
-  string aS2=\"\";
-  int nr=-1;
-  string aFS = sscanf(aS,\"LOFAR_ObsSW_Observation%d_%s\",nr,aS2);
-  DebugN(\"Found:   nr: \"+nr+\"\\n aS2: \"+aS2);
+  DebugN(\"len string\" + strlen(aS));
+  DebugN(\"len .status.state\" + strlen(\".status.state\"));
+  DebugN(\"pos .status.state\" + strpos(aS,\".status.state\"));
+  int tot = strpos(aS,\".status.state\")+strlen(\".status.state\");
+  DebugN(\"pos+len .status.state\" + tot);
 }" 0
  E E E
 0
@@ -95,4 +95,4 @@ LAYER, 7
 1
 LANG:1 0 
 0
-0
\ No newline at end of file
+0
diff --git a/MAC/Navigator2/panels/TrendPanel.pnl b/MAC/Navigator2/panels/TrendPanel.pnl
new file mode 100644
index 0000000000000000000000000000000000000000..6fef56d44563a25d7fd621b4fbb654c1b0d03ec9
--- /dev/null
+++ b/MAC/Navigator2/panels/TrendPanel.pnl
@@ -0,0 +1,185 @@
+V 13
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+PANEL,-1 -1 600 367 N "_3DFace" 0
+E E E E E 1 -1 -1 0  460 50
+"refFileName"0  1
+E E 3
+"CBRef" "0"
+"EClose" E
+"dpi" "96"
+0 0 0
+""
+DISPLAY_LAYER, 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
+LAYER, 0 
+1
+LANG:1 6 Layer1
+4 26
+"Line3"
+""
+1 460 50 E E E 1 E 1 E N {0,0,0} E N "_GediBackground" E E
+ E E
+0 0 0 0 0 0
+E E E
+0
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+2
+"dashclr"N "_Transparent"
+"antiAliased" "0"
+E E 0 1 1 0 1 E  460 50 460 350
+4 28
+"Line4"
+""
+1 460 20 E E E 1 E 1 E N "weiss" E N "_GediBackground" E E
+ E E
+0 0 0 0 0 0
+E E E
+0
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+2
+"dashclr"N "_Transparent"
+"antiAliased" "0"
+E E 0 1 1 0 1 E  460 20 460 350
+23 29
+"trendwindow"
+""
+1 10 20 E E E 1 E 1 E N "_WindowText" E N "_Window" E E
+ E E
+1 0 0 0 0 0
+E E E
+0
+1
+LANG:1 0 
+
+0
+1
+LANG:1 35 MS Shell Dlg 2,-1,11,5,50,0,0,0,0,0
+0  8 18 442 342
+5 E E E 1 429 N {0,0,0} 0 0 1 0 1 0 1 0 "temp" "CS001:LOFAR_PIC_Cabinet0.temperature" 0 2 0 0 1 "3 2 0.0" "%x" 0 1 2 0 E
+E
+1 0 0 3 2
+1
+LANG:1 36 CS001:LOFAR_PIC_Cabinet0.temperature
+1
+LANG:1 0 
+1 "" ""  1 0 0 1 0 1 N "Red"
+1 2 2 0 0 0 0 0
+1 0 "%H:%M:%S" "%x" 0 1 0 0 
+E 1 1 1 0 50 1 20 86460
+1
+LANG:1 35 MS Shell Dlg 2,-1,11,5,50,0,0,0,0,0
+0  1
+LANG:1 35 MS Shell Dlg 2,-1,11,5,50,0,0,0,0,0
+0  1
+LANG:1 35 MS Shell Dlg 2,-1,11,5,50,0,0,0,0,0
+0  100 
+N {0,0,0} 0 0 1 0 1 150 1 5 5 1 2
+0
+19 30
+"RADIO_BOX1"
+""
+1 471 20 E E E 1 E 1 E N "_3DText" E N "_3DFace" E E
+ E E
+2 0 0 0 0 0
+E E E
+0
+1
+LANG:1 0 
+
+0
+1
+LANG:1 37 MS Shell Dlg 2,8.25,-1,5,50,0,0,0,0,0
+0  469 18 593 142
+2
+T 
+1
+LANG:1 6 actual
+
+1 
+1
+LANG:1 0 
+E E
+0 0 0 0 0
+T 
+1
+LANG:1 16 historical (avg)
+
+0 
+1
+LANG:1 0 
+E E
+0 0 0 0 0
+1
+E "main(int button)
+{
+  string curvename = trendwindow.curveNames(0);
+  string dp = trendwindow.curveDataSource(curvename);
+  DebugN(\"DP: \",dp);
+  dyn_string split_dp = strsplit(dp,\".\");
+  DebugN(\"split_dp: \",split_dp);
+  DebugN(\"split_dp[1]: \" + split_dp[1]);
+  string avg_dp = split_dp[1] + \".compressed.\";
+  DebugN(\"avg_dp: \",avg_dp);
+  
+  for (int i = 1; i < dynlen(split_dp); i++) 
+  {
+    DebugN(\"avg_dp: \",avg_dp);
+    avg_dp += split_dp[i+1];
+  }
+  
+  // actual
+  if (this.number() == 0)
+  {
+    trendwindow.curveDataSource(curvename,dp);
+    trendwindow.trendRefresh();
+  } 
+  else if (this.number() == 1) 
+  {
+    trendwindow.curveDataSource(curvename, avg_dp);
+    trendwindow.trendRefresh();
+  }      
+}" 0
+
+0
+LAYER, 1 
+1
+LANG:1 6 Layer2
+0
+LAYER, 2 
+1
+LANG:1 6 Layer3
+0
+LAYER, 3 
+1
+LANG:1 6 Layer4
+0
+LAYER, 4 
+1
+LANG:1 6 Layer5
+0
+LAYER, 5 
+1
+LANG:1 6 Layer6
+0
+LAYER, 6 
+1
+LANG:1 6 Layer7
+0
+LAYER, 7 
+1
+LANG:1 6 Layer8
+0
+0
diff --git a/MAC/Navigator2/panels/main.pnl b/MAC/Navigator2/panels/main.pnl
index eb58707277f5ce0a52dbf7443794a8f5db791010..1f522df667f26ec495943293d177629a21d025f9 100644
--- a/MAC/Navigator2/panels/main.pnl
+++ b/MAC/Navigator2/panels/main.pnl
@@ -229,7 +229,7 @@ void addProcesses(string selectedStation) {
 
 void addObservations() {
   int xPos_AddSymbol = 0; 
-  int yPos_AddSymbol = 685; 
+  int yPos_AddSymbol = 697; 
   int ref = 1;
   string addPanelName    = \"objects/Observations/observation_smallCEPView.pnl\";
 
@@ -495,7 +495,7 @@ LANG:1 3 sw6
 2 42
 "PRIMITIVE_TEXT14"
 ""
-1 10 663 E E E 1 E 1 E N "_WindowText" E N "_Window" E E
+1 15 678 E E E 1 E 1 E N "_WindowText" E N "_Window" E E
  E E
 27 0 0 0 0 0
 E E E
@@ -507,8 +507,8 @@ LANG:1 0
 "sizePolicy" "Fixed Fixed"
 "dashclr"N "_Transparent"
 "antiAliased" "0"
-E E 0 1 1 2 1 E U  0 E 10 663 61 675
-0 2 2 "0s" 0 0 0 192 0 0  10 663 1
+E E 0 1 1 2 1 E U  0 E 15 678 66 690
+0 2 2 "0s" 0 0 0 192 0 0  15 678 1
 1
 LANG:1 35 MS Shell Dlg 2,-1,11,5,75,0,0,0,0,0
 0 1
@@ -600,7 +600,7 @@ LANG:1 7 HBA LBA
 2 74
 "PRIMITIVE_TEXT30"
 ""
-1 292 663 E E E 1 E 1 E N "_WindowText" E N "_Window" E E
+1 297 678 E E E 1 E 1 E N "_WindowText" E N "_Window" E E
  E E
 44 0 0 0 0 0
 E E E
@@ -612,8 +612,8 @@ LANG:1 0
 "sizePolicy" "Fixed Fixed"
 "dashclr"N "_Transparent"
 "antiAliased" "0"
-E E 0 1 1 2 1 E U  0 E 292 663 363 675
-0 2 2 "0s" 0 0 0 192 0 0  292 663 1
+E E 0 1 1 2 1 E U  0 E 297 678 368 690
+0 2 2 "0s" 0 0 0 192 0 0  297 678 1
 1
 LANG:1 35 MS Shell Dlg 2,-1,11,5,75,0,0,0,0,0
 0 1
@@ -621,7 +621,7 @@ LANG:1 11 Observation
 2 75
 "PRIMITIVE_TEXT31"
 ""
-1 131.9999999999999 677 E E E 1 E 1 E N "_WindowText" E N "_Window" E E
+1 136.9999999999999 692 E E E 1 E 1 E N "_WindowText" E N "_Window" E E
  E E
 45 0 0 0 0 0
 E E E
@@ -633,8 +633,8 @@ LANG:1 0
 "sizePolicy" "Fixed Fixed"
 "dashclr"N "_Transparent"
 "antiAliased" "0"
-E E 0 1 1 2 1 E U  0 E 131.9999999999999 677 189 689
-0 2 2 "0s" 0 0 0 192 0 0  131.9999999999999 677 1
+E E 0 1 1 2 1 E U  0 E 136.9999999999999 692 194 704
+0 2 2 "0s" 0 0 0 192 0 0  136.9999999999999 692 1
 1
 LANG:1 35 MS Shell Dlg 2,-1,11,5,75,0,0,0,0,0
 0 1
@@ -642,7 +642,7 @@ LANG:1 9 startTime
 2 76
 "PRIMITIVE_TEXT32"
 ""
-1 482 677 E E E 1 E 1 E N "_WindowText" E N "_Window" E E
+1 487 692 E E E 1 E 1 E N "_WindowText" E N "_Window" E E
  E E
 46 0 0 0 0 0
 E E E
@@ -654,8 +654,8 @@ LANG:1 0
 "sizePolicy" "Fixed Fixed"
 "dashclr"N "_Transparent"
 "antiAliased" "0"
-E E 0 1 1 2 1 E U  0 E 482 677 537 689
-0 2 2 "0s" 0 0 0 192 0 0  482 677 1
+E E 0 1 1 2 1 E U  0 E 487 692 542 704
+0 2 2 "0s" 0 0 0 192 0 0  487 692 1
 1
 LANG:1 35 MS Shell Dlg 2,-1,11,5,75,0,0,0,0,0
 0 1
@@ -663,7 +663,7 @@ LANG:1 8 stopTime
 2 77
 "PRIMITIVE_TEXT33"
 ""
-1 310 677 E E E 1 E 1 E N "_WindowText" E N "_Window" E E
+1 315 692 E E E 1 E 1 E N "_WindowText" E N "_Window" E E
  E E
 47 0 0 0 0 0
 E E E
@@ -675,8 +675,8 @@ LANG:1 0
 "sizePolicy" "Fixed Fixed"
 "dashclr"N "_Transparent"
 "antiAliased" "0"
-E E 0 1 1 2 1 E U  0 E 310 677 362 689
-0 2 2 "0s" 0 0 0 192 0 0  310 677 1
+E E 0 1 1 2 1 E U  0 E 315 692 367 704
+0 2 2 "0s" 0 0 0 192 0 0  315 692 1
 1
 LANG:1 35 MS Shell Dlg 2,-1,11,5,75,0,0,0,0,0
 0 1
@@ -684,7 +684,7 @@ LANG:1 8 progress
 2 78
 "PRIMITIVE_TEXT34"
 ""
-1 422 677 E E E 1 E 1 E N "_WindowText" E N "_Window" E E
+1 427 692 E E E 1 E 1 E N "_WindowText" E N "_Window" E E
  E E
 48 0 0 0 0 0
 E E E
@@ -696,8 +696,8 @@ LANG:1 0
 "sizePolicy" "Fixed Fixed"
 "dashclr"N "_Transparent"
 "antiAliased" "0"
-E E 0 1 1 2 1 E U  0 E 422 677 471 689
-0 2 2 "0s" 0 0 0 192 0 0  422 677 1
+E E 0 1 1 2 1 E U  0 E 427 692 476 704
+0 2 2 "0s" 0 0 0 192 0 0  427 692 1
 1
 LANG:1 35 MS Shell Dlg 2,-1,11,5,75,0,0,0,0,0
 0 1
@@ -747,7 +747,7 @@ LANG:1 2 BP
 2 115
 "PRIMITIVE_TEXT37"
 ""
-1 2 677 E E E 1 E 1 E N "_WindowText" E N "_Window" E E
+1 7 692 E E E 1 E 1 E N "_WindowText" E N "_Window" E E
  E E
 52 0 0 0 0 0
 E E E
@@ -759,8 +759,8 @@ LANG:1 0
 "sizePolicy" "Fixed Fixed"
 "dashclr"N "_Transparent"
 "antiAliased" "0"
-E E 0 1 1 2 1 E U  0 E 2 677 85 689
-0 2 2 "0s" 0 0 0 192 0 0  2 677 1
+E E 0 1 1 2 1 E U  0 E 7 692 90 704
+0 2 2 "0s" 0 0 0 192 0 0  7 692 1
 1
 LANG:1 35 MS Shell Dlg 2,-1,11,5,75,0,0,0,0,0
 0 1
@@ -768,7 +768,7 @@ LANG:1 13 ObservationNr
 2 116
 "PRIMITIVE_TEXT38"
 ""
-1 614 673 E E E 1 E 1 E N "_WindowText" E N "_Window" E E
+1 619 688 E E E 1 E 1 E N "_WindowText" E N "_Window" E E
  E E
 53 0 0 0 0 0
 E E E
@@ -780,8 +780,8 @@ LANG:1 0
 "sizePolicy" "Fixed Fixed"
 "dashclr"N "_Transparent"
 "antiAliased" "0"
-E E 0 1 1 2 1 E U  0 E 614 673 707 685
-0 2 2 "0s" 0 0 0 192 0 0  614 673 1
+E E 0 1 1 2 1 E U  0 E 619 688 712 700
+0 2 2 "0s" 0 0 0 192 0 0  619 688 1
 1
 LANG:1 35 MS Shell Dlg 2,-1,11,5,75,0,0,0,0,0
 0 1
@@ -846,7 +846,7 @@ LANG:1 0
 2
 "dashclr"N "_Transparent"
 "antiAliased" "0"
-E E 0 2 1 2 1 E  210 0 210 660
+E E 0 2 1 2 1 E  210 0 210 674.0000000000003
 4 33
 "LINE2"
 ""
@@ -861,11 +861,11 @@ LANG:1 0
 2
 "dashclr"N "_Transparent"
 "antiAliased" "0"
-E E 0 2 1 2 1 E  625 0 625 660
+E E 0 2 1 2 1 E  625 0 625 674
 4 41
 "LINE4"
 ""
-1 0 660 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E
+1 5 675 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E
  E E
 26 0 0 0 0 0
 E E E
@@ -876,7 +876,7 @@ LANG:1 0
 2
 "dashclr"N "_Transparent"
 "antiAliased" "0"
-E E 0 2 1 2 1 E  0 660 1010 660
+E E 0 2 1 2 1 E  5 675 1015 675
 0
 LAYER, 2 
 1
diff --git a/MAC/Navigator2/panels/navigator.pnl b/MAC/Navigator2/panels/navigator.pnl
index 42462844d8597461d87752a8388345414beb1eab..73dea10b86fe01945a7a8faf8b4119fb612dca39 100644
--- a/MAC/Navigator2/panels/navigator.pnl
+++ b/MAC/Navigator2/panels/navigator.pnl
@@ -1,7 +1,7 @@
 V 13
 1
 LANG:1 9 Navigator
-PANEL,-1 -1 1503 1000 N "_3DFace" 0
+PANEL,-1 -1 1503 998 N "_3DFace" 0
 "main()
 {
   //  LOG_TRACE(\"navigator.pnl:Initialize| init start baseDP: \"+$baseDP);
@@ -68,6 +68,7 @@ PANEL,-1 -1 1503 1000 N "_3DFace" 0
   } else {
 		setValue(fw_headLines,\"backCol\",\"Lofar_dpdoesnotexist\");
   } 
+  /*
   if (dpExists(DPNAME_NAVIGATOR + g_navigatorID + \".fw_alerts\")) {
     if (dpConnect(\"fw_alertsEvent\",false,DPNAME_NAVIGATOR + g_navigatorID + \".fw_alerts.event\")== -1) {
       DebugTN(\"Navigator.pnl:main|Couldn't connect to \"+DPNAME_NAVIGATOR + g_navigatorID + \".fw_alerts.event \"+getLasteError());
@@ -75,6 +76,7 @@ PANEL,-1 -1 1503 1000 N "_3DFace" 0
   } else {
 		setValue(fw_alerts,\"backCol\",\"Lofar_dpdoesnotexist\");
   } 
+  */
   if (dpExists(DPNAME_NAVIGATOR + g_navigatorID + \".fw_fastJumper\")) {
     if (dpConnect(\"fw_fastJumperEvent\",false,DPNAME_NAVIGATOR + g_navigatorID + \".fw_fastJumper.event\")== -1) {
       DebugTN(\"Navigator.pnl:main|Couldn't connect to \"+DPNAME_NAVIGATOR + g_navigatorID + \".fw_fastJumper.event \"+getLasteError());
@@ -180,19 +182,19 @@ DISPLAY_LAYER, 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
 LAYER, 0 
 1
 LANG:1 6 Layer1
-1 104 5 "" 0
+1 156 5 "" 0
 0
-1 106 9 "" 2
+1 158 9 "" 2
 0
-1 94 3 "" 12
+1 146 3 "" 12
 0
-1 99 4 "" 12
+1 151 4 "" 12
 0
-1 105 6 "" 2
+1 157 6 "" 2
 0
-1 112 12 "" 18
+1 164 12 "" 18
 0
-1 118 16 "" 1
+1 170 16 "" 1
 0
 15 33
 "CLOCK1"
@@ -216,9 +218,7 @@ LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0
 0  1
 LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0
 0 
-1 120 20 "" 1
-0
-1 121 21 "" 9
+1 172 20 "" 1
 0
 13 62
 "undock"
@@ -246,39 +246,151 @@ LANG:1 12 PUSH_BUTTON1
   navFunct_handleUndockClick();
 }" 0
  E E E
-13 93
-"b_iltSwitch"
+1 173 21 "0.0" 18
+0
+1 187 21 "0.0" 1
+31 "transform" 0 0 0.9999999999999999 0 0.8921739130434782 -0.4999999999999947 96.31826086956554
+0
+32 136
+"SPACER1"
 ""
-1 1010.405 11 E E E 1 E 1 E N "_ButtonText" E N "_Button" E E
+1 380 0 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E
  E E
-32 0 0 0 0 0
+33 0 0 0 0 0
 E E E
 0
 1
 LANG:1 0 
 
+1
+"sizePolicy" "Ignored Expanding"
+ 380 0 430 10 2
+32 137
+"SPACER2"
+""
+1 1490 180 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E
+ E E
+34 0 0 0 0 0
+E E E
 0
 1
-LANG:1 35 MS Shell Dlg 2,-1,11,5,75,0,0,0,0,0
-0  991 3 1062 27
+LANG:1 0 
 
-T 
 1
-LANG:1 9 iltSwitch
-"main()
-{
-  bool localmode;
-  g_involved_stations = makeDynString(\"\");    
+"sizePolicy" "Expanding Ignored"
+ 1490 180 1501.996428571429 230 1
+32 138
+"SPACER3"
+""
+1 1390 8.881784197001252e-016 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E
+ E E
+35 0 0 0 0 0
+E E E
+0
+1
+LANG:1 0 
 
-  dpGet(\"MCU001:LOFAR_PIC_Europe_DE601.localMode.stationSwitch\",localmode);
-  localmode = !localmode;
-  dpSet(\"MCU001:LOFAR_PIC_Europe_DE601.localMode.stationSwitch\",localmode);
-  
-  dynAppend(g_involved_stations,\"DE601:\");
-  navCtrl_handleNavigatorEvent(\"\",\"ILTSwitched\",\"GCFCWD.ctl\");
+1
+"sizePolicy" "Ignored Expanding"
+ 1390 8.881784197001252e-016 1440 20 2
+32 139
+"SPACER4"
+""
+1 1200 210 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E
+ E E
+36 0 0 0 0 0
+E E E
+0
+1
+LANG:1 0 
 
-}" 0
- E E E
+1
+"sizePolicy" "Expanding Ignored"
+ 1200 210 1210 260 1
+32 140
+"SPACER5"
+""
+1 1380 440 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E
+ E E
+37 0 0 0 0 0
+E E E
+0
+1
+LANG:1 0 
+
+1
+"sizePolicy" "Ignored Expanding"
+ 1380 440 1430 450 2
+32 141
+"SPACER6"
+""
+1 1200 660 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E
+ E E
+38 0 0 0 0 0
+E E E
+0
+1
+LANG:1 0 
+
+1
+"sizePolicy" "Expanding Ignored"
+ 1200 660 1210 710 1
+32 142
+"SPACER7"
+""
+1 1490 643 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E
+ E E
+39 0 0 0 0 0
+E E E
+0
+1
+LANG:1 0 
+
+1
+"sizePolicy" "Expanding Ignored"
+ 1490 643 1498 693 1
+32 143
+"SPACER8"
+""
+1 1190 950 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E
+ E E
+40 0 0 0 0 0
+E E E
+0
+1
+LANG:1 0 
+
+1
+"sizePolicy" "Expanding Ignored"
+ 1190 950 1200 1000 1
+32 144
+"SPACER9"
+""
+1 770 860 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E
+ E E
+41 0 0 0 0 0
+E E E
+0
+1
+LANG:1 0 
+
+1
+"sizePolicy" "Ignored Expanding"
+ 770 860 820 880 2
+32 145
+"SPACER10"
+""
+1 1500 926.0175879396984 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E
+ E E
+42 0 0 0 0 0
+E E E
+0
+1
+LANG:1 0 
+
+1
+"sizePolicy" "Expanding Ignored"
+ 1500 926.0175879396984 1502 976.0175879396984 1
 0
 LAYER, 1 
 1
@@ -351,7 +463,7 @@ LANG:1 6 Layer8
 0
 3 21 "PANEL_REF21" -1
 "" ""
-"objects/navigator_alerts.pnl" 40 813 T 30 1 0 1 -50 57
+"objects/navigator_alerts.pnl" 15.50000000000001 926.8747307968413 T 33 1 0 1 0.4999999999999929 -9.874730796841277
 1
 "$name""fw_alerts"
 0
diff --git a/MAC/Navigator2/panels/objects/Alerts/AESRow.pnl b/MAC/Navigator2/panels/objects/Alerts/AESRow.pnl
new file mode 100644
index 0000000000000000000000000000000000000000..70d5342b7445012f2e2a2556355831e98f81bd28
--- /dev/null
+++ b/MAC/Navigator2/panels/objects/Alerts/AESRow.pnl
@@ -0,0 +1,214 @@
+V 13
+4
+LANG:1 8 (NoName)
+LANG:10000 8 (NoName)
+LANG:10001 8 (NoName)
+LANG:10027 18 (БезИмени)
+PANEL,-1 -1 1102 107 N "_3DFace" 1
+"$AESREGDOLLAR_SCREENTYPE"
+E E E E E 1 -1 -1 0  -1 -1
+"objects_parampanels/STD_PANELS/AS_ES_Conf_para.pnl"0  1
+E "#uses \"navigator.ctl\"
+
+//Global mainpoint holders
+string 			itsActionDp	= \"\";
+string 			itsEventDp      = \"\";
+dyn_string 	itsSelectionDp  = \"\";
+
+bool   bDoubleClicked  = false;
+
+// routine for single mouse click
+void click(int row) {
+    // set delay in case double click was meant
+  delay(0, 100); 
+  if (!bDoubleClicked) {
+  }
+}
+
+
+// routine for double mouse click
+void dblClick(string dp) 
+{  
+  // indicate this is a doubleClick
+  bDoubleClicked = true; 
+  string selection=\"\";
+  DebugN(\"Double clicked. dp: \" + dp);
+  
+  LOG_TRACE(\"AESRow.pnl:DoubleClicked|doubleClick received on alarmtable dp:\" + dp);
+ 
+
+  if (dpExists(dp) ) {
+    g_currentDatapoint=dp;
+    if (strpos(dp,\"LOFAR_PIC\") >= 0) {
+        selection=\"Hardware\";
+    } else if (strpos(dp,\"LOFAR_ObsSW\") >= 0) {
+      if (strpos(dp,\"Ctrl\") >= 0) {
+        selection=\"Processes\";
+      } else {
+        selection=\"Observations\";
+      }
+    } else if (strpos(dp,\"LOFAR_PermSW\") >= 0) {
+      selection=\"Processes\";
+    }
+    setEvent(selection,\"ChangeTab\");
+  }
+  
+  // set delay to avoid click event will be triggered
+  delay(0, 500);
+  bDoubleClicked = false;  
+}
+
+
+
+// routine for right mouse click
+void rClick(int row) {
+  LOG_TRACE(\"AESRow.pnl:RightMouseClick|Right mouseclick received on alarmtable row: \" + row);  
+}" 0
+ 3
+"CBRef" "1"
+"EClose" E
+"dpi" "96"
+0 0 0
+""
+NC
+DISPLAY_LAYER, 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
+LAYER, 0 
+1
+LANG:1 6 Layer1
+1 1 0 "" 18
+31 "transform" 0 0 1 0 1 13 -8.5
+0
+1 2 0 "" 19
+31 "transform" 0 0 1 0 1 13 -8.5
+0
+1 3 0 "" 24
+31 "transform" 0 0 1 0 1 13 -8.5
+0
+1 8 0 "" 14
+31 "transform" 0 0 1 0 1 1 -7.5
+0
+1 10 0 "" 25
+31 "transform" 0 0 1 0 0.8333333333333334 0 4.999999999999999
+0
+1 12 0 "" 21
+31 "transform" 0 0 1 0 1 13 -8.500000000000007
+0
+1 13 0 "" 22
+31 "transform" 0 0 1 0 1 13 -8.500000000000007
+0
+1 14 0 "" 0
+31 "transform" 0 0 1 0 0.8333333333333334 0 4.999999999999999
+0
+1 15 0 "" 1
+1 "textFieldOut" 1 1 "main(int row, string column, string value)
+{
+  
+  if (row < 0 || column < 0) return;
+  
+  mapping mTableRow;
+ 
+  synchronized(g_bTableLineSynchronisation)
+  { 
+    int length;
+    dyn_anytype alertRow;  
+    
+    alertRow = this.getLineN(row);
+    
+    length = dynlen(alertRow);
+    for(int i=1; i<=length; i++)
+      mTableRow[this.columnName(i-1)] = alertRow[i];
+  }
+  
+  
+  //read pos of visible lines
+//  setMultiValue( \"ar_currentLine\", \"text\", row+1); // \"current line\" -indicator is 1 based
+
+//  aes_doColumnClick( AESTAB_TOP, row, column, value, mTableRow );
+}
+
+" 0
+ 
+1 "rightClick" 1 1 "main(int row, string column)
+{
+  int i, j;
+  anytype value;
+  mapping mTableMultipleRows;
+  
+  if (row < 0 || column < 0) return;
+  
+  //IM 116642: Trigger table widget once, to avoid timing problems
+  int top, bot;
+  getValue(\"\", \"lineRangeVisible\", top, bot);
+  
+  synchronized(g_bTableLineSynchronisation)
+  { 
+    int length;
+    dyn_anytype alertRow;  
+    
+    getValue( \"\", \"currentCell\", row, column );
+    value=this.cellValue;
+
+    alertRow = this.getLineN(row);
+    length = dynlen(alertRow);
+    
+    for(j=0; j<this.lineCount; j++)
+    {
+      mapping rowHeaderMapping;
+      
+      for(i=1; i<=length; i++)
+        rowHeaderMapping[this.columnName(i-1)] = alertRow[i];
+      
+      mTableMultipleRows[j] = rowHeaderMapping;
+    }
+  }
+  
+  rClick();
+
+//  aes_onRightClick( g_propDpNameTop, AESTAB_TOP, this.name, row, column, value, mTableMultipleRows );
+}" 0
+ 
+35 "verticalSizePolicy" 0 0 0
+35 "horizontalSizePolicy" 0 0 7
+31 "transform" 0 0 0.9797979797979798 0 0.6896551724137932 0.2020202020202022 9.310344827586199
+18 "font" 0 0 4
+LANG:1 26 Arial,-1,11,5,50,0,0,0,0,0
+LANG:10000 26 Arial,-1,13,5,40,0,0,0,0,0
+LANG:10001 26 Arial,-1,13,5,40,0,0,0,0,0
+LANG:10027 26 Arial,-1,13,5,40,0,0,0,0,0
+0 
+0
+0
+LAYER, 1 
+1
+LANG:1 6 Layer2
+0
+LAYER, 2 
+1
+LANG:1 6 Layer3
+0
+LAYER, 3 
+1
+LANG:1 6 Layer4
+0
+LAYER, 4 
+1
+LANG:1 6 Layer5
+0
+LAYER, 5 
+1
+LANG:1 6 Layer6
+0
+LAYER, 6 
+1
+LANG:1 6 Layer7
+0
+LAYER, 7 
+1
+LANG:1 6 Layer8
+0
+3 0 "" -1
+"" ""
+"vision/aes/AESRow.pnl" 5 15 T 1 1 0 1 63 1235
+1
+"$SCREENTYPE""$AESREGDOLLAR_SCREENTYPE"
+0
diff --git a/MAC/Navigator2/panels/objects/Alerts/alarms.pnl b/MAC/Navigator2/panels/objects/Alerts/alarms.pnl
deleted file mode 100644
index 90cec5c7cf011ab497aa14e24cb5f6fd9075be09..0000000000000000000000000000000000000000
--- a/MAC/Navigator2/panels/objects/Alerts/alarms.pnl
+++ /dev/null
@@ -1,572 +0,0 @@
-V 13
-1
-LANG:1 0 
-PANEL,-1 -1 1242 823 N "_3DFace" 1
-"$choice"
-"main()
-{
-  choice = $choice;
-  initialize();
-}
-
-void initialize() {
-  if (dpExists(DPNAME_NAVIGATOR + g_navigatorID+\".alarmsTrigger\")) {
-    dpConnect(\"alarmTrigger\",true,DPNAME_NAVIGATOR + g_navigatorID+\".alarmsTrigger\");
-  } else {
-    LOG_ERROR(\"alarms.pnl:initialize|Error connecting to alarmsTriggerpoint in navigator Instance.\");
-  }
-}
-
-void alarmTrigger(string dp1, bool T) {
-  LOG_TRACE(\"alarms.pnl:initialize|alarmTrigger received.\");
-  // set selected Row to the last entry that triggered this alarm
-  redraw_table();
-}" 0
- E E E E 1 -1 -1 0  10 10
-""0  1
-E "#uses \"navPanel.ctl\"
-
-string choice=\"\";
-string baseDP=\"\";
-bool needsSave=false;
-bool bDoubleClicked=false;
-mapping    g_alarms_copy;
-
-
-// routine for single mouse click
-void click(int row) {
-    // set delay in case double click was meant
-  delay(0, 100); 
-  if (!bDoubleClicked) {
-
-  }
-}
-
-// routine for double mouse click
-void dblClick(int row) {
-  
-  // indicate this is a doubleClick
-  bDoubleClicked = true; 
-  string selection=\"\";
-  
-  LOG_TRACE(\"alarms.pnl:DoubleClicked|doubleClick received on alarmtable row: \" + row);
-  
-  if (alarmTable.lineCount() < 1) {
-    bDoubleClicked = false;  
-    return;
-  }
-  dyn_anytype result = alarmTable.getLineN(row);
-  LOG_DEBUG(\"alarms.pnl:DoubleClicked|Result: \"+result);
-  string dp = navFunct_ObsToTemp(result[2]);
-  if (dpExists(dp) ) {
-    LOG_DEBUG(\"alarms.pnl:DoubleClick|Setting currentDatapoint from : \"+g_currentDatapoint+\" to \"+dp);
-    g_currentDatapoint=dp;
-    if (strpos(dp,\"LOFAR_PIC\") >= 0) {
-        selection=\"Hardware\";
-    } else if (strpos(dp,\"LOFAR_ObsSW\") >= 0) {
-      if (strpos(dp,\"Ctrl\") >= 0) {
-        selection=\"Processes\";
-      } else {
-        selection=\"Observations\";
-      }
-    } else if (strpos(dp,\"LOFAR_PermSW\") >= 0) {
-      selection=\"Processes\";
-    }         
-    navPanel_setEvent(selection,\"ChangeTab\");
-  }
-  
-  // set delay to avoid click event will be triggered
-  delay(0, 500);
-  bDoubleClicked = false;  
-}
-
-// routine for right mouse click
-void rClick(int row) {
-  LOG_TRACE(\"alarms.pnl:RightMouseClick|Right mouseclick received on alarmtable row: \" + row);
-  
-  if (alarmTable.lineCount() < 1) {
-    return;
-  }
-  dyn_anytype result = alarmTable.getLineN(row);
-  LOG_DEBUG(\"alarms.pnl:RightMouseClick|Result: \"+result);
-  string dp = navFunct_ObsToTemp(result[2])+\".status.state\";
-  string message = result[3];
-  int status=-1;
-  if (result[4] == \"ACK\") {
-    status = ACK;
-  } else if (result[4] == \"WENT\") {
-    status = WENT;
-  } else if (result[4] == \"CAME\") {
-    status = CAME;
-  }  
-
-  LOG_DEBUG(\"alarms.pnl:RightMouseClick|Looking for dp: \"+dp+\" status: \"+status);
- 
-  int iPos=-1;
-
-  //to narrow actions determine if the state is 'acknowledgable'
-  if (status != ACK) {
-
-    // ok rest should be possible to acknowledge
-    // find the entry in the table
-    iPos=dynContains(g_alarms[\"DPNAME\"],dp);  
-  
-    if (iPos < 1) {
-      LOG_ERROR(\"alarms.pnl:RightMouseClick|Strange, couldn't find chosen entry in alarm global list.\");
-    }
-  }
-  
-  // determine also if there is a http msg in the MESSAGE part if so we also need an open webpage on the rclikc menu
-  int start = strpos(message,\"http://\");
-  string httpStr=\"\";
-  if (start > -1) {
-    string startStr=substr(message,start);
-    int end=strpos(startStr,\" \");
-    httpStr=startStr;
-    if (end > -1){
-      httpStr=substr(startStr,0,end);
-    } 
-  }
-  LOG_DEBUG( \"alarms.pnl:RightMouseClick|found http msg: \"+httpStr);
-  
-  
-    
-  // define the popupMenu
-  dyn_string txt;
-  int answer;
-  int idx=1;
-  if (iPos > 0) {
-    dynInsertAt(txt,\"PUSH_BUTTON, Acknowledge, 1, 1\",idx++);
-  }
-  if (httpStr != \"\") {
-    dynInsertAt(txt,\"PUSH_BUTTON, Show Webpage, 2, 1\",idx++);
-  }
-  
-  if (dynlen(txt) > 0) {
-    popupMenu(txt,answer);
-  }
-
-  // acknowledge pushed 
-  if (answer == 1) {
-    acknowledgeAlarm(iPos,dp,message,true);
-  } else if (answer == 2) {
-    std_help(httpStr,true);
-  }
-}
-
-// *******************************************
-// Name : redraw_table
-// *******************************************
-// Description:
-// redraws the alarm table
-//
-//
-// Returns:
-//    nothing
-// *******************************************
-void redraw_table() {
-  // clear table
-  mapping g_alarmscopy = g_alarms;
-  LOG_DEBUG(\"alarms.pnl:redraw_table|deleting all entries from alarms\");
-  alarmTable.deleteAllLines();
-  if (g_alarmscopy[\"DPNAME\"] == \"\" ) return;
-
-  if (mappinglen(g_alarmscopy)) {
-    LOG_DEBUG(\"alarms.pnl:redraw_table|Nr of alerts in global table: \" + dynlen(g_alarmscopy[\"DPNAME\"]));
-    
-    //append  all CAME and WENT alarms
-    for (int j=1; j<=dynlen(g_alarmscopy[\"DPNAME\"])  ; j++) {
-      // sometimes the table alters during the loop, if so redraw it
-      if (j > dynlen(g_alarmscopy[\"DPNAME\"])) {
-        LOG_WARN(\"alarms.pnl:redraw_table|table update while in loop, rerun loop \");
-        redraw_table();
-      }
-      if (j >dynlen(g_alarmscopy[\"DPNAME\"]) ) return;  // if reset during loop, then escape  
-      if (g_alarmscopy[\"STATUS\"][j] != ACK  && choice == \"New\") {
-        string dp = navFunct_TempToObs(substr(g_alarmscopy[\"DPNAME\"][j],0,strpos(g_alarmscopy[\"DPNAME\"][j],\".status.state\")));
-        alarmTable.appendLine(\"Time\",g_alarmscopy[\"TIME\"][j],\"Datapoint\",dp,
-                              \"Message\",g_alarmscopy[\"MESSAGE\"][j],
-                              \"Status\",getAlarmStatus(g_alarmscopy[\"STATUS\"][j]),
-                              \"State\",g_alarmscopy[\"STATE\"][j]);
-
-        string aColor=getStateColor(g_alarmscopy[\"STATE\"][j]);
-        alarmTable.cellBackColRC(alarmTable.lineCount()-1,\"State\",aColor);
-      } else if (g_alarmscopy[\"STATUS\"][j] == ACK  && choice == \"Old\") {
-        string dp = navFunct_TempToObs(substr(g_alarmscopy[\"DPNAME\"][j],0,strpos(g_alarmscopy[\"DPNAME\"][j],\".status.state\")));
-        alarmTable.appendLine(\"Time\",g_alarmscopy[\"TIME\"][j],\"Datapoint\",dp,
-                              \"Message\",g_alarmscopy[\"MESSAGE\"][j],
-                              \"Status\",getAlarmStatus(g_alarmscopy[\"STATUS\"][j]),
-                              \"State\",g_alarmscopy[\"STATE\"][j]);
-
-        string aColor=getStateColor(g_alarmscopy[\"STATE\"][j]);
-        alarmTable.cellBackColRC(alarmTable.lineCount()-1,\"State\",aColor);
-      }
-    } 
-  } else {
-    LOG_WARN(\"alarms.pnl:redraw_table|g_alarms len still < 1, so not possible to check alarms\");
-  }    
-}
-
-void acknowledgeAlarm(int iPos,string dp,string message,bool save) {
-  // new state
-  int state;
-  if (g_alarms_copy[ \"STATE\" ][iPos] == SUSPICIOUS_CAME ||
-      g_alarms_copy[ \"STATE\" ][iPos] == SUSPICIOUS_WENT) {
-    state = SUSPICIOUS;
-  } else if (g_alarms_copy[ \"STATE\" ][iPos] == BROKEN_CAME ||
-      g_alarms_copy[ \"STATE\" ][iPos] == BROKEN_WENT) {
-    state = BROKEN;
-  }
-      
-  // check if the old state in the database is allready lower then the one in the global list.
-  // in that case we need to keep the DB state, since the state could have been changed b4 the ack was done.
-  // and the complete alarm can be removed from the global.
-  int dpState=0;
-  bool changed = false;
-  if (dpExists(dp)) {
-    dpGet(dp,dpState);
-    
-    // if state = beyond repair  dont change
-    if (dpState == BEYOND_REPAIR) {
-      return;
-    }
-    
-    if (dpState < state) {
-      needsSave=true;
-      dynRemove(g_alarms_copy[\"DPNAME\" ],iPos);
-      dynRemove(g_alarms_copy[\"TIME\"   ],iPos);
-      dynRemove(g_alarms_copy[\"STATE\"  ],iPos);
-      dynRemove(g_alarms_copy[\"MESSAGE\"],iPos);
-      dynRemove(g_alarms_copy[\"STATUS\" ],iPos);
-    } else {
-     
-      // now we determined the new status and state we need to write it in the databasepoint
-      // to trigger the complete chain again. ofcourse this needs to be done on the right database, so we get the
-      // systemname from the dp first.
-    
-      string sys = dpSubStr(dp,DPSUB_SYS);
-      if (dpExists(sys+\"__navObjectState\")) {
-        dpSet(sys+\"__navObjectState.DPName\",dp,
-              sys+\"__navObjectState.stateNr\",state,
-              sys+\"__navObjectState.message\",message,
-              sys+\"__navObjectState.force\",true);
-      }
-    }    
-  } else {
-    LOG_WARN(\"navigator_alerts.pnl:RightMouseClick|dp is not existing\");    
-  }
-
-  // need to check if save and needssave is true to deal with last element is faulty and the database does need to be saved
-  if (save && needsSave) {
-    saveAlarms();
-  }
-}
-
-private void saveAlarms() {
-  // rewrite database  
-  if (dpExists(DPNAME_NAVIGATOR + \".alarms\")) {
-    LOG_DEBUG(\"navigator_alerts.pnl:RightMouseClick|Storing the alarms in db\");
-    setAlarms(DPNAME_NAVIGATOR + \".alarms\",
-              g_alarms_copy[ \"TIME\"],g_alarms_copy[ \"DPNAME\"   ],g_alarms_copy[ \"MESSAGE\"  ],g_alarms_copy[ \"STATE\"    ],g_alarms_copy[ \"STATUS\"   ]);
-    needsSave=false;
-  } else {
-    LOG_ERROR(\"navigator_alerts.pnl:RightMouseClick|Couldn't write alarms to navigator\");
-  }
-  // trigger reread for monitorAlarmCtrl
-  if (dpExists(DPNAME_NAVIGATOR + \".alarms.rereadAlarms\")) {
-    LOG_DEBUG(\"navigator_alerts.pnl:RightMouseClick|trigger monitorAlarms\");
-    dpSet(DPNAME_NAVIGATOR + \".alarms.rereadAlarms\",true);
-  } else {
-    LOG_ERROR(\"navigator_alerts.pnl:RightMouseClick|Couldn't write alarms.rereadAlarms\");
-  }
-}
-
-void acknowledge(string what) {
-  
-  g_alarms_copy = g_alarms;
-
-  dyn_int ackList;
-  for (int iPos=1; iPos<=dynlen(g_alarms_copy[\"DPNAME\"])  ; iPos++) {
-  
-    switch(what) {
-      case (\"alarmall\") : {
-        if ((g_alarms_copy[ \"STATE\" ][iPos] == BROKEN_CAME ||
-            g_alarms_copy[ \"STATE\" ][iPos] == BROKEN_WENT) &&
-            g_alarms_copy[\"STATUS\"][iPos] != ACK ) {
-          dynAppend(ackList,iPos);
-        }
-        break;
-      }
-      case (\"alarmcame\") : {
-        if (g_alarms_copy[ \"STATE\" ][iPos] == BROKEN_CAME &&
-            g_alarms_copy[\"STATUS\"][iPos] != ACK ) {
-          dynAppend(ackList,iPos);
-        }
-        break;
-      }
-      case (\"alarmwent\") : {
-        if (g_alarms_copy[ \"STATE\" ][iPos] == BROKEN_WENT &&
-            g_alarms_copy[\"STATUS\"][iPos] != ACK ) {
-          dynAppend(ackList,iPos);
-        }
-        break;
-      }
-      case (\"suspall\") : {
-        if ((g_alarms_copy[ \"STATE\" ][iPos] == SUSPICIOUS_CAME ||
-            g_alarms_copy[ \"STATE\" ][iPos] == SUSPICIOUS_WENT) &&
-            g_alarms_copy[\"STATUS\"][iPos] != ACK ) {
-          dynAppend(ackList,iPos);
-        }
-        break;
-      }
-      case (\"suspcame\") : {
-        if (g_alarms_copy[ \"STATE\" ][iPos] == SUSPICIOUS_CAME &&
-            g_alarms_copy[\"STATUS\"][iPos] != ACK ) {
-          dynAppend(ackList,iPos);
-        }
-        break;
-      }
-      case (\"suspwent\") : {
-        if ( g_alarms_copy[ \"STATE\" ][iPos] == SUSPICIOUS_WENT &&
-            g_alarms_copy[\"STATUS\"][iPos] != ACK ) {
-          dynAppend(ackList,iPos);
-        }
-        break;
-      }
-      case (\"all\") : {
-        if (g_alarms_copy[\"STATUS\"][iPos] != ACK ) {
-          dynAppend(ackList,iPos);
-         }
-        break;
-      }
-      case (\"allcame\") : {
-        if (g_alarms_copy[\"STATUS\"][iPos] == CAME ) {
-          dynAppend(ackList,iPos);
-        }
-        break;
-      }
-      case (\"allwent\") : {
-        if (g_alarms_copy[\"STATUS\"][iPos] == WENT ) {
-          dynAppend(ackList,iPos);
-        }
-        break;
-      }
-      case (\"allstationtest\") : {  
-        if (strpos(g_alarms_copy[\"MESSAGE\"][iPos],\"stationtest\") >= 0 &&
-                   g_alarms_copy[\"STATUS\"][iPos] != ACK ) {
-          dynAppend(ackList,iPos);
-        }
-        break;
-      }
-    }
-  }
-  
-  // loop the list backwards to keep the dyn_list intact and same positions, only trigger the save with the last element.
-  bool save = false;
-  for (int jPos=dynlen(ackList); jPos>0; jPos--) {
-    string dp = g_alarms_copy[\"DPNAME\"][ackList[jPos]];
-    string message = g_alarms_copy[\"MESSAGE\"][ackList[jPos]];
-  if (jPos == 1) save = true;
-    acknowledgeAlarm(ackList[jPos],dp,message,save);    
-  }
-}" 0
- 3
-"CBRef" "1"
-"EClose" E
-"dpi" "96"
-0 0 0
-""
-DISPLAY_LAYER, 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
-LAYER, 0 
-1
-LANG:1 0 
-25 1
-"alarmTable"
-""
-1 8.576408888094308 39.41867429788368 E E E 1 E 1 E N "_WindowText" E N "_Window" E E
- "main(int row, string column)
-{
-  rClick(row);
-}" 0
- "main(int row, string column)
-{
-  dblClick(row);
-}" 0
-
-2 0 0 0 0 0
-E E E
-0
-1
-LANG:1 0 
-
-0
-1
-LANG:1 32 Arial Black,-1,11,5,50,0,0,0,0,0
-0  -2 28 1132 772
-"main()
-{
-  this.tableMode(TABLE_SELECT_MULTIPLE);
-}" 0
-"main(int row, string column, string value)
-{
-  click(row);
-}" 0
- 1 0 1 5 4 "Time" 16 1 0 "s" 1
-LANG:1 4 Time
-E
-1
-LANG:1 28 Time the alarm was triggered
-
-175 "Datapoint" 39 1 0 "s" 1
-LANG:1 9 Datapoint
-E
-1
-LANG:1 34 datapoint that triggered the alarm
-
-400 "Message" 41 1 0 "s" 1
-LANG:1 7 Message
-E
-1
-LANG:1 39 extra AlarmMessage set by the Software 
-
-425 "Status" 6 1 0 "s" 1
-LANG:1 6 Status
-E
-1
-LANG:1 22 Came,went, Acknowledge
-
-75 "State" 3 1 0 "s" 1
-LANG:1 5 State
-E
-1
-LANG:1 11 stateNumber
-
-40 
-20 20 "" 1 1
-LANG:1 2 #1
-"" 1 1
-LANG:1 2 #2
-"" 1 1
-LANG:1 2 #3
-"" 1 1
-LANG:1 2 #4
-10 10
-1
-LANG:1 32 Arial Black,-1,11,5,50,0,0,0,0,0
-0 0 1 1 1 7
-1 0
-26 2
-"CASCADE_BUTTON1"
-""
-1 0 0 E E E 1 E 1 E N "_ButtonText" E N "_Button" E E
- E E
-3 0 0 0 0 0
-E E E
-0
-1
-LANG:1 0 
-
-0
-1
-LANG:1 35 MS Shell Dlg 2,-1,11,5,50,0,0,0,0,0
-0  -2 -2 122 24
- 0 1
-LANG:1 11 Acknowledge
-"" 0 0 0 0 0
- 7 0 1
-LANG:1 5 Alarm
-"5" 0 0 0 0 0
- 3 1 1
-LANG:1 3 All
-"7" 0 0 0 0 0
- 1 1
-LANG:1 4 Came
-"8" 0 0 0 0 0
- 1 1
-LANG:1 4 Went
-"9" 0 0 0 0 0
- 0 1
-LANG:1 10 Suspicious
-"6" 0 0 0 0 0
- 3 1 1
-LANG:1 3 All
-"10" 0 0 0 0 0
- 1 1
-LANG:1 4 Came
-"11" 0 0 0 0 0
- 1 1
-LANG:1 4 Went
-"12" 0 0 0 0 0
- 0 1
-LANG:1 8 Specials
-"4" 0 0 0 0 0
- 1 1 1
-LANG:1 18 stationtest alarms
-"16" 0 0 0 0 0
- 1 1
-LANG:1 3 ___
-"26" 0 0 0 0 0
- 1 1
-LANG:1 3 All
-"13" 0 0 0 0 0
- 1 1
-LANG:1 8 All Came
-"14" 0 0 0 0 0
- 1 1
-LANG:1 8 All Went
-"15" 0 0 0 0 0
- E "main(string id)
-{
-  if (id == 7) {
-    acknowledge(\"alarmall\");
-  } else if (id == 8) {
-    acknowledge(\"alarmcame\");
-  } else if (id == 9) {
-    acknowledge(\"alarmwent\");
-  } else if (id == 10) {
-    acknowledge(\"suspall\");
-  } else if (id == 11) {
-    acknowledge(\"suspcame\");
-  } else if (id == 12) {
-    acknowledge(\"suspwent\");
-  } else if (id == 13) {
-    acknowledge(\"all\");
-  } else if (id == 14) {
-    acknowledge(\"allcame\");
-  } else if (id == 15) {
-    acknowledge(\"allwent\");
-  } else if (id == 16) {
-    acknowledge(\"allstationtest\");
-  }
-}" 0
-0 
-0
-LAYER, 1 
-1
-LANG:1 0 
-0
-LAYER, 2 
-1
-LANG:1 0 
-0
-LAYER, 3 
-1
-LANG:1 0 
-0
-LAYER, 4 
-1
-LANG:1 0 
-0
-LAYER, 5 
-1
-LANG:1 0 
-0
-LAYER, 6 
-1
-LANG:1 0 
-0
-LAYER, 7 
-1
-LANG:1 0 
-0
-0
diff --git a/MAC/Navigator2/panels/objects/Alerts/alarmsWinCCOA.pnl b/MAC/Navigator2/panels/objects/Alerts/alarmsWinCCOA.pnl
index 30cdd592f70beb43c27c43d1e52285df82296bbe..62b404d1b9b3154d7ff1edfb46dbbe1cc6fca67d 100644
--- a/MAC/Navigator2/panels/objects/Alerts/alarmsWinCCOA.pnl
+++ b/MAC/Navigator2/panels/objects/Alerts/alarmsWinCCOA.pnl
@@ -1,8 +1,13 @@
 V 13
 1
 LANG:1 0 
-PANEL,-1 -1 1078 735 N "_3DFace" 0
-E E E E E 1 -1 -1 0  -350 1100
+PANEL,-1 -1 1078 729 N "_3DFace" 0
+"main()
+{
+    // DebugN(\"loading winCCOA alarms\");
+
+}" 0
+ E E E E 1 -1 -1 0  -350 1100
 ""0  1
 E E 3
 "CBRef" "1"
@@ -14,9 +19,43 @@ DISPLAY_LAYER, 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
 LAYER, 0 
 1
 LANG:1 0 
-1 1 0 "" 26
+1 19 0 "" 26
 0
+29 17
+"BackgroundCover_ewo1"
+""
+1 360 680 E E E 1 E 1 E N "_3DText" E N "_3DFace" E E
+ E E
+0 0 0 0 0 0
+E E E
+0
+1
+LANG:1 0 
+
+0
+1
+LANG:1 35 MS Shell Dlg 2,-1,11,5,50,0,0,0,0,0
+0  360 680 710 720
+19 BackgroundCover.ewo
+0
+E29 18
+"BackgroundCover_ewo2"
+""
+1 10 675 E E E 1 E 1 E N "_3DText" E N "_Transparent" E E
+ E E
+1 0 0 0 0 0
+E E E
+0
+1
+LANG:1 0 
+
+0
+1
+LANG:1 35 MS Shell Dlg 2,-1,11,5,50,0,0,0,0,0
+0  10 675 165 720
+19 BackgroundCover.ewo
 0
+E0
 LAYER, 1 
 1
 LANG:1 0 
@@ -49,7 +88,7 @@ LANG:1 0
 "" ""
 "vision/aes/AEScreen.pnl" -350 1100 T 0 1 0 1 410 130
 3
-"$ACTION"""
+"$ACTION""1"
 "$FILENAME"""
-"$SCREENTYPE"""
+"$SCREENTYPE""aes_alerts_LOFAR"
 0
diff --git a/MAC/Navigator2/panels/objects/Hardware/Station_HBA.pnl b/MAC/Navigator2/panels/objects/Hardware/Station_HBA.pnl
index 348f95226c47d33a8c6c2f8b44e3476c1d840e5b..16527745c78e598336173acb1376bd8001063c91 100644
--- a/MAC/Navigator2/panels/objects/Hardware/Station_HBA.pnl
+++ b/MAC/Navigator2/panels/objects/Hardware/Station_HBA.pnl
@@ -1,4 +1,4 @@
-V 11
+V 13
 3
 LANG:1 4 aHBA
 LANG:6 0 
@@ -63,11 +63,12 @@ PANEL,-1 -1 241 145 N "_3DFace" 5
   strToolTip += \"<br> -> RCU\" + curXRCU + \" && RCU\" + curYRCU;
   strToolTip += \"<br>---------\";
   strToolTip += \"<br> (HBA\" + extrazero+curHBA + \")\";
-
-  strToolTip += \"<br> diff from centerOL:\" + $aX;
-  strToolTip += \"<br> diff from centerNB:\" + $aY;
-  strToolTip += \"<br> diff from centerH:\"  + $aZ;
-    
+  if ($aX != -1 || $aY != -1 || $aZ != -1) {
+    strToolTip += \"<br> diff from centerOL:\" + $aX;
+    strToolTip += \"<br> diff from centerNB:\" + $aY;
+    strToolTip += \"<br> diff from centerH:\"  + $aZ;
+  }
+  
   antennaHighlight.toolTipText  = strToolTip;
   aNr.toolTipText   = strToolTip;
   HBA.toolTipText  = strToolTip;
@@ -205,9 +206,11 @@ void dblClick() {
 void rClick() {
   navPanel_statePopup(baseDP);
 }" 0
- 2
+ 3
 "CBRef" "1"
 "EClose" E
+"dpi" "96"
+0 0 0
 ""
 DISPLAY_LAYER, 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
 LAYER, 0 
@@ -234,8 +237,9 @@ LANG:1 0
 LANG:6 0 
 LANG:30 0 
 
-1
+2
 "dashclr"N "_Transparent"
+"antiAliased" "0"
 E "main()
 {
   click();
@@ -262,8 +266,9 @@ LANG:1 0
 LANG:6 0 
 LANG:30 0 
 
-1
+2
 "dashclr"N "_Transparent"
+"antiAliased" "0"
 E "main()
 {
   click();
@@ -288,8 +293,9 @@ E E E
 1
 LANG:1 0 
 
-1
+2
 "dashclr"N "_Transparent"
+"antiAliased" "0"
 E "main()
 {
   click();
@@ -314,8 +320,9 @@ E E E
 1
 LANG:1 0 
 
-1
+2
 "dashclr"N "_Transparent"
+"antiAliased" "0"
 "main()
 {
     dpConnect( \"StationCallback\",true,DPNAME_NAVIGATOR + g_navigatorID +\".objectTrigger\" );
@@ -357,8 +364,9 @@ E E E
 1
 LANG:1 0 
 
-1
+2
 "dashclr"N "_Transparent"
+"antiAliased" "0"
 E "main()
 {
   click();
@@ -385,8 +393,10 @@ LANG:1 0
 LANG:6 0 
 LANG:30 0 
 
-1
+3
+"sizePolicy" "Fixed Fixed"
 "dashclr"N "_Transparent"
+"antiAliased" "0"
 "main()
 {
   aNr.text = $aNr;
@@ -395,7 +405,7 @@ LANG:30 0
 {
   click();
 }" 0
- 0 1 1 0 1 E U  0 E 13 11 27 27
+ 0 1 1 0 1 E U  0 E 13 11 27 26
 0 2 0 "0s" 0 0 0 193 0 0  20 11 1
 3
 LANG:1 26 Arial,-1,13,5,69,0,0,0,0,0
diff --git a/MAC/Navigator2/panels/objects/Hardware/Station_LBA.pnl b/MAC/Navigator2/panels/objects/Hardware/Station_LBA.pnl
index e45e14c7f8997e75d784ef845e186ef566b23466..3e9bbfca3f94ed5b704fec4358e42b692998b81d 100644
--- a/MAC/Navigator2/panels/objects/Hardware/Station_LBA.pnl
+++ b/MAC/Navigator2/panels/objects/Hardware/Station_LBA.pnl
@@ -1,4 +1,4 @@
-V 11
+V 13
 3
 LANG:1 4 aLBA
 LANG:6 0 
@@ -65,11 +65,12 @@ PANEL,-1 -1 212 145 N "_3DFace" 5
   strToolTip += \"<br> -> RCU\" + curXRCU + \" && RCU\" + curYRCU;
   strToolTip += \"<br>---------\";
   strToolTip += \"<br> (LBA\" + extrazero+curLBA + \")\";
-
-  strToolTip += \"<br> diff from centerOL:\" + $aX;
-  strToolTip += \"<br> diff from centerNB:\" + $aY;
-  strToolTip += \"<br> diff from centerH:\"  + $aZ;
-    
+  
+  if ($aX != -1 || $aY != -1 || $aZ != -1) {
+    strToolTip += \"<br> diff from centerOL:\" + $aX;
+    strToolTip += \"<br> diff from centerNB:\" + $aY;
+    strToolTip += \"<br> diff from centerH:\"  + $aZ;
+  }    
   antennaHighlight.toolTipText  = strToolTip;
   aNr.toolTipText   = strToolTip;
   LBA.toolTipText  = strToolTip;
@@ -198,9 +199,11 @@ void rClick() {
     navPanel_statePopup(antennaDP);
 //    navPanel_statePopup(\"LOFAR_PIC_HBA\"+extrazero+curLBA);
 }" 0
- 2
+ 3
 "CBRef" "1"
 "EClose" E
+"dpi" "96"
+0 0 0
 ""
 DISPLAY_LAYER, 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
 LAYER, 0 
@@ -227,8 +230,9 @@ LANG:1 0
 LANG:6 0 
 LANG:30 0 
 
-1
+2
 "dashclr"N "_Transparent"
+"antiAliased" "0"
 E "main()
 {
   click();
@@ -255,8 +259,9 @@ LANG:1 0
 LANG:6 0 
 LANG:30 0 
 
-1
+2
 "dashclr"N "_Transparent"
+"antiAliased" "0"
 E "main()
 {
   click();
@@ -281,8 +286,9 @@ E E E
 1
 LANG:1 0 
 
-1
+2
 "dashclr"N "_Transparent"
+"antiAliased" "0"
 "main()
 {
     dpConnect( \"StationCallback\",true,DPNAME_NAVIGATOR + g_navigatorID +\".objectTrigger\" );
@@ -322,8 +328,9 @@ LANG:1 0
 LANG:6 0 
 LANG:30 0 
 
-1
+2
 "dashclr"N "_Transparent"
+"antiAliased" "0"
 E "main()
 {
     click();
@@ -348,8 +355,9 @@ E E E
 1
 LANG:1 0 
 
-1
+2
 "dashclr"N "_Transparent"
+"antiAliased" "0"
 E "main()
 {
   click();
@@ -376,8 +384,10 @@ LANG:1 0
 LANG:6 0 
 LANG:30 0 
 
-1
+3
+"sizePolicy" "Fixed Fixed"
 "dashclr"N "_Transparent"
+"antiAliased" "0"
 "main()
 {
   aNr.text = $aNr;
@@ -386,7 +396,7 @@ LANG:30 0
 {
   click();
 }" 0
- 0 1 1 0 1 E U  0 E 12 11 26 27
+ 0 1 1 0 1 E U  0 E 12 11 26 26
 0 2 0 "0s" 0 0 0 193 0 0  19 11 1
 3
 LANG:1 26 Arial,-1,13,5,69,0,0,0,0,0
diff --git a/MAC/Navigator2/panels/objects/Hardware/observationFlow_stations.pnl b/MAC/Navigator2/panels/objects/Hardware/observationFlow_stations.pnl
index 8aa7f77e09a44a0b8e9e02e7b6e4fc0af51a830a..7b9acb55fd4b37b41942fd90943afef5b6a958af 100644
--- a/MAC/Navigator2/panels/objects/Hardware/observationFlow_stations.pnl
+++ b/MAC/Navigator2/panels/objects/Hardware/observationFlow_stations.pnl
@@ -1,4 +1,4 @@
-V 11
+V 13
 1
 LANG:1 16 childStateBorder
 PANEL,-1 -1 169 91 N "_3DFace" 0
@@ -191,6 +191,7 @@ void updateStationStates(dyn_string dps,dyn_string values) {
   dyn_string testList;
   dyn_string suspiciousList;
   dyn_string errorList;
+  dyn_string beyondRepairList;
   dyn_string offlineList;
   
   for (int i= 1; i<= dynlen(dps); i++) {
@@ -199,9 +200,12 @@ void updateStationStates(dyn_string dps,dyn_string values) {
       int val = values[i];
       if ( val > highestState) highestState=val;
       string station = dpSubStr(dps[i],DPSUB_SYS);
-      if (val >= 60) 
+      if (val >= 70) 
       {
         dynAppend(offlineList,navFunct_bareDBName(station));
+      }       else if (val >= 60) 
+      {
+        dynAppend(beyondRepairList,navFunct_bareDBName(station));
       } 
       else if (val >= 50)
       {
@@ -224,11 +228,13 @@ void updateStationStates(dyn_string dps,dyn_string values) {
     
   }
   dynSort(offlineList);
+  dynSort(beyondRepairList);
   dynSort(errorList);
   dynSort(suspiciousList);
   dynSort(testList);
   dynSort(maintenanceList);
   dynUnique(offlineList);
+  dynUnique(beyondRepairList);
   dynUnique(errorList);
   dynUnique(suspiciousList);
   dynUnique(testList);
@@ -256,6 +262,11 @@ void updateStationStates(dyn_string dps,dyn_string values) {
     if (i == 1) toolTipText += \"Error: <br>\";
     toolTipText += errorList[i] + \"<br>\";
   }
+  for (int i = 1; i <= dynlen(beyondRepairList);i++)
+  {
+    if (i == 1) toolTipText += \"Stations beyond repair: <br>\";
+    toolTipText += beyondRepairList[i] + \"<br>\";
+  }
   for (int i = 1; i <= dynlen(offlineList);i++)
   {
     if (i == 1) toolTipText += \"Stations offline: <br>\";
@@ -278,9 +289,11 @@ void setStates(int state, int childState) {
    SymbolCol = getStateColor(state);
    setValue(\"childStateBorder\", \"backCol\", SymbolCol);
 }" 0
- 2
+ 3
 "CBRef" "1"
 "EClose" E
+"dpi" "96"
+0 0 0
 ""
 DISPLAY_LAYER, 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
 LAYER, 0 
@@ -305,8 +318,9 @@ E E E
 1
 LANG:1 69 All stations involved in the  currently(selected) active observations
 
-1
+2
 "dashclr"N "_Transparent"
+"antiAliased" "0"
 "main()
 {
   dpConnect( \"observationsCallback\",true,DPNAME_NAVIGATOR + g_navigatorID +\".objectTrigger\" );
@@ -353,16 +367,18 @@ E E E
 1
 LANG:1 0 
 
-1
+3
+"sizePolicy" "Fixed Fixed"
 "dashclr"N "_Transparent"
+"antiAliased" "0"
 E "main()
 {
   click();
 }" 0
- 0 1 1 2 1 E U  0 E 50 30 89 43
+ 0 1 1 2 1 E U  0 E 50 30 91 42
 0 2 2 "0s" 0 0 0 192 0 0  50 30 1
 1
-LANG:1 37 MS Shell Dlg 2,8.25,-1,5,50,0,0,0,0,0
+LANG:1 35 MS Shell Dlg 2,-1,11,5,50,0,0,0,0,0
 0 1
 LANG:1 8 Stations
 0
diff --git a/MAC/Navigator2/panels/objects/Hardware/powerUnit_small.pnl b/MAC/Navigator2/panels/objects/Hardware/powerUnit_small.pnl
index 2395c38c041cbf787a01b8518cdf94abc1a87635..fe10be5a84d1c71a0e36399a5bc2616ed661bfec 100644
--- a/MAC/Navigator2/panels/objects/Hardware/powerUnit_small.pnl
+++ b/MAC/Navigator2/panels/objects/Hardware/powerUnit_small.pnl
@@ -96,7 +96,7 @@ void updatePowec(string dp1, bool invalid,
     
       // new ACX type controllers have 0=ok 1=error
       // DPT has to be extended with powerSystemType so we can be more flexible with the next check
-      if (db == \"PL610:\" || db == \"PL611:\" || db == \"PL612:\") module_ok = 0;
+      if (db == \"PL610:\" || db == \"PL611:\" || db == \"PL612:\" || db == \"IE613:\") module_ok = 0;
     
       for (int i = 1; i <= nrOfModules; i++)
       {
@@ -181,7 +181,7 @@ void update2Powecs(string dp1, bool invalid1,
     
     // new ACX type controllers have 0=ok 1=error
     // DPT has to be extended with powerSystemType so we can be more flexible with the next check
-    if (db == \"PL610:\" || db == \"PL611:\" || db == \"PL612:\") module_ok = 0;
+    if (db == \"PL610:\" || db == \"PL611:\" || db == \"PL612:\" || db == \"IE613:\") module_ok = 0;
         
     for (int i = 1; i <= nrOfModules1; i++)
     {
diff --git a/MAC/Navigator2/panels/objects/STD_PANELS/AESRow.pnl b/MAC/Navigator2/panels/objects/STD_PANELS/AESRow.pnl
new file mode 100644
index 0000000000000000000000000000000000000000..c71c15ccf49cfe340e469daf83fb582d58f7e508
--- /dev/null
+++ b/MAC/Navigator2/panels/objects/STD_PANELS/AESRow.pnl
@@ -0,0 +1,58 @@
+V 13
+4
+LANG:1 8 (NoName)
+LANG:10000 8 (NoName)
+LANG:10001 8 (NoName)
+LANG:10027 18 (БезИмени)
+PANEL,-1 -1 1086 89 N "_3DFace" 1
+"$AESREGDOLLAR_SCREENTYPE"
+E E E E E 1 -1 -1 0  -1 -1
+"objects_parampanels/STD_PANELS/AS_ES_Conf_para.pnl"0  1
+E E 3
+"CBRef" "1"
+"EClose" E
+"dpi" "96"
+0 0 0
+""
+NC
+DISPLAY_LAYER, 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
+LAYER, 0 
+1
+LANG:1 6 Layer1
+1 1 0 "" 18
+0
+0
+LAYER, 1 
+1
+LANG:1 6 Layer2
+0
+LAYER, 2 
+1
+LANG:1 6 Layer3
+0
+LAYER, 3 
+1
+LANG:1 6 Layer4
+0
+LAYER, 4 
+1
+LANG:1 6 Layer5
+0
+LAYER, 5 
+1
+LANG:1 6 Layer6
+0
+LAYER, 6 
+1
+LANG:1 6 Layer7
+0
+LAYER, 7 
+1
+LANG:1 6 Layer8
+0
+3 0 "" -1
+"" ""
+"vision/aes/AESRow.pnl" 5 15 T 1 1 0 1 63 1235
+1
+"$SCREENTYPE""$AESREGDOLLAR_SCREENTYPE"
+0
diff --git a/MAC/Navigator2/panels/objects/aesRow_Navigator.pnl b/MAC/Navigator2/panels/objects/aesRow_Navigator.pnl
new file mode 100644
index 0000000000000000000000000000000000000000..e5b3022f459fb4fca1bd2ecb1952eacada89302f
--- /dev/null
+++ b/MAC/Navigator2/panels/objects/aesRow_Navigator.pnl
@@ -0,0 +1,178 @@
+V 13
+1
+LANG:1 0 
+PANEL,-1 -1 1213 156 N "_3DFace" 1
+"$name"
+"main() {
+  
+  //delay while navigator instance is being prepared, shouldn't be needed, but this way we at least have a trigger when something goes wrong
+  int retry=0;
+  while (navigator_initializing() & retry < 120) {
+    delay(0,100);
+    retry++;
+    if (retry >= 120) {
+      LOG_FATAL(\"navigator_alerts.pnl:initialize|alarmTable retry longer then 4 minutes, navigatorInstance still not ready?\");
+      break;
+    }
+  }
+  
+  // Check if Action point exists and connect to it if
+  // it does. The action Point is the call back for this object
+  itsActionDp    = DPNAME_NAVIGATOR + g_navigatorID + \".\"+$name+\".action\";
+  itsEventDp     = DPNAME_NAVIGATOR + g_navigatorID + \".\"+$name+\".event\";
+  itsSelectionDp = DPNAME_NAVIGATOR + g_navigatorID + \".\"+$name+\".selection\";
+
+  if ( dpExists(itsActionDp) ) {
+    dpConnect(\"doAction\",false,itsActionDp);
+    ALERTSACTIONDP=itsActionDp;
+  }      
+}
+
+void initialize() {
+//  if (dpExists(DPNAME_NAVIGATOR + g_navigatorID+\".alarmsTrigger\")) {
+//    dpConnect(\"alarmTrigger\",true,DPNAME_NAVIGATOR + g_navigatorID+\".alarmsTrigger\");
+//  } else {
+//    LOG_ERROR(\"navigator_alerts.pnl:initialize|Error connecting to alarmsTriggerpoint in navigator Instance.\");
+//  }
+}
+
+//void alarmTrigger(string dp1, bool T) {
+//  LOG_TRACE(\"navigator_alerts.pnl:initialize|alarmTrigger received.\");
+//  redraw_table();
+//}
+
+//
+// Callback for dpConnect to action point.
+// If there is an action required this point will tell so
+//
+void doAction(string aDP, string anAction) {
+
+  LOG_TRACE(\"navigator_alerts.pnl:doAction|Action found:\" + anAction);
+  
+  // split action into essentials
+  dyn_string actionString;
+  if (!navFunct_splitAction(anAction,actionString)) {
+    return;
+  }
+  
+  LOG_DEBUG(\"navigator_alerts.pnl:doAction|found actionString: \" + actionString);
+  // ChangeSelection requires 1 param and will change itsSelection and calls initTable again
+  if (actionString[1] == \"Initialize\") {
+    initialize();
+    return;
+  }
+}" 0
+ E E E E 1 -1 -1 0  27 42
+""0  1
+E "#uses \"navigator.ctl\"
+
+//Global mainpoint holders
+string 			itsActionDp	= \"\";
+string 			itsEventDp      = \"\";
+dyn_string 	itsSelectionDp  = \"\";
+
+bool   bDoubleClicked  = false;
+
+// routine for single mouse click
+void click(int row) {
+    // set delay in case double click was meant
+  delay(0, 100); 
+  if (!bDoubleClicked) {
+  }
+}
+
+
+// routine for double mouse click
+void dblClick(string dp) 
+{  
+  // indicate this is a doubleClick
+  bDoubleClicked = true; 
+  string selection=\"\";
+  
+  LOG_TRACE(\"navigator_alerts.pnl:DoubleClicked|doubleClick received on alarmtable dp:\" + dp);
+ 
+
+  if (dpExists(dp) ) {
+    g_currentDatapoint=dp;
+    if (strpos(dp,\"LOFAR_PIC\") >= 0) {
+        selection=\"Hardware\";
+    } else if (strpos(dp,\"LOFAR_ObsSW\") >= 0) {
+      if (strpos(dp,\"Ctrl\") >= 0) {
+        selection=\"Processes\";
+      } else {
+        selection=\"Observations\";
+      }
+    } else if (strpos(dp,\"LOFAR_PermSW\") >= 0) {
+      selection=\"Processes\";
+    }
+    setEvent(selection,\"ChangeTab\");
+  }
+  
+  // set delay to avoid click event will be triggered
+  delay(0, 500);
+  bDoubleClicked = false;  
+}
+
+
+
+// routine for right mouse click
+void rClick(int row) {
+  LOG_TRACE(\"navigator_alerts.pnl:RightMouseClick|Right mouseclick received on alarmtable row: \" + row);  
+}
+" 0
+ 3
+"CBRef" "1"
+"EClose" E
+"dpi" "96"
+0 0 0
+""
+DISPLAY_LAYER, 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
+LAYER, 0 
+1
+LANG:1 0 
+1 1 0 "0" 18
+0
+1 15 0 "0" 1
+18 "font" 0 0 4
+LANG:1 26 Arial,-1,11,5,50,0,0,0,0,0
+LANG:10000 26 Arial,-1,13,5,40,0,0,0,0,0
+LANG:10001 26 Arial,-1,13,5,40,0,0,0,0,0
+LANG:10027 26 Arial,-1,13,5,40,0,0,0,0,0
+0 
+31 "transform" 0 0 1 0 3.659309225032019 -21.00000000000001 -105.8992442768891
+0
+0
+LAYER, 1 
+1
+LANG:1 0 
+0
+LAYER, 2 
+1
+LANG:1 0 
+0
+LAYER, 3 
+1
+LANG:1 0 
+0
+LAYER, 4 
+1
+LANG:1 0 
+0
+LAYER, 5 
+1
+LANG:1 0 
+0
+LAYER, 6 
+1
+LANG:1 0 
+0
+LAYER, 7 
+1
+LANG:1 0 
+0
+3 0 "PANEL_REF0" -1
+"" ""
+"objects/STD_PANELS/AESRow.pnl" 10 0 T 0 1 0 1 0 -1.776356839400251e-015
+1
+"$AESREGDOLLAR_SCREENTYPE""aes_alertRow_Navigator"
+0
diff --git a/MAC/Navigator2/panels/objects/navigator_alerts.pnl b/MAC/Navigator2/panels/objects/navigator_alerts.pnl
index 32adfa92ed4fdbab4dc25e455b3ea5b58d6dec0d..0b36e05372a822c0fdecd558940f0df2bd3cf31d 100644
--- a/MAC/Navigator2/panels/objects/navigator_alerts.pnl
+++ b/MAC/Navigator2/panels/objects/navigator_alerts.pnl
@@ -1,17 +1,17 @@
-V 11
+V 13
 1
 LANG:1 0 
-PANEL,-1 -1 1200 138 N "_3DFace" 1
+PANEL,-1 -1 1213 163 N "_3DFace" 1
 "$name"
 "main() {
   
   //delay while navigator instance is being prepared, shouldn't be needed, but this way we at least have a trigger when something goes wrong
   int retry=0;
-  while (navigator_initializing() & retry < 60) {
+  while (navigator_initializing() & retry < 120) {
     delay(0,100);
     retry++;
-    if (retry >= 60) {
-      LOG_FATAL(\"navigator_alerts.pnl:initialize|alarmTable retry longer then 2 minutes, navigatorInstance still not ready?\");
+    if (retry >= 120) {
+      LOG_FATAL(\"navigator_alerts.pnl:initialize|alarmTable retry longer then 4 minutes, navigatorInstance still not ready?\");
       break;
     }
   }
@@ -29,17 +29,17 @@ PANEL,-1 -1 1200 138 N "_3DFace" 1
 }
 
 void initialize() {
-  if (dpExists(DPNAME_NAVIGATOR + g_navigatorID+\".alarmsTrigger\")) {
-    dpConnect(\"alarmTrigger\",true,DPNAME_NAVIGATOR + g_navigatorID+\".alarmsTrigger\");
-  } else {
-    LOG_ERROR(\"navigator_alerts.pnl:initialize|Error connecting to alarmsTriggerpoint in navigator Instance.\");
-  }
+//  if (dpExists(DPNAME_NAVIGATOR + g_navigatorID+\".alarmsTrigger\")) {
+//    dpConnect(\"alarmTrigger\",true,DPNAME_NAVIGATOR + g_navigatorID+\".alarmsTrigger\");
+//  } else {
+//    LOG_ERROR(\"navigator_alerts.pnl:initialize|Error connecting to alarmsTriggerpoint in navigator Instance.\");
+//  }
 }
 
-void alarmTrigger(string dp1, bool T) {
-  LOG_TRACE(\"navigator_alerts.pnl:initialize|alarmTrigger received.\");
-  redraw_table();
-}
+//void alarmTrigger(string dp1, bool T) {
+//  LOG_TRACE(\"navigator_alerts.pnl:initialize|alarmTrigger received.\");
+//  redraw_table();
+//}
 
 //
 // Callback for dpConnect to action point.
@@ -62,414 +62,149 @@ void doAction(string aDP, string anAction) {
     return;
   }
 }" 0
- E E E E 1 -1 -1 0  0 0
+ E E E E 1 -1 -1 0  27 42
 ""0  1
 E "#uses \"navigator.ctl\"
 
 //Global mainpoint holders
 string 			itsActionDp	= \"\";
 string 			itsEventDp      = \"\";
-dyn_string 	        itsSelectionDp  = \"\";
-
-bool   bDoubleClicked  = false;
-
-// routine for single mouse click
-void click(int row) {
-    // set delay in case double click was meant
-  delay(0, 100); 
-  if (!bDoubleClicked) {
-  }
-}
-
-
-// routine for double mouse click
-void dblClick(int row) {
-  
-  // indicate this is a doubleClick
-  bDoubleClicked = true; 
-  string selection=\"\";
-  
-  LOG_TRACE(\"navigator_alerts.pnl:DoubleClicked|doubleClick received on alarmtable row: \" + row);
-  
-  if (alarmTable.lineCount() < 1) {
-    bDoubleClicked = false;  
-    return;
-  }
-  dyn_anytype result = alarmTable.getLineN(row);
-  LOG_DEBUG(\"navigator_alerts.pnl:DoubleClicked|Result: \"+result);
-  string dp = navFunct_ObsToTemp(result[2]);  
-  //we need to strip the . level from the dp 
-  dyn_string aS = strsplit(dp,\".\");
-  
-  dp=aS[1];
- 
-  if (dpExists(dp) ) {
-  g_currentDatapoint=dp;
-/*    // check if the datapoint we want to jump to has viewable panels b4 we jump to it, otherwise try the ones below
-    bool found=true;
-    while (!navFunct_dpHasPanels(dp)) {
-      dp = navFunct_dpStripLastElement(dp);
-      if (dpSubStr(dp,DPSUB_DP)== \"\") {
-        found = false;
-        break;
-      } 
-    }
-    if (found) {
-      g_currentDatapoint=dp;
-      LOG_DEBUG(\"navigator_alerts.pnl:DoubleClick|Setting currentDatapoint from : \"+g_currentDatapoint+\" to \"+dp);
-    }
-*/
-    if (strpos(dp,\"LOFAR_PIC\") >= 0) {
-        selection=\"Hardware\";
-    } else if (strpos(dp,\"LOFAR_ObsSW\") >= 0) {
-      if (strpos(dp,\"Ctrl\") >= 0) {
-        selection=\"Processes\";
-      } else {
-        selection=\"Observations\";
-      }
-    } else if (strpos(dp,\"LOFAR_PermSW\") >= 0) {
-      selection=\"Processes\";
-    }
-    setEvent(selection,\"ChangeTab\");
-  }
-  
-  // set delay to avoid click event will be triggered
-  delay(0, 500);
-  bDoubleClicked = false;  
-}
-
-
-
-// routine for right mouse click
-void rClick(int row) {
-  LOG_TRACE(\"navigator_alerts.pnl:RightMouseClick|Right mouseclick received on alarmtable row: \" + row);
-  
-  if (alarmTable.lineCount() < 1) {
-    return;
-  }
-  dyn_anytype result = alarmTable.getLineN(row);
-  LOG_DEBUG(\"navigator_alerts.pnl:RightMouseClick|Result: \"+result);
-  
-  string dp = navFunct_ObsToTemp(result[2])+\".status.state\";  
-  string message = result[3];
-  time timeStamp = result[1];
-  string state = result[4];
-  int status=-1;
-  if (state == \"ACK\") {
-    status = ACK;
-  } else if (state == \"WENT\") {
-    status = WENT;
-  } else if (state == \"CAME\") {
-    status = CAME;
-  }  
-
-  LOG_DEBUG(\"navigator_alerts.pnl:RightMouseClick|Looking for dp: \"+dp+\" status: \"+status);
- 
-  int iPos=-1;
-
-  //to narrow actions determine if the state is 'acknowledgable'
-  if (status != ACK) {
-
-    // ok rest should be possible to acknowledge
-    // find the entry in the table
-    iPos=dynContains(g_alarms[\"DPNAME\"],dp);  
-  
-    if (iPos < 1) {
-      LOG_ERROR(\"navigator_alerts.pnl:RightMouseClick|Strange, couldn't find chosen entry in alarm global list.\");
-    }
-  }
-  
-  // determine also if there is a http msg in the MESSAGE part if so we also need an open webpage on the rclikc menu
-  int start = strpos(message,\"http://\");
-  string httpStr=\"\";
-  if (start > -1) {
-    string startStr=substr(message,start);
-    int end=strpos(startStr,\" \");
-    httpStr=startStr;
-    if (end > -1){
-      httpStr=substr(startStr,0,end);
-    } 
-  }
-  LOG_DEBUG( \"navigator_alerts.pnl:RightMouseClick|found http msg: \"+httpStr);
-  
-  
-    
-  // define the popupMenu
-  dyn_string txt;
-  int answer;
-  int idx=1;
-  dynInsertAt(txt,\"PUSH_BUTTON, Acknowledge, 1, 1\",idx++);
-
-  if (httpStr != \"\") {
-    dynInsertAt(txt,\"PUSH_BUTTON, Show Webpage, 2, 1\",idx++);
-  }
-  
-  if (dynlen(txt) > 0) {
-    popupMenu(txt,answer);
-  }
-
-  // acknowledge pushed 
-  if (answer == 1) {
-    acknowledgeAlarm(iPos,timeStamp,dp,message,status);
-  } else if (answer == 2) {
-    std_help(httpStr,true);
-  }
-}
-
-
-// *******************************************
-// Name : redraw_table
-// *******************************************
-// Description:
-// redraws the alarm table
-//
-//
-// Returns:
-//    nothing
-// *******************************************
-
-void redraw_table() {
-  // clear table
-  LOG_DEBUG(\"navigator_alerts.pnl:redraw_table|deleting all entries from alarms\");
-  alarmTable.deleteAllLines();
-  if (!mappingHasKey(g_alarms,\"DPNAME\")) {
-    return;
-  }
-  
-  if (g_alarms[\"DPNAME\"] == \"\") return;
-  
-  LOG_DEBUG(\"navigator_alerts.pnl:redraw_table|Nr of alerts in global table: \" + dynlen(g_alarms[\"DPNAME\"]));
-  
-  //append  all CAME alarms
-  if (mappinglen(g_alarms) < 1) return;
-  for (int j=1; j<=dynlen(g_alarms[\"DPNAME\"])  ; j++) {
-    if (g_alarms[\"STATUS\"][j] == CAME ) {
-      string dp = navFunct_TempToObs(substr(g_alarms[\"DPNAME\"][j],0,strpos(g_alarms[\"DPNAME\"][j],\".status.state\")));
-      alarmTable.appendLine(\"Time\",g_alarms[\"TIME\"][j],
-                            \"Datapoint\",dp,
-                            \"Message\",g_alarms[\"MESSAGE\"][j],
-                            \"Status\",getAlarmStatus(g_alarms[\"STATUS\"][j]));
-        string aColor=getStateColor(g_alarms[\"STATE\"][j]);
-        alarmTable.cellBackColRC(alarmTable.lineCount()-1,\"Time\",aColor);
-        alarmTable.cellBackColRC(alarmTable.lineCount()-1,\"Datapoint\",aColor);
-        alarmTable.cellBackColRC(alarmTable.lineCount()-1,\"Message\",aColor);
-        alarmTable.cellBackColRC(alarmTable.lineCount()-1,\"Status\",aColor);
-    }
-  }
-  // set alarm_lineCount
-  nrLines.text(alarmTable.lineCount());
-
-}
-
-void setEvent(dyn_string aSelection,string event) {
-  if (navigator_initializing()) {
-    return;
-  }
-  string anEvent=$name+\"|\"+event;
-  if (dpExists(itsEventDp)) {
-     dpSet(itsEventDp,anEvent);
-  } else {
-    LOG_ERROR(\"navigator_alerts.pnl:setEvent|\"+itsEventDp + \" Does not exist yet\");     
-  }
-  if (dpExists(itsSelectionDp)) {
-    dpSet(itsSelectionDp,aSelection);
-  } else {
-    LOG_ERROR(\"navigator_alerts.pnl:setEvent|\"+itsSelectionDp + \" Does not exist yet\");     
-  }
-}
+dyn_string 	itsSelectionDp  = \"\";
 
-void rewriteAlarms() {
-  // rewrite database  
-  if (dpExists(DPNAME_NAVIGATOR + \".alarms\")) {
-    LOG_DEBUG(\"navigator_alerts.pnl:rewriteAlarms|Storing the alarms in db\");
-    setAlarms(DPNAME_NAVIGATOR + \".alarms\",
-              g_alarms[ \"TIME\"],g_alarms[ \"DPNAME\"   ],g_alarms[ \"MESSAGE\"  ],g_alarms[ \"STATE\"    ],g_alarms[ \"STATUS\"   ]);
-  } else {
-    LOG_ERROR(\"navigator_alerts.pnl:rewriteAlarms|Couldn't write alarms to navigator\");
-  }
-  // trigger reread for monitorAlarmCtrl
-  if (dpExists(DPNAME_NAVIGATOR + \".alarms.rereadAlarms\")) {
-    LOG_DEBUG(\"navigator_alerts.pnl:rewriteAlarms|trigger monitorAlarms\");
-    dpSet(DPNAME_NAVIGATOR + \".alarms.rereadAlarms\",true);
-  } else {
-    LOG_ERROR(\"navigator_alerts.pnl:rewriteAlarms|Couldn't write alarms.rereadAlarms\");
-  }
-}
-
-void acknowledgeAlarm(int iPos,time timeStamp,string dp,string message,int status) {
-  LOG_DEBUG(\"navigator_alerts.pnl:acknowledgeAlarms| entered with:\",iPos,timeStamp,dp, message, status);
-  // if iPos < 1 there was no entry in the globalmap, so we can drop the item since the datapoint was illegal
-  if (iPos < 1) {
-    for (int i=1;i<dynlen(g_alarms[ \"TIME\" ]);i++) {
-      if (g_alarms[ \"TIME\"][i] == timeStamp) {
-        if (g_alarms[ \"MESSAGE\"][i] == message && g_alarms[ \"STATUS\" ][i] == status) {
-          dynRemove(g_alarms[\"DPNAME\" ],i);
-          dynRemove(g_alarms[\"TIME\"   ],i);  
-          dynRemove(g_alarms[\"STATE\"  ],i);
-          dynRemove(g_alarms[\"MESSAGE\"],i);
-          dynRemove(g_alarms[\"STATUS\" ],i);
-          rewriteAlarms();
-          return;      
-        }
-      }
-    }
-    LOG_ERROR(\"navigator_alerts.pnl:ackNowledgeAlarm|No match in g_alarms found\");
-    return;
-  }
-  
-  
-  // new state
-  int state;
-  if (g_alarms[ \"STATE\" ][iPos] == SUSPICIOUS_CAME ||
-      g_alarms[ \"STATE\" ][iPos] == SUSPICIOUS_WENT) {
-    state = SUSPICIOUS;
-  } else if (g_alarms[ \"STATE\" ][iPos] == BROKEN_CAME ||
-      g_alarms[ \"STATE\" ][iPos] == BROKEN_WENT) {
-    state = BROKEN;
-  }
-  
-  // check if the old state in the database is allready lower then the one in the global list.
-  // in that case we need to keep the DB state, since the state could have been changed b4 the ack was done.
-  // and the complete alarm can be removed from the global.
-  int dpState=0;
-  bool changed = false;
-  dpGet(dp,dpState);
-  if (dpState < state && iPos <= dynlen(g_alarms)) {
-    dynRemove(g_alarms[\"DPNAME\" ],iPos);
-    dynRemove(g_alarms[\"TIME\"   ],iPos);
-    dynRemove(g_alarms[\"STATE\"  ],iPos);
-    dynRemove(g_alarms[\"MESSAGE\"],iPos);
-    dynRemove(g_alarms[\"STATUS\" ],iPos);
-    rewriteAlarms();    
-  } else {
-     
-    // now we determined the new status and state we need to write it in the databasepoint
-    // to trigger the complete chain again. ofcourse this needs to be done on the right database, se we get the
-    // systemname from the dp first.
-    
-    string sys = dpSubStr(dp,DPSUB_SYS);
-    if (dpExists(sys+\"__navObjectState\")) {
-      dpSet(sys+\"__navObjectState.DPName\",dp,
-            sys+\"__navObjectState.stateNr\",state,
-            sys+\"__navObjectState.message\",message,
-            sys+\"__navObjectState.force\",true);
-    }    
-  }
-}" 0
- 2
+" 0
+ 3
 "CBRef" "1"
 "EClose" E
+"dpi" "96"
+0 0 0
 ""
 DISPLAY_LAYER, 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
 LAYER, 0 
 1
 LANG:1 0 
-2 9
-"nrLines"
-""
-1 1152 33.33333333333333 E E E 1 E 1 E N "_3DText" E N "_Transparent" E E
- E E
-16 0 0 0 0 0
-E E E
+1 1 0 "0" 18
+31 "transform" 0 0 1 0 1 108 -32.1428571428569
 0
-2
-LANG:1 0 
-LANG:0 0 
-
-1
-"dashclr"N "_Transparent"
-E E 0 1 1 0 1 E U  0 E 1152 33.33333333333333 1193.999999999996 49.33333333333333
-0 2 2 "4d" 4 0 0 64 0 0  1152 33.33333333333333 1
-2
-LANG:1 26 Arial,-1,13,5,75,0,0,0,0,0
-LANG:0 107 -microsoft windows-Arial-normal-r-normal-*-*-120-100-100-*-*-iso8859-1|-13,0,0,0,400,0,0,0,0,3,2,1,34,Arial
-0 2
-LANG:1 1 0
-LANG:0 1 0
-25 11
-"alarmTable"
-""
-1 10 10 E E E 1 E 1 E N "_WindowText" E N "_Window" E E
- "main(int row, string column)
-{
-  rClick(row);
-}" 0
- "main(int row, string column)
-{
-  dblClick(row);
-}" 0
-
-19 0 0 0 0 0
-E E E
+1 2 0 "0" 19
+31 "transform" 0 0 1 0 1 108 -32.1428571428569
 0
-1
-LANG:1 0 
-
+1 3 0 "0" 24
+31 "transform" 0 0 1 0 1 108 -32.1428571428569
 0
-1
-LANG:1 32 Arial Black,-1,11,5,50,0,0,0,0,0
-0  8 8 1122 132
-E"main(int row, string column, string value)
+1 12 0 "0" 21
+31 "transform" 0 0 1 0 1 108 -32.14285714285715
+0
+1 13 0 "0" 22
+31 "transform" 0 0 1 0 1 108 -32.14285714285715
+0
+1 15 0 "0" 1
+1 "rightClick" 1 1 "main(int row, string column)
 {
-  click(row);
-}" 0
- 0 0 1 4 4 "Time" 13 1 0 "s" 1
-LANG:1 4 Time
-E
-1
-LANG:1 28 Time the alarm was triggered
-
-140 "Datapoint" 35 1 0 "s" 1
-LANG:1 9 Datapoint
-E
-1
-LANG:1 34 datapoint that triggered the alarm
+  int i, j;
+  anytype value;
+  mapping mTableMultipleRows;
+  
+  if (row < 0 || column < 0) return;
+  
+  //IM 116642: Trigger table widget once, to avoid timing problems
+  int top, bot;
+  getValue(\"\", \"lineRangeVisible\", top, bot);
+  
+  synchronized(g_bTableLineSynchronisation)
+  { 
+    int length;
+    dyn_anytype alertRow;  
+    
+    getValue( \"\", \"currentCell\", row, column );
+    value=this.cellValue;
 
-361 "Message" 31 1 0 "s" 1
-LANG:1 7 Message
-E
-1
-LANG:1 39 extra AlarmMessage set by the Software 
+    alertRow = this.getLineN(row);
+    length = dynlen(alertRow);
+    
+    for(j=0; j<this.lineCount; j++)
+    {
+      mapping rowHeaderMapping;
+      
+      for(i=1; i<=length; i++)
+        rowHeaderMapping[this.columnName(i-1)] = alertRow[i];
+      
+      mTableMultipleRows[j] = rowHeaderMapping;
+    }
+  }
+  
 
-325 "Status" 9 1 0 "s" 1
-LANG:1 6 Status
-E
-1
-LANG:1 22 Came,went, Acknowledge
+  //DebugTN(\"rClicked this.name,value:\"+this.name+\" \"+value);
+  aes_onRightClick( g_propDpNameTop, AESTAB_TOP, this.name, row, column, value, mTableMultipleRows );
+  //rClick(value);
+}" 0
+ 
+1 "doubleClick" 1 1 "main()
+{
+  int row, column;
+  anytype value;
+  mapping mTableRow;
+  
+  synchronized(g_bTableLineSynchronisation)
+  { 
+    int length;
+    dyn_anytype alertRow;  
+    
+    // determine position 
+    getValue(\"\",\"currentCell\", row, column );
+    value=this.cellValue;
 
-100 
-20 20 "" 1 1
-LANG:1 2 #1
-"" 1 1
-LANG:1 2 #2
-"" 1 1
-LANG:1 2 #3
-"" 1 1
-LANG:1 2 #4
-10 10
-1
-LANG:1 32 Arial Black,-1,11,5,50,0,0,0,0,0
-0 0 1 0 1 7
-1 0
-2 16
-"PRIMITIVE_TEXT1"
-""
-1 1280 -1022.784636488342 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E
- E E
-28 0 0 0 0 0
-E E E
+    alertRow = this.getLineN(row);
+    length = dynlen(alertRow);
+    for(int i=1; i<=length; i++)
+      mTableRow[this.columnName(i-1)] = alertRow[i];
+  }
+ 
+  //if( mappingHasKey( mTableRow, \"elementName\" ) )
+  //{
+  //  DebugTN( __FILE__ + \"(): table double clicked!!\", row, column, \"elementName: \" + mTableRow[\"elementName\"] );   
+  //  dblClick(mTableRow[\"elementName\"]);
+  //}
+}" 0
+ 
+1 "textFieldOut" 1 1 "main(int row, string column, string value)
+{
+  mapping mTableRow;
+  string newValue;
+  synchronized(g_bTableLineSynchronisation)
+  { 
+    int length;
+    dyn_anytype alertRow;  
+    
+    getValue( \"\", \"currentCell\", row, column );
+    newValue=this.cellValue;
+    
+    alertRow = this.getLineN(row);
+    
+    length = dynlen(alertRow);
+    for(int i=1; i<=length; i++)
+      mTableRow[this.columnName(i-1)] = alertRow[i];
+  }
+  DebugTN( \"click !!!!!!!!!!!!!!!!!!   value: \" + newValue );
+  //read pos of visible lines
+  setMultiValue( \"ar_currentLine\", \"text\", row+1); // \"current line\" -indicator is 1 based
+
+//  if( mappingHasKey( mTableRow, \"elementName\" ) )
+//  {
+//    DebugTN( __FILE__ + \"(): table clicked!!\", row, column, \"elementName: \" + mTableRow[\"elementName\"] );   
+//    click(mTableRow[\"elementName\"]);
+//  }
+  aes_doColumnClick( AESTAB_TOP, row, column, value, mTableRow );
+}
+" 0
+ 
+31 "transform" 0 0 1.111074694097082 0 3.504548263617748 -13.49918061718435 -133.0784496083959
+18 "font" 0 0 4
+LANG:1 26 Arial,-1,11,5,50,0,0,0,0,0
+LANG:10000 26 Arial,-1,13,5,40,0,0,0,0,0
+LANG:10001 26 Arial,-1,13,5,40,0,0,0,0,0
+LANG:10027 26 Arial,-1,13,5,40,0,0,0,0,0
+0 
 0
-1
-LANG:1 0 
-
-1
-"dashclr"N "_Transparent"
-E E 0 1 1 2 1 E 1 0 1.666666666666667 160 -23.33333333333334 1 E 972 22 1025 35
-0 2 2 "0s" 0 0 0 192 0 0  972 22 1
-1
-LANG:1 33 MS Shell Dlg,-1,11,5,75,0,0,0,0,0
-0 1
-LANG:1 9 # Alarms:
 0
 LAYER, 1 
 1
@@ -499,4 +234,9 @@ LAYER, 7
 1
 LANG:1 0 
 0
+3 0 "PANEL_REF0" -1
+"" ""
+"objects/STD_PANELS/AESRow.pnl" 27 42 T 0 1 0 1.071428571428571 -15.5 -35.99999999999999
+1
+"$AESREGDOLLAR_SCREENTYPE""aes_alertRow_Navigator"
 0
diff --git a/MAC/Navigator2/panels/objects/navigator_fastJumper.pnl b/MAC/Navigator2/panels/objects/navigator_fastJumper.pnl
index 9baa48d716357ff980ff2d0fae423b18da077f76..bfe608aca4b823d82ffaa9de127c028faa15a4e0 100644
--- a/MAC/Navigator2/panels/objects/navigator_fastJumper.pnl
+++ b/MAC/Navigator2/panels/objects/navigator_fastJumper.pnl
@@ -1,4 +1,4 @@
-V 11
+V 13
 1
 LANG:1 8 (NoName)
 PANEL,-1 -1 366 71 N "_3DFace" 1
@@ -6,11 +6,11 @@ PANEL,-1 -1 366 71 N "_3DFace" 1
 "main() {
     //delay while navigator instance is being prepared, shouldn't be needed, but this way we at least have a trigger when something goes wrong
   int retry=0;
-  while (navigator_initializing() & retry < 60) {
+  while (navigator_initializing() & retry < 120) {
     delay(0,100);
     retry++;
-    if (retry >= 60) {
-      LOG_FATAL(\"Navigator_fastJumper.pnl:initialize|main retry longer then 2 minutes, navigatorInstance still not ready?\");
+    if (retry >= 120) {
+      LOG_FATAL(\"Navigator_fastJumper.pnl:initialize|main retry longer then 4 minutes, navigatorInstance still not ready?\");
       break;
     }
   }
@@ -249,9 +249,11 @@ void visible(bool flag) {
     fastJump_previous.visible(flag);
     fastJump_next.visible(flag);
 }" 0
- 2
+ 3
 "CBRef" "1"
 "EClose" E
+"dpi" "96"
+0 0 0
 ""
 DISPLAY_LAYER, 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
 LAYER, 0 
diff --git a/MAC/Navigator2/panels/objects/navigator_headlines.pnl b/MAC/Navigator2/panels/objects/navigator_headlines.pnl
index 536e6c7a34efbbdf26ef9d3e57bb27ad44e02bc7..aa571ff04e18eb6535c8e9c3dfa5b6f0ef942385 100644
--- a/MAC/Navigator2/panels/objects/navigator_headlines.pnl
+++ b/MAC/Navigator2/panels/objects/navigator_headlines.pnl
@@ -1,4 +1,4 @@
-V 11
+V 13
 1
 LANG:1 8 (NoName)
 PANEL,-1 -1 733 56 N "_3DFace" 1
@@ -6,11 +6,11 @@ PANEL,-1 -1 733 56 N "_3DFace" 1
 "main() {
     //delay while navigator instance is being prepared, shouldn't be needed, but this way we at least have a trigger when something goes wrong
   int retry=0;
-  while (navigator_initializing() & retry < 60) {
+  while (navigator_initializing() & retry < 120) {
     delay(0,100);
     retry++;
-    if (retry >= 60) {
-      LOG_FATAL(\"Navigator_headLines.pnl:initialize|headLines retry longer then 2 minutes, navigatorInstance still not ready?\");
+    if (retry >= 120) {
+      LOG_FATAL(\"Navigator_headLines.pnl:initialize|headLines retry longer then 4 minutes, navigatorInstance still not ready?\");
       break;
     }
   }
@@ -157,9 +157,11 @@ void setEvent(dyn_string aSelection,string event) {
     LOG_ERROR(\"navigator_headlines.pnl:setEvent|\"+itsSelectionDp + \" Does not exist yet\");     
   }
 }" 0
- 2
+ 3
 "CBRef" "1"
 "EClose" E
+"dpi" "96"
+0 0 0
 ""
 DISPLAY_LAYER, 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
 LAYER, 0 
@@ -176,8 +178,10 @@ E E E
 1
 LANG:1 0 
 
-1
+3
+"sizePolicy" "Fixed Fixed"
 "dashclr"N "_Transparent"
+"antiAliased" "0"
 E E 0 1 1 0 1 E U  0 E 12 12 708 28
 1 2 0 "0s" 0 0 0 64 0 0  12 12 1
 1
diff --git a/MAC/Navigator2/panels/objects/navigator_locator.pnl b/MAC/Navigator2/panels/objects/navigator_locator.pnl
index dacfe339f4a8671f82889f1eb7aa111d88991114..01d024291e392927da72c92af2c454336d37b47d 100644
--- a/MAC/Navigator2/panels/objects/navigator_locator.pnl
+++ b/MAC/Navigator2/panels/objects/navigator_locator.pnl
@@ -1,4 +1,4 @@
-V 11
+V 13
 1
 LANG:1 8 (NoName)
 PANEL,-1 -1 393 217 N "_3DFace" 1
@@ -9,11 +9,11 @@ PANEL,-1 -1 393 217 N "_3DFace" 1
 
   //delay while navigator instance is being prepared, shouldn't be needed, but this way we at least have a trigger when something goes wrong
   int retry=0;
-  while (navigator_initializing() & retry < 60) {
+  while (navigator_initializing() & retry < 120) {
     delay(0,100);
     retry++;
-    if (retry >= 60) {
-      LOG_FATAL(\"navigator_locator.pnl:Initialize|locator retry longer then 2 minutes, navigatorInstance still not ready?\");
+    if (retry >= 120) {
+      LOG_FATAL(\"navigator_locator.pnl:Initialize|locator retry longer then 4 minutes, navigatorInstance still not ready?\");
       break;
     }
   }
@@ -210,9 +210,11 @@ void setEvent(dyn_string aSelection,string event) {
     LOG_ERROR(\"navigator_locator.pnl:setEvent|\"+itsSelectionDp + \" Does not exist yet\");     
   }
 }" 0
- 2
+ 3
 "CBRef" "1"
 "EClose" E
+"dpi" "96"
+0 0 0
 ""
 DISPLAY_LAYER, 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
 LAYER, 0 
@@ -231,7 +233,7 @@ LANG:1 0
 
 0
 1
-LANG:1 37 MS Shell Dlg 2,8.25,-1,5,50,0,0,0,0,0
+LANG:1 35 MS Shell Dlg 2,-1,11,5,50,0,0,0,0,0
 0  0 0 279 199
 10 TreeWidget
 3
diff --git a/MAC/Navigator2/panels/objects/navigator_progressBar.pnl b/MAC/Navigator2/panels/objects/navigator_progressBar.pnl
index f4a171caf02b60c4b5f9b553fdb26ef08a69ccb1..0beb8dcb90182149a03cdfb43e34641f3b82de83 100644
--- a/MAC/Navigator2/panels/objects/navigator_progressBar.pnl
+++ b/MAC/Navigator2/panels/objects/navigator_progressBar.pnl
@@ -1,4 +1,4 @@
-V 11
+V 13
 1
 LANG:1 8 (NoName)
 PANEL,-1 -1 638 94 N "_3DFace" 1
@@ -7,11 +7,11 @@ PANEL,-1 -1 638 94 N "_3DFace" 1
 {
     //delay while navigator instance is being prepared, shouldn't be needed, but this way we at least have a trigger when something goes wrong
   int retry=0;
-  while (navigator_initializing() & retry < 60) {
+  while (navigator_initializing() & retry < 120) {
     delay(0,100);
     retry++;
-    if (retry >= 60) {
-      LOG_FATAL(\"navigator_progressBar.pnl:initialize|progressBar retry longer then 2 minutes, navigatorInstance still not ready?\");
+    if (retry >= 120) {
+      LOG_FATAL(\"navigator_progressBar.pnl:initialize|progressBar retry longer then 4 minutes, navigatorInstance still not ready?\");
       break;
     }
   }
@@ -106,9 +106,11 @@ void setEvent(dyn_string aSelection,string event) {
     LOG_ERROR(\"navigator_progressBar.pnl:setEvent|\"+itsSelectionDp + \" Does not exist yet\");     
   }
 }" 0
- 2
+ 3
 "CBRef" "1"
 "EClose" E
+"dpi" "96"
+0 0 0
 ""
 DISPLAY_LAYER, 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
 LAYER, 0 
@@ -126,8 +128,9 @@ E E E
 LANG:1 0 
 LANG:0 0 
 
-1
+2
 "dashclr"N "_Transparent"
+"antiAliased" "0"
 E E 0 1 1 0 1 E -1 1.224646799147353e-016 -1.224646799147353e-016 -1 220 40 1 E 4 10 10
 10 30
 210 30
@@ -145,8 +148,9 @@ E E E
 LANG:1 0 
 LANG:0 0 
 
-1
+2
 "dashclr"N "_Transparent"
+"antiAliased" "0"
 E E 0 1 1 0 1 E -1 -1.224646799147353e-016 1.224646799147353e-016 -1 220 40 1 E 3 10 30
 10 10
 210 10
@@ -163,8 +167,9 @@ E E E
 LANG:1 0 
 LANG:0 0 
 
-1
+2
 "dashclr"N "_Transparent"
+"antiAliased" "0"
 E E 0 1 1 0 1 E -1 -1.224646799147353e-016 1.224646799147353e-016 -1 220 40 0 E 3 10 30
 10 10
 210 10
@@ -181,8 +186,9 @@ E E E
 LANG:1 0 
 LANG:0 0 
 
-1
+2
 "dashclr"N "_Transparent"
+"antiAliased" "0"
 "main()
 {
   
@@ -208,9 +214,11 @@ E E E
 1
 LANG:1 0 
 
-1
+3
+"sizePolicy" "Fixed Fixed"
 "dashclr"N "_Transparent"
-E E 0 1 1 2 1 E U  1 E 100 14 101 27
+"antiAliased" "0"
+E E 0 1 1 2 1 E U  1 E 100 14 102 26
 0 2 2 "0s" 0 0 0 192 0 0  100 14 1
 1
 LANG:1 33 MS Shell Dlg,-1,11,5,75,0,0,0,0,0
@@ -227,12 +235,14 @@ E E E
 1
 LANG:1 0 
 
-1
+3
+"sizePolicy" "Fixed Fixed"
 "dashclr"N "_Transparent"
-E E 0 1 1 2 1 E U  0 E 213 13 227 29
+"antiAliased" "0"
+E E 0 1 1 2 1 E U  0 E 213 13 229 28
 0 2 2 "0s" 0 0 0 192 0 0  213 13 1
 1
-LANG:1 35 MS Shell Dlg 2,10,-1,5,75,0,0,0,0,0
+LANG:1 35 MS Shell Dlg 2,-1,13,5,75,0,0,0,0,0
 0 1
 LANG:1 1 %
 0
diff --git a/MAC/Navigator2/panels/objects/navigator_typeSelector.pnl b/MAC/Navigator2/panels/objects/navigator_typeSelector.pnl
index 5c1bcdfccb5cf88812929489c1219d6b4bb7f2ca..836353231fde9814237d469023265e1ca27d25ea 100644
--- a/MAC/Navigator2/panels/objects/navigator_typeSelector.pnl
+++ b/MAC/Navigator2/panels/objects/navigator_typeSelector.pnl
@@ -1,4 +1,4 @@
-V 11
+V 13
 1
 LANG:1 8 (NoName)
 PANEL,-1 -1 352 496 N "_3DFace" 2
@@ -9,11 +9,11 @@ PANEL,-1 -1 352 496 N "_3DFace" 2
 
     //delay while navigator instance is being prepared, shouldn't be needed, but this way we at least have a trigger when something goes wrong
   int retry=0;
-  while (navigator_initializing() & retry < 60) {
+  while (navigator_initializing() & retry < 120) {
     delay(0,100);
     retry++;
-    if (retry >= 60) {
-      LOG_FATAL(\"navigator_typeSelector.pnl:Initialize|typeSelector retry longer then 2 minutes, navigatorInstance still not ready?\");
+    if (retry >= 120) {
+      LOG_FATAL(\"navigator_typeSelector.pnl:Initialize|typeSelector retry longer then 4 minutes, navigatorInstance still not ready?\");
       break;
     }
   }
@@ -431,9 +431,11 @@ void updatePlList()
   }
 
 }" 0
- 2
+ 3
 "CBRef" "1"
 "EClose" E
+"dpi" "96"
+0 0 0
 ""
 DISPLAY_LAYER, 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
 LAYER, 0 
@@ -453,7 +455,7 @@ LANG:1 9 processes
 1
 "allColumnsShowFocus" "bool FALSE"
 1
-LANG:1 37 MS Shell Dlg 2,8.25,-1,5,50,0,0,0,0,0
+LANG:1 35 MS Shell Dlg 2,-1,11,5,50,0,0,0,0,0
 0  10 30 289 429
 10 TreeWidget
 3
@@ -480,10 +482,10 @@ E E E
 LANG:1 8 hardware
 
 2
-"allColumnsShowFocus" "bool TRUE"
 "selectionMode" "enum 0"
+"allColumnsShowFocus" "bool TRUE"
 1
-LANG:1 37 MS Shell Dlg 2,8.25,-1,5,50,0,0,0,0,0
+LANG:1 35 MS Shell Dlg 2,-1,11,5,50,0,0,0,0,0
 0  10 30 289 429
 10 TreeWidget
 3
@@ -525,7 +527,7 @@ LANG:1 9 processes
 1
 "allColumnsShowFocus" "bool FALSE"
 1
-LANG:1 37 MS Shell Dlg 2,8.25,-1,5,50,0,0,0,0,0
+LANG:1 35 MS Shell Dlg 2,-1,11,5,50,0,0,0,0,0
 0  10 30 289 429
 10 TreeWidget
 3
@@ -554,7 +556,7 @@ LANG:1 9 processes
 1
 "allColumnsShowFocus" "bool FALSE"
 1
-LANG:1 37 MS Shell Dlg 2,8.25,-1,5,50,0,0,0,0,0
+LANG:1 35 MS Shell Dlg 2,-1,11,5,50,0,0,0,0,0
 0  10 30 289 429
 10 TreeWidget
 3
diff --git a/MAC/Navigator2/panels/objects/navigator_viewSelection.pnl b/MAC/Navigator2/panels/objects/navigator_viewSelection.pnl
index 7c53e2c416408917a7d7721f0df35ee18417bdc1..acf069711d55c2abc20b1c203f6518939be3f357 100644
--- a/MAC/Navigator2/panels/objects/navigator_viewSelection.pnl
+++ b/MAC/Navigator2/panels/objects/navigator_viewSelection.pnl
@@ -1,4 +1,4 @@
-V 11
+V 13
 1
 LANG:1 0 
 PANEL,-1 -1 1200 855 N "_3DFace" 1
@@ -8,11 +8,11 @@ PANEL,-1 -1 1200 855 N "_3DFace" 1
   tabView.enabled(false);
     //delay while navigator instance is being prepared, shouldn't be needed, but this way we at least have a trigger when something goes wrong
   int retry=0;
-  while (navigator_initializing() & retry < 60) {
+  while (navigator_initializing() & retry < 120) {
     delay(0,100);
     retry++;
-    if (retry >= 60) {
-      LOG_FATAL(\"navigator_viewSelection.pnl:Initialize| viewSelection retry longer then 2 minutes, navigatorInstance still not ready?\");
+    if (retry >= 120) {
+      LOG_FATAL(\"navigator_viewSelection.pnl:Initialize| viewSelection retry longer then 4 minutes, navigatorInstance still not ready?\");
       break;
     }
   }
@@ -87,9 +87,11 @@ void setEvent(dyn_string aSelection,string event) {
     LOG_ERROR(\"navigator_viewSelection.pnl:setEvent|\" +itsSelectionDp + \" Does not exist yet, selection: \" + aSelection);     
   }
 }" 0
- 2
+ 3
 "CBRef" "1"
 "EClose" E
+"dpi" "96"
+0 0 0
 ""
 DISPLAY_LAYER, 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
 LAYER, 0 
@@ -183,7 +185,7 @@ LANG:1 0
 
 0
 1
-LANG:1 37 MS Shell Dlg 2,8.25,-1,5,50,0,0,0,0,0
+LANG:1 35 MS Shell Dlg 2,-1,11,5,50,0,0,0,0,0
 0  1091 6 1190 32
  0 1
 LANG:1 8 Settings
@@ -256,12 +258,15 @@ LAYER, 7
 LANG:1 0 
 0
 3 0 "PANEL_REF1" -1
-"objects\\Hardware\\lofar_HW_state.pnl" 45 5 T 16 1 0 1 -16 1
+"" ""
+"objects/Hardware/lofar_HW_state.pnl" 45 5 T 16 1 0 1 -16 1
 0
 3 1 "PANEL_REF2" -1
-"objects\\Observations\\lofar_Obs_state.pnl" 125 5 T 16 1 0 1 43 1
+"" ""
+"objects/Observations/lofar_Obs_state.pnl" 125 5 T 16 1 0 1 43 1
 0
 3 2 "PANEL_REF3" -1
-"objects\\Processes\\lofar_Proc_state.pnl" 225 5 T 16 1 0 1 59 1
+"" ""
+"objects/Processes/lofar_Proc_state.pnl" 225 5 T 16 1 0 1 59 1
 0
 0
diff --git a/MAC/Navigator2/panels/vision/aes/AEScreen.pnl b/MAC/Navigator2/panels/vision/aes/AEScreen.pnl
new file mode 100644
index 0000000000000000000000000000000000000000..8e5798a86f59bf8ce7390c7319acbe458653047e
--- /dev/null
+++ b/MAC/Navigator2/panels/vision/aes/AEScreen.pnl
@@ -0,0 +1,3464 @@
+V 13
+4
+LANG:1 8 AEScreen
+LANG:10000 8 AESchirm
+LANG:10001 8 AEScreen
+LANG:10027 45 Панель алармов и событий
+PANEL,-1 -1 1060 793 N "_3DFace" 3
+"$ACTION"
+"$FILENAME"
+"$SCREENTYPE"
+"main()
+{
+  if ( isDollarDefined(\"$SCREENTYPE\") )
+    sDummyStringForDollarParameter1 = $SCREENTYPE;
+  if ( isDollarDefined(\"$ACTION\") )
+    sDummyStringForDollarParameter2 = $ACTION;
+  if ( isDollarDefined(\"$FILENAME\") )
+    sDummyStringForDollarParameter3 = $FILENAME;
+  
+  g_regInitReady=AES_INITSTATE_WAITING;
+  
+  dpGetCache(\"_Config.TimeoutJumping:_online.._value\", g_uJumpingTimeout);
+}
+" 0
+ E E E E 1 -1 -1 0  68 1230
+""0  1
+E "#uses \"aec.ctl\"
+#uses \"aes.ctl\"
+#uses \"aesuser.ctl\"
+//#uses \"dpGroups.ctl\"
+/////// neuer Teil - nicht loeschen
+///////////////////////////////////
+
+bool g_bTableLineSynchronisation;
+unsigned g_uJumpingTimeout;
+
+int g_iLineHoldThreadTop = -2;
+int g_iLineHoldThreadBot = -2;
+
+bool gb_automaticScrollTop;
+bool gb_automaticScrollBot;
+
+bool gb_automaticScrollTimeoutTop;
+bool gb_automaticScrollTimeoutBot;
+
+bool g_initFromAES;
+dyn_anytype vst;
+dyn_anytype vstn;
+bool g_langSwitched=false;
+int g_lsActiveRegister;
+string g_lsActiveScreenConfig;
+int g_lsProportion;
+
+bool g_firstHL=true;
+int g_arHeight=1;
+
+// flag for table init - wait for start operation
+bool g_regGeneralInit=false;
+
+bool p_startAction=false;
+string p_screenConfig;
+int p_action;
+string p_fileName;
+bool p_dispSlider=true;
+
+const bool g_autoAction=true;   // flag for automatic run
+const bool g_alertRow=false;    // flag to indicate alert row mode
+
+// neu
+dyn_anytype ddaRes;
+dyn_dyn_anytype vstn;   // new vst for AESCREEN => not global
+
+dyn_string      g_visibleColumnsTop;// da die sichtbaren Spalten auch die Reihenfolge im AS bestimmen
+dyn_string      g_visibleColumnsBot;// da die sichtbaren Spalten auch die Reihenfolge im AS bestimmen
+
+// speichert die letzte selektierte  registerkarte
+// wird in regChanged event beruecksichtigt um config und configList der
+// registerkarten top/bot mit general zu synchronisieren !!!
+// ACHTUNG - bei querystart muss immer die konfiguration der activen registerkarte verwendet werden !!!!!!
+// init mit 2 => entspricht reg_general
+unsigned g_lastActiveRegister=AESREGTAB_GENERAL;
+// header names for register tabs
+dyn_string g_regHeaderNames;
+
+// reg init statusinformation - important for table init routine ( _propDP check )
+int g_regInitReady=AES_INITSTATE_WAITING;
+
+// panel global propDP names ( _AESProperties )
+string g_propDpNameTop;   // name changed from gp_propDpName
+string g_propDpNameBot;
+
+// keeps the menuinformation
+dyn_dyn_anytype g_ddam;
+
+// global variables for shape information ( for top and bottom table )
+shape g_top;
+shape g_bottom;
+// §§§ alle panelglobalen mit gp !!!!!!!! damit kein konflikt mit scriptglobalen !!!!!
+
+/////// neuer Teil - nicht loeschen / end
+/////////////////////////////////////////
+
+int firstAlertMenu, lastAlertMenu;
+int firstEventMenu, lastEventMenu;
+int firstAlertRowMenu, lastAlertRowMenu;
+//****************************
+// from as/es_init() ****begin
+
+////// alerts
+//***********
+int AS_HIST_RANGE_SEC = 3600*24;
+int E_AS_FUNCTION = 0;
+int E_AS_DP_VAL = 1;
+dyn_string AS_TYPEFILTER;   // init in aes_initMainReg()
+dyn_int AS_TYPECONST;
+
+////// events
+//***********
+int ES_HIST_RANGE_SEC = 3600*24;
+int E_ES_FUNCTION = 0;
+int E_ES_DP_VAL = 1;
+dyn_string ES_TYPEFILTER;  // init in aes_initMainReg()
+dyn_int ES_TYPECONST;
+
+// §§§ ACHTUNG jetzt noch as - in zukunft aes oder ohne prefix !!!!!!!!!!!!!!!!
+// init ==> see aes_initOldScreenVariables() / initRegMain()
+int g_asMaxLinesToDisplay=0;
+int g_asMaxDpeToDisplay=0;
+int g_asMaxDpeHourToDisplay=0;
+
+// sync flags for reggeneralinit
+bool g_ctrlFlagTop=false;
+bool g_ctrlFlagBot=false;
+
+// global variables for splitscreen treating
+int  g_percent=50;
+int  g_splitMax=100;
+int  g_splitMin=0;
+int  g_splitInc=10;
+bool g_splitInit=false;
+int  g_percent;
+int  g_snap=4;
+
+int   g_both_x;
+float g_both_w;
+
+int   g_top_y;
+float g_total_h;
+
+string sDummyStringForDollarParameter1;// = $SCREENTYPE;
+string sDummyStringForDollarParameter2;// = $ACTION;
+string sDummyStringForDollarParameter3;// = $FILENAME;
+
+aes_scrollHandling(int tabType, int &iLineHoldThread)
+{
+  int propMode;
+  string propDpName;
+  bool b_automaticScroll;
+ 
+  if(g_uJumpingTimeout == 0)
+    return;
+  
+  propDpName = aes_getPropDpName(AES_DPTYPE_PROPERTIES, true, tabType);
+  aes_getPropMode(propDpName, propMode);
+
+  // check if scrolling was made automatically or manually
+  if(tabType == AESTAB_TOP)
+  {
+    if(gb_automaticScrollTop == 1)
+    {
+      b_automaticScroll = 1;
+      gb_automaticScrollTop = 0;
+    }
+  }
+  else
+  {
+    if(gb_automaticScrollBot == 1)
+    {
+      b_automaticScroll = 1;
+      gb_automaticScrollBot = 0;
+    }
+  }
+
+  if(iLineHoldThread == -2)
+  {
+    iLineHoldThread = -1;
+    return;
+  }
+
+  // stop the thread only if scrolling was made manually
+  if(iLineHoldThread != -1 && b_automaticScroll == 0)
+  {
+    stopThread(iLineHoldThread);
+    iLineHoldThread = -1;
+  }
+
+  // start the thread only if scrolling was made manually
+  if(propMode != AES_MODE_CLOSED && b_automaticScroll == 0)
+  {
+    iLineHoldThread = startThread(\"aes_lineHoldTimeoutThread\", tabType);
+  }
+}
+
+aes_lineHoldTimeoutThread(int tabType)
+{
+  dyn_string sortList;
+  dyn_bool sortAsc;
+  string s_propDp;
+  bool b_automaticScroll;
+  
+  do
+  {
+    delay(g_uJumpingTimeout);
+  } while( ((tabType == AESTAB_TOP) && table_top.isVerticalSliderPressed()) ||
+           ((tabType == AESTAB_BOT) && table_bot.isVerticalSliderPressed()) );
+
+  // check if scrolling shall be made when timeout is reached
+  if(tabType == AESTAB_TOP)
+  {
+    if(gb_automaticScrollTimeoutTop == 1)
+    {
+      b_automaticScroll = 1;
+      gb_automaticScrollTimeoutTop = 0;
+    }
+    gb_automaticScrollTop = 0;
+    
+    s_propDp = g_propDpNameTop;
+  }
+  else
+  {
+    if(gb_automaticScrollTimeoutBot == 1)
+    {
+      b_automaticScroll = 1;
+      gb_automaticScrollTimeoutBot = 0;
+    }
+    gb_automaticScrollBot = 0;
+
+    s_propDp = g_propDpNameBot;
+  }
+
+  // start automatic scrolling
+  if(b_automaticScroll == 1)
+  {
+    int i_sort;
+    bool b_sort;
+
+    if (dynlen(sortList)==0) //e.g. on delete
+    {
+      aes_getSortList( s_propDp, sortList, sortAsc );
+    }
+
+    i_sort = dynContains(sortList, \"__V_time\");
+    if (i_sort<1)
+      i_sort = dynContains(sortList, \"timeStr\");
+
+    if(i_sort<1)
+      b_sort=true;
+    else
+      b_sort = sortAsc[i_sort];
+    
+    if ( b_sort == 1 )
+      this.lineVisible = -1;
+    else
+      this.lineVisible = 0;
+  }
+  
+  if(tabType == AESTAB_TOP)
+    g_iLineHoldThreadTop = -2;
+  else
+    g_iLineHoldThreadBot = -2;
+}
+
+
+
+
+
+
+
+" 0
+ 4
+"CBRef" "1"
+"EClose" E
+"ELangChanged" "main()
+{
+  int areg;
+  string sconfig;
+
+  g_langSwitched=true;
+  
+  areg=reg_main.activeRegister;
+  sconfig=cb_aesConfig.selectedText;
+
+  reg_main.visible=false;
+  table_top.visible=false;
+  table_bot.visible=false;
+
+  if( sconfig == \"\" )
+    sconfig=cb_aesConfig.text;
+
+  g_lsActiveRegister=areg;
+  g_lsActiveScreenConfig=sconfig;
+  g_lsProportion=g_percent;
+
+}"
+"dpi" "96"
+0 0 0
+""
+NC
+DISPLAY_LAYER, 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
+LAYER, 0 
+1
+LANG:1 6 Layer1
+6 26
+"DEBUG"
+""
+1 0 3 E E E 1 E 1 E N "_3DFace" E N "_3DFace" E E
+ "main()
+{
+  int i;
+  for ( i=0; i<=table_top.columnCount(); i++)
+  {
+    table_top.columnVisibility(i) = TRUE;
+    table_top.columnWidth(i) = 20;
+    langString ls, ls2;
+    getValue(  \"table_top\", \"columnHeader\", i, ls); 
+    getValue(  \"table_top\", \"columnName\", i, ls2); 
+  }
+}
+" 0
+ E
+22 0 0 0 0 0
+E E E
+0
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+2
+"dashclr"N "_Transparent"
+"antiAliased" "0"
+E E 0 1 1 0 1 E U  1 E 0 1 3 3
+6 27
+"Border2"
+""
+1 810 630 E E E 1 E 1 E N {0,0,0} E N "_Transparent" E E
+ E E
+22 0 0 0 0 0
+E E E
+0
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+2
+"dashclr"N "_Transparent"
+"antiAliased" "0"
+E E 0 1 1 0 1 E U  2  0 3  "27.bmp" 12632256 E 410 130 550 510
+28 0
+"reg_main"
+""
+1 9.789729781365303 -1 E E E 1 E 0 E N "_3DText" E N "_3DFace" E E
+ E E
+1 0 0 0 0 0
+E E E
+0
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+1
+"selchangedcb" "main()
+{
+  string config, _screenType, app, pre;
+  dyn_string configList;
+  unsigned actReg;   
+  
+  // we are using the top dp for regtab treating
+  aes_changed( g_propDpNameTop, AES_CHANGED_REGTAB );  
+}"
+4
+LANG:1 26 Arial,-1,12,5,40,0,0,0,0,0
+LANG:10000 26 Arial,-1,12,5,40,0,0,0,0,0
+LANG:10001 26 Arial,-1,12,5,40,0,0,0,0,0
+LANG:10027 26 arial,-1,12,5,40,0,0,0,0,0
+0  9 621 1042 735
+"main()
+{
+  // local copy
+  aes_initMainReg();
+  return;
+  
+  
+  if( !g_autoAction )   // if autoAction aes_initMainReg will be called from  aes_startAction
+  { 
+    aes_initMainReg();
+  }
+  else
+  {
+    // waiting for p_startAction
+    while( !p_startAction )
+    {
+      delay( 0, 300 );
+    }
+    aes_startAction( p_screenConfig, p_action );
+  }
+  
+  
+  
+  // inform tableinitroutine that reginitroutine has finished
+  // we are misusing the type table property
+
+}
+" 0
+3 "tab_top" 4
+LANG:1 2 #1
+LANG:10000 2 #1
+LANG:10001 2 #1
+LANG:10027 2 #1
+0
+"tab_bot" 4
+LANG:1 2 #2
+LANG:10000 2 #2
+LANG:10001 2 #2
+LANG:10027 2 #2
+0
+"tab_general" 4
+LANG:1 2 #3
+LANG:10000 2 #3
+LANG:10001 2 #3
+LANG:10027 2 #3
+0
+
+25 1
+"table_top"
+""
+1 9.789729781365393 -1 E E E 1 E 0 E N "_WindowText" E N "_Window" E "main(int iType)
+{
+  int tableAckAction;
+  mapping mTableMultipleRows;
+  
+//check if there is an column _ACKABLE_ otherwise it is the event screen and there is nothing to ack
+  
+  int iCnt, i;
+  iCnt=this.columnCount();
+  for (i=1; i<=iCnt; i++)
+  {
+    if (this.columnName(i) == _ACKABLE_)
+    {
+      i = iCnt+2;
+      break;
+    }
+  }
+  if (i!=iCnt+2) //_ACKABLE_ was not found
+    return;
+
+
+
+  //added support for SINGLE ACK mode to work per line instead of on whole widget
+  tableAckAction = (iType == DPATTR_ACKTYPE_SINGLE)?AES_CHANGED_ACKSINGLE:AES_CHANGED_ACKALLVIS;
+  
+  synchronized(g_bTableLineSynchronisation)
+  {
+    aes_prepareForTableAcknowledge(tableAckAction, AESTAB_TOP, mTableMultipleRows);    
+  }
+
+  aes_acknowledgeTableFunction( this.name, \"1\", mTableMultipleRows);
+}
+" 0
+
+ "main(int row, string column)
+{
+  int i, j;
+  anytype value;
+  mapping mTableMultipleRows;
+  dyn_int diSelectedLines;
+  
+  //IM 116642: Trigger table widget once, to avoid timing problems
+  int top, bot;
+  getValue(\"\", \"lineRangeVisible\", top, bot);
+  
+  synchronized(g_bTableLineSynchronisation)
+  { 
+    int length;
+    dyn_anytype alertRow;  
+    
+    value=this.cellValue;
+    int iLineCnt = this.lineCount;
+    
+    dyn_string columnNames = makeDynString();
+
+
+    
+    for (j=0; j<iLineCnt; j++)
+    {
+
+      alertRow = this.getLineN(j);
+      length = dynlen(alertRow);
+      
+      if (dynlen(columnNames)==0) //read column names once
+      {
+        for (i = length; i>0; i--)
+          columnNames[i]= this.columnName(i-1);
+      }
+    
+      mapping rowHeaderMapping;
+      
+      for(i=1; i<=length; i++)
+        rowHeaderMapping[columnNames[i]] = alertRow[i];
+      
+      mTableMultipleRows[j] = rowHeaderMapping;
+    }
+    
+    diSelectedLines = this.getSelectedLines();
+  }
+
+  aes_onRightClick( g_propDpNameTop, AESTAB_TOP, this.name, row, column, value, mTableMultipleRows, diSelectedLines );
+}
+
+" 0
+ "main()
+{
+  int row, column;
+  anytype value;
+  mapping mTableRow;
+  
+  synchronized(g_bTableLineSynchronisation)
+  { 
+    int length;
+    dyn_anytype alertRow;  
+        
+    // determine position 
+    getValue(\"\",\"currentCell\", row, column );
+    // and content of active cell !
+    getValue(\"\",\"cellValue\", value );
+
+    alertRow = this.getLineN(row);
+    length = dynlen(alertRow);
+    for(int i=1; i<=length; i++)
+      mTableRow[this.columnName(i-1)] = alertRow[i];
+  }
+ 
+  aes_doColumnDblClick( g_propDpNameTop, row, column, value, mTableRow );
+}
+" 0
+
+2 0 0 0 0 0
+"main()
+{
+  reg_main.namedActiveRegister( AES_TABNAME_TOP );
+}" 0
+ E E
+0
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+1
+"scrolledCB" "synchronized main()
+{
+  aes_scrollHandling(AESTAB_TOP, g_iLineHoldThreadTop);
+}"
+4
+LANG:1 26 Arial,-1,12,5,40,0,0,0,0,0
+LANG:10000 26 Arial,-1,12,5,40,0,0,0,0,0
+LANG:10001 26 Arial,-1,12,5,40,0,0,0,0,0
+LANG:10027 26 arial,-1,12,5,40,0,0,0,0,0
+0  8 -3 1022 311
+"mapping  g_mQueryReplies;
+dyn_string g_dsSystems;
+
+// neu - fuer bessere performance in callback
+bool g_firstHL;
+int g_screenType;
+// property dp name
+string g_propDp;
+// Top/Bot info
+int g_tabType;
+// column name of register tab ( to build the tabheader eg Top/Alerts/Open )
+string g_regColumn;
+// mode
+int g_valType;
+dyn_string g_systemSelections;
+
+
+//////// neue variablen fuer configMatrix, settings and table eval commands append/update/delete
+dyn_dyn_anytype g_configMatrix;
+dyn_anytype     g_configSettings;
+
+string          g_tableCmdAppend;
+string          g_tableCmdUpdate;
+string          g_tableCmdDelete;
+
+dyn_string      g_colNames;
+bool            g_useFontProp;
+int             g_dpidIdx;
+int             g_timeIdx;
+int             g_countIdx;
+
+dyn_string      g_attrList;
+
+//*****************************
+// from old as/es_init() ***begin
+
+// momentan wird das prefix as fuer beide verwendet / es routinen werden angepasst
+// arbeitsvariablen muessen scriptglobal( pro tabelle) sein !!!!!!!!!!!
+int g_asDisplayLines = 0;
+int g_asDisplayDpes = 0;
+int g_asDisplayHours = 0;
+
+// halten die werte fuer AES_TYPEFILTER/TYPECONST ( == panelglobal )
+dyn_string g_typeFilter;
+dyn_int g_typeConst;
+
+//*****************************
+// from old aes_init() *****end
+
+
+///////////////////////////////////////////////
+// from old screen ***********************begin
+// new
+bool     g_historicalData;
+int      g_historicalDataInterval;   // display interval in sec back from now / only open mode 
+int      g_queryBlockedTime; // holds to queryblocktime in ms / see general settings
+dyn_bool g_colVis;           // holds the flag wheter an optional column is visible or not
+string   g_connectId;        // holds id of current query
+dyn_string g_counterConnectId; // holds numbers of Id's
+dyn_string g_closedIdf;      // new
+
+bool     g_checkAll;         // holds property setting - connect all systems
+time     g_timeLastUpdate;   // holds time of the last update
+string   g_dpCommentFilter;  // store filter
+
+bool     g_showInternals;    // value from _Config.ShowInternals
+bool     g_showInternalsA;    // value from _Config.ShowInternalDPs.Alerts
+bool     g_showInternalsAR;   // value from _Config.ShowInternalDPs.AlertRow
+bool     g_showInternalsE;    // value from _Config.ShowInternalDPs.Events
+
+unsigned g_maxClosedLines;   // max num of lines to be queried by closed protocoll
+unsigned g_state;            // alert-state filter
+
+int g_busyThread;    // id of thread, which shows busyness
+
+int g_maxLines;      // num of max lines in open protocoll
+
+// TI 14075 (discarding pending values)
+int        g_discardThread;
+time       g_discardStart;
+bool       g_discarded;
+const time MINCB_TIME = 2;
+const time MAXCB_TIME = 5;
+
+// characters for status-bits in current language
+// only for Events
+char g_Cdefault, g_Cout_prange, g_Cinvalid, g_Cfrom_GI, g_Cuserbit1, g_Cuserbit2;
+
+// IM 114080 - moved from aes.ctl
+dyn_string g_dsWorkAttr, g_dsWorkName, g_dsWorkVsbl;
+
+///////////////////////////////////////////////
+// from old screen *************************end
+
+main()
+{
+  aes_initMainTable( AESTAB_TOP );
+}
+" 0
+"main(int row, string column, string value)
+{
+  mapping mTableRow;
+  
+  synchronized(g_bTableLineSynchronisation)
+  { 
+    int length;
+    dyn_anytype alertRow;  
+    
+    alertRow = this.getLineN(row);
+    
+    length = dynlen(alertRow);
+    for(int i=1; i<=length; i++)
+      mTableRow[this.columnName(i-1)] = alertRow[i];
+  }
+
+  aes_doColumnClick( AESTAB_TOP, row, column, value, mTableRow );
+}
+" 0
+ 1 0 1 60 66 "#1" 3 1 1 "s" 4
+LANG:1 2 #1
+LANG:10000 4 Time
+LANG:10001 2 #1
+LANG:10027 10 Время
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+40 "#2" 2 1 1 "s" 4
+LANG:1 2 #2
+LANG:10000 2 #2
+LANG:10001 2 #2
+LANG:10027 2 #2
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+33 "#3" 16 1 1 "s" 4
+LANG:1 2 #3
+LANG:10000 2 #3
+LANG:10001 2 #3
+LANG:10027 2 #3
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+153 "#4" 24 1 1 "s" 4
+LANG:1 2 #4
+LANG:10000 2 #4
+LANG:10001 2 #4
+LANG:10027 2 #4
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+232 "#5" 16 1 1 "s" 4
+LANG:1 2 #5
+LANG:10000 2 #5
+LANG:10001 2 #5
+LANG:10027 2 #5
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+152 "#6" 3 1 1 "s" 4
+LANG:1 2 #6
+LANG:10000 2 #6
+LANG:10001 2 #6
+LANG:10027 2 #6
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+43 "#7" 5 1 1 "s" 4
+LANG:1 2 #7
+LANG:10000 2 #7
+LANG:10001 2 #7
+LANG:10027 2 #7
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+61 "#8" 2 1 1 "s" 4
+LANG:1 2 #8
+LANG:10000 2 #8
+LANG:10001 2 #8
+LANG:10027 2 #8
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+32 "#9" 14 1 1 "s" 4
+LANG:1 2 #9
+LANG:10000 2 #9
+LANG:10001 2 #9
+LANG:10027 2 #9
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+136 "#10" 3 1 1 "s" 4
+LANG:1 3 #10
+LANG:10000 3 #10
+LANG:10001 3 #10
+LANG:10027 3 #10
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+38 "#11" 1 1 1 "s" 4
+LANG:1 3 #11
+LANG:10000 3 #11
+LANG:10001 3 #11
+LANG:10027 3 #11
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#12" 1 1 1 "s" 4
+LANG:1 3 #12
+LANG:10000 3 #12
+LANG:10001 3 #12
+LANG:10027 3 #12
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#13" 1 1 1 "s" 4
+LANG:1 3 #13
+LANG:10000 3 #13
+LANG:10001 3 #13
+LANG:10027 3 #13
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#14" 1 1 1 "s" 4
+LANG:1 3 #14
+LANG:10000 3 #14
+LANG:10001 3 #14
+LANG:10027 3 #14
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#15" 1 1 1 "s" 4
+LANG:1 3 #15
+LANG:10000 3 #15
+LANG:10001 3 #15
+LANG:10027 3 #15
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#16" 1 1 1 "s" 4
+LANG:1 3 #16
+LANG:10000 3 #16
+LANG:10001 3 #16
+LANG:10027 3 #16
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#17" 1 1 1 "s" 4
+LANG:1 3 #17
+LANG:10000 3 #17
+LANG:10001 3 #17
+LANG:10027 3 #17
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#18" 1 1 1 "s" 4
+LANG:1 3 #18
+LANG:10000 3 #18
+LANG:10001 3 #18
+LANG:10027 3 #18
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#19" 1 1 1 "s" 4
+LANG:1 3 #19
+LANG:10000 3 #19
+LANG:10001 3 #19
+LANG:10027 3 #19
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#20" 1 1 1 "s" 4
+LANG:1 3 #20
+LANG:10000 3 #20
+LANG:10001 3 #20
+LANG:10027 3 #20
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#21" 1 1 1 "s" 4
+LANG:1 3 #21
+LANG:10000 3 #21
+LANG:10001 3 #21
+LANG:10027 3 #21
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#22" 1 1 1 "s" 4
+LANG:1 3 #22
+LANG:10000 3 #22
+LANG:10001 3 #22
+LANG:10027 3 #22
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#23" 1 1 1 "s" 4
+LANG:1 3 #23
+LANG:10000 3 #23
+LANG:10001 3 #23
+LANG:10027 3 #23
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#24" 1 1 1 "s" 4
+LANG:1 3 #24
+LANG:10000 3 #24
+LANG:10001 3 #24
+LANG:10027 3 #24
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#25" 1 1 1 "s" 4
+LANG:1 3 #25
+LANG:10000 3 #25
+LANG:10001 3 #25
+LANG:10027 3 #25
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#26" 1 1 1 "s" 4
+LANG:1 3 #26
+LANG:10000 3 #26
+LANG:10001 3 #26
+LANG:10027 3 #26
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#27" 1 1 1 "s" 4
+LANG:1 3 #27
+LANG:10000 3 #27
+LANG:10001 3 #27
+LANG:10027 3 #27
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#28" 1 1 1 "s" 4
+LANG:1 3 #28
+LANG:10000 3 #28
+LANG:10001 3 #28
+LANG:10027 3 #28
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#29" 1 1 1 "s" 4
+LANG:1 3 #29
+LANG:10000 3 #29
+LANG:10001 3 #29
+LANG:10027 3 #29
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#30" 1 1 1 "s" 4
+LANG:1 3 #30
+LANG:10000 3 #30
+LANG:10001 3 #30
+LANG:10027 3 #30
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#31" 1 0 1 "s" 4
+LANG:1 3 #31
+LANG:10000 3 #31
+LANG:10001 3 #31
+LANG:10027 3 #31
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#32" 1 0 1 "s" 4
+LANG:1 3 #32
+LANG:10000 3 #32
+LANG:10001 3 #32
+LANG:10027 3 #32
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#33" 1 0 1 "s" 4
+LANG:1 3 #33
+LANG:10000 3 #33
+LANG:10001 3 #33
+LANG:10027 3 #33
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#34" 1 0 1 "s" 4
+LANG:1 3 #34
+LANG:10000 3 #34
+LANG:10001 3 #34
+LANG:10027 3 #34
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#35" 1 0 1 "s" 4
+LANG:1 3 #35
+LANG:10000 3 #35
+LANG:10001 3 #35
+LANG:10027 3 #35
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#36" 0 0 1 "s" 4
+LANG:1 3 #36
+LANG:10000 3 #36
+LANG:10001 3 #36
+LANG:10027 3 #36
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 "#37" 0 0 1 "s" 4
+LANG:1 3 #37
+LANG:10000 3 #37
+LANG:10001 3 #37
+LANG:10027 3 #37
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 "#38" 0 0 1 "s" 4
+LANG:1 3 #38
+LANG:10000 3 #38
+LANG:10001 3 #38
+LANG:10027 3 #38
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 "#39" 0 0 1 "s" 4
+LANG:1 3 #39
+LANG:10000 3 #39
+LANG:10001 3 #39
+LANG:10027 3 #39
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 "#40" 0 0 1 "s" 4
+LANG:1 3 #40
+LANG:10000 3 #40
+LANG:10001 3 #40
+LANG:10027 3 #40
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 "#41" 0 0 1 "s" 4
+LANG:1 3 #41
+LANG:10000 3 #41
+LANG:10001 3 #41
+LANG:10027 3 #41
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 "#42" 0 0 1 "s" 4
+LANG:1 3 #42
+LANG:10000 3 #42
+LANG:10001 3 #42
+LANG:10027 3 #42
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 "#43" 0 0 1 "s" 4
+LANG:1 3 #43
+LANG:10000 3 #43
+LANG:10001 3 #43
+LANG:10027 3 #43
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 "#44" 0 0 1 "s" 4
+LANG:1 3 #44
+LANG:10000 3 #44
+LANG:10001 3 #44
+LANG:10027 3 #44
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 "#45" 0 0 1 "s" 4
+LANG:1 3 #45
+LANG:10000 3 #45
+LANG:10001 3 #45
+LANG:10027 3 #45
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 "#46" 0 0 1 "s" 4
+LANG:1 3 #46
+LANG:10000 3 #46
+LANG:10001 3 #46
+LANG:10027 3 #46
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 "#47" 0 0 1 "s" 4
+LANG:1 3 #47
+LANG:10000 3 #47
+LANG:10001 3 #47
+LANG:10027 3 #47
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 "#48" 0 0 1 "s" 4
+LANG:1 3 #48
+LANG:10000 3 #48
+LANG:10001 3 #48
+LANG:10027 3 #48
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 "#49" 0 0 1 "s" 4
+LANG:1 3 #49
+LANG:10000 3 #49
+LANG:10001 3 #49
+LANG:10027 3 #49
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 "#50" 0 0 1 "s" 4
+LANG:1 3 #50
+LANG:10000 3 #50
+LANG:10001 3 #50
+LANG:10027 3 #50
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 "#51" 0 0 1 "s" 4
+LANG:1 3 #51
+LANG:10000 3 #51
+LANG:10001 3 #51
+LANG:10027 3 #51
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 "#52" 0 0 1 "s" 4
+LANG:1 3 #52
+LANG:10000 3 #52
+LANG:10001 3 #52
+LANG:10027 3 #52
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 "#53" 0 0 1 "s" 4
+LANG:1 3 #53
+LANG:10000 3 #53
+LANG:10001 3 #53
+LANG:10027 3 #53
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 "#54" 0 0 1 "s" 4
+LANG:1 3 #54
+LANG:10000 3 #54
+LANG:10001 3 #54
+LANG:10027 3 #54
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 "#55" 0 0 1 "s" 4
+LANG:1 3 #55
+LANG:10000 3 #55
+LANG:10001 3 #55
+LANG:10027 3 #55
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 "#56" 0 0 1 "s" 4
+LANG:1 3 #56
+LANG:10000 3 #56
+LANG:10001 3 #56
+LANG:10027 3 #56
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 "#57" 0 0 1 "s" 4
+LANG:1 3 #57
+LANG:10000 3 #57
+LANG:10001 3 #57
+LANG:10027 3 #57
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 "#58" 0 0 1 "s" 4
+LANG:1 3 #58
+LANG:10000 3 #58
+LANG:10001 3 #58
+LANG:10027 3 #58
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 "#59" 0 0 1 "s" 4
+LANG:1 3 #59
+LANG:10000 3 #59
+LANG:10001 3 #59
+LANG:10027 3 #59
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 "#60" 0 0 1 "s" 4
+LANG:1 3 #60
+LANG:10000 3 #60
+LANG:10001 3 #60
+LANG:10027 3 #60
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 
+17 17 "" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+8 30
+4
+LANG:1 26 Arial,-1,12,5,40,0,0,0,0,0
+LANG:10000 26 Arial,-1,12,5,40,0,0,0,0,0
+LANG:10001 26 Arial,-1,12,5,40,0,0,0,0,0
+LANG:10027 26 arial,-1,12,5,40,0,0,0,0,0
+0 0 2 1 1 7
+1 0
+25 17
+"table_bot"
+""
+1 10 619 E E E 1 E 0 E N "_WindowText" E N "_Window" E "main(int iType)
+{
+  int tableAckAction;
+  mapping mTableMultipleRows;
+  
+//check if there is an column _ACKABLE_ otherwise it is the event screen and there is nothing to ack
+  
+  int iCnt, i;
+  iCnt=this.columnCount();
+  for (i=1; i<=iCnt; i++)
+  {
+    if (this.columnName(i-1) == _ACKABLE_)
+    {
+      i = iCnt+2;
+      break;
+    }
+  }
+  if (i!=iCnt+2) //_ACKABLE_ was not found
+    return;
+
+
+  //added support for SINGLE ACK mode to work per line instead of on whole widget
+  tableAckAction = (iType == DPATTR_ACKTYPE_SINGLE)?AES_CHANGED_ACKSINGLE:AES_CHANGED_ACKALLVIS;
+  
+  synchronized(g_bTableLineSynchronisation)
+  {
+    aes_prepareForTableAcknowledge(tableAckAction, AESTAB_BOT, mTableMultipleRows);    
+  }
+  
+  aes_acknowledgeTableFunction( this.name, \"1\", mTableMultipleRows);
+}
+
+
+" 0
+
+ "main(int row, string column)
+{
+  int i, j;
+  anytype value;
+  mapping mTableMultipleRows;
+  dyn_int diSelectedLines;
+  
+  //IM 116642: Trigger table widget once, to avoid timing problems
+  int top, bot;
+  getValue(\"\", \"lineRangeVisible\", top, bot);
+  
+  synchronized(g_bTableLineSynchronisation)
+  { 
+    int length;
+    dyn_anytype alertRow;  
+    
+    value=this.cellValue;
+    int iLineCnt = this.lineCount;
+    
+    dyn_string columnNames = makeDynString();
+
+
+    
+    for (j=0; j<iLineCnt; j++)
+    {
+
+      alertRow = this.getLineN(j);
+      length = dynlen(alertRow);
+      
+      if (dynlen(columnNames)==0) //read column names once
+      {
+        for (i = length; i>0; i--)
+          columnNames[i]= this.columnName(i-1);
+      }
+    
+      mapping rowHeaderMapping;
+      
+      for(i=1; i<=length; i++)
+        rowHeaderMapping[columnNames[i]] = alertRow[i];
+      
+      mTableMultipleRows[j] = rowHeaderMapping;
+    }
+    
+    diSelectedLines = this.getSelectedLines();
+  }
+
+  aes_onRightClick( g_propDpNameBot, AESTAB_BOT, this.name, row, column, value, mTableMultipleRows, diSelectedLines );
+}
+
+" 0
+ "main()
+{
+  int row, column;
+  anytype value;
+  mapping mTableRow;
+  
+  synchronized(g_bTableLineSynchronisation)
+  { 
+    int length;
+    dyn_anytype alertRow;  
+        
+    // determine position 
+    getValue(\"\",\"currentCell\", row, column );
+    // and content of active cell !
+    getValue(\"\",\"cellValue\", value );
+
+    alertRow = this.getLineN(row);
+    length = dynlen(alertRow);
+    for(int i=1; i<=length; i++)
+      mTableRow[this.columnName(i-1)] = alertRow[i];
+  }
+
+  aes_doColumnDblClick( g_propDpNameBot, row, column, value, mTableRow );
+}
+" 0
+
+16 0 0 0 0 0
+"main()
+{
+  reg_main.namedActiveRegister( AES_TABNAME_BOT );
+}" 0
+ E E
+0
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+1
+"scrolledCB" "synchronized main()
+{
+  aes_scrollHandling(AESTAB_BOT, g_iLineHoldThreadBot);
+}"
+4
+LANG:1 26 Arial,-1,12,5,40,0,0,0,0,0
+LANG:10000 26 Arial,-1,12,5,40,0,0,0,0,0
+LANG:10001 26 Arial,-1,12,5,40,0,0,0,0,0
+LANG:10027 26 arial,-1,12,5,40,0,0,0,0,0
+0  8 308 1022 622
+"mapping  g_mQueryReplies;
+dyn_string g_dsSystems;
+
+// neu - fuer bessere performance in callback
+bool g_firstHL = true;
+bool lastSystem = false;
+int g_screenType;
+// property dp name
+string g_propDp;
+// Top/Bot info
+int g_tabType;
+// column name of register tab ( to build the tabheader eg Top/Alerts/Open )
+string g_regColumn;
+// mode
+int g_valType;
+dyn_string g_systemSelections;
+
+//////// neue variablen fuer configMatrix, settings and table eval commands append/update/delete
+dyn_dyn_anytype g_configMatrix;
+dyn_anytype     g_configSettings;
+
+string          g_tableCmdAppend;
+string          g_tableCmdUpdate;
+string          g_tableCmdDelete;
+
+dyn_string      g_colNames;
+bool            g_useFontProp;
+int             g_dpidIdx;
+int             g_timeIdx;
+int             g_countIdx;
+
+dyn_string      g_attrList;
+
+//*****************************
+// from old as/es_init() ***begin
+
+// momentan wird das prefix as fuer beide verwendet / es routinen werden angepasst
+// arbeitsvariablen muessen scriptglobal( pro tabelle) sein !!!!!!!!!!!
+int g_asDisplayLines = 0;
+int g_asDisplayDpes = 0;
+int g_asDisplayHours = 0;
+
+// halten die werte fuer AES_TYPEFILTER/TYPECONST ( == panelglobal )
+dyn_string g_typeFilter;
+dyn_int g_typeConst;
+
+//*****************************
+// from old aes_init() *****end
+
+
+///////////////////////////////////////////////
+// from old screen ***********************begin
+// new
+bool     g_historicalData;
+int      g_historicalDataInterval;   // display interval in sec back from now / only open mode 
+int      g_queryBlockedTime; // holds to queryblocktime in ms / see general settings
+dyn_bool g_colVis;           // holds the flag wheter an optional column is visible or not
+string   g_connectId;        // holds id of current query
+dyn_string g_counterConnectId; // holds numbers of Id's
+dyn_string g_closedIdf;      // new
+
+bool     g_checkAll;         // holds property setting - connect all systems
+time     g_timeLastUpdate;   // holds time of the last update
+string   g_dpCommentFilter;  // store filter
+
+bool     g_showInternals;    // value from _Config.ShowInternals
+
+bool     g_showInternalsA;    // value from _Config.ShowInternalDPs.Alerts
+bool     g_showInternalsAR;   // value from _Config.ShowInternalDPs.AlertRow
+bool     g_showInternalsE;    // value from _Config.ShowInternalDPs.Events
+
+unsigned g_maxClosedLines;   // max num of lines to be queried by closed protocoll
+unsigned g_state;            // alert-state filter
+
+int g_busyThread;    // id of thread, which shows busyness
+
+int g_maxLines;      // num of max lines in open protocoll
+
+// TI 14075 (discarding pending values)
+int        g_discardThread;
+time       g_discardStart;
+bool       g_discarded;
+const time MINCB_TIME = 2;
+const time MAXCB_TIME = 5;
+
+// characters for status-bits in current language
+// only for Events
+char g_Cdefault, g_Cout_prange, g_Cinvalid, g_Cfrom_GI, g_Cuserbit1, g_Cuserbit2;
+
+// IM 114080 - moved from aes.ctl
+dyn_string g_dsWorkAttr, g_dsWorkName, g_dsWorkVsbl;
+
+///////////////////////////////////////////////
+// from old screen *************************end
+
+main()
+{
+  aes_initMainTable( AESTAB_BOT );
+}
+" 0
+"main(int row, string column, string value)
+{
+  mapping mTableRow;
+  
+  synchronized(g_bTableLineSynchronisation)
+  { 
+    int length;
+    dyn_anytype alertRow;  
+    
+    alertRow = this.getLineN(row);
+    
+    length = dynlen(alertRow);
+    for(int i=1; i<=length; i++)
+      mTableRow[this.columnName(i-1)] = alertRow[i];
+  }
+ 
+  aes_doColumnClick( AESTAB_BOT, row, column, value, mTableRow );
+}
+" 0
+ 1 0 1 60 66 "#1" 3 1 1 "s" 4
+LANG:1 2 #1
+LANG:10000 4 Time
+LANG:10001 2 #1
+LANG:10027 10 Время
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+40 "#2" 2 1 1 "s" 4
+LANG:1 2 #2
+LANG:10000 2 #2
+LANG:10001 2 #2
+LANG:10027 2 #2
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+33 "#3" 16 1 1 "s" 4
+LANG:1 2 #3
+LANG:10000 2 #3
+LANG:10001 2 #3
+LANG:10027 2 #3
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+153 "#4" 24 1 1 "s" 4
+LANG:1 2 #4
+LANG:10000 2 #4
+LANG:10001 2 #4
+LANG:10027 2 #4
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+232 "#5" 16 1 1 "s" 4
+LANG:1 2 #5
+LANG:10000 2 #5
+LANG:10001 2 #5
+LANG:10027 2 #5
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+152 "#6" 3 1 1 "s" 4
+LANG:1 2 #6
+LANG:10000 2 #6
+LANG:10001 2 #6
+LANG:10027 2 #6
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+43 "#7" 5 1 1 "s" 4
+LANG:1 2 #7
+LANG:10000 2 #7
+LANG:10001 2 #7
+LANG:10027 2 #7
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+61 "#8" 2 1 1 "s" 4
+LANG:1 2 #8
+LANG:10000 2 #8
+LANG:10001 2 #8
+LANG:10027 2 #8
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+32 "#9" 14 1 1 "s" 4
+LANG:1 2 #9
+LANG:10000 2 #9
+LANG:10001 2 #9
+LANG:10027 2 #9
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+136 "#10" 3 1 1 "s" 4
+LANG:1 3 #10
+LANG:10000 3 #10
+LANG:10001 3 #10
+LANG:10027 3 #10
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+38 "#11" 1 1 1 "s" 4
+LANG:1 3 #11
+LANG:10000 3 #11
+LANG:10001 3 #11
+LANG:10027 3 #11
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#12" 1 1 1 "s" 4
+LANG:1 3 #12
+LANG:10000 3 #12
+LANG:10001 3 #12
+LANG:10027 3 #12
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#13" 1 1 1 "s" 4
+LANG:1 3 #13
+LANG:10000 3 #13
+LANG:10001 3 #13
+LANG:10027 3 #13
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#14" 1 1 1 "s" 4
+LANG:1 3 #14
+LANG:10000 3 #14
+LANG:10001 3 #14
+LANG:10027 3 #14
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#15" 1 1 1 "s" 4
+LANG:1 3 #15
+LANG:10000 3 #15
+LANG:10001 3 #15
+LANG:10027 3 #15
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#16" 1 1 1 "s" 4
+LANG:1 3 #16
+LANG:10000 3 #16
+LANG:10001 3 #16
+LANG:10027 3 #16
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#17" 1 1 1 "s" 4
+LANG:1 3 #17
+LANG:10000 3 #17
+LANG:10001 3 #17
+LANG:10027 3 #17
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#18" 1 1 1 "s" 4
+LANG:1 3 #18
+LANG:10000 3 #18
+LANG:10001 3 #18
+LANG:10027 3 #18
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#19" 1 1 1 "s" 4
+LANG:1 3 #19
+LANG:10000 3 #19
+LANG:10001 3 #19
+LANG:10027 3 #19
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#20" 1 1 1 "s" 4
+LANG:1 3 #20
+LANG:10000 3 #20
+LANG:10001 3 #20
+LANG:10027 3 #20
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#21" 1 1 1 "s" 4
+LANG:1 3 #21
+LANG:10000 3 #21
+LANG:10001 3 #21
+LANG:10027 3 #21
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#22" 1 1 1 "s" 4
+LANG:1 3 #22
+LANG:10000 3 #22
+LANG:10001 3 #22
+LANG:10027 3 #22
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#23" 1 1 1 "s" 4
+LANG:1 3 #23
+LANG:10000 3 #23
+LANG:10001 3 #23
+LANG:10027 3 #23
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#24" 1 1 1 "s" 4
+LANG:1 3 #24
+LANG:10000 3 #24
+LANG:10001 3 #24
+LANG:10027 3 #24
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#25" 1 1 1 "s" 4
+LANG:1 3 #25
+LANG:10000 3 #25
+LANG:10001 3 #25
+LANG:10027 3 #25
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#26" 1 1 1 "s" 4
+LANG:1 3 #26
+LANG:10000 3 #26
+LANG:10001 3 #26
+LANG:10027 3 #26
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#27" 1 1 1 "s" 4
+LANG:1 3 #27
+LANG:10000 3 #27
+LANG:10001 3 #27
+LANG:10027 3 #27
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#28" 1 1 1 "s" 4
+LANG:1 3 #28
+LANG:10000 3 #28
+LANG:10001 3 #28
+LANG:10027 3 #28
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#29" 1 1 1 "s" 4
+LANG:1 3 #29
+LANG:10000 3 #29
+LANG:10001 3 #29
+LANG:10027 3 #29
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#30" 1 1 1 "s" 4
+LANG:1 3 #30
+LANG:10000 3 #30
+LANG:10001 3 #30
+LANG:10027 3 #30
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#31" 1 0 1 "s" 4
+LANG:1 3 #31
+LANG:10000 3 #31
+LANG:10001 3 #31
+LANG:10027 3 #31
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#32" 1 0 1 "s" 4
+LANG:1 3 #32
+LANG:10000 3 #32
+LANG:10001 3 #32
+LANG:10027 3 #32
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#33" 1 0 1 "s" 4
+LANG:1 3 #33
+LANG:10000 3 #33
+LANG:10001 3 #33
+LANG:10027 3 #33
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#34" 1 0 1 "s" 4
+LANG:1 3 #34
+LANG:10000 3 #34
+LANG:10001 3 #34
+LANG:10027 3 #34
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#35" 1 0 1 "s" 4
+LANG:1 3 #35
+LANG:10000 3 #35
+LANG:10001 3 #35
+LANG:10027 3 #35
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#36" 0 0 1 "s" 4
+LANG:1 3 #36
+LANG:10000 3 #36
+LANG:10001 3 #36
+LANG:10027 3 #36
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 "#37" 0 0 1 "s" 4
+LANG:1 3 #37
+LANG:10000 3 #37
+LANG:10001 3 #37
+LANG:10027 3 #37
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 "#38" 0 0 1 "s" 4
+LANG:1 3 #38
+LANG:10000 3 #38
+LANG:10001 3 #38
+LANG:10027 3 #38
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 "#39" 0 0 1 "s" 4
+LANG:1 3 #39
+LANG:10000 3 #39
+LANG:10001 3 #39
+LANG:10027 3 #39
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 "#40" 0 0 1 "s" 4
+LANG:1 3 #40
+LANG:10000 3 #40
+LANG:10001 3 #40
+LANG:10027 3 #40
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 "#41" 0 0 1 "s" 4
+LANG:1 3 #41
+LANG:10000 3 #41
+LANG:10001 3 #41
+LANG:10027 3 #41
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 "#42" 0 0 1 "s" 4
+LANG:1 3 #42
+LANG:10000 3 #42
+LANG:10001 3 #42
+LANG:10027 3 #42
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 "#43" 0 0 1 "s" 4
+LANG:1 3 #43
+LANG:10000 3 #43
+LANG:10001 3 #43
+LANG:10027 3 #43
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 "#44" 0 0 1 "s" 4
+LANG:1 3 #44
+LANG:10000 3 #44
+LANG:10001 3 #44
+LANG:10027 3 #44
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 "#45" 0 0 1 "s" 4
+LANG:1 3 #45
+LANG:10000 3 #45
+LANG:10001 3 #45
+LANG:10027 3 #45
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 "#46" 0 0 1 "s" 4
+LANG:1 3 #46
+LANG:10000 3 #46
+LANG:10001 3 #46
+LANG:10027 3 #46
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 "#47" 0 0 1 "s" 4
+LANG:1 3 #47
+LANG:10000 3 #47
+LANG:10001 3 #47
+LANG:10027 3 #47
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 "#48" 0 0 1 "s" 4
+LANG:1 3 #48
+LANG:10000 3 #48
+LANG:10001 3 #48
+LANG:10027 3 #48
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 "#49" 0 0 1 "s" 4
+LANG:1 3 #49
+LANG:10000 3 #49
+LANG:10001 3 #49
+LANG:10027 3 #49
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 "#50" 0 0 1 "s" 4
+LANG:1 3 #50
+LANG:10000 3 #50
+LANG:10001 3 #50
+LANG:10027 3 #50
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 "#51" 0 0 1 "s" 4
+LANG:1 3 #51
+LANG:10000 3 #51
+LANG:10001 3 #51
+LANG:10027 3 #51
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 "#52" 0 0 1 "s" 4
+LANG:1 3 #52
+LANG:10000 3 #52
+LANG:10001 3 #52
+LANG:10027 3 #52
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 "#53" 0 0 1 "s" 4
+LANG:1 3 #53
+LANG:10000 3 #53
+LANG:10001 3 #53
+LANG:10027 3 #53
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 "#54" 0 0 1 "s" 4
+LANG:1 3 #54
+LANG:10000 3 #54
+LANG:10001 3 #54
+LANG:10027 3 #54
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 "#55" 0 0 1 "s" 4
+LANG:1 3 #55
+LANG:10000 3 #55
+LANG:10001 3 #55
+LANG:10027 3 #55
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 "#56" 0 0 1 "s" 4
+LANG:1 3 #56
+LANG:10000 3 #56
+LANG:10001 3 #56
+LANG:10027 3 #56
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 "#57" 0 0 1 "s" 4
+LANG:1 3 #57
+LANG:10000 3 #57
+LANG:10001 3 #57
+LANG:10027 3 #57
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 "#58" 0 0 1 "s" 4
+LANG:1 3 #58
+LANG:10000 3 #58
+LANG:10001 3 #58
+LANG:10027 3 #58
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 "#59" 0 0 1 "s" 4
+LANG:1 3 #59
+LANG:10000 3 #59
+LANG:10001 3 #59
+LANG:10027 3 #59
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 "#60" 0 0 1 "s" 4
+LANG:1 3 #60
+LANG:10000 3 #60
+LANG:10001 3 #60
+LANG:10027 3 #60
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 
+17 17 "" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+8 30
+4
+LANG:1 26 Arial,-1,12,5,40,0,0,0,0,0
+LANG:10000 26 Arial,-1,12,5,40,0,0,0,0,0
+LANG:10001 26 Arial,-1,12,5,40,0,0,0,0,0
+LANG:10027 26 arial,-1,12,5,40,0,0,0,0,0
+0 0 2 1 1 7
+1 0
+22 19
+"cb_aesConfig"
+""
+1 760.0000000000001 759 E E E 1 E 1 E N {0,0,0} E N "_Window" E E
+ E E
+17 0 0 0 0 0
+E E E
+0
+4
+LANG:1 20 Screen configuration
+LANG:10000 19 Schirmkonfigutation
+LANG:10001 20 Screen configuration
+LANG:10027 37 Конфигурация экрана
+
+0
+4
+LANG:1 26 Arial,-1,13,5,40,0,0,0,0,0
+LANG:10000 26 Arial,-1,13,5,40,0,0,0,0,0
+LANG:10001 26 Arial,-1,13,5,40,0,0,0,0,0
+LANG:10027 26 Arial,-1,13,5,40,0,0,0,0,0
+0  758 758 932 785
+0
+
+E
+"main()
+{
+  string screenConfigName;
+  
+  screenConfigName=this.text;
+  aes_screenConfigChanged( screenConfigName );
+
+}" 0
+
+E
+ 0 0
+13 20
+"pb_close"
+""
+1 937 759 E E E 1 E 1 E N "_ButtonText" E N "_Button" E E
+ E E
+18 0 0 0 0 0
+E E E
+0
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0
+4
+LANG:1 26 Arial,-1,13,5,40,0,0,0,0,0
+LANG:10000 26 Arial,-1,13,5,40,0,0,0,0,0
+LANG:10001 26 Arial,-1,13,5,40,0,0,0,0,0
+LANG:10027 26 Arial,-1,13,5,40,0,0,0,0,0
+0  935 758 1023 786
+
+T 
+4
+LANG:1 5 Close
+LANG:10000 10 Schließen
+LANG:10001 5 Close
+LANG:10027 14 Закрыть
+"main()
+{
+  aes_panelOff( true );
+}" 0
+ E E E
+13 21
+"cmdHelp"
+""
+1 20 760 E E E 1 E 1 E N "_ButtonText" E N "_Button" E E
+ E E
+19 0 0 0 112 0
+E E E
+0
+4
+LANG:1 16 Online help [F1]
+LANG:10000 17 Online Hilfe [F1]
+LANG:10001 16 Online help [F1]
+LANG:10027 19 Справка [F1]
+
+0
+4
+LANG:1 26 Arial,-1,13,5,40,0,0,0,0,0
+LANG:10000 26 Arial,-1,13,5,40,0,0,0,0,0
+LANG:10001 26 Arial,-1,13,5,40,0,0,0,0,0
+LANG:10027 26 Arial,-1,13,5,40,0,0,0,0,0
+0  18 758 106 786
+
+T 
+4
+LANG:1 4 Help
+LANG:10000 5 Hilfe
+LANG:10001 4 Help
+LANG:10027 14 Справка
+"main()
+{
+ std_help(\"AES_MainGeneral\", TRUE);
+}
+" 0
+ E E E
+14 25
+"TextField1"
+""
+1 650 628 E E E 1 E 0 E N "_WindowText" E N "_Window" E E
+ E E
+22 0 0 0 0 0
+E E E
+0
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0
+4
+LANG:1 26 Arial,-1,13,5,40,0,0,0,0,0
+LANG:10000 26 Arial,-1,13,5,40,0,0,0,0,0
+LANG:10001 26 Arial,-1,13,5,40,0,0,0,0,0
+LANG:10027 26 Arial,-1,13,5,40,0,0,0,0,0
+0  648 626 842 653
+3 "0s" 0 0 0 0 0 -1  E "main()
+{
+  this.text=myUiNumber() + \"_\" + myModuleName();
+}" 0
+ E
+1 28 0 "" 0
+0
+29 11
+"sl_gauge"
+""
+1 1020 1.099120794378905e-013 E E E 1 E 0 E N "_3DText" E N "_3DFace" E E
+ E E
+11 0 0 0 0 0
+E E E
+0
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+8
+"invertedAppearance" "bool TRUE"
+"maxValue" "int 99"
+"tickInterval" "int 1"
+"value" "int 50"
+"backgroundOrigin" "enum 0"
+"lineStep" "int 1"
+"minValue" "int 1"
+"invertedAppearance" "bool TRUE"
+4
+LANG:1 35 MS Shell Dlg 2,-1,11,5,50,0,0,0,0,0
+LANG:10000 35 MS Shell Dlg 2,-1,11,5,50,0,0,0,0,0
+LANG:10001 35 MS Shell Dlg 2,-1,11,5,50,0,0,0,0,0
+LANG:10027 35 MS Shell Dlg 2,-1,11,5,50,0,0,0,0,0
+0  1020 0 1043 620
+12 SliderWidget
+2
+0 "Slide" "(int value)"
+"  int perc;
+  bool fromSlider=true;
+
+  perc=this.value;
+  
+  if( g_regInitReady == AES_INITSTATE_OK ) 
+  {
+    aes_setSplitPosition( g_top, g_bottom, perc, fromSlider );
+  }"
+0 "Change" "(int value)"
+"  int perc;
+  bool fromSlider=true;
+
+  perc=this.value;
+  
+  if( g_regInitReady == AES_INITSTATE_OK ) 
+  {
+    aes_setSplitPosition( g_top, g_bottom, perc, fromSlider );
+  }"
+"int oldVal=0;
+
+main()
+{
+  int perc;
+
+  while( g_regInitReady == AES_INITSTATE_WAITING )
+  {    
+    delay( 0, 50 );
+  }
+
+  if( g_regInitReady == AES_INITSTATE_FAILURE )
+  {
+    return;
+  } 
+  
+  while( true )
+  {
+    perc=this.value;
+    if( perc != oldVal )
+    {
+      if( perc >= 0 && perc <= 100 )
+      {
+        while (!shapeExists(\"te_proportionTop\") || !shapeExists(\"te_proportionBot\"))
+           delay(0,100);
+
+        setMultiValue(
+          \"te_proportionTop\", \"text\", perc,
+          \"te_proportionBot\", \"text\", 100-perc );
+
+        oldVal=perc;
+        // save info to dp(only top)
+        dpSetCache( g_propDpNameTop+\".Settings.Proportion\"+AES_ORIVAL, perc );
+      }
+    }
+        
+    delay( 0, 500 );
+  }
+}" 0
+13 12
+"bt_topFull"
+""
+1 1022 0 E E E 1 E 0 E N "_ButtonText" E N "_Button" E E
+ E E
+12 0 0 0 0 0
+E E E
+0
+4
+LANG:1 29 Expand top table to full size
+LANG:10000 43 Expandiere obere Tabelle auf Maximalgröße
+LANG:10001 29 Expand top table to full size
+LANG:10027 73 Максимально развернуть верхнюю таблицу
+
+0
+4
+LANG:1 26 Arial,-1,13,5,40,0,0,0,0,0
+LANG:10000 26 Arial,-1,13,5,40,0,0,0,0,0
+LANG:10001 26 Arial,-1,13,5,40,0,0,0,0,0
+LANG:10027 26 Arial,-1,13,5,40,0,0,0,0,0
+0  1020 -2 1044 32
+
+P 
+10040064
+"12.png"
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+"main()
+{
+  aes_setTopFullSize( g_top, g_bottom );
+}" 0
+ E E E
+13 15
+"bt_topSplit"
+""
+1 1022 0 E E E 1 E 0 E N "_ButtonText" E N "_Button" E E
+ E E
+15 0 0 0 0 0
+E E E
+0
+4
+LANG:1 20 Change to split view
+LANG:10000 29 Wechsle zur Splittdarstellung
+LANG:10001 20 Change to split view
+LANG:10027 67 Перейти к раздельному представлению
+
+0
+4
+LANG:1 26 Arial,-1,13,5,40,0,0,0,0,0
+LANG:10000 26 Arial,-1,13,5,40,0,0,0,0,0
+LANG:10001 26 Arial,-1,13,5,40,0,0,0,0,0
+LANG:10027 26 Arial,-1,13,5,40,0,0,0,0,0
+0  1020 -2 1044 32
+
+P 
+10040064
+"15.png"
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+"main()
+{
+  // g_percent - state before full mode
+  aes_resetSplitPosition( g_top, g_bottom );
+}" 0
+ E E E
+13 14
+"bt_botFull"
+""
+1 1022 589 E E E 1 E 0 E N "_ButtonText" E N "_Button" E E
+ E E
+14 0 0 0 0 0
+E E E
+0
+4
+LANG:1 32 Expand bottom table to full size
+LANG:10000 44 Expandiere untere Tabelle auf Maximalgröße
+LANG:10001 32 Expand bottom table to full size
+LANG:10027 71 Максимально развернуть нижнюю таблицу
+
+0
+4
+LANG:1 26 Arial,-1,13,5,40,0,0,0,0,0
+LANG:10000 26 Arial,-1,13,5,40,0,0,0,0,0
+LANG:10001 26 Arial,-1,13,5,40,0,0,0,0,0
+LANG:10027 26 Arial,-1,13,5,40,0,0,0,0,0
+0  1020 587 1044 621
+
+P 
+10040064
+"14.png"
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+"main()
+{
+  aes_setBottomFullSize( g_top, g_bottom );
+}" 0
+ E E E
+13 16
+"bt_botSplit"
+""
+1 1022 589 E E E 1 E 0 E N "_ButtonText" E N "_Button" E E
+ E E
+16 0 0 0 0 0
+E E E
+0
+4
+LANG:1 20 Change to split view
+LANG:10000 29 Wechsle zur Splittdarstellung
+LANG:10001 20 Change to split view
+LANG:10027 67 Перейти к раздельному представлению
+
+0
+4
+LANG:1 26 Arial,-1,13,5,40,0,0,0,0,0
+LANG:10000 26 Arial,-1,13,5,40,0,0,0,0,0
+LANG:10001 26 Arial,-1,13,5,40,0,0,0,0,0
+LANG:10027 26 Arial,-1,13,5,40,0,0,0,0,0
+0  1020 587 1044 621
+
+P 
+10040064
+"16.png"
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+"main()
+{
+  // g_percent - state before full mode
+  aes_resetSplitPosition( g_top, g_bottom );
+}" 0
+ E E E
+0
+LAYER, 1 
+1
+LANG:1 6 Layer2
+0
+LAYER, 2 
+1
+LANG:1 6 Layer3
+0
+LAYER, 3 
+1
+LANG:1 6 Layer4
+0
+LAYER, 4 
+1
+LANG:1 6 Layer5
+0
+LAYER, 5 
+1
+LANG:1 6 Layer6
+0
+LAYER, 6 
+1
+LANG:1 6 Layer7
+0
+LAYER, 7 
+1
+LANG:1 6 Layer8
+0
+3 0 "PANEL_REF0" -1
+"" ""
+"objects_parts/STD_OBJECTS/ButtonBarBackground.pnl" 115 735 T 23 2.225176157441873 0 1 -285.8952581058154 15
+0
+0
diff --git a/MAC/Navigator2/panels/vision/aes/saved_AESRow.pnl b/MAC/Navigator2/panels/vision/aes/saved_AESRow.pnl
new file mode 100644
index 0000000000000000000000000000000000000000..e703d60b9be355049329b5a0d4f142e42244186f
--- /dev/null
+++ b/MAC/Navigator2/panels/vision/aes/saved_AESRow.pnl
@@ -0,0 +1,2570 @@
+V 13
+4
+LANG:1 6 AESRow
+LANG:10000 7 AEZeile
+LANG:10001 6 AESRow
+LANG:10027 25 Строка аларма
+PANEL,-1 -1 1091 50 N "_3DFace" 1
+"$SCREENTYPE"
+"int oldVal=0;
+
+main()
+{
+  synchronized(bSync)
+  {
+    g_regInitReady=AES_INITSTATE_WAITING;
+    dpGetCache(\"_Config.TimeoutJumping:_online.._value\", g_uJumpingTimeout);
+
+    int perc;
+    delay(0,100);  // necesary for langswitch
+
+    while( g_regInitReady == AES_INITSTATE_WAITING )
+    {    
+      delay( 0, 100 );  // $$$ war 300
+    }
+
+    if( g_regInitReady == AES_INITSTATE_FAILURE )
+    {
+      return;
+    } 
+
+      perc=100;  
+      if(TRUE)
+      {
+        if( perc >= 0 && perc <= 100 )
+        {
+          while (!shapeExists(\"te_proportionTop\") || !shapeExists(\"te_proportionBot\"))
+             delay(0,100);
+      
+          setMultiValue(
+            \"te_proportionTop\", \"text\", perc,
+            \"te_proportionBot\", \"text\", 100-perc );
+
+          oldVal=perc;
+          //save info to dp(only top)
+          dpSetCache( g_propDpNameTop+\".Settings.Proportion\"+AES_ORIVAL, perc );
+        }
+      }
+  }    
+        
+}" 0
+ E E E E 1 -1 -1 0  68 1230
+""0  1
+E "#uses \"aec.ctl\"
+#uses \"aes.ctl\"
+#uses \"aesuser.ctl\"
+//#uses \"dpGroups.ctl\"
+/////// neuer Teil - nicht loeschen
+///////////////////////////////////
+
+mapping  g_mQueryReplies;
+dyn_string g_dsSystems;
+bool g_bTableLineSynchronisation;
+unsigned g_uJumpingTimeout;
+int g_iLineHoldThreadTop = -2;
+bool bSync;
+
+bool g_initFromAES;
+dyn_anytype vst;
+dyn_anytype vstn;
+bool g_langSwitched=false;
+int g_lsActiveRegister;
+string g_lsActiveScreenConfig;
+int g_lsProportion;
+
+bool g_firstHL=true;
+int g_arHeight=1;
+
+// flag for table init - wait for start operation
+bool g_regGeneralInit=false;
+
+bool p_startAction=false;
+string p_screenConfig;
+int p_action;
+string p_fileName;
+bool p_dispSlider=true;
+
+const bool g_autoAction=true;   // flag for automatic run
+const bool g_alertRow=true;    // flag to indicate alert row mode
+
+// neu
+dyn_anytype ddaRes;
+dyn_dyn_anytype vstn;   // new vst for AESCREEN => not global
+
+dyn_string      g_visibleColumnsTop;// da die sichtbaren Spalten auch die Reihenfolge im AS bestimmen
+dyn_string      g_visibleColumnsBot;// da die sichtbaren Spalten auch die Reihenfolge im AS bestimmen
+
+// speichert die letzte selektierte  registerkarte
+// wird in regChanged event beruecksichtigt um config und configList der
+// registerkarten top/bot mit general zu synchronisieren !!!
+// ACHTUNG - bei querystart muss immer die konfiguration der activen registerkarte verwendet werden !!!!!!
+// init mit 2 => entspricht reg_general
+unsigned g_lastActiveRegister=AESREGTAB_GENERAL;
+// header names for register tabs
+dyn_string g_regHeaderNames;
+
+// reg init statusinformation - important for table init routine ( _propDP check )
+int g_regInitReady=AES_INITSTATE_WAITING;
+
+// panel global propDP names ( _AESProperties )
+string g_propDpNameTop;   // name changed from gp_propDpName
+string g_propDpNameBot;
+
+// keeps the menuinformation
+dyn_dyn_anytype g_ddam;
+
+// global variables for shape information ( for top and bottom table )
+shape g_top;
+shape g_bottom;
+// §§§ alle panelglobalen mit gp !!!!!!!! damit kein konflikt mit scriptglobalen !!!!!
+
+/////// neuer Teil - nicht loeschen / end
+/////////////////////////////////////////
+
+int firstAlertMenu, lastAlertMenu;
+int firstEventMenu, lastEventMenu;
+int firstAlertRowMenu, lastAlertRowMenu;
+//****************************
+// from as/es_init() ****begin
+
+////// alerts
+//***********
+int AS_HIST_RANGE_SEC = 3600*24;
+int E_AS_FUNCTION = 0;
+int E_AS_DP_VAL = 1;
+dyn_string AS_TYPEFILTER;   // init in aes_initMainReg()
+dyn_int AS_TYPECONST;
+
+////// events
+//***********
+int ES_HIST_RANGE_SEC = 3600*24;
+int E_ES_FUNCTION = 0;
+int E_ES_DP_VAL = 1;
+dyn_string ES_TYPEFILTER;  // init in aes_initMainReg()
+dyn_int ES_TYPECONST;
+
+// §§§ ACHTUNG jetzt noch as - in zukunft aes oder ohne prefix !!!!!!!!!!!!!!!!
+// init ==> see aes_initOldScreenVariables() / initRegMain()
+int g_asMaxLinesToDisplay=0;
+int g_asMaxDpeToDisplay=0;
+int g_asMaxDpeHourToDisplay=0;
+
+// global flag for active windowmanager
+bool g_motif;
+
+// sync flags for reggeneralinit
+bool g_ctrlFlagTop=false;
+bool g_ctrlFlagBot=false;
+
+// global variables for splitscreen treating
+int  g_percent=50;
+int  g_splitMax=100;
+int  g_splitMin=0;
+int  g_splitInc=10;
+bool g_splitInit=false;
+int  g_percent;
+int  g_snap=4;
+
+int   g_both_x;
+float g_both_w;
+string sDummyStringForDollarParameter1 = $SCREENTYPE;
+int   g_top_y;
+float g_total_h;
+
+// NAVIGATOR ADDONS
+#uses \"navigator.ctl\"
+
+//Global mainpoint holders
+string 			itsActionDp	= \"\";
+string 			itsEventDp      = \"\";
+dyn_string 	itsSelectionDp  = \"\";
+
+bool   bDoubleClicked  = false;
+
+// routine for single mouse click
+void click(int row) {
+    // set delay in case double click was meant
+  delay(0, 100); 
+  if (!bDoubleClicked) {
+  }
+}
+
+
+// routine for double mouse click
+void dblClick(string dp) 
+{  
+  // indicate this is a doubleClick
+  bDoubleClicked = true; 
+  string selection=\"\";
+  
+  LOG_TRACE(\"navigator_alerts.pnl:DoubleClicked|doubleClick received on alarmtable dp:\" + dp);
+ 
+
+  if (dpExists(dp) ) {
+    g_currentDatapoint=dp;
+    if (strpos(dp,\"LOFAR_PIC\") >= 0) {
+        selection=\"Hardware\";
+    } else if (strpos(dp,\"LOFAR_ObsSW\") >= 0) {
+      if (strpos(dp,\"Ctrl\") >= 0) {
+        selection=\"Processes\";
+      } else {
+        selection=\"Observations\";
+      }
+    } else if (strpos(dp,\"LOFAR_PermSW\") >= 0) {
+      selection=\"Processes\";
+    }
+    setEvent(selection,\"ChangeTab\");
+  }
+  
+  // set delay to avoid click event will be triggered
+  delay(0, 500);
+  bDoubleClicked = false;  
+}
+
+
+
+// routine for right mouse click
+void rClick(int row) {
+  LOG_TRACE(\"navigator_alerts.pnl:RightMouseClick|Right mouseclick received on alarmtable row: \" + row);  
+}
+// END NAVIGATOR ADDONS
+
+aes_scrollHandling(int tabType, int &iLineHoldThread)
+{
+  int propMode;
+  string propDpName;
+ 
+  if(g_uJumpingTimeout == 0)
+    return;
+  
+  propDpName = aes_getPropDpName(AES_DPTYPE_PROPERTIES, true, tabType);
+  aes_getPropMode(propDpName, propMode);
+  
+  if(iLineHoldThread == -2)
+  {
+    iLineHoldThread = -1;
+    return;
+  }
+  
+  if(iLineHoldThread != -1)
+  {
+    stopThread(iLineHoldThread);
+    iLineHoldThread = -1;
+  }
+  
+  if(propMode != AES_MODE_CLOSED)
+    iLineHoldThread = startThread(\"aes_lineHoldTimeoutThread\", tabType);
+}
+
+aes_lineHoldTimeoutThread(int tabType)
+{
+  delay(g_uJumpingTimeout);
+
+  if(tabType == AESTAB_TOP)
+    g_iLineHoldThreadTop = -2;
+  else
+    g_iLineHoldThreadBot = -2;
+  
+  this.lineVisible = -1;
+}
+
+" 0
+ 5
+"CBRef" "1"
+"EClose" E
+"ELangChanged" "main()
+{
+  delay(0,500);
+  
+  synchronized(bSync)
+  {
+    int areg;
+    string sconfig;
+
+    g_regInitReady=AES_INITSTATE_WAITING;
+
+    g_langSwitched=true;
+
+    setMultiValue( \"ar_currentLine\", \"text\", \"-\",
+                   \"as_lineCount\", \"text\", \"-\" );
+  
+    areg=reg_main.activeRegister;
+    sconfig=cb_aesConfig.selectedText;
+  
+    if( sconfig == \"\" )
+      sconfig=cb_aesConfig.text;
+
+    g_lsActiveRegister=areg;
+    g_lsActiveScreenConfig=sconfig;
+    g_lsProportion=g_percent;
+  
+    aes_doStop(g_propDpNameTop);
+    aes_doStart(g_propDpNameTop);
+  }
+}"
+"LangSwitchMode" "1"
+"dpi" "96"
+0 0 0
+""
+NC
+DISPLAY_LAYER, 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
+LAYER, 0 
+1
+LANG:1 6 Layer1
+2 18
+"Text1"
+""
+1 1021 21 E E E 1 E 1 E N "_3DText" E N "_Transparent" E E
+ E E
+16 0 0 0 0 0
+E E E
+0
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+3
+"sizePolicy" "Fixed Fixed"
+"dashclr"N "_Transparent"
+"antiAliased" "1"
+E E 0 1 1 0 1 E U  0 E 1021 21 1027 36
+0 2 2 "0s" 0 0 0 192 0 0  1021 21 1
+4
+LANG:1 26 Arial,-1,13,5,40,0,0,0,0,0
+LANG:10000 26 Arial,-1,13,5,40,0,0,0,0,0
+LANG:10001 26 Arial,-1,13,5,40,0,0,0,0,0
+LANG:10027 26 Arial,-1,13,5,40,0,0,0,0,0
+0 4
+LANG:1 1 /
+LANG:10000 1 /
+LANG:10001 1 /
+LANG:10027 1 /
+2 19
+"as_lineCount"
+""
+1 1028 21 E E E 1 E 1 E N "_3DText" E N "_Transparent" E E
+ E E
+17 0 0 0 0 0
+E E E
+0
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+3
+"sizePolicy" "Fixed Fixed"
+"dashclr"N "_Transparent"
+"antiAliased" "1"
+E E 0 1 1 0 1 E U  0 E 1028 21 1070 37
+0 2 2 "3d" 3 0 0 64 0 0  1028 21 1
+4
+LANG:1 26 Arial,-1,13,5,40,0,0,0,0,0
+LANG:10000 26 Arial,-1,13,5,40,0,0,0,0,0
+LANG:10001 26 Arial,-1,13,5,40,0,0,0,0,0
+LANG:10027 26 Arial,-1,13,5,40,0,0,0,0,0
+0 4
+LANG:1 1 0
+LANG:10000 1 0
+LANG:10001 1 0
+LANG:10027 1 0
+2 24
+"ar_currentLine"
+""
+1 977 21 E E E 1 E 1 E N "_3DText" E N "_Transparent" E E
+ E E
+22 0 0 0 0 0
+E E E
+0
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+3
+"sizePolicy" "Fixed Fixed"
+"dashclr"N "_Transparent"
+"antiAliased" "1"
+E E 0 1 1 0 1 E U  0 E 977 21 1019 37
+0 2 2 "3d" 3 0 0 66 0 0  977 21 1
+4
+LANG:1 26 Arial,-1,13,5,40,0,0,0,0,0
+LANG:10000 26 Arial,-1,13,5,40,0,0,0,0,0
+LANG:10001 26 Arial,-1,13,5,40,0,0,0,0,0
+LANG:10027 26 Arial,-1,13,5,40,0,0,0,0,0
+0 4
+LANG:1 1 0
+LANG:10000 1 0
+LANG:10001 1 0
+LANG:10027 1 0
+13 8
+"bt_splitUp"
+""
+1 10 20 E E E 1 E 0 E N "_ButtonText" E N "_Button" E E
+ E E
+8 0 0 0 0 0
+E E E
+0
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0
+4
+LANG:1 26 Arial,-1,13,5,40,0,0,0,0,0
+LANG:10000 26 Arial,-1,13,5,40,0,0,0,0,0
+LANG:10001 26 Arial,-1,13,5,40,0,0,0,0,0
+LANG:10027 26 Arial,-1,13,5,40,0,0,0,0,0
+0  8 18 22 27
+
+T 
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+"main()
+{
+  int perc;
+
+  perc=aes_incPercentage( false );
+  aes_setSplitPosition( g_top, g_bottom, perc );
+}" 0
+ E E E
+13 9
+"bt_splitDown"
+""
+1 10 20 E E E 1 E 0 E N "_ButtonText" E N "_Button" E E
+ E E
+9 0 0 0 0 0
+E E E
+0
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0
+4
+LANG:1 26 Arial,-1,13,5,40,0,0,0,0,0
+LANG:10000 26 Arial,-1,13,5,40,0,0,0,0,0
+LANG:10001 26 Arial,-1,13,5,40,0,0,0,0,0
+LANG:10027 26 Arial,-1,13,5,40,0,0,0,0,0
+0  8 18 22 27
+
+T 
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+"main()
+{
+  int perc;
+
+  perc=aes_incPercentage( true );
+  aes_setSplitPosition( g_top, g_bottom, perc );
+}" 0
+ E E E
+13 16
+"bt_botSplit"
+""
+1 20 20 E E E 1 E 0 E N "_ButtonText" E N "_Button" E E
+ E E
+16 0 0 0 0 0
+E E E
+0
+4
+LANG:1 20 Change to split view
+LANG:10000 29 Wechsle zur Splittdarstellung
+LANG:10001 20 Change to split view
+LANG:10027 67 Перейти к раздельному представлению
+
+0
+4
+LANG:1 26 Arial,-1,13,5,40,0,0,0,0,0
+LANG:10000 26 Arial,-1,13,5,40,0,0,0,0,0
+LANG:10001 26 Arial,-1,13,5,40,0,0,0,0,0
+LANG:10027 26 Arial,-1,13,5,40,0,0,0,0,0
+0  18 18 32 27
+
+T 
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+"main()
+{
+
+  // g_percent - state before full mode
+  aes_resetSplitPosition( g_top, g_bottom );
+/*
+  // enable split button
+  setMultiValue(
+    \"bt_topFull\",  \"visible\", true,
+    \"bt_botFull\",  \"visible\", true,
+    \"bt_botSplit\", \"visible\", false );
+
+  g_top.visible( true );
+      
+  // disable slider ( buttons )
+  if( g_motif )
+  {
+    setMultiValue(
+      \"bt_splitUp\",   \"visible\", true,
+      \"bt_splitDown\", \"visible\", true );
+  }
+  else
+  {
+    setMultiValue(
+     \"ax_gauge\", \"visible\", true );
+  }
+*/
+  //reg_main.registerVisible(AESREGTAB_TOP)=true;
+}" 0
+ E E E
+13 12
+"bt_topFull"
+""
+1 10 10 E E E 1 E 0 E N "_ButtonText" E N "_Button" E E
+ E E
+12 0 0 0 0 0
+E E E
+0
+4
+LANG:1 29 Expand top table to full size
+LANG:10000 41 Expandiere Top Tabelle auf Maximalgröße
+LANG:10001 29 Expand top table to full size
+LANG:10027 60 Максимизировать верхнюю таблицу
+
+0
+4
+LANG:1 26 Arial,-1,13,5,40,0,0,0,0,0
+LANG:10000 26 Arial,-1,13,5,40,0,0,0,0,0
+LANG:10001 26 Arial,-1,13,5,40,0,0,0,0,0
+LANG:10027 26 Arial,-1,13,5,40,0,0,0,0,0
+0  8 8 22 22
+
+T 
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+"main()
+{
+
+  aes_setTopFullSize( g_top, g_bottom );
+/*
+  // enable split button / activate register tab
+  setMultiValue(
+    \"bt_topFull\",  \"visible\", false,
+    \"bt_botFull\",  \"visible\", false,
+    \"bt_topSplit\", \"visible\", true,
+    AES_REGMAIN,   \"namedActiveRegister\", AES_TABNAME_TOP );
+    
+  // disable slider ( buttons )
+  if( g_motif )
+  {
+    setMultiValue(
+      \"bt_splitUp\",   \"visible\", false,
+      \"bt_splitDown\", \"visible\", false );
+  }
+  else
+  {
+    setMultiValue(
+     \"ax_gauge\", \"visible\", false );
+  }
+
+  //reg_main.registerVisible(AESREGTAB_BOT)=false;
+*/
+}" 0
+ E E E
+13 14
+"bt_botFull"
+""
+1 30 30 E E E 1 E 0 E N "_ButtonText" E N "_Button" E E
+ E E
+14 0 0 0 0 0
+E E E
+0
+4
+LANG:1 32 Expand bottom table to full size
+LANG:10000 44 Expandiere Bottom Tabelle auf Maximalgröße
+LANG:10001 32 Expand bottom table to full size
+LANG:10027 58 Максимизировать нижнюю таблицу
+
+0
+4
+LANG:1 26 Arial,-1,13,5,40,0,0,0,0,0
+LANG:10000 26 Arial,-1,13,5,40,0,0,0,0,0
+LANG:10001 26 Arial,-1,13,5,40,0,0,0,0,0
+LANG:10027 26 Arial,-1,13,5,40,0,0,0,0,0
+0  28 28 42 37
+
+T 
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+"main()
+{
+  aes_setBottomFullSize( g_top, g_bottom );
+/*
+  // enable split button / activate register tab
+  setMultiValue(
+    \"bt_topFull\",  \"visible\", false,
+    \"bt_botFull\",  \"visible\", false,
+    \"bt_botSplit\", \"visible\", true,
+    AES_REGMAIN,    \"namedActiveRegister\", AES_TABNAME_BOT );
+  
+  // disable slider ( buttons )
+  if( g_motif )
+  {
+    setMultiValue(
+      \"bt_splitUp\",   \"visible\", false,
+      \"bt_splitDown\", \"visible\", false );
+  }
+  else
+  {
+    setMultiValue(
+     \"ax_gauge\", \"visible\", false );
+  }
+*/
+  // Behandlung jetzt in controlCB
+  //reg_main.registerVisible(AESREGTAB_TOP)=false;
+}" 0
+ E E E
+25 17
+"table_bot"
+""
+1 10 20 E E E 1 E 0 E N "_WindowText" E N "_Window" E "// SimpleCtrlScriptStart {valid}
+main()
+{
+string sObjectName;
+getValue(\"\",\"name\",sObjectName);
+ep_acknowledgeTableFunction( sObjectName,\"1\",\"__V_dpid\",\"__V_time\",\"__V_count\",\"__V_ackable\");
+}
+// SimpleCtrlScript {EP_confirmTable}
+// Type {1}
+// Column_DPE {__V_dpid}
+// Column_Time {__V_time}
+// Column_Index {__V_count}
+// Column_Confirmable {__V_ackable}
+// SimpleCtrlScriptEnd {EP_confirmTable}
+" 0
+
+ "main()
+{
+  aes_onRightClick( g_propDpNameBot, AESTAB_BOT, this.name );
+
+/*
+  string propDp=g_propDpNameBot;
+  unsigned screenType;
+  int row, column;
+  anytype val;
+  
+  setInputFocus( myModuleName(), myPanelName(), this.name );
+
+  aes_getScreenType( propDp, screenType );
+
+  getValue(\"\",\"currentCell\",row, column );
+  val=this.cellValue;
+
+  aes_displayMenu( screenType, row, column, val, propDp, this.name );
+*/
+}" 0
+ "main()
+{
+  int row, column;
+  anytype value;
+
+  // determine position 
+  getValue(\"\",\"currentCell\", row, column );
+  // and content of active cell !
+  getValue(\"\",\"cellValue\", value );
+
+  aes_doColumnDblClick( g_propDpNameBot, row, column, value );
+}" 0
+
+16 0 0 0 0 0
+"main()
+{
+  reg_main.namedActiveRegister( AES_TABNAME_BOT );
+}" 0
+ E E
+0
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0
+4
+LANG:1 26 Arial,-1,12,5,40,0,0,0,0,0
+LANG:10000 26 Arial,-1,12,5,40,0,0,0,0,0
+LANG:10001 26 Arial,-1,12,5,40,0,0,0,0,0
+LANG:10027 26 arial,-1,12,5,40,0,0,0,0,0
+0  8 8 22 22
+"// neu - fuer bessere performance in callback
+bool g_firstHL;
+int g_screenType;
+// property dp name
+string g_propDp;
+// Top/Bot info
+int g_tabType;
+// column name of register tab ( to build the tabheader eg Top/Alerts/Open )
+string g_regColumn;
+// mode
+int g_valType;
+dyn_string g_systemSelections;
+
+//////// neue variablen fuer configMatrix, settings and table eval commands append/update/delete
+dyn_dyn_anytype g_configMatrix;
+dyn_anytype     g_configSettings;
+
+string          g_tableCmdAppend;
+string          g_tableCmdUpdate;
+string          g_tableCmdDelete;
+dyn_string      g_colNames;
+bool            g_useFontProp;
+int             g_dpidIdx;
+int             g_timeIdx;
+int             g_countIdx;
+
+dyn_string      g_attrList;
+dyn_string      g_visibleColumns;// da die sichtbaren Spalten auch die Reihenfolge im AS bestimmen
+
+//*****************************
+// from old as/es_init() ***begin
+
+// momentan wird das prefix as fuer beide verwendet / es routinen werden angepasst
+// arbeitsvariablen muessen scriptglobal( pro tabelle) sein !!!!!!!!!!!
+int g_asDisplayLines = 0;
+int g_asDisplayDpes = 0;
+int g_asDisplayHours = 0;
+
+// halten die werte fuer AES_TYPEFILTER/TYPECONST ( == panelglobal )
+dyn_string g_typeFilter;
+dyn_int g_typeConst;
+
+//*****************************
+// from old aes_init() *****end
+
+
+///////////////////////////////////////////////
+// from old screen ***********************begin
+// new
+bool     g_historicalData;
+int      g_historicalDataInterval;   // display interval in sec back from now / only open mode 
+int      g_queryBlockedTime; // holds to queryblocktime in ms / see general settings
+dyn_bool g_colVis;           // holds the flag wheter an optional column is visible or not
+string   g_connectId;        // holds id of current query
+time     g_timeLastUpdate;   // holds time of the last update
+string   g_dpCommentFilter;  // store filter
+
+bool     g_showInternals;    // value from _Config.ShowInternals
+
+bool     g_showInternalsA;    // value from _Config.ShowInternalDPs.Alerts
+bool     g_showInternalsAR;   // value from _Config.ShowInternalDPs.AlertRow
+bool     g_showInternalsE;    // value from _Config.ShowInternalDPs.Events
+
+unsigned g_maxClosedLines;   // max num of lines to be queried by closed protocoll
+unsigned g_state;            // alert-state filter
+
+int g_busyThread;    // id of thread, which shows busyness
+
+int g_maxLines;      // num of max lines in open protocoll
+
+// TI 14075 (discarding pending values)
+int        g_discardThread;
+time       g_discardStart;
+bool       g_discarded;
+const time MINCB_TIME = 2;
+const time MAXCB_TIME = 5;
+
+// characters for status-bits in current language
+// only for Events
+char g_Cdefault, g_Cout_prange, g_Cinvalid, g_Cfrom_GI, g_Cuserbit1, g_Cuserbit2;
+
+// IM 114080 - moved from aes.ctl
+dyn_string g_dsWorkAttr, g_dsWorkName, g_dsWorkVsbl;
+
+///////////////////////////////////////////////
+// from old screen *************************end
+
+main()
+{
+  aes_initMainTable( AESTAB_BOT );
+}
+" 0
+"main(int row, string column, string value)
+{
+  aes_doColumnClick( AESTAB_BOT, row, column, value );
+}" 0
+ 1 0 1 35 1 "#1" 3 1 1 "s" 4
+LANG:1 2 #1
+LANG:10000 4 Time
+LANG:10001 2 #1
+LANG:10027 10 Время
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+40 "#2" 2 1 1 "s" 4
+LANG:1 2 #2
+LANG:10000 2 #2
+LANG:10001 2 #2
+LANG:10027 2 #2
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+33 "#3" 16 1 1 "s" 4
+LANG:1 2 #3
+LANG:10000 2 #3
+LANG:10001 2 #3
+LANG:10027 2 #3
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+153 "#4" 24 1 1 "s" 4
+LANG:1 2 #4
+LANG:10000 2 #4
+LANG:10001 2 #4
+LANG:10027 2 #4
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+232 "#5" 16 1 1 "s" 4
+LANG:1 2 #5
+LANG:10000 2 #5
+LANG:10001 2 #5
+LANG:10027 2 #5
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+152 "#6" 3 1 1 "s" 4
+LANG:1 2 #6
+LANG:10000 2 #6
+LANG:10001 2 #6
+LANG:10027 2 #6
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+43 "#7" 5 1 1 "s" 4
+LANG:1 2 #7
+LANG:10000 2 #7
+LANG:10001 2 #7
+LANG:10027 2 #7
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+61 "#8" 2 1 1 "s" 4
+LANG:1 2 #8
+LANG:10000 2 #8
+LANG:10001 2 #8
+LANG:10027 2 #8
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+32 "#9" 14 1 1 "s" 4
+LANG:1 2 #9
+LANG:10000 2 #9
+LANG:10001 2 #9
+LANG:10027 2 #9
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+136 "#10" 3 1 1 "s" 4
+LANG:1 3 #10
+LANG:10000 3 #10
+LANG:10001 3 #10
+LANG:10027 3 #10
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+38 "#11" 1 1 1 "s" 4
+LANG:1 3 #11
+LANG:10000 3 #11
+LANG:10001 3 #11
+LANG:10027 3 #11
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#12" 1 1 1 "s" 4
+LANG:1 3 #12
+LANG:10000 3 #12
+LANG:10001 3 #12
+LANG:10027 3 #12
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#13" 1 1 1 "s" 4
+LANG:1 3 #13
+LANG:10000 3 #13
+LANG:10001 3 #13
+LANG:10027 3 #13
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#14" 1 1 1 "s" 4
+LANG:1 3 #14
+LANG:10000 3 #14
+LANG:10001 3 #14
+LANG:10027 3 #14
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#15" 1 1 1 "s" 4
+LANG:1 3 #15
+LANG:10000 3 #15
+LANG:10001 3 #15
+LANG:10027 3 #15
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#16" 1 1 1 "s" 4
+LANG:1 3 #16
+LANG:10000 3 #16
+LANG:10001 3 #16
+LANG:10027 3 #16
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#17" 1 1 1 "s" 4
+LANG:1 3 #17
+LANG:10000 3 #17
+LANG:10001 3 #17
+LANG:10027 3 #17
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#18" 1 1 1 "s" 4
+LANG:1 3 #18
+LANG:10000 3 #18
+LANG:10001 3 #18
+LANG:10027 3 #18
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#19" 1 1 1 "s" 4
+LANG:1 3 #19
+LANG:10000 3 #19
+LANG:10001 3 #19
+LANG:10027 3 #19
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#20" 1 1 1 "s" 4
+LANG:1 3 #20
+LANG:10000 3 #20
+LANG:10001 3 #20
+LANG:10027 3 #20
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#21" 1 1 1 "s" 4
+LANG:1 3 #21
+LANG:10000 3 #21
+LANG:10001 3 #21
+LANG:10027 3 #21
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#22" 1 1 1 "s" 4
+LANG:1 3 #22
+LANG:10000 3 #22
+LANG:10001 3 #22
+LANG:10027 3 #22
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#23" 1 1 1 "s" 4
+LANG:1 3 #23
+LANG:10000 3 #23
+LANG:10001 3 #23
+LANG:10027 3 #23
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#24" 1 1 1 "s" 4
+LANG:1 3 #24
+LANG:10000 3 #24
+LANG:10001 3 #24
+LANG:10027 3 #24
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#25" 1 1 1 "s" 4
+LANG:1 3 #25
+LANG:10000 3 #25
+LANG:10001 3 #25
+LANG:10027 3 #25
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#26" 1 1 1 "s" 4
+LANG:1 3 #26
+LANG:10000 3 #26
+LANG:10001 3 #26
+LANG:10027 3 #26
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#27" 1 1 1 "s" 4
+LANG:1 3 #27
+LANG:10000 3 #27
+LANG:10001 3 #27
+LANG:10027 3 #27
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#28" 1 1 1 "s" 4
+LANG:1 3 #28
+LANG:10000 3 #28
+LANG:10001 3 #28
+LANG:10027 3 #28
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#29" 1 1 1 "s" 4
+LANG:1 3 #29
+LANG:10000 3 #29
+LANG:10001 3 #29
+LANG:10027 3 #29
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#30" 1 1 1 "s" 4
+LANG:1 3 #30
+LANG:10000 3 #30
+LANG:10001 3 #30
+LANG:10027 3 #30
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#31" 1 0 1 "s" 4
+LANG:1 3 #31
+LANG:10000 3 #31
+LANG:10001 3 #31
+LANG:10027 3 #31
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#32" 1 0 1 "s" 4
+LANG:1 3 #32
+LANG:10000 3 #32
+LANG:10001 3 #32
+LANG:10027 3 #32
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#33" 1 0 1 "s" 4
+LANG:1 3 #33
+LANG:10000 3 #33
+LANG:10001 3 #33
+LANG:10027 3 #33
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#34" 1 0 1 "s" 4
+LANG:1 3 #34
+LANG:10000 3 #34
+LANG:10001 3 #34
+LANG:10027 3 #34
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#35" 1 0 1 "s" 4
+LANG:1 3 #35
+LANG:10000 3 #35
+LANG:10001 3 #35
+LANG:10027 3 #35
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 
+25 25 "" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+8 30
+4
+LANG:1 26 Arial,-1,12,5,40,0,0,0,0,0
+LANG:10000 26 Arial,-1,12,5,40,0,0,0,0,0
+LANG:10001 26 Arial,-1,12,5,40,0,0,0,0,0
+LANG:10027 26 arial,-1,12,5,40,0,0,0,0,0
+0 0 1 1 1 7
+1 0
+22 25
+"cb_aesConfig"
+""
+1 10 9 E E E 1 E 0 E N {0,0,0} E N "_Window" E E
+ E E
+23 0 0 0 0 0
+E E E
+0
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0
+4
+LANG:1 26 Arial,-1,13,5,40,0,0,0,0,0
+LANG:10000 26 Arial,-1,13,5,40,0,0,0,0,0
+LANG:10001 26 Arial,-1,13,5,40,0,0,0,0,0
+LANG:10027 26 Arial,-1,13,5,40,0,0,0,0,0
+0  8 8 48 35
+0
+
+E
+"main()
+{
+  string screenConfigName;
+  
+  screenConfigName=this.text;
+  aes_screenConfigChanged( screenConfigName );
+
+}" 0
+
+E
+ 0 0
+13 15
+"bt_topSplit"
+""
+1 10 10 E E E 1 E 0 E N "_ButtonText" E N "_Button" E E
+ E E
+15 0 0 0 0 0
+E E E
+0
+4
+LANG:1 20 Change to split view
+LANG:10000 29 Wechsle zur Splittdarstellung
+LANG:10001 20 Change to split view
+LANG:10027 67 Перейти к раздельному представлению
+
+0
+4
+LANG:1 26 Arial,-1,13,5,40,0,0,0,0,0
+LANG:10000 26 Arial,-1,13,5,40,0,0,0,0,0
+LANG:10001 26 Arial,-1,13,5,40,0,0,0,0,0
+LANG:10027 26 Arial,-1,13,5,40,0,0,0,0,0
+0  8 8 22 22
+
+T 
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+"main()
+{
+
+  // g_percent - state before full mode
+  aes_resetSplitPosition( g_top, g_bottom );
+
+/*
+  // enable split button
+  setMultiValue(
+    \"bt_topFull\",  \"visible\", true,
+    \"bt_botFull\",  \"visible\", true,
+    \"bt_topSplit\", \"visible\", false );
+  
+  g_bottom.visible( true );
+  
+  // disable slider ( buttons )
+  if( g_motif )
+  {
+    setMultiValue(
+      \"bt_splitUp\",   \"visible\", true,
+      \"bt_splitDown\", \"visible\", true );
+  }
+  else
+  {
+    setMultiValue(
+     \"ax_gauge\", \"visible\", true );
+  }
+
+  //reg_main.registerVisible(AESREGTAB_BOT)=true;
+*/
+}" 0
+ E E E
+13 21
+"ar_up"
+""
+1 1053 10 E E E 1 E 1 E N "_ButtonText" E N "_Button" E E
+ E E
+19 0 0 0 0 0
+E E E
+0
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0
+4
+LANG:1 26 Arial,-1,13,5,40,0,0,0,0,0
+LANG:10000 26 Arial,-1,13,5,40,0,0,0,0,0
+LANG:10001 26 Arial,-1,13,5,40,0,0,0,0,0
+LANG:10027 26 Arial,-1,13,5,40,0,0,0,0,0
+0  1053 10 1083 27
+
+P 
+6736998
+"pictures/up_en.gif"
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+"// up
+
+main()
+{
+  aes_arVisible( true );
+}" 0
+ E E E
+13 22
+"ar_down"
+""
+1 1053 25 E E E 1 E 1 E N "_ButtonText" E N "_Button" E E
+ E E
+20 0 0 0 0 0
+E E E
+0
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0
+4
+LANG:1 26 arial,-1,13,5,50,0,0,0,0,0
+LANG:10000 26 arial,-1,13,5,50,0,0,0,0,0
+LANG:10001 26 arial,-1,13,5,50,0,0,0,0,0
+LANG:10027 26 arial,-1,13,5,50,0,0,0,0,0
+0  1053 25 1083 42
+
+P 
+6736998
+"pictures/down_en.gif"
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+"// down
+
+main()
+{
+  aes_arVisible( false );
+}" 0
+ E E E
+28 0
+"reg_main"
+"ALERTROW"
+1 51 91 E E E 1 E 0 E N "_3DText" E N "_3DFace" E E
+ E E
+1 0 0 0 0 0
+E E E
+0
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+1
+"selchangedcb" "main()
+{
+  string config, _screenType, app, pre;
+  dyn_string configList;
+  unsigned actReg;   
+  
+  // we are using the top dp for regtab treating
+  aes_changed( g_propDpNameTop, AES_CHANGED_REGTAB );  
+}"
+4
+LANG:1 26 Arial,-1,12,5,40,0,0,0,0,0
+LANG:10000 26 Arial,-1,12,5,40,0,0,0,0,0
+LANG:10001 26 Arial,-1,12,5,40,0,0,0,0,0
+LANG:10027 26 arial,-1,12,5,40,0,0,0,0,0
+0  48 8 152 35
+"main()
+{
+
+  aes_initMainReg();
+
+  // inform tableinitroutine that reginitroutine has finished
+  // we are misusing the type table property
+
+}" 0
+3 "tab_top" 4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+0
+"tab_bot" 4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+0
+"tab_general" 4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+0
+
+25 1
+"table_top"
+""
+1 10 10 E E E 1 E 1 E N "_WindowText" E N "_Window" E "// SimpleCtrlScriptStart {valid}
+main()
+{
+string sObjectName;
+getValue(\"\",\"name\",sObjectName);
+ep_acknowledgeTableFunction( sObjectName,\"1\",\"__V_dpid\",\"__V_time\",\"__V_count\",\"__V_ackable\");
+}
+// SimpleCtrlScript {EP_confirmTable}
+// Type {1}
+// Column_DPE {__V_dpid}
+// Column_Time {__V_time}
+// Column_Index {__V_count}
+// Column_Confirmable {__V_ackable}
+// SimpleCtrlScriptEnd {EP_confirmTable}
+" 0
+
+ "main(int row, string column)
+{
+  int i, j;
+  anytype value;
+  mapping mTableMultipleRows;
+  
+  //IM 116642: Trigger table widget once, to avoid timing problems
+  int top, bot;
+  getValue(\"\", \"lineRangeVisible\", top, bot);
+  
+  synchronized(g_bTableLineSynchronisation)
+  { 
+    int length;
+    dyn_anytype alertRow;  
+    
+    getValue( \"\", \"currentCell\", row, column );
+    value=this.cellValue;
+
+    alertRow = this.getLineN(row);
+    length = dynlen(alertRow);
+    
+    for(j=0; j<this.lineCount; j++)
+    {
+      mapping rowHeaderMapping;
+      
+      for(i=1; i<=length; i++)
+        rowHeaderMapping[this.columnName(i-1)] = alertRow[i];
+      
+      mTableMultipleRows[j] = rowHeaderMapping;
+    }
+  }
+
+  aes_onRightClick( g_propDpNameTop, AESTAB_TOP, this.name, row, column, value, mTableMultipleRows );
+}" 0
+ "main()
+{
+  int row, column;
+  anytype value;
+  mapping mTableRow;
+  
+  synchronized(g_bTableLineSynchronisation)
+  { 
+    int length;
+    dyn_anytype alertRow;  
+        
+    // determine position 
+    getValue(\"\",\"currentCell\", row, column );
+    // and content of active cell !
+    getValue(\"\",\"cellValue\", value );
+
+    alertRow = this.getLineN(row);
+    length = dynlen(alertRow);
+    for(int i=1; i<=length; i++)
+      mTableRow[this.columnName(i-1)] = alertRow[i];
+  }
+ 
+  aes_doColumnDblClick( g_propDpNameTop, row, column, value, mTableRow );
+}" 0
+
+2 0 0 0 0 0
+"main()
+{
+  reg_main.namedActiveRegister( AES_TABNAME_TOP );
+}" 0
+ E E
+0
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+1
+"scrolledCB" "synchronized main()
+{
+  aes_scrollHandling(AESTAB_TOP, g_iLineHoldThreadTop);
+}"
+4
+LANG:1 26 Arial,-1,11,5,50,0,0,0,0,0
+LANG:10000 26 Arial,-1,13,5,40,0,0,0,0,0
+LANG:10001 26 Arial,-1,13,5,40,0,0,0,0,0
+LANG:10027 26 Arial,-1,13,5,40,0,0,0,0,0
+0  8 8 1002 35
+"//Function table_top_EventInitialize()
+
+// neu - fuer bessere performance in callback
+bool g_firstHL = true;
+bool lastSystem = false;
+int g_screenType;
+// property dp name
+string g_propDp;
+// Top/Bot info
+int g_tabType;
+// column name of register tab ( to build the tabheader eg Top/Alerts/Open )
+string g_regColumn;
+// mode
+int g_valType;
+dyn_string g_systemSelections;
+
+//////// neue variablen fuer configMatrix, settings and table eval commands append/update/delete
+dyn_dyn_anytype g_configMatrix;
+dyn_anytype     g_configSettings;
+
+string          g_tableCmdAppend;
+string          g_tableCmdUpdate;
+string          g_tableCmdDelete;
+
+dyn_string      g_colNames;
+bool            g_useFontProp;
+int             g_dpidIdx;
+int             g_timeIdx;
+int             g_countIdx;
+
+dyn_string      g_attrList;
+
+//*****************************
+// from old as/es_init() ***begin
+
+// momentan wird das prefix as fuer beide verwendet / es routinen werden angepasst
+// arbeitsvariablen muessen scriptglobal( pro tabelle) sein !!!!!!!!!!!
+int g_asDisplayLines = 0;
+int g_asDisplayDpes = 0;
+int g_asDisplayHours = 0;
+
+// halten die werte fuer AES_TYPEFILTER/TYPECONST ( == panelglobal )
+dyn_string g_typeFilter;
+dyn_int g_typeConst;
+
+//*****************************
+// from old aes_init() *****end
+
+
+///////////////////////////////////////////////
+// from old screen ***********************begin
+// new
+bool     g_historicalData;
+int      g_historicalDataInterval;   // display interval in sec back from now / only open mode 
+int      g_queryBlockedTime; // holds to queryblocktime in ms / see general settings
+dyn_bool g_colVis;           // holds the flag wheter an optional column is visible or not
+string   g_connectId;        // holds id of current query
+dyn_string g_counterConnectId; // holds numbers of Id's
+//dyn_int  g_counterConnectId; // holds numbers of connected system id's
+dyn_string g_closedIdf;      // new
+bool     g_checkAll;         // holds property setting - connect all systems
+time     g_timeLastUpdate;   // holds time of the last update
+string   g_dpCommentFilter;  // store filter
+
+bool     g_showInternals;    // value from _Config.ShowInternals
+
+bool     g_showInternalsA;    // value from _Config.ShowInternalDPs.Alerts
+bool     g_showInternalsAR;   // value from _Config.ShowInternalDPs.AlertRow
+bool     g_showInternalsE;    // value from _Config.ShowInternalDPs.Events
+
+unsigned g_maxClosedLines;   // max num of lines to be queried by closed protocoll
+unsigned g_state;            // alert-state filter
+
+int g_busyThread;    // id of thread, which shows busyness
+
+int g_maxLines;      // num of max lines in open protocoll
+
+// TI 14075 (discarding pending values)
+int        g_discardThread;
+time       g_discardStart;
+bool       g_discarded;
+const time MINCB_TIME = 2;
+const time MAXCB_TIME = 5;
+
+// characters for status-bits in current language
+// only for Events
+char g_Cdefault, g_Cout_prange, g_Cinvalid, g_Cfrom_GI, g_Cuserbit1, g_Cuserbit2;
+
+// IM 114080 - moved from aes.ctl
+dyn_string g_dsWorkAttr, g_dsWorkName, g_dsWorkVsbl;
+
+///////////////////////////////////////////////
+// from old screen *************************end
+
+main()
+{
+//******************************** from row panel init begin
+  const string ARH=\"$AESREGDOLLAR_ROWHEIGHT\";
+  int p1, p2; 
+
+  if( isDollarDefined( ARH ) )
+  {
+    g_arHeight=(int)getDollarValue( ARH );
+  }  
+  else
+  {
+    table_top.visible=false;
+    table_top.appendLines(10);
+    getValue(\"table_top\",\"lineRangeVisible\",p1,p2);
+    table_top.deleteAllLines();
+    g_arHeight = p2-p1+1;
+    table_top.visible=true;
+  }
+
+//  delay(5);
+//  aes_doStart(\"_AESPropertiesRTRow_\"+myUiNumber() + \"_\" + myModuleName()+\"_Top\");
+
+//******************************** from row panel init end
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  delay(0,100);
+  aes_initMainTable( AESTAB_TOP );
+}
+" 0
+"main(int row, string column, string value)
+{
+  mapping mTableRow;
+  
+  synchronized(g_bTableLineSynchronisation)
+  { 
+    int length;
+    dyn_anytype alertRow;  
+    
+    alertRow = this.getLineN(row);
+    
+    length = dynlen(alertRow);
+    for(int i=1; i<=length; i++)
+      mTableRow[this.columnName(i-1)] = alertRow[i];
+  }
+  
+  //read pos of visible lines
+  setMultiValue( \"ar_currentLine\", \"text\", row+1); // \"current line\" -indicator is 1 based
+
+  aes_doColumnClick( AESTAB_TOP, row, column, value, mTableRow );
+}
+
+" 0
+ 0 0 1 60 14 "#1" 4 1 1 "s" 4
+LANG:1 2 #1
+LANG:10000 4 Time
+LANG:10001 2 #1
+LANG:10027 10 Время
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+40 "#2" 3 1 1 "s" 4
+LANG:1 2 #2
+LANG:10000 2 #2
+LANG:10001 2 #2
+LANG:10027 2 #2
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+33 "#3" 19 1 1 "s" 4
+LANG:1 2 #3
+LANG:10000 2 #3
+LANG:10001 2 #3
+LANG:10027 2 #3
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+162 "#4" 28 1 1 "s" 4
+LANG:1 2 #4
+LANG:10000 2 #4
+LANG:10001 2 #4
+LANG:10027 2 #4
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+232 "#5" 18 1 1 "s" 4
+LANG:1 2 #5
+LANG:10000 2 #5
+LANG:10001 2 #5
+LANG:10027 2 #5
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+152 "#6" 4 1 1 "s" 4
+LANG:1 2 #6
+LANG:10000 2 #6
+LANG:10001 2 #6
+LANG:10027 2 #6
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+43 "#7" 6 1 1 "s" 4
+LANG:1 2 #7
+LANG:10000 2 #7
+LANG:10001 2 #7
+LANG:10027 2 #7
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+61 "#8" 3 1 1 "s" 4
+LANG:1 2 #8
+LANG:10000 2 #8
+LANG:10001 2 #8
+LANG:10027 2 #8
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+32 "#9" 15 1 1 "s" 4
+LANG:1 2 #9
+LANG:10000 2 #9
+LANG:10001 2 #9
+LANG:10027 2 #9
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+128 "#10" 3 1 1 "s" 4
+LANG:1 3 #10
+LANG:10000 3 #10
+LANG:10001 3 #10
+LANG:10027 3 #10
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+38 "#11" 2 1 1 "s" 4
+LANG:1 3 #11
+LANG:10000 3 #11
+LANG:10001 3 #11
+LANG:10027 3 #11
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#12" 2 0 1 "s" 4
+LANG:1 3 #12
+LANG:10000 3 #12
+LANG:10001 3 #12
+LANG:10027 3 #12
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#13" 2 0 1 "s" 4
+LANG:1 3 #13
+LANG:10000 3 #13
+LANG:10001 3 #13
+LANG:10027 3 #13
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#14" 2 0 1 "s" 4
+LANG:1 3 #14
+LANG:10000 3 #14
+LANG:10001 3 #14
+LANG:10027 3 #14
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#15" 2 0 1 "s" 4
+LANG:1 3 #15
+LANG:10000 3 #15
+LANG:10001 3 #15
+LANG:10027 3 #15
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#16" 2 0 1 "s" 4
+LANG:1 3 #16
+LANG:10000 3 #16
+LANG:10001 3 #16
+LANG:10027 3 #16
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#17" 2 0 1 "s" 4
+LANG:1 3 #17
+LANG:10000 3 #17
+LANG:10001 3 #17
+LANG:10027 3 #17
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#18" 2 0 1 "s" 4
+LANG:1 3 #18
+LANG:10000 3 #18
+LANG:10001 3 #18
+LANG:10027 3 #18
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#19" 2 0 1 "s" 4
+LANG:1 3 #19
+LANG:10000 3 #19
+LANG:10001 3 #19
+LANG:10027 3 #19
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#20" 2 0 1 "s" 4
+LANG:1 3 #20
+LANG:10000 3 #20
+LANG:10001 3 #20
+LANG:10027 3 #20
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#21" 2 0 1 "s" 4
+LANG:1 3 #21
+LANG:10000 3 #21
+LANG:10001 3 #21
+LANG:10027 3 #21
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#22" 2 0 1 "s" 4
+LANG:1 3 #22
+LANG:10000 3 #22
+LANG:10001 3 #22
+LANG:10027 3 #22
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#23" 2 0 1 "s" 4
+LANG:1 3 #23
+LANG:10000 3 #23
+LANG:10001 3 #23
+LANG:10027 3 #23
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#24" 2 0 1 "s" 4
+LANG:1 3 #24
+LANG:10000 3 #24
+LANG:10001 3 #24
+LANG:10027 3 #24
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#25" 2 0 1 "s" 4
+LANG:1 3 #25
+LANG:10000 3 #25
+LANG:10001 3 #25
+LANG:10027 3 #25
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#26" 2 0 1 "s" 4
+LANG:1 3 #26
+LANG:10000 3 #26
+LANG:10001 3 #26
+LANG:10027 3 #26
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#27" 2 0 1 "s" 4
+LANG:1 3 #27
+LANG:10000 3 #27
+LANG:10001 3 #27
+LANG:10027 3 #27
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#28" 2 0 1 "s" 4
+LANG:1 3 #28
+LANG:10000 3 #28
+LANG:10001 3 #28
+LANG:10027 3 #28
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#29" 2 0 1 "s" 4
+LANG:1 3 #29
+LANG:10000 3 #29
+LANG:10001 3 #29
+LANG:10027 3 #29
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#30" 2 0 1 "s" 4
+LANG:1 3 #30
+LANG:10000 3 #30
+LANG:10001 3 #30
+LANG:10027 3 #30
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#31" 2 0 1 "s" 4
+LANG:1 3 #31
+LANG:10000 3 #31
+LANG:10001 3 #31
+LANG:10027 3 #31
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#32" 2 0 1 "s" 4
+LANG:1 3 #32
+LANG:10000 3 #32
+LANG:10001 3 #32
+LANG:10027 3 #32
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#33" 2 0 1 "s" 4
+LANG:1 3 #33
+LANG:10000 3 #33
+LANG:10001 3 #33
+LANG:10027 3 #33
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#34" 2 0 1 "s" 4
+LANG:1 3 #34
+LANG:10000 3 #34
+LANG:10001 3 #34
+LANG:10027 3 #34
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#35" 2 0 1 "s" 4
+LANG:1 3 #35
+LANG:10000 3 #35
+LANG:10001 3 #35
+LANG:10027 3 #35
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+24 "#36" -1 0 1 "s" 4
+LANG:1 3 #36
+LANG:10000 3 #36
+LANG:10001 3 #36
+LANG:10027 3 #36
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 "#37" -1 0 1 "s" 4
+LANG:1 3 #37
+LANG:10000 3 #37
+LANG:10001 3 #37
+LANG:10027 3 #37
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 "#38" -1 0 1 "s" 4
+LANG:1 3 #38
+LANG:10000 3 #38
+LANG:10001 3 #38
+LANG:10027 3 #38
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 "#39" -1 0 1 "s" 4
+LANG:1 3 #39
+LANG:10000 3 #39
+LANG:10001 3 #39
+LANG:10027 3 #39
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 "#40" -1 0 1 "s" 4
+LANG:1 3 #40
+LANG:10000 3 #40
+LANG:10001 3 #40
+LANG:10027 3 #40
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 "#41" -1 0 1 "s" 4
+LANG:1 3 #41
+LANG:10000 3 #41
+LANG:10001 3 #41
+LANG:10027 3 #41
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 "#42" -1 0 1 "s" 4
+LANG:1 3 #42
+LANG:10000 3 #42
+LANG:10001 3 #42
+LANG:10027 3 #42
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 "#43" -1 0 1 "s" 4
+LANG:1 3 #43
+LANG:10000 3 #43
+LANG:10001 3 #43
+LANG:10027 3 #43
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 "#44" -1 0 1 "s" 4
+LANG:1 3 #44
+LANG:10000 3 #44
+LANG:10001 3 #44
+LANG:10027 3 #44
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 "#45" -1 0 1 "s" 4
+LANG:1 3 #45
+LANG:10000 3 #45
+LANG:10001 3 #45
+LANG:10027 3 #45
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 "#46" -1 0 1 "s" 4
+LANG:1 3 #46
+LANG:10000 3 #46
+LANG:10001 3 #46
+LANG:10027 3 #46
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 "#47" -1 0 1 "s" 4
+LANG:1 3 #47
+LANG:10000 3 #47
+LANG:10001 3 #47
+LANG:10027 3 #47
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 "#48" -1 0 1 "s" 4
+LANG:1 3 #48
+LANG:10000 3 #48
+LANG:10001 3 #48
+LANG:10027 3 #48
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 "#49" -1 0 1 "s" 4
+LANG:1 3 #49
+LANG:10000 3 #49
+LANG:10001 3 #49
+LANG:10027 3 #49
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 "#50" -1 0 1 "s" 4
+LANG:1 3 #50
+LANG:10000 3 #50
+LANG:10001 3 #50
+LANG:10027 3 #50
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 "#51" -1 0 1 "s" 4
+LANG:1 3 #51
+LANG:10000 3 #51
+LANG:10001 3 #51
+LANG:10027 3 #51
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 "#52" -1 0 1 "s" 4
+LANG:1 3 #52
+LANG:10000 3 #52
+LANG:10001 3 #52
+LANG:10027 3 #52
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 "#53" -1 0 1 "s" 4
+LANG:1 3 #53
+LANG:10000 3 #53
+LANG:10001 3 #53
+LANG:10027 3 #53
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 "#54" -1 0 1 "s" 4
+LANG:1 3 #54
+LANG:10000 3 #54
+LANG:10001 3 #54
+LANG:10027 3 #54
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 "#55" -1 0 1 "s" 4
+LANG:1 3 #55
+LANG:10000 3 #55
+LANG:10001 3 #55
+LANG:10027 3 #55
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 "#56" -1 0 1 "s" 4
+LANG:1 3 #56
+LANG:10000 3 #56
+LANG:10001 3 #56
+LANG:10027 3 #56
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 "#57" -1 0 1 "s" 4
+LANG:1 3 #57
+LANG:10000 3 #57
+LANG:10001 3 #57
+LANG:10027 3 #57
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 "#58" -1 0 1 "s" 4
+LANG:1 3 #58
+LANG:10000 3 #58
+LANG:10001 3 #58
+LANG:10027 3 #58
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 "#59" -1 0 1 "s" 4
+LANG:1 3 #59
+LANG:10000 3 #59
+LANG:10001 3 #59
+LANG:10027 3 #59
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 "#60" -1 0 1 "s" 4
+LANG:1 3 #60
+LANG:10000 3 #60
+LANG:10001 3 #60
+LANG:10027 3 #60
+E
+4
+LANG:1 0 
+LANG:10000 0 
+LANG:10001 0 
+LANG:10027 0 
+
+0 
+26 26 "" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+"" 1 4
+LANG:1 5 row_1
+LANG:10000 5 row_1
+LANG:10001 5 row_1
+LANG:10027 5 row_1
+8 30
+4
+LANG:1 26 Arial,-1,11,5,50,0,0,0,0,0
+LANG:10000 26 Arial,-1,13,5,40,0,0,0,0,0
+LANG:10001 26 Arial,-1,13,5,40,0,0,0,0,0
+LANG:10027 26 Arial,-1,13,5,40,0,0,0,0,0
+0 0 0 0 1 7
+1 0
+0
+LAYER, 1 
+1
+LANG:1 6 Layer2
+0
+LAYER, 2 
+1
+LANG:1 6 Layer3
+0
+LAYER, 3 
+1
+LANG:1 6 Layer4
+0
+LAYER, 4 
+1
+LANG:1 6 Layer5
+0
+LAYER, 5 
+1
+LANG:1 6 Layer6
+0
+LAYER, 6 
+1
+LANG:1 6 Layer7
+0
+LAYER, 7 
+1
+LANG:1 6 Layer8
+0
+0
diff --git a/MAC/Navigator2/scripts/claim.ctl b/MAC/Navigator2/scripts/claim.ctl
index 54702e94a795c6dca5b1fd8c72515fce766e6fa0..ca0c67e1832b584e3abf8e6f8270ac0291b9390e 100644
--- a/MAC/Navigator2/scripts/claim.ctl
+++ b/MAC/Navigator2/scripts/claim.ctl
@@ -46,7 +46,6 @@
 // *******************************************
 
 #uses "GCFCommon.ctl"
-#uses "GCFAlarm.ctl"
 
 global mapping g_ClaimedTypes;
 
@@ -879,7 +878,7 @@ string  FindFreeClaim(
         }
       }
 
-      sendAlarm(g_ClaimedTypes[ strTypeName ][ "DP" ][iIndex],
+      DebugTN(g_ClaimedTypes[ strTypeName ][ "DP" ][iIndex],
                 "No free claim available, reuse oldest existing claim: "+g_ClaimedTypes[ strTypeName ][ "NAME" ][iIndex],
                 TRUE);
       }
diff --git a/MAC/Navigator2/scripts/gcf_cwd.ctl b/MAC/Navigator2/scripts/gcf_cwd.ctl
index 0f3a068f50064b5b1dc2eb8fe12ef9199089036e..c32aeb57bd4e86e2f1ebb7b3d7b26859da6a6b6a 100644
--- a/MAC/Navigator2/scripts/gcf_cwd.ctl
+++ b/MAC/Navigator2/scripts/gcf_cwd.ctl
@@ -111,7 +111,7 @@ void distSystemChanged(string dp, dyn_int newDistSysList) {
     if (dynContains(newDistSysList,g_connections[ "SYSTEM" ][i]) < 1) {
       g_connections[ "UP" ][i]     = false;
       g_connections[ "DOWNTIME" ][i] = getCurrentTime();
-      if (!dynContains(involved_systems,g_connections[ "NAME" ]) < 1) {
+      if (dynContains(involved_systems,g_connections[ "NAME" ] [i]) < 1) {
         dynAppend(involved_systems,g_connections[ "NAME" ][i]); 
       }
     }
diff --git a/MAC/Navigator2/scripts/libs/CMakeLists.txt b/MAC/Navigator2/scripts/libs/CMakeLists.txt
index 6414dd767f28a1daf1aa5fed6aaa45a95e80b08a..e16dd2b7b351d26d8f4d53cb53478567d5196833 100644
--- a/MAC/Navigator2/scripts/libs/CMakeLists.txt
+++ b/MAC/Navigator2/scripts/libs/CMakeLists.txt
@@ -1,7 +1,6 @@
 # $Id$
 
 install(FILES
-  GCFAlarm.ctl
   GCFCommon_prod.ctl
   GCFCommon_test.ctl
   GCFCWD.ctl
diff --git a/MAC/Navigator2/scripts/libs/GCFAlarm.ctl b/MAC/Navigator2/scripts/libs/GCFAlarm.ctl
deleted file mode 100644
index dd408e29549572e10363f1f299a78a511ea17e63..0000000000000000000000000000000000000000
--- a/MAC/Navigator2/scripts/libs/GCFAlarm.ctl
+++ /dev/null
@@ -1,220 +0,0 @@
-// GCFAlarm.ctl
-//
-//  Copyright (C) 2002-2004
-//  ASTRON (Netherlands Foundation for Research in Astronomy)
-//  P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, softwaresupport@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$
-//
-///////////////////////////////////////////////////////////////////
-// GCF Alarm functions
-///////////////////////////////////////////////////////////////////
-//
-//
-// Functions and procedures
-//
-// initAlarmSystem      : initializes the AlarmSystem
-// getAlarmStatus       : gives the string representation from the alarmStatus
-// getAlarms            : get the priorly set and still open alarms from the database
-// setAlarms            : writes all alarsm to database
-// distSystemTriggered  : Callback that a distSystem has connected/disconnected
-// objectStateCallback  : Fill the global alarm mapping and the alarm database
-
-#uses "GCFLogging.ctl"
-#uses "GCFCommon.ctl"
-
-// Mapping where we try to keep all alarms to be able to access them faster from the panels
-global mapping    g_alarms;
-
-// needed for dpDisconnect after a connect and a resync when dist systems go off or online
-global bool isConnected = false;
-
-const int CAME = 0;
-const int WENT = 1;
-const int ACK  = 2;
-
-// *******************************************
-// Name : initNavigatorAlarms
-// *******************************************
-// Description:
-// initializes the Navigator Alarmsystem
-// Keeps a global mapping that contain all current alarms
-// connects to the __navigator.alarms point te be triggered when alarms change
-// so the mapping can be kept up te date.
-//
-//
-
-// *******************************************
-void initNavigatorAlarms(){
-  LOG_DEBUG("GCFAlarm.ctl.ctl:initAlarmSystem|entered");
-  g_alarms[ "TIME"     ] = makeDynTime();                    
-  g_alarms[ "DPNAME"   ] = makeDynString();
-  g_alarms[ "MESSAGE"  ] = makeDynString();
-  g_alarms[ "STATE"    ] = makeDynInt();
-  g_alarms[ "STATUS"   ] = makeDynInt();
-  
-  // Routine to connect to _DistConnections.ManNums.
-  // This point keeps a dyn_int array with all active distributed connections
-  // and will generate a callback everytime a station goes off-, or on- line
-
-  // connect to alarm point and read initial alarms from database.
-  if (dpExists(DPNAME_NAVIGATOR +  ".alarms")) {
-    if (dpConnect("alarmSystemTriggered",true,DPNAME_NAVIGATOR +  ".alarms.time")== -1) {
-      LOG_ERROR("GCFAlarm.ctl:initCtrlAlarmSystem|Couldn't connect to alarm point, alarms will not be updated");  
-    }
-  } else {
-    LOG_ERROR("GCFAlarm.ctl:initCtrlAlarmSystem|Couldn't connect to alarm point, alarms will not be updated");  
-    if (g_initializing) {
-      writeInitProcess("initNavigatorAlarmsFinished");
-    }
-  } 
-}
-
-// *******************************************
-// Name : alarmSystemTriggered
-// *******************************************
-// Description:
-// callback when the __navigator.alarm point is changed.
-// this callback will rewrite the global mapping for the navigator
-//
-void alarmSystemTriggered(string dp1, dyn_time times) {
-  mappingClear(g_alarms);
-  if (dpExists(DPNAME_NAVIGATOR +  ".alarms")) {
-    getAlarms(DPNAME_NAVIGATOR +  ".alarms",
-              g_alarms[ "TIME"],g_alarms[ "DPNAME"   ],g_alarms[ "MESSAGE"  ],g_alarms[ "STATE"    ],g_alarms[ "STATUS"   ]);
-  } else {
-    LOG_ERROR("GCFAlarm.ctl:alarmSystemTriggered|Couldn't get alarms from navigator");
-  }
-  
-  //set trigger so panels (if any) know mapping is (re)synced
-  if (dpExists(DPNAME_NAVIGATOR + g_navigatorID+".alarmsTrigger")) {
-    dpSet(DPNAME_NAVIGATOR + g_navigatorID+".alarmsTrigger",true);
-  }  
-  LOG_DEBUG("GCFAlarm.ctl:alarmSystemTriggered|Nr alarms in global after update: ", dynlen(g_alarms["TIME"]));      
-  showMapping(g_alarms,"g_alarms");
-  
-  if (g_initializing) {
-    writeInitProcess("initNavigatorAlarmsFinished");
-  }
-
-  
-}
-
-// *******************************************
-// Name : getAlarmStatus
-// *******************************************
-// Description:
-// gives the string representation from the alarmStatus
-//
-//
-// Returns:
-//    string representing the Status
-// *******************************************
-string getAlarmStatus(int status){
-
-  if (status == 0) {
-    return "CAME";
-  } else if (status == 1) {
-    return "WENT";
-  } else if (status == 2) {
-    return "ACK";
-  }
-  return "UNKNOWN";
-}
-
-// *******************************************
-// Name : getAlarms
-// *******************************************
-// Description:
-// get the priorly set and still open alarms from the database
-//
-//
-// Returns:
-//    None
-// *******************************************
-void getAlarms(string dp,dyn_time &times,dyn_string &names, dyn_string &messages, dyn_int &state, dyn_int &status) {
-  if (dpGet(dp+".time",times,dp+".datapoint",names,dp+".message",messages,dp+".state",state,dp+".status",status) < 0) {
-    LOG_DEBUG("GCFAlarm.ctl:getAlarms|Error getting alarms from database: ", getLastError());  
-  }
-}
-
-// *******************************************
-// Name : setAlarms
-// *******************************************
-// Description:
-// writes all alarms to database
-//
-//
-// Returns:
-//    None
-// *******************************************
-void setAlarms(string dp,dyn_time times,dyn_string names, dyn_string messages, dyn_int state, dyn_int status) {
-  
-  if (dpSet(dp+".time",times,dp+".datapoint",names,dp+".message",messages,dp+".state",state,dp+".status",status) < 0) {
-    LOG_DEBUG("GCFAlarm.ctl:setAlarms|Error setting alarms in database: ", getLastError());  
-  }
-}
-
-// *******************************************
-// Name : stateToStatus
-// *******************************************
-// Description:
-// returns the alarmstatus derived from the state
-//
-//
-// Returns:
-//    the derived status
-// *******************************************
-int stateToStatus(int aState) {
-  if (aState == SUSPICIOUS || aState == BROKEN) {
-    return ACK;
-  } else if (aState == SUSPICIOUS_CAME || aState == BROKEN_CAME) {
-    return CAME;
-  } else if (aState == SUSPICIOUS_WENT || aState == BROKEN_WENT) {
-    return WENT;
-  }
-  return -1;
-}
-
-
-// *******************************************
-// Name : sendAlarm
-// *******************************************
-// Description:
-//    sends an Alarm to the database
-//
-//
-// *******************************************
-void sendAlarm(string aDPName,string aMessage,bool force) {
-  
-  int aStateNr = BROKEN_CAME;
-
-  if (dpExists(aDPName) && aMessage != "") {
-    dpSet( "__navObjectState.DPName",aDPName+".status.state",
-           "__navObjectState.stateNr",aStateNr,
-           "__navObjectState.message",aMessage,
-           "__navObjectState.force",force);
-  } else {
-    if (aMessage == "") {
-      LOG_ERROR("GCFAlarm.ctl:sendAlarm|ERROR: empty message for alarm ");
-    } else {
-      LOG_ERROR("GCFAlarm.ctl:sendAlarm|ERROR: non existing DP for alarm: "+aDPName);
-    }
-  }
-}
-
-
diff --git a/MAC/Navigator2/scripts/libs/GCFCWD.ctl b/MAC/Navigator2/scripts/libs/GCFCWD.ctl
index d24cccd1cee7fb810a4350b24011af0d4ad5be80..bcb64d776c89fb3373da6ad1e577fe9631d85cf8 100644
--- a/MAC/Navigator2/scripts/libs/GCFCWD.ctl
+++ b/MAC/Navigator2/scripts/libs/GCFCWD.ctl
@@ -146,26 +146,8 @@ void GCFCWD_connectWD(string dp1, dyn_int systemID,
       time t;
       g_connections[ "DOWNTIME" ][iPos] = t;        
     }    
-    // we need to reflect the status of the stations up/down also in the "MainDBName+LOFAR_PIC_[Ring].status.childState
+    
     if (changed) {
-      // changed to up, childstate is highest childstate of all stations.state and .childStates
-      // else 
-      // changed to down, childstate will be set to dpOffline
-      if (up[i] && name[i] != CEPDBName) {
-        if (dpExists(MainDBName+"__navObjectState.DPName")) {
-            dpSet(MainDBName+"__navObjectState.DPName",MainDBName+"LOFAR_PIC_"+navFunct_getRingFromStation(name[i])+"_"+navFunct_bareDBName(name[i])+".status.state",
-                  MainDBName+"__navObjectState.stateNr",OPERATIONAL,
-                  MainDBName+"__navObjectState.message","System came online",
-                  MainDBName+"__navObjectState.force",true);
-        }        
-      } else if (name[i] != CEPDBName) {
-        if (dpExists(MainDBName+"__navObjectState.DPName")) {
-            dpSet(MainDBName+"__navObjectState.DPName",MainDBName+"LOFAR_PIC_"+navFunct_getRingFromStation(name[i])+"_"+navFunct_bareDBName(name[i])+".status.state",
-                  MainDBName+"__navObjectState.stateNr",DPOFFLINE,
-                  MainDBName+"__navObjectState.message","System went offline",
-                  MainDBName+"__navObjectState.force",false);
-        }
-      }
       // if not first call during init process, inform framewotk that something has changed 
       if (!isAnswer()) {
         g_involved_stations = involved;
diff --git a/MAC/Navigator2/scripts/libs/GCFCommon_prod.ctl b/MAC/Navigator2/scripts/libs/GCFCommon_prod.ctl
index bf3d15e6e6a86c6f14df1758e8533b9753f34b01..d51e3721f2d6b0796a9c5a5ed5c1b740b523ffbd 100644
--- a/MAC/Navigator2/scripts/libs/GCFCommon_prod.ctl
+++ b/MAC/Navigator2/scripts/libs/GCFCommon_prod.ctl
@@ -43,6 +43,7 @@ const string   DPNAME_NAVIGATOR  = "__navigator";
 global string   MainDBName        = "MCU001:";
 global string   CEPDBName         = "CCU001:";
 global unsigned MainDBID          = 61;
+global int  g_MaxNrClaims           = 250;      // the maximal nr of claims handled by the claimmanager
 
 global mapping stateColor;
 global mapping stateName;
@@ -51,7 +52,6 @@ global mapping stateNumber;
 global bool       g_initializing          = true;     // to show if initialise is ready
 global string     g_initProcess           = "";       // holds last finished init process
 global bool       g_standAlone            = false;    // can be used to check if we are in standalone mode (== station only mode)
-global int        g_MaxNrClaims           = 250;      // the maximal nr of claims handled by the claimmanager
 
 
 ///////////////////////////////////////////////////////////////////////////
@@ -73,8 +73,8 @@ void initLofarColors() {
     stateColor [50] = "Lofar_broken";
     stateColor [53] = "Lofar_broken_went";
     stateColor [56] = "Lofar_broken_came";
-    stateColor [56] = "Lofar_beyond_repair";
-    stateColor [60] = "Lofar_dpOffline";
+    stateColor [60] = "Lofar_beyond_repair";
+    stateColor [70] = "Lofar_dpOffline";
     
   	stateName [0]  = "off";
     stateName [10] = "operational";
@@ -86,8 +86,8 @@ void initLofarColors() {
     stateName [50] = "broken";
     stateName [53] = "broken_went";
     stateName [56] = "broken_came";
-    stateName [58] = "beyond_repair";
-    stateName [60] = "dp_Offline";
+    stateName [60] = "beyond_repair";
+    stateName [70] = "dp_Offline";
     
     stateNumber ["off"]             = 0;
     stateNumber ["operational"]     = 10;
@@ -99,8 +99,8 @@ void initLofarColors() {
     stateNumber ["broken"]          = 50;
     stateNumber ["broken_went"]     = 53;
     stateNumber ["broken_came"]     = 56;
-    stateNumber ["broken_repair"]   = 58;
-    stateNumber ["dpOffline"]       = 60;
+    stateNumber ["broken_repair"]   = 60;
+    stateNumber ["dpOffline"]       = 70;
 }
 
 
@@ -114,8 +114,8 @@ const int SUSPICIOUS_CAME  = 46;
 const int BROKEN           = 50;
 const int BROKEN_WENT      = 53;
 const int BROKEN_CAME      = 56;
-const int BEYOND_REPAIR    = 58;
-const int DPOFFLINE        = 60;
+const int BEYOND_REPAIR    = 60;
+const int DPOFFLINE        = 70;
 
 
 
diff --git a/MAC/Navigator2/scripts/libs/GCFCommon_test.ctl b/MAC/Navigator2/scripts/libs/GCFCommon_test.ctl
index 51ab441f0966e02f60261fa9114596afdb9391a7..4d1109cb73a0218572bc3faf668d8ba5e9923221 100644
--- a/MAC/Navigator2/scripts/libs/GCFCommon_test.ctl
+++ b/MAC/Navigator2/scripts/libs/GCFCommon_test.ctl
@@ -43,6 +43,7 @@ const string   DPNAME_NAVIGATOR  = "__navigator";
 global string   MainDBName        = "MCU199:";
 global string   CEPDBName         = "CCU199:";
 global unsigned MainDBID          = 64;
+global int  g_MaxNrClaims         = 250;      // the maximal nr of claims handled by the claimmanager
 
 global mapping stateColor;
 global mapping stateName;
@@ -51,7 +52,6 @@ global mapping stateNumber;
 global bool       g_initializing          = true;     // to show if initialise is ready
 global string     g_initProcess           = "";       // holds last finished init process
 global bool       g_standAlone            = false;    // can be used to check if we are in standalone mode (== station only mode)
-global int        g_MaxNrClaims           = 250;      // the maximal nr of claims handled by the claimmanager
 
 
 ///////////////////////////////////////////////////////////////////////////
@@ -73,8 +73,8 @@ void initLofarColors() {
     stateColor [50] = "Lofar_broken";
     stateColor [53] = "Lofar_broken_went";
     stateColor [56] = "Lofar_broken_came";
-    stateColor [58] = "Lofar_beyond_repair";
-    stateColor [60] = "Lofar_dpOffline";
+    stateColor [60] = "Lofar_beyond_repair";
+    stateColor [70] = "Lofar_dpOffline";
     
   	stateName [0]  = "off";
     stateName [10] = "operational";
@@ -86,8 +86,8 @@ void initLofarColors() {
     stateName [50] = "broken";
     stateName [53] = "broken_went";
     stateName [56] = "broken_came";
-    stateName [58] = "beyond_repair";
-    stateName [60] = "dp_Offline";
+    stateName [60] = "beyond_repair";
+    stateName [70] = "dp_Offline";
     
     stateNumber ["off"]             = 0;
     stateNumber ["operational"]     = 10;
@@ -99,8 +99,8 @@ void initLofarColors() {
     stateNumber ["broken"]          = 50;
     stateNumber ["broken_went"]     = 53;
     stateNumber ["broken_came"]     = 56;
-    stateNumber ["beyond_repair"]   = 58;
-    stateNumber ["dpOffline"]       = 60;
+    stateNumber ["beyond_repair"]   = 60;
+    stateNumber ["dpOffline"]       = 70;
 }
 
 
@@ -114,8 +114,8 @@ const int SUSPICIOUS_CAME  = 46;
 const int BROKEN           = 50;
 const int BROKEN_WENT      = 53;
 const int BROKEN_CAME      = 56;
-const int BEYOND_REPAIR    = 58;
-const int DPOFFLINE        = 60;
+const int BEYOND_REPAIR    = 60;
+const int DPOFFLINE        = 70;
 
 
 
diff --git a/MAC/Navigator2/scripts/libs/navFunct.ctl b/MAC/Navigator2/scripts/libs/navFunct.ctl
index 17ef94929fe760d95d6fe3002d8b8191d8073482..9087e4e0476e58d1e79e22710a7337f36ed8adec 100644
--- a/MAC/Navigator2/scripts/libs/navFunct.ctl
+++ b/MAC/Navigator2/scripts/libs/navFunct.ctl
@@ -1911,8 +1911,9 @@ void navFunct_fillStationLists() {
 //                                 "RS306","RS307","RS308","RS309","RS310","RS311",
 //                                 "RS404","RS406","RS407","RS408","RS409","RS410","RS411","RS412","RS413",
 //                                 "RS503","RS506","RS507","RS508","RS509");
-//  europeStations = makeDynString("DE601","DE602","DE603","DE604","DE605","DE609","FR606","PL610","PL611","PL612","SE607","UK608");
-  europeStations = makeDynString("DE601","DE602","DE603","DE604","DE605","DE609","FR606","PL610","PL611","PL612","SE607","UK608");
+//  europeStations = makeDynString("DE601","DE602","DE603","DE604","DE605","FR606","SE607","UK608","DE609","PL610","PL611","PL612","IE613");
+
+  europeStations = makeDynString("DE601","DE602","DE603","DE604","DE605","FR606","SE607","UK608","DE609","PL610","PL611","PL612","IE613");
   superTerpStations = makeDynString("CS002","CS003","CS004","CS005","CS006","CS007");
   cs0nnCoreStations = makeDynString("CS001",
                                     "CS011","CS013","CS017",
diff --git a/MAC/Navigator2/scripts/libs/navPanel.ctl b/MAC/Navigator2/scripts/libs/navPanel.ctl
index 96561ad592019b76f6ec4600b2d35de4ff65e977..3af431fc75f33874dbe03ca29c83f6327472f43f 100644
--- a/MAC/Navigator2/scripts/libs/navPanel.ctl
+++ b/MAC/Navigator2/scripts/libs/navPanel.ctl
@@ -434,30 +434,12 @@ void navPanel_statePopup(string baseDP) {
   dyn_string popup;
 
   // NCFObjectState vars
-  string DPName="";
   int state;
-  string message="Operator Overrule";
-  bool force=true;
   
   // define the popupMenu
   LOG_DEBUG("navPanel.ctl:navPanel_statePopup|define popup for DP: "+baseDP);
  
-  int idx=1;
-//  dynInsertAt(popup,"PUSH_BUTTON,Acknowledge All,3,1",idx++);
-  dynInsertAt(popup,"PUSH_BUTTON,Report issue to CRAFT,4,1",idx++);
-  dynInsertAt(popup,"SEPARATOR",idx++);    
-  dynInsertAt(popup,"CASCADE_BUTTON,Set State, 1",idx++);
-  dynInsertAt(popup,"CASCADE_BUTTON,Set Recursive State, 1",idx++);
-  dynInsertAt(popup,"Set State",idx++);
-  for (int i = 1; i <= mappinglen(stateName); i++)  {
-    string aS="PUSH_BUTTON,"+mappingGetValue(stateName,i)+",1"+mappingGetKey(stateName,i)+",1";
-    dynInsertAt(popup,aS,idx++);
-  }  
-  dynInsertAt(popup,"Set Recursive State",idx++);
-  for (int i = 1; i <= mappinglen(stateName); i++)  {
-    string aS="PUSH_BUTTON,"+mappingGetValue(stateName,i)+",2"+mappingGetKey(stateName,i)+",1";
-    dynInsertAt(popup,aS,idx++);
-  }
+  dynAppend(popup,"PUSH_BUTTON,Set State,1,1");
   
   LOG_DEBUG("navPanel.ctl:navPanel_statePopup|popup composed");
   if (popupMenu(popup,state)<0 || !state>0) {
@@ -465,116 +447,14 @@ void navPanel_statePopup(string baseDP) {
   }
   
   LOG_DEBUG("navPanel.ctl:navPanel_statePopup|popup returned: "+state);
-  bool recursive = false;
-  bool ackall = false;
-  if (state == 3) {
-    ackall = true;
-    recursive=true;
-    // add 1000 to state to indicate a big non existing state, so we are able to receive that in the monitor reset controller
-    // and see it's not a normal reset.
-    state+=1000;
-  } else if (state == 4 ) {
-    // This will only work on windows for now    
-    string httpStr=g_craftPath+"craft/edit/setUpReportIssue.do?locationPath="+baseDP+".html";
-//    string httpStr="http://lofartest.astron.nl:8080/craft/edit/setUpReportIssue.do?locationPath="+baseDP+".html";
-    LOG_DEBUG("navPanel.ctl:navPanel_statePopup|httpStr: "+httpStr);
-    std_help(httpStr,true);
-    state=-1;    
-  } else if (state == 10 ) {
-    state = 0;
-  } else if (state == 20) {
-    state = 0;
-    recursive = true;    
-  } else if (state < 200) {
-    state -= 100;
-  } else {
-    state -= 200;
-    recursive = true;
-  }        
-
-  LOG_DEBUG("navPanel.ctl:navPanel_statePopup|recursive="+recursive);
-  LOG_DEBUG("navPanel.ctl:navPanel_statePopup|ackall="+ackall);
   
-  string database = dpSubStr(baseDP,DPSUB_SYS);
-  string bareDP = dpSubStr(baseDP,DPSUB_DP);
-  if (state >= 0  ) {
-    if (!recursive) {
-      LOG_DEBUG("navPanel.ctl:navPanel_statePopup|Operator sets "+baseDP+".status.state to "+getStateName(state)+ " (SINGLE) on database: "+database);
-      DPName=baseDP+".status.state";
-      dpSet(database+"__navObjectState.DPName",DPName,
-            database+"__navObjectState.stateNr",state,
-            database+"__navObjectState.message",message,
-            database+"__navObjectState.force",force);
-    } else {
-      // we will write the info to the __resetObjectState point.
-      // All existing stations, CCU's and MCU's will be connected to this point
-      // via a ctl script that runs on each machine.
-      // that script will do an update (if needed) for their own Database.
-      LOG_DEBUG("navPanel.ctl:navPanel_statePopup|Operator sets "+baseDP+".status.state to "+getStateName(state)+" (RECURSIVE) on database: "+database);
-      dpSet(database+"__resetObjectState.DPName",baseDP,
-            database+"__resetObjectState.stateNr",state,
-            database+"__resetObjectState.message",message);
-    }
-    
-    //as last we also need to loop through the global alarms and throw away went states, 
-    // and set CAME to ACK for all alarms starting at the given DP
-    
-    if (ackall) {
-      dyn_string dps;
-      bool changed=false;
-      // change CAME to ACK and collect all dps that are WENT
-      LOG_DEBUG("navPanel.ctl:navPanel_statePopup|bareDP to start from:"+bareDP);
-      for (int i=1;i<=dynlen(g_alarms["DPNAME"]);i++) {
-        // only if DP is in wanted DP range
-        if (strpos(g_alarms["DPNAME"][i],bareDP)>-1) {
-          if (g_alarms["STATUS"][i] == CAME) {
-            g_alarms["STATUS"][i] = ACK;
-            if (g_alarms["STATE"][i] == BROKEN_CAME) {
-              g_alarms["STATE"][i] = BROKEN;
-            } else if (g_alarms["STATE"] == SUSPICIOUS_CAME) {
-              g_alarms["STATE"][i] = SUSPICIOUS;
-            }
-            changed=true;
-          } else if (g_alarms["STATUS"][i] == WENT) {
-            dynAppend(dps,g_alarms["DPNAME"][i]);
-          }
-        }
-      
-        // now remove found WENTs from mapping
-        if (dynlen(dps) > 0) {
-          changed=true;
-          for (int i=1; i<= dynlen(dps); i++) {
-            int iPos=dynContains(g_alarms["DPNAME"],dps[i]);
-            if (iPos > 0) {
-              dynRemove(g_alarms["DPNAME" ],iPos);
-              dynRemove(g_alarms["TIME"   ],iPos);
-              dynRemove(g_alarms["STATE"  ],iPos);
-              dynRemove(g_alarms["MESSAGE"],iPos);
-              dynRemove(g_alarms["STATUS" ],iPos);
-            }
-          }
-        }
-      }
-      // if something changed, rewrite mapping and trigger monitor alarm controllers
-      if (changed) {
-        // rewrite database  
-        if (dpExists(DPNAME_NAVIGATOR + ".alarms")) {
-          LOG_DEBUG("navPanel.ctl:navPanel_statePopup|Storing the alarms in db");
-          setAlarms(DPNAME_NAVIGATOR + ".alarms",
-                    g_alarms[ "TIME"],g_alarms[ "DPNAME"   ],g_alarms[ "MESSAGE"  ],g_alarms[ "STATE"    ],g_alarms[ "STATUS"   ]);
-        } else {
-          LOG_ERROR("navPanel.ctl:navPanel_statePopup|Couldn't write alarms to navigator");
-        }
-        // trigger reread for monitorAlarmCtrl
-        if (dpExists(DPNAME_NAVIGATOR + ".alarms.rereadAlarms")) {
-          LOG_DEBUG("navPanel.ctl:navPanel_statePopup|trigger monitorAlarms");
-          dpSet(DPNAME_NAVIGATOR + ".alarms.rereadAlarms",true);
-        } else {
-          LOG_ERROR("navPanel.ctl:navPanel_statePopup|Couldn't write alarms.rereadAlarms");
-        }  
-      }
-    }      
+  if( state == 1 )
+  {
+    LOG_DEBUG("navPanel.ctl:navPanel_statePopup|Open popup 'Popups/Popup_SetState.pnl' for baseDP '" + baseDP + "'");
+    ChildPanelOnRelativModal( "Popups/Popup_SetState.pnl", 
+                              "SetState_" + baseDP,
+                              makeDynString( "$baseDP:" + baseDP ),
+                              10, 10 );
   }
-  LOG_DEBUG("navPanel.ctl:navPanel_statePopup|end (re)set states reached");
 }
 
diff --git a/MAC/Navigator2/scripts/libs/navigator.ctl b/MAC/Navigator2/scripts/libs/navigator.ctl
index 0c38275bb24d32894f49b1fda181340430ac78b5..d919a6cd0f2ddf997688849e34b63763e201e984 100644
--- a/MAC/Navigator2/scripts/libs/navigator.ctl
+++ b/MAC/Navigator2/scripts/libs/navigator.ctl
@@ -37,7 +37,6 @@
 #uses "GCFCWD.ctl"
 #uses "claimManager.ctl"
 #uses "GCFCommon.ctl"
-#uses "GCFAlarm.ctl"
 #uses "navCtrl.ctl"
 #uses "navConfig.ctl"
 #uses "navFunct.ctl"
@@ -115,8 +114,8 @@ void navigator_handleEventInitialize()
   LOG_TRACE("navigator.ctl:navigator_handleEventInitialize|entered");
   g_initializing = true;
   
-    MainDBName         = getSystemName();
-    MainDBID           = getSystemId();
+  MainDBName         = getSystemName();
+  MainDBID           = getSystemId();
   // first we need to check if we are on the MainCU or a stationDB, if we are on a stationDB we are in standalone mode
   if (strpos(MainDBName,"MCU") >= 0) {
     CEPDBName          = MainDBName;
@@ -188,14 +187,6 @@ void navigator_handleEventInitialize()
   // Clear the workDatapoints
   navigator_clearWorkDPs();  
         
-  // Initilaize the alarm system
-  initNavigatorAlarms();
-
-
-  // we need to wait until the alarmSystem has been initialised
-  if (!waitInitProcess("initNavigatorAlarmsFinished")) {
-    LOG_FATAL("navigator.ctl:navigator_handleEventInitialize|Couldn't finish initNavigatorAlarmsFinished() , leaving");
-  }
  
   // Do a dpQueryConnectSingle() so that we get a list of observations
   // so that we can easily populate our tables with 'Planned', 'Running' and 'Finished' observations
diff --git a/MAC/Navigator2/scripts/monitorAlarms.ctl b/MAC/Navigator2/scripts/monitorAlarms.ctl
index 5119eac5659ee439f98c33c14be8c8945c74fb35..15f53dcca98d6c3ea0dd957875846cc5f8cff04c 100644
--- a/MAC/Navigator2/scripts/monitorAlarms.ctl
+++ b/MAC/Navigator2/scripts/monitorAlarms.ctl
@@ -21,7 +21,6 @@
 //#  $Id$
 
 #uses "GCFCommon.ctl"
-#uses "GCFAlarm.ctl"
 #uses "navFunct.ctl"
 
 
@@ -33,451 +32,180 @@
 bool bDebug=false;
 bool occupied=false;
 
-main () {
+mapping mLastData;
+
+
+void main()
+{
+  
 
   // Set the global statecolors/colornames.
   initLofarColors();
+  
+  // connect to debugflag to be able to switch debug on/off during run
+  if (dpExists("scriptInfo.monitorAlarms.debug")) {
+    dpConnect("debugCB",true,"scriptInfo.monitorAlarms.debug");
+  } else {
+    DebugTN("monitorAlarms.ctl:main|scriptInfo.monitorAlarms.debugpoint not found in Database");  
+  } 
 
   // initialize the AlarmSystem
-  initCtrlAlarmSystem();
+  Init();
+
 }
 
-///////////////////////////////////////////////////////////////////////////
-//
-// Function initAlarmSystem
-//
-// Initializes the AlarmSystem for the main ctrl'er that runs on the MainCu
-// connect to distmanager to be able to check
-// if systems came or went ofline. If came or went do a queryconnect again on all
-// NCFObjectStates to be able to check if state changes were issued.
-// 
-///////////////////////////////////////////////////////////////////////////
-void initCtrlAlarmSystem()  {
-  if (bDebug) DebugTN("monitorAlarms.ctl:initAlarmSystem|entered");
-  g_alarms[ "TIME"     ] = makeDynTime();                    
-  g_alarms[ "DPNAME"   ] = makeDynString();
-  g_alarms[ "MESSAGE"  ] = makeDynString();
-  g_alarms[ "STATE"    ] = makeDynInt();
-  g_alarms[ "STATUS"   ] = makeDynInt();
-  
-  // read all stored alarms.
-  readAlarms();
-  
-  // Routine to connect to _DistConnections.ManNums.
-  // This point keeps a dyn_int array with all active distributed connections
-  // and will generate a callback everytime a station goes off-, or on- line
 
- 
-  if (dpExists("_DistConnections.Dist.ManNums")) {
-    dpConnect("distSystemTriggered",true,"_DistConnections.Dist.ManNums");
-  } else {
-    if (bDebug) DebugTN("monitorAlarms.ctl:initCtrlAlarmSystem|_DistConnections point not found, no trigger available for dist System updates.");  
-  } 
-  if (bDebug) DebugTN("monitorAlarms.ctl:initCtrlAlarmSystem|Nr alarms in global after init: "+ dynlen(g_alarms["TIME"]));      
-  showMapping(g_alarms,"g_alarms"); 
+private void debugCB(string dp1, bool debug)
+{
+  bDebug = debug;
 }
 
-// *******************************************
-// Name : distSystemTriggered
-// *******************************************
-// Description:
-// Callback that a distSystem has connected/disconnected
-//
-//
-// Returns:
-//    None
-// *******************************************
-void distSystemTriggered(string dp1, dyn_int systemList) {
-  
-  string query = "SELECT '_original.._value' FROM '{__navObjectState.DPName,__navObjectState.stateNr,__navObjectState.message,__navObjectState.force}' REMOTE ALL WHERE _DPT = \"NCFObjectState\" SORT BY 0";
-  
-  
-  if (isConnected) {
-    dpQueryDisconnect("objectStateCallback","objectState"); 
-    dpDisconnect("resetTriggered",DPNAME_NAVIGATOR +  ".alarms.dpResetList",
-                                  DPNAME_NAVIGATOR +  ".alarms.dpResetStates",
-                                  DPNAME_NAVIGATOR +  ".alarms.dpResetMsgs");
-    dpDisconnect("rereadTriggered",DPNAME_NAVIGATOR +  ".alarms.rereadAlarms");
-  }
-  
-  // also connect to the resetTrigger dp to receive a trigger that the internal global list needs a reread
-  // (in case ACK did remove an alarm for example)
-  if (dpExists(DPNAME_NAVIGATOR +  ".alarms.rereadAlarms")) {
-    dpConnect("rereadTriggered",false,DPNAME_NAVIGATOR +  ".alarms.rereadAlarms");
-  } else {
-    DebugTN("monitorAlarms.ctl:distSystemTriggered|Couldn't connect to"+DPNAME_NAVIGATOR +  ".alarms.rereadAlarms");
-  }  
 
-  // Connect to the dp elements that we use to receive
-  // a new claim in the MainDB
-  // dpQueryConnectAll( "objectStateCallback",true,"objectState",query,20);   test DISCARDING
-  dpQueryConnectAll( "objectStateCallback",true,"objectState",query); 
+
+void Init()
+{
+  string strSysName;
   
-  // also connect to the dpResetList dp to receive lists if dp's that need to be cleared from the global list and thus from the
-  // datapoint in the database
-  if (dpExists(DPNAME_NAVIGATOR +  ".alarms.dpResetList")) {
-    dpConnect("resetTriggered",false,DPNAME_NAVIGATOR +  ".alarms.dpResetList",
-                                     DPNAME_NAVIGATOR +  ".alarms.dpResetStates",
-                                     DPNAME_NAVIGATOR +  ".alarms.dpResetMsgs");
-  } else {
-    DebugTN("monitorAlarms.ctl:distSystemTriggered|Couldn't connect to"+DPNAME_NAVIGATOR +  ".alarms.dpResetList");
-  }
+  strSysName = strrtrim( getSystemName(), ":" );
   
+  string strQuery = "SELECT ALERT '_alert_hdl.._prior', '_alert_hdl.._ackable' " + 
+                    "FROM '{LOFAR_ObsSW.status.childSumAlert,LOFAR_PermSW.status.childSumAlert,LOFAR_PIC.status.childSumAlert}' " +
+                    "REMOTE ALL " +
+                    "WHERE _SYS != \"" + strSysName + "\""; 
   
-  isConnected = true; 
+  dpQueryConnectSingle( "CallbackAlertLCU", true, "", strQuery );
 }
 
-// *******************************************
-// Name : objectStateCallback
-// *******************************************
-// Description:
-// Fill the global alarm mapping and the alarm database
-//
-//
-// Returns:
-//    None
-// *******************************************
-void objectStateCallback(string ident, dyn_dyn_anytype aResult) {
-  
-  if (bDebug) DebugTN( "monitorAlarms.ctl:objectStateCallback| Number of states in callback = " + dynlen( aResult ) );
-  if (bDebug) DebugTN("monitorAlarms.ctl:objectStateCallback|Result: "+ aResult);
-  if (bDebug) DebugTN("monitorAlarms.ctl:objectStateCallback|occupied: "+ occupied);
-  while (occupied) {
-    delay(0,25);    
-  }
-  
-  occupied = true;
-  
-  
-  if (dynlen(aResult) <= 0) {
-    occupied = false;
-    return;
-  } 
-  
-  bool changed = false;
-  int iPos;
- 
-  // Loop through all alarms in this callback
-  for (int nr = 2; nr < dynlen (aResult);nr+=4) {
-    //get the stateNr and DP that go with this message
-    if (!dpExists(aResult[nr][1])) continue;
-    time aTime     = getCurrentTime();
-    string aSystem = dpSubStr(aResult[nr][1],DPSUB_SYS);
-    string aDP     = aResult[nr][2];
-    if (strpos(aDP,":") < 0) {
-      string aS=aSystem+aDP;
-      aDP=aS;
-    }
-    // check if DPName contains a System name, otherwise get the name from dppart
-    
-    int state      = (int)aResult[nr+1][2];
-  
-    // skip BEYOND_REPAIR(58) and DPOFFLINE(60)
-    if (state > 56) {
-      continue;
-    }
-    
-    
-    string message = aResult[nr+2][2];
-    bool force     = aResult[nr+3][2];
-    int aStatus    = CAME;
-  
-    if (aDP==""){
-      continue;
-    }
+
+
+void CallbackAlertLCU( string strIdent, dyn_dyn_anytype ddaAlerts )
+{
+  int x, y, iHighestPrio;
+  bool bCame, bRetVal;
+  string strHighestAlertClass;
   
-    // Is this an existing DP or a new one
-    iPos = dynContains( g_alarms[ "DPNAME"         ], aDP );
+  if (bDebug) LOG_DEBUG( "monitorAlarms.ctl:CallbackAlertLCU|=========================================================================================================================" );
 
   
-    // check if existing dp.
-    // if it exists, check if new state 1st digit > oldState 1st digit && force, otherwise return
-//    if (iPos > 0 && ((floor(g_alarms["STATE"][iPos]/10) >= floor(state/10))&& !force)) {
-    if (iPos > 0 && g_alarms["STATE"][iPos] >= state && !force) {
-    	if (bDebug) DebugN("monitorAlarms.ctl:objectStateCallback|return on condition mismatch");
-    	if (bDebug) DebugN("Found existing dp: ",aDP);
-    	if (bDebug) DebugN("state ",g_alarms["STATE"][iPos]);
-      	continue;
-    }
-    
-    
-    // if state < 40 we might need to remove an ACK'ed or WENT ALARM
-    // if status != ACK then we need to keep it and let ACK command remove it
-    // otherwise it can't be an alarm, so return.
-    if (state < 40)  {
-      if (iPos > 0 && g_alarms["STATUS"][iPos] == ACK ) {
-        dynRemove(g_alarms["DPNAME" ],iPos);
-        dynRemove(g_alarms["TIME"   ],iPos);
-        dynRemove(g_alarms["STATE"  ],iPos);
-        dynRemove(g_alarms["MESSAGE"],iPos);
-        dynRemove(g_alarms["STATUS" ],iPos);
-        changed = true;
+  for( x=2; x<=dynlen(ddaAlerts); x++ )
+  {
+        
+    if (bDebug) DebugN( " ---------------------------------------------------------------------------------------" );
+    if (bDebug) DebugN( ddaAlerts[x] );
 
+    // Declaration and initialization of variables
+    dyn_string dsStationDPEs;
+    string strStation, strStationDP, strStationDistChildSumAlertDPE;
+    int iActState ;       
+    dyn_int diPrios;
 
-      } else if (iPos > 0 && g_alarms["STATUS"][iPos] == CAME) {
-        g_alarms["STATUS"][iPos] = WENT;
-        g_alarms["STATE"][iPos] = g_alarms["STATE"][iPos]-3;
-        changed = true;
-      }   
-      if (changed) {
-        storeAlarms();
+    
+    // 12-jun-2017: to detect callbacks with the same data: first check the last known data in our mapping
+    string strStationDPE = dpSubStr( ddaAlerts[x][1], DPSUB_SYS_DP_EL );
+    if( mappingHasKey( mLastData, strStationDPE ) )
+    {
+      if( mLastData[strStationDPE] == ddaAlerts[x] )
+      {
+           if (bDebug) LOG_DEBUG( "monitorAlarms.ctl:CallbackAlertLCU|Data for " + strStationDPE+ " is not changed !!!" );
+           continue;
       }
-      continue;
     }
     
-    // in the remainder of the cases the state was an alarm
-    if( iPos < 1 ){
-      if (bDebug) DebugN("monitorAlarms.ctl:objectStateCallback|Need to append new alarm");
-      dynAppend( g_alarms[ "DPNAME"          ], aDP );
-      iPos = dynlen( g_alarms[ "DPNAME" ] );
-      if (state == BROKEN) aStatus=ACK;
-      if (state == BROKEN_WENT) aStatus=WENT;
-      if (state == BROKEN_CAME) aStatus=CAME;
-      if (state == SUSPICIOUS) aStatus=ACK;
-      if (state == SUSPICIOUS_WENT) aStatus=WENT;
-      if (state == SUSPICIOUS_CAME) aStatus=CAME;
+    // Store data to detect next change
+    mLastData[strStationDPE] = ddaAlerts[x];
+    
     
-    } else {
-      if (bDebug) DebugN("monitorAlarms.ctl:objectStateCallback|Need to examine if alarm update is needed");
-      // it was an existing DP, so we have to compare the status.
-     
-      int oldState=g_alarms["STATE"][iPos];
-      time oldTime = g_alarms["TIME"][iPos];
+    
+    int iPrio        = ddaAlerts[x][3];
+    bool bAckable    = ddaAlerts[x][4];
 
-      // check broken ranges first
-      if (state >= BROKEN ) {
-        if (oldState == BROKEN) {
-          if (state == BROKEN) {
-            aStatus = ACK;
-            aTime = oldTime;
-          } else if (state == BROKEN_CAME) {
-            aStatus = CAME;
-          } else {
-            aStatus = WENT;
-          }
-        } else if (oldState  == BROKEN_WENT) {
-          if (state == BROKEN) {
-            aStatus = ACK;
-          } else if (state == BROKEN_WENT) {
-            aTime = oldTime;
-            aStatus = WENT;
-          } else {
-            aStatus = CAME;
-          }        
-        } else if (oldState == BROKEN_CAME) {
-          if (state == BROKEN) {
-            aStatus = ACK;
-          } else if (state == BROKEN_WENT) {
-            aStatus = WENT;
-          } else {
-            aTime = oldTime;
-            aStatus = CAME;
-          }
-        }
-      } else if (state >= SUSPICIOUS) {
-        if (oldState == SUSPICIOUS) {
-          if (state == SUSPICIOUS) {
-            aTime = oldTime;
-            aStatus = ACK;
-          } else if (state == SUSPICIOUS_CAME) {
-            aStatus = CAME;
-          } else {
-            aStatus = WENT;
-          }
-        } else if (oldState  == SUSPICIOUS_WENT) {
-          if (state == SUSPICIOUS) {
-            aStatus = ACK;
-          } else if (state == SUSPICIOUS_WENT) {
-            aTime = oldTime;
-            aStatus = WENT;
-          } else {
-            aStatus = CAME;
-          }        
-        } else if (oldState == SUSPICIOUS_CAME) {
-          if (state == SUSPICIOUS) {
-            aStatus = ACK;
-          } else if (state == SUSPICIOUS_WENT) {
-            aStatus = WENT;
-          } else {
-            aStatus = CAME;
-            aTime = oldTime;
-          }        
-        }
-      }
+    // Get stationname and remove ':' on the end
+    strStation = dpSubStr( ddaAlerts[x][1], DPSUB_SYS );
+    strStation = strrtrim( strStation, ":" );
+    
+    // Determine station DP to use, based on DPE name: LOFAR_ObsSW, LOFAR_PermSW or LOFAR_PIC
+    if( patternMatch( "*LOFAR_ObsSW*", ddaAlerts[x][1] ) )
+    {
+      dsStationDPEs = dpNames( "LOFAR_ObsSW*" + strStation, "Station"  );
     }
-    if (bDebug) DebugTN("monitorAlarms.ctl:objectStateCallback|Found: Datapoint - "+aDP);
-    if (bDebug) DebugTN("monitorAlarms.ctl:objectStateCallback|Found: Time      - ",aTime);
-    if (bDebug) DebugTN("monitorAlarms.ctl:objectStateCallback|Found: State     - "+state);
-    if (bDebug) DebugTN("monitorAlarms.ctl:objectStateCallback|Found: Message   - "+message);
-    if (bDebug) DebugTN("monitorAlarms.ctl:objectStateCallback|Found: Status    - "+aStatus);
-    if (bDebug) DebugTN("monitorAlarms.ctl:objectStateCallback|Found: Force     - "+force);
-    if (bDebug) DebugTN("monitorAlarms.ctl:objectStateCallback|iPos:            - "+iPos);
-    // Now store the values 
-    g_alarms[ "TIME"    ][iPos] = aTime;
-    g_alarms[ "STATE"   ][iPos] = state;
-    g_alarms[ "MESSAGE" ][iPos] = message;
-    g_alarms[ "STATUS"  ][iPos] = aStatus;
-    changed=true;
-    // check if the alarm was a suspicious_came or an alarm_came
-    // if this is true then we need to send an email to the observers
-    // the station tests generate 100's of alarms all the time, 
-    // the system should know this but the mailnotification becomes spam with these amounts
-    // so we will skip these for now.
-    if (strpos(message,"stationtest:") < 0) {
-      if (state == SUSPICIOUS_CAME ) {
-        sendMail("SUSPICIOUS_CAME",aDP,aTime,message);
-      } else if (state == BROKEN_CAME) {
-        sendMail("BROKEN_CAME",aDP,aTime,message);        
-      }
+    else if( patternMatch( "*LOFAR_PermSW*", ddaAlerts[x][1] ) )
+    {
+      dsStationDPEs = dpNames( "LOFAR_PermSW*" + strStation, "Station"  );
     }
-  }
-  // store all alarms if changed
-  if (changed) {
-    storeAlarms();
-  }
-  occupied = false;
-}
-
-void resetTriggered(string dp1, dyn_string aDPList,
-                    string dp2, dyn_int aStateList,
-                    string dp3, dyn_string aMsgList) {
-    while (occupied) {
-      delay(0,25);    
+    else if( patternMatch( "*LOFAR_PIC*", ddaAlerts[x][1] ) )
+    {
+      dsStationDPEs = dpNames( "LOFAR_PIC_*" + strStation, "Station"  );
+    }
+    else
+    {
+      if (bDebug) DebugTN( __FUNCTION__ + "(): unrecognized alert '" + ddaAlerts[x][1] + "', skipp it !!" );
+if (bDebug) LOG_DEBUG( "monitorAlarms.ctl:CallbackAlertLCU|unrecognized alert '" + ddaAlerts[x][1] + "', skipp it !!" );
+      continue;
     }
-    occupied=true;
-    
-    if (bDebug) DebugTN("monitorAlarms.ctl:resetTriggered|resetList received: "+ aDPList);
-    bool changed = false;
-    int iPos=-1;
-    time aTime     = getCurrentTime();    
-    // we have to loop through the supplied dplists,
-    // we need to check if the new state is an alarm,
-    // if it is an alarm (40-56)
-    // check if available in alarm list, if not, add it.
-    // if it is, and it differs from the old, update the old one
-    //
-    // if the state is not an alarm, but the dp is in the alarm list
-    // remove the alarm.
-    
-    // start checking over all supplied dps
-    for (int i=1;i <= dynlen(aDPList); i++) {
-      iPos = dynContains( g_alarms[ "DPNAME"         ], aDPList[i] );
-    
-      // check if state >= start alarm type states
-      if (aStateList[i] >= SUSPICIOUS  ) {
-        if (iPos > 0) {
-          if (g_alarms["STATE"][iPos] != aStateList[i]) {
-            if (g_alarms["STATE"][iPos]!=aStateList[i] || 
-                g_alarms["STATUS"][iPos]!=stateToStatus(aStateList[i]) ||
-                g_alarms["MESSAGE"][iPos]!=aMsgList[i] ) {
-              g_alarms["TIME"][iPos] = aTime;
-              g_alarms["STATE"][iPos]=aStateList[i];
-              g_alarms["MESSAGE"][iPos]=aMsgList[i];
-              g_alarms["STATUS"][iPos]=stateToStatus(aStateList[i]);
-              // check if the alarm was a suspicious_came or an alarm_came
-              // if this is true then we need to send an email to the observers
-              if (aStateList[i] == SUSPICIOUS_CAME ) {
-                sendMail("SUSPICIOUS_CAME",aDPList[i],aTime,aMsgList[i]);
-              } else if (aStateList[i] == BROKEN_CAME) {
-                sendMail("BROKEN_CAME",aDPList[i],aTime,aMsgList[i]);        
-              }
-              changed=true;
-            }   
-          }
-        } else {
-          iPos=dynAppend(g_alarms["DPNAME" ],aDPList[i]);
-          g_alarms["TIME"][iPos] = aTime;
-          g_alarms["STATE"][iPos]=aStateList[i];
-          g_alarms["MESSAGE"][iPos]=aMsgList[i];
-          g_alarms["STATUS"][iPos]=stateToStatus(aStateList[i]);
-          // check if the alarm was a suspicious_came or an alarm_came
-          // if this is true then we need to send an email to the observers
-          if (aStateList[i] == SUSPICIOUS_CAME ) {
-            sendMail("SUSPICIOUS_CAME",aDPList[i],aTime,aMsgList[i]);
-          } else if (aStateList[i] == BROKEN_CAME) {
-            sendMail("BROKEN_CAME",aDPList[i],aTime,aMsgList[i]);        
-          }
-          changed=true;
-        }
-      } else {
-        // If it was in the list it can be removed now
-        if (iPos > 0) {
-          dynRemove(g_alarms["DPNAME" ],iPos);
-          dynRemove(g_alarms["TIME"   ],iPos);
-          dynRemove(g_alarms["STATE"  ],iPos);
-          dynRemove(g_alarms["MESSAGE"],iPos);
-          dynRemove(g_alarms["STATUS" ],iPos);
-          changed=true;
-        } 
-      }
-    }  
     
-    if (changed) {
-      storeAlarms();
+    // Normally only one DPE should be found: take it
+    if( dynlen(dsStationDPEs) >= 1 )
+    {
+      strStationDP = dpSubStr( dsStationDPEs[1], DPSUB_DP );
+    }
+    else
+    {
+      if (bDebug) LOG_DEBUG( "monitorAlarms.ctl:CallbackAlertLCU|strStationDP NOT FOUND FOR ALERT '" + ddaAlerts[x][1] + "' !!" );
+      continue;
     }
-    occupied = false;  
-}
-
-void rereadTriggered(string dp1, bool aB) {
-  if (bDebug) DebugTN("monitorAlarms.ctl:rereadTriggered|reread internal alarmList");
-  while (occupied) {
-    delay(0,25);    
-  }
-  occupied=true;
     
-  readAlarms();
-  occupied=false;
-}
-
-
-void storeAlarms() {
-  // store alarms in database.
-  if (dpExists(DPNAME_NAVIGATOR + ".alarms")) {
-    if (bDebug) DebugTN("monitorAlarms.ctl:objectStateCallback|Storing the alarms in db: "+g_alarms);
-    setAlarms(DPNAME_NAVIGATOR + ".alarms",
-              g_alarms[ "TIME"],g_alarms[ "DPNAME"   ],g_alarms[ "MESSAGE"  ],g_alarms[ "STATE"    ],g_alarms[ "STATUS"   ]);
-  } else {
-    DebugTN("monitorAlarms.ctl:objectStateCallback|Couldn't write alarms to navigator ");
-  }
-}
+    strStationDistChildSumAlertDPE = strStationDP + ".dist_childSumAlert";
 
+    // Get actual state and list of summed-prios's (because they can't be get by the dpConnect)   
+    dpGet( ddaAlerts[x][1] + ":_alert_hdl.._act_state",    iActState,
+           ddaAlerts[x][1] + ":_alert_hdl.._summed_prios", diPrios );
 
-void readAlarms() {
-  mappingClear(g_alarms);
     
-  // read initial alarms from database.
-  if (dpExists(DPNAME_NAVIGATOR +  ".alarms")) {
-    getAlarms(DPNAME_NAVIGATOR +  ".alarms",
-              g_alarms[ "TIME"],g_alarms[ "DPNAME"   ],g_alarms[ "MESSAGE"  ],g_alarms[ "STATE"    ],g_alarms[ "STATUS"   ]);
-  } else {
-    DebugTN("monitorAlarms.ctl:initCtrlAlarmSystem|Couldn't get alarms from navigator");
-  }
-}
-
-private void sendMail(string state, string aDP,time aTime,string message) {
+    // First deactivate the alert to go to a 'default' state
+    dpSet( strStationDistChildSumAlertDPE, 0 );
+    dpDeactivateAlert( strStationDistChildSumAlertDPE, bRetVal, TRUE );
+
+    // Now set the highest/actual prio of the sumalert as alert, this raises the alert
+    dpActivateAlert( strStationDistChildSumAlertDPE, bRetVal, TRUE );        
+    dpSet( strStationDistChildSumAlertDPE, iPrio );
+   
+    // If sum-alert is acked: ack our alert also
+    if( iActState == DPATTR_ALERTSTATE_APP_ACK )
+    {
+      dpSet( strStationDistChildSumAlertDPE + ":_alert_hdl.._ack", DPATTR_ACKTYPE_SINGLE );
+    }
+    
+    // If sum-alert is went-unacked: detect prio that cames below our prio and do dpSet, this causes the alert to go to the went-unacked state
+    if( ( iActState == DPATTR_ALERTSTATE_APP_DISAPP_NOT_ACK ) ||
+        ( iActState == DPATTR_ALERTSTATE_DISAPP_NOT_ACK ) )
+    {
+      int iNextPrio;
+      
+      dynSort( diPrios );
+      
+      for( y=1; y<=dynlen(diPrios); y++ )
+      {
+        // If this is prio is higher or equal then our current sumalert prio: stop
+        if( diPrios[y] >= iPrio )
+        {
+          break;
+        }
+        
+        // If this prio is higher then the previous one: takeover
+        if( diPrios[y] > iNextPrio )
+        {
+          iNextPrio = diPrios[y];
+        }
+      }
 
-  int ret;
-  dyn_string email_cont;
-  string aS="";
-  
-  string t = formatTime("%c",aTime);
+      // dpSet determined prio
+      dpSet( strStationDistChildSumAlertDPE, iNextPrio );
 
-  email_cont[1] = "dummymail@astron.nl";
-  email_cont[2] = "lofarsys@control.lofar";
-  aS="LOFAR_ALARM "+dpSubStr(aDP,DPSUB_SYS)+" "+message+" "+state;
-  email_cont[3] = aS;
-  aS="This is a generated message, replying is useless.\n\n New alarm from LOFAR: \n\n time     : "+t+"\n status   : "+state+"\n datapoint: "+aDP+"\n message  : "+message; 
-  email_cont[4] = aS;
-  
-  dyn_string emails;
-  dpGet("MCU001:__navigator.alarmSettings.emails",emails);
+    }
+   
+     if (bDebug) LOG_DEBUG( "monitorAlarms.ctl:CallbackAlertLCU|Copied alert '" + ddaAlerts[x][1] + "' to strStationDistChildSumAlertDPE '" + strStationDistChildSumAlertDPE + "'" );
+  }  
   
-  for(int i=1;i<=dynlen(emails);i++) {
-    email_cont[1] = emails[i];
   
-    // sending the message
-    if (bDebug) DebugTN("sending msg to listeners: ");
-    emSendMail ("smtp.lofar.eu","mcu001.control.lofar", email_cont, ret);
-    if (bDebug) DebugTN("SendMail return value: "+ret);
-  }
 }
+
diff --git a/MAC/Navigator2/scripts/monitorStateChanges.ctl b/MAC/Navigator2/scripts/monitorStateChanges.ctl
index 47f8738c67d59ff36564650f9874e7830f2ed35f..6e26d8ce045fd73e2c30fbcb2ec1b28a532b728c 100644
--- a/MAC/Navigator2/scripts/monitorStateChanges.ctl
+++ b/MAC/Navigator2/scripts/monitorStateChanges.ctl
@@ -24,7 +24,9 @@
 
 
 // This script needs to run on every CSU, CCU and MainCU
-// it monitors the state changes in the database, and will update the childstates accordingly
+// it monitors the point where the state changes are being send to and updates the point in the database accordingly.
+// it will also set comments into the alarmsystem accordingly.
+// in the past it also tried to update all childStates, but this will be done by the childSumAlert automaticly from now on
 // 
 
 global bool isConnected=false;
@@ -44,6 +46,7 @@ main () {
 
   // subscribe to the statechange update mechanism
   subscribeObjectStateChange();
+  subscribeObjectStateChanges();
 }
 
 
@@ -51,157 +54,44 @@ main () {
 //Function subscribeObjectStateChange
 // 
 // subscribes to the __navObjectState DP of the database to monitor 
-// possible stateChanges, also checks if the scripts runs on a MCU*** 
-// machine and subscribes to the needed statechanges there also.
+// possible stateChanges,
 //
-// Added 26-3-2007 A.Coolen
 ///////////////////////////////////////////////////////////////////////////
 void subscribeObjectStateChange() {
 
   if (bDebug){
      DebugN("monitorStateChanges.ctl:subscribeObjectStateChange|entered");
    }
-  // ROutine to connnect to the __navObjectState point to trigger statechanges
-  // So that childState points can be set/reset accordingly.
+  // Routine to connnect to the __navObjectState point to trigger statechanges
 
   dpConnect("objectStateTriggered",false,"__navObjectState.DPName",
             "__navObjectState.stateNr",
             "__navObjectState.message",
             "__navObjectState.force");
   
-  //Find out the Database we are running on
-  string database=getSystemName();
-  if (substr(database,0,3) == "MCU") {
-    connectMainPoints();  
-  }
 }
 
- 
 ///////////////////////////////////////////////////////////////////////////
-//Function connectMainPoints
+//Function subscribeObjectStateChanges
 // 
-// connect to the mainpoints to set the state's and childstate's to the max
-// of the state's and childstate's of the ones in the stations
-//
-// Msg something like: Station:Dp.state=state
-//                e.g. CS011:LOFAR_ObsSW_Oservation10.status.state=broken
-//
-// Points of interrest:
-//    StnObservation  --> Station --> MCU*:LOFAR_ObsSW_Observation*_*_CS011.status.state/childState
-//    StnPermSW       --> Station --> MCU*:LOFAR_PermSW_*_CS011.status.state/childState
-//    StnPic          --> Station --> MCU*:LOFAR_PIC_*_CS011.status.state/childState
-//    if an Antenna changes state or childstate, the rcu belonging to this antenna should trigger its childstate
-//
-// Added 26-3-2007 A.Coolen
-///////////////////////////////////////////////////////////////////////////
-void connectMainPoints() {
-
-  // Routine to connect to _DistConnections.ManNums.
-  // This point keeps a dyn_int array with all active distributed connections
-  // and will generate a callback everytime a station goes off-, or on- line
-
-  if (dpExists("_DistConnections.Dist.ManNums")) {
-    dpConnect("distSystemTriggered",true,"_DistConnections.Dist.ManNums");
-  } else {
-    DebugN("monitorStateChanges.ctl:connectMainPoints|_DistConnections point not found, no trigger available for dist System updates.");  
-  }
-
-}
-
-
-///////////////////////////////////////////////////////////////////////////
-//Function distSystemTriggered
-// 
-// Callback function that is triggered by the (dis)appearance of a Distributed system.
-//
-///////////////////////////////////////////////////////////////////////////
-void distSystemTriggered(string dp1, dyn_int systemList) {
-  
-  if (bDebug) DebugN("monitorStateChanges.ctl:distSystemTriggered|entered");
-
-  // Check all states from LOFAR_PermSW.state in all remote stations.
-  // if one of them changes, and the state is not equal to old state, update the MCU one
-  string queryPermSW = "SELECT '_original.._value' FROM '{LOFAR_PermSW.status.state,LOFAR_PermSW.status.childState}' REMOTE ALL WHERE _DPT = \"StnPermSW\" SORT BY 1 DESC";
-
-  // Check all states from LOFAR_PIC.state in all remote stations.
-  // if one of them changes, and the state is not equal to old state, update the MCU one
-  string queryPIC = "SELECT '_original.._value' FROM '{LOFAR_PIC.status.state,LOFAR_PIC.status.childState}' REMOTE ALL WHERE _DPT = \"StnPIC\" SORT BY 1 DESC";
-
-  // Check all states from LOFAR_ObsSW_Observation*.state in all remote stations.
-  // if one of them changes, and the state is not equal to old state, update the MCU one
-  string queryObservation = "SELECT '_original.._value' FROM '{LOFAR_ObsSW_Observation*.status.state,LOFAR_ObsSW_Observation*.status.childState}' REMOTE ALL WHERE _DPT = \"StnObservation\" SORT BY 1 DESC";
-
-  if (bDebug) DebugN("monitorStateChanges.ctl:distSystemTriggered|isConnected: "+isConnected);
-  if (isConnected) {
-    if (dpQueryDisconnect("stationStateTriggered","PermSW") < 0) {
-      if (bDebug) DebugN("monitorStateChanges.ctl:distSystemTriggered|disconnect PermSW: "+getLastError());
-    }
-    if (dpQueryDisconnect("stationStateTriggered","PIC") < 0) {
-      if (bDebug) DebugN("monitorStateChanges.ctl:distSystemTriggered|disconnect PIC: "+getLastError());
-    }
-    if (dpQueryDisconnect("stationStateTriggered","Observation") < 0) {
-      if (bDebug) DebugN("monitorStateChanges.ctl:distSystemTriggered|disconnect Observation: "+getLastError());
-    }
-  }
-
-  if (dynlen(systemList) > 0 ) {
-    dpQueryConnectSingle("stationStateTriggered",false,"PermSW",queryPermSW);
-    dpQueryConnectSingle("stationStateTriggered",false,"PIC",queryPIC);
-    dpQueryConnectSingle("stationStateTriggered",false,"Observation",queryObservation);
-    isConnected=true;
-  } else {
-    isConnected=false;
-  }    
-}
-
-///////////////////////////////////////////////////////////////////////////
-//Function stationStateTriggered
-// 
-// Callback where a trigger of a changed is handled.
+// subscribes to the __navObjectState DP of the database to monitor 
+// possible stateChanges,
 //
-// Added 02-04-2007 A.Coolen
 ///////////////////////////////////////////////////////////////////////////
-void stationStateTriggered(string ident, dyn_dyn_anytype tab) {
-  if (bDebug) DebugN("monitorStateChanges.ctl:stationStateTriggered|entered");
-
-  string state    = "";
-  string station = "";
-  string armName = "";
-  string datapoint = "";
-  string element = "";
-
-
-  for(int z=2;z<=dynlen(tab);z++){
-    if (bDebug) DebugN("monitorStateChanges.ctl:stationStateTriggered|Found : ",tab[z]);
+void subscribeObjectStateChanges() {
 
-    state = tab[z][2];
-    string dp=tab[z][1];
-    station = dpSubStr(dp,DPSUB_SYS);
-    strreplace(dp,station,"");
-    strreplace(station,":","");
+  if (bDebug){
+     DebugN("monitorStateChanges.ctl:subscribeObjectStateChanges|entered");
+   }
+  // Routine to connnect to the __navObjectStates point to trigger statechanges
 
-    // strip element name and datapoint
-    datapoint = dpSubStr(dp,DPSUB_DP);
+  dpConnect("objectStatesTriggered",false,"__navObjectStates.DPNames",
+            "__navObjectStates.stateNrs",
+            "__navObjectStates.messages",
+            "__navObjectStates.force");
   
-    // skip the point
-    element = substr(dp,strlen(datapoint)+1,((strlen(dp))-(strlen(datapoint)))); 
-
-    // get the RingName
-    armName=navFunct_getRingFromStation(station);
-
-
-    if (bDebug) DebugN("monitorStateChanges.ctl:stationStateTriggered|station : ",station, " DP: " ,datapoint," element: ",element);
-
-    // if all needed values are available we can start doing the major update.
-    if (state >-1 && datapoint != "" && station != "" && armName != "" && element != ""){
-      if (ident == "PIC") {
-	      setStates(datapoint + "_"+ armName + "_" + station,element,state,"",true,true);
-      } else {
-	      setStates(datapoint,element,state,"",true,true);
-      }
-    }
-  }
 }
+ 
 
 ///////////////////////////////////////////////////////////////////////////
 //Function objectStateTriggered
@@ -214,7 +104,28 @@ void objectStateTriggered(string dp1, string trigger,
                           string dp2, int state,
                           string dp3, string message,
                           string dp4, bool force) {
-  // __navObjectState change.
+
+  if (trigger == "") return;
+
+  // To keep it simple entering here we just will put the points into dynamic vars and call the objectStatesTriggered
+  // variant
+  dyn_string dps = makeDynString(trigger);
+  dyn_int states = makeDynInt(state);
+  dyn_string messages = makeDynString(message);
+  dyn_bool forces = makeDynBool(force);
+  
+  dpSet("__navObjectStates.DPNames",dps,
+        "__navObjectStates.stateNrs",states,
+        "__navObjectStates.messages",messages,
+        "__navObjectStates.force",forces);
+}
+
+void objectStatesTriggered(string dp1, dyn_string triggers,
+                           string dp2, dyn_int states,
+                           string dp3, dyn_string messages,
+                           string dp4, dyn_bool forces) {
+
+  // __navObjectStates change.
   // This point should have points like:
   //
   // LOFAR_PIC_Cabinet0_Subrack0_RSPBoard0_RCU0.status.state
@@ -222,280 +133,153 @@ void objectStateTriggered(string dp1, string trigger,
   // a msg indicating extra comments on the state
   // true/false
   //
-  // The force bool will be used to monitor if lowering a state > 10 is allowed.
-  // false means NO, true means force a change.
   //                               
   // This State should be set to childState=bad in all upper (LOFAR-PIC_Cabinet0_Subrack0_RSPBoard0) treenodes
   // ofcourse we need to monitor if this statechange is allowed.
-  // if force false we also monitor the first digit of the state (1-5) if the 1st digit of the current state matches, not
+  // if force false we also monitor the first digit of the state (1-5) if the 1st digit of the current state matches, no
   // state change allowed (to avoid ACK'ed alarms go back to came for example)
+  //                               
+  // The force bool will be used to monitor if lowering a state >= 10 is allowed.
+  // false means NO, true means force a change.
   
+  if (dynlen(triggers) < 1 || triggers[1] == "") return;
 
-
-  if (trigger == "") return;
-
-  if (bDebug) DebugTN("monitorStateChanges.ctl:objectStateTriggered|entered with trigger:", trigger);
-
-  string datapoint = "";
-  string element   = "";
-
+  if (bDebug) DebugTN("monitorStateChanges.ctl:objectStatesTriggered|entered with triggers:", triggers);
   
-  // the datapointname can hold _ and . seperated path elements.  however, after the last point there should be
-  // an element state, or an element childState
-  //
-  // strip the system name
-  datapoint = dpSubStr(trigger,DPSUB_DP_EL);
-
+  dyn_string datapoints;
     
-  int start=strpos(trigger,".status.state");
-  if (start >= 0) {
-  	element = "status.state";
-  } else {
-    start=strpos(trigger,".status.childState");
-    if (start >= 0) {
-   	  element = "status.childState";
-    } else {
-      DebugTN("monitorStateChanges.ctl:objectStateTriggered|ERROR: No state nor childState found in DPName");
-      return;
-    }
-  }
-
-  // strip the last status.state or status.childState from the datapoint name.
-  // the remainder is used as path
-  datapoint = substr(trigger,0,start);
+  for ( int i = 1; i <= dynlen(triggers); i++) {
+    string element   = "";
+  
+    // the datapointname can hold _ and . seperated path elements.  however, after the last point there should be
+    // status.state
+    //
+    // strip the system name
+    string dp = dpSubStr(triggers[i],    DPSUB_DP_EL);
+    
+    if (strlen(dp) > 0) {
 
-  if (bDebug) DebugN("monitorStateChanges.ctl:objectStateTriggered|state:  " + state + " DP: " + datapoint + " Element: " + element + " Message: " + message);
-  // if all needed values are available we can start doing the major update.
-  if (state >= 0 && datapoint != "" && element != "" && dpExists(datapoint+"."+element)){
+      int start=strpos(dp,".status.state");
+      if (start < 0 || strlen(dp) > (start + strlen(".status.state"))) {
+        DebugTN("monitorStateChanges.ctl:objectStatesTriggered|ERROR: No status.state found in DPName, or not last element in name: " + dp);
+        return;
+      }
+    
+      // strip the last status.state from the datapoint name.
+      // the remainder is used as path
+      string bareDP = substr(dp,0,start);
 
-    setStates(datapoint,element,state,message,force,false);
-  } else {
-    DebugTN("monitorStateChanges.ctl:objectStateTriggered|result: Wrong datapoint or state. DP: " + datapoint +"."+element+ " State: "+state );
+      // if all needed values are available we can start doing the major update.
+      if (states[i] >= 0 && bareDP != "" && dpExists(bareDP + ".status.state")){
+        dynAppend(datapoints, bareDP);
+      } else {
+        DebugTN("monitorStateChanges.ctl:objectStatesTriggered|result: Wrong datapoint or state. DP: " + datapoint +"."+element+ " State: "+state );
+      }
+    }
   }
+  setStates(datapoints,states,messages,forces);
 }
 
 
 ///////////////////////////////////////////////////////////////////////////
 //Function setStates
 // 
-// Does the setting of (child)state.
+// Does the setting of the involved states.
 //
-// datapoint      = the base datapoint that needs to be set
-// element        = state or childState needs 2b checked 
-// state          = new state
-// message        = message if applied by __navObjectState
-// force          = boolean indicating if states > 10 are allowed to be lowered or not and check first digit old against new state
-// stationTrigger = check if the stationTrigger fired this. In that case the state/childState
-//                  is a pure copy from the station to the MCU point, so childState should be 
-//                  treated as state and just be copied, not evaluated.
+// datapoints     = the base datapoints that need to be set
+// states         = new states
+// messages       = messages if supplied
+// force          = boolean indicating if states >= 10 are allowed to be lowered or not and check first digit old against new state
 //
 // Added 3-4-2007 A.Coolen
 ///////////////////////////////////////////////////////////////////////////
-void setStates(string datapoint,string element,int state,string message,bool force,bool stationTrigger) {
+void setStates(dyn_string datapoints,dyn_int states,dyn_string messages,dyn_bool force) {
 
-  if (bDebug) DebugN("monitorStateChanges.ctl:setStates|entered with datapoint: "+ datapoint+" element: "+ element+ " state: "+state+" message: "+message+" stationTrigger: "+stationTrigger);
+  if (bDebug) DebugN("monitorStateChanges.ctl:setStates|entered");
 
   string dp;
-  
-  // If element is state just set the state (might have been done by the callerprocess, 
-  // When this is done we have to strip the last treenode, 
-  // and start updating the childStates for the remaining nodes. If the element is childState,
-  // only the childState updates needs 2b done, unless stationTrigger = true, then childstate should be
-  // handled the same way as state.
-  if (element == "status.state" || stationTrigger) {
-    // set the state value of this dp
+  for (int i = 1; i <= dynlen(datapoints); i++) 
+  {
+    // set the state value of the dp's
     
     int aVal;
-    dpGet(datapoint+"."+element,aVal);
-    // if state is BEYOND_REPAIR skip the set
-    if (aVal == BEYOND_REPAIR)
-    {
-      return;
+    dpGet(datapoints[i]+".status.state",aVal);
+ 
+  // We used to have our own alarmsystem with a simulated WENT and CAME.
+  // They were set as 43 and 46 for suspicious and 53 and 56 for broken.
+  // as there are still c++ controllers using that system we will check for them here and change
+  // them to their corresponding alarm numer (40 and 50)
+  // this should be altered in the c++ controllers eventually obviously....
+  
+    if (states[i] == 43 || states[i] == 46) {
+      states[i] = 40;
+    } else if (states[i] == 53 || states[i] == 56) {
+      states[i] = 50;
     }
     
-    if (state > -1 && state != aVal) {
-      if (force) {
-        dpSet(datapoint+"."+element,state);
+    if (states[i] > -1 && states[i] != aVal) {
+      if (force[i]) {
+        dpSet(datapoints[i]+".status.state",states[i]);
       } else {
-        if (bDebug) DebugN("monitorStateChanges.ctl:setStates|original val: "+aVal+ " state to set to: " + state);
-        if (aVal <=10 && state <= 0) {
-          dpSet(datapoint+"."+element,state);
-        } else if (aVal <= state && floor(aVal/10)!=floor(state/10) ){
-          dpSet(datapoint+"."+element,state);
+        if (bDebug) DebugN("monitorStateChanges.ctl:setStates|original val: "+aVal+ " state to set to: " + states[i]);
+        if (aVal <=10 && states[i] == 0) {
+          dpSet(datapoints[i]+".status.state",states[i]);
+        } else if (aVal <= states[i] && floor(aVal/10)!=floor(states[i]/10) ){
+          dpSet(datapoints[i]+".status.state",states[i]);
         } else {
           if (bDebug) DebugN("monitorStateChanges.ctl:setStates|State not changed because of force conditions");
           return;
         }
       }
-      dpSet(datapoint+".status.message",message);
+      dpSet(datapoints[i]+".status.message",messages[i]);
       
-
-  
-      if (bDebug) DebugN( "monitorStateChanges.ctl:setStates|Continueing with setChildState passing path: "+datapoint);
-  
-      //  Since the antenna's are placed outside the regular path (LOFAR_PIC_HBA* and _LBA*)
-      // but in reality are connected to the RCU, we need to change the datapoint here to trigger the rcu's
-      if (strpos(datapoint,"_HBA") >= 0 || strpos(datapoint,"_LBA") >= 0 ) {
-    
-   
-        if (bDebug) DebugN("monitorStateChanges.ctl:setStates|Containing HBA or LBA: "+datapoint);
-    
-        if (bDebug) DebugN("monitorStateChanges.ctl:setStates|Containing pure: " + dpSubStr(datapoint,DPSUB_SYS_DP));
-
-        //Only take pure Antenna so skip HBA00.Element01 points)
-//        if (dpSubStr(datapoint,DPSUB_SYS_DP) == datapoint)  {
-
-          if (bDebug) DebugN("monitorStateChanges.ctl:setStates|pure antenna point");
-
-          // get the rcuX and rcuY points
-          string rcuXDP,XDP;
-          string rcuYDP,YDP;
-          dpGet(dpSubStr(datapoint,DPSUB_SYS_DP)+".common.RCUX",XDP);
-          dpGet(dpSubStr(datapoint,DPSUB_SYS_DP)+".common.RCUY",YDP);
-      
-
-  
-          rcuXDP = dpSubStr(XDP,DPSUB_DP);
-          rcuYDP = dpSubStr(YDP,DPSUB_DP);
-          if (bDebug) DebugN("monitorStateChanges.ctl:setStates|datapoint to set for X: "+rcuXDP);
-          if (bDebug) DebugN("monitorStateChanges.ctl:setStates|datapoint to set for Y: "+rcuYDP);
-
-          // since we have two possible attachments (X and Y to different RCU)
-          // set childState if needed, if succeeded set childState for one level less also
-          // continue while true
-      
-          dpSet(rcuXDP+".status.childState",state);
-          dp = navFunct_getPathLessOne(rcuXDP);
-          rcuXDP = dp;        
-
-          dpSet(rcuYDP+".status.childState",state);
-          dp = navFunct_getPathLessOne(rcuYDP);
-          rcuYDP = dp;        
-
-      
-
-          while ( setChildState(rcuXDP,state)) {
-            if (bDebug) DebugN( "monitorStateChanges.ctl:setStates|Continueing with setChildState passing path: "+rcuXDP);
-            dp = navFunct_getPathLessOne(rcuXDP);
-            rcuXDP=dp;
-          }
-  //      }  
-      }
-
+      // Call function to add message to alertcomment (call as thread to avoid eventload during callback
+      startThread( "SetAlertComment", datapoints[i]+".status.state", messages[i] );
+       
     } else {
       if (bDebug) DebugN("monitorStateChanges.ctl:setStates|Equal value or state < 0, no need to set new state");
-    }
-    
-    // But we still need to trigger a new childState update
-    dp = navFunct_getPathLessOne(datapoint);
-    datapoint=dp;
-
-  } else if (element != "status.childState") {
-    DebugN("monitorStateChanges.ctl:setStates|Error. unknown element in stateChange trigger: ", element);
-    return;
-  }
-  
-  // set childState if needed, if succeeded set childState for one level less also
-  // continue while true
-  while ( setChildState(datapoint,state)) {
-    if (bDebug) DebugN( "monitorStateChanges.ctl:setStates|Continueing with setChildState passing path: "+datapoint);
-    dp = navFunct_getPathLessOne(datapoint);
-    datapoint=dp;
+    }   
   }
 }
 
 
-///////////////////////////////////////////////////////////////////////////
-//Function setChildState
-// 
-// Does the setting of childstate based upon the highest state found in all 
-// the direct children of a given datepoint, merged with the given state
-//
-// Added 26-3-2007 A.Coolen
-///////////////////////////////////////////////////////////////////////////
-bool setChildState(string Dp,int state) {
 
-  if (bDebug) DebugN("monitorStateChanges.ctl:setChildState| entered with DP: "+Dp+" stateVal: "+ state);
 
-  if (state < 0 || Dp == "") return false;
-
-  dyn_dyn_anytype tab;
-  int z;
-  int aVal;
-
-  // take present value for comparing later.
-  dpGet(Dp+".status.childState",aVal);
-
-  // if state is BEYOND_REPAIR skip the set
-  if (aVal == BEYOND_REPAIR)
-  {
+// This function is started as thread to avoide datapoint handling in a callback, we
+void SetAlertComment( string dpe, string message, int delaymsec = 10 )
+{
+  string strQuery;
+  string strAlertComment;
+  dyn_dyn_anytype ddaAlerts;
+  atime atLastAlert;
+  
+  delay(0,delaymsec);
+  
+  // Get alerts of given dpe
+  strQuery = "SELECT ALERT '_alert_hdl.._prior' FROM '" + dpSubStr( dpe, DPSUB_DP_EL ) + "'";
+  dpQuery( strQuery, ddaAlerts );
+  
+  if( dynlen(ddaAlerts) < 2 )
     return;
-  }
-
-  if (bDebug) DebugN("monitorStateChanges.ctl:setChildState|"+Dp+".status.childState = "+aVal);
-
-
-  // Query for all state and childState in the tree from this datapoint down.
-  // Only the first level will be examined.
-  // By sorting descending we can shorten the time needed for evaluation. If the top element's state value = lower or equal
-  // to the value we need to set, we can leave the loop and set the new state value. In case it is bigger we can take that value
-  // and set it as the new value (if > the original value)
-
-
-  string query = "SELECT '_original.._value' FROM '{"+Dp+"_*.status.childState,"+Dp+"_*.status.state,"+Dp+".*.status.childState,"+Dp+".*.status.state}' SORT BY 1 DESC";
-  if (bDebug) DebugN("monitorStateChanges.ctl:setChildState|Query: ",query);
-  int err = dpQuery(query, tab);
-
-
-   
-  if (err < 0) {
-    if (bDebug) DebugN("monitorStateChanges.ctl:setChildState|Error " + err + " while getting query.");
-    return false;
-  }
-
-  if (bDebug) DebugN("monitorStateChanges.ctl:setChildState|Found hits:  " + tab);
- 
-  dyn_string aS1=strsplit(Dp,"_");
-  int maxElements= dynlen(aS1)+1; 
-  int foundElements=0;
-
-  // first check if the last element still has . seperated elements
-  dyn_string aS2=strsplit(aS1[dynlen(aS1)],".");
-  if (dynlen(aS2) > 1) {
-    maxElements+=dynlen(aS2)-1; 
-  }
-
-  for(z=2;z<=dynlen(tab);z++) {
-    dyn_string aStr1=strsplit((string)tab[z][1],"_");
-    foundElements=dynlen(aStr1);
-
-    if (bDebug) DebugN("monitorStateChanges.ctl:setChildState|Working with dp: " +(string)tab[z][1]);
-
-    // first check if the last element still has . seperated elements but skip the status.state status.childState
-    dyn_string aStr2=strsplit(aStr1[dynlen(aStr1)],".");
-    if (dynlen(aStr2) > 3) {
-      foundElements+=dynlen(aStr2)-3; 
-    }
-    
-    if(foundElements <= maxElements) {
-      if (bDebug) DebugN("monitorStateChanges.ctl:setChildState|Have to check DP: ",tab[z][1], " state: ", tab[z][2]);
+  
+  // Remove header
+  dynRemove( ddaAlerts, 1 );
+  
+  // Sort alerts on time, descending to get the latest one
+  dynDynSort( ddaAlerts, 2,false );
 
-      // check if found state > new state
-      if ((int)tab[z][2] > state) {
-        state=(int)tab[z][2];
-      }
-      // check if state != oldVal
-      if (state != aVal && state > -1 ) {
-        if (bDebug) DebugN("monitorStateChanges.ctl:setChildState|state not equal oldstate(",aVal,") so set ",Dp+".status.childState to: ",state);
-        
-        
-        dpSet(Dp+".status.childState",state);
-        return true;
-      }
-      return false;
-    }
-  }
+  if (bDebug) DebugN( "monitorStateChanges.ctl:SetAlertComment|entered with datapoint-element: "+ dpe +" message: "+message+" delaymsec: "+delaymsec);
+  
+  // Takeover latest alert time
+  atLastAlert = ddaAlerts[1][2];
+  
+  // First get current alarm comment
+  alertGet( (time)atLastAlert, getACount(atLastAlert), dpSubStr( getAIdentifier(atLastAlert), DPSUB_SYS_DP_EL_CONF_DET ) + "._comment", strAlertComment );
+  
+  // Add given comment
+  strAlertComment += message + "\uA7";
+  
+  // Store new comment
+  alertSet( (time)atLastAlert, getACount(atLastAlert), dpSubStr( getAIdentifier(atLastAlert), DPSUB_SYS_DP_EL_CONF_DET ) + "._comment", strAlertComment );   
 
-  return false;
 }
-
diff --git a/MAC/Navigator2/scripts/monitorStationAlarms.ctl b/MAC/Navigator2/scripts/monitorStationAlarms.ctl
index 0e7febd50d48c8bc512cc9a9b5653f59c978ce66..a8f679048d6db167233b8ca88ba29c4226868f51 100644
--- a/MAC/Navigator2/scripts/monitorStationAlarms.ctl
+++ b/MAC/Navigator2/scripts/monitorStationAlarms.ctl
@@ -21,7 +21,6 @@
 //#  $Id$
 
 #uses "GCFCommon.ctl"
-#uses "GCFAlarm.ctl"
 #uses "navFunct.ctl"
 
 
@@ -140,8 +139,8 @@ void alarmCallback(string dp1, string DPName,
   }
     
   
-  // above 56 the states are not monitorred for now
-  if (state >= 57) {
+  // DPOFFLINE and BEYOND_REPAIR are not monitorred for now
+  if (state >= BEYOND_REPAIR) {
     occupied = false;
     return;
   }
diff --git a/MAC/Navigator2/scripts/setSumAlerts.ctl b/MAC/Navigator2/scripts/setSumAlerts.ctl
index 844e90f4441e7872278adcf7259fae5bfb1212c3..028fd915de78fc22753cc8a6d17f4ee914d11056 100644
--- a/MAC/Navigator2/scripts/setSumAlerts.ctl
+++ b/MAC/Navigator2/scripts/setSumAlerts.ctl
@@ -1,3 +1,4 @@
+#uses "GCFCommon.ctl"
 
 
 
@@ -5,6 +6,8 @@ bool bDebug;
 
 void main()
 {
+  
+  
   // connect to debugflag to be able to switch debug on/off during run
   if (dpExists("scriptInfo.setSumAlerts.debug")) {
     dpConnect("debugCB",true,"scriptInfo.setSumAlerts.debug");
@@ -33,8 +36,8 @@ private void debugCB(string dp1, bool debug)
 private void setSumAlerts( string strDPE, bool bRunDone )
 {
   int x, y;
-  string strDPE;
-  dyn_string dsParentDPEs, dsChilds, dsChildDPEs;
+  string strDPE, strParentDP;
+  dyn_string dsParentDPEs, dsChilds, dsChildDPEs, dsParentRelations;
 
   // If we're already done: do nothing  
   if( bRunDone )
@@ -55,6 +58,8 @@ private void setSumAlerts( string strDPE, bool bRunDone )
     string strDPE;
     dyn_string dsChilds, dsChildDPEs;
     
+    strParentDP = dpSubStr( dsParentDPEs[x], DPSUB_DP );
+    
     // Use DPE part, and remove last parts (normally '.state.childSumAlert')
     strDPE = dpSubStr( dsParentDPEs[x], DPSUB_DP_EL );
     strDPE = RemoveLastDpeParts(strDPE);
@@ -64,7 +69,7 @@ private void setSumAlerts( string strDPE, bool bRunDone )
     {
       continue;
     }
-    
+      
     if( strDPE == "" )
     {
       continue;
@@ -85,6 +90,12 @@ private void setSumAlerts( string strDPE, bool bRunDone )
     // Get childs of this DPE
     dsChilds = GetChilds( strDPE );
     
+    // Get objects with a relation to this parent
+    if( dpTypeName( strParentDP ) == "RCU" )
+    {
+      dsParentRelations = GetRelationsToParent( strParentDP );
+      dynAppend( dsChilds, dsParentRelations );
+    }
     
     // For each child: get DPE's to add to sumalerts and append to list
     for( y=1; y<=dynlen(dsChilds); y++ )
@@ -98,45 +109,48 @@ private void setSumAlerts( string strDPE, bool bRunDone )
     
     if( iAlertHdlType == DPCONFIG_SUM_ALERT)
     {
-      if (dynlen(dsChildDPEs) > 0)
+      // If list is empty: use dummybit
+      if( dynlen(dsChildDPEs) <= 0 )
+      {
+        DebugTN( "setSumAlerts(): empty dsChildDPEs list for DPE '" + dsParentDPEs[x] + "', 'DummyBit' will be used !!" );
+        dsChildDPEs = makeDynString( "DummyBit." );
+      }
+
+      // First deactivate the alert
+      dpDeactivateAlert( dsParentDPEs[x], bRetVal1 );
+      if( !bRetVal1 )
+      {
+        DebugTN( "setSumAlerts(): FAILED TO dpDeactivateAlert FOR DPE '" + dsParentDPEs[x] + "'!!" );
+      }
+        
+
+      // Now change the sumalert dplist
+      iRetVal = dpSet( dsParentDPEs[x] + ":_alert_hdl.._dp_list",    dsChildDPEs,
+                        dsParentDPEs[x] + ":_alert_hdl.._dp_pattern", "" );
+
+      dyn_errClass derrLastError = getLastError();
+      if( dynlen(derrLastError) > 0 )
       {
-        // First deactivate the alert
-        dpDeactivateAlert( dsParentDPEs[x], bRetVal1 );
-        if( !bRetVal1 )
-        {
-  	  DebugTN( "setSumAlerts(): FAILED TO dpDeactivateAlert FOR DPE '" + dsParentDPEs[x] + "'!!" );
-        }
-
-        // No change the sumalert dplist
-        iRetVal = dpSet( dsParentDPEs[x] + ":_alert_hdl.._dp_list",    dsChildDPEs,
-	  	         dsParentDPEs[x] + ":_alert_hdl.._dp_pattern", "" );
-
-        dyn_errClass derrLastError = getLastError();
-        if( dynlen(derrLastError) > 0 )
-        {
-  	  DebugTN( "setSumAlerts(): FAILED TO dpSet FOR DPE, getLastError():", derrLastError );
-        }
-        else if( iRetVal != 0 )
-        {
-	  DebugTN( "setSumAlerts(): FAILED TO dpSet FOR DPE, iRetVal = " + iRetVal );
-        }
-
-        // Activate alert again
-        dpActivateAlert( dsParentDPEs[x], bRetVal2 );
-        if( !bRetVal2 )
-        {
-	  DebugTN( "setSumAlerts(): FAILED TO dpActivateAlert FOR DPE '" + dsParentDPEs[x] + "'!!" );
-        }
-
-        // Show if we're succesfull
-        if( bRetVal1 && bRetVal2 && ( iRetVal == 0 ) )
-        {
-	  if( bDebug )
-	  {
-	    DebugTN( "setSumAlerts(): SumAlerts for DPE '" + dsParentDPEs[x] + "' succesfully set to " + dynlen(dsChildDPEs) + " child DPEs" );
-	  }
-        }
+        DebugTN( "setSumAlerts(): FAILED TO dpSet FOR DPE, getLastError():", derrLastError );
       }
+      else if( iRetVal != 0 )
+      {
+        DebugTN( "setSumAlerts(): FAILED TO dpSet FOR DPE, iRetVal = " + iRetVal );
+      }
+  
+      // Activate alert again
+      dpActivateAlert( dsParentDPEs[x], bRetVal2 );
+      if( !bRetVal2 )
+      {
+        DebugTN( "setSumAlerts(): FAILED TO dpActivateAlert FOR DPE '" + dsParentDPEs[x] + "'!!" );
+      }
+
+      // Show if we're succesfull
+      if( bRetVal1 && bRetVal2 && ( iRetVal == 0 ) && bDebug )
+      {
+        DebugTN( "setSumAlerts(): SumAlerts for DPE '" + dsParentDPEs[x] + "' succesfully set to " + dynlen(dsChildDPEs) + " child DPEs" );
+      }
+        
     }
     else
     {
@@ -148,6 +162,12 @@ private void setSumAlerts( string strDPE, bool bRunDone )
     
   }
   
+  // If this system is the MCU: call function for MCU alerts
+  if( getSystemName() == MainDBName )
+  {
+    setSumAlerts_MCU();
+  }
+  
   dpSet( "scriptInfo.setSumAlerts.runDone", true );
   DebugTN("setSumAlerts.ctl:main|set of sumAlerts done");     
   
@@ -156,11 +176,118 @@ private void setSumAlerts( string strDPE, bool bRunDone )
 
 
 
+void setSumAlerts_MCU()
+{
+  int x, y;
+  string strDPE, strParentDP;
+  dyn_string dsParentDPEs, dsChilds, dsChildDPEs, dsParentRelations;
+
+  
+  DebugTN("setSumAlerts_MCU.ctl:main|start set of sumAlerts");     
+    
+  // Get all DPE's with a 'childSumAlert'
+  dsParentDPEs = dpNames( "*.status.childSumAlert", "Station" );
+
+  dynSort(dsParentDPEs);
+  
+  // Go through sumalerts
+  for( x=1; x<=dynlen(dsParentDPEs); x++ )
+  {
+    bool bRetVal1, bRetVal2;
+    int iRetVal, iAlertHdlType;
+    string strDPE;
+    dyn_string dsChildDPEs;
+    
+    strParentDP = dpSubStr( dsParentDPEs[x], DPSUB_DP );
+    strDPE = dpSubStr( dsParentDPEs[x], DPSUB_DP_EL );
+    
+    
+    // Skip master datapoints 
+    if( patternMatch( "*_mp*", strDPE ))
+    {
+      continue;
+    }
+    
+    if( strDPE == "" )
+    {
+      continue;
+    }
+
+
+    if (bDebug) 
+    {
+      DebugTN( __FUNCTION__ + "(), working on: " + strDPE );
+    }
+
+    // Define DPE for childsumalert: this is the determined dist_childsumalert
+    dynClear( dsChildDPEs );
+    dsChildDPEs[1] = strParentDP + ".dist_childSumAlert";
+
+    
+    // Check if this DPE has an alert_hdl of type sumalert
+    dpGet( dsParentDPEs[x] + ":_alert_hdl.._type", iAlertHdlType );
+    
+    if( iAlertHdlType == DPCONFIG_SUM_ALERT)
+    {
+      // First deactivate the alert
+      dpDeactivateAlert( dsParentDPEs[x], bRetVal1 );
+      if( !bRetVal1 )
+      {
+        DebugTN( "setSumAlerts(): FAILED TO dpDeactivateAlert FOR DPE '" + dsParentDPEs[x] + "'!!" );
+      }
+        
+      // If list is empty: use dummybit
+      if( dynlen(dsChildDPEs) <= 0 )
+      {
+         DebugTN( "setSumAlerts(): empty dsChildDPEs list for DPE '" + dsParentDPEs[x] + "', 'DummyBit' will be used !!" );
+        dsChildDPEs = makeDynString( "DummyBit." );
+      }
+
+      // Now change the sumalert dplist
+      iRetVal = dpSet( dsParentDPEs[x] + ":_alert_hdl.._dp_list",    dsChildDPEs,
+                        dsParentDPEs[x] + ":_alert_hdl.._dp_pattern", "" );
+
+      dyn_errClass derrLastError = getLastError();
+      if( dynlen(derrLastError) > 0 )
+      {
+        DebugTN( "setSumAlerts(): FAILED TO dpSet FOR DPE, getLastError():", derrLastError );
+      }
+      else if( iRetVal != 0 )
+      {
+        DebugTN( "setSumAlerts(): FAILED TO dpSet FOR DPE, iRetVal = " + iRetVal );
+      }
+
+      // Activate alert again
+      dpActivateAlert( dsParentDPEs[x], bRetVal2 );
+      if( !bRetVal2 )
+      {
+        DebugTN( "setSumAlerts(): FAILED TO dpActivateAlert FOR DPE '" + dsParentDPEs[x] + "'!!" );
+      }
+
+      // Show if we're succesfull
+      if( bRetVal1 && bRetVal2 && ( iRetVal == 0 ) && bDebug )
+      {
+         DebugTN( "setSumAlerts(): SumAlerts for DPE '" + dsParentDPEs[x] + "' succesfully set to " + dynlen(dsChildDPEs) + " child DPEs" );
+      }
+        
+    }
+    else
+    {
+      DebugTN( "setSumAlerts(): DPE '" + dsParentDPEs[x] + "' DOESN'T HAVE AN ALERT-HANDLE OR NOT OF TYPE SUM-ALERT!!" );
+    }
+    
+    // Small delay to give some time and limit number of events
+    delay(0,10);
+    
+  }
+  
+}
+
 
 private dyn_string GetChilds( string strDPE )
 {
   int x, iLevel;
-  string strDP, strParent, strChildDPE;
+  string strDP, strParent, strChildDP, strChildDPE;
   dyn_string dsDPEs, dsChilds;
 
   strParent = strDPE;
@@ -183,8 +310,10 @@ private dyn_string GetChilds( string strDPE )
     dynAppend( dsDPEs, dpNames( strDPE + ".**.childSumAlert" ) );
   }
     
+  
   for( x=dynlen(dsDPEs); x>=1; x-- )
   {
+    strChildDP  = dpSubStr( dsDPEs[x], DPSUB_DP );
     strChildDPE = dpSubStr( dsDPEs[x], DPSUB_DP_EL );
     strChildDPE = RemoveLastDpeParts(strChildDPE);
 
@@ -218,6 +347,12 @@ private dyn_string GetChilds( string strDPE )
       continue;
     }
     
+    // The antenna's should not be recognized as children based on name (they have their own reference to RCUx/y)
+    if( ( dpTypeName(strChildDP) == "HBAAntenna" ) ||
+        ( dpTypeName(strChildDP) == "LBAAntenna" ) )
+    {
+      continue;
+    }
     
     dynAppend( dsChilds, strChildDPE );
     
@@ -308,3 +443,34 @@ private int GetDpeLevel( string strDPE )
 
 
 
+private dyn_string GetRelationsToParent( string strParentDP )
+{
+  int x;
+  string strQuery, strDP;
+  dyn_dyn_anytype ddaData;
+  dyn_string dsParentRelations;
+  
+  
+  strQuery = "SELECT '_original.._value' FROM '{*.common.RCUX,*.common.RCUY}' WHERE '_original.._value' LIKE \"" + strParentDP + ".*\" OR '_original.._value'  LIKE \"" + strParentDP + "\"";
+  
+  dpQuery( strQuery, ddaData );
+   
+//  if( dynlen(ddaData) >= 2 )
+//    DebugTN( __FUNCTION__ + "(): strParentDP = " + strParentDP, ddaData );
+  
+  for( x=2; x<=dynlen(ddaData); x++ )
+  {
+    // Determine DP-name and add to dyn_string with relations to given parent-DP
+    strDP = dpSubStr( ddaData[x][1], DPSUB_DP );
+    dynAppend( dsParentRelations, strDP );
+  }
+  
+  dynUnique( dsParentRelations );
+
+  if( bDebug && ( dynlen(dsParentRelations) > 0 ) )
+  {
+    DebugTN( __FUNCTION__ + "(): strParentDP = '" + strParentDP + "' related DPs: " + dynStringToString( dsParentRelations, "," )  );
+  }
+  
+  return dsParentRelations;
+}
diff --git a/MAC/Services/src/PipelineControl.py b/MAC/Services/src/PipelineControl.py
index 19edb2ca30d6eb249446850825f7bc211e2e222d..d813599b006230a1e7a6462a6ecadb804043b7ed 100755
--- a/MAC/Services/src/PipelineControl.py
+++ b/MAC/Services/src/PipelineControl.py
@@ -72,6 +72,7 @@ from lofar.sas.otdb.OTDBBusListener import OTDBBusListener
 from lofar.sas.otdb.config import DEFAULT_OTDB_NOTIFICATION_BUSNAME, DEFAULT_OTDB_SERVICE_BUSNAME
 from lofar.sas.otdb.otdbrpc import OTDBRPC
 from lofar.common.util import waitForInterrupt
+from lofar.common import isProductionEnvironment
 from lofar.messaging.RPC import RPCTimeoutException, RPCException
 from lofar.sas.resourceassignment.resourceassignmentservice.rpc import RARPC
 from lofar.sas.resourceassignment.resourceassignmentservice.config import DEFAULT_BUSNAME as DEFAULT_RAS_SERVICE_BUSNAME
@@ -86,6 +87,14 @@ from socket import getfqdn
 import logging
 logger = logging.getLogger(__name__)
 
+# NDPPP seems to like to have 2 cores.
+DEFAULT_NUMBER_OF_CORES_PER_TASK = 2
+# This needs to match what's in SLURM
+NUMBER_OF_NODES = 40
+NUMBER_OF_CORES_PER_NODE = 24
+# We /4 because we can then run 4 pipelines, and -2 to reserve cores for TBBwriter
+DEFAULT_NUMBER_OF_TASKS = (NUMBER_OF_NODES / 4) * (NUMBER_OF_CORES_PER_NODE - 2) / DEFAULT_NUMBER_OF_CORES_PER_TASK
+
 def runCommand(cmdline, input=None):
   logger.info("runCommand starting: %s", cmdline)
 
@@ -144,26 +153,23 @@ class Parset(dict):
     return result
 
   def processingNumberOfCoresPerTask(self):
-    result = int(self[PARSET_PREFIX + "Observation.Cluster.ProcessingCluster.numberOfCoresPerTask"]) or "21"
-    if result != 2:
-        logger.warn('Invalid Observation.Cluster.ProcessingCluster.numberOfCoresPerTask: %s, defaulting to %s', result, 21)
-    return 2
+    result = int(self[PARSET_PREFIX + "Observation.Cluster.ProcessingCluster.numberOfCoresPerTask"]) or None
+    if not result:
+        logger.warn('Invalid Observation.Cluster.ProcessingCluster.numberOfCoresPerTask: %s, defaulting to %i',
+                    result, DEFAULT_NUMBER_OF_CORES_PER_TASK)
+        result = DEFAULT_NUMBER_OF_CORES_PER_TASK
+    return result
 
   def processingNumberOfTasks(self):
-    """ Parse the number of nodes to allocate from "Observation.Cluster.ProcessingCluster.numberOfTasks",
-        which can have either the format "{number}" or "{min}-{max}". """
-
-    defaultValue = 244
-    parsetValue = self[PARSET_PREFIX + "Observation.Cluster.ProcessingCluster.numberOfTasks"].strip()
+    """ Parse the number of nodes to allocate from "Observation.Cluster.ProcessingCluster.numberOfTasks" """
 
-    result = int(parsetValue) * 10 # ScS expects to schedule 10 jobs/node, and still specifies #nodes
+    result = int(self[PARSET_PREFIX + "Observation.Cluster.ProcessingCluster.numberOfTasks"].strip()) or None
 
     # apply bound
-    if result <= 0 or result > 50*24:
-      result = defaultValue
-
-    if result != parsetValue:
-      logger.warn('Invalid Observation.Cluster.ProcessingCluster.numberOfTasks: %s, defaulting to %s', parsetValue, result)
+    if not result or result <= 0 or result > NUMBER_OF_NODES * NUMBER_OF_CORES_PER_NODE:
+      logger.warn('Invalid Observation.Cluster.ProcessingCluster.numberOfTasks: %s, defaulting to %s',
+                  result, DEFAULT_NUMBER_OF_TASKS)
+      result = DEFAULT_NUMBER_OF_TASKS
 
     return result
 
@@ -173,18 +179,24 @@ class Parset(dict):
 
   @staticmethod
   def defaultDockerImage():
-    return "lofar-pipeline:latest"
+    return "lofar-pipeline"
 
   @staticmethod
   def defaultDockerTag():
-    return "latest"
+    if isProductionEnvironment():
+        # "latest" refers to the current /production/ image
+        return "latest"
+    else:
+        # test/dev environments want to use their specific version, since they
+        # share images with the production environment
+        return runCommand("docker-template", "${LOFAR_TAG}")
 
   def dockerImage(self):
     # Return the version set in the parset, and fall back to our own version.
     image = self[PARSET_PREFIX + "Observation.ObservationControl.PythonControl.softwareVersion"]
 
     if not image:
-       return self.defaultDockerImage()
+       image = self.defaultDockerImage()
 
     if ":" in image:
        return image
diff --git a/MAC/Services/test/tPipelineControl.py b/MAC/Services/test/tPipelineControl.py
index a421145cab838c772a302b407cc47a65e77ed68d..56cd69a8185703a347d2958b1c87ab340b10c7ac 100644
--- a/MAC/Services/test/tPipelineControl.py
+++ b/MAC/Services/test/tPipelineControl.py
@@ -157,8 +157,8 @@ class MockOTDBService(MessageHandlerInterface):
             PARSET_PREFIX + "Observation.processType":                           ("Observation" if OtdbID == 4 else "Pipeline"),
             PARSET_PREFIX + "Observation.Cluster.ProcessingCluster.clusterName":          "CEP4",
             PARSET_PREFIX + "Observation.Cluster.ProcessingCluster.clusterPartition":     "cpu",
-            PARSET_PREFIX + "Observation.Cluster.ProcessingCluster.numberOfCoresPerTask": "20",
-            PARSET_PREFIX + "Observation.Cluster.ProcessingCluster.numberOfTasks":        "24",
+            PARSET_PREFIX + "Observation.Cluster.ProcessingCluster.numberOfCoresPerTask": "2",
+            PARSET_PREFIX + "Observation.Cluster.ProcessingCluster.numberOfTasks":        "110",
         } }
 
     def TaskSetStatus(self, OtdbID, NewStatus, UpdateTimestamps):
diff --git a/MAC/Tools/Rubidium/rubidium_logger.py b/MAC/Tools/Rubidium/rubidium_logger.py
deleted file mode 100755
index 1fec802e0e4a5ce5a2c11d8c4b1db7eddfc2f293..0000000000000000000000000000000000000000
--- a/MAC/Tools/Rubidium/rubidium_logger.py
+++ /dev/null
@@ -1,450 +0,0 @@
-#!/usr/bin/python
-
-import subprocess
-from subprocess import Popen, PIPE
-import sys
-import time
-from time import sleep
-import termios
-import resource
-import os
-import datetime
-import glob
-import logging
-import logging.handlers
-
-
-try:
-    import codecs
-except ImportError:
-    codecs = None
-
-ttMeanSpec  =   100 # +/- 100ns limit
-ttMeanSs    =   100 # sample count of which mean should be lower then ttMeanSpec
-ttLogLength = 86400 # Maximum number of history, 24 hours
-                    # Lost lock is always resulting in wrong
-
-logFp = None
-ttHistList = []
-ttMeanList = []
-loHistList = []
-lastOKay = False
-noPPS = False
-st5 = -1
-
-workingSettings = [1280, 5, 3261, 35387, 13, 13, ['\x03', '\x1c', '\x7f', '\x15', '\x04', '\x00', '\x01', '\x00', '\x11', '\x13', '\x1a', '\x00', '\x12', '\x0f', '\x17', '\x16', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00']]
-
-rub_logger = None
-msgBuffer = []
-statusFile = ""
-
-cmdList = ['ST?', 'TT?']
-advCmdList = ['AD0?', 'AD1?', 'AD2?', 'AD3?', 'AD4?', 'AD5?', 'AD6?', 'AD7?', 'AD8?', 'AD9?', 'AD10?', 'AD11?', 'AD12?', 'AD13?', 'AD14?', 'AD15?', 'AD16?', 'AD17?', 'AD18?','SD0?', 'SD1?', 'SD2?', 'SD3?', 'SD4?', 'SD5?', 'SD6?', 'SD7?','SP?','SF?','SS?','MO?','MR?','MS?','LO?','GA?','PH?','EP?','FC?','DS?', 'TO?','TS?','PS?','PL?','PT?','PF?','PI?','LM?']
-
-
-
-def checkSettings(fp):
-    curSet = termios.tcgetattr(fp)
-    if curSet != workingSettings:
-        cmd = 'stty < /dev/ttyS0'
-        cf = Popen(cmd, shell = True, stdout = PIPE, stderr = PIPE)
-        (result, resultErr) = cf.communicate()
-        print result, resultErr
-    else:
-        return True
-
-
-def callCommand(cmd):
-
-    cmd1 = "/opt/lofar/sbin/tci "
-    cmd1 += cmd
-    result = None
-    cf = Popen(cmd1, shell = True, stdout = PIPE, stderr = PIPE)
-        
-    (res,resErr) = cf.communicate()
-    if cf.returncode != -1 and len(res)>0:
-        result = res
-    else:
-        result = "Fail"
-    return result
-
-
-
-# How to become a daemon
-# ----------------------
-# See Advanced Programming in the UNIX Environment by Stevens and Rago, section 13.3, pp. 425/426.
-# See also the UNIX Programming FAW (http://www.erlenstar.demon.co.uk/unix/faq_2.html#SEC16)
-#
-# 1. call umask(0) to clear the file mode creation mask. the umask is inherited and may be set to
-#    deny certain permissions.
-# 2. fork() and let the parent exit. this returns control to the shell. also, the child inherits
-#    the parent's process group id, but gets its own process id. by definition, it is therefore
-#    not a process group leader. this is a prerequisite for calling setsid(), which is the next
-#    step.
-# 3. call setsid() to create a new session. the process becomes leader of a new sessions, process
-#    group leader of a new process group and has no controlling terminal.
-# 4. fork() again to ensure the process is not a session leader. (System V systems may allocate a
-#    controlling terminal for session leaders under certain conditions).
-# 5. chdir("/") to ensure that the daemon does not tie up any mounted file systems.
-# 6. close all open file descriptors we may have inherited from our parent.
-# 7. re-open stdin, stdout, and stderr; for instance, point stdout and stderr to a log file, or
-#    simply redirect to /dev/null.
-#
-def daemonize(logfile):
-    try:
-        no_file = resource.getrlimit(resource.RLIMIT_NOFILE)
-    except ValueError, ex:
-        print "error: unable to determine NOFILE resource limit; daemon not started (%s)" % ex
-        sys.exit(EXIT_ERROR)
-
-    # 1. clear umask
-    try:
-        os.umask(0)
-    except OSError, ex:
-        print "error: unable to set umask; daemon not started %s" % ex
-        sys.exit(EXIT_ERROR)
-
-    # 2. fork and let parent exit
-    try:
-        pid = os.fork()
-    except OSError, ex:
-        print "error: unable to fork; daemon not started (%s)" % ex
-        sys.exit(EXIT_ERROR)
-
-    if pid != 0:
-        # parent exits
-        # NOTE: Steven and Rago specify a standard exit(0) here, while the UNIX Programming FAQ
-        # recommends _exit(0) (see http://www.erlenstar.demon.co.uk/unix/faq_2.html#SEC6). We favour
-        # the latter approach, because it seems correct to only do user-mode clean-up once.
-        os._exit(0)
-
-    #
-    #    FIRST CHILD PROCESS
-    #
-
-    # 3. create a new session
-    try:
-        sid = os.setsid()
-    except OSError, ex:
-        print "error: unable to create a new session; daemon not started (%s)" % ex
-        sys.exit(EXIT_ERROR)
-
-    # 4. second fork
-    try:
-        pid = os.fork()
-    except OSError, ex:
-        print "error: unable to fork; daemon not started (%s)" % ex
-        sys.exit(EXIT_ERROR)
-
-    if pid != 0:
-        # parent exits
-        # NOTE: Steven and Rago specify a standard exit(0) here, while the UNIX Programming FAQ
-        # recommends _exit(0) (see http://www.erlenstar.demon.co.uk/unix/faq_2.html#SEC6). We favour
-        # the latter approach, because it seems correct to only do user-mode clean-up once.
-        os._exit(0)
-
-    #
-    #    SECOND CHILD PROCESS
-    #
-
-    try:
-        # 5. change the working directory
-        os.chdir("/")
-
-        # 6. closing stdout; from this moment on, any errors will be sent to the syslog.
-        # 6a. flush stdout and stderr
-        sys.stdout.flush()
-        sys.stderr.flush()
-
-        # 6b. close all open file descriptors (uses soft NO_FILE limit)
-        for fd in range(0, max(no_file[0], 1024)):
-            try:
-                os.close(fd)
-            except OSError:
-                pass
-
-        # 7. re-open stdin, stdout, and stderr as /dev/null
-        # for python >= 2.4 use os.devnull
-        sys.stdin = open("/dev/null", "r")
-        sys.stdout = open(logfile, "a")
-        sys.stderr = open(logfile, "a")
-    except (IOError, OSError), ex:
-        syslog.syslog(syslog.LOG_ERR, "unable to chdir, close open file descriptors, or open %s; daemon not started (%s)" % logfile, ex)
-        sys.exit(EXIT_ERROR)
-
-    #
-    # properly daemonized from now on...
-    #
-
-
-def statusHandler(cmd, response):
-    global ttHistList, loHistList, noPPS, st5
-    statusLine = "Rubidium_Status at "
-    logLine = ""
-    curLo = 0
-    
-    okay = True
-        
-    if cmd.find("TT?") != -1:
-        if response != "Fail":
-            conVal = 0
-            try:
-                conVal = int(response.strip())
-                if conVal == -1:
-                    noPPS = True
-                else:
-                    noPPS = False
-                if conVal > 500000000 :
-                    conVal = conVal - 1000000000
-            except:
-                conVal = -127
-            ttHistList.append(abs(conVal))
-        else:
-            ttHistList.append(-127)
-        if len(ttHistList) > ttLogLength:
-            ttHistList.pop(0)
-    elif cmd.find("ST?") != -1:
-        if response != "Fail":
-            parts = response.split(',')
-            try:
-                if len(parts)==6:
-                    st5 = int(parts[4])
-            except:
-                st5 = -1
-        else:
-            st5 = -1
-    elif cmd.find("LO?") != -1:
-        resStr = response.strip()
-        if resStr.find('1') != -1:
-            curLo = 1
-            loHistList.append(1)
-        elif resStr.find('0') != -1:
-            loHistList.append(0)
-            curLo = 0
-
-        if len(loHistList) > (ttLogLength/60):
-            loHistList.pop(0)
-
-        subSet = None
-        if len(ttHistList) > ttMeanSs:
-            subSet =  ttHistList[ttMeanSs*-1:-1]
-        else:
-            subSet =  ttHistList[:]
-        sum = 0
-        count = 0
-        for val in subSet:
-            if val != -127:
-                sum += val
-                count += 1
-        try:
-            mean = float(sum) / float(count)
-        except:
-            mean = 2 * ttMeanSpec
-
-        outSpec = False
-        if mean > ttMeanSpec:
-            outSpec = True
-        outOfSpecCount = 0
-        for i in ttHistList:
-            if i > ttMeanSpec:
-                outOfSpecCount += 1
-
-        outOfLocCount = loHistList.count(0)
-        comErrorCount = ttHistList.count(-127)
-
-        if response == "Fail" or outSpec or curLo == 0 or st5 != 4 and st5 != 20 or noPPS:
-            logLine += ": fail"
-        else:
-            logLine += ": okay"
-
-        if curLo == 1 and not noPPS and (st5 == 4 or st5 == 20):
-            logLine += ", rubidium lock=okay"
-        else:
-            logLine += ", rubidium lock=fail"
-
-        logLine += ", pps input="
-        if noPPS:
-            logLine += "fail"
-        else:
-            logLine += "okay"
-        logLine += ", status=" + str(st5)            
-            
-        logLine += ", communication error=" + str(comErrorCount) + " sec"
-        logLine += ", outside spec +- 100 ns=" + str(outOfSpecCount) + " sec"
-        logLine += ", lost lock=" + str(outOfLocCount) + " times\n"
-
-        logTime = datetime.datetime.utcnow()
-        line =  statusLine + logTime.isoformat() + logLine
-#        logFp.truncate(0)
-        logFp = None
-        try:
-            logFp = open(statusFile,"w+")
-        except Exception, e:
-            print "Trouble while opening a log file, details: " + e.__str__()
-        logFp.write(line)
-        logFp.flush()
-        logFp.close()
-        
-
-def getHostName():
-    cmd = 'hostname -s' 
-    cf = Popen(cmd, shell = True, stdout = PIPE, stderr = PIPE)
-        
-    (res,resErr) = cf.communicate()
-    if cf.returncode != -1 and len(res)>0:
-        result = res.strip()
-    else:
-        result = "CS000"
-    return result
-
-def main():
-
-    # Now make yourself a daemon...!
-    daemonize("/var/log/ntpstats/rubidium_logger.log")
-    global ttyFp, logFp, rub_logger, statusFile
-
-    args = sys.argv[1:]
-    
-    hostName = getHostName()
-    
-    if hostName == None:
-        hostName = ''
-    logFilePath = '/var/log/ntpstats/'
-    statusFile = '/var/log/ntpstats/rubidium_status_' + hostName + ".log"
-    logFileBase = 'rubidium_log'
-    logPath  = os.path.join(logFilePath, logFileBase)
-
-    # Set up a specific logger with our desired output level
-    rub_logger = logging.getLogger('Rubidium Logger')
-    rub_logger.setLevel(logging.INFO)
-
-    # Add the log message handler to the logger 
-    handler = MyTimedRotatingFileHandler(logPath)
-    rub_logger.addHandler(handler)
-        
-    try:
-        # check if ttyS0 can be opened
-        ttyFp = open("/dev/ttyS0", "w+")
-    except Exception, e:
-        print "Trouble while opening the serial port, details: " + e.__str__()
-        sys.exit()
-
-    checkSettings(ttyFp)
-    if ttyFp != None:
-        ttyFp.close()
-
-    print "running"
-
-    first = True
-    oldCur = -1
-    cur = -1
-    count = 0
-    interval = 60
-    cmdIndex = 0
-    cmdStep = 4
-    #Logger loop, read rubidium
-    while True:
-        count += 1
-        #Wait loop, every second one read loop
-        while cur == oldCur:
-            sleep(0.01)
-            cur = round(time.time())
-            
-        oldCur = cur
-        logStr = ''
-        for cmd in cmdList:
-            line = callCommand(cmd)
-            statusHandler(cmd,line)
-            if cmd.find("TT?")!= -1:
-                # Modify clock response if it returns a high value
-                if line != "Fail":
-                    conVal = -127
-                    try:
-                        conVal = int(line.strip())
-                    except:
-                        conVal = -127
-                    if conVal > 500000000 :
-                        conVal = conVal - 1000000000
-                    line = str(conVal)
-            logStr += cmd.strip('?') + ' ' + line.strip() + "; "
-        if count >= interval or cmdIndex != 0:
-            # Every 60 seconds, call all advanced commands, in groups of 4 / second
-            if cmdIndex == 0:
-                count = 0
-            for i in range(cmdStep):
-                curCmdIndex = cmdIndex + i
-                if curCmdIndex < len(advCmdList):
-                    cmd = advCmdList[curCmdIndex]
-                    line = callCommand(cmd)
-                    logStr += cmd.strip('?') + ' ' + line.strip() + "; "
-                    if cmd.find("LO?")!= -1:
-                        statusHandler(cmd,line)
-                        
-            cmdIndex += cmdStep
-            if cmdIndex > len(advCmdList):
-                cmdIndex = 0 
-                
-        printAndLog(logStr)
-        if count > (round(float(len(advCmdList))/cmdStep)+1):
-            sleep(0.5)
-        else:
-            sleep(0.2)
-            
-    if logFp != None:
-        logFp.close()
-
-
-def printAndLog(text):
-    # print to log file
-    global  msgBuffer
-    logTime = datetime.datetime.utcnow()
-    line =  logTime.isoformat() + '; ' + text
-    sLine = line.strip()
-    if rub_logger == None:
-        msgBuffer.append(sLine)
-    else:
-        if len(msgBuffer)!= 0:
-            for bLine in msgBuffer:
-                rub_logger.info(bLine)
-            msgBuffer = []
-        rub_logger.info(sLine)
-
-
-
-#Class to modify the standard python timed rotating file handler, 
-# now with the specified filename structure: filename.YYmmdd
-class MyTimedRotatingFileHandler(logging.handlers.TimedRotatingFileHandler):
-  def __init__(self,dir_log):
-   self.dir_log = dir_log
-   filename =  self.dir_log + "." + time.strftime("%Y%m%d")
-   logging.handlers.TimedRotatingFileHandler.__init__(self,filename, when='midnight', interval=1, backupCount=0, encoding=None)
-   cmd = 'ln -fs ' + filename + ' ' + self.dir_log
-   cf = Popen(cmd, shell = True, stdout = PIPE, stderr = PIPE)
-   (res,resErr) = cf.communicate()
-   
-  def doRollover(self):
-   """
-   TimedRotatingFileHandler remix - rotates logs on daily basis, and filename of current logfile is time.strftime("%Y%m%d") always
-   """ 
-   self.stream.close()
-   # get the time that this sequence started at and make it a TimeTuple
-   t = self.rolloverAt - self.interval
-   timeTuple = time.localtime(t)
-   self.baseFilename = self.dir_log + "." + time.strftime("%Y%m%d")
-    
-   if self.encoding:
-     self.stream = codecs.open(self.baseFilename, 'a', self.encoding)
-   else:
-     self.stream = open(self.baseFilename, 'a')
-
-   cmd = 'ln -fs ' + self.baseFilename + ' ' + self.dir_log
-   cf = Popen(cmd, shell = True, stdout = PIPE, stderr = PIPE)
-   (res,resErr) = cf.communicate()
-   self.rolloverAt = self.rolloverAt + self.interval
-
-
-
-#Call main, execute this script
-main()
-
-
diff --git a/MAC/Tools/Rubidium/rubidium_logger_centos7.py b/MAC/Tools/Rubidium/rubidium_logger_centos7.py
index 6fdc91b1c3e76be44f35befbcb96e05737b95739..19e5f37ebb8b09b9b83dea6b7ed728972a7cab39 100755
--- a/MAC/Tools/Rubidium/rubidium_logger_centos7.py
+++ b/MAC/Tools/Rubidium/rubidium_logger_centos7.py
@@ -2,6 +2,8 @@
 #
 # Rubidium logger implementation for CentOS7 (uses daemonize PIP package)
 #
+# Install/Copy this in /usr/local/bin on stations, DO NOT INSTALL IN /opt/lofar !!!!
+#
 
 import subprocess
 from subprocess import Popen, PIPE
@@ -50,7 +52,7 @@ advCmdList = ['AD0?', 'AD1?', 'AD2?', 'AD3?', 'AD4?', 'AD5?', 'AD6?', 'AD7?', 'A
 def checkSettings(fp):
     curSet = termios.tcgetattr(fp)
     if curSet != workingSettings:
-        cmd = 'stty < /dev/rubidium'
+        cmd = 'timeout -k 5s 5s stty < /dev/rubidium'
         cf = Popen(cmd, shell = True, stdout = PIPE, stderr = PIPE)
         (result, resultErr) = cf.communicate()
         print result, resultErr
@@ -60,7 +62,7 @@ def checkSettings(fp):
 
 def callCommand(cmd):
 
-    cmd1 = "/opt/lofar/sbin/tci "
+    cmd1 = "timeout -k 5s 5s tci "
     cmd1 += cmd
     result = None
     cf = Popen(cmd1, shell = True, stdout = PIPE, stderr = PIPE)
@@ -182,7 +184,7 @@ def statusHandler(cmd, response):
         
 
 def getHostName():
-    cmd = 'hostname -s' 
+    cmd = 'timeout -k 1s 1s hostname -s' 
     cf = Popen(cmd, shell = True, stdout = PIPE, stderr = PIPE)
         
     (res,resErr) = cf.communicate()
@@ -294,7 +296,7 @@ class MyTimedRotatingFileHandler(logging.handlers.TimedRotatingFileHandler):
    self.dir_log = dir_log
    filename =  self.dir_log + "." + time.strftime("%Y%m%d")
    logging.handlers.TimedRotatingFileHandler.__init__(self,filename, when='midnight', interval=1, backupCount=0, encoding=None)
-   cmd = 'ln -fs ' + filename + ' ' + self.dir_log
+   cmd = 'timeout 5s ln -fs ' + filename + ' ' + self.dir_log
    cf = Popen(cmd, shell = True, stdout = PIPE, stderr = PIPE)
    (res,resErr) = cf.communicate()
    os.chmod(filename,0644)
@@ -314,7 +316,7 @@ class MyTimedRotatingFileHandler(logging.handlers.TimedRotatingFileHandler):
    else:
      self.stream = open(self.baseFilename, 'a')
 
-   cmd = 'ln -fs ' + self.baseFilename + ' ' + self.dir_log
+   cmd = 'timeout 5s ln -fs ' + self.baseFilename + ' ' + self.dir_log
    cf = Popen(cmd, shell = True, stdout = PIPE, stderr = PIPE)
    (res,resErr) = cf.communicate()
    os.chmod(self.baseFilename,0644)
diff --git a/RTCP/Cobalt/BrokenAntennaInfo/src/FinalMetaDataGatherer.cc b/RTCP/Cobalt/BrokenAntennaInfo/src/FinalMetaDataGatherer.cc
index 12b142e3914d95c9ba0587d72620ca99a558910e..29a03e36e980dda6fbd26ca0f938df3fe8bb4d9f 100644
--- a/RTCP/Cobalt/BrokenAntennaInfo/src/FinalMetaDataGatherer.cc
+++ b/RTCP/Cobalt/BrokenAntennaInfo/src/FinalMetaDataGatherer.cc
@@ -193,7 +193,7 @@ namespace LOFAR {
 
       string host     = parset.getString("Cobalt.FinalMetaDataGatherer.database.host", "");
       if (host.empty())
-        host = "sasdb";
+        host = "sasdb.control.lofar";
 
       string db       = parset.getString("Cobalt.FinalMetaDataGatherer.database.name", "");
       if (db.empty())
diff --git a/RTCP/Cobalt/CoInterface/src/BudgetTimer.cc b/RTCP/Cobalt/CoInterface/src/BudgetTimer.cc
index 324bcfdb84b789ebaa09bbd3baa27a852af8d572..89ba3fa92e158b002d78b6c049c04f7d6865f1f3 100644
--- a/RTCP/Cobalt/CoInterface/src/BudgetTimer.cc
+++ b/RTCP/Cobalt/CoInterface/src/BudgetTimer.cc
@@ -66,7 +66,10 @@ namespace LOFAR {
 
       if (budget > 0.0 && elapsed > budget) {
         const double realTimePerc = 100.0 * elapsed / budget;
-        LOG_DEBUG_STR("Run-time budget exceeded: " << itsName << " ran at " << realTimePerc << "% (took " << elapsed << " s, budget is " << budget << " s)");
+        if (elapsed > 2 * budget)
+          LOG_WARN_STR("Run-time budget exceeded: " << itsName << " ran at " << realTimePerc << "% (took " << elapsed << " s, budget is " << budget << " s)");
+        else
+          LOG_DEBUG_STR("Run-time budget exceeded: " << itsName << " ran at " << realTimePerc << "% (took " << elapsed << " s, budget is " << budget << " s)");
       }
     }
   } // namespace Cobalt
diff --git a/RTCP/Cobalt/CoInterface/src/BudgetTimer.h b/RTCP/Cobalt/CoInterface/src/BudgetTimer.h
index 9f39f493b1783d8d949d520008633351e5257942..0ee87cd883ffd5fc19903ab38667a01390e8f10c 100644
--- a/RTCP/Cobalt/CoInterface/src/BudgetTimer.h
+++ b/RTCP/Cobalt/CoInterface/src/BudgetTimer.h
@@ -42,6 +42,18 @@ namespace LOFAR {
 
       void stop();
 
+      // Internal class to do an automatic start/stop.
+      class StartStop {
+      public:
+        StartStop(BudgetTimer& timer) : itsTimer(timer) { itsTimer.start(); }
+        ~StartStop() { itsTimer.stop(); }
+        private:
+          // Forbid copy.
+          StartStop (const StartStop&);
+          StartStop& operator= (StartStop&);
+          BudgetTimer& itsTimer;
+      };
+
     private:
         const double budget;
 
diff --git a/RTCP/Cobalt/CoInterface/src/CMakeLists.txt b/RTCP/Cobalt/CoInterface/src/CMakeLists.txt
index 5820f8c93dadf2941a47675703b3945f07cf3f98..0f92407c39fffcbe85ba9b622c7432910434d1f8 100644
--- a/RTCP/Cobalt/CoInterface/src/CMakeLists.txt
+++ b/RTCP/Cobalt/CoInterface/src/CMakeLists.txt
@@ -18,6 +18,7 @@ lofar_add_library(cointerface
   Stream.cc
   Parset.cc
   RunningStatistics.cc
+  RSPTimeStamp.cc
   TABTranspose.cc
   TimeFuncs.cc
   RingCoordinates.cc
diff --git a/RTCP/Cobalt/CoInterface/src/CorrelatedData.h b/RTCP/Cobalt/CoInterface/src/CorrelatedData.h
index 0efe2c42eee2159552a7148307d407e5fc6e221e..b191945a19cd916087701ebe517dc3818b4576f1 100644
--- a/RTCP/Cobalt/CoInterface/src/CorrelatedData.h
+++ b/RTCP/Cobalt/CoInterface/src/CorrelatedData.h
@@ -29,7 +29,6 @@
 #include <CoInterface/Config.h>
 #include <CoInterface/StreamableData.h>
 #include <CoInterface/MultiDimArray.h>
-#include <CoInterface/OutputTypes.h>
 
 
 namespace LOFAR
diff --git a/RTCP/Cobalt/CoInterface/src/OutputTypes.h b/RTCP/Cobalt/CoInterface/src/OutputTypes.h
index a2280b6f80fef456516d58cae897fa68b5a7c277..032701e3eacc079f679169d9ab3d7e6a76f89fc1 100644
--- a/RTCP/Cobalt/CoInterface/src/OutputTypes.h
+++ b/RTCP/Cobalt/CoInterface/src/OutputTypes.h
@@ -1,5 +1,6 @@
 //# OutputTypes.h
-//# Copyright (C) 2011-2013  ASTRON (Netherlands Institute for Radio Astronomy)
+//# Copyright (C) 2011-2013, 2017
+//# ASTRON (Netherlands Institute for Radio Astronomy)
 //# P.O. Box 2, 7990 AA Dwingeloo, The Netherlands
 //#
 //# This file is part of the LOFAR software suite.
@@ -32,7 +33,8 @@ namespace LOFAR
     enum OutputType
     {
       CORRELATED_DATA = 1,
-      BEAM_FORMED_DATA
+      BEAM_FORMED_DATA,
+      RSP_RAW_DATA
     };
 
   } // namespace Cobalt
diff --git a/RTCP/Cobalt/CoInterface/src/Parset.cc b/RTCP/Cobalt/CoInterface/src/Parset.cc
index afbc2653015f6c3ea24022a714499d699b9d942c..83d947cf80ed2914ad206abc4b9a669fc5879bb6 100644
--- a/RTCP/Cobalt/CoInterface/src/Parset.cc
+++ b/RTCP/Cobalt/CoInterface/src/Parset.cc
@@ -1,5 +1,5 @@
 //# Parset.cc
-//# Copyright (C) 2008-2015  ASTRON (Netherlands Institute for Radio Astronomy)
+//# Copyright (C) 2008-2017  ASTRON (Netherlands Institute for Radio Astronomy)
 //# P.O. Box 2, 7990 AA Dwingeloo, The Netherlands
 //#
 //# This file is part of the LOFAR software suite.
@@ -39,6 +39,7 @@
 #include <Common/LofarLogger.h>
 #include <Common/DataConvert.h>
 #include <Common/LofarBitModeInfo.h>
+#include <Common/StringUtil.h>
 #include <ApplCommon/PosixTime.h>
 #include <CoInterface/PrintVector.h>
 #include <CoInterface/OutputTypes.h>
@@ -319,10 +320,11 @@ namespace LOFAR
 
       // NOTE: Make sure that all keys have defaults, to make test parsets
       // a lot shorter.
+      // --Update: No, instead use tParsetDefault in tests and reject parsets with missing required values.
 
-      vector<string>   emptyVectorString;
-      vector<unsigned> emptyVectorUnsigned;
-      vector<double>   emptyVectorDouble;
+      const vector<string>   emptyVectorString;
+      const vector<unsigned> emptyVectorUnsigned;
+      const vector<double>   emptyVectorDouble;
 
       // Generic information
       settings.realTime = getBool("Cobalt.realTime", false);
@@ -498,7 +500,7 @@ namespace LOFAR
         string prefix = str(format("PIC.Core.Cobalt.%s.") % node.name);
 
         node.hostName = getString(prefix + "host", "localhost");
-        node.cpu      = getUint32(prefix + "cpu",  0);
+        node.cpu      = getInt(prefix + "cpu", -1);
         node.mpi_nic  = getString(prefix + "mpi_nic",  "");
         node.gpus     = getUint32Vector(prefix + "gpus", vector<unsigned>(1,0)); // default to [0]
 
@@ -635,35 +637,8 @@ namespace LOFAR
         settings.beamFormer.nrDelayCompensationChannels = nrDelayCompCh;
 
         // Derive antennaFields to use for beam forming
-        vector<string> beamFormerStations = getStringVector("Cobalt.BeamFormer.stationList", emptyVectorString, true);
-        if (beamFormerStations.empty()) {
-          // if [], default to all stations
-          beamFormerStations = stations;
-        } else {
-          // filter out stations not in the observation. This allows basic defaults ([CS002..7] etc) to be used, even if
-          // they contain stations that are not available.
-          vector<string> filteredList;
-
-          for (size_t i = 0; i < beamFormerStations.size(); i++) {
-            if (std::find(stations.begin(),
-                          stations.end(),
-                          beamFormerStations[i]) != stations.end()) {
-              filteredList.push_back(beamFormerStations[i]);
-            } else {
-              LOG_WARN_STR("Removing station " << beamFormerStations[i] << " from the beam-former, as it is not participating in the observation: " << settings.rawStationList);
-            }
-          }
-
-          beamFormerStations = filteredList;
-        }
-
-        // Note that this could happen by accident if too many stations are taken out of the observation, leaving none to beam form.
-        ASSERTSTR(!beamFormerStations.empty(), "No stations left to beam form! Aborting.");
-
-        // Sort stations (CS, RS, int'l), to get a consistent and predictable order.
-        std::sort(beamFormerStations.begin(), beamFormerStations.end(), compareStationNames);
-
-        settings.beamFormer.antennaFieldNames = ObservationSettings::expandAntennaFieldNames(beamFormerStations, settings.antennaSet);
+        settings.beamFormer.antennaFieldNames = getOutputTypeAntennaFieldNames("Cobalt.BeamFormer.stationList",
+                                                                               stations, settings.antennaSet);
         LOG_DEBUG_STR("Beamforming " << settings.beamFormer.antennaFieldNames.size() << " fields: " << settings.beamFormer.antennaFieldNames);
 
         ObservationSettings::BeamFormer::StokesSettings
@@ -902,12 +877,130 @@ namespace LOFAR
         settings.beamFormer.dedispersionFFTsize = getUint32("Cobalt.BeamFormer.dedispersionFFTsize", settings.blockSize);
       }
 
+      /* ===============================
+       * RSPRaw collection information
+       * ===============================
+       */
+
+      settings.rspRaw.enabled = getBool("Observation.DataProducts.Output_RSPRaw.enabled", false);
+      if (settings.rspRaw.enabled) {
+        if (isDefined("Cobalt.RSPRaw.startTime")) {
+          settings.rspRaw.startTime = getTime("Cobalt.RSPRaw.startTime", "");
+          LOG_INFO_STR("RSP raw startTime specified as " << getString("Cobalt.RSPRaw.startTime"));
+        } else {
+          settings.rspRaw.startTime = (time_t)settings.startTime;
+        }
+        if (isDefined("Cobalt.RSPRaw.stopTime")) {
+          settings.rspRaw.stopTime = getTime("Cobalt.RSPRaw.stopTime", "");
+          LOG_INFO_STR("RSP raw stopTime specified as " << getString("Cobalt.RSPRaw.stopTime"));
+        } else {
+          settings.rspRaw.stopTime = (time_t)settings.stopTime;
+        }
+
+        // Read antenna field names (via stationList key) to use for RSP raw output
+        settings.rspRaw.antennaFieldNames = getOutputTypeAntennaFieldNames("Cobalt.RSPRaw.stationList",
+                                                                           stations, settings.antennaSet);
+        if (settings.rspRaw.antennaFieldNames.empty()) {
+          settings.rspRaw.antennaFieldNames = settings.antennaFieldNames; // default
+        }
+        LOG_INFO_STR("RSP raw: " << settings.rspRaw.antennaFieldNames.size() << " fields: " << settings.rspRaw.antennaFieldNames);
+
+        /*
+         * RSPRaw is not a supported output type in the rest of the system (it is COBALT-only).
+         * The Observatory specifies a correlation or beamforming observation, then copies a
+         * parset override in place. Hence, all RSPRaw settings must be auto-detectable (sane defaults),
+         * possibly from correlation or beamforming settings, even if those are not enabled (anymore)!
+         */
+        vector<ObservationSettings::FileLocation> locations = getFileLocations("RSPRaw");
+        const bool locationsAutoDetected = locations.empty();
+        if (locationsAutoDetected) {
+          LOG_INFO("RSP raw: trying to auto-detect storage locations from correlated and/or coherent stokes and/or incoherent stokes storage locations");
+          const vector<ObservationSettings::FileLocation> correlated_locations = getFileLocations("Correlated");
+          const vector<ObservationSettings::FileLocation> coherent_locations   = getFileLocations("CoherentStokes");
+          const vector<ObservationSettings::FileLocation> incoherent_locations = getFileLocations("IncoherentStokes");
+
+          locations.insert(locations.end(), correlated_locations.begin(), correlated_locations.end());
+          locations.insert(locations.end(), coherent_locations.begin(),   coherent_locations.end());
+          locations.insert(locations.end(), incoherent_locations.begin(), incoherent_locations.end());
+          if (locations.empty()) {
+            THROW(CoInterfaceException, "No RSP raw locations specified and could not derive any location(s) from correlated, coherent stokes, or incoherent stokes file locations (even if not enabled).");
+          }
+
+          // Purge duplicate hostname locations. By clearing filenames first, we can simply do sort() and unique().
+          for (size_t i = 0; i < locations.size(); ++i) {
+            locations[i].filename.clear();
+          }
+          std::sort(locations.begin(), locations.end());
+          std::unique(locations.begin(), locations.end());
+        }
+
+        // Assign output file locations
+        vector<unsigned> maxNrBeamletsPerBoard; // normally we end up with 4 sending RSP boards per ant field
+        unsigned locationIdx = 0;
+        for (size_t i = 0; i < settings.rspRaw.antennaFieldNames.size(); ++i) {
+          const ObservationSettings::AntennaFieldName& afName = settings.rspRaw.antennaFieldNames[i];
+          vector<ObservationSettings::AntennaFieldName>::iterator nameIt = std::find(settings.antennaFieldNames.begin(),
+                                                                                     settings.antennaFieldNames.end(), afName);
+          ASSERTSTR(nameIt != settings.antennaFieldNames.end(), "RSP raw antenna field name " << afName.fullName() <<
+                                                                " missing in observation antenna field list"); // getOutputTypeAntennaFieldNames() must have avoided this
+          vector<ObservationSettings::AntennaField>::iterator afIt = settings.antennaFields.begin() +
+                                              std::distance(settings.antennaFieldNames.begin(), nameIt);
+          size_t nrStreams = afIt->inputStreams.size();
+          if (maxNrBeamletsPerBoard.size() < nrStreams) {
+            maxNrBeamletsPerBoard.resize(nrStreams);
+          }
+
+          for (unsigned s = 0; s < nrStreams; ++s) {
+            if (locationIdx >= locations.size()) {
+              if (locationsAutoDetected) {
+                locationIdx = 0; // if auto-detected, assign locations in round-robin order
+              } else { // Either you specify no locations and we do it all, or you specify a complete list. No half-baked RSP raw settings!
+                THROW(CoInterfaceException, "No RSP raw filename or location specified for antenna field " <<
+                                            afName.fullName() << " stream " << s);
+              }
+            }
+
+            ObservationSettings::RSPRaw::File file;
+            file.antennaFieldNameIdx = i;
+            file.streamNr = s;
+            if (locationsAutoDetected) {
+              locations[locationIdx].filename = str(format("L%u_%s_%u_rsp.raw") % settings.observationID % afName.fullName().c_str() % s);
+            }
+            file.location = locations[locationIdx];
+            settings.rspRaw.files.push_back(file);
+
+            outputProcHosts.insert(file.location.host);
+            LOG_INFO_STR("RSP raw: file " << locations[locationIdx].filename <<
+                         " is written to " << file.location.toString());
+
+            locationIdx += 1;
+
+            maxNrBeamletsPerBoard[s] = std::max(maxNrBeamletsPerBoard[s],
+                                                (unsigned)std::count(afIt->rspBoardMap.begin(),
+                                                                     afIt->rspBoardMap.end(), s));
+          }
+        }
+
+        // Read nrBeamletsPerBoardList and apply sane defaults wrt max nr beamlets per board in the obs
+        settings.rspRaw.nrBeamletsPerBoardList = getUint32Vector("Cobalt.RSPRaw.nrBeamletsPerBoardList",
+                                                                 emptyVectorUnsigned, true);
+        if (settings.rspRaw.nrBeamletsPerBoardList.size() < maxNrBeamletsPerBoard.size()) {
+          settings.rspRaw.nrBeamletsPerBoardList.resize(maxNrBeamletsPerBoard.size(), UINT_MAX);
+        }
+        for (size_t i = 0; i < settings.rspRaw.nrBeamletsPerBoardList.size(); ++i) {
+          settings.rspRaw.nrBeamletsPerBoardList[i] = std::min(settings.rspRaw.nrBeamletsPerBoardList[i],
+                                                               maxNrBeamletsPerBoard[i]);
+        }
+        LOG_INFO_STR("RSP raw: max nr beamlets per RSP board to forward: " << settings.rspRaw.nrBeamletsPerBoardList);
+      }
+
+
       // set output hosts
       settings.outputProcHosts.clear();
       for (set<string>::const_iterator i = outputProcHosts.begin(); i != outputProcHosts.end(); ++i) {
-        // skip empty host names
-        if (*i == "")
+        if (i->empty()) {
           continue;
+        }
 
         settings.outputProcHosts.push_back(*i);
       }
@@ -915,6 +1008,42 @@ namespace LOFAR
       return settings;
     }
 
+    vector<struct ObservationSettings::AntennaFieldName>
+    Parset::getOutputTypeAntennaFieldNames(const string& stationListKey,
+                                           const vector<string>& stations,
+                                           const string& antennaSet) const
+    {
+      vector<string> newStations = getStringVector(stationListKey, vector<string>(), true);
+      if (newStations.empty()) {
+        // if [], default to all stations
+        newStations = stations;
+      } else {
+        // filter out stations not in the observation. This allows basic defaults ([CS002..7] etc) to be used, even if
+        // they contain stations that are not available.
+        vector<string> filteredList;
+
+        for (size_t i = 0; i < newStations.size(); i++) {
+          if (std::find(stations.begin(), stations.end(),
+                        newStations[i]) != stations.end()) {
+            filteredList.push_back(newStations[i]);
+          } else {
+            LOG_WARN_STR("Removing station " << newStations[i] << " from interpreted " << stationListKey <<
+                         ", as it is not participating in the observation: " << settings.rawStationList);
+          }
+        }
+
+        newStations = filteredList;
+      }
+
+      // Note that this could happen by accident if too many stations are taken out of the observation, leaving none
+      ASSERTSTR(!newStations.empty(), "No stations left! Aborting.");
+
+      // Sort stations (CS, RS, int'l), to get a consistent and predictable order.
+      std::sort(newStations.begin(), newStations.end(), compareStationNames);
+
+      return ObservationSettings::expandAntennaFieldNames(newStations, antennaSet);
+    }
+
     bool Parset::nodeReadsAntennaFieldData(const struct ObservationSettings& settings,
                                            const string& nodeName) const {
       for (size_t i = 0; i < settings.antennaFields.size(); ++i) {
@@ -927,7 +1056,7 @@ namespace LOFAR
 
     // pos and ref must each have at least size 3.
     double Parset::distanceVec3(const vector<double>& pos,
-                                const vector<double>& ref) const {
+                                const vector<double>& ref) {
       double dx = pos.at(0) - ref.at(0);
       double dy = pos.at(1) - ref.at(1);
       double dz = pos.at(2) - ref.at(2);
@@ -935,7 +1064,7 @@ namespace LOFAR
     }
 
     // max delay distance in meters; static per obs, i.e. unprojected (some upper bound)
-    double Parset::maxDelayDistance(const struct ObservationSettings& settings) const {
+    double Parset::maxDelayDistance(const struct ObservationSettings& settings) {
       // Available in each parset through included StationCalibration.parset.
       const vector<double> refPhaseCenter =
           settings.delayCompensation.referencePhaseCenter;
@@ -954,7 +1083,7 @@ namespace LOFAR
 
     // Top frequency of highest subband observed in Hz.
     double Parset::maxObservationFrequency(const struct ObservationSettings& settings,
-                                           double subbandWidth) const {
+                                           double subbandWidth) {
       double maxCentralFrequency = 0.0;
 
       for (unsigned sb = 0; sb < settings.subbands.size(); sb++) {
@@ -968,7 +1097,7 @@ namespace LOFAR
     // Determine the nr of channels per subband for delay compensation.
     // We aim for the visibility samples to be good to about 1 part in 1000.
     // See the Cobalt beamformer design doc for more info on how and why.
-    unsigned Parset::calcNrDelayCompensationChannels(const struct ObservationSettings& settings) const {
+    unsigned Parset::calcNrDelayCompensationChannels(const struct ObservationSettings& settings) {
       double d = maxDelayDistance(settings); // in meters
       if (d < 400.0)
         d = 400.0; // for e.g. CS002LBA only; CS001LBA-CS002LBA is ~441 m
@@ -1014,6 +1143,9 @@ namespace LOFAR
       return static_cast<size_t>(floor((stopTime - startTime) * subbandWidth() / blockSize));
     }
 
+    size_t ObservationSettings::nrRspRawBlocks() const {
+      return static_cast<size_t>(floor(((double)rspRaw.stopTime - rspRaw.startTime) * subbandWidth() / blockSize));
+    }
 
     double ObservationSettings::subbandWidth() const {
       return 1.0 * clockHz() / 1024;
@@ -1156,15 +1288,6 @@ namespace LOFAR
     }
 
 
-    void Parset::checkVectorLength(const std::string &key, unsigned expectedSize) const
-    {
-      unsigned actualSize = getStringVector(key, true).size();
-
-      if (actualSize != expectedSize)
-        THROW(CoInterfaceException, "Key \"" << string(key) << "\" contains wrong number of entries (expected: " << expectedSize << ", actual: " << actualSize << ')');
-    }
-
-
     void Parset::checkInputConsistency() const
     {
     }
@@ -1185,10 +1308,13 @@ namespace LOFAR
     std::string Parset::getHostName(OutputType outputType, unsigned streamNr) const
     {
       if (outputType == CORRELATED_DATA)
-        return settings.correlator.files[streamNr].location.host;
+        return settings.correlator.files.at(streamNr).location.host;
 
       if (outputType == BEAM_FORMED_DATA)
-        return settings.beamFormer.files[streamNr].location.host;
+        return settings.beamFormer.files.at(streamNr).location.host;
+
+      if (outputType == RSP_RAW_DATA)
+        return settings.rspRaw.files.at(streamNr).location.host;
 
       return "unknown";
     }
@@ -1197,10 +1323,13 @@ namespace LOFAR
     std::string Parset::getFileName(OutputType outputType, unsigned streamNr) const
     {
       if (outputType == CORRELATED_DATA)
-        return settings.correlator.files[streamNr].location.filename;
+        return settings.correlator.files.at(streamNr).location.filename;
 
       if (outputType == BEAM_FORMED_DATA)
-        return settings.beamFormer.files[streamNr].location.filename;
+        return settings.beamFormer.files.at(streamNr).location.filename;
+
+      if (outputType == RSP_RAW_DATA)
+        return settings.rspRaw.files.at(streamNr).location.filename;
 
       return "unknown";
     }
@@ -1209,10 +1338,13 @@ namespace LOFAR
     std::string Parset::getDirectoryName(OutputType outputType, unsigned streamNr) const
     {
       if (outputType == CORRELATED_DATA)
-        return settings.correlator.files[streamNr].location.directory;
+        return settings.correlator.files.at(streamNr).location.directory;
 
       if (outputType == BEAM_FORMED_DATA)
-        return settings.beamFormer.files[streamNr].location.directory;
+        return settings.beamFormer.files.at(streamNr).location.directory;
+
+      if (outputType == RSP_RAW_DATA)
+        return settings.rspRaw.files.at(streamNr).location.directory;
 
       return "unknown";
     }
@@ -1226,10 +1358,26 @@ namespace LOFAR
       switch (outputType) {
       case CORRELATED_DATA:    return settings.correlator.files.size();
       case BEAM_FORMED_DATA:   return settings.beamFormer.files.size();
+      case RSP_RAW_DATA:       return settings.rspRaw.files.size();
       default:                 THROW(CoInterfaceException, "Unknown output type");
       }
     }
 
+    unsigned Parset::getRSPRawOutputStreamIdx(const std::string& antennaFieldName,
+                                              unsigned boardNr) const
+    {
+      const std::vector<ObservationSettings::RSPRaw::File>& files = settings.rspRaw.files;
+      for (size_t i = 0; i < files.size(); ++i) {
+        if (settings.rspRaw.antennaFieldNames.at(files[i].antennaFieldNameIdx).fullName() == antennaFieldName &&
+            files[i].streamNr == boardNr) {
+          return i;
+        }
+      }
+
+      THROW(CoInterfaceException, "Unknown output stream for antenna field name " <<
+                                  antennaFieldName << " and RSP board nr " << boardNr);
+    }
+
     size_t Parset::nrBytesPerComplexSample() const
     {
       return 2 * nrBitsPerSample() / 8;
@@ -1300,7 +1448,7 @@ namespace LOFAR
       return list;
     }
 
-    double Parset::getTime(const std::string &name, const std::string &defaultValue) const
+    time_t Parset::getTime(const std::string &name, const std::string &defaultValue) const
     {
       return LOFAR::to_time_t(boost::posix_time::time_from_string(getString(name, defaultValue)));
     }
@@ -1372,7 +1520,7 @@ namespace LOFAR
       return settings.nrBitsPerSample;
     }
 
-    unsigned Parset::nrObsOutputTypes() const
+    unsigned Parset::nrProcessedOutputTypes() const
     {
       unsigned nr = 0;
 
@@ -1385,6 +1533,7 @@ namespace LOFAR
       if (settings.beamFormer.anyIncoherentTABs()) {
         nr += 1;
       }
+      // RSP raw is not a processed output type, so not counted: see caller(s) for impact if changing this
 
       return nr;
     }
@@ -1394,6 +1543,7 @@ namespace LOFAR
       switch (outputType) {
       case CORRELATED_DATA:   return settings.correlator.enabled;
       case BEAM_FORMED_DATA:  return settings.beamFormer.enabled;
+      case RSP_RAW_DATA:      return settings.rspRaw.enabled;
       default:                THROW(CoInterfaceException, "Unknown output type");
       }
     }
diff --git a/RTCP/Cobalt/CoInterface/src/Parset.h b/RTCP/Cobalt/CoInterface/src/Parset.h
index 9686bf00f34b43ced7bc523ca2e0c3d9becc62e6..ce32ab3d700ae9d6fff62f58d7890da48525b8fb 100644
--- a/RTCP/Cobalt/CoInterface/src/Parset.h
+++ b/RTCP/Cobalt/CoInterface/src/Parset.h
@@ -1,5 +1,5 @@
 //# Parset.h: class/struct that holds the Parset information
-//# Copyright (C) 2008-2015  ASTRON (Netherlands Institute for Radio Astronomy)
+//# Copyright (C) 2008-2017  ASTRON (Netherlands Institute for Radio Astronomy)
 //# P.O. Box 2, 7990 AA Dwingeloo, The Netherlands
 //#
 //# This file is part of the LOFAR software suite.
@@ -112,6 +112,8 @@ namespace LOFAR
 
       size_t nrBlocks() const;
 
+      size_t nrRspRawBlocks() const;
+
       // The number of seconds represented by each block.
       double blockDuration() const;
 
@@ -191,8 +193,13 @@ namespace LOFAR
                  antennaField == other.antennaField;
         }
 
+        bool operator==(const std::string &other) const {
+          return fullName() == other;
+        }
+
         // Returns the indices in fullSet for each element of subSet.
-        static std::vector<unsigned> indices(const std::vector<AntennaFieldName> &subSet, const std::vector<AntennaFieldName> &fullSet);
+        static std::vector<unsigned> indices(const std::vector<AntennaFieldName> &subSet,
+                                             const std::vector<AntennaFieldName> &fullSet);
 
         // Returns a list of the station names.
         static std::vector<std::string> names( const std::vector<AntennaFieldName> &list );
@@ -290,8 +297,8 @@ namespace LOFAR
         // Host name
         std::string hostName;
 
-        // CPU number to bind to
-        size_t cpu;
+        // CPU socket number to bind to, or -1 to not bind to any
+        int cpu;
 
         // CUDA GPU numbers to bind to
         std::vector<unsigned> gpus;
@@ -306,6 +313,7 @@ namespace LOFAR
       std::vector<struct Node> nodes;
 
       // Cluster where data writers run
+      // TODO: move to per output type and read Output_XXX.storageClusterName keys
       std::string outputCluster;
 
       /*
@@ -408,6 +416,36 @@ namespace LOFAR
         string host;
         string directory;
         string filename;
+
+        // Make FileLocation objects comparable and equality testable,
+        // so we can prune dups in a vector using sort + unique.
+        bool operator<(const FileLocation& rhs) const {
+          int cmp = cluster.compare(rhs.cluster);
+          if (cmp < 0) return true;
+          if (cmp > 0) return false;
+          cmp = host.compare(rhs.host);
+          if (cmp < 0) return true;
+          if (cmp > 0) return false;
+          cmp = directory.compare(rhs.directory);
+          if (cmp < 0) return true;
+          if (cmp > 0) return false;
+          cmp = filename.compare(rhs.filename);
+          if (cmp < 0) return true;
+          return false;
+        }
+
+        bool operator==(const FileLocation& rhs) const {
+          return filename  == rhs.filename  && host    == rhs.host &&
+                 directory == rhs.directory && cluster == rhs.cluster;
+        }
+
+        std::string toString() const {
+          std::string s;
+          if (!cluster.empty()) {
+            s = cluster + ':';
+          }
+          return s + host + ':' + directory + '/' + filename;
+        }
       };
 
       /* ===============================
@@ -583,6 +621,9 @@ namespace LOFAR
 
         // Antenna fields to use for beam forming.
         // Must be a subset of the observation antenna-field list
+        //
+        // Derived from key: Cobalt.Beamformer.stationList
+        // TODO: split up in CoherentStokes and IncoherentStokes antenna field name lists
         std::vector<AntennaFieldName> antennaFieldNames;
 
         // All SAPs, with information about the TABs to form.
@@ -654,6 +695,64 @@ namespace LOFAR
 
       struct BeamFormer beamFormer;
 
+      /* ===============================
+       * RSPRaw collection information
+       * ===============================
+       */
+
+      struct RSPRaw {
+          // Whether RSP raw data collection was requested.
+          //
+          // key: Observation.DataProducts.Output_RSPRaw.enabled
+          // Default: false
+          bool enabled;
+
+          // Specified RSP raw data dump / piggy backing start time
+          // in seconds since 1970.
+          //
+          // key: Cobalt.RSPRaw.startTime
+          // Default: value of Observation.startTime
+          time_t startTime;
+
+          // Specified raw RSP data dump / piggy backing stop time
+          // in seconds since 1970.
+          //
+          // key: Cobalt.RSPRaw.stopTime
+          // Default: value of Observation.stopTime
+          time_t stopTime;
+
+          // All antenna fields specified for RSP raw output
+          // Must be a subset of the observation antenna-field list
+          //
+          // Derived from key: Cobalt.RSPRaw.stationList
+          // Default value: antennaFieldNames (observation wide)
+          std::vector<AntennaFieldName> antennaFieldNames;
+
+          // A vector with per RSP board (for all stations) the number of beamlets,
+          // to send out from each station RSP frame.
+          // Vector size must be the (max) number of antenna field input streams (typically 4).
+          // (This is a cheap variant of full (beam, subband) selection per (station, board).)
+          //
+          // key: Cobalt.RSPRaw.nrBeamletsPerBoardList
+          // An absent key, missing values (vector too small), or too high value means all.
+          std::vector<unsigned> nrBeamletsPerBoardList;
+
+          struct File {
+              // Index into *RSP raw* antennaFieldNames
+              unsigned antennaFieldNameIdx;
+
+              // Stream number, aka sender RSP board nr (typically 0-3)
+              unsigned streamNr;
+
+              struct FileLocation location;
+          };
+
+          // The list of files to write
+          std::vector<struct File> files;
+      };
+
+      struct RSPRaw rspRaw;
+
       // Returns the Nyquist zone number based on bandFilter.
       unsigned nyquistZone() const;
 
@@ -710,13 +809,14 @@ namespace LOFAR
       std::string                 positionType() const;
       unsigned                    dedispersionFFTsize() const;
 
-      unsigned                    nrObsOutputTypes() const;
+      unsigned                    nrProcessedOutputTypes() const;
       bool                        outputThisType(OutputType) const;
 
       unsigned nrStreams(OutputType, bool force = false) const;
       std::string getHostName(OutputType, unsigned streamNr) const;
       std::string getFileName(OutputType, unsigned streamNr) const;
       std::string getDirectoryName(OutputType, unsigned streamNr) const;
+      unsigned getRSPRawOutputStreamIdx(const std::string& antennaFieldName, unsigned boardNr) const;
 
       double channel0Frequency( size_t subband, size_t nrChannels ) const;
 
@@ -729,15 +829,19 @@ namespace LOFAR
 
       mutable std::string itsWriteCache;
 
-      void                        checkVectorLength(const std::string &key, unsigned expectedSize) const;
       void                        checkInputConsistency() const;
 
-      void                        addPosition(string stName);
-      double                      getTime(const std::string &name, const std::string &defaultValue) const;
+      time_t                      getTime(const std::string &name, const std::string &defaultValue) const;
 
       std::vector<double>         centroidPos(const string &stations) const;
 
-      std::vector<struct ObservationSettings::FileLocation> getFileLocations(const std::string outputType) const;
+      std::vector<struct ObservationSettings::AntennaFieldName>
+                                  getOutputTypeAntennaFieldNames(const std::string& stationListKey,
+                                                                 const std::vector<std::string>& stations,
+                                                                 const std::string& antennaSet) const;
+
+      std::vector<struct ObservationSettings::FileLocation>
+                                  getFileLocations(const std::string outputType) const;
 
       // Returns whether nodeName has to participate in the observation
       // given antenna fields, antenna mode, and configured antenna field streams.
@@ -745,12 +849,12 @@ namespace LOFAR
       bool                        nodeReadsAntennaFieldData(const struct ObservationSettings& settings,
                                                             const std::string& nodeName) const;
 
-      double                      distanceVec3(const std::vector<double>& pos,
-                                               const std::vector<double>& ref) const;
-      double                      maxDelayDistance(const struct ObservationSettings& settings) const;
-      double                      maxObservationFrequency(const struct ObservationSettings& settings,
-                                                          double subbandWidth) const;
-      unsigned                    calcNrDelayCompensationChannels(const struct ObservationSettings& settings) const;
+      static double               distanceVec3(const std::vector<double>& pos,
+                                               const std::vector<double>& ref);
+      static double               maxDelayDistance(const struct ObservationSettings& settings);
+      static double               maxObservationFrequency(const struct ObservationSettings& settings,
+                                                          double subbandWidth);
+      static unsigned             calcNrDelayCompensationChannels(const struct ObservationSettings& settings);
     };
 
     std::ostream &operator<<(std::ostream &os, const ObservationSettings::AntennaFieldName &fieldName);
diff --git a/RTCP/Cobalt/InputProc/src/Station/RSP.h b/RTCP/Cobalt/CoInterface/src/RSP.h
similarity index 89%
rename from RTCP/Cobalt/InputProc/src/Station/RSP.h
rename to RTCP/Cobalt/CoInterface/src/RSP.h
index ef602ae268d46db66031d160cf2e38d20e281dbf..ff0bea84ca02a5b76a54a5ecb6c279c90946188f 100644
--- a/RTCP/Cobalt/InputProc/src/Station/RSP.h
+++ b/RTCP/Cobalt/CoInterface/src/RSP.h
@@ -1,5 +1,6 @@
 //# RSP.h: RSP data format
-//# Copyright (C) 2012-2013  ASTRON (Netherlands Institute for Radio Astronomy)
+//# Copyright (C) 2012-2013, 2017
+//# ASTRON (Netherlands Institute for Radio Astronomy)
 //# P.O. Box 2, 7990 AA Dwingeloo, The Netherlands
 //#
 //# This file is part of the LOFAR software suite.
@@ -18,14 +19,14 @@
 //#
 //# $Id$
 
-#ifndef LOFAR_INPUT_PROC_RSP_H
-#define LOFAR_INPUT_PROC_RSP_H
+#ifndef LOFAR_INTERFACE_RSP_H
+#define LOFAR_INTERFACE_RSP_H
 
 #include <cstddef>
 #include <complex>
 
+#include "RSPTimeStamp.h"
 #include <Common/LofarTypes.h>
-#include <InputProc/RSPTimeStamp.h>
 
 namespace LOFAR
 {
@@ -51,8 +52,8 @@ namespace LOFAR
       // ----------------------------------------------------------------------
 
       struct Header {
-        // 2: Beamlet Data CoInterface 5.0
-        // 3: Beamlet Data CoInterface 6.0 (8- and 4-bit mode support)
+        // 2: Beamlet Data CoInterface 5.0: no longer supported
+        // 3: Beamlet Data CoInterface 6.0 (add 8- and 4-bit mode support apart from 16-bit mode)
         uint8 version;
 
         // bit (0=LSB)
@@ -97,8 +98,9 @@ namespace LOFAR
       } header;
 
       // Payload, allocated for maximum size.
-      // Actual size depends on the header (nrBeamlets, nrBlocks). It changed in
-      // the past (61 vs 60) and may be less for tests and old pre-recorded data
+      // Actual size depends on the header (nrBeamlets, nrBlocks). It changed in the past (61 vs 60) and
+      // may be less for tests, old pre-recorded data, in 4 bit mode for 1 of the boards, and
+      // RSP raw output for offline reprocessing or piggy-backing (selectable beamlet subset).
       union Payload {
         char data[8130];
 
@@ -167,15 +169,9 @@ namespace LOFAR
 
       unsigned bitMode() const
       {
-        if (header.version < 3)
-          return 16;
-
-        switch (header.sourceInfo2 & 0x3) {
-        default:
-        case 0x0: return 16;
-        case 0x1: return 8;
-        case 0x2: return 4;
-        }
+        //if (header.version < 3)  // disabled: Beamlet Data CoInterface 5.0 is too old to care and in a hot path
+        //  return 16;
+        return 16 >> header.sourceInfo2; // 0x0: 16, 0x1: 8, 0x2: 4
       }
 
       void bitMode(unsigned mode)
@@ -206,6 +202,11 @@ namespace LOFAR
         header.blockSequenceNumber = ts.getBlockId();
       }
 
+      void timeStampError()
+      {
+        header.timestamp = 0xFFFFFFFF; // clock not initialised
+      }
+
       size_t packetSize() const
       {
         return sizeof(RSP::Header) + header.nrBlocks * header.nrBeamlets * 2 * 2 * bitMode() / 8;
diff --git a/RTCP/Cobalt/InputProc/src/RSPTimeStamp.cc b/RTCP/Cobalt/CoInterface/src/RSPTimeStamp.cc
similarity index 100%
rename from RTCP/Cobalt/InputProc/src/RSPTimeStamp.cc
rename to RTCP/Cobalt/CoInterface/src/RSPTimeStamp.cc
diff --git a/RTCP/Cobalt/InputProc/src/RSPTimeStamp.h b/RTCP/Cobalt/CoInterface/src/RSPTimeStamp.h
similarity index 100%
rename from RTCP/Cobalt/InputProc/src/RSPTimeStamp.h
rename to RTCP/Cobalt/CoInterface/src/RSPTimeStamp.h
diff --git a/RTCP/Cobalt/CoInterface/src/SmartPtr.h b/RTCP/Cobalt/CoInterface/src/SmartPtr.h
index 06dc8484e9558be8a490c111d07fa5c5e1d673a1..d88f8f93e1ef4244c412cee985dc45851971d126 100644
--- a/RTCP/Cobalt/CoInterface/src/SmartPtr.h
+++ b/RTCP/Cobalt/CoInterface/src/SmartPtr.h
@@ -1,5 +1,6 @@
-//# SmartPtr.h
-//# Copyright (C) 2011-2013  ASTRON (Netherlands Institute for Radio Astronomy)
+//# SmartPtr.h: unsafe pre-C++11 version of the C++11 unique_ptr
+//# Copyright (C) 2011-2013, 2017
+//# ASTRON (Netherlands Institute for Radio Astronomy)
 //# P.O. Box 2, 7990 AA Dwingeloo, The Netherlands
 //#
 //# This file is part of the LOFAR software suite.
@@ -24,6 +25,7 @@
 //# Never #include <config.h> or #include <lofar_config.h> in a header file!
 
 #include <cstdlib>
+#include <utility> // std::swap()
 
 namespace LOFAR
 {
@@ -56,6 +58,8 @@ namespace LOFAR
       T *get();
       T *release();
 
+      void swap(SmartPtr<T,D>& other) /*noexcept*/;
+
     private:
       T *ptr;
     };
@@ -187,6 +191,11 @@ namespace LOFAR
     }
 
 
+    template <typename T, class D>
+    inline void SmartPtr<T,D>::swap(SmartPtr<T,D>& other) /*noexcept*/
+    {
+      std::swap(ptr, other.ptr);
+    }
   } // namespace Cobalt
 } // namespace LOFAR
 
diff --git a/RTCP/Cobalt/CoInterface/src/Stream.cc b/RTCP/Cobalt/CoInterface/src/Stream.cc
index 24d4a3385f2b4c7d93110e61de793fa8bbe6fb73..f83c8bae797bcd93274ac2b98c6d1d20c4615a2d 100644
--- a/RTCP/Cobalt/CoInterface/src/Stream.cc
+++ b/RTCP/Cobalt/CoInterface/src/Stream.cc
@@ -61,6 +61,7 @@ namespace LOFAR
 
 
     // The returned descriptor can be supplied to LCS/Stream StreamFactory.h
+    // For RSP raw impl convenience this function must remain thread-safe.
     string getStreamDescriptorBetweenIONandStorage(const Parset &parset, OutputType outputType, unsigned streamNr, const std::string &bind_local_iface)
     {
       string host = parset.getHostName(outputType, streamNr);
diff --git a/RTCP/Cobalt/CoInterface/src/StreamableData.h b/RTCP/Cobalt/CoInterface/src/StreamableData.h
index 5fe7ec3e223452ab75a27588744030f78770be4b..46fb070c1bdbf06a48fd179fb38b4e05e381a36c 100644
--- a/RTCP/Cobalt/CoInterface/src/StreamableData.h
+++ b/RTCP/Cobalt/CoInterface/src/StreamableData.h
@@ -1,5 +1,6 @@
 //# StreamableData.h
-//# Copyright (C) 2008-2013  ASTRON (Netherlands Institute for Radio Astronomy)
+//# Copyright (C) 2008-2013, 2017
+//# ASTRON (Netherlands Institute for Radio Astronomy)
 //# P.O. Box 2, 7990 AA Dwingeloo, The Netherlands
 //#
 //# This file is part of the LOFAR software suite.
@@ -25,11 +26,12 @@
 
 #include <Common/LofarTypes.h>
 #include <Common/DataConvert.h>
-#include <CoInterface/Parset.h>
-#include <CoInterface/MultiDimArray.h>
-#include <CoInterface/SparseSet.h>
-#include <CoInterface/Allocator.h>
 #include <Stream/Stream.h>
+#include "Parset.h"
+#include "MultiDimArray.h"
+#include "SparseSet.h"
+#include "Allocator.h"
+#include "RSP.h"
 
 namespace LOFAR
 {
@@ -50,15 +52,20 @@ namespace LOFAR
       // the CPU which fills the datastructure sets the peerMagicNumber,
       // because other CPUs will overwrite it with a read(s,true) call from
       // either disk or network.
-      StreamableData() : peerMagicNumber(magic), rawSequenceNumber(0)
+      StreamableData(bool readWithSeqNr = true, bool writeWithSeqNr = true)
+      : peerMagicNumber(magic),
+        readWithSequenceNumber(readWithSeqNr),
+        writeWithSequenceNumber(writeWithSeqNr),
+        rawSequenceNumber(0)
       {
       }
+
       virtual ~StreamableData()
       {
       }
 
-      void read(Stream *, bool withSequenceNumber, unsigned align = 1);
-      void write(Stream *, bool withSequenceNumber, unsigned align = 1);
+      void read(Stream *, unsigned align);
+      void write(Stream *, unsigned align);
 
       bool shouldByteSwap() const
       {
@@ -86,10 +93,21 @@ namespace LOFAR
         rawSequenceNumber = seqno;
       }
 
+      bool doReadWithSequenceNumber()
+      {
+        return readWithSequenceNumber;
+      }
+
       virtual void setDimensions(unsigned, unsigned, unsigned)
       {
       }
 
+      // Fraction of data that was lost due to output bottlenecks
+      virtual double outputLossFraction() const
+      {
+        return 0.0;
+      }
+
       uint32_t peerMagicNumber;  /// magic number received from peer
 
     protected:
@@ -98,6 +116,8 @@ namespace LOFAR
       virtual void writeData(Stream *, unsigned) = 0;
 
     private:
+      bool readWithSequenceNumber;
+      bool writeWithSequenceNumber;
       uint32_t rawSequenceNumber; /// possibly needs byte swapping
     };
 
@@ -121,9 +141,9 @@ namespace LOFAR
     };
 
 
-    inline void StreamableData::read(Stream *str, bool withSequenceNumber, unsigned alignment)
+    inline void StreamableData::read(Stream *str, unsigned alignment)
     {
-      if (withSequenceNumber) {
+      if (readWithSequenceNumber) {
         std::vector<char> header(alignment > 2 * sizeof(uint32_t) ? alignment : 2 * sizeof(uint32_t));
         uint32_t          &magicValue = *reinterpret_cast<uint32_t *>(&header[0]);
         uint32_t          &seqNo = *reinterpret_cast<uint32_t *>(&header[sizeof(uint32_t)]);
@@ -138,10 +158,10 @@ namespace LOFAR
     }
 
 
-    inline void StreamableData::write(Stream *str, bool withSequenceNumber, unsigned alignment)
+    inline void StreamableData::write(Stream *str, unsigned alignment)
     {
 
-      if (withSequenceNumber) {
+      if (writeWithSequenceNumber) {
         /*     std::vector<char> header(alignment > sizeof(uint32_t) ? alignment : sizeof(uint32_t)); */
         std::vector<char> header(alignment > 2 * sizeof(uint32_t) ? alignment : 2 * sizeof(uint32_t));
         uint32_t          &magicValue = *reinterpret_cast<uint32_t *>(&header[0]);
@@ -164,6 +184,9 @@ namespace LOFAR
     template <typename T, unsigned DIM, unsigned FLAGS_DIM>
     inline SampleData<T,DIM,FLAGS_DIM>::SampleData(const ExtentList &extents, const FlagsExtentList &flagsExtents, Allocator &allocator)
       :
+      // This clarifies seq nr handling for beamforming, however, beamformed output is *not*
+      // written via StreamableData->write(), but in a custom way in MSWriterDAL::write().
+      StreamableData(true, false),
       samples(extents, alignment, allocator),
       flags(flagsExtents) // e.g., for FilteredData [nrChannels][nrStations], sparse dimension [nrSamplesPerIntegration]
     {
@@ -187,6 +210,40 @@ namespace LOFAR
       str->write(samples.origin(), samples.num_elements() * sizeof(T));
     }
 
+
+    class RSPRawData : public StreamableData
+    {
+    public:
+      RSPRawData()
+      : StreamableData(false, false), // raw: no seq nrs
+        buffer(bufferSize),
+        used(0)
+      {
+      }
+
+    protected:
+      virtual void readData(Stream *str, unsigned alignment)
+      {
+        (void)alignment;
+
+        used = str->tryRead(&buffer[0], bufferSize); // don't know what to expect, so read what is avail
+      }
+
+      virtual void writeData(Stream *str, unsigned alignment)
+      {
+        (void)alignment;
+
+        str->write(&buffer[0], used);
+        used = 0;
+      }
+
+    private:
+      static const unsigned bufferSize = 64 * sizeof(RSP);
+
+      vector<uint8_t> buffer; // vector<RSP> could have worked, but byte stream from TCP to storage
+      size_t used;
+    };
+
   } // namespace Cobalt
 } // namespace LOFAR
 
diff --git a/RTCP/Cobalt/CoInterface/src/TABTranspose.cc b/RTCP/Cobalt/CoInterface/src/TABTranspose.cc
index 4d062e03277c33d64b8f82e30016b08b6800dcdb..3b6fbfea096983c1fd9edbda0e1f400a98fe3a35 100644
--- a/RTCP/Cobalt/CoInterface/src/TABTranspose.cc
+++ b/RTCP/Cobalt/CoInterface/src/TABTranspose.cc
@@ -62,7 +62,7 @@ void Subband::write(Stream &stream) const {
   stream.write(&dim2, sizeof dim2);
   stream.write(data.origin(), data.num_elements() * sizeof *data.origin());
 
-  LOG_DEBUG_STR("Written block "  << id);
+  LOG_DEBUG_STR("Written block " << id);
 }
 
 
@@ -84,7 +84,7 @@ void Subband::read(Stream &stream) {
 
 std::ostream &operator<<(std::ostream &str, const Subband::BlockID &id)
 {
-  return str << "file " << id.fileIdx << " block " << id.block << " subband " << id.subband;
+  return str << "stream " << id.fileIdx << " block " << id.block << " subband " << id.subband;
 }
 
 
@@ -212,13 +212,19 @@ void Block::write( BeamformedData &output ) {
     }
   }
 
-  // Report summary
-  size_t nrLost = std::count(subbandCache.begin(), subbandCache.end(), (Subband*)NULL);
+  // Update flags
+  for (size_t sb = 0; sb < subbandCache.size(); sb++) {
+      output.flags[sb].reset(); 
+
+      if (!subbandCache[sb])
+          output.flags[sb].include(0, nrSamples);
+  }
 
-  if (nrLost == 0)
-    LOG_DEBUG_STR("Block: written " << (nrSubbands - nrLost) << " subbands, lost " << nrLost << " subbands.");
+  // Report summary
+  if (complete())
+    LOG_DEBUG_STR("[block " << blockIdx << " stream " << fileIdx << "] [Block] Written " << (nrSubbands - nrSubbandsLeft) << " subbands, lost " << nrSubbandsLeft << " subbands.");
   else
-    LOG_INFO_STR("Block: written " << (nrSubbands - nrLost) << " subbands, lost " << nrLost << " subbands.");
+    LOG_INFO_STR("[block " << blockIdx << " stream " << fileIdx << "] [Block] Written " << (nrSubbands - nrSubbandsLeft) << " subbands, lost " << nrSubbandsLeft << " subbands.");
 }
 
 
@@ -229,11 +235,18 @@ bool Block::complete() const {
 
 // The BlockCollector collects blocks from different rtcp processes for a TAB.
 // More precisely, we have one BlockCollector per file (i.e. part).
-BlockCollector::BlockCollector( Pool<BeamformedData> &outputPool, size_t fileIdx, size_t nrSubbands, size_t nrChannels, size_t nrSamples, size_t nrBlocks, size_t maxBlocksInFlight )
+BlockCollector::BlockCollector( Pool<BeamformedData> &outputPool, size_t fileIdx, size_t nrSubbands, size_t nrChannels, size_t nrSamples, size_t nrBlocks, size_t maxBlocksInFlight, const std::string &logPrefix )
 :
+  logPrefix(logPrefix + "[BlockCollector] "),
+
+  nrFullBlocksLost(0),
+  nrBlockSubbandsLost(0),
+  nrBlockSubbandsReceived(0),
+  nrBlockSubbandsTooLate(0),
+
   // drop = false: we drop at the output, not at the input, but we do want to protect against unbounded growth
-  inputQueue(str(format("BlockCollector::inputQueue [file %u]") % fileIdx), (1 + maxBlocksInFlight) * nrSubbands, false),
-  outputQueue(str(format("BlockCollector::outputQueue [file %u]") % fileIdx), 3, false),
+  inputQueue(str(format("BlockCollector::inputQueue [stream %u]") % fileIdx), (1 + maxBlocksInFlight) * nrSubbands, false),
+  outputQueue(str(format("BlockCollector::outputQueue [stream %u]") % fileIdx), 3, false),
 
   outputPool(outputPool),
 
@@ -302,7 +315,9 @@ void BlockCollector::outputLoop() {
 // subsequent Blocks are missing something, send it (or them) off into the
 // outputQueue for write-back to storage.
 void BlockCollector::processSubband( SmartPtr<Subband> &subband ) {
-  LOG_DEBUG_STR("BlockCollector: Add " << subband->id);
+  ++nrBlockSubbandsReceived;
+
+  LOG_DEBUG_STR(logPrefix << "Add " << subband->id);
 
   const size_t &blockIdx = subband->id.block;
 
@@ -311,10 +326,11 @@ void BlockCollector::processSubband( SmartPtr<Subband> &subband ) {
   if (!have(blockIdx)) {
     if (!fetch(blockIdx)) {
       // too late -- discard packet
-      LOG_DEBUG_STR("BlockCollector: Dropped subband " << subband->id.subband  << " of file " << subband->id.fileIdx);
+      ++nrBlockSubbandsTooLate;
+      LOG_DEBUG_STR(logPrefix << "Dropped subband " << subband->id.subband);
 
       // if we can't drop, we shouldn't even be here.
-      ASSERTSTR(canDrop, "Received block " << blockIdx << ", but already emitted up to " << lastEmitted << " for file " << subband->id.fileIdx << " subband " << subband->id.subband);
+      ASSERTSTR(canDrop, "Received block " << blockIdx << ", but already emitted up to " << lastEmitted << " for stream " << subband->id.fileIdx << " subband " << subband->id.subband);
 
       return;
     }
@@ -336,7 +352,7 @@ void BlockCollector::processSubband( SmartPtr<Subband> &subband ) {
 
     if (nrBlocks > 0 && blockIdx == nrBlocks - 1) {
       // Received last block -- wrap up
-      LOG_INFO_STR("BlockCollector: Received last block of file " << fileIdx);
+      LOG_INFO_STR(logPrefix << "Received last block");
 
       ASSERT(blocks.empty());
 
@@ -357,6 +373,24 @@ void BlockCollector::finish() {
     emitUpTo(maxBlock());
   }
 
+  // Update loss statistics
+  nrFullBlocksLost += nrBlocks - lastEmitted + 1;
+  if (nrBlocks > 0) {
+    const float didNotReceivePerc = 100.0 - 100.0*nrBlockSubbandsReceived/nrSubbands/nrBlocks;
+    const float didNotSendPerc = (100.0*nrFullBlocksLost + 100.0*nrBlockSubbandsLost/nrSubbands) / nrBlocks;
+    const float lostPerc = didNotSendPerc - didNotReceivePerc;
+    const float tooLatePerc = 100.0 * nrBlockSubbandsTooLate / nrSubbands / nrBlocks;
+
+    if (didNotReceivePerc > 0)
+      LOG_WARN_STR(logPrefix << "Did not receive " << didNotReceivePerc << "% of the data");
+    if (lostPerc > 0)
+      LOG_ERROR_STR(logPrefix << "I lost " << lostPerc << "% of the data");
+    if (didNotSendPerc > 0)
+      LOG_WARN_STR(logPrefix << "Did not send " << didNotSendPerc << "% of the data");
+    if (tooLatePerc > 0)
+      LOG_ERROR_STR(logPrefix << "Received " << tooLatePerc << "% of the data too late. Consider increasing maxBlocksInFlight.");
+  }
+
   if (!canDrop) {
     // Should have received everything
     ASSERT(nrBlocks == 0 || (ssize_t)nrBlocks == lastEmitted + 1);
@@ -389,18 +423,23 @@ void BlockCollector::emit(size_t blockIdx) {
   } else {
     ASSERT((ssize_t)blockIdx > lastEmitted);
   }
-  lastEmitted = blockIdx;
 
-  // clear data we didn't receive
+  // fetch data
   SmartPtr<Block> &block = blocks.at(blockIdx);
+  LOG_DEBUG_STR(logPrefix << "Emitting block " << blockIdx << " (last emit: " << lastEmitted << ")");
 
-  LOG_DEBUG_STR("BlockCollector: emitting block " << blockIdx << " of file " << fileIdx);
+  // update loss statistics
+  nrFullBlocksLost += blockIdx - lastEmitted + 1;
+  nrBlockSubbandsLost += block->nrSubbandsLeft;
   
   // emit to outputPool.filled()
   outputQueue.append(block);
 
   // remove from our administration
   blocks.erase(blockIdx);
+
+  // remember where we left off
+  lastEmitted = blockIdx;
 }
 
 
@@ -487,7 +526,7 @@ void Receiver::receiveLoop()
 
       const size_t fileIdx = subband->id.fileIdx;
 
-      ASSERTSTR(collectors.find(fileIdx) != collectors.end(), "Received a piece of file " << fileIdx << ", which is unknown to me");
+      ASSERTSTR(collectors.find(fileIdx) != collectors.end(), "Received a piece of stream " << fileIdx << ", which is unknown to me");
 
       //LOG_DEBUG_STR("File " << fileIdx << ": Adding subband " << subband.id);
 
@@ -604,8 +643,8 @@ MultiSender::MultiSender( const HostMap &hostMap, const Parset &parset,
     if(find(hosts.begin(), hosts.end(), i->second) == hosts.end())
       hosts.push_back(i->second);
 
-    // each file gets a drop_rate counter
-    drop_rates[i->first] = RunningStatistics("%");
+    // each host gets a drop_rate counter
+    drop_rates[i->second] = RunningStatistics("%");
   }
 
   for (vector<struct Host>::const_iterator i = hosts.begin(); i != hosts.end(); ++i) {
@@ -616,10 +655,32 @@ MultiSender::MultiSender( const HostMap &hostMap, const Parset &parset,
 
 MultiSender::~MultiSender()
 {
-  LOG_INFO_STR("MultiSender: realTime = " << itsParset.settings.realTime << ", maxRetentionTime = " << maxRetentionTime);
-  for (HostMap::const_iterator i = hostMap.begin(); i != hostMap.end(); ++i) {
-    LOG_INFO_STR("MultiSender: [file " << i->first << " to " << i->second.hostName << "] Dropped " << drop_rates.at(i->first).mean() << "% of the data");
+  // at this point, process() has finished, either gracefully or with an exception
+
+  // drain queues in case process() did not
+  for (std::map<Host, QueuePtr>::iterator i = queues.begin(); i != queues.end(); ++i) {
+    QueuePtr &queue = i->second;
+
+    while (!queue->empty()) {
+      (void)queue->remove();
+
+      // this is loss, obviously
+      drop_rates.at(i->first).push(100.0);
+    }
   }
+
+  // report statistics
+  for (std::map<Host, RunningStatistics>::const_iterator i = drop_rates.begin(); i != drop_rates.end(); ++i) {
+    const float didNotReceivePerc = 0.0; // no output loss possible so far
+    const float lostPerc = i->second.mean();
+    const float didNotSendPerc = didNotReceivePerc + lostPerc;
+
+    if (lostPerc > 0)
+      LOG_ERROR_STR("[BeamFormer] I lost " << lostPerc << "% of the data to " << i->first.hostName);
+    if (didNotSendPerc > 0)
+      LOG_WARN_STR("[BeamFormer] Did not send " << lostPerc << "% of the data to " << i->first.hostName);
+  }
+
 }
 
 
@@ -641,13 +702,13 @@ void MultiSender::process( OMPThreadSet *threadSet )
     try {
       OMPThreadSet::ScopedRun sr(*threadSet);
 
-      LOG_DEBUG_STR(logPrefix << "MultiSender: Connecting to " << host.hostName << ":" << host.brokerPort << ":" << host.service);
+      LOG_DEBUG_STR(logPrefix << "Connecting to " << host.hostName << ":" << host.brokerPort << ":" << host.service);
 
       PortBroker::ClientStream stream(host.hostName, host.brokerPort, host.service, 0, bind_local_iface);
 
       LOG_DEBUG_STR(logPrefix << "Connected");
 
-      SmartPtr< Queue< SmartPtr<struct Subband> > > &queue = queues.at(host);
+      QueuePtr &queue = queues.at(host);
 
       SmartPtr<struct Subband> subband;
       NSTimer sendTimer(str(format("Send Subband to %s") % host.hostName), true, true);
@@ -678,13 +739,13 @@ bool MultiSender::append( SmartPtr<struct Subband> &subband )
   const size_t fileIdx = subband->id.fileIdx;
   const struct Host &host = hostMap.at(fileIdx);
 
-  SmartPtr< Queue< SmartPtr<struct Subband> > > &queue = queues.at(host);
+  QueuePtr &queue = queues.at(host);
 
   bool dropped = false;
 
   // If oldest packet in queue is too old, drop it in lieu of this new one
   if (itsParset.settings.realTime && TimeSpec::now() - queue->oldest() > maxRetentionTime) {
-    drop_rates.at(fileIdx).push(100.0);
+    drop_rates.at(host).push(100.0);
 
     // remove oldest item
     SmartPtr<struct Subband> subband = queue->remove();
@@ -694,7 +755,7 @@ bool MultiSender::append( SmartPtr<struct Subband> &subband )
 
     dropped = true;
   } else {
-    drop_rates.at(fileIdx).push(0.0);
+    drop_rates.at(host).push(0.0);
   }
 
   // Append the data to the respective queue
diff --git a/RTCP/Cobalt/CoInterface/src/TABTranspose.h b/RTCP/Cobalt/CoInterface/src/TABTranspose.h
index d302d6726cb83d75f94849c680fb54eec4bc0989..46f9466d34640537ccaebf814abb9f5fb7366b8b 100644
--- a/RTCP/Cobalt/CoInterface/src/TABTranspose.h
+++ b/RTCP/Cobalt/CoInterface/src/TABTranspose.h
@@ -67,7 +67,33 @@ namespace LOFAR
 
       std::ostream &operator<<(std::ostream &str, const Subband::BlockID &id);
 
-      typedef SampleData<float, 3> BeamformedData; // [nrSubbands][nrChannels][nrSamples]
+      class BeamformedData: public SampleData<float, 3, 1> {
+      public:
+        BeamformedData(size_t nrSubbands, size_t nrChannels, size_t nrSamples, Allocator &allocator = heapAllocator):
+          // data: [nrSubbands][nrChannels][nrSamples]
+          // flags: [nrSubbands], and encodes *output data loss*, not flagged input
+          SampleData<float, 3, 1>(boost::extents[nrSamples][nrSubbands][nrChannels],
+                                  boost::extents[nrSubbands],
+                                  allocator),
+          nrSubbands(nrSubbands),
+          nrChannels(nrChannels),
+          nrSamples(nrSamples)
+        {
+        }
+
+        // fraction of data that is lost due to output bottlenecks
+        virtual double outputLossFraction() const {
+          size_t nrFlaggedSamples = 0;
+
+          for (size_t i = 0; i < flags.shape()[0]; i++)
+            nrFlaggedSamples += flags[i].count();
+
+          return 1.0 * nrFlaggedSamples / (nrSubbands * nrSamples);
+        }
+
+      private:
+        const size_t nrSubbands, nrChannels, nrSamples;
+      };
 
       /*
        * A block of data, representing for one time slice all
@@ -119,6 +145,7 @@ namespace LOFAR
         // Cache of subband data for this block
         std::vector< SmartPtr<Subband> > subbandCache;
 
+      public:
         // The number of subbands left to receive.
         size_t nrSubbandsLeft;
       };
@@ -155,7 +182,7 @@ namespace LOFAR
          * maxBlocksInFlight: the maximum number of blocks to process in
          *                    parallel (or 0 for no limit).
          */
-        BlockCollector( Pool<BeamformedData> &outputPool, size_t fileIdx, size_t nrSubbands, size_t nrChannels, size_t nrSamples, size_t nrBlocks = 0, size_t maxBlocksInFlight = 0 );
+        BlockCollector( Pool<BeamformedData> &outputPool, size_t fileIdx, size_t nrSubbands, size_t nrChannels, size_t nrSamples, size_t nrBlocks = 0, size_t maxBlocksInFlight = 0, const std::string &logPrefix = "" );
 
         ~BlockCollector();
 
@@ -171,6 +198,14 @@ namespace LOFAR
         void finish();
 
       private:
+        const std::string logPrefix;
+
+        // statistics
+        size_t nrFullBlocksLost;        // could not emit anything of these blocks
+        size_t nrBlockSubbandsLost;     // could not receive this number of subbands of any block
+        size_t nrBlockSubbandsReceived; // received this number of subbands of any block
+        size_t nrBlockSubbandsTooLate;  // received this number of subbands of any block too late
+
         /*
          * Elements travel along the following path
          *
@@ -381,7 +416,7 @@ namespace LOFAR
 
         const Parset &itsParset;
 
-        std::map<size_t, RunningStatistics> drop_rates; // [fileIdx]
+        std::map<Host, RunningStatistics> drop_rates;
 
         // MultiSender has a queue per host it sends to. If it appends an element
         // to a queue, it will discard the head if it is older than maxRententionTime.
@@ -397,7 +432,8 @@ namespace LOFAR
         std::vector<struct Host> hosts;
 
         // A queue for data to be sent to each host
-        std::map<struct Host, SmartPtr< Queue< SmartPtr<struct Subband> > > > queues;
+        typedef SmartPtr< Queue< SmartPtr<struct Subband> > > QueuePtr;
+        std::map<struct Host, QueuePtr> queues;
       };
 
     } // namespace TABTranspose
diff --git a/RTCP/Cobalt/CoInterface/test/CMakeLists.txt b/RTCP/Cobalt/CoInterface/test/CMakeLists.txt
index 007b8b7c288cc144fb3f2d7ac2dd630d29eca151..b383745ec7777857ed0ffe5b83939f7a0cd369b3 100644
--- a/RTCP/Cobalt/CoInterface/test/CMakeLists.txt
+++ b/RTCP/Cobalt/CoInterface/test/CMakeLists.txt
@@ -11,6 +11,7 @@ lofar_add_test(tpow2 tpow2.cc)
 lofar_add_test(tSparseSet tSparseSet.cc)
 lofar_add_test(tfpequals tfpequals.cc)
 lofar_add_test(tcmpfloat DEPENDS cmpfloat)
+lofar_add_test(tRSP tRSP.cc)
 
 
 if(UNITTEST++_FOUND)
@@ -21,5 +22,6 @@ if(UNITTEST++_FOUND)
   lofar_add_test(tRunningStatistics tRunningStatistics.cc)
   lofar_add_test(tTABTranspose tTABTranspose.cc tParsetDefault.cc)
   lofar_add_test(tRingCoordinates tRingCoordinates.cc)
+  lofar_add_test(tRSPTimeStamp tRSPTimeStamp.cc)
   lofar_add_test(tSelfDestructTimer tSelfDestructTimer.cc)
 endif(UNITTEST++_FOUND)
diff --git a/RTCP/Cobalt/CoInterface/test/tLTAFeedback.in_parsets/cluster.parset b/RTCP/Cobalt/CoInterface/test/tLTAFeedback.in_parsets/cluster.parset
index 62cdd6be7fcd742e58ad1e13857912178d29fbc4..b8cc94121c6ab02278b4be5507cf2f895d5dbd44 100644
--- a/RTCP/Cobalt/CoInterface/test/tLTAFeedback.in_parsets/cluster.parset
+++ b/RTCP/Cobalt/CoInterface/test/tLTAFeedback.in_parsets/cluster.parset
@@ -19,10 +19,10 @@ Cobalt.FinalMetaDataGatherer.sshPrivateKey =
 Cobalt.FinalMetaDataGatherer.executable = source /data/home/lofarsys/production/lofar_cobalt/lofarinit.sh; FinalMetaDataGatherer
 
 # The database hostname to connect to:
-#   Production:  sasdb
-#   Development: sasdbtest (do not use here; prefer hostname redirection)
-# If empty (or missing), the default is used: sasdb
-Cobalt.FinalMetaDataGatherer.database.host = sasdb
+#   Production:  sasdb.control.lofar
+#   Development: sasdbtest.control.lofar (do not use here; prefer hostname redirection)
+# If empty (or missing), the default is used: sasdb.control.lofar
+Cobalt.FinalMetaDataGatherer.database.host = sasdb.control.lofar
 
 # The database port number to connect to.
 # If empty (or missing), the default used: 5432
diff --git a/RTCP/Cobalt/CoInterface/test/tLTAFeedback.in_parsets/correlated.parset b/RTCP/Cobalt/CoInterface/test/tLTAFeedback.in_parsets/correlated.parset
index cc1ca287b68f022b6efc8babdbdf08db632a7e3f..096dee07523092196eafae26ac3fadf766085bc4 100644
--- a/RTCP/Cobalt/CoInterface/test/tLTAFeedback.in_parsets/correlated.parset
+++ b/RTCP/Cobalt/CoInterface/test/tLTAFeedback.in_parsets/correlated.parset
@@ -19,10 +19,10 @@ Cobalt.FinalMetaDataGatherer.sshPrivateKey =
 Cobalt.FinalMetaDataGatherer.executable = source /data/home/lofarsys/production/lofar_cobalt/lofarinit.sh; FinalMetaDataGatherer
 
 # The database hostname to connect to:
-#   Production:  sasdb
-#   Development: sasdbtest (do not use here; prefer hostname redirection)
-# If empty (or missing), the default is used: sasdb
-Cobalt.FinalMetaDataGatherer.database.host = sasdb
+#   Production:  sasdb.control.lofar
+#   Development: sasdbtest.control.lofar (do not use here; prefer hostname redirection)
+# If empty (or missing), the default is used: sasdb.control.lofar
+Cobalt.FinalMetaDataGatherer.database.host = sasdb.control.lofar
 
 # The database port number to connect to.
 # If empty (or missing), the default used: 5432
diff --git a/RTCP/Cobalt/CoInterface/test/tLTAFeedback.in_parsets/cs+is.parset b/RTCP/Cobalt/CoInterface/test/tLTAFeedback.in_parsets/cs+is.parset
index 280855e0ba2fab034525118ea9771e7059d95690..4b84d95498d3dec9b9c561a0bf6addd3653c8c61 100644
--- a/RTCP/Cobalt/CoInterface/test/tLTAFeedback.in_parsets/cs+is.parset
+++ b/RTCP/Cobalt/CoInterface/test/tLTAFeedback.in_parsets/cs+is.parset
@@ -19,10 +19,10 @@ Cobalt.FinalMetaDataGatherer.sshPrivateKey =
 Cobalt.FinalMetaDataGatherer.executable = source /data/home/lofarsys/production/lofar_cobalt/lofarinit.sh; FinalMetaDataGatherer
 
 # The database hostname to connect to:
-#   Production:  sasdb
-#   Development: sasdbtest (do not use here; prefer hostname redirection)
-# If empty (or missing), the default is used: sasdb
-Cobalt.FinalMetaDataGatherer.database.host = sasdb
+#   Production:  sasdb.control.lofar
+#   Development: sasdbtest.control.lofar (do not use here; prefer hostname redirection)
+# If empty (or missing), the default is used: sasdb.control.lofar
+Cobalt.FinalMetaDataGatherer.database.host = sasdb.control.lofar
 
 # The database port number to connect to.
 # If empty (or missing), the default used: 5432
diff --git a/RTCP/Cobalt/CoInterface/test/tLTAFeedback.in_parsets/flyseye.parset b/RTCP/Cobalt/CoInterface/test/tLTAFeedback.in_parsets/flyseye.parset
index 9e988174db36ae4e17e23927357ebfbfc8e3eac8..648f88c18e51112d9085932e6f9aa79c90d6aea3 100644
--- a/RTCP/Cobalt/CoInterface/test/tLTAFeedback.in_parsets/flyseye.parset
+++ b/RTCP/Cobalt/CoInterface/test/tLTAFeedback.in_parsets/flyseye.parset
@@ -19,10 +19,10 @@ Cobalt.FinalMetaDataGatherer.sshPrivateKey =
 Cobalt.FinalMetaDataGatherer.executable = source /data/home/lofarsys/production/lofar_cobalt/lofarinit.sh; FinalMetaDataGatherer
 
 # The database hostname to connect to:
-#   Production:  sasdb
-#   Development: sasdbtest (do not use here; prefer hostname redirection)
-# If empty (or missing), the default is used: sasdb
-Cobalt.FinalMetaDataGatherer.database.host = sasdb
+#   Production:  sasdb.control.lofar
+#   Development: sasdbtest.control.lofar (do not use here; prefer hostname redirection)
+# If empty (or missing), the default is used: sasdb.control.lofar
+Cobalt.FinalMetaDataGatherer.database.host = sasdb.control.lofar
 
 # The database port number to connect to.
 # If empty (or missing), the default used: 5432
diff --git a/RTCP/Cobalt/CoInterface/test/tParset.parset_obs228591 b/RTCP/Cobalt/CoInterface/test/tParset.parset_obs228591
index ee24fd500ee7520af1861b71735c53b2c56f5330..61a5948e52ee2a506149348afa11a4f5d63a962a 100644
--- a/RTCP/Cobalt/CoInterface/test/tParset.parset_obs228591
+++ b/RTCP/Cobalt/CoInterface/test/tParset.parset_obs228591
@@ -19,10 +19,10 @@ Cobalt.FinalMetaDataGatherer.sshPrivateKey =
 Cobalt.FinalMetaDataGatherer.executable = source /data/home/lofarsys/production/lofar_cobalt/lofarinit.sh; FinalMetaDataGatherer
 
 # The database hostname to connect to:
-#   Production:  sasdb
-#   Development: sasdbtest (do not use here; prefer hostname redirection)
-# If empty (or missing), the default is used: sasdb
-Cobalt.FinalMetaDataGatherer.database.host = sasdb
+#   Production:  sasdb.control.lofar
+#   Development: sasdbtest.control.lofar (do not use here; prefer hostname redirection)
+# If empty (or missing), the default is used: sasdb.control.lofar
+Cobalt.FinalMetaDataGatherer.database.host = sasdb.control.lofar
 
 # The database port number to connect to.
 # If empty (or missing), the default used: 5432
diff --git a/RTCP/Cobalt/CoInterface/test/tParsetDefault.cc b/RTCP/Cobalt/CoInterface/test/tParsetDefault.cc
index 7f08111eacff2defab610f00620a686a840b2289..fc0360d9c59be1449bf4874a3c356052aa9eac73 100644
--- a/RTCP/Cobalt/CoInterface/test/tParsetDefault.cc
+++ b/RTCP/Cobalt/CoInterface/test/tParsetDefault.cc
@@ -26,8 +26,7 @@
 
 #include <lofar_config.h>
 
-#include <string>
-#include <CoInterface/Parset.h>
+#include "tParsetDefault.h"
 
 using std::string;
 using LOFAR::Cobalt::Parset;
diff --git a/RTCP/Cobalt/InputProc/test/tRSP.cc b/RTCP/Cobalt/CoInterface/test/tRSP.cc
similarity index 97%
rename from RTCP/Cobalt/InputProc/test/tRSP.cc
rename to RTCP/Cobalt/CoInterface/test/tRSP.cc
index 9c7ade0a0289f8bc1d260d218926b795ce0ea7b1..d0c11b3d1376f3e00acea86c98350f886ca8c27b 100644
--- a/RTCP/Cobalt/InputProc/test/tRSP.cc
+++ b/RTCP/Cobalt/CoInterface/test/tRSP.cc
@@ -28,8 +28,8 @@
 #include <Common/DataConvert.h>
 #include <Stream/FileStream.h>
 
-#include <InputProc/RSPTimeStamp.h>
-#include <InputProc/Station/RSP.h>
+#include <CoInterface/RSP.h>
+#include <CoInterface/RSPTimeStamp.h>
 
 
 using namespace LOFAR;
diff --git a/RTCP/Cobalt/InputProc/test/tRSP.in_16bit b/RTCP/Cobalt/CoInterface/test/tRSP.in_16bit
similarity index 100%
rename from RTCP/Cobalt/InputProc/test/tRSP.in_16bit
rename to RTCP/Cobalt/CoInterface/test/tRSP.in_16bit
diff --git a/RTCP/Cobalt/InputProc/test/tRSP.in_8bit b/RTCP/Cobalt/CoInterface/test/tRSP.in_8bit
similarity index 100%
rename from RTCP/Cobalt/InputProc/test/tRSP.in_8bit
rename to RTCP/Cobalt/CoInterface/test/tRSP.in_8bit
diff --git a/RTCP/Cobalt/InputProc/test/tRSP.sh b/RTCP/Cobalt/CoInterface/test/tRSP.sh
similarity index 100%
rename from RTCP/Cobalt/InputProc/test/tRSP.sh
rename to RTCP/Cobalt/CoInterface/test/tRSP.sh
diff --git a/RTCP/Cobalt/InputProc/test/tRSP.stdout b/RTCP/Cobalt/CoInterface/test/tRSP.stdout
similarity index 100%
rename from RTCP/Cobalt/InputProc/test/tRSP.stdout
rename to RTCP/Cobalt/CoInterface/test/tRSP.stdout
diff --git a/RTCP/Cobalt/InputProc/test/tRSPTimeStamp.cc b/RTCP/Cobalt/CoInterface/test/tRSPTimeStamp.cc
similarity index 98%
rename from RTCP/Cobalt/InputProc/test/tRSPTimeStamp.cc
rename to RTCP/Cobalt/CoInterface/test/tRSPTimeStamp.cc
index 7a8f0d1dda06b27d57b95a176c1a917a94abea0b..80a8b19bb601c9ee0d06e0093d2a367df42ad8ec 100644
--- a/RTCP/Cobalt/InputProc/test/tRSPTimeStamp.cc
+++ b/RTCP/Cobalt/CoInterface/test/tRSPTimeStamp.cc
@@ -26,7 +26,7 @@
 
 #include <Common/LofarLogger.h>
 
-#include <InputProc/RSPTimeStamp.h>
+#include <CoInterface/RSPTimeStamp.h>
 
 #define SAMPLERATE 195312.5
 // start the test at INT32_MAX * SAMPLERATE
diff --git a/RTCP/Cobalt/CoInterface/test/tTABTranspose.cc b/RTCP/Cobalt/CoInterface/test/tTABTranspose.cc
index d343f370bcbbf5d714f36b2119edff1973ddca19..170110c90c13db8629bb2e35c0cdec50a3e67a77 100644
--- a/RTCP/Cobalt/CoInterface/test/tTABTranspose.cc
+++ b/RTCP/Cobalt/CoInterface/test/tTABTranspose.cc
@@ -114,9 +114,7 @@ SUITE(Block) {
         block.addSubband(subband);
       }
 
-      BeamformedData output(
-        boost::extents[nrSamples][nrSubbands][nrChannels],
-        boost::extents[nrSubbands][nrChannels]);
+      BeamformedData output(nrSubbands, nrChannels, nrSamples);
 
       NSTimer transposeTimer(str(format("Block::write for %u subbands, %u channels, %u samples") % nrSubbands % nrChannels % nrSamples), true, true);
       transposeTimer.start();
@@ -143,9 +141,7 @@ struct Fixture {
     ctr(outputPool, 0, nrSubbands, nrChannels, nrSamples)
   {
     for (size_t i = 0; i < nrBlocks; ++i) {
-      outputPool.free.append(new BeamformedData(
-        boost::extents[nrSamples][nrSubbands][nrChannels],
-        boost::extents[nrSubbands][nrChannels]), false);
+      outputPool.free.append(new BeamformedData(nrSubbands, nrChannels, nrSamples), false);
     }
   }
 };
@@ -405,9 +401,7 @@ SUITE(SendReceive) {
     for (size_t i = 0; i < nrTABs; ++i) {
       outputPools[i] = new Pool<BeamformedData>(str(format("OneToOne::outputPool[%u]") % i), true);
       for (size_t b = 0; b < nrBlocks; ++b) {
-        outputPools[i]->free.append(new BeamformedData(
-          boost::extents[nrSamples][nrSubbands][nrChannels],
-          boost::extents[nrSubbands][nrChannels]), false);
+        outputPools[i]->free.append(new BeamformedData(nrSubbands, nrChannels, nrSamples), false);
       }
 
       collectors[i] = new BlockCollector(*outputPools[i], i, nrSubbands, nrChannels, nrSamples);
@@ -593,9 +587,7 @@ SUITE(MultiReceiver) {
             outputPools[t] = new Pool<BeamformedData>(str(format("MultiReceiver::Transpose::outputPool[%u]") % t), true);
 
             for (size_t i = 0; i < nrBlocks; ++i) {
-              outputPools[t]->free.append(new BeamformedData(
-                boost::extents[nrSamples][nrSubbands][nrChannels],
-                boost::extents[nrSubbands][nrChannels]), false);
+              outputPools[t]->free.append(new BeamformedData(nrSubbands, nrChannels, nrSamples), false);
             }
             collectors[FILEIDX(t)] = new BlockCollector(*outputPools[t], FILEIDX(t), nrSubbands, nrChannels, nrSamples, nrBlocks);
           }
diff --git a/RTCP/Cobalt/GPUProc/doc/BGP-Cobalt-procs.dia b/RTCP/Cobalt/GPUProc/doc/BGP-Cobalt-procs.dia
index 85c095f0b296d3ef00d41666ee289acd2ba8e881..8110ef14839ad000e24537c5902dc95db11db014 100644
Binary files a/RTCP/Cobalt/GPUProc/doc/BGP-Cobalt-procs.dia and b/RTCP/Cobalt/GPUProc/doc/BGP-Cobalt-procs.dia differ
diff --git a/RTCP/Cobalt/GPUProc/doc/BGP-Cobalt-procs.png b/RTCP/Cobalt/GPUProc/doc/BGP-Cobalt-procs.png
index 7a96df4b1b0a0499209f22b82dac4e0fca00d1d1..12daa06af65b868988a38c6baa5cb74bda2cc61a 100644
Binary files a/RTCP/Cobalt/GPUProc/doc/BGP-Cobalt-procs.png and b/RTCP/Cobalt/GPUProc/doc/BGP-Cobalt-procs.png differ
diff --git a/RTCP/Cobalt/GPUProc/doc/bf-2nd-transpose.dia b/RTCP/Cobalt/GPUProc/doc/bf-2nd-transpose.dia
index 3c50e7449afe2ef1b896f3287af6f82db8f6ba8c..b4f2d0641fee6a6c5f1501be43ef1a177605af30 100644
Binary files a/RTCP/Cobalt/GPUProc/doc/bf-2nd-transpose.dia and b/RTCP/Cobalt/GPUProc/doc/bf-2nd-transpose.dia differ
diff --git a/RTCP/Cobalt/GPUProc/doc/bf-2nd-transpose.png b/RTCP/Cobalt/GPUProc/doc/bf-2nd-transpose.png
index f214af997363508243f09a7cd5ff70f2be8b7b21..b2d8b8d9ea879903e7b4b7b69ac5a94fe84004e1 100644
Binary files a/RTCP/Cobalt/GPUProc/doc/bf-2nd-transpose.png and b/RTCP/Cobalt/GPUProc/doc/bf-2nd-transpose.png differ
diff --git a/RTCP/Cobalt/GPUProc/doc/cobalt-data-flow/Component Model.pdf b/RTCP/Cobalt/GPUProc/doc/cobalt-data-flow/Component Model.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..b6760167cbaf1dafce7f4a7ad8234c12a544b97e
--- /dev/null
+++ b/RTCP/Cobalt/GPUProc/doc/cobalt-data-flow/Component Model.pdf	
@@ -0,0 +1,5918 @@
+%PDF-1.4
+%âãÏÓ
+1 0 obj
+  <<
+    /Author()/Title(Component Model)/Subject()/Producer()/Keywords()/CreationDate(D:20170827165324+00'00')/ModDate(D:20170827165324+00'00')/Creator(Sub Systems, Inc.)
+  >>
+endobj
+4 0 obj
+  <</Length 245900>>
+  stream
+        q 0.750000 0 0 0.750000 0.000000 819.349976 cm 
+        q  
+        % VpOrgX: 0, VpOrgY: 0 (RecNo: 1)
+         
+        % mm: 8 (RecNo: 2)
+         
+        % WinExtX: 795, WinExtY: 1138 (RecNo: 3)
+         
+        % VpExtX: 763, VpExtY: -1092 (RecNo: 4)
+         
+        % WinOrgX: 0, WinOrgY: 0 (RecNo: 5)
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .753 .749 .753 rg 0 0 0 RG 1 w 1 J
+13 32 769 180 re f
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .753 .749 .753 rg 0 0 0 RG 1 w 1 J
+13 13 104 18 re f
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+10 29 m
+780 29 l
+780 210 l
+10 210 l
+10 29 l
+B Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+10 10 m
+115 10 l
+115 29 l
+10 29 l
+10 10 l
+B Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 10 m
+115 10 l
+115 29 l
+10 29 l
+10 10 l
+h S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 15 13 Tm 0 -9 Td(LOFAR::Cobalt) Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .753 .749 .753 rg 0 0 0 RG 1 w 1 J
+756 154 14 14 re f
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+753 151 14 14 re f
+753 151 14 15 re S
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .976 .933 .867 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .965 .918 .847 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .953 .902 .827 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .941 .886 .808 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .929 .875 .784 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .922 .859 .765 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .910 .843 .745 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+753 151 14 14 re S
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F1 10.000000 Tf 0 g 1 0 0 -1 735 170 Tm 0 -9 Td(S) Tj 8 0 Td(t) Tj 3 0 Td(o) Tj 6 0 Td(r) Tj 3 0 Td(a) Tj 6 0 Td(g) Tj 6 0 Td(e) Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .753 .749 .753 rg 0 0 0 RG 1 w 1 J
+523 43 239 159 re f
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+520 40 239 159 re f
+520 40 239 160 re S
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .988 .949 .890 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .984 .945 .886 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .984 .945 .882 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .984 .941 .882 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .980 .941 .878 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .980 .937 .878 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .980 .937 .875 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .976 .937 .871 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .976 .933 .871 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .976 .933 .867 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .973 .929 .867 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .973 .929 .863 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .973 .925 .863 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .969 .925 .859 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .969 .925 .855 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .969 .922 .855 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .969 .922 .851 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .965 .918 .851 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .965 .918 .847 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .965 .914 .847 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .961 .914 .843 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .961 .914 .839 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .961 .910 .839 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .957 .910 .835 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .957 .906 .835 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .957 .906 .831 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .953 .906 .827 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .953 .902 .827 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .953 .902 .824 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .949 .898 .824 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .949 .898 .820 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .949 .894 .820 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .949 .894 .816 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .945 .894 .812 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .945 .890 .812 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .945 .890 .808 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .941 .886 .808 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .941 .886 .804 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .941 .882 .804 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .937 .882 .800 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .937 .882 .796 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .937 .878 .796 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .933 .878 .792 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .933 .875 .792 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .933 .875 .788 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .929 .875 .784 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .929 .871 .784 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .929 .871 .780 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .929 .867 .780 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .925 .867 .776 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .925 .863 .776 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .925 .863 .773 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .922 .863 .769 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .922 .859 .769 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .922 .859 .765 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .918 .855 .765 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .918 .855 .761 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .918 .851 .761 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .914 .851 .757 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .914 .851 .753 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .914 .847 .753 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .910 .847 .749 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .910 .843 .749 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .910 .843 .745 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+520 40 239 159 re S
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 613 49 Tm 0 -9 Td(Output) Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+744 45 10 16 re f
+744 45 10 17 re S
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+741 47 6 4 re f
+741 47 6 5 re S
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+741 54 6 4 re f
+741 54 6 5 re S
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+753 151 14 14 re f
+753 151 14 15 re S
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .976 .933 .867 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .965 .918 .847 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .953 .902 .827 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .941 .886 .808 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .929 .875 .784 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .922 .859 .765 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .910 .843 .745 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+753 151 14 14 re S
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F1 10.000000 Tf 0 g 1 0 0 -1 735 170 Tm 0 -9 Td(S) Tj 8 0 Td(t) Tj 3 0 Td(o) Tj 6 0 Td(r) Tj 3 0 Td(a) Tj 6 0 Td(g) Tj 6 0 Td(e) Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .753 .749 .753 rg 0 0 0 RG 1 w 1 J
+233 43 249 159 re f
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+230 40 249 159 re f
+230 40 249 160 re S
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .988 .949 .890 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .984 .945 .886 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .984 .945 .882 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .984 .941 .882 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .980 .941 .878 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .980 .937 .878 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .980 .937 .875 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .976 .937 .871 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .976 .933 .871 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .976 .933 .867 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .973 .929 .867 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .973 .929 .863 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .973 .925 .863 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .969 .925 .859 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .969 .925 .855 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .969 .922 .855 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .969 .922 .851 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .965 .918 .851 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .965 .918 .847 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .965 .914 .847 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .961 .914 .843 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .961 .914 .839 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .961 .910 .839 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .957 .910 .835 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .957 .906 .835 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .957 .906 .831 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .953 .906 .827 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .953 .902 .827 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .953 .902 .824 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .949 .898 .824 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .949 .898 .820 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .949 .894 .820 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .949 .894 .816 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .945 .894 .812 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .945 .890 .812 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .945 .890 .808 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .941 .886 .808 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .941 .886 .804 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .941 .882 .804 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .937 .882 .800 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .937 .882 .796 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .937 .878 .796 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .933 .878 .792 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .933 .875 .792 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .933 .875 .788 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .929 .875 .784 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .929 .871 .784 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .929 .871 .780 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .929 .867 .780 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .925 .867 .776 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .925 .863 .776 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .925 .863 .773 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .922 .863 .769 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .922 .859 .769 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .922 .859 .765 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .918 .855 .765 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .918 .855 .761 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .918 .851 .761 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .914 .851 .757 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .914 .851 .753 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .914 .847 .753 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .910 .847 .749 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .910 .843 .749 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .910 .843 .745 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+230 40 249 159 re S
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 312 49 Tm 0 -9 Td(G) Tj 9 0 Td(P) Tj 8 0 Td(U) Tj 8 0 Td(P) Tj 7 0 Td(i) Tj 2 0 Td(p) Tj 7 0 Td(e) Tj 5 0 Td(l) Tj 2 0 Td(i) Tj 2 0 Td(n) Tj 7 0 Td(e) Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+464 45 10 16 re f
+464 45 10 17 re S
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+461 47 6 4 re f
+461 47 6 5 re S
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+461 54 6 4 re f
+461 54 6 5 re S
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .753 .749 .753 rg 0 0 0 RG 1 w 1 J
+543 143 89 49 re f
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+540 140 89 49 re f
+540 140 89 50 re S
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .984 .945 .886 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .984 .945 .882 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .980 .941 .878 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .980 .937 .878 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .976 .937 .871 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .976 .933 .871 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .976 .933 .867 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .973 .929 .863 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .973 .925 .863 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .969 .925 .855 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .969 .922 .855 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .965 .918 .851 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .965 .918 .847 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .965 .914 .847 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .961 .914 .839 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .961 .910 .839 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .957 .906 .835 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .957 .906 .831 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .953 .902 .827 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .953 .902 .824 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .949 .898 .824 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .949 .894 .820 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .949 .894 .816 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .945 .890 .812 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .945 .890 .812 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .945 .890 .808 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .941 .886 .808 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .941 .882 .804 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .937 .882 .800 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .937 .878 .796 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .933 .878 .792 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .933 .875 .788 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .929 .875 .784 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .929 .871 .784 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .929 .867 .780 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .925 .867 .776 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .925 .863 .773 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .922 .863 .769 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .922 .859 .765 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .918 .855 .765 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .918 .855 .761 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .914 .851 .757 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .914 .851 .753 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .910 .847 .749 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .910 .843 .749 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .910 .843 .745 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+540 140 89 49 re S
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 543 149 Tm 0 -9 Td(Beams Collector) Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .753 .749 .753 rg 0 0 0 RG 1 w 1 J
+373 143 79 49 re f
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+370 140 79 49 re f
+370 140 79 50 re S
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .984 .945 .886 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .984 .941 .882 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .980 .941 .878 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .980 .937 .875 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .976 .937 .871 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .976 .933 .867 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .973 .929 .863 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .973 .925 .863 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .969 .925 .855 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .969 .922 .855 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .965 .918 .851 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .965 .914 .847 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .961 .914 .843 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .961 .910 .839 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .957 .910 .835 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .957 .906 .831 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .953 .902 .827 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .953 .902 .824 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .949 .898 .820 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .949 .894 .820 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .945 .894 .812 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .945 .890 .808 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .941 .886 .808 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .941 .882 .804 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .937 .882 .800 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .937 .882 .800 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .937 .878 .796 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .933 .875 .792 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .933 .875 .788 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .929 .871 .784 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .929 .871 .780 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .925 .867 .776 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .925 .863 .773 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .922 .863 .769 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .922 .859 .765 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .918 .855 .765 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .918 .851 .761 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .914 .851 .753 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .914 .847 .753 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .910 .843 .749 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .910 .843 .745 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+370 140 79 49 re S
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 380 149 Tm 0 -9 Td(B) Tj 8 0 Td(e) Tj 6 0 Td(a) Tj 6 0 Td(m) Tj 9 0 Td(P) Tj 7 0 Td(a) Tj 6 0 Td(r) Tj 3 0 Td(t) Tj 3 0 Td(s) Tj 6 0 Td( ) Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 388 162 Tm 0 -9 Td(S) Tj 7 0 Td(u) Tj 7 0 Td(p) Tj 7 0 Td(p) Tj 7 0 Td(l) Tj 2 0 Td(i) Tj 2 0 Td(e) Tj 6 0 Td(r) Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .753 .749 .753 rg 0 0 0 RG 1 w 1 J
+243 73 89 51 re f
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+240 70 89 51 re f
+240 70 89 52 re S
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .984 .945 .886 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .984 .945 .886 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .984 .945 .882 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .980 .941 .878 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .980 .937 .878 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .976 .937 .871 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .976 .933 .871 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .976 .933 .867 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .973 .929 .863 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .973 .925 .863 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .969 .925 .855 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .969 .922 .855 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .965 .918 .851 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .965 .918 .847 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .965 .914 .847 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .961 .914 .839 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .961 .910 .839 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .957 .906 .835 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .957 .906 .831 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .953 .902 .827 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .953 .902 .824 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .949 .898 .824 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .949 .894 .820 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .949 .894 .816 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .945 .890 .812 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .945 .890 .808 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .941 .886 .808 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .941 .886 .808 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .941 .882 .804 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .937 .882 .800 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .937 .878 .796 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .933 .878 .792 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .933 .875 .788 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .929 .875 .784 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .929 .871 .784 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .929 .867 .780 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .925 .867 .776 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .925 .863 .773 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .922 .863 .769 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .922 .859 .765 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .918 .855 .765 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .918 .855 .761 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .914 .851 .757 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .914 .851 .753 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .910 .847 .749 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .910 .843 .749 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .910 .843 .745 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+240 70 89 51 re S
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 242 79 Tm 0 -9 Td(G) Tj 9 0 Td(P) Tj 8 0 Td(U) Tj 8 0 Td( ) Tj 3 0 Td(K) Tj 8 0 Td(e) Tj 5 0 Td(r) Tj 3 0 Td(n) Tj 7 0 Td(e) Tj 5 0 Td(l) Tj 2 0 Td(s) Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+314 75 10 16 re f
+314 75 10 17 re S
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+311 77 6 4 re f
+311 77 6 5 re S
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+311 84 6 4 re f
+311 84 6 5 re S
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .753 .749 .753 rg 0 0 0 RG 1 w 1 J
+16 86 14 14 re f
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+13 83 14 14 re f
+13 83 14 15 re S
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .976 .933 .867 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .965 .918 .847 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .953 .902 .827 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .941 .886 .808 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .929 .875 .784 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .922 .859 .765 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .910 .843 .745 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+13 83 14 14 re S
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F1 10.000000 Tf 0 g 1 0 0 -1 13 101 Tm 0 -9 Td(Network) Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .753 .749 .753 rg 0 0 0 RG 1 w 1 J
+23 43 199 159 re f
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+20 40 199 159 re f
+20 40 199 160 re S
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .988 .949 .890 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .984 .945 .886 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .984 .945 .882 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .984 .941 .882 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .980 .941 .878 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .980 .937 .878 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .980 .937 .875 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .976 .937 .871 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .976 .933 .871 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .976 .933 .867 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .973 .929 .867 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .973 .929 .863 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .973 .925 .863 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .969 .925 .859 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .969 .925 .855 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .969 .922 .855 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .969 .922 .851 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .965 .918 .851 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .965 .918 .847 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .965 .914 .847 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .961 .914 .843 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .961 .914 .839 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .961 .910 .839 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .957 .910 .835 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .957 .906 .835 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .957 .906 .831 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .953 .906 .827 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .953 .902 .827 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .953 .902 .824 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .949 .898 .824 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .949 .898 .820 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .949 .894 .820 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .949 .894 .816 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .945 .894 .812 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .945 .890 .812 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .945 .890 .808 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .941 .886 .808 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .941 .886 .804 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .941 .882 .804 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .937 .882 .800 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .937 .882 .796 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .937 .878 .796 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .933 .878 .792 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .933 .875 .792 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .933 .875 .788 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .929 .875 .784 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .929 .871 .784 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .929 .871 .780 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .929 .867 .780 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .925 .867 .776 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .925 .863 .776 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .925 .863 .773 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .922 .863 .769 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .922 .859 .769 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .922 .859 .765 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .918 .855 .765 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .918 .855 .761 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .918 .851 .761 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .914 .851 .757 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .914 .851 .753 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .914 .847 .753 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .910 .847 .749 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .910 .843 .749 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .910 .843 .745 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+20 40 199 159 re S
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 97 49 Tm 0 -9 Td(Input) Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+204 45 10 16 re f
+204 45 10 17 re S
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+201 47 6 4 re f
+201 47 6 5 re S
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+201 54 6 4 re f
+201 54 6 5 re S
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+13 83 14 14 re f
+13 83 14 15 re S
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .976 .933 .867 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .965 .918 .847 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .953 .902 .827 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .941 .886 .808 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .929 .875 .784 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .922 .859 .765 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .910 .843 .745 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+13 83 14 14 re S
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F1 10.000000 Tf 0 g 1 0 0 -1 13 101 Tm 0 -9 Td(Network) Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .753 .749 .753 rg 0 0 0 RG 1 w 1 J
+653 292 129 20 re f
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .753 .749 .753 rg 0 0 0 RG 1 w 1 J
+653 273 104 18 re f
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+650 289 m
+780 289 l
+780 310 l
+650 310 l
+650 289 l
+B Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+650 270 m
+755 270 l
+755 289 l
+650 289 l
+650 270 l
+B Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+650 270 m
+755 270 l
+755 289 l
+650 289 l
+650 270 l
+h S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 655 273 Tm 0 -9 Td(HDF5) Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .753 .749 .753 rg 0 0 0 RG 1 w 1 J
+33 143 69 49 re f
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+30 140 69 49 re f
+30 140 69 50 re S
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .984 .945 .886 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .984 .941 .882 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .980 .937 .878 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .976 .937 .871 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .976 .933 .867 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .973 .929 .867 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .973 .925 .863 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .969 .925 .855 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .969 .922 .851 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .965 .918 .847 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .961 .914 .843 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .961 .914 .839 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .957 .910 .835 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .957 .906 .831 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .953 .902 .827 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .949 .898 .824 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .949 .894 .820 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .949 .894 .816 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .945 .890 .812 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .941 .886 .808 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .941 .882 .804 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .937 .882 .796 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .937 .882 .796 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .933 .878 .792 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .933 .875 .792 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .929 .875 .784 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .929 .871 .780 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .925 .867 .776 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .925 .863 .773 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .922 .859 .769 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .922 .859 .765 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .918 .855 .761 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .914 .851 .757 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .914 .847 .753 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .910 .843 .749 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .910 .843 .745 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+30 140 69 49 re S
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 32 149 Tm 0 -9 Td(G) Tj 9 0 Td(e) Tj 6 0 Td(o) Tj 7 0 Td(m) Tj 10 0 Td(e) Tj 6 0 Td(t) Tj 3 0 Td(r) Tj 3 0 Td(i) Tj 2 0 Td(c) Tj 6 0 Td(a) Tj 6 0 Td(l) Tj 2 0 Td( ) Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 48 162 Tm 0 -9 Td(Delays) Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .753 .749 .753 rg 0 0 0 RG 1 w 1 J
+73 73 79 39 re f
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+70 70 79 39 re f
+70 70 79 40 re S
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .984 .945 .886 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .984 .941 .882 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .984 .941 .882 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .980 .941 .878 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .980 .937 .875 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .976 .937 .871 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .976 .933 .867 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .973 .929 .863 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .973 .925 .863 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .969 .925 .855 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .969 .922 .855 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .965 .918 .851 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .965 .914 .847 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .961 .914 .843 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .961 .910 .839 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .957 .910 .835 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .957 .906 .831 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .953 .902 .827 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .953 .902 .824 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .949 .898 .820 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .949 .894 .820 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .945 .894 .812 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .945 .890 .808 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .941 .886 .808 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .941 .882 .804 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .937 .882 .800 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .937 .878 .796 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .933 .875 .792 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .933 .875 .792 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .933 .875 .788 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .929 .871 .784 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .929 .871 .780 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .925 .867 .776 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .925 .863 .773 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .922 .863 .769 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .922 .859 .765 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .918 .855 .765 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .918 .851 .761 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .914 .851 .753 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .914 .847 .753 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .910 .843 .749 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .910 .843 .745 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+70 70 79 39 re S
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 75 79 Tm 0 -9 Td(AntennaField ) Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 97 92 Tm 0 -9 Td(Input) Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .753 .749 .753 rg 0 0 0 RG 1 w 1 J
+133 143 69 49 re f
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+130 140 69 49 re f
+130 140 69 50 re S
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .984 .945 .886 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .984 .941 .882 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .980 .937 .878 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .976 .937 .871 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .976 .933 .867 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .973 .929 .867 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .973 .925 .863 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .969 .925 .855 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .969 .922 .851 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .965 .918 .847 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .961 .914 .843 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .961 .914 .839 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .957 .910 .835 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .957 .906 .831 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .953 .902 .827 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .949 .898 .824 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .949 .894 .820 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .949 .894 .816 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .945 .890 .812 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .941 .886 .808 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .941 .882 .804 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .937 .882 .796 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .937 .882 .796 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .933 .878 .792 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .933 .875 .792 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .929 .875 .784 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .929 .871 .780 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .925 .867 .776 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .925 .863 .773 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .922 .859 .769 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .922 .859 .765 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .918 .855 .761 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .914 .851 .757 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .914 .847 .753 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .910 .843 .749 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .910 .843 .745 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+130 140 69 49 re S
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 137 149 Tm 0 -9 Td(Transpose ) Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 147 162 Tm 0 -9 Td(Sender) Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .753 .749 .753 rg 0 0 0 RG 1 w 1 J
+253 143 69 49 re f
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+250 140 69 49 re f
+250 140 69 50 re S
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .984 .945 .886 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .984 .945 .886 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .984 .941 .882 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .980 .937 .878 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .976 .937 .871 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .976 .933 .867 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .973 .929 .867 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .973 .925 .863 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .969 .925 .855 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .969 .922 .851 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .965 .918 .847 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .961 .914 .843 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .961 .914 .839 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .957 .910 .835 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .957 .906 .831 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .953 .902 .827 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .949 .898 .824 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .949 .894 .820 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .949 .894 .816 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .945 .890 .812 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .941 .886 .808 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .941 .882 .804 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .937 .882 .796 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .933 .878 .792 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .933 .875 .792 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .929 .875 .784 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .929 .871 .780 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .929 .871 .780 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .925 .867 .776 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .925 .863 .773 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .922 .859 .769 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .922 .859 .765 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .918 .855 .761 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .914 .851 .757 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .914 .847 .753 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .910 .843 .749 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .910 .843 .745 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+250 140 69 49 re S
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 257 149 Tm 0 -9 Td(Transpose ) Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 261 162 Tm 0 -9 Td(R) Tj 8 0 Td(e) Tj 6 0 Td(c) Tj 6 0 Td(e) Tj 6 0 Td(i) Tj 3 0 Td(v) Tj 6 0 Td(e) Tj 6 0 Td(r) Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .753 .749 .753 rg 0 0 0 RG 1 w 1 J
+673 73 79 51 re f
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+670 70 79 51 re f
+670 70 79 52 re S
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .984 .945 .886 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .984 .941 .882 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .980 .941 .878 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .980 .937 .875 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .976 .937 .871 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .976 .933 .867 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .973 .929 .863 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .973 .925 .863 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .969 .925 .855 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .969 .922 .855 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .965 .918 .851 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .965 .914 .847 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .961 .914 .843 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .961 .910 .839 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .957 .910 .835 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .957 .906 .831 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .953 .902 .827 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .953 .902 .824 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .949 .898 .820 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .949 .894 .820 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .945 .894 .812 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .945 .890 .808 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .941 .886 .808 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .941 .886 .808 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .941 .882 .804 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .937 .882 .800 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .937 .878 .796 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .933 .875 .792 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .933 .875 .788 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .929 .871 .784 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .929 .871 .780 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .925 .867 .776 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .925 .863 .773 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .922 .863 .769 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .922 .859 .765 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .918 .855 .765 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .918 .851 .761 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .914 .851 .753 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .914 .847 .753 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .910 .843 .749 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .910 .843 .745 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+670 70 79 51 re S
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 673 79 Tm 0 -9 Td(DataWriter) Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+734 75 10 16 re f
+734 75 10 17 re S
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+731 77 6 4 re f
+731 77 6 5 re S
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+731 84 6 4 re f
+731 84 6 5 re S
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .753 .749 .753 rg 0 0 0 RG 1 w 1 J
+373 73 89 49 re f
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+370 70 89 49 re f
+370 70 89 50 re S
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .984 .945 .886 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .984 .945 .882 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .980 .941 .878 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .980 .937 .878 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .976 .937 .871 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .976 .933 .871 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .976 .933 .867 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .973 .929 .863 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .973 .925 .863 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .969 .925 .855 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .969 .922 .855 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .965 .918 .851 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .965 .918 .847 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .965 .914 .847 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .961 .914 .839 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .961 .910 .839 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .957 .906 .835 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .957 .906 .831 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .953 .902 .827 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .953 .902 .824 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .953 .902 .824 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .949 .898 .824 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .949 .894 .820 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .949 .894 .816 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .945 .890 .812 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .945 .890 .808 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .941 .886 .808 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .941 .882 .804 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .937 .882 .800 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .937 .878 .796 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .933 .878 .792 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .933 .875 .788 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .929 .875 .784 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .929 .871 .784 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .929 .867 .780 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .925 .867 .776 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .925 .863 .773 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .922 .863 .769 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .922 .859 .765 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .918 .855 .765 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .918 .855 .761 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .914 .851 .757 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .914 .851 .753 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .910 .847 .749 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .910 .843 .749 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .910 .843 .745 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .910 .843 .745 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+370 70 89 49 re S
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 387 79 Tm 0 -9 Td(C) Tj 8 0 Td(o) Tj 7 0 Td(r) Tj 3 0 Td(r) Tj 3 0 Td(e) Tj 6 0 Td(l) Tj 2 0 Td(a) Tj 6 0 Td(t) Tj 3 0 Td(e) Tj 6 0 Td(d) Tj 7 0 Td( ) Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 374 92 Tm 0 -9 Td(SubbandSender) Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .753 .749 .753 rg 0 0 0 RG 1 w 1 J
+533 73 99 49 re f
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+530 70 99 49 re f
+530 70 99 50 re S
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .984 .945 .886 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .984 .945 .882 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .984 .941 .882 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .980 .937 .878 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .980 .937 .878 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .980 .937 .875 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .976 .937 .871 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .976 .933 .871 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .973 .929 .867 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .973 .929 .863 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .973 .925 .863 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .969 .925 .855 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .969 .922 .855 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .969 .922 .851 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .965 .918 .851 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .965 .914 .847 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .961 .914 .843 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .961 .914 .839 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .957 .910 .835 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .957 .906 .835 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .957 .906 .831 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .953 .906 .827 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .953 .902 .824 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .949 .898 .824 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .949 .898 .820 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .949 .894 .820 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .945 .894 .812 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .945 .890 .812 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .945 .890 .808 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .941 .886 .804 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .941 .886 .804 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .941 .882 .804 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .937 .882 .800 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .937 .882 .796 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .933 .878 .792 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .933 .875 .792 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .933 .875 .788 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .929 .871 .784 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .929 .871 .780 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .929 .867 .780 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .925 .867 .776 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .925 .863 .773 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .922 .863 .769 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .922 .859 .769 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .918 .855 .765 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .918 .855 .761 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .918 .851 .761 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .914 .851 .757 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .914 .847 .753 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .910 .847 .749 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .910 .843 .749 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .910 .843 .745 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+530 70 99 49 re S
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 552 79 Tm 0 -9 Td(C) Tj 8 0 Td(o) Tj 7 0 Td(r) Tj 3 0 Td(r) Tj 3 0 Td(e) Tj 6 0 Td(l) Tj 2 0 Td(a) Tj 6 0 Td(t) Tj 3 0 Td(e) Tj 6 0 Td(d) Tj 7 0 Td( ) Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 534 92 Tm 0 -9 Td(S) Tj 8 0 Td(u) Tj 7 0 Td(b) Tj 7 0 Td(b) Tj 7 0 Td(a) Tj 6 0 Td(n) Tj 7 0 Td(d) Tj 7 0 Td(R) Tj 8 0 Td(e) Tj 5 0 Td(c) Tj 5 0 Td(e) Tj 5 0 Td(i) Tj 2 0 Td(v) Tj 5 0 Td(e) Tj 5 0 Td(r) Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .753 .749 .753 rg 0 0 0 RG 1 w 1 J
+13 282 139 25 re f
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .753 .749 .753 rg 0 0 0 RG 1 w 1 J
+13 263 104 18 re f
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+10 279 m
+150 279 l
+150 305 l
+10 305 l
+10 279 l
+B Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+10 260 m
+115 260 l
+115 279 l
+10 279 l
+10 260 l
+B Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 260 m
+115 260 l
+115 279 l
+10 279 l
+10 260 l
+h S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 15 263 Tm 0 -9 Td(c) Tj 6 0 Td(a) Tj 6 0 Td(s) Tj 6 0 Td(a) Tj 6 0 Td(c) Tj 6 0 Td(o) Tj 7 0 Td(r) Tj 3 0 Td(e) Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .988 .949 .890 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        16 0 0 16 13 284 cm /img1 Do Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F1 10.000000 Tf 0 g 1 0 0 -1 33 284 Tm 0 -9 Td(+ measures) Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .753 .749 .753 rg 0 0 0 RG 1 w 1 J
+253 262 119 20 re f
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .753 .749 .753 rg 0 0 0 RG 1 w 1 J
+253 243 104 18 re f
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+250 259 m
+370 259 l
+370 280 l
+250 280 l
+250 259 l
+B Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+250 240 m
+355 240 l
+355 259 l
+250 259 l
+250 240 l
+B Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+250 240 m
+355 240 l
+355 259 l
+250 259 l
+250 240 l
+h S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 255 243 Tm 0 -9 Td(CUDA) Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .753 .749 .753 rg 0 0 0 RG 1 w 1 J
+123 252 119 20 re f
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .753 .749 .753 rg 0 0 0 RG 1 w 1 J
+123 233 104 18 re f
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+120 249 m
+240 249 l
+240 270 l
+120 270 l
+120 249 l
+B Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+120 230 m
+225 230 l
+225 249 l
+120 249 l
+120 230 l
+B Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+120 230 m
+225 230 l
+225 249 l
+120 249 l
+120 230 l
+h S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 125 233 Tm 0 -9 Td(O) Tj 8 0 Td(p) Tj 7 0 Td(e) Tj 5 0 Td(n) Tj 7 0 Td(M) Tj 9 0 Td(P) Tj 7 0 Td(I) Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+0 0 m 0 3 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+0 7 m 0 10 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+0 14 m 0 17 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+0 21 m 0 24 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+0 28 m 0 31 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+0 35 m 0 38 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+0 42 m 0 45 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+0 49 m 0 52 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+0 56 m 0 59 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+0 63 m 0 66 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+0 70 m 0 73 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+0 77 m 0 80 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+0 84 m 0 87 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+0 91 m 0 94 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+0 98 m 0 101 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+0 105 m 0 108 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+0 112 m 0 115 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+0 119 m 0 122 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+0 126 m 0 129 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+0 133 m 0 136 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+0 140 m 0 143 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+0 147 m 0 150 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+0 154 m 0 157 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+0 161 m 0 164 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+0 168 m 0 171 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+0 175 m 0 178 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+0 182 m 0 185 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+0 189 m 0 192 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+0 196 m 0 199 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+0 203 m 0 206 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+0 210 m 0 213 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+0 217 m 0 220 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+0 224 m 0 227 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+0 231 m 0 234 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+0 238 m 0 241 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+0 245 m 0 248 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+0 252 m 0 255 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+0 259 m 0 262 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+0 266 m 0 269 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+0 273 m 0 276 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+0 280 m 0 283 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+0 287 m 0 290 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+0 294 m 0 297 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+0 301 m 0 304 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+0 308 m 0 311 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+0 315 m 0 318 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+2 320 m 5 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+9 320 m 12 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+16 320 m 19 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+23 320 m 26 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+30 320 m 33 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+37 320 m 40 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+44 320 m 47 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+51 320 m 54 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+58 320 m 61 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+65 320 m 68 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+72 320 m 75 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+79 320 m 82 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+86 320 m 89 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+93 320 m 96 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+100 320 m 103 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+107 320 m 110 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+114 320 m 117 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+121 320 m 124 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+128 320 m 131 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+135 320 m 138 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+142 320 m 145 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+149 320 m 152 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+156 320 m 159 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+163 320 m 166 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+170 320 m 173 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+177 320 m 180 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+184 320 m 187 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+191 320 m 194 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+198 320 m 201 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+205 320 m 208 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+212 320 m 215 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+219 320 m 222 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+226 320 m 229 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+233 320 m 236 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+240 320 m 243 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+247 320 m 250 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+254 320 m 257 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+261 320 m 264 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+268 320 m 271 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+275 320 m 278 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+282 320 m 285 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+289 320 m 292 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+296 320 m 299 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+303 320 m 306 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+310 320 m 313 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+317 320 m 320 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+324 320 m 327 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+331 320 m 334 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+338 320 m 341 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+345 320 m 348 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+352 320 m 355 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+359 320 m 362 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+366 320 m 369 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+373 320 m 376 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+380 320 m 383 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+387 320 m 390 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+394 320 m 397 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+401 320 m 404 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+408 320 m 411 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+415 320 m 418 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+422 320 m 425 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+429 320 m 432 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+436 320 m 439 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+443 320 m 446 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+450 320 m 453 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+457 320 m 460 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+464 320 m 467 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+471 320 m 474 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+478 320 m 481 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+485 320 m 488 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+490 318 m 490 315 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+490 311 m 490 308 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+490 304 m 490 301 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+490 297 m 490 294 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+490 290 m 490 287 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+490 283 m 490 280 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+490 276 m 490 273 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+490 269 m 490 266 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+490 262 m 490 259 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+490 255 m 490 252 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+490 248 m 490 245 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+490 241 m 490 238 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+490 234 m 490 231 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+490 227 m 490 224 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+490 220 m 490 217 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+490 213 m 490 210 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+490 206 m 490 203 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+490 199 m 490 196 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+490 192 m 490 189 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+490 185 m 490 182 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+490 178 m 490 175 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+490 171 m 490 168 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+490 164 m 490 161 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+490 157 m 490 154 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+490 150 m 490 147 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+490 143 m 490 140 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+490 136 m 490 133 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+490 129 m 490 126 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+490 122 m 490 119 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+490 115 m 490 112 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+490 108 m 490 105 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+490 101 m 490 98 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+490 94 m 490 91 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+490 87 m 490 84 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+490 80 m 490 77 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+490 73 m 490 70 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+490 66 m 490 63 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+490 59 m 490 56 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+490 52 m 490 49 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+490 45 m 490 42 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+490 38 m 490 35 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+490 31 m 490 28 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+490 24 m 490 21 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+490 17 m 490 14 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+490 10 m 490 7 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+490 3 m 490 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+486 0 m 483 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+479 0 m 476 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+472 0 m 469 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+465 0 m 462 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+458 0 m 455 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+451 0 m 448 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+444 0 m 441 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+437 0 m 434 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+430 0 m 427 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+423 0 m 420 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+416 0 m 413 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+409 0 m 406 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+402 0 m 399 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+395 0 m 392 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+388 0 m 385 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+381 0 m 378 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+374 0 m 371 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+367 0 m 364 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+360 0 m 357 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+353 0 m 350 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+346 0 m 343 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+339 0 m 336 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+332 0 m 329 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+325 0 m 322 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+318 0 m 315 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+311 0 m 308 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+304 0 m 301 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+297 0 m 294 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+290 0 m 287 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+283 0 m 280 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+276 0 m 273 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+269 0 m 266 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+262 0 m 259 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+255 0 m 252 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+248 0 m 245 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+241 0 m 238 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+234 0 m 231 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+227 0 m 224 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+220 0 m 217 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+213 0 m 210 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+206 0 m 203 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+199 0 m 196 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+192 0 m 189 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+185 0 m 182 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+178 0 m 175 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+171 0 m 168 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+164 0 m 161 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+157 0 m 154 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+150 0 m 147 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+143 0 m 140 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+136 0 m 133 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+129 0 m 126 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+122 0 m 119 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+115 0 m 112 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+108 0 m 105 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+101 0 m 98 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+94 0 m 91 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+87 0 m 84 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+80 0 m 77 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+73 0 m 70 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+66 0 m 63 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+59 0 m 56 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+52 0 m 49 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+45 0 m 42 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+38 0 m 35 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+31 0 m 28 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+24 0 m 21 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+17 0 m 14 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 0 m 7 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+3 0 m 0 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F1 10.000000 Tf 0 g 1 0 0 -1 174 4 Tm 0 -9 Td(G) Tj 8 0 Td(P) Tj 7 0 Td(U) Tj 8 0 Td( ) Tj 3 0 Td(N) Tj 8 0 Td(o) Tj 6 0 Td(d) Tj 6 0 Td(e) Tj 6 0 Td(s) Tj 5 0 Td(:) Tj 2 0 Td( ) Tj 3 0 Td(8) Tj 6 0 Td( ) Tj 3 0 Td(+) Tj 6 0 Td( ) Tj 3 0 Td(2) Tj 6 0 Td( ) Tj 3 0 Td(t) Tj 2 0 Td(e) Tj 6 0 Td(s) Tj 5 0 Td(t) Tj 2 0 Td( ) Tj 3 0 Td(&) Tj 7 0 Td( ) Tj 3 0 Td(s) Tj 5 0 Td(p) Tj 6 0 Td(a) Tj 6 0 Td(r) Tj 3 0 Td(e) Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+510 0 m 510 3 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+510 7 m 510 10 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+510 14 m 510 17 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+510 21 m 510 24 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+510 28 m 510 31 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+510 35 m 510 38 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+510 42 m 510 45 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+510 49 m 510 52 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+510 56 m 510 59 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+510 63 m 510 66 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+510 70 m 510 73 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+510 77 m 510 80 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+510 84 m 510 87 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+510 91 m 510 94 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+510 98 m 510 101 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+510 105 m 510 108 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+510 112 m 510 115 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+510 119 m 510 122 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+510 126 m 510 129 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+510 133 m 510 136 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+510 140 m 510 143 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+510 147 m 510 150 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+510 154 m 510 157 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+510 161 m 510 164 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+510 168 m 510 171 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+510 175 m 510 178 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+510 182 m 510 185 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+510 189 m 510 192 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+510 196 m 510 199 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+510 203 m 510 206 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+510 210 m 510 213 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+510 217 m 510 220 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+510 224 m 510 227 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+510 231 m 510 234 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+510 238 m 510 241 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+510 245 m 510 248 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+510 252 m 510 255 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+510 259 m 510 262 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+510 266 m 510 269 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+510 273 m 510 276 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+510 280 m 510 283 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+510 287 m 510 290 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+510 294 m 510 297 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+510 301 m 510 304 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+510 308 m 510 311 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+510 315 m 510 318 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+512 320 m 515 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+519 320 m 522 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+526 320 m 529 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+533 320 m 536 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+540 320 m 543 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+547 320 m 550 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+554 320 m 557 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+561 320 m 564 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+568 320 m 571 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+575 320 m 578 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+582 320 m 585 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+589 320 m 592 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+596 320 m 599 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+603 320 m 606 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+610 320 m 613 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+617 320 m 620 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+624 320 m 627 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+631 320 m 634 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+638 320 m 641 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+645 320 m 648 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+652 320 m 655 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+659 320 m 662 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+666 320 m 669 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+673 320 m 676 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+680 320 m 683 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+687 320 m 690 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+694 320 m 697 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+701 320 m 704 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+708 320 m 711 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+715 320 m 718 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+722 320 m 725 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+729 320 m 732 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+736 320 m 739 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+743 320 m 746 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+750 320 m 753 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+757 320 m 760 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+764 320 m 767 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+771 320 m 774 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+778 320 m 781 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+785 320 m 788 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 318 m 790 315 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 311 m 790 308 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 304 m 790 301 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 297 m 790 294 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 290 m 790 287 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 283 m 790 280 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 276 m 790 273 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 269 m 790 266 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 262 m 790 259 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 255 m 790 252 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 248 m 790 245 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 241 m 790 238 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 234 m 790 231 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 227 m 790 224 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 220 m 790 217 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 213 m 790 210 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 206 m 790 203 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 199 m 790 196 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 192 m 790 189 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 185 m 790 182 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 178 m 790 175 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 171 m 790 168 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 164 m 790 161 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 157 m 790 154 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 150 m 790 147 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 143 m 790 140 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 136 m 790 133 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 129 m 790 126 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 122 m 790 119 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 115 m 790 112 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 108 m 790 105 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 101 m 790 98 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 94 m 790 91 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 87 m 790 84 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 80 m 790 77 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 73 m 790 70 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 66 m 790 63 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 59 m 790 56 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 52 m 790 49 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 45 m 790 42 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 38 m 790 35 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 31 m 790 28 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 24 m 790 21 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 17 m 790 14 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 10 m 790 7 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 3 m 790 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+786 0 m 783 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+779 0 m 776 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+772 0 m 769 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+765 0 m 762 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+758 0 m 755 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+751 0 m 748 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+744 0 m 741 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+737 0 m 734 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+730 0 m 727 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+723 0 m 720 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+716 0 m 713 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+709 0 m 706 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+702 0 m 699 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+695 0 m 692 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+688 0 m 685 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+681 0 m 678 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+674 0 m 671 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+667 0 m 664 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+660 0 m 657 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+653 0 m 650 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+646 0 m 643 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+639 0 m 636 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+632 0 m 629 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+625 0 m 622 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+618 0 m 615 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+611 0 m 608 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+604 0 m 601 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+597 0 m 594 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+590 0 m 587 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+583 0 m 580 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+576 0 m 573 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+569 0 m 566 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+562 0 m 559 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+555 0 m 552 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+548 0 m 545 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+541 0 m 538 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+534 0 m 531 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+527 0 m 524 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+520 0 m 517 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+513 0 m 510 0 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F1 10.000000 Tf 0 g 1 0 0 -1 534 4 Tm 0 -9 Td(S) Tj 8 0 Td(t) Tj 3 0 Td(o) Tj 6 0 Td(r) Tj 3 0 Td(a) Tj 6 0 Td(g) Tj 6 0 Td(e) Tj 6 0 Td( ) Tj 3 0 Td(&) Tj 7 0 Td( ) Tj 3 0 Td(P) Tj 7 0 Td(r) Tj 3 0 Td(o) Tj 6 0 Td(c) Tj 5 0 Td(e) Tj 6 0 Td(s) Tj 5 0 Td(s) Tj 5 0 Td(i) Tj 2 0 Td(n) Tj 6 0 Td(g) Tj 6 0 Td( ) Tj 3 0 Td(C) Tj 8 0 Td(l) Tj 2 0 Td(u) Tj 6 0 Td(s) Tj 5 0 Td(t) Tj 2 0 Td(e) Tj 6 0 Td(r) Tj 3 0 Td(:) Tj 2 0 Td( ) Tj 3 0 Td(~) Tj 6 0 Td(1) Tj 6 0 Td(0) Tj 6 0 Td(0) Tj 6 0 Td( ) Tj 3 0 Td(n) Tj 6 0 Td(o) Tj 6 0 Td(d) Tj 6 0 Td(e) Tj 6 0 Td(s) Tj 5 0 Td(,) Tj 2 0 Td( ) Tj 3 0 Td(~) Tj 6 0 Td(2) Tj 6 0 Td( ) Tj 3 0 Td(P) Tj 7 0 Td(B) Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .753 .749 .753 rg 0 0 0 RG 1 w 1 J
+373 252 216 60 re f
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .753 .749 .753 rg 0 0 0 RG 1 w 1 J
+373 233 138 18 re f
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+370 249 m
+587 249 l
+587 310 l
+370 310 l
+370 249 l
+B Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+370 230 m
+509 230 l
+509 249 l
+370 249 l
+370 230 l
+B Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+370 230 m
+509 230 l
+509 249 l
+370 249 l
+370 230 l
+h S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 375 233 Tm 0 -9 Td( ) Tj 3 0 Td( ) Tj 3 0 Td( ) Tj 3 0 Td( ) Tj 3 0 Td( ) Tj 3 0 Td( ) Tj 3 0 Td( ) Tj 3 0 Td( ) Tj 3 0 Td( ) Tj 3 0 Td( ) Tj 3 0 Td( ) Tj 3 0 Td( ) Tj 3 0 Td( ) Tj 3 0 Td( ) Tj 3 0 Td( ) Tj 3 0 Td( ) Tj 3 0 Td( ) Tj 3 0 Td( ) Tj 3 0 Td( ) Tj 3 0 Td( ) Tj 3 0 Td( ) Tj 3 0 Td( ) Tj 3 0 Td( ) Tj 3 0 Td( ) Tj 3 0 Td( ) Tj 3 0 Td( ) Tj 3 0 Td( ) Tj 3 0 Td( ) Tj 3 0 Td( ) Tj 3 0 Td(L) Tj 7 0 Td(O) Tj 8 0 Td(F) Tj 7 0 Td(A) Tj 8 0 Td(R) Tj 8 0 Td(:) Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .988 .949 .890 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        16 0 0 16 373 254 cm /img3 Do Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F1 10.000000 Tf 0 g 1 0 0 -1 393 254 Tm 0 -9 Td(+) Tj 6 0 Td( ) Tj 3 0 Td(O) Tj 9 0 Td(b) Tj 6 0 Td(s) Tj 6 0 Td(e) Tj 6 0 Td(r) Tj 3 0 Td(v) Tj 5 0 Td(a) Tj 6 0 Td(t) Tj 2 0 Td(i) Tj 2 0 Td(o) Tj 6 0 Td(n) Tj 6 0 Td(S) Tj 7 0 Td(e) Tj 6 0 Td(t) Tj 2 0 Td(t) Tj 2 0 Td(i) Tj 2 0 Td(n) Tj 6 0 Td(g) Tj 6 0 Td(s) Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .988 .949 .890 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        16 0 0 16 373 270 cm /img1 Do Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F1 10.000000 Tf 0 g 1 0 0 -1 393 270 Tm 0 -9 Td(+) Tj 6 0 Td( ) Tj 3 0 Td(S) Tj 8 0 Td(y) Tj 5 0 Td(s) Tj 5 0 Td(t) Tj 2 0 Td(e) Tj 6 0 Td(m) Tj 9 0 Td(T) Tj 7 0 Td(o) Tj 6 0 Td(o) Tj 6 0 Td(l) Tj 2 0 Td(s) Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .988 .949 .890 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        16 0 0 16 373 286 cm /img5 Do Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F3 10.000000 Tf 0 g 1 0 0 -1 393 286 Tm 0 -9 Td(+) Tj 6 0 Td( ) Tj 3 0 Td(A) Tj 8 0 Td(n) Tj 6 0 Td(t) Tj 3 0 Td(e) Tj 6 0 Td(n) Tj 6 0 Td(n) Tj 6 0 Td(a) Tj 6 0 Td(H) Tj 8 0 Td(e) Tj 6 0 Td(a) Tj 6 0 Td(l) Tj 2 0 Td(t) Tj 2 0 Td(h) Tj 6 0 Td(I) Tj 2 0 Td(n) Tj 6 0 Td(f) Tj 2 0 Td(o) Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .753 .749 .753 rg 0 0 0 RG 1 w 1 J
+503 252 139 60 re f
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .753 .749 .753 rg 0 0 0 RG 1 w 1 J
+503 233 104 18 re f
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+500 249 m
+640 249 l
+640 310 l
+500 310 l
+500 249 l
+B Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+500 230 m
+605 230 l
+605 249 l
+500 249 l
+500 230 l
+B Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+500 230 m
+605 230 l
+605 249 l
+500 249 l
+500 230 l
+h S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 505 233 Tm 0 -9 Td(:Common) Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .988 .949 .890 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        16 0 0 16 503 254 cm /img5 Do Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F3 10.000000 Tf 0 g 1 0 0 -1 523 254 Tm 0 -9 Td(+) Tj 6 0 Td( ) Tj 3 0 Td(L) Tj 6 0 Td(o) Tj 6 0 Td(g) Tj 6 0 Td(g) Tj 6 0 Td(i) Tj 2 0 Td(n) Tj 6 0 Td(g) Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .988 .949 .890 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        16 0 0 16 503 270 cm /img5 Do Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F3 10.000000 Tf 0 g 1 0 0 -1 523 270 Tm 0 -9 Td(+) Tj 6 0 Td( ) Tj 3 0 Td(M) Tj 9 0 Td(o) Tj 6 0 Td(n) Tj 6 0 Td(i) Tj 2 0 Td(t) Tj 3 0 Td(o) Tj 6 0 Td(r) Tj 3 0 Td(i) Tj 2 0 Td(n) Tj 6 0 Td(g) Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .988 .949 .890 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        16 0 0 16 503 286 cm /img5 Do Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F3 10.000000 Tf 0 g 1 0 0 -1 523 286 Tm 0 -9 Td(+) Tj 6 0 Td( ) Tj 3 0 Td(O) Tj 9 0 Td(b) Tj 6 0 Td(s) Tj 5 0 Td(e) Tj 6 0 Td(r) Tj 3 0 Td(v) Tj 5 0 Td(a) Tj 6 0 Td(t) Tj 3 0 Td(i) Tj 2 0 Td(o) Tj 6 0 Td(n) Tj 6 0 Td(F) Tj 7 0 Td(e) Tj 6 0 Td(e) Tj 6 0 Td(d) Tj 6 0 Td(b) Tj 6 0 Td(a) Tj 6 0 Td(c) Tj 5 0 Td(k) Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .753 .749 .753 rg 0 0 0 RG 1 w 1 J
+633 242 150 25 re f
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .753 .749 .753 rg 0 0 0 RG 1 w 1 J
+633 223 104 18 re f
+Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+630 239 m
+781 239 l
+781 265 l
+630 265 l
+630 239 l
+B Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+630 220 m
+735 220 l
+735 239 l
+630 239 l
+630 220 l
+B Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+630 220 m
+735 220 l
+735 239 l
+630 239 l
+630 220 l
+h S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 635 223 Tm 0 -9 Td(c) Tj 6 0 Td(a) Tj 6 0 Td(s) Tj 6 0 Td(a) Tj 6 0 Td(c) Tj 6 0 Td(o) Tj 7 0 Td(r) Tj 3 0 Td(e) Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 0 0 cm .988 .949 .890 rg 0 0 -1 1 re f Q
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        16 0 0 16 633 244 cm /img1 Do Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F1 10.000000 Tf 0 g 1 0 0 -1 653 244 Tm 0 -9 Td(+) Tj 6 0 Td( ) Tj 3 0 Td(m) Tj 9 0 Td(s) Tj 5 0 Td( ) Tj 3 0 Td(\() Tj 3 0 Td(M) Tj 9 0 Td(e) Tj 6 0 Td(a) Tj 6 0 Td(s) Tj 5 0 Td(u) Tj 6 0 Td(r) Tj 3 0 Td(e) Tj 6 0 Td(m) Tj 9 0 Td(e) Tj 6 0 Td(n) Tj 6 0 Td(t) Tj 2 0 Td(S) Tj 7 0 Td(e) Tj 6 0 Td(t) Tj 2 0 Td(\)) Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+139 140 m 139 133 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+139 129 m 139 122 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+139 118 m 139 111 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+139 140 m 134 125 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+139 140 m 144 125 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 100 117 cm .988 .949 .890 rg 0 0 32 -11 re f Q
+        BT /F1 10.000000 Tf 0 g 1 0 0 -1 100 117 Tm 0 -9 Td(«) Tj 6 0 Td(f) Tj 3 0 Td(l) Tj 2 0 Td(o) Tj 6 0 Td(w) Tj 8 0 Td(») Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+62 260 m 62 253 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+62 249 m 62 242 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+62 238 m 62 231 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+62 227 m 62 220 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+62 216 m 62 209 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+62 205 m 62 198 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+62 194 m 62 190 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+62 260 m 57 245 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+62 260 m 67 245 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+225 230 m 232 223 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+236 219 m 243 212 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+247 208 m 254 201 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+258 197 m 265 190 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+225 230 m 232 216 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+225 230 m 239 223 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+292 122 m 292 129 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+292 133 m 292 140 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+292 122 m 297 137 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+292 122 m 287 137 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 253 125 cm .988 .949 .890 rg 0 0 32 -11 re f Q
+        BT /F1 10.000000 Tf 0 g 1 0 0 -1 253 125 Tm 0 -9 Td(«) Tj 6 0 Td(f) Tj 3 0 Td(l) Tj 2 0 Td(o) Tj 6 0 Td(w) Tj 8 0 Td(») Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+250 165 m 243 165 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+239 165 m 232 165 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+228 165 m 221 165 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+217 165 m 210 165 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+206 165 m 200 165 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+250 165 m 235 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+250 165 m 235 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 205 143 cm .988 .949 .890 rg 0 0 32 -11 re f Q
+        BT /F1 10.000000 Tf 0 g 1 0 0 -1 205 143 Tm 0 -9 Td(«) Tj 6 0 Td(f) Tj 3 0 Td(l) Tj 2 0 Td(o) Tj 6 0 Td(w) Tj 8 0 Td(») Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+500 230 m 500 223 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+500 219 m 500 212 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+500 230 m 495 215 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+500 230 m 505 215 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+540 185 m 533 183 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+529 181 m 522 178 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+518 177 m 511 174 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+507 173 m 500 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+496 168 m 489 166 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+485 164 m 478 161 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+474 160 m 467 157 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+463 156 m 456 153 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+452 151 m 450 150 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+540 185 m 524 184 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+540 185 m 528 175 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 468 129 cm .988 .949 .890 rg 0 0 46 -11 re f Q
+        BT /F1 10.000000 Tf 0 g 1 0 0 -1 468 129 Tm 0 -9 Td(transpose) Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 468 142 cm .988 .949 .890 rg 0 0 53 -11 re f Q
+        BT /F1 10.000000 Tf 0 g 1 0 0 -1 468 142 Tm 0 -9 Td(b) Tj 6 0 Td(e) Tj 6 0 Td(a) Tj 6 0 Td(m) Tj 9 0 Td( ) Tj 3 0 Td(d) Tj 6 0 Td(a) Tj 6 0 Td(t) Tj 2 0 Td(a) Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 453 184 cm .988 .949 .890 rg 0 0 32 -11 re f Q
+        BT /F1 10.000000 Tf 0 g 1 0 0 -1 453 184 Tm 0 -9 Td(«) Tj 6 0 Td(f) Tj 3 0 Td(l) Tj 2 0 Td(o) Tj 6 0 Td(w) Tj 8 0 Td(») Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+540 151 m 533 153 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+529 155 m 522 157 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+518 159 m 511 161 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+507 163 m 500 166 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+496 167 m 489 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+485 171 m 478 174 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+474 175 m 467 178 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+463 180 m 456 182 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+452 184 m 450 185 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+540 151 m 528 161 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+540 151 m 524 152 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 494 180 cm .988 .949 .890 rg 0 0 32 -11 re f Q
+        BT /F1 10.000000 Tf 0 g 1 0 0 -1 494 180 Tm 0 -9 Td(«) Tj 6 0 Td(f) Tj 3 0 Td(l) Tj 2 0 Td(o) Tj 6 0 Td(w) Tj 8 0 Td(») Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+175 230 m 175 223 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+175 219 m 175 212 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+175 208 m 175 201 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+175 197 m 175 190 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+175 230 m 170 215 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+175 230 m 180 215 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+370 91 m 363 91 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+359 91 m 352 91 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+348 91 m 341 91 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+337 91 m 330 91 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+370 91 m 355 96 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+370 91 m 355 86 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 336 70 cm .988 .949 .890 rg 0 0 32 -11 re f Q
+        BT /F1 10.000000 Tf 0 g 1 0 0 -1 336 70 Tm 0 -9 Td(«) Tj 6 0 Td(f) Tj 3 0 Td(l) Tj 2 0 Td(o) Tj 6 0 Td(w) Tj 8 0 Td(») Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+670 95 m 663 95 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+659 95 m 652 95 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+648 95 m 641 95 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+637 95 m 630 95 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+670 95 m 655 100 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+670 95 m 655 90 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 634 76 cm .988 .949 .890 rg 0 0 32 -11 re f Q
+        BT /F1 10.000000 Tf 0 g 1 0 0 -1 634 76 Tm 0 -9 Td(«) Tj 6 0 Td(f) Tj 3 0 Td(l) Tj 2 0 Td(o) Tj 6 0 Td(w) Tj 8 0 Td(») Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+370 145 m 363 140 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+359 138 m 352 132 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+348 130 m 341 124 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+337 122 m 330 116 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+370 145 m 355 140 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+370 145 m 361 132 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 338 110 cm .988 .949 .890 rg 0 0 32 -11 re f Q
+        BT /F1 10.000000 Tf 0 g 1 0 0 -1 338 110 Tm 0 -9 Td(«) Tj 6 0 Td(f) Tj 3 0 Td(l) Tj 2 0 Td(o) Tj 6 0 Td(w) Tj 8 0 Td(») Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+530 94 m 523 94 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+519 94 m 512 94 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+508 94 m 501 94 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+497 94 m 490 94 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+486 94 m 479 94 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+475 94 m 468 94 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+464 94 m 460 94 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+530 94 m 515 99 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+530 94 m 515 89 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 465 74 cm .988 .949 .890 rg 0 0 67 -11 re f Q
+        BT /F1 10.000000 Tf 0 g 1 0 0 -1 465 74 Tm 0 -9 Td(s) Tj 6 0 Td(u) Tj 6 0 Td(b) Tj 6 0 Td(b) Tj 6 0 Td(a) Tj 6 0 Td(n) Tj 6 0 Td(d) Tj 6 0 Td( ) Tj 3 0 Td(d) Tj 6 0 Td(a) Tj 6 0 Td(t) Tj 2 0 Td(a) Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 484 98 cm .988 .949 .890 rg 0 0 32 -11 re f Q
+        BT /F1 10.000000 Tf 0 g 1 0 0 -1 484 98 Tm 0 -9 Td(«) Tj 6 0 Td(f) Tj 3 0 Td(l) Tj 2 0 Td(o) Tj 6 0 Td(w) Tj 8 0 Td(») Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+679 220 m 679 213 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+679 209 m 679 202 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+679 198 m 679 191 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+679 187 m 679 180 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+679 176 m 679 169 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+679 165 m 679 158 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+679 154 m 679 147 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+679 143 m 679 136 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+679 132 m 679 125 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+679 220 m 674 205 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+679 220 m 684 205 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+696 270 m 696 263 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+696 259 m 696 252 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+696 248 m 696 241 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+696 237 m 696 230 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+696 226 m 696 219 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+696 215 m 696 208 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+696 204 m 696 197 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+696 193 m 696 186 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+696 182 m 696 175 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+696 171 m 696 164 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+696 160 m 696 153 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+696 149 m 696 142 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+696 138 m 696 131 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+696 127 m 696 122 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+696 270 m 691 255 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+696 270 m 701 255 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+130 165 m 123 165 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+119 165 m 112 165 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+108 165 m 101 165 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+130 165 m 115 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+130 165 m 115 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+326 240 m 326 233 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+326 229 m 326 222 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+326 218 m 326 211 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+326 207 m 326 200 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+326 196 m 326 189 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+326 185 m 326 178 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+326 174 m 326 167 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+326 163 m 326 156 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+326 152 m 326 145 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+326 141 m 326 134 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+326 130 m 326 123 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+326 240 m 321 225 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+326 240 m 331 225 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+70 90 m 63 90 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+59 90 m 52 90 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+48 90 m 41 90 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+37 90 m 30 90 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+70 90 m 55 95 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+70 90 m 55 85 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 31 70 cm .988 .949 .890 rg 0 0 32 -11 re f Q
+        BT /F1 10.000000 Tf 0 g 1 0 0 -1 31 70 Tm 0 -9 Td(«) Tj 6 0 Td(f) Tj 3 0 Td(l) Tj 2 0 Td(o) Tj 6 0 Td(w) Tj 8 0 Td(») Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+755 151 m 751 144 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+749 140 m 745 133 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+743 129 m 738 122 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+755 151 m 743 141 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+755 151 m 752 136 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 708 129 cm .988 .949 .890 rg 0 0 32 -11 re f Q
+        BT /F1 10.000000 Tf 0 g 1 0 0 -1 708 129 Tm 0 -9 Td(«) Tj 6 0 Td(f) Tj 3 0 Td(l) Tj 2 0 Td(o) Tj 6 0 Td(w) Tj 8 0 Td(») Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+670 115 m 663 120 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+659 123 m 652 129 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+648 132 m 641 138 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+637 141 m 630 147 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+670 115 m 661 128 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+670 115 m 655 120 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 637 144 cm .988 .949 .890 rg 0 0 32 -11 re f Q
+        BT /F1 10.000000 Tf 0 g 1 0 0 -1 637 144 Tm 0 -9 Td(«) Tj 6 0 Td(f) Tj 3 0 Td(l) Tj 2 0 Td(o) Tj 6 0 Td(w) Tj 8 0 Td(») Tj ET Q
+        Q
+        Q
+
+endstream
+endobj
+5 0 obj
+  <<
+    /Type/Page
+    /Parent 3 0 R
+    /Resources 2 0 R
+    /MediaBox [0 0 571 819]
+    /Contents 4 0 R
+    /Group << /S /Transparency /CS /DeviceRGB /I false /K false >>
+  >>
+endobj
+6 0 obj
+  [ 750 750 278 333 474 556 556 889 722 238 333 333 389 584 278 333 278 278 556 556 556 556 556 556 556 556 556 556 333 333 584 
+  584 584 611 975 722 722 722 722 667 611 778 722 278 556 722 611 833 722 778 667 778 722 667 611 722 667 944 667 667 611 
+  333 278 333 584 556 333 556 611 556 611 556 333 611 611 278 278 556 278 889 611 611 611 611 389 556 333 611 556 778 556 
+  556 500 389 280 389 584 750 556 750 278 556 500 1000 556 556 333 1000 667 333 1000 750 611 750 750 278 278 500 500 350 556 
+  1000 333 1000 556 333 944 750 500 667 278 333 556 556 556 556 280 556 333 737 370 556 584 333 737 552 400 549 333 333 333 
+  576 556 333 333 333 365 556 834 834 834 611 722 722 722 722 722 722 1000 722 667 667 667 667 278 278 278 278 722 722 778 
+  778 778 778 778 584 778 722 722 722 722 667 667 611 556 556 556 556 556 556 889 556 556 556 556 556 278 278 278 278 611 
+  611 611 611 611 611 611 549 611 611 611 611 611 556 611 556 ] 
+endobj
+7 0 obj
+  <<
+    /Type/FontDescriptor
+    /FontName/Arial,Bold
+    /Ascent 905/CapHeight 905/Descent -212
+    /Flags 32
+    /FontBBox [0 -212 1000 905]
+    /ItalicAngle 0/StemV 0
+  >>
+endobj
+8 0 obj
+  <<
+    /Type/Font/Subtype/TrueType/BaseFont/Arial,Bold/Encoding/WinAnsiEncoding
+    /FirstChar 30/LastChar 255
+    /Widths 6 0 R
+    /FontDescriptor 7 0 R
+  >>
+endobj
+9 0 obj
+  [ 750 750 278 278 355 556 556 889 667 191 333 333 389 584 278 333 278 278 556 556 556 556 556 556 556 556 556 556 278 278 584 
+  584 584 556 1015 667 667 722 722 667 611 778 722 278 500 667 556 833 722 778 667 778 722 667 611 722 667 944 667 667 611 
+  278 278 278 469 556 333 556 556 500 556 556 278 556 556 222 222 500 222 833 556 556 556 556 333 500 278 556 500 722 500 
+  500 500 334 260 334 584 750 556 750 222 556 333 1000 556 556 333 1000 667 333 1000 750 611 750 750 222 222 333 333 350 556 
+  1000 333 1000 500 333 944 750 500 667 278 333 556 556 556 556 260 556 333 737 370 556 584 333 737 552 400 549 333 333 333 
+  576 537 333 333 333 365 556 834 834 834 611 667 667 667 667 667 667 1000 722 667 667 667 667 278 278 278 278 722 722 778 
+  778 778 778 778 584 778 722 722 722 722 667 667 611 556 556 556 556 556 556 889 500 556 556 556 556 278 278 278 278 556 
+  556 556 556 556 556 556 549 611 556 556 556 556 500 556 500 ] 
+endobj
+10 0 obj
+  <<
+    /Type/FontDescriptor
+    /FontName/Arial
+    /Ascent 905/CapHeight 905/Descent -212
+    /Flags 32
+    /FontBBox [0 -212 1015 905]
+    /ItalicAngle 0/StemV 0
+  >>
+endobj
+11 0 obj
+  <<
+    /Type/Font/Subtype/TrueType/BaseFont/Arial/Encoding/WinAnsiEncoding
+    /FirstChar 30/LastChar 255
+    /Widths 9 0 R
+    /FontDescriptor 10 0 R
+  >>
+endobj
+12 0 obj
+  <</Filter /FlateDecode /Length 15861 /Length1 23472>>
+  stream
+xœc`d``à``àø0!#51E¤êI>PdPÔ,(pIÒH¨â
+P•JnbEÁ<Ž" Ž@]
+Ée%
+ýÏ;^000J00°E¥üý¥±‘½„ûyzNeÚ‹R
[á -9¹%!×ù'dÒ
+Òs'\9ìÄÀü¨ç`N~rbÐ9Ñ+€®â�¹íñõ®Î•ñü6_9¤9@Ò‹«k”]šRcøkýßtŽ@/€~ùè ìþù180üZÿ«
+è;/A&ƒLzX€äoF¦­6§Ø˜ô"Xö³¾a`e`bÝÅ 	ÄR¬Ë$YÔ€þûÿˆ_€è™ÿ_€äA4Ó+ w€0Èi+Ö2f2¬eØÏpˆñP×z†[N0ˆ3¸0Ìa¨a˜ÂÐÎÀÆédbÚäÂ0…Qòÿ}†…Ì@|¨6œ¡Žaƒ£Äÿ—õ­Ì—ºZx”òz}þ—2Ä0Ügif0gðaÈc(`løñ¿ïÿ¤ÿK–2ìd>ñÿ/7ƒC2C2ÃÙÿïXoü¿Ã Ô1•a&Ã}ÆIœ[€¶4�UÎe(b˜ÅËÂø?ýÿ/ ʁn`aðe8Ëx€Ihz*ÃsF	Æfg )‹ÿoøèN†X††Y»MÝ™Ycþûþ?Ë ´£hêL†MÛ¶Ãe/Ã-FÖÿ—üÿÀ É ÃàÉPÏ°…áãæÿÙ300°2H0h2Xeòö1g¸À¨Ìx)Ÿ•‡ÕˆÕµêÿC†P k—u>cüÎTÇTÇTÏ|ŒÅí¿C+ÃD†ý‡Ž2<d”bÔgôgcÒdÊgšÇ\ÄÀ´ÑÁ!…!“¡“aÐô{ŒÚŒÛ˜x˜Î3/fYÍò›Mö߃ÿ|lj³æ2däe”`T`,flb¼Æø˜É™)ži6Ó#æ),+Y.±'2È0Ä1ä2ô2¬føÎ(ÄhÁÈ͘ÁXÃØÎ8‘q&ãYÆŒ/˜™B˜²™Þ3g02ïeqbqb	f)fifmcíf{ñ/âß‘ÿ}ÿoô¿!¡†¡èú©ó€a²“á<ÃM†›÷1²2r3ò1ò]¢ÈÊXÍXÍXÇØ˸ˆqãJÆ-@[.0>b|Éø‰ñ+ão&&&6&i&E&%&%&e¦"¦r¦)Ls˜Î3gºÀô†é'³8³³6³)³
s$s>ÐUí̘'0oe~È"Åržå?««ë4Öù¬+XW³býÀÆÃÞÄÁÀqæÏâ¿Zïýcø×ñoÚ¿Mÿ¶üÈ Ê É Å Ã Ï`ÃȐȐȐÅPÁ0a)Ãz†ËŒ<ŒŒRŒZŒvŒ>ŒŒñŒYŒ…ŒŒMŒ-Œ³—‚ÜθŽqãYÆëŒï®æe’¹™IÉ”ɉɟɟ)Ž)•©iÓ$¦-Lט~1³3s3ó3‹2k1»3Ç2§2—0W2OcÞÀ|†ù.ó#æo̘ÿ0ÿgáb‘gQbQcÑfqg‰g)e™Çòœå9këiÖ§l\l¹lml;Ø>²›±Û±°²Ç²÷³oc¿Â‘À°á0ÃV†í ¢072»2oeèc2f‘d:ÇtŽA—!ž!…Ù—ÉžicS-ã&Ö
+6k&kF?†,jLS˜Ž1ÍgúÆdÍìËèÍ̐Åd2“M„eÐt–ÃoYö0¥2š\ÁÆÃXÇôž‡a#“%ÐΣÌ,Ú̧n1ßgdgYÈp›…‹Qœñ-Óræ�Fnƽ,v¬ŠÌsÖ12Ö2lere`àúÍÑèÍèǸŠ¡!„шñóf&?†-æ̏š²™n0¼e(gè`˜Î˜Â’ÎÐÇ`ÌXÃðœaÓ<fMÖ<6-6QÆ“L™,]LÂŒ[˜XV200Y2ª02³Š0´0Æ2Ïb{Ït“¡”á<Ã=æ5@ןgZÇìËò5ˆ1ƒ!—¡–¡¡ð#C%kË%ÆtfÆ0U–Sj˜Xt=CCƒ>Ã6	†];™}"ò>ŒYŒ¡3f1Ìb˜Á°‰…¡‚!“A„!œ!áö¦é¬|Œ©@÷2°œþÄõÃÌÿéyÿ'1èþ¿ÂÐþ¿hâ
+†§ý+[ÿU30È1Üd¸ÇèÃêÆtžÕí¿.SÓM¦`¦iÛ@D300ª2J0¼bxÅ°(nǺ›¡‹å:C0ƒýÿžÿWD4”€.KbðbxËðhƒóã~Lÿ»10T²Þgü¿ü¿<#CÆÿ†=KÙYÙµÞ²l`¼Ä°¡š!•)è	sê¿L†)@Æ080´1”2t2t²²4³üd`päaaÖaÖaÖaRbegÖfÖb°ÒZ›Ødåw0klV“¿°‡Y“á31knÒ–•ßɬÎ,»ÉZÞa³òf!Q#~G]fF}É �dçùëbûâ,ñÌr@Y Yd5�yë™åö3Ë1\�Ê°10�åA²
+ÌrùÌróê0e˜e™e6)È8ª3KõJ201ð3‹3¼âÿ@šè^q}fq h<³8C?Pv>³8HH$ŸYœ¡žYœa?³8Ðƒ³ø¦IÆ@·‹oêQ⛳rŒ@ÜM‰ QñÍ1± ®øæðH°øfß@´øfO2ñMV Íâ›
M@ºÄ7ë9t‹oV×™"¾YHÕ¨d*¯ÑG1f1 'Ř
+€,F¦#üŒŒò˜E6�13Щ  ³„6«¨ÍßÏÌÂÀÈÌÄÌȐ ÿÿ�3ã&^A#G.¦ÿLï„ä™Þ1½Éü?Àôv3Ÿ Ñ|G/¦Gëx?ffzÄôˆé!ÓC†z¦Œ@ÒÈšäígzÀp(ú(ÃÆô€éÓ}¦ûL÷˜î1ð3ÝeÐb{¦»ñ@ö|¦»û™î2¼gºËÀÎt(+Àthˆ±í™î001ÝŠ
+0Ýzë6ägºôà-¦[@§]Þdni´Äؤ­b�EäUA"@)qiP˜Ñ¦K›~jÊïdVc–Ùd-ï°›Y‰ÁŽÁ˜Yi“ª¡üf‰M6™ò;˜oVЖ_àhÀt…a3]r…A€é
+ƒP$�(š�”)�ʲY×€¬k
@z½�ÈßÀtéƒ�Ó5¦S@}g€z¯10]cp�ê`ºÆÀÁtaКLç7©9É;Š1c:Î Î Ït–éˆf:ÃtÄg:Ít$ÎtHËåO1Û$'ÏàÈ
”g`:Î ÀtŒA€é8ƒ>P+ÓÁÍ*Bòÿ™ö30
ÛÏ Ï´ŸÁÈóŠÄEû2lLû™”6¥È
ÙÍpŠƒAžiÃKÍ´ŒaƒC–¼ƒš³§‘ƒˆP³²²€Ä|…ùjLjÓf%@„Zß$ ¡ÖÒT"ÔªÚ@„ZNÐ�¡–’4
+D¨EÅ
jþ!@ãÄ¦yÛUÔåÍý³ù™Ê€ØH�Ù,LåLå@±Ÿ, 7ÎÞ¤¥%¿ƒi–ƒ¶¦–|Ã.Ɔ=Œ
AŒ
‹Rêlâ´däv3Z00240:lAáZ:H06œblXËØPÌØ ÆØ ÊØ ÂØ Àhî°ƒIq“§1ˆÚä
+¢7;:9€h[;#~ 쁸H33ìòÎEþƒx@w+nVP)VÜ,)Ò¤´YˤYq³ž•Q¾£Óa ÆÃý@ú>Í I�Šžg:ÌÀÌÀÏt˜Ážé0C<PÝ Ú÷@õÿ™3°U+ýÑÏ"ù™”ô™”왔♔ꙔÞ3)1°1€œóžI‘‰!äD S׃œ	4W‘AŸ	äpE X˜3fRbRbRdRtÐð`î—aä—cô—û/ÇdÎ &ÆÀÀ $È!¸ƒ‘wÛwÞßy89™ú˜údä™&€h ݿ駬üÆ›ÔvË;Š2Ngcadg´dPcTÒÅ >£)ƒHÜ„A†i5PÞh“LPÿ&5ù]Œ| ]ÛäÊ<‘)³ƒ	È|!³[þºÂÆMòW"«·É_‘é”?©¿ƒƒq“üµŒ@‰]
+;@JwÊXȯ=R*ß”˜µI¾Dm“¯•q—Ï–Ù2#$±I>®h¢¿|Z”¼Ð<™$y‡âŒÛäíeâäm@Ú7É›‚ôl“7�:A¤}›¼бš2;@–*ˁ%j¾ƒ1ÃA‡}{»?»»»»"»<»,»4»‡‡�‡ÈŽÿ´DØ@ˆÃb30$€Pš‰‘ƒ‰Á‹aƒ0³7“w°£÷†ÉÞI
+¾+ï`ä
+ŒÚÀªìĸAÈ›Á;Äiƒ…¶÷öÿA̵½7°DGlddì‹Šn`êØÁȱƒñ?H¨UzƒsÄNFFÁÖ^i­ÑÚÉ !Vf/a/d'héæ"@ŒK�	ImmmmÒ06ˆ­-»ašwpĆU²‘Œ@Œÿ²‘Þ&+ÄDìdüÄøÁÕe'ãG±“ÙŽñ“kHœÙÎ%2Ò{cHÝNƏ@uj 
+¨ŽCŽA¤ŽAC¤nã,y;TúêT@Ð<NNUyªœœ óv°0‚ìÝX¬âê²QH�íW`(ÙÉP,®�SRsJÕÕe£*�ºK¬áÈ]§Ä@îÚ`rÖF 1r@ètF)W“d¥@Nß�r9H	Ð&} ¯:aJ;A¾ÛÁr
È k@fC€÷ÌÞÀÐÖÖÖaÂ‡I‚¥:ik3n¶ŽLŽqMUvMPvMâ„
Ýe’6&G‚$60«%$%g€èÄÔ
‘Ê©.’•]6Zƒô¡H¥c@ÒÖÊ.b\C"6Æ8¤ºl²v°vUNt‰Üì`bŽbW'Ì®&Xì
+�Ùe²Ë¤Å)@§˜ƒœâ²ËÜh—9È.ww]‘ÞÁNŒÞ9œ"c@´Säf&n.!çˆiÅH'1»
@ÎNkE‰:é],Œ+¸µ#7ð(;màb”®£®#HŠ…$µ(Å’ê’¨³V”ÞŸ$Ô%�Ô%¨ìÄ ]RZ\Ê ášéD@²¸¸¸(TRª­­­
"4H$£aüb ×
‰.Å%Þ´‚½7ØFEldgŠ&€¼´Á
+&ÆÍíºãÿ ÷= B+Bff˜BØfNNB n@Ž€ÑÚÚ 7œå±“¡i÷fF9ƆâHæ
rÞ!L„¼C¢€~‰ŠØÅ0ŸI‰(ô`1£6#È©0¿€œ­­Í 
ò¡6ƒk¦K1ƒè’R(‰—€˜@yS´‹ZŠµKJQÜ¥]\RZ¬
"@Ú% cµ$€†j3001200°2°2003°38mab|Âƾƒi¦ƒ0+Ëf.v–'Œ’l¬O˜˜÷02p2ÎdÔcÐøfó×ÆOà‹ï_{ [àPÀÐ@QPQPH02°0üQ`>ðǁ•á7ƒË6]@+-AD3l`ºÎÇRÌ 
+Äžì²å¬aŒíQL«j@˜Y–Áe
CPÏ* ˜#Pï.~ žP ¾û@½6@ýa@3¤@b@³|æ%Í©Úµ¤hFÈ
´/ŠCž!Ÿ5ìÿ_ }ÓX3¤ñ< Ý‹X3¬`³dÈŠ-ºs?ƒ9H
ЍÓØV1Ì�ª”OºsP]PïB ›c€ú@l û9Ù{$A4Ð/l@ó4þíùèuæƒf,Åÿ2­bˆºÑèÎ6 @÷ºÝì
t¯0ÐíN@÷·3gè`<þfhÚßúÍ$ô£ÐœV íþTú¹è^) ØXønWº_ƒi
ƒ%“à ­‡p¿A~ú;äg ú9l–É@}An¹FÃø 7‚Ür#Œºu/нÊL–ÿŸÝÍ	sÈ}0äV»@nƒÑ@{234�ýŸ
i`82eÈeña`dyÌ0“õ)3s00<dZÅpˆmYRü€|F ;ƒY·0Ìñb¾ ÌRüÿ/ˆÌ_,€rUlÓ€þHa``2âoúLotÙTêÙen{ÌдcÐÜ,kŠ€æ†�ý¬4ߘå)ƒÐÿmÀ0èÚýž5ìÿ_…
Ð-ì½A@»þ�ÝÁÀ´Š!è6wÆã
@œrÐ~}EÖ06Æ°–@w=º?„ââ ´Ë“É’a'HH?ÐOª {€zÁh¨¦—Éòÿ Z zQ@î�¹…õ8ÃBÑ@³ŽÃHNl@7ÉÝ¥tÛS û1­bȺÓ
+èVo {5€v3�ÝËtÈ=ö,4îÕ`aØÃzüÿ_Û@nùè‡y@·¶³¬a(â…L ³@ö¬bPd[Ð
Â@Zd&Ðm¹@9ýµf6ЍiÀ°€Ñ@»ÝX²ÿ?ºíkÈ./
T;å5ƒ;È
@·-ºÓFÝ<
èf'ÍÊÐâ3­ahš?ä>
tC2Ð.@{AnmÑÀp°ùèW ûT@43ƒ2H0<@æ€èf ¼&PŒfÉ`X43-‰!”eƒK	ƒóD†$–.Ìšz¬@1 €fo`zÍÄq€Á˜ƒÁh×L
âížÂìW³X0ÌcYÍPÄr•a.ˆB–«LJ,WYYWÿÉÊÀx’u5Sˆ
£a|<Œ©e]Íx�¤DƒØ(j°ˆcÇb&{°Ø
r+Ðîk¬«Ò€n{Åzõÿ–«“8Ø_3�±ŒŠoÊ5�åµ8´gpd3î`e`c`øÄù,V¬æ,ìYDXTr¡¬ö3÷2t²\ý“±¡é*C»(C"Ó4~]LךAd>]Àöÿ/K1ƒëq†4 0š5ŒaPÜFÃøl–¹@õN0Æê_4§hŽ<Ð<6&Ëÿç@H?a ÿPì+“%ƒ7ãqI {͏ÿ_´gÐí@÷·Ý1
(—tːY¬'–ÝÐ
´3è
tëB¦U@ua1@7Û³<f0�šËº¹F£ðâì½’@²ýÆô«"Н¬aÿÿýéÅÁÀÀÈ.²ƒ!h^#Н;aêaú°èïbZõÿ!ÐMÒ,g¢ØÖ0d±Ù^@7>º3èÖ{@u¯XÃÿÿgsû¿œmËÿÌBÿW°Ù7€|Öÿˏÿ¯�¹è§i¬ÿÿý¶è/M _—�ý¶$ÎÁÀͶŠaÐÿsXrAá’†Ã<–OS@á�ò0\8ÙÖ3Ô³þfHêe‰±,`ð`žÈtk7ãq†l–†–Y=,’Ìí q ?b€r@±6 ¸Ë†@y)æ©1@?º°ô243ßfée1fdÝÂPÅfÏtûIyÀpð`šc
gXÄöšÁˆ%”a!놠¿b@þ�¹h§9G)/‡(ö«†,+jD¸€ê°†ýÿËêÀ°èæi ½¬Ù@÷/bOf`g¹Êà4dÞB :!¶U3X3,a³dHéúuŸÆò˜Á�d&›(CÐÿœ¬¯泆2„³ÝÃÞÀ°-”]”aЮ¥@÷…‚Ü4GŠ¥˜Á‹e*C4‹CÓk†–Õ@1oÖ¨ÿ¿™W3±T0´ƒ0sCPN‚µ¡‡%›¡ƒ¥˜Áè^ÝÎÂÀÀ¼ŠA
èOE¶©Þ@ÿòÍìbÑfpeËfèŠõ²20h�ýÛ
kae0`c`èúWdÐ
@»;YD@zí3t0Y2p2ÿ¿ˆÝA˜­¡¤ä û™_2,döbèà``pä˜Ê°€µ•A—„a4
+&Éð
H##}ŽY€¡(fÎdÌp	h7Pžh÷N–F†L–0#fCIA]–‹Ó2Ìfægˆg9Å0›eCˆÏ"Ì Á¼!€yƒ
Hœå<C�HÓ%–Q,6@ýy,ñÅÌ$™¯0p±¤1LécícHaUêÿ4„4ãc†(æ0†(¶6 û'ƒÈ|Ì[þ{‚0‹ƒ.HH/ŒfidÈaÍÆ`Äl´SA—å"Ã4&of/{Al÷Ý
+s'̍Xܧò'È\?Aþ`™Í`ÃÀðÿ«‚h†L½«xÓ-gf_†JÆÿw100¸0Œò=`b 9SÆ Öc1eØč@¾½È_âÅgånå[æ�ªÛÌÆÀÈ�ÂLNf 6Pï< þ@3NÃä`j@jAnÀ"Ž¢ŽUúÿ.þV+füò£˜²³‘Áèf3Ûÿ»@˜ù%ƒ³Õ3ˆ°—1ˆ0«Åå€f¢ðÿïb•f0bÙÊ ÂÌðÿ;n7aG±Ÿ‘Á�H¸0ã�bÃüÂÀðÿÿ@ -Â0…“©…Ñÿ@zYŠ¼8€6å>ô ˜t;S/ƒ €üÁòŽA”Ù—¡’qƒ0ãµÿׁtã5æR#Šëù¬ÒF,[T¿üßÂ@õ“Aâ¬[¬@&ÎäÄÀÀÌðÿ;Š8PŠ: ,f,¦@ldƒ0
+E$¿‹i3C<Ãhæ—^ £Ù&1؁0‹=Ðl FáÅ8N2؁0ÛQ £ðb,ËAF£ðAr»X¢´˜gÜü³:
+ÄßÅæÏ ÂL*@·JÌcpaŸå<ƒ.ƒô‚ô³ð2¸ƒ0ãŠÿ»@˜iƒ2ÃäYL\A˜ñPˆ™œ̘þgž²è†R#f•f0bÙÊ £aêî5d9Çàt·¶º?È÷‚ÑlŒ ÌÀÀàÂ0>1,j@ú@za´Ð0,fÂÌ…™EŒ°:jšE©›˜zNñq }ŒVþƒ¹‰‘áÿ. �Òlw’Yí\Ø®2,dfhf`ø{‡á>/c`ød_ŠÙš@>/P^(ŸT7—á÷W Ú" º« ÌðŸ‰EšaÛ†l –êßÒ4‡ƒdÿ`~ ¾¿¾�ñz~ 9«€feíý´»hî] ÍŸtÏ+ ;Z€î:’º/è®2 Ûö�ÝùèÞ ›#€nž�t»(Ðí:@÷ý tß4f<ÎÐÁöÿ/K1ƒŒFác'A=È\ ¹‹€æ{Ãh>qõ@}L–É@wÊé]@÷Ö°ù@÷ºÀh>q˜z¶;ɬö0…"Îzœa!нÍ0ší*ÃBÖhÂGú“…AFÃø¬aÿÿýïÅdùÿãñÿ`îG±f
+ä†f†ÿ@F³„þÿËôš‡=™5êÿo–•™Ú`4ÐýKX²:XŠö20ˆÀh û8îãg
egÑfpÒ ¶³±‚ÜÃ
+tWÈ]¬[¬¿üߍÄRÿw±,gpcüÂ0ˆ€´4ˆò³j~2©ÿ?ÇÀÀÀÏÀðÿ+Ó*†% äÅÂ@˜áÿyÆüŒ×þïg\ñÿ+>äËù_W0Lf¼Æ Ì\Ê`Â0šUšÁˆe+ƒ
+È0·€ÜƒÂGáã–'Aÿ.–F3S ¶²A…[ž°zyÿw1mf0a Â0‹8Š<PŸõ{‚0óK/†Ñ(|Ür0=^l“ì@˜Åþÿ.Fá£ðAòÿwqœd°a¶£@µ@ŒÂŠ±,a YQZ̳ÌXLÿïbVšëÏ  šIè)˜
+·<õ,ËÜ@FsÚ10»Ãÿ] ÌVÏ Â^Æ ²ŸEèŸóº rÈM(|>ÈÍ(úAúQÌCáã–G±Ÿ…—Á„WüßÂ(|>yzSWfüÔÄ0>L‹<H½+K#ƒP¯‹-Ð]@ÌäÄ`ÆÌðÿ;³ƒƒhæR#†Ñ(|Ür0=F¬Ò@?oý¿‹UšÁˆe+ƒ
+̍0sQāc«gpa͸‚AƒáŸ&/ÒŸþ˱ž¯ãøÃ`ı–Á(Þ”[”·ªIÉÕš1ö200}ûÿhFP¯�ËYÚÿ RÇ6‰Á„YìaÄ'ì@˜íèÿ] ÌÅ Å<‹ÁŒÅôÿ.fu öe¨dÚ ÌäÄ`Æøåÿ.¦	ÿw1~aÐbk -doòsþa/caüÉ0èþL{˜?1Ìf‰úÿ•åG1³œcð‚Ñ(|,â,¦…@¼è~ >~–b6AV†å@væŠq±gâ4†�Öãÿÿ²UÔ�í)fpc)að`
cÈc¹
+´ûñÿ#l–¹,ÿøÙyڏ343Y2Èå§õv�ù¢@3$Ø–�ÍÙ´¯¨>íC2k8ƒ'ƒÈ^ yó€ffíógùÄ0…™›ÁhŽ
+Ëc
¤
X3$ݵMA�è.E œ&Ð} ¨Î%†Áˆíþ°ú%”y5ƒóS ÅíL"{˜ýö°¬a(ºo×*†yœÇæq¤0¸qÔ3Lc[Å0yC3Pl{Ã6m†v¬aÿÿÃÅ‹áß?›ƒ‘]–Á…Í’!h—ˆÚéÄÆ0
è® x2Ð
 yíÂrgƒãñÿ‹`ö‚ì…éãpcXÂò‰aÐos@n…Ù	³hî" Ÿ¼a4“åÿ. N†ý
Å> ½@s2­úD3­bÈ�ñî,‰ÝÛtgНö@w�ÍPº-¹ŽAhÿýË€î¹ÆÇÒÄ ·30h ¸è˜þýEñ/Ìß w„1°ÃCFá@û=€nha ÝÂ@û€nra ÛBY_2„2¯fðb#V^#~&Ëÿ;îva–
+ z&I–÷@\ÌÐ
r'È­ŒÇ$8œé&Pý<¦< X3Ëd†f¶U- ¤jÿ/écÉéº5è^{ »Ò€ö¬úÿ„A4Ó*†VÑ q–P†.ºÙžñøÿEL"ÿwé"¦Ó@»,øXè/I–†–† ß¤X3°ý(Á¢t/ƒKÇ0ø�q%Ðï*, ¿ƒh`°Y2$³8�õñ3x‚üÈ’ÍÐÁ¬ÇÀ�´ƒÙh^1ƒLûv7v7n7ÖÍ*Ìù*¬TØd„Y½šYùš™1ȱX0$32¤€0£ÛÿsŒ¯ôkfz¿	tûD ¿!Šé:Cãq† ÎÒ]@ÿÿa¦SF ̲†¡�„t*3­bTª¹T	bÕË‚Ø 1&K†m 3hÖ2Ñ uL«þ?âßLS€nqbHaÚ´cÐM@»˜¦0ŒñnIa ›4@ö�ÝæÎÎ0
„a4ïÂ0ÄšÓa
âí�‰©‚0ŒñAâ@s¥@Fƒø@7Äœ@Fƒø@·‚ÄP܁[w€ÜÛ}j £A| @b”º‹¹ »”AFƒø@÷Ä°¸äo†Ñ >Ð? 1Âî�¹7œA
+„a4ˆ˜
+Ãhèw€ÜÆàÂ0ĺ$†â†øÃß5@ö
†ÿ“€b/´PnPþPìP<
Ä©©ª›T;¨~&PÏ >'êwš4·hÖ yË€f‚0ˆÚwh‡Ì “öjíÙÒt×nÝ ûavݺ¤èÖµ@wŸ@á3üúåÈ>Ý w�ý¶èe Ÿfõ¬º©d/Ðm€nœt#È^z}@7ýOéɃԀÔýÂôOÐNy ¿‚ADý·„~=ôë: ï�ý|ä.è9`88ü‹í ;™V1ÜâH ý‹eCK›ƒû*-ÂRÍàÃfÏÎržÁ…Í’!™¥˜Á…õ8CC�Ëc†ÌÖ,ÿXlŒØx¸Xæ28±+0,a[ÅК
+RÏÐ͚°¨ž‹5Œ!„Y0°²ed}ÊÏ’Ç།A„ٝAdËT†hÙŒÇÿ/Ú—ÀÜÉàÄ@½‹X0,ÚïÍRÁÐε…!—åƒ�ÐM",ρîÉ°Ÿu+Ck#ÐmlìzûY'0t°-d¨`­f¨âÈeØÏöèÖ«iÌ«äÙâ,Y›<@v€üÄ–ËÀÉÊà £9f0$³ë�ý¼ŠAåƒg;C.Û†�†æ0»á
+v ø2 Ü†ÿ3@˜á6û°�ºè^VmÖ0†y@?´³Æ2,aI¹‡Áè#–•,Ì
¬ï4Y<4Ø9–°ê3tpJ0,`ûôƒP¿2ÌN–ÇÌ«ÔØÓYÛÔXC滲=aàb
aà‚ÑL–ûÙ“ØY£þÿf
º%ƒ¡
è!–Õ@³–°d3tÀh˜l«f°60ô0­bÐc
ûÿè^/ÍÁÀÀÈ.ËàôÇ" ?¼ÙX’þ	…ÙóÈ_,10ÿ·³‚Âl– õ.@:Då½XD´YE¸Xa4Œs»(Ã
+ YÝ@·{±3¸±ïgðbgÒËÒØÚ‚Y}ÒX„‚Ù3±»3Hp¸1,aggè�Ú—´?€õ'ƒk0ƒÃg ÖÒY@ö ?(ÆÀ𿘁áßu Ža``ˆ‰Äì� n \(H/àüÿR 9) } 9 ™] 3@fƒÌɁԀô20ü½R´w-Ðü ´ç>ÝtHœ5ìÿ_`xx±†1L†KŒ†ñY3¤±�ݤçÕ¹Áh>L$Æ°hž7ŒFáÃāò,V0Y2³Y2äíwÚ³èŽv
ãíŸt_LžÉòÿ}Æãÿ'õ*�õ³í›t_Œ†ñnÆxœ¡DÕïñú–‚āú³­b˜Äí0ÆúsÈ0…tнÉÀppÑ(| 8Ð=ó@úa4м…L«Za4ˆäǁāâj@÷Ç�Ýo£Qø0q <Ëc U`4ˆÏdùÿ?H| {€~n†Ñ(|˜8H>ŒhŸŒfïeº‘
Fƒäîá‡Ñ@°ݧ´_èN

ãƒüt3È: Ÿ½3t²,`ð�aÂʱ†ýÿÂlM £ü0fžÈÂ0Æg“c`�aö†Ñ@wtƒ0ŒFáåØúú€˜C„a4ˆÿÿ3ÝÜÂŒÇÿÏa ý„üE ÌÌÈÀ�Â,@Fùÿ?ƒ0Ð~†Ñ0>Û\ {˜C„î>	Â@÷&0t€0ŒFáå€áÁÀ¾è^!ÍÀÆfÏÂ0…’‹ÚÄìïAhO7ƒèÿÿA˜eƒ3OdHa {»Aè·gŒÇ2`fLL?
+h&kØÿ¿ t¯0Ãh ?„aöÀìCáÝÀÖt7sȃ0Œñÿa?ÂüK‚¿	»„aôÿ¿L«ž1Œfa,îîfkº„?ƒ0ëq†%@½Â ÒÇxüÿn ^
¤O0?„™,¤˜,ÿeNe`�a˜],	 £YzšA&ÎÆÀÂlÏØ%€öˁôÿÂ@wG²Ù3„ƒ0Œñفö°ÍªWº7èÎß‰@?Þùè/^ »Ó@˜mC;Ð*œÙ{$vɳ<f0à``Ðda`0`9ȐÆÀð?„a4ãqIÆãÿ±h3°Ý&ÈZÂàÆtúÿbÖ*†v¦ÿO°Ö3p0Ðm- tãIºuȽ@·¯ºÛ
+èv6&K†@?¬aÍ¬Ç  5@»‹þ/e`øwèe [Š@ȇ¹
DÝ2¥˜¡ùƒ$ëoIvYI†�–L†v –d~
”_Í`ôCs"ƒ#P®ƒÙŒA€µ¡‡¥¨¦˜Á……A˜åP/ßcàeïe`^4$’×fha	eaæUj,	,Ç\XAz€4Ð>)Öãl@{5@v1g3سÜfgzÍÐÁ”êí`šÁº…¡Še5ƒóVæ@ ÚÀÿ™g�õx€0Pï#æ< {Ã2™Zt™ÓŒ˜.0±ˆÍ-šdK�íàÚ	´kо2C8Ëo¦_@õ@ÌÌÂ`ÄrèV† 6bú	Â@³z@$´Ã‰!…iC
+ËT ~:#¦« = }@°1¤0Ù4ÉÁˆ¨ŽiÐÝ
+@·‹2€ØÌlFÌ­@7îg`�™ÇøšdHL
3'L
{-ƒWƒs3Ögpcuü¿‹ñ%ƒ
Kƒ Ã^ 6e`øwˆ·é“@±ó@q Ü< ø)¦Íñ Ìü’Á„™gýßŬÄ H³®eÈdµeÐeýË0åC�ËÖo³Yí4Ø4XÖ01000€0ˆf)þÿ‡iC0ÓÕÿçW�Ý Èf‹`å<ÊàÎÔÀR¢š™V1ÐÆP~ ßÈž4(2›õ)3ëq†4¶U3XzØ]šÙ%܀؃5ìÿ_ÐL ^.–Ç@óývh°,eš
+4ú¿0öÃÃ
+&Á,½\@óAf‚h–P†…L¯:€êœj×€0Ó%†i Û™¤þïb
+`éš
4+h^ÐÌ)@s½€æÎaÝÊ`ÂŒ_þOaÈßÅÄ(|>nyÜúÿïbid0c1b[ „Qø@÷nf0a ÂÌ/¼@˜mƒ³ØÍ�á(-æY ³þïbVGá£ðaòlþê ̤´C
+…âïb«ga/c™Å"‡ÂGáÃ䙶0(ƒ0Èný(|{L\A(|>Hh'/ƒ;3®�ªbæ—^ £Ù&1؁0‹=Ð} \ü2K1ƒ“åÿýl«þ_ò·Å&2­ú¿„YþÿÊída`Ð�ªëdæfHa)að`ódPa<Î 	Â@ýr,	@ÜÃÀ4«
d“%ƒ0ë' ¾Æãÿÿ°­bhÚÓ
´«höo yöÌÿÍ•šÍ2è/ [<@îºÉ›y5ƒ'±š0„íê�ºAhÖ"–b†f–f†¦«FL'Œ™þ�é#F ˆ€rFÌ‚)ŒN@7:1€h[’I‹ÄŠs23¤°La†fþÿ'™ù4Í
+ÔËÀ`Ä´hžÓÿSŒ‡€fñ3È2KÍdÚyhï$¦{@»ADºãƒÿ= ÌÀ𿘁áßJ&K†L¿€nü	tÐ\¦@}@6›%C.kØÿ¿À0ág=ΐƴŠÁ‘eƒÃh>ƒãñÿ³x5Œñb»a4KCÃh>P¤¤¤‹ú–(†`–s^Ì„YÁîÒd`à²ÝéÍÂÀ`tÃ"ÖgÉ@¾Pži?P-PN(/T�¢34³„þÿËôšh'P/Hˆæg¹Ê̼šÁ“ՁAˆe5ƒÿc@|Fùñ ÌÀ𿈋þ=gïfàb~Íà²è. ù¢,Åÿ¿€Ü	tÇB {$™,ÿwÝ´è¶v ›¦ÝÔÁò˜Aè6
 û¬Yæ1,aNgè`5`ð�š4Ðî tú»ƒõ$ÃR ßæ€h ÛÎÝTÿï$ÿs@·º÷Ð́î~tû5 ûï00ü½ÉfÉ
+ö^I`Ø°±ÎgX4'ë†d–cœ>’l»ؘ,v2701¶3D0Н3A(¾„A4Ó*I7 ¶Ò†@vƒˆŠ{å<~3�ú;�è÷f!{–�7[`XÙ¶,µI,ê@ñb†0–J†`…2K2Xõ؀Āz@b,u@uúÞ@³‚YªBY2d±^fHfýÁ°ŒÓ‹ažÃÌÄ`ÍêÈ°„Í’!¥ˆÁñ8C'ó†v&.†N ü˜øX*ZAn¹¤$T×ÁRÈÀÀÒÉ0ƒå0Pî9Î²9f°ê3Ä°|`˜ÁøŠas1ƒ&H
ó øq†,o€ò†@³rA4ÐÌÛ@ý¹^,@uw&²d0p°E2ÈÍâ`Éb>y¶‰l«€vïa°�ê5Ù´Ohï@î€Ñ0>ÈM ÷€Ü£_ýÿtSÞdß‚¹ä
rÈ ·Àh;Pì™
2F?g�¹G„Å>Ý@?ëÍa
d³|�†Á'= [¦ݳè¦+@7ÙÝÕÎê§bM–N ½„a4Ð| [Aî¹™å+Š»cXníaËàÂ0Äg�š	 šh>Šÿ`~e˜ÈÉ Â0äoßAþê“aÍRÈÀÀ6‘èC›äÞu@7‚Øù@·‚Ô~�¹‘!†ñÐí@ÿ°D10±ùè}ûYžÜô›*Cȍ ûXÝ|€fp°:ƒÔ0ÁÌ™4«äo»@rŒ¯þß¹d'ëzMXŽ3Ä°ä2xìÉ33h²}aàgÛtÏ- b@w&3(ƒìùƒ¥
ä>ûîÏd๟-(/ÏàÆòè'éʁÜóÌí,‡þ�¹h&+/Èí@÷܆E-ƒ›Ð,9 ÛjlXŸÝ
+tß17¶õ3Xn31+3Ì`ZÅ ÄÙ@ZÈVòÅAb@q= œ'P^¨ÆÄÑ õ¬G²@F£ðQä€ê.3$ƒ0ŒFá£ÈÕý`XÂ0ÈŸÂ0…’Ê331Xƒ0ŒòPÄ€ò,bÿ×ÀԁÔ3q1t±S&^
+b3°ã6d>ƒ5«#Ö"7†Ñ(|PžñøÿåÌ?Ú±ØÁÎÀÀÂÌ š¥‚¡„a4ˆp¦Uâ@¬¤=l-–w¢,oæ‚07ƒËU†VÖÇ­Lj3¸“IAÈ–ò“b@qi œ,Õh‚ä€jÕ@b@=@}<ÓÜøxÜþï⻢ÿGفüí@±Ù,f,¦@lû£ðbl“ì@˜Å(ÄÌ/¼@EP/ãŠÿ‡¯ýÒ/t+«4ƒËVÆ/@9 Fá£ðAò@sKŒ@F³Õ3¸‚0ŒÆí.»PÜ	rç.–óº ̬4ˆY¶üÀÊðÿË´ÿ/XžüÁÃ`Äz‹ÁˆH3Xrog```ø§ÃÀðÿ•
äƒh�ýt—{ƒÈ\9>ˆÛŸXÂd&о¯,ó–0ŸeàbyÌ`À¼ŠAõ�ÃB–5í¬aÓXŠ¢¸Ò\€t/˾ŽAˆM”A‚͏aë>†vö•œl·äAjYÚ8zxÙ…$8ù–°cè`=ΰ„%H/fXÄ’ÏÐÎdÉ Â,%lJû™õøXv1Ä�ùž¬‘",³¸ØV1Ì`
ûÿ—õÃRÖ	ÞL«þ?ºÃ…ù5ƒ£ÛÿsL“€n‹ayÌ 	4/“͆awØÿC^ÿ…¸yŒø.1¸0®ø¿„A4ã5&ÆF@ì²¥˜¬€bš01 ¼HH¤¦¨/dã†y@,�¤¥A4ã—ÿ?™ôzâÙŒ3ܘö30НüL¯„A˜Eýÿwf•f0aÂʱ40¨€0óÓÿ»`l›u+ƒíÚ”kd0c1b[ :^Â0úÿ.6ufRù¿‹I
+$ÏàÂ0>/ƒ;3®�šÄL[”A˜Yýÿ.¹“e+ƒ
+Ì>>Ð
ÌÛ¼@˜¹”Á„™³Ü@˜á¿{€h†ρ|†?â[þåÝal¨žáß2
Ô«Ô¯4#„fMa
4[hæu &@{Y¢‚YÎ1xí\ÃlÈ É"È Ër‘a«
+ƒHè-¦^†Õ@¼€Å…Á†Åˆa4Œï
+Ê/gp©gVgPb2`a¬bÐc)faóbða‹fhwp‹
qt°·³µ±¶²´0751624Ð×ÓÕÑÖÒÔPWSUQVRT—“•‘–’”àçãåáæâä`gceafbdÐqUvKPØ –°EMÙÃCWÈWN
+$Â@
+6(�…€L
H͐> …¢rƒPsŠi‰@6�)˜™:Œ
+66º:
+®Ê
+κ(+ì`Œ
+Œ�²{]”#6¼±7ø‚Ø&€Ä7ðŁ\%2\60&(¸np+ËèrMp·‘›ËYÙ9•KW‡a#7É
dmW.ØÈ(nÇbldwµÚÈÄÀÁtþ)e×
’Ê. l`VuMLÙáê"­¨©«³Ñ9Y9iƒ²Ó~m#708ƒ¬aÜÀ漁dŽB&È7Ý
+utõì`HJÐæIQNIŒ‰ØÀœ4Ãuƒ 6Ð.Ä«žHÀ¸ 79G´ÃdA²ÒÌ]®™
+ Å]]í
+FÀô‚dA&DFÍ�:ŒIÕ-¡Ë
hu‡®Žw°Ð6¦ÖȈ
Œ­‘@¯€|òÈ.®©Ê® ‘„,…
œÊNÊ]Y	‰
+¤º60U*n’’rØùÿƒ”«BWH„²â{iåÈD™"]A•›%$Qd€ß( è¬ìÌ
dðñƒ@^ÄH…ɁX å 1 zï WiEE AnTöÜà°A!YaCP„2ÐO "Õ‚¡+Ù¨LQQ1’¨kCJ`„kæNç„.+8HÿVUe…®¯”ß¾AaL‰�Õ°©
+|e�I*l`L`P°a°±aì
ÚÚ´´tu6°;o`ùÉÄ×1ÕÕ)ÛÁ¤¬\  �¤\60D�´Ò—ÐÕQTäIQNéÞáÀälhŒ�ñ»w(0$IobpÐ׎ÜÀ”�’9�“
É4Àd`Ú“”uu¶00200ˆnàP"É¡Æ/ &ìšaµQ·tF*H<ÁÊށQ
+®]	.ÒŠŠ‘@‘H>*Â&cmvŽ`–f±€,&ifÎ
BÎ10Å:€œž
,ª@ÄòsbÊvŽÀ‹*£‚ہ™àÉ¥¨HXH“ÛŽÿ@º@LÌ™Q¬´Qœ½Á…â<ž.f ƒYÔ˜¼C¢ºº¸Pœîr%Ðéž ç©D…
!Š
+ÎB#60«n`VÝñÿ€GJop‰�É„Dl`	…@
+\…Ò@š€"##uuܔݺºÜ”ܺºwüoHRVPîÚÉtˆéPWkÐÒ€ˆ
Œ@™]ÝÒÜz"7$d0ZéêldbpÚ¨Ìظс±#8*b§�ƒBGHÄ&&F&ç§È*@¹ˆ
+ Q&&(H¤D¤„Á›Ñ;¨ž¤>Rz§CÈ�&‘ ~CòF¡ E 1F†äL ‹˜@EnTYÔÍĐ¼ƒ¤z“̆ä 615€œ¹Qä, ]É;@fïb`bd``¹!22ˆuu609‡Dx+{FEXH+*FJ+*I D¸vS—wð5$—…4L¨O¤q£ò†xå
+ō@37„)W*MSÞ  4d#ƒ»LdW—B—B—2Ðúä°’bÔ‘‰”VŒÜАS+-©¼ÆÝÈÀÔº1qÇÿÍ2ÊŠ0Û€¶UÃl+Ú²¶kÈ: ›7$c±-,èú
ŒÑ È`QùNq£ƒ2ÈþÈ
,j KîíŠéŠRVTVÜ ²ä, ³€\>™H	 —Ì�¹„„r�òáÕ9
+endstream
+endobj
+13 0 obj
+  <</Filter /FlateDecode /Length 315>>
+  stream
+xœSPPP�a}gOϼÌý€¢üäàÔ…´Ì¼”¢ÔâüÒ¢äT…¤ÔôÌ<^.˜jC#…”Ìäaª¼äÜĘJ¹ž.Á•Å%©¹žyiù0llôƒ€†—U*h8:::::k;e&æ„æe&秤j*èû¥¤eæ¥c‘Éë—ä¤æ¦æ•((ØÙ)¤¤¦Áœòob_bnª‚>Ó±¨
©,HU�úf(dAz	èžâ‚ÄäԢļôT˜
+
+6v
+6nnnnv0«RóR°è€20)-9#±Å A óìPBQ	2hvnbÌŸ
+
+0o*$—¥æ•¤d&—(èƒDRRÓ2óR‹R‹óK‹’S
+òaÚ@nÌKAq0/�õ‹6
+endstream
+endobj
+14 0 obj
+<<
+  /Type/FontDescriptor
+  /FontName/AAAAAC+ArialUnicode
+  /Ascent 905/CapHeight 905/Descent -212
+  /Flags 32
+  /FontBBox [0 -212 1000 905]
+  /ItalicAngle 0/StemV 0
+  /FontFile2 12 0 R
+>>
+endobj
+15 0 obj
+<<
+  /Type/Font/Subtype/CIDFontType2/BaseFont/AAAAAC+ArialUnicode/CIDToGIDMap/Identity
+  /CIDSystemInfo <</Registry (Adobe)/Ordering (Identity) /Supplement 0>> 
+  /FontDescriptor 14 0 R
+>>
+endobj
+16 0 obj
+<<
+  /Type/Font/Subtype/Type0/BaseFont/AAAAAC+ArialUnicode/Encoding/Identity-H
+  /DescendantFonts [15 0 R]
+  /ToUnicode 13 0 R
+>>
+endobj
+17 0 obj
+[ 750 750 278 278 355 556 556 889 667 191 333 333 389 584 278 333 278 278 556 556 556 556 556 556 556 556 556 556 278 278 584 
+584 584 556 1015 667 667 722 722 667 611 778 722 278 500 667 556 833 722 778 667 778 722 667 611 722 667 944 667 667 611 
+278 278 278 469 556 333 556 556 500 556 556 278 556 556 222 222 500 222 833 556 556 556 556 333 500 278 556 500 722 500 
+500 500 334 260 334 584 750 556 750 222 556 333 1000 556 556 333 1000 667 333 1000 750 611 750 750 222 222 333 333 350 556 
+1000 333 1000 500 333 944 750 500 667 278 333 556 556 556 556 260 556 333 737 370 556 584 333 737 552 400 549 333 333 333 
+576 537 333 333 333 365 556 834 834 834 611 667 667 667 667 667 667 1000 722 667 667 667 667 278 278 278 278 722 722 778 
+778 778 778 778 584 778 722 722 722 722 667 667 611 556 556 556 556 556 556 889 500 556 556 556 556 278 278 278 278 556 
+556 556 556 556 556 556 549 611 556 556 556 556 500 556 500 ] 
+endobj
+18 0 obj
+<<
+  /Type/FontDescriptor
+  /FontName/Arial,Italic
+  /Ascent 905/CapHeight 905/Descent -212
+  /Flags 96
+  /FontBBox [0 -212 1015 905]
+  /ItalicAngle -10/StemV 0
+>>
+endobj
+19 0 obj
+<<
+  /Type/Font/Subtype/TrueType/BaseFont/Arial,Italic/Encoding/WinAnsiEncoding
+  /FirstChar 30/LastChar 255
+  /Widths 17 0 R
+  /FontDescriptor 18 0 R
+>>
+endobj
+20 0 obj
+<<
+  /Type/XObject/Subtype/Image/Name/img0/BitsPerComponent 8/ColorSpace/DeviceGray/Width 16/Height 16/Length 46/Filter [/FlateDecode]
+>>
+stream
+xœc```�aÎÉÿÿÿÿ?ÿÿÂGáã–‡éFáã–§T?a÷¢x�“þs
+endstream
+endobj
+21 0 obj
+<<
+  /Type/XObject/Subtype/Image/Name/img1/BitsPerComponent 8/ColorSpace/DeviceRGB/Width 16/Height 16/Length 181/Filter [/FlateDecode]
+  /SMask 20 0 R 
+>>
+stream
+xœc```�aÎ'$O¬~=f�ˆ„1`"3°¨Ï¸ð?ã?]ȸ�D ĸ0Ã�·úÿÿŠ^ÜêAêQ´`QÅå(¶`Qáÿÿÿ —Ã\‹â0,æ_È�"	b 8ä}Üîÿÿˆ@$Ì# ‹2þ£¸äŽ‘ ÷�]ƒ¢…°ûQlÁb>ŠP†Å|˜«`Ê`Šaº>`QÅKQÌG±·�g@´
+endstream
+endobj
+22 0 obj
+<<
+  /Type/XObject/Subtype/Image/Name/img2/BitsPerComponent 8/ColorSpace/DeviceGray/Width 16/Height 16/Length 38/Filter [/FlateDecode]
+>>
+stream
+xœc```�a
äÿÿÿÿ?it>>yâÕÓÊ|ÂîÅô-�¸t™g
+endstream
+endobj
+23 0 obj
+<<
+  /Type/XObject/Subtype/Image/Name/img3/BitsPerComponent 8/ColorSpace/DeviceRGB/Width 16/Height 16/Length 228/Filter [/FlateDecode]
+  /SMask 22 0 R 
+>>
+stream
+xœc```�aÎÇ%Ï`qˆ@$Œ"’qÅdú3þÿ"yˆþg\�"	d`QRÿ?  ÀÁÁÁÁÁÁÂÂÂÀ�hç‰E=Šù(¶`1äþŒ>üˆˆˆˆˆ�Ú²ÈÁè0 E¸ÕÿjÁb÷0dd\�zè	cÃD@R(î©¿páÿ ÂbËÿÿXÌ©ÿÿ?#ˆ@d@�ÝößÀ�·zùXlÁb>CÆŒÿ@/�}"	»¤è†Ñ0>Hœõ¸Õƒœ"±8Å¿(>Ç"Œ2�ôÇ3à
+endstream
+endobj
+24 0 obj
+<<
+  /Type/XObject/Subtype/Image/Name/img4/BitsPerComponent 8/ColorSpace/DeviceGray/Width 16/Height 16/Length 56/Filter [/FlateDecode]
+>>
+stream
+xœc```�aÎ'$ÓÏÀðÿÿ.�	ø ÿ@2 Y
+yP¸X̧’û¤0Ð
+endstream
+endobj
+25 0 obj
+<<
+  /Type/XObject/Subtype/Image/Name/img5/BitsPerComponent 8/ColorSpace/DeviceRGB/Width 16/Height 16/Length 117/Filter [/FlateDecode]
+  /SMask 24 0 R 
+>>
+stream
+xœc```�aÎ'$O‘þ´Åã P`ÐÐÐhhhh�á 2¬�‘ ÅU@Å@) ,HWCnÃÌY°âÀ�i©Çm>PñÿÿPÔã «444`†7�ٸ݃ۥ$è¡•ñtv�‘
+0Ÿ
+endstream
+endobj
+2 0 obj
+<<
+  /ProcSet [/PDF/Text/ImageC/ImageB]
+  /Font << /F0 8 0 R
+    /F1 11 0 R
+    /F2 16 0 R
+    /F3 19 0 R>>
+  /XObject << /img0 20 0 R
+    /img1 21 0 R
+    /img2 22 0 R
+    /img3 23 0 R
+    /img4 24 0 R
+    /img5 25 0 R>>
+  /ExtGState <</SRCAND  <</Type /ExtGState/BM/Darken>> /SSMULT  <</Type /ExtGState/BM/Multiply>> /SSDIFF  <</Type /ExtGState/BM/Difference>> /SRCPAINT <</Type /ExtGState/BM/Lighten>> >>
+>>
+endobj
+3 0 obj
+<<
+  /Type/Pages
+  /MediaBox [0 0 572 820]
+  /Kids [ 5 0 R ]
+  /Count 1
+>>
+endobj
+26 0 obj
+<<
+  /Type/Catalog
+  /Pages 3 0 R
+  /OpenAction [ 5 0 R /XYZ null null null ]
+>>
+endobj
+xref
+0 27
+0000000000 65536 f
+0000000017 00000 n
+0000269125 00000 n
+0000269567 00000 n
+0000000214 00000 n
+0000246176 00000 n
+0000246380 00000 n
+0000247343 00000 n
+0000247544 00000 n
+0000247729 00000 n
+0000248693 00000 n
+0000248890 00000 n
+0000249072 00000 n
+0000265031 00000 n
+0000265427 00000 n
+0000265643 00000 n
+0000265855 00000 n
+0000266008 00000 n
+0000266957 00000 n
+0000267147 00000 n
+0000267325 00000 n
+0000267551 00000 n
+0000267930 00000 n
+0000268148 00000 n
+0000268574 00000 n
+0000268810 00000 n
+0000269665 00000 n
+trailer
+<<
+/Size 27
+/Root 26 0 R
+/Info 1 0 R
+/ID[<674bfbb1a739136ead99ef48980f5aa3><674bfbb1a739136ead99ef48980f5aa3>] 
+>>
+startxref
+269769
+%%EOF
diff --git a/RTCP/Cobalt/GPUProc/doc/cobalt-data-flow/OutputProc.pdf b/RTCP/Cobalt/GPUProc/doc/cobalt-data-flow/OutputProc.pdf
index 412e74399ecddaedf719ff3c84baa1ff434305c3..aa6706be89c9bf4fdc1d75eea6c7ab84fa36c8f6 100644
--- a/RTCP/Cobalt/GPUProc/doc/cobalt-data-flow/OutputProc.pdf
+++ b/RTCP/Cobalt/GPUProc/doc/cobalt-data-flow/OutputProc.pdf
@@ -2,11 +2,11 @@
 %âãÏÓ
 1 0 obj
   <<
-    /Author()/Title(OutputProc)/Subject()/Producer()/Keywords()/CreationDate(D:20140521163034+00'00')/ModDate(D:20140521163034+00'00')/Creator(Sub Systems, Inc.)
+    /Author()/Title(OutputProc)/Subject()/Producer()/Keywords()/CreationDate(D:20170827170126+00'00')/ModDate(D:20170827170126+00'00')/Creator(Sub Systems, Inc.)
   >>
 endobj
 4 0 obj
-  <</Length 35433>>
+  <</Length 44523>>
   stream
         q 0.750000 0 0 0.750000 0.000000 841.650024 cm 
         q  
@@ -19,46 +19,46 @@ endobj
         % VpExtX: 793, VpExtY: -1122 (RecNo: 4)
          
         % WinOrgX: 0, WinOrgY: 0 (RecNo: 5)
-        q q q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q q q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
         n 
-        197 46 m
-297 46 l
-297 116 l
-197 116 l
-197 46 l
+        273 43 m
+373 43 l
+373 113 l
+273 113 l
+273 43 l
 
         .753 .749 .753 rg .753 .749 .753 RG 1 w 1 J
 f Q
         Q 
-        q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
         n 
-        197 46 m
-297 46 l
-297 116 l
-197 116 l
-197 46 l
+        273 43 m
+373 43 l
+373 113 l
+273 113 l
+273 43 l
 
         0 0 0 rg .753 .749 .753 RG 1 w 1 J 1 j s Q
         Q 
         Q 
-        q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
         n 
-        194 43 m
-294 43 l
-294 113 l
-194 113 l
-194 43 l
+        270 40 m
+370 40 l
+370 110 l
+270 110 l
+270 40 l
 
         .988 .949 .890 rg 0 0 0 RG 1 w 1 J
 f Q
         Q 
-        q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
         n 
-        194 43 m
-294 43 l
-294 113 l
-194 113 l
-194 43 l
+        270 40 m
+370 40 l
+370 110 l
+270 110 l
+270 40 l
 
         0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
         Q 
@@ -66,50 +66,52 @@ f Q
         q Q 
         q Q 
         q Q 
-        q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
-        BT /F0 10.000000 Tf 0 g 1 0 0 -1 224 71 Tm 0 -9 Td(E) Tj 8 0 Td(t) Tj 3 0 Td(h) Tj 6 0 Td(e) Tj 6 0 Td(r) Tj 3 0 Td(n) Tj 6 0 Td(e) Tj 6 0 Td(t) Tj ET Q
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 294 62 Tm 0 -9 Td(E) Tj 8 0 Td(t) Tj 3 0 Td(h) Tj 6 0 Td(e) Tj 6 0 Td(r) Tj 3 0 Td(n) Tj 6 0 Td(e) Tj 6 0 Td(t) Tj 2 0 Td( ) Tj 3 0 Td(o) Tj 6 0 Td(r) Tj ET Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 296 75 Tm 0 -9 Td(I) Tj 3 0 Td(n) Tj 6 0 Td(f) Tj 3 0 Td(i) Tj 2 0 Td(n) Tj 6 0 Td(i) Tj 2 0 Td(b) Tj 6 0 Td(a) Tj 6 0 Td(n) Tj 6 0 Td(d) Tj ET Q
         Q 
         Q 
-        q q q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q q q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
         n 
-        193 246 m
-193 218 171 196 143 196 c
-116 196 94 218 94 245 c
-94 273 116 295 144 295 c
-171 295 193 273 193 246 c
+        123 245 m
+123 218 101 196 73 196 c
+46 196 24 218 24 245 c
+24 273 46 295 74 295 c
+101 295 123 273 123 245 c
 h 
         .753 .749 .753 rg .753 .749 .753 RG 1 w 1 J
 f Q
         Q 
-        q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
         n 
-        193 246 m
-193 218 171 196 143 196 c
-116 196 94 218 94 245 c
-94 273 116 295 144 295 c
-171 295 193 273 193 246 c
+        123 245 m
+123 218 101 196 73 196 c
+46 196 24 218 24 245 c
+24 273 46 295 74 295 c
+101 295 123 273 123 245 c
 h 
         0 0 0 rg .753 .749 .753 RG 1 w 1 J 1 j s Q
         Q 
         Q 
-        q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
         n 
-        190 242 m
-190 270 168 292 140 292 c
-113 292 91 270 91 242 c
-91 215 113 193 141 193 c
-168 193 190 215 190 242 c
+        120 242 m
+120 270 98 292 70 292 c
+43 292 21 270 21 242 c
+21 215 43 193 71 193 c
+98 193 120 215 120 242 c
 h 
         .988 .949 .890 rg 0 0 0 RG 1 w 1 J
 f Q
         Q 
-        q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
         n 
-        190 242 m
-190 270 168 292 140 292 c
-113 292 91 270 91 242 c
-91 215 113 193 141 193 c
-168 193 190 215 190 242 c
+        120 242 m
+120 270 98 292 70 292 c
+43 292 21 270 21 242 c
+21 215 43 193 71 193 c
+98 193 120 215 120 242 c
 h 
         0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
         Q 
@@ -117,64 +119,64 @@ h
         q Q 
         q Q 
         q Q 
-        q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
-        BT /F0 10.000000 Tf 0 g 1 0 0 -1 109 230 Tm 0 -9 Td(I) Tj 3 0 Td(n) Tj 6 0 Td(p) Tj 6 0 Td(u) Tj 6 0 Td(t) Tj 3 0 Td(T) Tj 7 0 Td(h) Tj 6 0 Td(r) Tj 3 0 Td(e) Tj 6 0 Td(a) Tj 6 0 Td(d) Tj 6 0 Td(:) Tj 2 0 Td(:) Tj ET Q
-        q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
-        BT /F0 10.000000 Tf 0 g 1 0 0 -1 124 243 Tm 0 -9 Td(process) Tj ET Q
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 39 230 Tm 0 -9 Td(I) Tj 3 0 Td(n) Tj 6 0 Td(p) Tj 6 0 Td(u) Tj 6 0 Td(t) Tj 3 0 Td(T) Tj 7 0 Td(h) Tj 6 0 Td(r) Tj 3 0 Td(e) Tj 6 0 Td(a) Tj 6 0 Td(d) Tj 6 0 Td(:) Tj 2 0 Td(:) Tj ET Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 54 243 Tm 0 -9 Td(process) Tj ET Q
         Q 
         Q 
         q Q 
-        q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
         0 0 0 RG 2 w 1 J
 24 345 m 124 345 l S Q
-        q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
         0 0 0 RG 2 w 1 J
 24 395 m 124 395 l S Q
         q Q 
         q Q 
         q Q 
         q Q 
-        q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
         BT /F0 10.000000 Tf 0 g 1 0 0 -1 37 363 Tm 0 -9 Td(o) Tj 6 0 Td(u) Tj 6 0 Td(t) Tj 3 0 Td(p) Tj 6 0 Td(u) Tj 6 0 Td(t) Tj 3 0 Td(P) Tj 8 0 Td(o) Tj 6 0 Td(o) Tj 6 0 Td(l) Tj 2 0 Td(.) Tj 3 0 Td(f) Tj 2 0 Td(r) Tj 3 0 Td(e) Tj 6 0 Td(e) Tj ET Q
         Q 
         Q 
-        q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
         0 0 0 RG 2 w 1 J
 174 345 m 274 345 l S Q
-        q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
         0 0 0 RG 2 w 1 J
 174 395 m 274 395 l S Q
         q Q 
         q Q 
         q Q 
         q Q 
-        q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
         BT /F0 10.000000 Tf 0 g 1 0 0 -1 184 363 Tm 0 -9 Td(o) Tj 6 0 Td(u) Tj 6 0 Td(t) Tj 3 0 Td(p) Tj 6 0 Td(u) Tj 6 0 Td(t) Tj 3 0 Td(P) Tj 8 0 Td(o) Tj 6 0 Td(o) Tj 6 0 Td(l) Tj 2 0 Td(.) Tj 3 0 Td(f) Tj 3 0 Td(i) Tj 2 0 Td(l) Tj 2 0 Td(l) Tj 2 0 Td(e) Tj 6 0 Td(d) Tj ET Q
         Q 
         Q 
-        q q q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q q q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
         n 
-        203 509 m
+        203 510 m
 203 537 181 559 153 559 c
-126 559 104 537 104 509 c
+126 559 104 537 104 510 c
 104 482 126 460 154 460 c
-181 460 203 482 203 509 c
+181 460 203 482 203 510 c
 h 
         .753 .749 .753 rg .753 .749 .753 RG 1 w 1 J
 f Q
         Q 
-        q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
         n 
-        203 509 m
+        203 510 m
 203 537 181 559 153 559 c
-126 559 104 537 104 509 c
+126 559 104 537 104 510 c
 104 482 126 460 154 460 c
-181 460 203 482 203 509 c
+181 460 203 482 203 510 c
 h 
         0 0 0 rg .753 .749 .753 RG 1 w 1 J 1 j s Q
         Q 
         Q 
-        q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
         n 
         200 507 m
 200 534 178 556 150 556 c
@@ -185,7 +187,7 @@ h
         .988 .949 .890 rg 0 0 0 RG 1 w 1 J
 f Q
         Q 
-        q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
         n 
         200 507 m
 200 534 178 556 150 556 c
@@ -199,55 +201,55 @@ h
         q Q 
         q Q 
         q Q 
-        q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
         BT /F0 10.000000 Tf 0 g 1 0 0 -1 129 487 Tm 0 -9 Td(S) Tj 8 0 Td(u) Tj 6 0 Td(b) Tj 6 0 Td(b) Tj 6 0 Td(a) Tj 6 0 Td(n) Tj 6 0 Td(d) Tj ET Q
-        q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
         BT /F0 10.000000 Tf 0 g 1 0 0 -1 115 500 Tm 0 -9 Td(O) Tj 9 0 Td(u) Tj 6 0 Td(t) Tj 3 0 Td(p) Tj 6 0 Td(u) Tj 6 0 Td(t) Tj 3 0 Td(T) Tj 7 0 Td(h) Tj 6 0 Td(r) Tj 3 0 Td(e) Tj 6 0 Td(a) Tj 6 0 Td(d) Tj 6 0 Td(:) Tj 2 0 Td(:) Tj ET Q
-        q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
         BT /F0 10.000000 Tf 0 g 1 0 0 -1 134 513 Tm 0 -9 Td(doWork) Tj ET Q
         Q 
         Q 
         q Q 
-        q q q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q q q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
         n 
-        105 1018 m
-205 1018 l
-205 1088 l
-105 1088 l
-105 1018 l
+        323 1093 m
+423 1093 l
+423 1163 l
+323 1163 l
+323 1093 l
 
         .753 .749 .753 rg .753 .749 .753 RG 1 w 1 J
 f Q
         Q 
-        q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
         n 
-        105 1018 m
-205 1018 l
-205 1088 l
-105 1088 l
-105 1018 l
+        323 1093 m
+423 1093 l
+423 1163 l
+323 1163 l
+323 1093 l
 
         0 0 0 rg .753 .749 .753 RG 1 w 1 J 1 j s Q
         Q 
         Q 
-        q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
         n 
-        102 1015 m
-202 1015 l
-202 1085 l
-102 1085 l
-102 1015 l
+        320 1090 m
+420 1090 l
+420 1160 l
+320 1160 l
+320 1090 l
 
         .988 .949 .890 rg 0 0 0 RG 1 w 1 J
 f Q
         Q 
-        q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
         n 
-        102 1015 m
-202 1015 l
-202 1085 l
-102 1085 l
-102 1015 l
+        320 1090 m
+420 1090 l
+420 1160 l
+320 1160 l
+320 1090 l
 
         0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
         Q 
@@ -255,33 +257,33 @@ f Q
         q Q 
         q Q 
         q Q 
-        q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
-        BT /F0 10.000000 Tf 0 g 1 0 0 -1 143 1043 Tm 0 -9 Td(Disk) Tj ET Q
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 361 1118 Tm 0 -9 Td(Disk) Tj ET Q
         Q 
         Q 
-        q q q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q q q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
         n 
         447 247 m
-447 274 425 296 398 296 c
+447 274 425 296 397 296 c
 370 296 348 274 348 247 c
-348 219 370 197 398 197 c
+348 219 370 197 397 197 c
 425 197 447 219 447 247 c
 h 
         .753 .749 .753 rg .753 .749 .753 RG 1 w 1 J
 f Q
         Q 
-        q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
         n 
         447 247 m
-447 274 425 296 398 296 c
+447 274 425 296 397 296 c
 370 296 348 274 348 247 c
-348 219 370 197 398 197 c
+348 219 370 197 397 197 c
 425 197 447 219 447 247 c
 h 
         0 0 0 rg .753 .749 .753 RG 1 w 1 J 1 j s Q
         Q 
         Q 
-        q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
         n 
         444 244 m
 444 271 422 293 394 293 c
@@ -292,7 +294,7 @@ h
         .988 .949 .890 rg 0 0 0 RG 1 w 1 J
 f Q
         Q 
-        q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
         n 
         444 244 m
 444 271 422 293 394 293 c
@@ -306,30 +308,30 @@ h
         q Q 
         q Q 
         q Q 
-        q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
         BT /F0 10.000000 Tf 0 g 1 0 0 -1 360 231 Tm 0 -9 Td(M) Tj 9 0 Td(u) Tj 6 0 Td(l) Tj 2 0 Td(t) Tj 3 0 Td(i) Tj 2 0 Td(R) Tj 8 0 Td(e) Tj 6 0 Td(c) Tj 6 0 Td(e) Tj 6 0 Td(i) Tj 2 0 Td(v) Tj 6 0 Td(e) Tj 6 0 Td(r) Tj 3 0 Td(:) Tj 2 0 Td(:) Tj ET Q
-        q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
         BT /F0 10.000000 Tf 0 g 1 0 0 -1 366 244 Tm 0 -9 Td(r) Tj 3 0 Td(e) Tj 6 0 Td(c) Tj 6 0 Td(e) Tj 6 0 Td(i) Tj 2 0 Td(v) Tj 5 0 Td(e) Tj 6 0 Td(L) Tj 6 0 Td(o) Tj 6 0 Td(o) Tj 6 0 Td(p) Tj ET Q
         Q 
         Q 
         q Q 
-        q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
         0 0 0 RG 2 w 1 J
 345 344 m 445 344 l S Q
-        q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
         0 0 0 RG 2 w 1 J
 345 394 m 445 394 l S Q
         q Q 
         q Q 
         q Q 
         q Q 
-        q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
         BT /F0 10.000000 Tf 0 g 1 0 0 -1 358 356 Tm 0 -9 Td(B) Tj 8 0 Td(l) Tj 2 0 Td(o) Tj 6 0 Td(c) Tj 6 0 Td(k) Tj 6 0 Td(C) Tj 8 0 Td(o) Tj 6 0 Td(l) Tj 2 0 Td(l) Tj 2 0 Td(e) Tj 6 0 Td(c) Tj 5 0 Td(t) Tj 2 0 Td(o) Tj 6 0 Td(r) Tj 3 0 Td(:) Tj 2 0 Td(:) Tj ET Q
-        q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
         BT /F0 10.000000 Tf 0 g 1 0 0 -1 367 369 Tm 0 -9 Td(i) Tj 2 0 Td(n) Tj 6 0 Td(p) Tj 6 0 Td(u) Tj 6 0 Td(t) Tj 3 0 Td(Q) Tj 9 0 Td(u) Tj 6 0 Td(e) Tj 6 0 Td(u) Tj 6 0 Td(e) Tj ET Q
         Q 
         Q 
-        q q q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q q q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
         n 
         373 510 m
 373 538 351 560 324 560 c
@@ -340,7 +342,7 @@ h
         .753 .749 .753 rg .753 .749 .753 RG 1 w 1 J
 f Q
         Q 
-        q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
         n 
         373 510 m
 373 538 351 560 324 560 c
@@ -351,7 +353,7 @@ h
         0 0 0 rg .753 .749 .753 RG 1 w 1 J 1 j s Q
         Q 
         Q 
-        q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
         n 
         370 507 m
 370 535 348 557 321 557 c
@@ -362,7 +364,7 @@ h
         .988 .949 .890 rg 0 0 0 RG 1 w 1 J
 f Q
         Q 
-        q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
         n 
         370 507 m
 370 535 348 557 321 557 c
@@ -376,81 +378,81 @@ h
         q Q 
         q Q 
         q Q 
-        q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
         BT /F0 10.000000 Tf 0 g 1 0 0 -1 285 495 Tm 0 -9 Td(B) Tj 8 0 Td(l) Tj 2 0 Td(o) Tj 6 0 Td(c) Tj 6 0 Td(k) Tj 6 0 Td(C) Tj 8 0 Td(o) Tj 6 0 Td(l) Tj 2 0 Td(l) Tj 2 0 Td(e) Tj 6 0 Td(c) Tj 5 0 Td(t) Tj 2 0 Td(o) Tj 6 0 Td(r) Tj 3 0 Td(:) Tj 2 0 Td(:) Tj ET Q
-        q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
         BT /F0 10.000000 Tf 0 g 1 0 0 -1 297 508 Tm 0 -9 Td(i) Tj 2 0 Td(n) Tj 6 0 Td(p) Tj 6 0 Td(u) Tj 6 0 Td(t) Tj 3 0 Td(L) Tj 6 0 Td(o) Tj 6 0 Td(o) Tj 6 0 Td(p) Tj ET Q
         Q 
         Q 
         q Q 
-        q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
         0 0 0 RG 2 w 1 J
-261 884 m 361 884 l S Q
-        q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+250 850 m 350 850 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
         0 0 0 RG 2 w 1 J
-261 934 m 361 934 l S Q
+250 900 m 350 900 l S Q
         q Q 
         q Q 
         q Q 
         q Q 
-        q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
-        BT /F0 10.000000 Tf 0 g 1 0 0 -1 262 902 Tm 0 -9 Td(o) Tj 6 0 Td(u) Tj 6 0 Td(t) Tj 3 0 Td(p) Tj 6 0 Td(u) Tj 6 0 Td(t) Tj 3 0 Td(P) Tj 8 0 Td(o) Tj 6 0 Td(o) Tj 6 0 Td(l) Tj 2 0 Td(s) Tj 6 0 Td([) Tj 3 0 Td(f) Tj 3 0 Td(i) Tj 2 0 Td(l) Tj 2 0 Td(e) Tj 6 0 Td(]) Tj 3 0 Td(.) Tj 2 0 Td(f) Tj 2 0 Td(r) Tj 3 0 Td(e) Tj 6 0 Td(e) Tj ET Q
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 251 868 Tm 0 -9 Td(o) Tj 6 0 Td(u) Tj 6 0 Td(t) Tj 3 0 Td(p) Tj 6 0 Td(u) Tj 6 0 Td(t) Tj 3 0 Td(P) Tj 8 0 Td(o) Tj 6 0 Td(o) Tj 6 0 Td(l) Tj 2 0 Td(s) Tj 6 0 Td([) Tj 3 0 Td(f) Tj 3 0 Td(i) Tj 2 0 Td(l) Tj 2 0 Td(e) Tj 6 0 Td(]) Tj 3 0 Td(.) Tj 2 0 Td(f) Tj 2 0 Td(r) Tj 3 0 Td(e) Tj 6 0 Td(e) Tj ET Q
         Q 
         Q 
-        q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
         0 0 0 RG 2 w 1 J
-441 881 m 541 881 l S Q
-        q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+380 850 m 480 850 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
         0 0 0 RG 2 w 1 J
-441 931 m 541 931 l S Q
+380 900 m 480 900 l S Q
         q Q 
         q Q 
         q Q 
         q Q 
-        q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
-        BT /F0 10.000000 Tf 0 g 1 0 0 -1 439 899 Tm 0 -9 Td(o) Tj 6 0 Td(u) Tj 6 0 Td(t) Tj 3 0 Td(p) Tj 6 0 Td(u) Tj 6 0 Td(t) Tj 3 0 Td(P) Tj 8 0 Td(o) Tj 6 0 Td(o) Tj 6 0 Td(l) Tj 2 0 Td(s) Tj 6 0 Td([) Tj 3 0 Td(f) Tj 3 0 Td(i) Tj 2 0 Td(l) Tj 2 0 Td(e) Tj 6 0 Td(]) Tj 3 0 Td(.) Tj 3 0 Td(f) Tj 3 0 Td(i) Tj 2 0 Td(l) Tj 2 0 Td(l) Tj 2 0 Td(e) Tj 6 0 Td(d) Tj ET Q
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 378 868 Tm 0 -9 Td(o) Tj 6 0 Td(u) Tj 6 0 Td(t) Tj 3 0 Td(p) Tj 6 0 Td(u) Tj 6 0 Td(t) Tj 3 0 Td(P) Tj 8 0 Td(o) Tj 6 0 Td(o) Tj 6 0 Td(l) Tj 2 0 Td(s) Tj 6 0 Td([) Tj 3 0 Td(f) Tj 3 0 Td(i) Tj 2 0 Td(l) Tj 2 0 Td(e) Tj 6 0 Td(]) Tj 3 0 Td(.) Tj 3 0 Td(f) Tj 3 0 Td(i) Tj 2 0 Td(l) Tj 2 0 Td(l) Tj 2 0 Td(e) Tj 6 0 Td(d) Tj ET Q
         Q 
         Q 
-        q q q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q q q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
         n 
-        444 780 m
-444 807 422 829 394 829 c
-367 829 345 807 345 780 c
-345 752 367 730 394 730 c
-422 730 444 752 444 780 c
+        412 753 m
+412 780 390 802 362 802 c
+335 802 313 780 313 753 c
+313 725 335 703 363 703 c
+390 703 412 725 412 753 c
 h 
         .753 .749 .753 rg .753 .749 .753 RG 1 w 1 J
 f Q
         Q 
-        q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
         n 
-        444 780 m
-444 807 422 829 394 829 c
-367 829 345 807 345 780 c
-345 752 367 730 394 730 c
-422 730 444 752 444 780 c
+        412 753 m
+412 780 390 802 362 802 c
+335 802 313 780 313 753 c
+313 725 335 703 363 703 c
+390 703 412 725 412 753 c
 h 
         0 0 0 rg .753 .749 .753 RG 1 w 1 J 1 j s Q
         Q 
         Q 
-        q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
         n 
-        441 777 m
-441 804 419 826 391 826 c
-364 826 342 804 342 777 c
-342 749 364 727 391 727 c
-419 727 441 749 441 777 c
+        409 750 m
+409 777 387 799 359 799 c
+332 799 310 777 310 750 c
+310 722 332 700 360 700 c
+387 700 409 722 409 750 c
 h 
         .988 .949 .890 rg 0 0 0 RG 1 w 1 J
 f Q
         Q 
-        q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
         n 
-        441 777 m
-441 804 419 826 391 826 c
-364 826 342 804 342 777 c
-342 749 364 727 391 727 c
-419 727 441 749 441 777 c
+        409 750 m
+409 777 387 799 359 799 c
+332 799 310 777 310 750 c
+310 722 332 700 360 700 c
+387 700 409 722 409 750 c
 h 
         0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
         Q 
@@ -458,69 +460,69 @@ h
         q Q 
         q Q 
         q Q 
-        q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
-        BT /F0 10.000000 Tf 0 g 1 0 0 -1 356 764 Tm 0 -9 Td(B) Tj 8 0 Td(l) Tj 2 0 Td(o) Tj 6 0 Td(c) Tj 6 0 Td(k) Tj 6 0 Td(C) Tj 8 0 Td(o) Tj 6 0 Td(l) Tj 2 0 Td(l) Tj 2 0 Td(e) Tj 6 0 Td(c) Tj 5 0 Td(t) Tj 2 0 Td(o) Tj 6 0 Td(r) Tj 3 0 Td(:) Tj 2 0 Td(:) Tj ET Q
-        q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
-        BT /F0 10.000000 Tf 0 g 1 0 0 -1 365 777 Tm 0 -9 Td(o) Tj 6 0 Td(u) Tj 6 0 Td(t) Tj 3 0 Td(p) Tj 6 0 Td(u) Tj 6 0 Td(t) Tj 3 0 Td(L) Tj 6 0 Td(o) Tj 6 0 Td(o) Tj 6 0 Td(p) Tj ET Q
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 324 737 Tm 0 -9 Td(B) Tj 8 0 Td(l) Tj 2 0 Td(o) Tj 6 0 Td(c) Tj 6 0 Td(k) Tj 6 0 Td(C) Tj 8 0 Td(o) Tj 6 0 Td(l) Tj 2 0 Td(l) Tj 2 0 Td(e) Tj 6 0 Td(c) Tj 5 0 Td(t) Tj 2 0 Td(o) Tj 6 0 Td(r) Tj 3 0 Td(:) Tj 2 0 Td(:) Tj ET Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 333 750 Tm 0 -9 Td(o) Tj 6 0 Td(u) Tj 6 0 Td(t) Tj 3 0 Td(p) Tj 6 0 Td(u) Tj 6 0 Td(t) Tj 3 0 Td(L) Tj 6 0 Td(o) Tj 6 0 Td(o) Tj 6 0 Td(p) Tj ET Q
         Q 
         Q 
         q Q 
-        q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
         0 0 0 RG 2 w 1 J
-347 616 m 447 616 l S Q
-        q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+316 616 m 416 616 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
         0 0 0 RG 2 w 1 J
-347 666 m 447 666 l S Q
+316 666 m 416 666 l S Q
         q Q 
         q Q 
         q Q 
         q Q 
-        q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
-        BT /F0 10.000000 Tf 0 g 1 0 0 -1 360 628 Tm 0 -9 Td(B) Tj 8 0 Td(l) Tj 2 0 Td(o) Tj 6 0 Td(c) Tj 6 0 Td(k) Tj 6 0 Td(C) Tj 8 0 Td(o) Tj 6 0 Td(l) Tj 2 0 Td(l) Tj 2 0 Td(e) Tj 6 0 Td(c) Tj 5 0 Td(t) Tj 2 0 Td(o) Tj 6 0 Td(r) Tj 3 0 Td(:) Tj 2 0 Td(:) Tj ET Q
-        q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
-        BT /F0 10.000000 Tf 0 g 1 0 0 -1 366 641 Tm 0 -9 Td(o) Tj 6 0 Td(u) Tj 6 0 Td(t) Tj 3 0 Td(p) Tj 6 0 Td(u) Tj 6 0 Td(t) Tj 3 0 Td(Q) Tj 9 0 Td(u) Tj 6 0 Td(e) Tj 6 0 Td(u) Tj 6 0 Td(e) Tj ET Q
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 329 628 Tm 0 -9 Td(B) Tj 8 0 Td(l) Tj 2 0 Td(o) Tj 6 0 Td(c) Tj 6 0 Td(k) Tj 6 0 Td(C) Tj 8 0 Td(o) Tj 6 0 Td(l) Tj 2 0 Td(l) Tj 2 0 Td(e) Tj 6 0 Td(c) Tj 5 0 Td(t) Tj 2 0 Td(o) Tj 6 0 Td(r) Tj 3 0 Td(:) Tj 2 0 Td(:) Tj ET Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 335 641 Tm 0 -9 Td(o) Tj 6 0 Td(u) Tj 6 0 Td(t) Tj 3 0 Td(p) Tj 6 0 Td(u) Tj 6 0 Td(t) Tj 3 0 Td(Q) Tj 9 0 Td(u) Tj 6 0 Td(e) Tj 6 0 Td(u) Tj 6 0 Td(e) Tj ET Q
         Q 
         Q 
-        q q q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q q q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
         n 
-        447 1054 m
-447 1082 425 1104 398 1104 c
-370 1104 348 1082 348 1054 c
-348 1027 370 1005 398 1005 c
-425 1005 447 1027 447 1054 c
+        416 988 m
+416 1015 394 1037 367 1037 c
+339 1037 317 1015 317 988 c
+317 960 339 938 367 938 c
+394 938 416 960 416 988 c
 h 
         .753 .749 .753 rg .753 .749 .753 RG 1 w 1 J
 f Q
         Q 
-        q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
         n 
-        447 1054 m
-447 1082 425 1104 398 1104 c
-370 1104 348 1082 348 1054 c
-348 1027 370 1005 398 1005 c
-425 1005 447 1027 447 1054 c
+        416 988 m
+416 1015 394 1037 367 1037 c
+339 1037 317 1015 317 988 c
+317 960 339 938 367 938 c
+394 938 416 960 416 988 c
 h 
         0 0 0 rg .753 .749 .753 RG 1 w 1 J 1 j s Q
         Q 
         Q 
-        q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
         n 
-        444 1051 m
-444 1079 422 1101 394 1101 c
-367 1101 345 1079 345 1051 c
-345 1024 367 1002 394 1002 c
-422 1002 444 1024 444 1051 c
+        413 985 m
+413 1012 391 1034 364 1034 c
+336 1034 314 1012 314 985 c
+314 957 336 935 364 935 c
+391 935 413 957 413 985 c
 h 
         .988 .949 .890 rg 0 0 0 RG 1 w 1 J
 f Q
         Q 
-        q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
         n 
-        444 1051 m
-444 1079 422 1101 394 1101 c
-367 1101 345 1079 345 1051 c
-345 1024 367 1002 394 1002 c
-422 1002 444 1024 444 1051 c
+        413 985 m
+413 1012 391 1034 364 1034 c
+336 1034 314 1012 314 985 c
+314 957 336 935 364 935 c
+391 935 413 957 413 985 c
 h 
         0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
         Q 
@@ -528,198 +530,998 @@ h
         q Q 
         q Q 
         q Q 
-        q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
-        BT /F0 10.000000 Tf 0 g 1 0 0 -1 349 1039 Tm 0 -9 Td(T) Tj 7 0 Td(A) Tj 8 0 Td(B) Tj 8 0 Td(O) Tj 9 0 Td(u) Tj 6 0 Td(t) Tj 3 0 Td(p) Tj 6 0 Td(u) Tj 6 0 Td(t) Tj 3 0 Td(T) Tj 7 0 Td(h) Tj 6 0 Td(r) Tj 3 0 Td(e) Tj 6 0 Td(a) Tj 6 0 Td(d) Tj 6 0 Td(:) Tj 2 0 Td(:) Tj ET Q
-        q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
-        BT /F0 10.000000 Tf 0 g 1 0 0 -1 378 1052 Tm 0 -9 Td(doWork) Tj ET Q
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 318 972 Tm 0 -9 Td(T) Tj 7 0 Td(A) Tj 8 0 Td(B) Tj 8 0 Td(O) Tj 9 0 Td(u) Tj 6 0 Td(t) Tj 3 0 Td(p) Tj 6 0 Td(u) Tj 6 0 Td(t) Tj 3 0 Td(T) Tj 7 0 Td(h) Tj 6 0 Td(r) Tj 3 0 Td(e) Tj 6 0 Td(a) Tj 6 0 Td(d) Tj 6 0 Td(:) Tj 2 0 Td(:) Tj ET Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 347 985 Tm 0 -9 Td(doWork) Tj ET Q
         Q 
         Q 
         q Q 
-        q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
         .753 .749 .753 rg 0 0 0 RG 1 w 1 J
-461 221 138 54 re f
+203 225 138 54 re f
 Q
-        q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
         .969 .953 .969 rg 0 0 0 RG 1 w 1 J
-458 206 m
-458 273 l
-597 273 l
-597 218 l
-585 206 l
-458 206 l
+200 210 m
+200 277 l
+339 277 l
+339 222 l
+327 210 l
+200 210 l
 B Q
-        q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
         .831 .816 .831 rg 0 0 0 RG 1 w 1 J
-585 206 m
-585 218 l
-597 218 l
-585 206 l
+327 210 m
+327 222 l
+339 222 l
+327 210 l
 B Q
         q  
-        % VpExtX: 793, VpExtY: 1122 (RecNo: 2096)
-        q 0.957861 -0.000000 -0.000000 0.959649 0.000000 -0.000000 cm 
-        BT /F1 10.000000 Tf 0 g 463 -230 Td(MultiReceiver demultiplexes ) Tj ET Q
-        q 0.957861 -0.000000 -0.000000 0.959649 0.000000 -0.000000 cm 
-        BT /F1 10.000000 Tf 0 g 463 -242 Td(subbands of different TABs ) Tj ET Q
-        q 0.957861 -0.000000 -0.000000 0.959649 0.000000 -0.000000 cm 
-        BT /F1 10.000000 Tf 0 g 463 -254 Td(coming from the same Cobalt ) Tj ET Q
-        q 0.957861 -0.000000 -0.000000 0.959649 0.000000 -0.000000 cm 
-        BT /F1 10.000000 Tf 0 g 463 -266 Td(node.) Tj ET Q
-        Q 
-        q q q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
-        n 
-        540 509 m
-540 537 518 559 490 559 c
-463 559 441 537 441 509 c
-441 482 463 460 491 460 c
-518 460 540 482 540 509 c
+        % VpExtX: 793, VpExtY: 1122 (RecNo: 2099)
+        q 0.957866 -0.000000 -0.000000 0.959609 0.000000 -0.000000 cm 
+        BT /F1 10.000000 Tf 0 g 205 -234 Td(MultiReceiver demultiplexes ) Tj ET Q
+        q 0.957866 -0.000000 -0.000000 0.959609 0.000000 -0.000000 cm 
+        BT /F1 10.000000 Tf 0 g 205 -246 Td(subbands of different TABs ) Tj ET Q
+        q 0.957866 -0.000000 -0.000000 0.959609 0.000000 -0.000000 cm 
+        BT /F1 10.000000 Tf 0 g 205 -258 Td(coming from the same Cobalt ) Tj ET Q
+        q 0.957866 -0.000000 -0.000000 0.959609 0.000000 -0.000000 cm 
+        BT /F1 10.000000 Tf 0 g 205 -270 Td(node.) Tj ET Q
+        Q 
+        q q q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        n 
+        512 513 m
+512 540 490 562 462 562 c
+435 562 413 540 413 513 c
+413 485 435 463 463 463 c
+490 463 512 485 512 513 c
+h 
+        .753 .749 .753 rg .753 .749 .753 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        n 
+        512 513 m
+512 540 490 562 462 562 c
+435 562 413 540 413 513 c
+413 485 435 463 463 463 c
+490 463 512 485 512 513 c
+h 
+        0 0 0 rg .753 .749 .753 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        n 
+        509 510 m
+509 537 487 559 459 559 c
+432 559 410 537 410 510 c
+410 482 432 460 460 460 c
+487 460 509 482 509 510 c
+h 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        n 
+        509 510 m
+509 537 487 559 459 559 c
+432 559 410 537 410 510 c
+410 482 432 460 460 460 c
+487 460 509 482 509 510 c
+h 
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        q Q 
+        q Q 
+        q Q 
+        q Q 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 424 497 Tm 0 -9 Td(B) Tj 8 0 Td(l) Tj 2 0 Td(o) Tj 6 0 Td(c) Tj 6 0 Td(k) Tj 6 0 Td(C) Tj 8 0 Td(o) Tj 6 0 Td(l) Tj 2 0 Td(l) Tj 2 0 Td(e) Tj 6 0 Td(c) Tj 5 0 Td(t) Tj 2 0 Td(o) Tj 6 0 Td(r) Tj 3 0 Td(:) Tj 2 0 Td(:) Tj ET Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 450 510 Tm 0 -9 Td(e) Tj 7 0 Td(m) Tj 9 0 Td(i) Tj 2 0 Td(t) Tj ET Q
+        Q 
+        Q 
+        q Q 
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        .753 .749 .753 rg 0 0 0 RG 1 w 1 J
+432 575 78 42 re f
+Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        .969 .953 .969 rg 0 0 0 RG 1 w 1 J
+429 560 m
+429 615 l
+508 615 l
+508 572 l
+496 560 l
+429 560 l
+B Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        .831 .816 .831 rg 0 0 0 RG 1 w 1 J
+496 560 m
+496 572 l
+508 572 l
+496 560 l
+B Q
+        q  
+        % VpExtX: 793, VpExtY: 1122 (RecNo: 2314)
+        q 0.957866 -0.000000 -0.000000 0.959609 0.000000 -0.000000 cm 
+        BT /F1 10.000000 Tf 0 g 434 -584 Td(Subbands are ) Tj ET Q
+        q 0.957866 -0.000000 -0.000000 0.959609 0.000000 -0.000000 cm 
+        BT /F1 10.000000 Tf 0 g 434 -596 Td(interwoven ) Tj ET Q
+        q 0.957866 -0.000000 -0.000000 0.959609 0.000000 -0.000000 cm 
+        BT /F1 10.000000 Tf 0 g 434 -608 Td(upon emission.) Tj ET Q
+        Q 
+        q q q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        n 
+        612 242 m
+612 270 590 292 562 292 c
+535 292 513 270 513 242 c
+513 215 535 193 563 193 c
+590 193 612 215 612 242 c
+h 
+        .753 .749 .753 rg .753 .749 .753 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        n 
+        612 242 m
+612 270 590 292 562 292 c
+535 292 513 270 513 242 c
+513 215 535 193 563 193 c
+590 193 612 215 612 242 c
+h 
+        0 0 0 rg .753 .749 .753 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        n 
+        609 239 m
+609 267 587 289 559 289 c
+532 289 510 267 510 239 c
+510 212 532 190 560 190 c
+587 190 609 212 609 239 c
+h 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        n 
+        609 239 m
+609 267 587 289 559 289 c
+532 289 510 267 510 239 c
+510 212 532 190 560 190 c
+587 190 609 212 609 239 c
+h 
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        q Q 
+        q Q 
+        q Q 
+        q Q 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 528 227 Tm 0 -9 Td(I) Tj 3 0 Td(n) Tj 6 0 Td(p) Tj 6 0 Td(u) Tj 6 0 Td(t) Tj 3 0 Td(T) Tj 7 0 Td(h) Tj 6 0 Td(r) Tj 3 0 Td(e) Tj 6 0 Td(a) Tj 6 0 Td(d) Tj 6 0 Td(:) Tj 2 0 Td(:) Tj ET Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 543 240 Tm 0 -9 Td(process) Tj ET Q
+        Q 
+        Q 
+        q Q 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        0 0 0 RG 2 w 1 J
+640 350 m 740 350 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        0 0 0 RG 2 w 1 J
+640 400 m 740 400 l S Q
+        q Q 
+        q Q 
+        q Q 
+        q Q 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 650 368 Tm 0 -9 Td(o) Tj 6 0 Td(u) Tj 6 0 Td(t) Tj 3 0 Td(p) Tj 6 0 Td(u) Tj 6 0 Td(t) Tj 3 0 Td(P) Tj 8 0 Td(o) Tj 6 0 Td(o) Tj 6 0 Td(l) Tj 2 0 Td(.) Tj 3 0 Td(f) Tj 3 0 Td(i) Tj 2 0 Td(l) Tj 2 0 Td(l) Tj 2 0 Td(e) Tj 6 0 Td(d) Tj ET Q
+        Q 
+        Q 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        0 0 0 RG 2 w 1 J
+500 350 m 600 350 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        0 0 0 RG 2 w 1 J
+500 400 m 600 400 l S Q
+        q Q 
+        q Q 
+        q Q 
+        q Q 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 513 368 Tm 0 -9 Td(o) Tj 6 0 Td(u) Tj 6 0 Td(t) Tj 3 0 Td(p) Tj 6 0 Td(u) Tj 6 0 Td(t) Tj 3 0 Td(P) Tj 8 0 Td(o) Tj 6 0 Td(o) Tj 6 0 Td(l) Tj 2 0 Td(.) Tj 3 0 Td(f) Tj 2 0 Td(r) Tj 3 0 Td(e) Tj 6 0 Td(e) Tj ET Q
+        Q 
+        Q 
+        q q q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        n 
+        672 513 m
+672 540 650 562 622 562 c
+595 562 573 540 573 513 c
+573 485 595 463 623 463 c
+650 463 672 485 672 513 c
 h 
         .753 .749 .753 rg .753 .749 .753 RG 1 w 1 J
 f Q
         Q 
-        q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        n 
+        672 513 m
+672 540 650 562 622 562 c
+595 562 573 540 573 513 c
+573 485 595 463 623 463 c
+650 463 672 485 672 513 c
+h 
+        0 0 0 rg .753 .749 .753 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        n 
+        669 510 m
+669 537 647 559 619 559 c
+592 559 570 537 570 510 c
+570 482 592 460 620 460 c
+647 460 669 482 669 510 c
+h 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        n 
+        669 510 m
+669 537 647 559 619 559 c
+592 559 570 537 570 510 c
+570 482 592 460 620 460 c
+647 460 669 482 669 510 c
+h 
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        q Q 
+        q Q 
+        q Q 
+        q Q 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 599 490 Tm 0 -9 Td(RSPRaw) Tj ET Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 584 503 Tm 0 -9 Td(O) Tj 9 0 Td(u) Tj 6 0 Td(t) Tj 3 0 Td(p) Tj 6 0 Td(u) Tj 6 0 Td(t) Tj 3 0 Td(T) Tj 7 0 Td(h) Tj 6 0 Td(r) Tj 3 0 Td(e) Tj 6 0 Td(a) Tj 6 0 Td(d) Tj 6 0 Td(:) Tj 2 0 Td(:) Tj ET Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 603 516 Tm 0 -9 Td(doWork) Tj ET Q
+        Q 
+        Q 
+        q Q 
+        q Q 
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+392 800 m
+398 810 410 831 418 850 c S Q
+        q Q 
+        q q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        n 
+        418 850 m
+417 833 l
+406 838 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        n 
+        418 850 m
+417 833 l
+406 838 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q Q 
+        q q Q 
+        Q 
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+72 293 m 72 300 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+72 304 m 72 311 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+72 315 m 72 322 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+72 326 m 72 333 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+72 337 m 72 344 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+72 293 m 77 308 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+72 293 m 67 308 l S Q
+        q Q 
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+371 508 m
+380 508 397 509 410 511 c S Q
+        q Q 
+        q q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        n 
+        410 511 m
+395 503 l
+393 515 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        n 
+        410 511 m
+395 503 l
+393 515 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q Q 
+        q q Q 
+        Q 
+        q Q 
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+121 281 m
+144 299 176 326 196 345 c S Q
+        q Q 
+        q q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        n 
+        196 345 m
+188 330 l
+180 338 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        n 
+        196 345 m
+188 330 l
+180 338 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q Q 
+        q q Q 
+        Q 
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+88 395 m 91 402 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+94 406 m 97 413 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+100 417 m 103 424 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+106 428 m 109 435 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+112 439 m 115 446 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+118 450 m 122 457 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+88 395 m 100 406 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+88 395 m 91 411 l S Q
+        q Q 
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+210 395 m
+200 413 186 439 176 457 c S Q
+        q Q 
+        q q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        n 
+        176 457 m
+189 446 l
+178 440 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        n 
+        176 457 m
+189 446 l
+178 440 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q Q 
+        q q Q 
+        Q 
+        q Q 
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+154 557 m
+172 803 248 1034 329 1090 c S Q
+        q Q 
+        q q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        n 
+        329 1090 m
+319 1076 l
+312 1086 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        n 
+        329 1090 m
+319 1076 l
+312 1086 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q Q 
+        q q Q 
+        Q 
+        q Q 
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+319 110 m
+331 132 351 168 366 194 c S Q
+        q Q 
+        q q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        n 
+        366 194 m
+363 177 l
+353 183 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        n 
+        366 194 m
+363 177 l
+353 183 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        q 1 0 0 -1 276 147 cm 1 1 1 rg 0 0 64 -11 re f Q
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 276 147 Tm 0 -9 Td(B) Tj 8 0 Td(e) Tj 6 0 Td(a) Tj 6 0 Td(m) Tj 9 0 Td(f) Tj 3 0 Td(o) Tj 6 0 Td(r) Tj 3 0 Td(m) Tj 9 0 Td(e) Tj 6 0 Td(r) Tj 3 0 Td(:) Tj ET Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        q 1 0 0 -1 276 160 cm 1 1 1 rg 0 0 112 -11 re f Q
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 276 160 Tm 0 -9 Td([) Tj 3 0 Td(t) Tj 3 0 Td(a) Tj 6 0 Td(b) Tj 6 0 Td(]) Tj 3 0 Td([) Tj 3 0 Td(s) Tj 6 0 Td(u) Tj 6 0 Td(b) Tj 6 0 Td(b) Tj 6 0 Td(a) Tj 6 0 Td(n) Tj 6 0 Td(d) Tj 6 0 Td(]) Tj 2 0 Td([) Tj 2 0 Td(s) Tj 5 0 Td(a) Tj 6 0 Td(m) Tj 9 0 Td(p) Tj 6 0 Td(l) Tj 2 0 Td(e) Tj 6 0 Td(]) Tj ET Q
+        q Q 
+        q q Q 
+        Q 
+        q Q 
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+394 294 m
+394 307 394 329 394 344 c S Q
+        q Q 
+        q q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        n 
+        394 344 m
+400 328 l
+388 328 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        n 
+        394 344 m
+400 328 l
+388 328 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        q 1 0 0 -1 351 304 cm 1 1 1 rg 0 0 90 -11 re f Q
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 351 304 Tm 0 -9 Td([) Tj 3 0 Td(s) Tj 6 0 Td(u) Tj 6 0 Td(b) Tj 6 0 Td(b) Tj 6 0 Td(a) Tj 6 0 Td(n) Tj 6 0 Td(d) Tj 6 0 Td(]) Tj 2 0 Td([) Tj 2 0 Td(s) Tj 5 0 Td(a) Tj 6 0 Td(m) Tj 9 0 Td(p) Tj 6 0 Td(l) Tj 2 0 Td(e) Tj 6 0 Td(]) Tj ET Q
+        q Q 
+        q q Q 
+        Q 
+        q Q 
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+382 394 m
+374 412 359 440 349 458 c S Q
+        q Q 
+        q q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        n 
+        349 458 m
+362 447 l
+352 441 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        n 
+        349 458 m
+362 447 l
+352 441 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q Q 
+        q q Q 
+        Q 
+        q Q 
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+283 110 m
+238 139 167 183 121 211 c S Q
+        q Q 
+        q q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        n 
+        121 211 m
+138 208 l
+132 198 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        n 
+        121 211 m
+138 208 l
+132 198 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        q 1 0 0 -1 181 154 cm 1 1 1 rg 0 0 48 -11 re f Q
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 181 154 Tm 0 -9 Td(C) Tj 8 0 Td(o) Tj 6 0 Td(r) Tj 3 0 Td(r) Tj 3 0 Td(e) Tj 6 0 Td(l) Tj 2 0 Td(a) Tj 6 0 Td(t) Tj 2 0 Td(o) Tj 6 0 Td(r) Tj ET Q
+        q Q 
+        q q Q 
+        Q 
+        q Q 
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+364 666 m
+364 668 364 683 363 700 c S Q
+        q Q 
+        q q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        n 
+        363 700 m
+370 684 l
+358 684 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        n 
+        363 700 m
+370 684 l
+358 684 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q Q 
+        q q Q 
+        Q 
+        q Q 
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+608 560 m
+547 819 462 1049 412 1090 c S Q
+        q Q 
+        q q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        n 
+        412 1090 m
+428 1085 l
+421 1075 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
         n 
-        540 509 m
-540 537 518 559 490 559 c
-463 559 441 537 441 509 c
-441 482 463 460 491 460 c
-518 460 540 482 540 509 c
-h 
-        0 0 0 rg .753 .749 .753 RG 1 w 1 J 1 j s Q
+        412 1090 m
+428 1085 l
+421 1075 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
         Q 
         Q 
-        q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q Q 
+        q q Q 
+        Q 
+        q Q 
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+415 900 m
+410 909 401 924 394 935 c S Q
+        q Q 
+        q q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
         n 
-        537 507 m
-537 534 515 556 487 556 c
-460 556 438 534 438 507 c
-438 479 460 457 488 457 c
-515 457 537 479 537 507 c
-h 
-        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+        394 935 m
+408 925 l
+397 918 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J
 f Q
         Q 
-        q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
         n 
-        537 507 m
-537 534 515 556 487 556 c
-460 556 438 534 438 507 c
-438 479 460 457 488 457 c
-515 457 537 479 537 507 c
-h 
+        394 935 m
+408 925 l
+397 918 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q Q 
+        q q Q 
+        Q 
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+314 900 m 318 907 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+320 911 m 324 918 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+326 922 m 330 929 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+332 933 m 334 935 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+314 900 m 326 911 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+314 900 m 317 916 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+336 800 m 333 807 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+331 811 m 328 818 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+326 822 m 323 829 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+321 833 m 317 840 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+315 844 m 312 850 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+336 800 m 334 816 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+336 800 m 325 811 l S Q
+        q Q 
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+358 1035 m
+357 1048 361 1072 367 1090 c S Q
+        q Q 
+        q q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        n 
+        367 1090 m
+367 1073 l
+356 1077 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        n 
+        367 1090 m
+367 1073 l
+356 1077 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q Q 
+        q q Q 
+        Q 
+        q Q 
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+357 110 m
+392 135 458 178 510 209 c S Q
+        q Q 
+        q q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        n 
+        510 209 m
+499 196 l
+493 206 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        n 
+        510 209 m
+499 196 l
+493 206 l
+
         0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
         Q 
+        Q 
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        q 1 0 0 -1 407 143 cm 1 1 1 rg 0 0 42 -11 re f Q
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 407 143 Tm 0 -9 Td(RSP raw) Tj ET Q
+        q Q 
+        q q Q 
+        Q 
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+551 290 m 551 297 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+551 301 m 551 308 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+551 312 m 551 319 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+551 323 m 551 330 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+551 334 m 551 341 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+551 345 m 551 350 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+551 290 m 556 305 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+551 290 m 546 305 l S Q
+        q Q 
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+607 290 m
+623 307 649 333 665 350 c S Q
         q Q 
+        q q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        n 
+        665 350 m
+658 334 l
+650 343 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        n 
+        665 350 m
+658 334 l
+650 343 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
         q Q 
+        q q Q 
+        Q 
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+562 400 m 565 407 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+567 411 m 571 418 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+573 422 m 577 429 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+579 433 m 583 440 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+585 444 m 589 451 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+591 455 m 594 460 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+562 400 m 573 411 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+562 400 m 565 416 l S Q
         q Q 
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+676 400 m
+668 417 654 443 645 460 c S Q
         q Q 
-        q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
-        BT /F0 10.000000 Tf 0 g 1 0 0 -1 452 494 Tm 0 -9 Td(B) Tj 8 0 Td(l) Tj 2 0 Td(o) Tj 6 0 Td(c) Tj 6 0 Td(k) Tj 6 0 Td(C) Tj 8 0 Td(o) Tj 6 0 Td(l) Tj 2 0 Td(l) Tj 2 0 Td(e) Tj 6 0 Td(c) Tj 5 0 Td(t) Tj 2 0 Td(o) Tj 6 0 Td(r) Tj 3 0 Td(:) Tj 2 0 Td(:) Tj ET Q
-        q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
-        BT /F0 10.000000 Tf 0 g 1 0 0 -1 478 507 Tm 0 -9 Td(e) Tj 7 0 Td(m) Tj 9 0 Td(i) Tj 2 0 Td(t) Tj ET Q
+        q q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        n 
+        645 460 m
+658 449 l
+647 443 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        n 
+        645 460 m
+658 449 l
+647 443 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
         Q 
         Q 
         q Q 
-        q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
-        .753 .749 .753 rg 0 0 0 RG 1 w 1 J
-554 489 78 42 re f
-Q
-        q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
-        .969 .953 .969 rg 0 0 0 RG 1 w 1 J
-551 474 m
-551 529 l
-630 529 l
-630 486 l
-618 474 l
-551 474 l
-B Q
-        q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
-        .831 .816 .831 rg 0 0 0 RG 1 w 1 J
-618 474 m
-618 486 l
-630 486 l
-618 474 l
-B Q
-        q  
-        % VpExtX: 793, VpExtY: 1122 (RecNo: 2311)
-        q 0.957861 -0.000000 -0.000000 0.959649 0.000000 -0.000000 cm 
-        BT /F1 10.000000 Tf 0 g 556 -498 Td(Subbands are ) Tj ET Q
-        q 0.957861 -0.000000 -0.000000 0.959649 0.000000 -0.000000 cm 
-        BT /F1 10.000000 Tf 0 g 556 -510 Td(interwoven ) Tj ET Q
-        q 0.957861 -0.000000 -0.000000 0.959649 0.000000 -0.000000 cm 
-        BT /F1 10.000000 Tf 0 g 556 -522 Td(upon emission.) Tj ET Q
+        q q Q 
+        Q 
+        q Q 
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+423 560 m
+416 570 399 594 383 616 c S Q
+        q Q 
+        q q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        n 
+        383 616 m
+397 607 l
+387 600 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        n 
+        383 616 m
+397 607 l
+387 600 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q 0.957866 -0.000000 -0.000000 -0.959609 0.000000 -0.000000 cm 
+        q 1 0 0 -1 335 577 cm 1 1 1 rg 0 0 90 -11 re f Q
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 335 577 Tm 0 -9 Td([) Tj 3 0 Td(s) Tj 6 0 Td(a) Tj 6 0 Td(m) Tj 9 0 Td(p) Tj 6 0 Td(l) Tj 2 0 Td(e) Tj 6 0 Td(]) Tj 3 0 Td([) Tj 2 0 Td(s) Tj 5 0 Td(u) Tj 6 0 Td(b) Tj 6 0 Td(b) Tj 6 0 Td(a) Tj 6 0 Td(n) Tj 6 0 Td(d) Tj 6 0 Td(]) Tj ET Q
+        q Q 
+        q q Q 
         Q 
+        Q
+        Q
+
+endstream
+endobj
+5 0 obj
+  <<
+    /Type/Page
+    /Parent 3 0 R
+    /Resources 2 0 R
+    /MediaBox [0 0 594 841]
+    /Contents 4 0 R
+    /Group << /S /Transparency /CS /DeviceRGB /I false /K false >>
+  >>
+endobj
+6 0 obj
+  <</Length 18145>>
+  stream
+        q 0.750000 0 0 0.750000 0.000000 841.650024 cm 
+        q  
+        % VpOrgX: 0, VpOrgY: 0 (RecNo: 1)
+         
+        % mm: 8 (RecNo: 2)
+         
+        % WinExtX: 827, WinExtY: 1169 (RecNo: 3)
+         
+        % VpExtX: 793, VpExtY: -1122 (RecNo: 4)
+         
+        % WinOrgX: 827, WinOrgY: 0 (RecNo: 5)
         q Q 
-        q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
         0 0 0 RG 1 w 1 J
-222 113 m
-208 136 186 170 172 193 c S Q
+392 800 m
+398 810 410 831 418 850 c S Q
         q Q 
-        q q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q q q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
         n 
-        172 193 m
-186 183 l
-175 176 l
+        418 850 m
+417 833 l
+406 838 l
 
         0 0 0 rg 0 0 0 RG 1 w 1 J
 f Q
         Q 
-        q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
         n 
-        172 193 m
-186 183 l
-175 176 l
+        418 850 m
+417 833 l
+406 838 l
 
         0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
         Q 
         Q 
-        q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
-        q 1 0 0 -1 174 139 cm 1 1 1 rg 0 0 48 -11 re f Q
-        BT /F0 10.000000 Tf 0 g 1 0 0 -1 174 139 Tm 0 -9 Td(C) Tj 8 0 Td(o) Tj 6 0 Td(r) Tj 3 0 Td(r) Tj 3 0 Td(e) Tj 6 0 Td(l) Tj 2 0 Td(a) Tj 6 0 Td(t) Tj 2 0 Td(o) Tj 6 0 Td(r) Tj ET Q
         q Q 
         q q Q 
         Q 
-        q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+72 293 m 72 300 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
         0 0 0 RG 1 w 1 J
-114 293 m 111 300 l S Q
-        q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+72 304 m 72 311 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
         0 0 0 RG 1 w 1 J
-109 304 m 105 311 l S Q
-        q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+72 315 m 72 322 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
         0 0 0 RG 1 w 1 J
-103 315 m 99 322 l S Q
-        q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+72 326 m 72 333 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
         0 0 0 RG 1 w 1 J
-97 326 m 94 333 l S Q
-        q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+72 337 m 72 344 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
         0 0 0 RG 1 w 1 J
-92 337 m 88 344 l S Q
-        q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+72 293 m 77 308 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
         0 0 0 RG 1 w 1 J
-114 293 m 112 309 l S Q
-        q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+72 293 m 67 308 l S Q
+        q Q 
+        q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
         0 0 0 RG 1 w 1 J
-114 293 m 103 304 l S Q
+371 508 m
+380 508 397 509 410 511 c S Q
+        q Q 
+        q q q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
+        n 
+        410 511 m
+395 503 l
+393 515 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
+        n 
+        410 511 m
+395 503 l
+393 515 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q Q 
+        q q Q 
+        Q 
         q Q 
-        q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
         0 0 0 RG 1 w 1 J
-173 293 m
-183 308 197 330 207 345 c S Q
+121 281 m
+144 299 176 326 196 345 c S Q
         q Q 
-        q q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q q q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
         n 
-        207 345 m
-203 328 l
-193 335 l
+        196 345 m
+188 330 l
+180 338 l
 
         0 0 0 rg 0 0 0 RG 1 w 1 J
 f Q
         Q 
-        q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
         n 
-        207 345 m
-203 328 l
-193 335 l
+        196 345 m
+188 330 l
+180 338 l
 
         0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
         Q 
@@ -727,37 +1529,37 @@ f Q
         q Q 
         q q Q 
         Q 
-        q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
         0 0 0 RG 1 w 1 J
 88 395 m 91 402 l S Q
-        q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
         0 0 0 RG 1 w 1 J
 94 406 m 97 413 l S Q
-        q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
         0 0 0 RG 1 w 1 J
 100 417 m 103 424 l S Q
-        q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
         0 0 0 RG 1 w 1 J
 106 428 m 109 435 l S Q
-        q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
         0 0 0 RG 1 w 1 J
 112 439 m 115 446 l S Q
-        q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
         0 0 0 RG 1 w 1 J
 118 450 m 122 457 l S Q
-        q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
         0 0 0 RG 1 w 1 J
 88 395 m 100 406 l S Q
-        q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
         0 0 0 RG 1 w 1 J
 88 395 m 91 411 l S Q
         q Q 
-        q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
         0 0 0 RG 1 w 1 J
 210 395 m
 200 413 186 439 176 457 c S Q
         q Q 
-        q q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q q q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
         n 
         176 457 m
 189 446 l
@@ -766,7 +1568,7 @@ f Q
         0 0 0 rg 0 0 0 RG 1 w 1 J
 f Q
         Q 
-        q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
         n 
         176 457 m
 189 446 l
@@ -779,25 +1581,25 @@ f Q
         q q Q 
         Q 
         q Q 
-        q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
         0 0 0 RG 1 w 1 J
-151 557 m
-151 701 151 900 151 1015 c S Q
+154 557 m
+172 803 248 1034 329 1090 c S Q
         q Q 
-        q q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q q q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
         n 
-        151 1015 m
-157 999 l
-145 999 l
+        329 1090 m
+319 1076 l
+312 1086 l
 
         0 0 0 rg 0 0 0 RG 1 w 1 J
 f Q
         Q 
-        q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
         n 
-        151 1015 m
-157 999 l
-145 999 l
+        329 1090 m
+319 1076 l
+312 1086 l
 
         0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
         Q 
@@ -806,45 +1608,45 @@ f Q
         q q Q 
         Q 
         q Q 
-        q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
         0 0 0 RG 1 w 1 J
-275 113 m
-296 136 328 171 349 194 c S Q
+319 110 m
+331 132 351 168 366 194 c S Q
         q Q 
-        q q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q q q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
         n 
-        349 194 m
-343 178 l
-334 186 l
+        366 194 m
+363 177 l
+353 183 l
 
         0 0 0 rg 0 0 0 RG 1 w 1 J
 f Q
         Q 
-        q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
         n 
-        349 194 m
-343 178 l
-334 186 l
+        366 194 m
+363 177 l
+353 183 l
 
         0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
         Q 
         Q 
-        q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
-        q 1 0 0 -1 268 137 cm 1 1 1 rg 0 0 64 -11 re f Q
-        BT /F0 10.000000 Tf 0 g 1 0 0 -1 268 137 Tm 0 -9 Td(B) Tj 8 0 Td(e) Tj 6 0 Td(a) Tj 6 0 Td(m) Tj 9 0 Td(f) Tj 3 0 Td(o) Tj 6 0 Td(r) Tj 3 0 Td(m) Tj 9 0 Td(e) Tj 6 0 Td(r) Tj 3 0 Td(:) Tj ET Q
-        q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
-        q 1 0 0 -1 268 150 cm 1 1 1 rg 0 0 112 -11 re f Q
-        BT /F0 10.000000 Tf 0 g 1 0 0 -1 268 150 Tm 0 -9 Td([) Tj 3 0 Td(t) Tj 3 0 Td(a) Tj 6 0 Td(b) Tj 6 0 Td(]) Tj 3 0 Td([) Tj 3 0 Td(s) Tj 6 0 Td(u) Tj 6 0 Td(b) Tj 6 0 Td(b) Tj 6 0 Td(a) Tj 6 0 Td(n) Tj 6 0 Td(d) Tj 6 0 Td(]) Tj 2 0 Td([) Tj 2 0 Td(s) Tj 5 0 Td(a) Tj 6 0 Td(m) Tj 9 0 Td(p) Tj 6 0 Td(l) Tj 2 0 Td(e) Tj 6 0 Td(]) Tj ET Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
+        q 1 0 0 -1 276 147 cm 1 1 1 rg 0 0 64 -11 re f Q
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 276 147 Tm 0 -9 Td(B) Tj 8 0 Td(e) Tj 6 0 Td(a) Tj 6 0 Td(m) Tj 9 0 Td(f) Tj 3 0 Td(o) Tj 6 0 Td(r) Tj 3 0 Td(m) Tj 9 0 Td(e) Tj 6 0 Td(r) Tj 3 0 Td(:) Tj ET Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
+        q 1 0 0 -1 276 160 cm 1 1 1 rg 0 0 112 -11 re f Q
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 276 160 Tm 0 -9 Td([) Tj 3 0 Td(t) Tj 3 0 Td(a) Tj 6 0 Td(b) Tj 6 0 Td(]) Tj 3 0 Td([) Tj 3 0 Td(s) Tj 6 0 Td(u) Tj 6 0 Td(b) Tj 6 0 Td(b) Tj 6 0 Td(a) Tj 6 0 Td(n) Tj 6 0 Td(d) Tj 6 0 Td(]) Tj 2 0 Td([) Tj 2 0 Td(s) Tj 5 0 Td(a) Tj 6 0 Td(m) Tj 9 0 Td(p) Tj 6 0 Td(l) Tj 2 0 Td(e) Tj 6 0 Td(]) Tj ET Q
         q Q 
         q q Q 
         Q 
         q Q 
-        q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
         0 0 0 RG 1 w 1 J
 394 294 m
 394 307 394 329 394 344 c S Q
         q Q 
-        q q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q q q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
         n 
         394 344 m
 400 328 l
@@ -853,7 +1655,7 @@ f Q
         0 0 0 rg 0 0 0 RG 1 w 1 J
 f Q
         Q 
-        q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
         n 
         394 344 m
 400 328 l
@@ -862,19 +1664,19 @@ f Q
         0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
         Q 
         Q 
-        q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
         q 1 0 0 -1 351 304 cm 1 1 1 rg 0 0 90 -11 re f Q
         BT /F0 10.000000 Tf 0 g 1 0 0 -1 351 304 Tm 0 -9 Td([) Tj 3 0 Td(s) Tj 6 0 Td(u) Tj 6 0 Td(b) Tj 6 0 Td(b) Tj 6 0 Td(a) Tj 6 0 Td(n) Tj 6 0 Td(d) Tj 6 0 Td(]) Tj 2 0 Td([) Tj 2 0 Td(s) Tj 5 0 Td(a) Tj 6 0 Td(m) Tj 9 0 Td(p) Tj 6 0 Td(l) Tj 2 0 Td(e) Tj 6 0 Td(]) Tj ET Q
         q Q 
         q q Q 
         Q 
         q Q 
-        q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
         0 0 0 RG 1 w 1 J
 382 394 m
 374 412 359 440 349 458 c S Q
         q Q 
-        q q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q q q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
         n 
         349 458 m
 362 447 l
@@ -883,7 +1685,7 @@ f Q
         0 0 0 rg 0 0 0 RG 1 w 1 J
 f Q
         Q 
-        q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
         n 
         349 458 m
 362 447 l
@@ -896,55 +1698,109 @@ f Q
         q q Q 
         Q 
         q Q 
-        q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+283 110 m
+238 139 167 183 121 211 c S Q
+        q Q 
+        q q q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
+        n 
+        121 211 m
+138 208 l
+132 198 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
+        n 
+        121 211 m
+138 208 l
+132 198 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
+        q 1 0 0 -1 181 154 cm 1 1 1 rg 0 0 48 -11 re f Q
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 181 154 Tm 0 -9 Td(C) Tj 8 0 Td(o) Tj 6 0 Td(r) Tj 3 0 Td(r) Tj 3 0 Td(e) Tj 6 0 Td(l) Tj 2 0 Td(a) Tj 6 0 Td(t) Tj 2 0 Td(o) Tj 6 0 Td(r) Tj ET Q
+        q Q 
+        q q Q 
+        Q 
+        q Q 
+        q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+364 666 m
+364 668 364 683 363 700 c S Q
+        q Q 
+        q q q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
+        n 
+        363 700 m
+370 684 l
+358 684 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
+        n 
+        363 700 m
+370 684 l
+358 684 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q Q 
+        q q Q 
+        Q 
+        q Q 
+        q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
         0 0 0 RG 1 w 1 J
-450 557 m
-438 574 421 600 411 616 c S Q
+608 560 m
+547 819 462 1049 412 1090 c S Q
         q Q 
-        q q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q q q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
         n 
-        411 616 m
-425 606 l
-414 599 l
+        412 1090 m
+428 1085 l
+421 1075 l
 
         0 0 0 rg 0 0 0 RG 1 w 1 J
 f Q
         Q 
-        q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
         n 
-        411 616 m
-425 606 l
-414 599 l
+        412 1090 m
+428 1085 l
+421 1075 l
 
         0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
         Q 
         Q 
-        q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
-        q 1 0 0 -1 387 573 cm 1 1 1 rg 0 0 90 -11 re f Q
-        BT /F0 10.000000 Tf 0 g 1 0 0 -1 387 573 Tm 0 -9 Td([) Tj 3 0 Td(s) Tj 6 0 Td(a) Tj 6 0 Td(m) Tj 9 0 Td(p) Tj 6 0 Td(l) Tj 2 0 Td(e) Tj 6 0 Td(]) Tj 3 0 Td([) Tj 2 0 Td(s) Tj 5 0 Td(u) Tj 6 0 Td(b) Tj 6 0 Td(b) Tj 6 0 Td(a) Tj 6 0 Td(n) Tj 6 0 Td(d) Tj 6 0 Td(]) Tj ET Q
         q Q 
         q q Q 
         Q 
         q Q 
-        q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
         0 0 0 RG 1 w 1 J
-395 666 m
-394 683 394 709 393 727 c S Q
+415 900 m
+410 909 401 924 394 935 c S Q
         q Q 
-        q q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q q q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
         n 
-        393 727 m
-400 711 l
-388 711 l
+        394 935 m
+408 925 l
+397 918 l
 
         0 0 0 rg 0 0 0 RG 1 w 1 J
 f Q
         Q 
-        q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
         n 
-        393 727 m
-400 711 l
-388 711 l
+        394 935 m
+408 925 l
+397 918 l
 
         0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
         Q 
@@ -952,26 +1808,65 @@ f Q
         q Q 
         q q Q 
         Q 
+        q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+314 900 m 318 907 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+320 911 m 324 918 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+326 922 m 330 929 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+332 933 m 334 935 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+314 900 m 326 911 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+314 900 m 317 916 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+336 800 m 333 807 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+331 811 m 328 818 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+326 822 m 323 829 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+321 833 m 317 840 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+315 844 m 312 850 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+336 800 m 334 816 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+336 800 m 325 811 l S Q
         q Q 
-        q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
         0 0 0 RG 1 w 1 J
-426 827 m
-436 841 454 865 468 881 c S Q
+358 1035 m
+357 1048 361 1072 367 1090 c S Q
         q Q 
-        q q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q q q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
         n 
-        468 881 m
-462 865 l
-453 873 l
+        367 1090 m
+367 1073 l
+356 1077 l
 
         0 0 0 rg 0 0 0 RG 1 w 1 J
 f Q
         Q 
-        q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
         n 
-        468 881 m
-462 865 l
-453 873 l
+        367 1090 m
+367 1073 l
+356 1077 l
 
         0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
         Q 
@@ -980,103 +1875,130 @@ f Q
         q q Q 
         Q 
         q Q 
-        q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
         0 0 0 RG 1 w 1 J
-473 931 m
-459 951 439 982 426 1002 c S Q
+357 110 m
+392 135 458 178 510 209 c S Q
         q Q 
-        q q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q q q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
         n 
-        426 1002 m
-440 992 l
-430 985 l
+        510 209 m
+499 196 l
+493 206 l
 
         0 0 0 rg 0 0 0 RG 1 w 1 J
 f Q
         Q 
-        q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
         n 
-        426 1002 m
-440 992 l
-430 985 l
+        510 209 m
+499 196 l
+493 206 l
 
         0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
         Q 
         Q 
+        q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
+        q 1 0 0 -1 407 143 cm 1 1 1 rg 0 0 42 -11 re f Q
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 407 143 Tm 0 -9 Td(RSP raw) Tj ET Q
         q Q 
         q q Q 
         Q 
-        q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
         0 0 0 RG 1 w 1 J
-325 934 m 329 941 l S Q
-        q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+551 290 m 551 297 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
         0 0 0 RG 1 w 1 J
-331 945 m 335 952 l S Q
-        q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+551 301 m 551 308 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
         0 0 0 RG 1 w 1 J
-337 956 m 342 963 l S Q
-        q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+551 312 m 551 319 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
         0 0 0 RG 1 w 1 J
-344 967 m 348 974 l S Q
-        q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+551 323 m 551 330 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
         0 0 0 RG 1 w 1 J
-350 978 m 355 985 l S Q
-        q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+551 334 m 551 341 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
         0 0 0 RG 1 w 1 J
-357 989 m 361 996 l S Q
-        q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+551 345 m 551 350 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
         0 0 0 RG 1 w 1 J
-363 1000 m 365 1002 l S Q
-        q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+551 290 m 556 305 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
         0 0 0 RG 1 w 1 J
-325 934 m 337 944 l S Q
-        q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+551 290 m 546 305 l S Q
+        q Q 
+        q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
         0 0 0 RG 1 w 1 J
-325 934 m 328 949 l S Q
-        q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+607 290 m
+623 307 649 333 665 350 c S Q
+        q Q 
+        q q q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
+        n 
+        665 350 m
+658 334 l
+650 343 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
+        n 
+        665 350 m
+658 334 l
+650 343 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q Q 
+        q q Q 
+        Q 
+        q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
         0 0 0 RG 1 w 1 J
-361 827 m 357 834 l S Q
-        q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+562 400 m 565 407 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
         0 0 0 RG 1 w 1 J
-355 838 m 350 845 l S Q
-        q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+567 411 m 571 418 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
         0 0 0 RG 1 w 1 J
-348 849 m 344 856 l S Q
-        q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+573 422 m 577 429 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
         0 0 0 RG 1 w 1 J
-341 860 m 337 867 l S Q
-        q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+579 433 m 583 440 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
         0 0 0 RG 1 w 1 J
-334 871 m 330 878 l S Q
-        q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+585 444 m 589 451 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
         0 0 0 RG 1 w 1 J
-328 882 m 326 884 l S Q
-        q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+591 455 m 594 460 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
         0 0 0 RG 1 w 1 J
-361 827 m 357 842 l S Q
-        q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+562 400 m 573 411 l S Q
+        q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
         0 0 0 RG 1 w 1 J
-361 827 m 349 837 l S Q
+562 400 m 565 416 l S Q
         q Q 
-        q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
         0 0 0 RG 1 w 1 J
-345 1051 m
-304 1050 242 1050 202 1050 c S Q
+676 400 m
+668 417 654 443 645 460 c S Q
         q Q 
-        q q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q q q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
         n 
-        202 1050 m
-218 1056 l
-218 1044 l
+        645 460 m
+658 449 l
+647 443 l
 
         0 0 0 rg 0 0 0 RG 1 w 1 J
 f Q
         Q 
-        q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
         n 
-        202 1050 m
-218 1056 l
-218 1044 l
+        645 460 m
+658 449 l
+647 443 l
 
         0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
         Q 
@@ -1085,29 +2007,32 @@ f Q
         q q Q 
         Q 
         q Q 
-        q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
         0 0 0 RG 1 w 1 J
-371 505 m
-394 504 423 504 438 505 c S Q
+423 560 m
+416 570 399 594 383 616 c S Q
         q Q 
-        q q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q q q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
         n 
-        438 505 m
-422 498 l
-422 510 l
+        383 616 m
+397 607 l
+387 600 l
 
         0 0 0 rg 0 0 0 RG 1 w 1 J
 f Q
         Q 
-        q q 0.957861 -0.000000 -0.000000 -0.959649 0.000000 -0.000000 cm 
+        q q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
         n 
-        438 505 m
-422 498 l
-422 510 l
+        383 616 m
+397 607 l
+387 600 l
 
         0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
         Q 
         Q 
+        q 0.957866 -0.000000 -0.000000 -0.959609 -792.155029 -0.000000 cm 
+        q 1 0 0 -1 335 577 cm 1 1 1 rg 0 0 90 -11 re f Q
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 335 577 Tm 0 -9 Td([) Tj 3 0 Td(s) Tj 6 0 Td(a) Tj 6 0 Td(m) Tj 9 0 Td(p) Tj 6 0 Td(l) Tj 2 0 Td(e) Tj 6 0 Td(]) Tj 3 0 Td([) Tj 2 0 Td(s) Tj 5 0 Td(u) Tj 6 0 Td(b) Tj 6 0 Td(b) Tj 6 0 Td(a) Tj 6 0 Td(n) Tj 6 0 Td(d) Tj 6 0 Td(]) Tj ET Q
         q Q 
         q q Q 
         Q 
@@ -1116,17 +2041,17 @@ f Q
 
 endstream
 endobj
-5 0 obj
+7 0 obj
   <<
     /Type/Page
     /Parent 3 0 R
     /Resources 2 0 R
     /MediaBox [0 0 594 841]
-    /Contents 4 0 R
+    /Contents 6 0 R
     /Group << /S /Transparency /CS /DeviceRGB /I false /K false >>
   >>
 endobj
-6 0 obj
+8 0 obj
   [ 750 750 278 278 355 556 556 889 667 191 333 333 389 584 278 333 278 278 556 556 556 556 556 556 556 556 556 556 278 278 584 
   584 584 556 1015 667 667 722 722 667 611 778 722 278 500 667 556 833 722 778 667 778 722 667 611 722 667 944 667 667 611 
   278 278 278 469 556 333 556 556 500 556 556 278 556 556 222 222 500 222 833 556 556 556 556 333 500 278 556 500 722 500 
@@ -1136,7 +2061,7 @@ endobj
   778 778 778 778 584 778 722 722 722 722 667 667 611 556 556 556 556 556 556 889 500 556 556 556 556 278 278 278 278 556 
   556 556 556 556 556 556 549 611 556 556 556 556 500 556 500 ] 
 endobj
-7 0 obj
+9 0 obj
   <<
     /Type/FontDescriptor
     /FontName/Arial
@@ -1146,25 +2071,25 @@ endobj
     /ItalicAngle 0/StemV 0
   >>
 endobj
-8 0 obj
+10 0 obj
   <<
     /Type/Font/Subtype/TrueType/BaseFont/Arial/Encoding/WinAnsiEncoding
     /FirstChar 30/LastChar 255
-    /Widths 6 0 R
-    /FontDescriptor 7 0 R
+    /Widths 8 0 R
+    /FontDescriptor 9 0 R
   >>
 endobj
-9 0 obj
+11 0 obj
   [ 500 500 274 284 392 591 539 818 800 230 302 302 417 684 217 400 217 390 539 539 539 539 539 539 539 539 539 539 217 217 684 
   684 684 448 955 645 573 619 701 506 488 686 710 266 357 580 471 898 748 754 560 754 598 531 524 687 621 934 590 553 570 
   302 379 302 684 415 268 509 588 462 589 523 313 589 566 242 242 497 242 861 566 586 588 589 348 424 339 566 479 723 459 
-  484 452 302 239 302 684 299 539 646 229 539 377 733 375 375 371 1210 531 316 931 646 570 646 646 229 229 377 377 406 500 
+  484 452 302 239 302 684 311 539 646 229 539 377 733 375 375 371 1210 531 316 931 646 570 646 646 229 229 377 377 406 500 
   1000 337 773 424 316 928 646 452 553 274 284 539 539 556 539 239 448 414 890 392 506 684 400 890 415 377 684 366 366 282 
   577 458 217 205 351 431 506 906 931 952 448 645 645 645 645 645 645 860 619 506 506 506 506 266 266 266 266 701 748 754 
   754 754 754 754 684 754 687 687 687 687 553 560 544 509 509 509 509 509 509 832 462 523 523 523 523 242 242 242 242 559 
   566 586 586 586 586 586 684 586 566 566 566 566 484 588 484 ] 
 endobj
-10 0 obj
+12 0 obj
   <<
     /Type/FontDescriptor
     /FontName/SegoeUI
@@ -1174,19 +2099,19 @@ endobj
     /ItalicAngle 0/StemV 0
   >>
 endobj
-11 0 obj
+13 0 obj
   <<
     /Type/Font/Subtype/TrueType/BaseFont/SegoeUI/Encoding/WinAnsiEncoding
     /FirstChar 30/LastChar 255
-    /Widths 9 0 R
-    /FontDescriptor 10 0 R
+    /Widths 11 0 R
+    /FontDescriptor 12 0 R
   >>
 endobj
 2 0 obj
   <<
     /ProcSet [/PDF/Text/ImageC/ImageB]
-    /Font << /F0 8 0 R
-      /F1 11 0 R>>
+    /Font << /F0 10 0 R
+      /F1 13 0 R>>
     /XObject << >>
     /ExtGState <</SRCAND  <</Type /ExtGState/BM/Darken>> /SSMULT  <</Type /ExtGState/BM/Multiply>> /SSDIFF  <</Type /ExtGState/BM/Difference>> /SRCPAINT <</Type /ExtGState/BM/Lighten>> >>
   >>
@@ -1195,11 +2120,11 @@ endobj
   <<
     /Type/Pages
     /MediaBox [0 0 595 842]
-    /Kids [ 5 0 R ]
-    /Count 1
+    /Kids [ 5 0 R 7 0 R ]
+    /Count 2
   >>
 endobj
-12 0 obj
+14 0 obj
   <<
     /Type/Catalog
     /Pages 3 0 R
@@ -1207,27 +2132,29 @@ endobj
   >>
 endobj
 xref
-0 13
+0 15
 0000000000 65536 f
 0000000017 00000 n
-0000038592 00000 n
-0000038914 00000 n
+0000066095 00000 n
+0000066418 00000 n
 0000000209 00000 n
-0000035703 00000 n
-0000035907 00000 n
-0000036871 00000 n
-0000037067 00000 n
-0000037247 00000 n
-0000038206 00000 n
-0000038408 00000 n
-0000039024 00000 n
+0000044793 00000 n
+0000044997 00000 n
+0000063203 00000 n
+0000063407 00000 n
+0000064371 00000 n
+0000064567 00000 n
+0000064748 00000 n
+0000065708 00000 n
+0000065910 00000 n
+0000066534 00000 n
 trailer
 <<
-  /Size 13
-  /Root 12 0 R
+  /Size 15
+  /Root 14 0 R
   /Info 1 0 R
-  /ID[<928edadfcb14663f78c8f4ebe9af328c><928edadfcb14663f78c8f4ebe9af328c>] 
+  /ID[<b249d13c2ef997dee383f3cb56c03ada><b249d13c2ef997dee383f3cb56c03ada>] 
 >>
 startxref
-39138
+66648
 %%EOF
diff --git a/RTCP/Cobalt/GPUProc/doc/cobalt-data-flow/Signal Processing Pipeline.pdf b/RTCP/Cobalt/GPUProc/doc/cobalt-data-flow/Signal Processing Pipeline.pdf
new file mode 100755
index 0000000000000000000000000000000000000000..5b3a95326a363f8b534e1f37c6600d52b04302bf
--- /dev/null
+++ b/RTCP/Cobalt/GPUProc/doc/cobalt-data-flow/Signal Processing Pipeline.pdf	
@@ -0,0 +1,5140 @@
+%PDF-1.4
+%âãÏÓ
+1 0 obj
+  <<
+    /Author()/Title(Signal Processing Pipeline)/Subject()/Producer()/Keywords()/CreationDate(D:20170827170239+00'00')/ModDate(D:20170827170239+00'00')/Creator(Sub Systems, Inc.)
+  >>
+endobj
+4 0 obj
+  <</Length 120904>>
+  stream
+        q 0.750000 0 0 0.750000 0.000000 819.349976 cm 
+        q  
+        % VpOrgX: 0, VpOrgY: 0 (RecNo: 1)
+         
+        % mm: 8 (RecNo: 2)
+         
+        % WinExtX: 795, WinExtY: 1138 (RecNo: 3)
+         
+        % VpExtX: 763, VpExtY: -1092 (RecNo: 4)
+         
+        % WinOrgX: 0, WinOrgY: 0 (RecNo: 5)
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 170 m 10 173 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 177 m 10 180 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 184 m 10 187 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 191 m 10 194 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 198 m 10 201 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 205 m 10 208 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 212 m 10 215 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 219 m 10 222 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 226 m 10 229 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 233 m 10 236 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 240 m 10 243 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 247 m 10 250 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 254 m 10 257 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 261 m 10 264 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 268 m 10 271 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 275 m 10 278 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 282 m 10 285 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 289 m 10 292 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 296 m 10 299 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 303 m 10 306 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 310 m 10 313 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 317 m 10 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 324 m 10 327 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 331 m 10 334 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 338 m 10 341 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 345 m 10 348 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 352 m 10 355 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 359 m 10 362 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 366 m 10 369 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 373 m 10 376 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 380 m 10 383 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 387 m 10 390 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 394 m 10 397 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 401 m 10 404 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 408 m 10 411 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 415 m 10 418 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 422 m 10 425 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 429 m 10 432 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 436 m 10 439 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 443 m 10 446 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 450 m 10 453 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 457 m 10 460 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 464 m 10 467 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 471 m 10 474 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 478 m 10 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 480 m 11 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+15 480 m 18 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+22 480 m 25 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+29 480 m 32 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+36 480 m 39 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+43 480 m 46 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+50 480 m 53 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+57 480 m 60 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+64 480 m 67 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+71 480 m 74 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+78 480 m 81 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+85 480 m 88 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+92 480 m 95 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+99 480 m 102 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+106 480 m 109 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+113 480 m 116 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+120 480 m 123 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+127 480 m 130 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+134 480 m 137 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+141 480 m 144 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+148 480 m 151 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+155 480 m 158 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+162 480 m 165 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+169 480 m 172 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+176 480 m 179 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+183 480 m 186 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+190 480 m 193 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+197 480 m 200 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+204 480 m 207 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+211 480 m 214 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+218 480 m 221 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+225 480 m 228 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+232 480 m 235 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+239 480 m 242 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+246 480 m 249 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+253 480 m 256 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+260 480 m 263 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+267 480 m 270 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+274 480 m 277 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+281 480 m 284 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+288 480 m 291 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+295 480 m 298 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+302 480 m 305 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+309 480 m 312 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+316 480 m 319 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+323 480 m 326 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+330 480 m 333 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+337 480 m 340 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+344 480 m 347 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+351 480 m 354 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+358 480 m 361 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+365 480 m 368 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+372 480 m 375 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+379 480 m 382 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+386 480 m 389 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+393 480 m 396 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+400 480 m 403 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+407 480 m 410 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+414 480 m 417 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+421 480 m 424 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+428 480 m 431 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+435 480 m 438 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+442 480 m 445 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+449 480 m 452 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+456 480 m 459 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+463 480 m 466 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+470 480 m 473 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+477 480 m 480 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+484 480 m 487 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+491 480 m 494 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+498 480 m 501 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+505 480 m 508 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+512 480 m 515 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+519 480 m 522 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+526 480 m 529 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+533 480 m 536 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+540 480 m 543 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+547 480 m 550 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+554 480 m 557 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+561 480 m 564 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+568 480 m 571 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+575 480 m 578 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+582 480 m 585 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+589 480 m 592 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+596 480 m 599 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+603 480 m 606 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+610 480 m 613 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+617 480 m 620 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+624 480 m 627 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+631 480 m 634 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+638 480 m 641 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+645 480 m 648 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+652 480 m 655 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+659 480 m 662 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+666 480 m 669 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+673 480 m 676 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+680 480 m 683 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+687 480 m 690 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+694 480 m 697 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+701 480 m 704 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+708 480 m 711 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+715 480 m 718 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+722 480 m 725 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+729 480 m 732 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+736 480 m 739 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+743 480 m 746 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+750 480 m 753 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+757 480 m 760 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+764 480 m 767 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+771 480 m 774 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+778 480 m 781 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+785 480 m 788 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 478 m 790 475 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 471 m 790 468 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 464 m 790 461 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 457 m 790 454 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 450 m 790 447 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 443 m 790 440 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 436 m 790 433 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 429 m 790 426 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 422 m 790 419 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 415 m 790 412 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 408 m 790 405 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 401 m 790 398 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 394 m 790 391 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 387 m 790 384 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 380 m 790 377 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 373 m 790 370 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 366 m 790 363 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 359 m 790 356 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 352 m 790 349 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 345 m 790 342 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 338 m 790 335 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 331 m 790 328 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 324 m 790 321 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 317 m 790 314 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 310 m 790 307 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 303 m 790 300 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 296 m 790 293 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 289 m 790 286 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 282 m 790 279 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 275 m 790 272 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 268 m 790 265 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 261 m 790 258 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 254 m 790 251 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 247 m 790 244 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 240 m 790 237 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 233 m 790 230 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 226 m 790 223 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 219 m 790 216 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 212 m 790 209 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 205 m 790 202 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 198 m 790 195 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 191 m 790 188 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 184 m 790 181 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 177 m 790 174 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 170 m 787 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+783 170 m 780 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+776 170 m 773 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+769 170 m 766 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+762 170 m 759 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+755 170 m 752 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+748 170 m 745 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+741 170 m 738 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+734 170 m 731 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+727 170 m 724 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+720 170 m 717 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+713 170 m 710 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+706 170 m 703 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+699 170 m 696 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+692 170 m 689 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+685 170 m 682 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+678 170 m 675 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+671 170 m 668 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+664 170 m 661 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+657 170 m 654 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+650 170 m 647 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+643 170 m 640 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+636 170 m 633 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+629 170 m 626 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+622 170 m 619 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+615 170 m 612 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+608 170 m 605 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+601 170 m 598 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+594 170 m 591 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+587 170 m 584 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+580 170 m 577 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+573 170 m 570 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+566 170 m 563 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+559 170 m 556 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+552 170 m 549 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+545 170 m 542 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+538 170 m 535 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+531 170 m 528 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+524 170 m 521 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+517 170 m 514 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+510 170 m 507 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+503 170 m 500 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+496 170 m 493 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+489 170 m 486 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+482 170 m 479 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+475 170 m 472 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+468 170 m 465 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+461 170 m 458 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+454 170 m 451 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+447 170 m 444 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+440 170 m 437 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+433 170 m 430 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+426 170 m 423 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+419 170 m 416 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+412 170 m 409 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+405 170 m 402 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+398 170 m 395 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+391 170 m 388 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+384 170 m 381 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+377 170 m 374 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+370 170 m 367 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+363 170 m 360 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+356 170 m 353 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+349 170 m 346 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+342 170 m 339 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+335 170 m 332 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+328 170 m 325 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+321 170 m 318 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+314 170 m 311 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+307 170 m 304 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+300 170 m 297 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+293 170 m 290 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+286 170 m 283 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+279 170 m 276 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+272 170 m 269 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+265 170 m 262 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+258 170 m 255 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+251 170 m 248 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+244 170 m 241 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+237 170 m 234 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+230 170 m 227 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+223 170 m 220 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+216 170 m 213 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+209 170 m 206 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+202 170 m 199 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+195 170 m 192 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+188 170 m 185 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+181 170 m 178 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+174 170 m 171 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+167 170 m 164 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+160 170 m 157 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+153 170 m 150 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+146 170 m 143 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+139 170 m 136 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+132 170 m 129 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+125 170 m 122 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+118 170 m 115 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+111 170 m 108 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+104 170 m 101 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+97 170 m 94 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+90 170 m 87 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+83 170 m 80 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+76 170 m 73 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+69 170 m 66 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+62 170 m 59 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+55 170 m 52 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+48 170 m 45 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+41 170 m 38 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+34 170 m 31 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+27 170 m 24 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+20 170 m 17 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+13 170 m 10 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 233 174 Tm 0 -9 Td(B) Tj 8 0 Td(e) Tj 6 0 Td(a) Tj 6 0 Td(m) Tj 9 0 Td(f) Tj 3 0 Td(o) Tj 6 0 Td(r) Tj 3 0 Td(m) Tj 9 0 Td(e) Tj 6 0 Td(r) Tj 3 0 Td( ) Tj 3 0 Td(P) Tj 8 0 Td(i) Tj 2 0 Td(p) Tj 6 0 Td(e) Tj 6 0 Td(l) Tj 2 0 Td(i) Tj 2 0 Td(n) Tj 6 0 Td(e) Tj 6 0 Td( ) Tj 3 0 Td(w) Tj 8 0 Td(i) Tj 2 0 Td(t) Tj 3 0 Td(h) Tj 6 0 Td( ) Tj 3 0 Td(C) Tj 8 0 Td(o) Tj 6 0 Td(h) Tj 6 0 Td(e) Tj 6 0 Td(r) Tj 3 0 Td(e) Tj 6 0 Td(n) Tj 6 0 Td(t) Tj 2 0 Td( ) Tj 3 0 Td(a) Tj 6 0 Td(n) Tj 6 0 Td(d) Tj 6 0 Td(/) Tj 2 0 Td(o) Tj 6 0 Td(r) Tj 3 0 Td( ) Tj 3 0 Td(I) Tj 2 0 Td(n) Tj 6 0 Td(c) Tj 5 0 Td(o) Tj 6 0 Td(h) Tj 6 0 Td(e) Tj 6 0 Td(r) Tj 3 0 Td(e) Tj 6 0 Td(n) Tj 6 0 Td(t) Tj 2 0 Td( ) Tj 3 0 Td(S) Tj 7 0 Td(t) Tj 2 0 Td(o) Tj 6 0 Td(k) Tj 5 0 Td(e) Tj 6 0 Td(s) Tj 5 0 Td( ) Tj 3 0 Td(O) Tj 8 0 Td(u) Tj 6 0 Td(t) Tj 2 0 Td(p) Tj 6 0 Td(u) Tj 6 0 Td(t) Tj 2 0 Td(\() Tj 3 0 Td(s) Tj 5 0 Td(\)) Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+50 50 m 50 53 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+50 57 m 50 60 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+50 64 m 50 67 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+50 71 m 50 74 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+50 78 m 50 81 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+50 85 m 50 88 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+50 92 m 50 95 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+50 99 m 50 102 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+50 106 m 50 109 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+50 113 m 50 116 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+50 120 m 50 123 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+50 127 m 50 130 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+50 134 m 50 137 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+50 141 m 50 144 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+50 148 m 50 151 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+50 155 m 50 158 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+52 160 m 55 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+59 160 m 62 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+66 160 m 69 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+73 160 m 76 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+80 160 m 83 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+87 160 m 90 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+94 160 m 97 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+101 160 m 104 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+108 160 m 111 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+115 160 m 118 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+122 160 m 125 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+129 160 m 132 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+136 160 m 139 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+143 160 m 146 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+150 160 m 153 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+157 160 m 160 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+164 160 m 167 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+171 160 m 174 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+178 160 m 181 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+185 160 m 188 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+192 160 m 195 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+199 160 m 202 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+206 160 m 209 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+213 160 m 216 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+220 160 m 223 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+227 160 m 230 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+234 160 m 237 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+241 160 m 244 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+248 160 m 251 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+255 160 m 258 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+262 160 m 265 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+269 160 m 272 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+276 160 m 279 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+283 160 m 286 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+290 160 m 293 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+297 160 m 300 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+304 160 m 307 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+311 160 m 314 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+318 160 m 321 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+325 160 m 328 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+332 160 m 335 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+339 160 m 342 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+346 160 m 349 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+353 160 m 356 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+360 160 m 363 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+367 160 m 370 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+374 160 m 377 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+381 160 m 384 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+388 160 m 391 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+395 160 m 398 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+402 160 m 405 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+409 160 m 412 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+416 160 m 419 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+423 160 m 426 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+430 160 m 433 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+437 160 m 440 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+444 160 m 447 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+451 160 m 454 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+458 160 m 461 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+465 160 m 468 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+472 160 m 475 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+479 160 m 482 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+486 160 m 489 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+493 160 m 496 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+500 160 m 503 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+507 160 m 510 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+514 160 m 517 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+521 160 m 524 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+528 160 m 531 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+535 160 m 538 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+542 160 m 545 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+549 160 m 552 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+556 160 m 559 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+563 160 m 566 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+570 160 m 573 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+577 160 m 580 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+584 160 m 587 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+591 160 m 594 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+598 160 m 601 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+605 160 m 608 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+612 160 m 615 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+619 160 m 622 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+626 160 m 629 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+633 160 m 636 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+640 160 m 643 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+647 160 m 650 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+654 160 m 657 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+661 160 m 664 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+668 160 m 671 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+675 160 m 678 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+682 160 m 685 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+689 160 m 692 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+696 160 m 699 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+703 160 m 706 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+710 160 m 713 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+717 160 m 720 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+724 160 m 727 160 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+730 159 m 730 156 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+730 152 m 730 149 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+730 145 m 730 142 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+730 138 m 730 135 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+730 131 m 730 128 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+730 124 m 730 121 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+730 117 m 730 114 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+730 110 m 730 107 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+730 103 m 730 100 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+730 96 m 730 93 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+730 89 m 730 86 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+730 82 m 730 79 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+730 75 m 730 72 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+730 68 m 730 65 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+730 61 m 730 58 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+730 54 m 730 51 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+727 50 m 724 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+720 50 m 717 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+713 50 m 710 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+706 50 m 703 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+699 50 m 696 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+692 50 m 689 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+685 50 m 682 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+678 50 m 675 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+671 50 m 668 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+664 50 m 661 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+657 50 m 654 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+650 50 m 647 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+643 50 m 640 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+636 50 m 633 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+629 50 m 626 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+622 50 m 619 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+615 50 m 612 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+608 50 m 605 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+601 50 m 598 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+594 50 m 591 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+587 50 m 584 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+580 50 m 577 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+573 50 m 570 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+566 50 m 563 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+559 50 m 556 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+552 50 m 549 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+545 50 m 542 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+538 50 m 535 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+531 50 m 528 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+524 50 m 521 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+517 50 m 514 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+510 50 m 507 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+503 50 m 500 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+496 50 m 493 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+489 50 m 486 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+482 50 m 479 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+475 50 m 472 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+468 50 m 465 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+461 50 m 458 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+454 50 m 451 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+447 50 m 444 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+440 50 m 437 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+433 50 m 430 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+426 50 m 423 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+419 50 m 416 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+412 50 m 409 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+405 50 m 402 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+398 50 m 395 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+391 50 m 388 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+384 50 m 381 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+377 50 m 374 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+370 50 m 367 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+363 50 m 360 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+356 50 m 353 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+349 50 m 346 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+342 50 m 339 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+335 50 m 332 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+328 50 m 325 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+321 50 m 318 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+314 50 m 311 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+307 50 m 304 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+300 50 m 297 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+293 50 m 290 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+286 50 m 283 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+279 50 m 276 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+272 50 m 269 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+265 50 m 262 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+258 50 m 255 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+251 50 m 248 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+244 50 m 241 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+237 50 m 234 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+230 50 m 227 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+223 50 m 220 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+216 50 m 213 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+209 50 m 206 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+202 50 m 199 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+195 50 m 192 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+188 50 m 185 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+181 50 m 178 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+174 50 m 171 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+167 50 m 164 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+160 50 m 157 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+153 50 m 150 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+146 50 m 143 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+139 50 m 136 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+132 50 m 129 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+125 50 m 122 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+118 50 m 115 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+111 50 m 108 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+104 50 m 101 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+97 50 m 94 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+90 50 m 87 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+83 50 m 80 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+76 50 m 73 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+69 50 m 66 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+62 50 m 59 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+55 50 m 52 50 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 345 54 Tm 0 -9 Td(C) Tj 8 0 Td(o) Tj 6 0 Td(r) Tj 3 0 Td(r) Tj 3 0 Td(e) Tj 6 0 Td(l) Tj 2 0 Td(a) Tj 6 0 Td(t) Tj 3 0 Td(o) Tj 6 0 Td(r) Tj 3 0 Td( ) Tj 3 0 Td(P) Tj 8 0 Td(i) Tj 2 0 Td(p) Tj 6 0 Td(e) Tj 6 0 Td(l) Tj 2 0 Td(i) Tj 2 0 Td(n) Tj 6 0 Td(e) Tj ET Q
+        q q q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        442 113 m
+442 91 424 73 402 73 c
+381 73 363 91 363 112 c
+363 134 381 152 403 152 c
+424 152 442 134 442 113 c
+h 
+        .753 .749 .753 rg .753 .749 .753 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        442 113 m
+442 91 424 73 402 73 c
+381 73 363 91 363 112 c
+363 134 381 152 403 152 c
+424 152 442 134 442 113 c
+h 
+        0 0 0 rg .753 .749 .753 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        439 110 m
+439 131 421 149 399 149 c
+378 149 360 131 360 109 c
+360 88 378 70 400 70 c
+421 70 439 88 439 110 c
+h 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        439 110 m
+439 131 421 149 399 149 c
+378 149 360 131 360 109 c
+360 88 378 70 400 70 c
+421 70 439 88 439 110 c
+h 
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        q Q 
+        q Q 
+        q Q 
+        q Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 374 97 Tm 0 -9 Td(F) Tj 7 0 Td(i) Tj 2 0 Td(n) Tj 6 0 Td(e) Tj 6 0 Td( ) Tj 3 0 Td(D) Tj 8 0 Td(e) Tj 6 0 Td(l) Tj 2 0 Td(a) Tj 6 0 Td(y) Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 366 110 Tm 0 -9 Td(C) Tj 8 0 Td(o) Tj 6 0 Td(m) Tj 9 0 Td(p) Tj 6 0 Td(e) Tj 6 0 Td(n) Tj 6 0 Td(s) Tj 5 0 Td(a) Tj 6 0 Td(t) Tj 2 0 Td(i) Tj 2 0 Td(o) Tj 6 0 Td(n) Tj ET Q
+        Q 
+        Q 
+        q Q 
+        q q q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        332 113 m
+332 134 314 152 292 152 c
+271 152 253 134 253 112 c
+253 91 271 73 293 73 c
+314 73 332 91 332 113 c
+h 
+        .753 .749 .753 rg .753 .749 .753 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        332 113 m
+332 134 314 152 292 152 c
+271 152 253 134 253 112 c
+253 91 271 73 293 73 c
+314 73 332 91 332 113 c
+h 
+        0 0 0 rg .753 .749 .753 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        329 110 m
+329 131 311 149 289 149 c
+268 149 250 131 250 109 c
+250 88 268 70 290 70 c
+311 70 329 88 329 110 c
+h 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        329 110 m
+329 131 311 149 289 149 c
+268 149 250 131 250 109 c
+250 88 268 70 290 70 c
+311 70 329 88 329 110 c
+h 
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        q Q 
+        q Q 
+        q Q 
+        q Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 269 97 Tm 0 -9 Td(FFT C2C) Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 273 110 Tm 0 -9 Td(16-512) Tj ET Q
+        Q 
+        Q 
+        q Q 
+        q q q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        102 233 m
+102 254 84 272 62 272 c
+41 272 23 254 23 232 c
+23 211 41 193 63 193 c
+84 193 102 211 102 233 c
+h 
+        .753 .749 .753 rg .753 .749 .753 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        102 233 m
+102 254 84 272 62 272 c
+41 272 23 254 23 232 c
+23 211 41 193 63 193 c
+84 193 102 211 102 233 c
+h 
+        0 0 0 rg .753 .749 .753 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        99 230 m
+99 251 81 269 59 269 c
+38 269 20 251 20 229 c
+20 208 38 190 60 190 c
+81 190 99 208 99 230 c
+h 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        99 230 m
+99 251 81 269 59 269 c
+38 269 20 251 20 229 c
+20 208 38 190 60 190 c
+81 190 99 208 99 230 c
+h 
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        q Q 
+        q Q 
+        q Q 
+        q Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 35 223 Tm 0 -9 Td(I) Tj 3 0 Td(n) Tj 6 0 Td(t) Tj 3 0 Td(T) Tj 7 0 Td(o) Tj 6 0 Td(F) Tj 7 0 Td(l) Tj 2 0 Td(o) Tj 6 0 Td(a) Tj 6 0 Td(t) Tj ET Q
+        Q 
+        Q 
+        q Q 
+        q q q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        232 233 m
+232 254 214 272 192 272 c
+171 272 153 254 153 232 c
+153 211 171 193 192 193 c
+214 193 232 211 232 233 c
+h 
+        .753 .749 .753 rg .753 .749 .753 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        232 233 m
+232 254 214 272 192 272 c
+171 272 153 254 153 232 c
+153 211 171 193 192 193 c
+214 193 232 211 232 233 c
+h 
+        0 0 0 rg .753 .749 .753 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        229 230 m
+229 251 211 269 190 269 c
+168 269 150 251 150 229 c
+150 208 168 190 190 190 c
+211 190 229 208 229 230 c
+h 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        229 230 m
+229 251 211 269 190 269 c
+168 269 150 251 150 229 c
+150 208 168 190 190 190 c
+211 190 229 208 229 230 c
+h 
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        q Q 
+        q Q 
+        q Q 
+        q Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 169 217 Tm 0 -9 Td(FFT C2C) Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 184 230 Tm 0 -9 Td(6) Tj 6 0 Td(4) Tj ET Q
+        Q 
+        Q 
+        q Q 
+        q q q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        352 233 m
+352 254 334 272 312 272 c
+291 272 273 254 273 232 c
+273 211 291 193 313 193 c
+334 193 352 211 352 233 c
+h 
+        .753 .749 .753 rg .753 .749 .753 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        352 233 m
+352 254 334 272 312 272 c
+291 272 273 254 273 232 c
+273 211 291 193 313 193 c
+334 193 352 211 352 233 c
+h 
+        0 0 0 rg .753 .749 .753 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        349 230 m
+349 251 331 269 309 269 c
+288 269 270 251 270 229 c
+270 208 288 190 310 190 c
+331 190 349 208 349 230 c
+h 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        349 230 m
+349 251 331 269 309 269 c
+288 269 270 251 270 229 c
+270 208 288 190 310 190 c
+331 190 349 208 349 230 c
+h 
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        q Q 
+        q Q 
+        q Q 
+        q Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 284 217 Tm 0 -9 Td(F) Tj 7 0 Td(i) Tj 2 0 Td(n) Tj 6 0 Td(e) Tj 6 0 Td( ) Tj 3 0 Td(D) Tj 8 0 Td(e) Tj 6 0 Td(l) Tj 2 0 Td(a) Tj 6 0 Td(y) Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 276 230 Tm 0 -9 Td(C) Tj 8 0 Td(o) Tj 6 0 Td(m) Tj 9 0 Td(p) Tj 6 0 Td(e) Tj 6 0 Td(n) Tj 6 0 Td(s) Tj 5 0 Td(a) Tj 6 0 Td(t) Tj 2 0 Td(i) Tj 2 0 Td(o) Tj 6 0 Td(n) Tj ET Q
+        Q 
+        Q 
+        q Q 
+        q q q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        102 343 m
+102 364 84 382 62 382 c
+41 382 23 364 23 342 c
+23 321 41 303 63 303 c
+84 303 102 321 102 343 c
+h 
+        .753 .749 .753 rg .753 .749 .753 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        102 343 m
+102 364 84 382 62 382 c
+41 382 23 364 23 342 c
+23 321 41 303 63 303 c
+84 303 102 321 102 343 c
+h 
+        0 0 0 rg .753 .749 .753 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        99 340 m
+99 361 81 379 59 379 c
+38 379 20 361 20 339 c
+20 318 38 300 60 300 c
+81 300 99 318 99 340 c
+h 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        99 340 m
+99 361 81 379 59 379 c
+38 379 20 361 20 339 c
+20 318 38 300 60 300 c
+81 300 99 318 99 340 c
+h 
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        q Q 
+        q Q 
+        q Q 
+        q Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 37 327 Tm 0 -9 Td(Bandpass) Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 36 340 Tm 0 -9 Td(C) Tj 8 0 Td(o) Tj 6 0 Td(r) Tj 3 0 Td(r) Tj 3 0 Td(e) Tj 6 0 Td(c) Tj 5 0 Td(t) Tj 2 0 Td(i) Tj 2 0 Td(o) Tj 6 0 Td(n) Tj ET Q
+        Q 
+        Q 
+        q Q 
+        q q q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        232 343 m
+232 364 214 382 192 382 c
+171 382 153 364 153 342 c
+153 321 171 303 192 303 c
+214 303 232 321 232 343 c
+h 
+        .753 .749 .753 rg .753 .749 .753 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        232 343 m
+232 364 214 382 192 382 c
+171 382 153 364 153 342 c
+153 321 171 303 192 303 c
+214 303 232 321 232 343 c
+h 
+        0 0 0 rg .753 .749 .753 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        229 340 m
+229 361 211 379 190 379 c
+168 379 150 361 150 339 c
+150 318 168 300 190 300 c
+211 300 229 318 229 340 c
+h 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        229 340 m
+229 361 211 379 190 379 c
+168 379 150 361 150 339 c
+150 318 168 300 190 300 c
+211 300 229 318 229 340 c
+h 
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        q Q 
+        q Q 
+        q Q 
+        q Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 158 327 Tm 0 -9 Td(B) Tj 8 0 Td(e) Tj 6 0 Td(a) Tj 6 0 Td(m) Tj 9 0 Td(f) Tj 3 0 Td(o) Tj 6 0 Td(r) Tj 3 0 Td(m) Tj 9 0 Td(i) Tj 2 0 Td(n) Tj 6 0 Td(g) Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 159 340 Tm 0 -9 Td(1) Tj 6 0 Td(-) Tj 3 0 Td(2) Tj 6 0 Td(2) Tj 6 0 Td(2) Tj 6 0 Td( ) Tj 3 0 Td(b) Tj 6 0 Td(e) Tj 6 0 Td(a) Tj 6 0 Td(m) Tj 9 0 Td(s) Tj ET Q
+        Q 
+        Q 
+        q Q 
+        q q q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        352 343 m
+352 364 334 382 312 382 c
+291 382 273 364 273 342 c
+273 321 291 303 313 303 c
+334 303 352 321 352 343 c
+h 
+        .753 .749 .753 rg .753 .749 .753 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        352 343 m
+352 364 334 382 312 382 c
+291 382 273 364 273 342 c
+273 321 291 303 313 303 c
+334 303 352 321 352 343 c
+h 
+        0 0 0 rg .753 .749 .753 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        349 340 m
+349 361 331 379 309 379 c
+288 379 270 361 270 339 c
+270 318 288 300 310 300 c
+331 300 349 318 349 340 c
+h 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        349 340 m
+349 361 331 379 309 379 c
+288 379 270 361 270 339 c
+270 318 288 300 310 300 c
+331 300 349 318 349 340 c
+h 
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        q Q 
+        q Q 
+        q Q 
+        q Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 287 327 Tm 0 -9 Td(IFFT C2C) Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 304 340 Tm 0 -9 Td(6) Tj 6 0 Td(4) Tj ET Q
+        Q 
+        Q 
+        q Q 
+        q q q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        482 343 m
+482 364 464 382 442 382 c
+421 382 403 364 403 342 c
+403 321 421 303 442 303 c
+464 303 482 321 482 343 c
+h 
+        .753 .749 .753 rg .753 .749 .753 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        482 343 m
+482 364 464 382 442 382 c
+421 382 403 364 403 342 c
+403 321 421 303 442 303 c
+464 303 482 321 482 343 c
+h 
+        0 0 0 rg .753 .749 .753 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        479 340 m
+479 361 461 379 440 379 c
+418 379 400 361 400 339 c
+400 318 418 300 440 300 c
+461 300 479 318 479 340 c
+h 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        479 340 m
+479 361 461 379 440 379 c
+418 379 400 361 400 339 c
+400 318 418 300 440 300 c
+461 300 479 318 479 340 c
+h 
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        q Q 
+        q Q 
+        q Q 
+        q Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 424 327 Tm 0 -9 Td(FIR-16) Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 417 340 Tm 0 -9 Td(\() Tj 3 0 Td(o) Tj 6 0 Td(p) Tj 6 0 Td(t) Tj 3 0 Td(i) Tj 2 0 Td(o) Tj 6 0 Td(n) Tj 6 0 Td(a) Tj 6 0 Td(l) Tj 2 0 Td(\)) Tj ET Q
+        Q 
+        Q 
+        q Q 
+        q q q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        592 343 m
+592 364 574 382 552 382 c
+531 382 513 364 513 342 c
+513 321 531 303 553 303 c
+574 303 592 321 592 343 c
+h 
+        .753 .749 .753 rg .753 .749 .753 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        592 343 m
+592 364 574 382 552 382 c
+531 382 513 364 513 342 c
+513 321 531 303 553 303 c
+574 303 592 321 592 343 c
+h 
+        0 0 0 rg .753 .749 .753 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        589 340 m
+589 361 571 379 549 379 c
+528 379 510 361 510 339 c
+510 318 528 300 550 300 c
+571 300 589 318 589 340 c
+h 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        589 340 m
+589 361 571 379 549 379 c
+528 379 510 361 510 339 c
+510 318 528 300 550 300 c
+571 300 589 318 589 340 c
+h 
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        q Q 
+        q Q 
+        q Q 
+        q Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 529 320 Tm 0 -9 Td(FFT C2C) Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 536 333 Tm 0 -9 Td(1) Tj 6 0 Td(6) Tj 6 0 Td(-) Tj 3 0 Td(6) Tj 6 0 Td(4) Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 527 346 Tm 0 -9 Td(\() Tj 3 0 Td(o) Tj 6 0 Td(p) Tj 6 0 Td(t) Tj 3 0 Td(i) Tj 2 0 Td(o) Tj 6 0 Td(n) Tj 6 0 Td(a) Tj 6 0 Td(l) Tj 2 0 Td(\)) Tj ET Q
+        Q 
+        Q 
+        q Q 
+        q q q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        702 343 m
+702 364 684 382 662 382 c
+641 382 623 364 623 342 c
+623 321 641 303 663 303 c
+684 303 702 321 702 343 c
+h 
+        .753 .749 .753 rg .753 .749 .753 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        702 343 m
+702 364 684 382 662 382 c
+641 382 623 364 623 342 c
+623 321 641 303 663 303 c
+684 303 702 321 702 343 c
+h 
+        0 0 0 rg .753 .749 .753 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        699 340 m
+699 361 681 379 659 379 c
+638 379 620 361 620 339 c
+620 318 638 300 660 300 c
+681 300 699 318 699 340 c
+h 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        699 340 m
+699 361 681 379 659 379 c
+638 379 620 361 620 339 c
+620 318 638 300 660 300 c
+681 300 699 318 699 340 c
+h 
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        q Q 
+        q Q 
+        q Q 
+        q Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 638 320 Tm 0 -9 Td(C) Tj 8 0 Td(o) Tj 6 0 Td(h) Tj 6 0 Td(e) Tj 6 0 Td(r) Tj 3 0 Td(e) Tj 6 0 Td(n) Tj 6 0 Td(t) Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 636 333 Tm 0 -9 Td(Stokes I or) Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 647 346 Tm 0 -9 Td(IQUV) Tj ET Q
+        Q 
+        Q 
+        q Q 
+        q q q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        352 433 m
+352 454 334 472 312 472 c
+291 472 273 454 273 432 c
+273 411 291 393 313 393 c
+334 393 352 411 352 433 c
+h 
+        .753 .749 .753 rg .753 .749 .753 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        352 433 m
+352 454 334 472 312 472 c
+291 472 273 454 273 432 c
+273 411 291 393 313 393 c
+334 393 352 411 352 433 c
+h 
+        0 0 0 rg .753 .749 .753 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        349 430 m
+349 451 331 469 309 469 c
+288 469 270 451 270 429 c
+270 408 288 390 310 390 c
+331 390 349 408 349 430 c
+h 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        349 430 m
+349 451 331 469 309 469 c
+288 469 270 451 270 429 c
+270 408 288 390 310 390 c
+331 390 349 408 349 430 c
+h 
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        q Q 
+        q Q 
+        q Q 
+        q Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 287 417 Tm 0 -9 Td(IFFT C2C) Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 304 430 Tm 0 -9 Td(6) Tj 6 0 Td(4) Tj ET Q
+        Q 
+        Q 
+        q Q 
+        q q q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        482 433 m
+482 454 464 472 442 472 c
+421 472 403 454 403 432 c
+403 411 421 393 442 393 c
+464 393 482 411 482 433 c
+h 
+        .753 .749 .753 rg .753 .749 .753 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        482 433 m
+482 454 464 472 442 472 c
+421 472 403 454 403 432 c
+403 411 421 393 442 393 c
+464 393 482 411 482 433 c
+h 
+        0 0 0 rg .753 .749 .753 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        479 430 m
+479 451 461 469 440 469 c
+418 469 400 451 400 429 c
+400 408 418 390 440 390 c
+461 390 479 408 479 430 c
+h 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        479 430 m
+479 451 461 469 440 469 c
+418 469 400 451 400 429 c
+400 408 418 390 440 390 c
+461 390 479 408 479 430 c
+h 
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        q Q 
+        q Q 
+        q Q 
+        q Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 424 417 Tm 0 -9 Td(FIR-16) Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 417 430 Tm 0 -9 Td(\() Tj 3 0 Td(o) Tj 6 0 Td(p) Tj 6 0 Td(t) Tj 3 0 Td(i) Tj 2 0 Td(o) Tj 6 0 Td(n) Tj 6 0 Td(a) Tj 6 0 Td(l) Tj 2 0 Td(\)) Tj ET Q
+        Q 
+        Q 
+        q Q 
+        q q q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        592 433 m
+592 454 574 472 552 472 c
+531 472 513 454 513 432 c
+513 411 531 393 553 393 c
+574 393 592 411 592 433 c
+h 
+        .753 .749 .753 rg .753 .749 .753 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        592 433 m
+592 454 574 472 552 472 c
+531 472 513 454 513 432 c
+513 411 531 393 553 393 c
+574 393 592 411 592 433 c
+h 
+        0 0 0 rg .753 .749 .753 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        589 430 m
+589 451 571 469 549 469 c
+528 469 510 451 510 429 c
+510 408 528 390 550 390 c
+571 390 589 408 589 430 c
+h 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        589 430 m
+589 451 571 469 549 469 c
+528 469 510 451 510 429 c
+510 408 528 390 550 390 c
+571 390 589 408 589 430 c
+h 
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        q Q 
+        q Q 
+        q Q 
+        q Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 529 410 Tm 0 -9 Td(FFT C2C) Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 536 423 Tm 0 -9 Td(1) Tj 6 0 Td(6) Tj 6 0 Td(-) Tj 3 0 Td(6) Tj 6 0 Td(4) Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 527 436 Tm 0 -9 Td(\() Tj 3 0 Td(o) Tj 6 0 Td(p) Tj 6 0 Td(t) Tj 3 0 Td(i) Tj 2 0 Td(o) Tj 6 0 Td(n) Tj 6 0 Td(a) Tj 6 0 Td(l) Tj 2 0 Td(\)) Tj ET Q
+        Q 
+        Q 
+        q Q 
+        q q q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        702 433 m
+702 454 684 472 662 472 c
+641 472 623 454 623 432 c
+623 411 641 393 663 393 c
+684 393 702 411 702 433 c
+h 
+        .753 .749 .753 rg .753 .749 .753 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        702 433 m
+702 454 684 472 662 472 c
+641 472 623 454 623 432 c
+623 411 641 393 663 393 c
+684 393 702 411 702 433 c
+h 
+        0 0 0 rg .753 .749 .753 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        699 430 m
+699 451 681 469 659 469 c
+638 469 620 451 620 429 c
+620 408 638 390 660 390 c
+681 390 699 408 699 430 c
+h 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        699 430 m
+699 451 681 469 659 469 c
+638 469 620 451 620 429 c
+620 408 638 390 660 390 c
+681 390 699 408 699 430 c
+h 
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        q Q 
+        q Q 
+        q Q 
+        q Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 635 410 Tm 0 -9 Td(I) Tj 3 0 Td(n) Tj 6 0 Td(c) Tj 6 0 Td(o) Tj 6 0 Td(h) Tj 6 0 Td(e) Tj 6 0 Td(r) Tj 3 0 Td(e) Tj 6 0 Td(n) Tj 6 0 Td(t) Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 636 423 Tm 0 -9 Td(Stokes I or) Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 647 436 Tm 0 -9 Td(IQUV) Tj ET Q
+        Q 
+        Q 
+        q Q 
+        q q q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        553 13 m
+783 13 l
+783 43 l
+553 43 l
+553 13 l
+
+        .753 .749 .753 rg .753 .749 .753 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        553 13 m
+783 13 l
+783 43 l
+553 43 l
+553 13 l
+
+        0 0 0 rg .753 .749 .753 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        550 10 m
+780 10 l
+780 40 l
+550 40 l
+550 10 l
+
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        550 10 m
+780 10 l
+780 40 l
+550 40 l
+550 10 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        q Q 
+        q Q 
+        q Q 
+        q Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 557 18 Tm 0 -9 Td(D) Tj 8 0 Td(a) Tj 6 0 Td(t) Tj 3 0 Td(a) Tj 6 0 Td( ) Tj 3 0 Td(a) Tj 6 0 Td(n) Tj 6 0 Td(d) Tj 6 0 Td( ) Tj 3 0 Td(M) Tj 9 0 Td(e) Tj 6 0 Td(t) Tj 3 0 Td(a) Tj 6 0 Td(d) Tj 6 0 Td(a) Tj 6 0 Td(t) Tj 2 0 Td(a) Tj 6 0 Td( ) Tj 3 0 Td(W) Tj 10 0 Td(r) Tj 3 0 Td(i) Tj 2 0 Td(t) Tj 2 0 Td(e) Tj 6 0 Td(b) Tj 6 0 Td(a) Tj 6 0 Td(c) Tj 5 0 Td(k) Tj 5 0 Td( ) Tj 3 0 Td(\() Tj 3 0 Td(s) Tj 5 0 Td(t) Tj 2 0 Td(o) Tj 6 0 Td(r) Tj 3 0 Td(a) Tj 6 0 Td(g) Tj 6 0 Td(e) Tj 6 0 Td( ) Tj 3 0 Td(c) Tj 5 0 Td(l) Tj 2 0 Td(u) Tj 6 0 Td(s) Tj 5 0 Td(t) Tj 2 0 Td(e) Tj 6 0 Td(r) Tj 3 0 Td(\)) Tj ET Q
+        Q 
+        Q 
+        q q q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        23 13 m
+173 13 l
+173 43 l
+23 43 l
+23 13 l
+
+        .753 .749 .753 rg .753 .749 .753 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        23 13 m
+173 13 l
+173 43 l
+23 43 l
+23 13 l
+
+        0 0 0 rg .753 .749 .753 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        20 10 m
+170 10 l
+170 40 l
+20 40 l
+20 10 l
+
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        20 10 m
+170 10 l
+170 40 l
+20 40 l
+20 10 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        q Q 
+        q Q 
+        q Q 
+        q Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 25 12 Tm 0 -9 Td(T) Tj 7 0 Td(r) Tj 3 0 Td(a) Tj 6 0 Td(n) Tj 6 0 Td(s) Tj 6 0 Td(p) Tj 6 0 Td(o) Tj 6 0 Td(s) Tj 6 0 Td(e) Tj 6 0 Td(d) Tj 6 0 Td( ) Tj 3 0 Td(S) Tj 7 0 Td(t) Tj 2 0 Td(a) Tj 6 0 Td(t) Tj 2 0 Td(i) Tj 2 0 Td(o) Tj 6 0 Td(n) Tj 6 0 Td( ) Tj 3 0 Td(D) Tj 8 0 Td(a) Tj 6 0 Td(t) Tj 2 0 Td(a) Tj 6 0 Td( ) Tj 3 0 Td(f) Tj 2 0 Td(r) Tj 3 0 Td(o) Tj 6 0 Td(m) Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 35 25 Tm 0 -9 Td(N) Tj 8 0 Td(e) Tj 6 0 Td(t) Tj 3 0 Td(w) Tj 8 0 Td(o) Tj 6 0 Td(r) Tj 3 0 Td(k) Tj 5 0 Td( ) Tj 3 0 Td(\() Tj 3 0 Td(u) Tj 6 0 Td(p) Tj 6 0 Td( ) Tj 3 0 Td(t) Tj 2 0 Td(o) Tj 6 0 Td( ) Tj 3 0 Td(2) Tj 6 0 Td(4) Tj 6 0 Td(0) Tj 6 0 Td( ) Tj 3 0 Td(G) Tj 8 0 Td(b) Tj 6 0 Td(i) Tj 2 0 Td(t) Tj 2 0 Td(/) Tj 2 0 Td(s) Tj 5 0 Td(\)) Tj ET Q
+        Q 
+        Q 
+        q q q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        522 113 m
+522 134 504 152 482 152 c
+461 152 443 134 443 112 c
+443 91 461 73 483 73 c
+504 73 522 91 522 113 c
+h 
+        .753 .749 .753 rg .753 .749 .753 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        522 113 m
+522 134 504 152 482 152 c
+461 152 443 134 443 112 c
+443 91 461 73 483 73 c
+504 73 522 91 522 113 c
+h 
+        0 0 0 rg .753 .749 .753 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        519 110 m
+519 131 501 149 479 149 c
+458 149 440 131 440 109 c
+440 88 458 70 480 70 c
+501 70 519 88 519 110 c
+h 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        519 110 m
+519 131 501 149 479 149 c
+458 149 440 131 440 109 c
+440 88 458 70 480 70 c
+501 70 519 88 519 110 c
+h 
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        q Q 
+        q Q 
+        q Q 
+        q Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 457 97 Tm 0 -9 Td(Bandpass) Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 456 110 Tm 0 -9 Td(C) Tj 8 0 Td(o) Tj 6 0 Td(r) Tj 3 0 Td(r) Tj 3 0 Td(e) Tj 6 0 Td(c) Tj 5 0 Td(t) Tj 2 0 Td(i) Tj 2 0 Td(o) Tj 6 0 Td(n) Tj ET Q
+        Q 
+        Q 
+        q Q 
+        q q q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        642 113 m
+642 134 624 152 603 152 c
+581 152 563 134 563 112 c
+563 91 581 73 603 73 c
+624 73 642 91 642 113 c
+h 
+        .753 .749 .753 rg .753 .749 .753 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        642 113 m
+642 134 624 152 603 152 c
+581 152 563 134 563 112 c
+563 91 581 73 603 73 c
+624 73 642 91 642 113 c
+h 
+        0 0 0 rg .753 .749 .753 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        639 110 m
+639 131 621 149 599 149 c
+578 149 560 131 560 109 c
+560 88 578 70 600 70 c
+621 70 639 88 639 110 c
+h 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        639 110 m
+639 131 621 149 599 149 c
+578 149 560 131 560 109 c
+560 88 578 70 600 70 c
+621 70 639 88 639 110 c
+h 
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        q Q 
+        q Q 
+        q Q 
+        q Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 574 103 Tm 0 -9 Td(C) Tj 8 0 Td(o) Tj 6 0 Td(r) Tj 3 0 Td(r) Tj 3 0 Td(e) Tj 6 0 Td(l) Tj 2 0 Td(a) Tj 6 0 Td(t) Tj 2 0 Td(i) Tj 2 0 Td(o) Tj 6 0 Td(n) Tj ET Q
+        Q 
+        Q 
+        q Q 
+        q q q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        142 113 m
+142 134 124 152 103 152 c
+81 152 63 134 63 112 c
+63 91 81 73 103 73 c
+124 73 142 91 142 113 c
+h 
+        .753 .749 .753 rg .753 .749 .753 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        142 113 m
+142 134 124 152 103 152 c
+81 152 63 134 63 112 c
+63 91 81 73 103 73 c
+124 73 142 91 142 113 c
+h 
+        0 0 0 rg .753 .749 .753 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        139 110 m
+139 131 121 149 99 149 c
+78 149 60 131 60 109 c
+60 88 78 70 100 70 c
+121 70 139 88 139 110 c
+h 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        139 110 m
+139 131 121 149 99 149 c
+78 149 60 131 60 109 c
+60 88 78 70 100 70 c
+121 70 139 88 139 110 c
+h 
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        q Q 
+        q Q 
+        q Q 
+        q Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 75 103 Tm 0 -9 Td(I) Tj 3 0 Td(n) Tj 6 0 Td(t) Tj 3 0 Td(T) Tj 7 0 Td(o) Tj 6 0 Td(F) Tj 7 0 Td(l) Tj 2 0 Td(o) Tj 6 0 Td(a) Tj 6 0 Td(t) Tj ET Q
+        Q 
+        Q 
+        q Q 
+        q q q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        222 113 m
+222 134 204 152 182 152 c
+161 152 143 134 143 112 c
+143 91 161 73 183 73 c
+204 73 222 91 222 113 c
+h 
+        .753 .749 .753 rg .753 .749 .753 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        222 113 m
+222 134 204 152 182 152 c
+161 152 143 134 143 112 c
+143 91 161 73 183 73 c
+204 73 222 91 222 113 c
+h 
+        0 0 0 rg .753 .749 .753 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        219 110 m
+219 131 201 149 179 149 c
+158 149 140 131 140 109 c
+140 88 158 70 180 70 c
+201 70 219 88 219 110 c
+h 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        219 110 m
+219 131 201 149 179 149 c
+158 149 140 131 140 109 c
+140 88 158 70 180 70 c
+201 70 219 88 219 110 c
+h 
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        q Q 
+        q Q 
+        q Q 
+        q Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 164 103 Tm 0 -9 Td(FIR-16) Tj ET Q
+        Q 
+        Q 
+        q Q 
+        q q q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        722 113 m
+722 134 704 152 682 152 c
+661 152 643 134 643 112 c
+643 91 661 73 683 73 c
+704 73 722 91 722 113 c
+h 
+        .753 .749 .753 rg .753 .749 .753 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        722 113 m
+722 134 704 152 682 152 c
+661 152 643 134 643 112 c
+643 91 661 73 683 73 c
+704 73 722 91 722 113 c
+h 
+        0 0 0 rg .753 .749 .753 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        719 110 m
+719 131 701 149 679 149 c
+658 149 640 131 640 109 c
+640 88 658 70 680 70 c
+701 70 719 88 719 110 c
+h 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        719 110 m
+719 131 701 149 679 149 c
+658 149 640 131 640 109 c
+640 88 658 70 680 70 c
+701 70 719 88 719 110 c
+h 
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        q Q 
+        q Q 
+        q Q 
+        q Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 667 90 Tm 0 -9 Td(T) Tj 8 0 Td(i) Tj 2 0 Td(m) Tj 9 0 Td(e) Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 656 103 Tm 0 -9 Td(A) Tj 8 0 Td(v) Tj 6 0 Td(e) Tj 6 0 Td(r) Tj 3 0 Td(a) Tj 6 0 Td(g) Tj 6 0 Td(i) Tj 2 0 Td(n) Tj 6 0 Td(g) Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 655 116 Tm 0 -9 Td(t) Tj 3 0 Td(o) Tj 6 0 Td( ) Tj 3 0 Td(0) Tj 6 0 Td(.) Tj 2 0 Td(2) Tj 6 0 Td(5) Tj 6 0 Td(-) Tj 3 0 Td(2) Tj 6 0 Td( ) Tj 3 0 Td(s) Tj ET Q
+        Q 
+        Q 
+        q Q 
+        q q q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        782 343 m
+782 364 764 382 742 382 c
+721 382 703 364 703 342 c
+703 321 721 303 743 303 c
+764 303 782 321 782 343 c
+h 
+        .753 .749 .753 rg .753 .749 .753 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        782 343 m
+782 364 764 382 742 382 c
+721 382 703 364 703 342 c
+703 321 721 303 743 303 c
+764 303 782 321 782 343 c
+h 
+        0 0 0 rg .753 .749 .753 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        779 340 m
+779 361 761 379 739 379 c
+718 379 700 361 700 339 c
+700 318 718 300 740 300 c
+761 300 779 318 779 340 c
+h 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        779 340 m
+779 361 761 379 739 379 c
+718 379 700 361 700 339 c
+700 318 718 300 740 300 c
+761 300 779 318 779 340 c
+h 
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        q Q 
+        q Q 
+        q Q 
+        q Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 727 320 Tm 0 -9 Td(T) Tj 8 0 Td(i) Tj 2 0 Td(m) Tj 9 0 Td(e) Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 716 333 Tm 0 -9 Td(A) Tj 8 0 Td(v) Tj 6 0 Td(e) Tj 6 0 Td(r) Tj 3 0 Td(a) Tj 6 0 Td(g) Tj 6 0 Td(i) Tj 2 0 Td(n) Tj 6 0 Td(g) Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 723 346 Tm 0 -9 Td(by 1-8x) Tj ET Q
+        Q 
+        Q 
+        q Q 
+        q q q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        782 433 m
+782 454 764 472 742 472 c
+721 472 703 454 703 432 c
+703 411 721 393 743 393 c
+764 393 782 411 782 433 c
+h 
+        .753 .749 .753 rg .753 .749 .753 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        782 433 m
+782 454 764 472 742 472 c
+721 472 703 454 703 432 c
+703 411 721 393 743 393 c
+764 393 782 411 782 433 c
+h 
+        0 0 0 rg .753 .749 .753 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        779 430 m
+779 451 761 469 739 469 c
+718 469 700 451 700 429 c
+700 408 718 390 740 390 c
+761 390 779 408 779 430 c
+h 
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        779 430 m
+779 451 761 469 739 469 c
+718 469 700 451 700 429 c
+700 408 718 390 740 390 c
+761 390 779 408 779 430 c
+h 
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        q Q 
+        q Q 
+        q Q 
+        q Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 727 410 Tm 0 -9 Td(T) Tj 8 0 Td(i) Tj 2 0 Td(m) Tj 9 0 Td(e) Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 716 423 Tm 0 -9 Td(A) Tj 8 0 Td(v) Tj 6 0 Td(e) Tj 6 0 Td(r) Tj 3 0 Td(a) Tj 6 0 Td(g) Tj 6 0 Td(i) Tj 2 0 Td(n) Tj 6 0 Td(g) Tj ET Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 723 436 Tm 0 -9 Td(by 1-8x) Tj ET Q
+        Q 
+        Q 
+        q Q 
+        q Q 
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+230 230 m
+244 230 262 230 270 230 c S Q
+        q Q 
+        q q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        270 230 m
+254 224 l
+254 236 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        270 230 m
+254 224 l
+254 236 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q Q 
+        q q Q 
+        Q 
+        q Q 
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+100 348 m
+117 394 191 430 270 431 c S Q
+        q Q 
+        q q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        270 431 m
+254 425 l
+254 437 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        270 431 m
+254 425 l
+254 437 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 165 393 cm 1 1 1 rg 0 0 7 -11 re f Q
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 165 393 Tm 0 -9 Td(T) Tj ET Q
+        q Q 
+        q q Q 
+        Q 
+        q Q 
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+40 40 m
+40 71 40 136 40 190 c S Q
+        q Q 
+        q q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        40 190 m
+46 174 l
+34 174 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        40 190 m
+46 174 l
+34 174 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q Q 
+        q q Q 
+        Q 
+        q Q 
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+678 70 m
+678 61 678 48 678 40 c S Q
+        q Q 
+        q q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        678 40 m
+672 56 l
+684 56 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        678 40 m
+672 56 l
+684 56 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q Q 
+        q q Q 
+        Q 
+        q Q 
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+350 430 m
+362 430 384 430 400 430 c S Q
+        q Q 
+        q q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        400 430 m
+384 424 l
+384 436 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        400 430 m
+384 424 l
+384 436 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 368 414 cm 1 1 1 rg 0 0 7 -11 re f Q
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 368 414 Tm 0 -9 Td(S) Tj ET Q
+        q Q 
+        q q Q 
+        Q 
+        q Q 
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+270 263 m
+231 272 157 289 100 302 c S Q
+        q Q 
+        q q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        100 302 m
+117 304 l
+114 293 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        100 302 m
+117 304 l
+114 293 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 274 265 cm 1 1 1 rg 0 0 7 -11 re f Q
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 274 265 Tm 0 -9 Td(T) Tj ET Q
+        q Q 
+        q q Q 
+        Q 
+        q Q 
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+220 110 m
+228 110 242 110 250 110 c S Q
+        q Q 
+        q q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        250 110 m
+234 104 l
+234 116 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        250 110 m
+234 104 l
+234 116 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q Q 
+        q q Q 
+        Q 
+        q Q 
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+330 110 m
+338 110 352 110 360 110 c S Q
+        q Q 
+        q q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        360 110 m
+344 104 l
+344 116 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        360 110 m
+344 104 l
+344 116 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q Q 
+        q q Q 
+        Q 
+        q Q 
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+100 340 m
+111 340 133 340 150 340 c S Q
+        q Q 
+        q q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        150 340 m
+134 334 l
+134 346 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        150 340 m
+134 334 l
+134 346 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 102 321 cm 1 1 1 rg 0 0 7 -11 re f Q
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 102 321 Tm 0 -9 Td(T) Tj ET Q
+        q Q 
+        q q Q 
+        Q 
+        q Q 
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+100 230 m
+117 230 139 230 150 230 c S Q
+        q Q 
+        q q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        150 230 m
+134 224 l
+134 236 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        150 230 m
+134 224 l
+134 236 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 101 210 cm 1 1 1 rg 0 0 27 -11 re f Q
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 101 210 Tm 0 -9 Td(T) Tj 7 0 Td( ) Tj 3 0 Td( ) Tj 3 0 Td( ) Tj 3 0 Td( ) Tj 3 0 Td(S) Tj ET Q
+        q Q 
+        q q Q 
+        Q 
+        q Q 
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+350 340 m
+364 340 386 340 400 340 c S Q
+        q Q 
+        q q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        400 340 m
+384 334 l
+384 346 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        400 340 m
+384 334 l
+384 346 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 368 325 cm 1 1 1 rg 0 0 7 -11 re f Q
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 368 325 Tm 0 -9 Td(S) Tj ET Q
+        q Q 
+        q q Q 
+        Q 
+        q Q 
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+480 340 m
+488 340 502 340 510 340 c S Q
+        q Q 
+        q q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        510 340 m
+494 334 l
+494 346 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        510 340 m
+494 334 l
+494 346 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q Q 
+        q q Q 
+        Q 
+        q Q 
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+230 340 m
+241 340 259 340 270 340 c S Q
+        q Q 
+        q q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        270 340 m
+254 334 l
+254 346 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        270 340 m
+254 334 l
+254 346 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 244 324 cm 1 1 1 rg 0 0 7 -11 re f Q
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 244 324 Tm 0 -9 Td(T) Tj ET Q
+        q Q 
+        q q Q 
+        Q 
+        q Q 
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+740 300 m
+740 209 740 97 740 40 c S Q
+        q Q 
+        q q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        740 40 m
+734 56 l
+746 56 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        740 40 m
+734 56 l
+746 56 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 745 177 cm 1 1 1 rg 0 0 7 -11 re f Q
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 745 177 Tm 0 -9 Td(T) Tj ET Q
+        q Q 
+        q q Q 
+        Q 
+        q Q 
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+780 410 m
+786 378 784 217 775 40 c S Q
+        q Q 
+        q q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        775 40 m
+770 56 l
+782 56 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        775 40 m
+770 56 l
+782 56 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 769 177 cm 1 1 1 rg 0 0 7 -11 re f Q
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 769 177 Tm 0 -9 Td(T) Tj ET Q
+        q Q 
+        q q Q 
+        Q 
+        q Q 
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+99 40 m
+99 47 99 60 100 70 c S Q
+        q Q 
+        q q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        100 70 m
+105 54 l
+93 54 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        100 70 m
+105 54 l
+93 54 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q Q 
+        q q Q 
+        Q 
+        q Q 
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+590 340 m
+598 340 612 340 620 340 c S Q
+        q Q 
+        q q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        620 340 m
+604 334 l
+604 346 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        620 340 m
+604 334 l
+604 346 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q Q 
+        q q Q 
+        Q 
+        q Q 
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+480 430 m
+488 430 502 430 510 430 c S Q
+        q Q 
+        q q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        510 430 m
+494 424 l
+494 436 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        510 430 m
+494 424 l
+494 436 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q Q 
+        q q Q 
+        Q 
+        q Q 
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+590 430 m
+598 430 612 430 620 430 c S Q
+        q Q 
+        q q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        620 430 m
+604 424 l
+604 436 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        620 430 m
+604 424 l
+604 436 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q Q 
+        q q Q 
+        Q 
+        q Q 
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+520 110 m
+528 110 546 110 560 110 c S Q
+        q Q 
+        q q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        560 110 m
+544 104 l
+544 116 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        n 
+        560 110 m
+544 104 l
+544 116 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q 0.959748 -0.000000 -0.000000 -0.959578 0.000000 -0.000000 cm 
+        q 1 0 0 -1 523 94 cm 1 1 1 rg 0 0 7 -11 re f Q
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 523 94 Tm 0 -9 Td(T) Tj ET Q
+        q Q 
+        q q Q 
+        Q 
+        Q
+        Q
+
+endstream
+endobj
+5 0 obj
+  <<
+    /Type/Page
+    /Parent 3 0 R
+    /Resources 2 0 R
+    /MediaBox [0 0 571 819]
+    /Contents 4 0 R
+    /Group << /S /Transparency /CS /DeviceRGB /I false /K false >>
+  >>
+endobj
+6 0 obj
+  <</Length 54571>>
+  stream
+        q 0.750000 0 0 0.750000 0.000000 819.349976 cm 
+        q  
+        % VpOrgX: 0, VpOrgY: 0 (RecNo: 1)
+         
+        % mm: 8 (RecNo: 2)
+         
+        % WinExtX: 795, WinExtY: 1138 (RecNo: 3)
+         
+        % VpExtX: 763, VpExtY: -1092 (RecNo: 4)
+         
+        % WinOrgX: 795, WinOrgY: 0 (RecNo: 5)
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 170 m 10 173 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 177 m 10 180 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 184 m 10 187 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 191 m 10 194 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 198 m 10 201 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 205 m 10 208 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 212 m 10 215 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 219 m 10 222 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 226 m 10 229 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 233 m 10 236 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 240 m 10 243 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 247 m 10 250 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 254 m 10 257 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 261 m 10 264 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 268 m 10 271 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 275 m 10 278 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 282 m 10 285 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 289 m 10 292 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 296 m 10 299 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 303 m 10 306 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 310 m 10 313 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 317 m 10 320 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 324 m 10 327 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 331 m 10 334 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 338 m 10 341 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 345 m 10 348 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 352 m 10 355 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 359 m 10 362 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 366 m 10 369 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 373 m 10 376 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 380 m 10 383 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 387 m 10 390 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 394 m 10 397 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 401 m 10 404 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 408 m 10 411 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 415 m 10 418 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 422 m 10 425 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 429 m 10 432 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 436 m 10 439 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 443 m 10 446 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 450 m 10 453 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 457 m 10 460 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 464 m 10 467 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 471 m 10 474 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 478 m 10 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+10 480 m 11 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+15 480 m 18 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+22 480 m 25 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+29 480 m 32 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+36 480 m 39 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+43 480 m 46 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+50 480 m 53 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+57 480 m 60 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+64 480 m 67 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+71 480 m 74 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+78 480 m 81 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+85 480 m 88 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+92 480 m 95 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+99 480 m 102 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+106 480 m 109 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+113 480 m 116 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+120 480 m 123 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+127 480 m 130 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+134 480 m 137 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+141 480 m 144 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+148 480 m 151 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+155 480 m 158 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+162 480 m 165 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+169 480 m 172 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+176 480 m 179 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+183 480 m 186 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+190 480 m 193 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+197 480 m 200 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+204 480 m 207 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+211 480 m 214 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+218 480 m 221 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+225 480 m 228 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+232 480 m 235 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+239 480 m 242 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+246 480 m 249 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+253 480 m 256 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+260 480 m 263 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+267 480 m 270 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+274 480 m 277 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+281 480 m 284 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+288 480 m 291 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+295 480 m 298 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+302 480 m 305 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+309 480 m 312 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+316 480 m 319 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+323 480 m 326 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+330 480 m 333 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+337 480 m 340 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+344 480 m 347 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+351 480 m 354 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+358 480 m 361 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+365 480 m 368 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+372 480 m 375 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+379 480 m 382 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+386 480 m 389 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+393 480 m 396 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+400 480 m 403 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+407 480 m 410 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+414 480 m 417 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+421 480 m 424 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+428 480 m 431 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+435 480 m 438 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+442 480 m 445 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+449 480 m 452 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+456 480 m 459 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+463 480 m 466 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+470 480 m 473 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+477 480 m 480 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+484 480 m 487 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+491 480 m 494 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+498 480 m 501 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+505 480 m 508 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+512 480 m 515 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+519 480 m 522 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+526 480 m 529 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+533 480 m 536 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+540 480 m 543 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+547 480 m 550 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+554 480 m 557 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+561 480 m 564 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+568 480 m 571 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+575 480 m 578 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+582 480 m 585 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+589 480 m 592 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+596 480 m 599 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+603 480 m 606 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+610 480 m 613 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+617 480 m 620 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+624 480 m 627 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+631 480 m 634 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+638 480 m 641 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+645 480 m 648 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+652 480 m 655 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+659 480 m 662 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+666 480 m 669 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+673 480 m 676 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+680 480 m 683 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+687 480 m 690 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+694 480 m 697 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+701 480 m 704 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+708 480 m 711 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+715 480 m 718 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+722 480 m 725 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+729 480 m 732 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+736 480 m 739 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+743 480 m 746 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+750 480 m 753 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+757 480 m 760 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+764 480 m 767 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+771 480 m 774 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+778 480 m 781 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+785 480 m 788 480 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 478 m 790 475 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 471 m 790 468 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 464 m 790 461 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 457 m 790 454 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 450 m 790 447 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 443 m 790 440 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 436 m 790 433 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 429 m 790 426 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 422 m 790 419 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 415 m 790 412 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 408 m 790 405 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 401 m 790 398 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 394 m 790 391 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 387 m 790 384 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 380 m 790 377 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 373 m 790 370 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 366 m 790 363 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 359 m 790 356 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 352 m 790 349 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 345 m 790 342 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 338 m 790 335 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 331 m 790 328 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 324 m 790 321 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 317 m 790 314 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 310 m 790 307 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 303 m 790 300 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 296 m 790 293 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 289 m 790 286 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 282 m 790 279 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 275 m 790 272 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 268 m 790 265 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 261 m 790 258 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 254 m 790 251 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 247 m 790 244 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 240 m 790 237 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 233 m 790 230 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 226 m 790 223 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 219 m 790 216 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 212 m 790 209 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 205 m 790 202 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 198 m 790 195 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 191 m 790 188 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 184 m 790 181 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 177 m 790 174 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+790 170 m 787 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+783 170 m 780 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+776 170 m 773 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+769 170 m 766 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+762 170 m 759 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+755 170 m 752 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+748 170 m 745 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+741 170 m 738 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+734 170 m 731 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+727 170 m 724 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+720 170 m 717 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+713 170 m 710 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+706 170 m 703 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+699 170 m 696 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+692 170 m 689 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+685 170 m 682 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+678 170 m 675 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+671 170 m 668 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+664 170 m 661 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+657 170 m 654 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+650 170 m 647 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+643 170 m 640 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+636 170 m 633 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+629 170 m 626 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+622 170 m 619 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+615 170 m 612 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+608 170 m 605 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+601 170 m 598 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+594 170 m 591 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+587 170 m 584 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+580 170 m 577 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+573 170 m 570 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+566 170 m 563 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+559 170 m 556 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+552 170 m 549 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+545 170 m 542 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+538 170 m 535 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+531 170 m 528 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+524 170 m 521 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+517 170 m 514 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+510 170 m 507 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+503 170 m 500 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+496 170 m 493 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+489 170 m 486 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+482 170 m 479 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+475 170 m 472 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+468 170 m 465 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+461 170 m 458 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+454 170 m 451 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+447 170 m 444 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+440 170 m 437 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+433 170 m 430 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+426 170 m 423 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+419 170 m 416 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+412 170 m 409 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+405 170 m 402 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+398 170 m 395 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+391 170 m 388 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+384 170 m 381 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+377 170 m 374 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+370 170 m 367 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+363 170 m 360 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+356 170 m 353 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+349 170 m 346 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+342 170 m 339 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+335 170 m 332 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+328 170 m 325 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+321 170 m 318 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+314 170 m 311 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+307 170 m 304 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+300 170 m 297 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+293 170 m 290 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+286 170 m 283 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+279 170 m 276 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+272 170 m 269 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+265 170 m 262 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+258 170 m 255 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+251 170 m 248 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+244 170 m 241 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+237 170 m 234 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+230 170 m 227 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+223 170 m 220 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+216 170 m 213 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+209 170 m 206 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+202 170 m 199 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+195 170 m 192 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+188 170 m 185 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+181 170 m 178 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+174 170 m 171 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+167 170 m 164 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+160 170 m 157 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+153 170 m 150 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+146 170 m 143 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+139 170 m 136 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+132 170 m 129 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+125 170 m 122 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+118 170 m 115 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+111 170 m 108 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+104 170 m 101 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+97 170 m 94 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+90 170 m 87 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+83 170 m 80 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+76 170 m 73 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+69 170 m 66 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+62 170 m 59 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+55 170 m 52 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+48 170 m 45 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+41 170 m 38 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+34 170 m 31 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+27 170 m 24 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+20 170 m 17 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+13 170 m 10 170 l S Q
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 233 174 Tm 0 -9 Td(B) Tj 8 0 Td(e) Tj 6 0 Td(a) Tj 6 0 Td(m) Tj 9 0 Td(f) Tj 3 0 Td(o) Tj 6 0 Td(r) Tj 3 0 Td(m) Tj 9 0 Td(e) Tj 6 0 Td(r) Tj 3 0 Td( ) Tj 3 0 Td(P) Tj 8 0 Td(i) Tj 2 0 Td(p) Tj 6 0 Td(e) Tj 6 0 Td(l) Tj 2 0 Td(i) Tj 2 0 Td(n) Tj 6 0 Td(e) Tj 6 0 Td( ) Tj 3 0 Td(w) Tj 8 0 Td(i) Tj 2 0 Td(t) Tj 3 0 Td(h) Tj 6 0 Td( ) Tj 3 0 Td(C) Tj 8 0 Td(o) Tj 6 0 Td(h) Tj 6 0 Td(e) Tj 6 0 Td(r) Tj 3 0 Td(e) Tj 6 0 Td(n) Tj 6 0 Td(t) Tj 2 0 Td( ) Tj 3 0 Td(a) Tj 6 0 Td(n) Tj 6 0 Td(d) Tj 6 0 Td(/) Tj 2 0 Td(o) Tj 6 0 Td(r) Tj 3 0 Td( ) Tj 3 0 Td(I) Tj 2 0 Td(n) Tj 6 0 Td(c) Tj 5 0 Td(o) Tj 6 0 Td(h) Tj 6 0 Td(e) Tj 6 0 Td(r) Tj 3 0 Td(e) Tj 6 0 Td(n) Tj 6 0 Td(t) Tj 2 0 Td( ) Tj 3 0 Td(S) Tj 7 0 Td(t) Tj 2 0 Td(o) Tj 6 0 Td(k) Tj 5 0 Td(e) Tj 6 0 Td(s) Tj 5 0 Td( ) Tj 3 0 Td(O) Tj 8 0 Td(u) Tj 6 0 Td(t) Tj 2 0 Td(p) Tj 6 0 Td(u) Tj 6 0 Td(t) Tj 2 0 Td(\() Tj 3 0 Td(s) Tj 5 0 Td(\)) Tj ET Q
+        q Q 
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+230 230 m
+244 230 262 230 270 230 c S Q
+        q Q 
+        q q q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        n 
+        270 230 m
+254 224 l
+254 236 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        n 
+        270 230 m
+254 224 l
+254 236 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q Q 
+        q q Q 
+        Q 
+        q Q 
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+100 348 m
+117 394 191 430 270 431 c S Q
+        q Q 
+        q q q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        n 
+        270 431 m
+254 425 l
+254 437 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        n 
+        270 431 m
+254 425 l
+254 437 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        q 1 0 0 -1 165 393 cm 1 1 1 rg 0 0 7 -11 re f Q
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 165 393 Tm 0 -9 Td(T) Tj ET Q
+        q Q 
+        q q Q 
+        Q 
+        q Q 
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+40 40 m
+40 71 40 136 40 190 c S Q
+        q Q 
+        q q q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        n 
+        40 190 m
+46 174 l
+34 174 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        n 
+        40 190 m
+46 174 l
+34 174 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q Q 
+        q q Q 
+        Q 
+        q Q 
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+678 70 m
+678 61 678 48 678 40 c S Q
+        q Q 
+        q q q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        n 
+        678 40 m
+672 56 l
+684 56 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        n 
+        678 40 m
+672 56 l
+684 56 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q Q 
+        q q Q 
+        Q 
+        q Q 
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+350 430 m
+362 430 384 430 400 430 c S Q
+        q Q 
+        q q q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        n 
+        400 430 m
+384 424 l
+384 436 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        n 
+        400 430 m
+384 424 l
+384 436 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        q 1 0 0 -1 368 414 cm 1 1 1 rg 0 0 7 -11 re f Q
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 368 414 Tm 0 -9 Td(S) Tj ET Q
+        q Q 
+        q q Q 
+        Q 
+        q Q 
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+270 263 m
+231 272 157 289 100 302 c S Q
+        q Q 
+        q q q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        n 
+        100 302 m
+117 304 l
+114 293 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        n 
+        100 302 m
+117 304 l
+114 293 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        q 1 0 0 -1 274 265 cm 1 1 1 rg 0 0 7 -11 re f Q
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 274 265 Tm 0 -9 Td(T) Tj ET Q
+        q Q 
+        q q Q 
+        Q 
+        q Q 
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+220 110 m
+228 110 242 110 250 110 c S Q
+        q Q 
+        q q q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        n 
+        250 110 m
+234 104 l
+234 116 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        n 
+        250 110 m
+234 104 l
+234 116 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q Q 
+        q q Q 
+        Q 
+        q Q 
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+330 110 m
+338 110 352 110 360 110 c S Q
+        q Q 
+        q q q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        n 
+        360 110 m
+344 104 l
+344 116 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        n 
+        360 110 m
+344 104 l
+344 116 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q Q 
+        q q Q 
+        Q 
+        q Q 
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+100 340 m
+111 340 133 340 150 340 c S Q
+        q Q 
+        q q q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        n 
+        150 340 m
+134 334 l
+134 346 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        n 
+        150 340 m
+134 334 l
+134 346 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        q 1 0 0 -1 102 321 cm 1 1 1 rg 0 0 7 -11 re f Q
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 102 321 Tm 0 -9 Td(T) Tj ET Q
+        q Q 
+        q q Q 
+        Q 
+        q Q 
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+100 230 m
+117 230 139 230 150 230 c S Q
+        q Q 
+        q q q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        n 
+        150 230 m
+134 224 l
+134 236 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        n 
+        150 230 m
+134 224 l
+134 236 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        q 1 0 0 -1 101 210 cm 1 1 1 rg 0 0 27 -11 re f Q
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 101 210 Tm 0 -9 Td(T) Tj 7 0 Td( ) Tj 3 0 Td( ) Tj 3 0 Td( ) Tj 3 0 Td( ) Tj 3 0 Td(S) Tj ET Q
+        q Q 
+        q q Q 
+        Q 
+        q Q 
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+350 340 m
+364 340 386 340 400 340 c S Q
+        q Q 
+        q q q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        n 
+        400 340 m
+384 334 l
+384 346 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        n 
+        400 340 m
+384 334 l
+384 346 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        q 1 0 0 -1 368 325 cm 1 1 1 rg 0 0 7 -11 re f Q
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 368 325 Tm 0 -9 Td(S) Tj ET Q
+        q Q 
+        q q Q 
+        Q 
+        q Q 
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+480 340 m
+488 340 502 340 510 340 c S Q
+        q Q 
+        q q q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        n 
+        510 340 m
+494 334 l
+494 346 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        n 
+        510 340 m
+494 334 l
+494 346 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q Q 
+        q q Q 
+        Q 
+        q Q 
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+230 340 m
+241 340 259 340 270 340 c S Q
+        q Q 
+        q q q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        n 
+        270 340 m
+254 334 l
+254 346 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        n 
+        270 340 m
+254 334 l
+254 346 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        q 1 0 0 -1 244 324 cm 1 1 1 rg 0 0 7 -11 re f Q
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 244 324 Tm 0 -9 Td(T) Tj ET Q
+        q Q 
+        q q Q 
+        Q 
+        q Q 
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+740 300 m
+740 209 740 97 740 40 c S Q
+        q Q 
+        q q q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        n 
+        740 40 m
+734 56 l
+746 56 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        n 
+        740 40 m
+734 56 l
+746 56 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        q 1 0 0 -1 745 177 cm 1 1 1 rg 0 0 7 -11 re f Q
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 745 177 Tm 0 -9 Td(T) Tj ET Q
+        q Q 
+        q q Q 
+        Q 
+        q Q 
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+780 410 m
+786 378 784 217 775 40 c S Q
+        q Q 
+        q q q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        n 
+        775 40 m
+770 56 l
+782 56 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        n 
+        775 40 m
+770 56 l
+782 56 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        q 1 0 0 -1 769 177 cm 1 1 1 rg 0 0 7 -11 re f Q
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 769 177 Tm 0 -9 Td(T) Tj ET Q
+        q Q 
+        q q Q 
+        Q 
+        q Q 
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+99 40 m
+99 47 99 60 100 70 c S Q
+        q Q 
+        q q q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        n 
+        100 70 m
+105 54 l
+93 54 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        n 
+        100 70 m
+105 54 l
+93 54 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q Q 
+        q q Q 
+        Q 
+        q Q 
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+590 340 m
+598 340 612 340 620 340 c S Q
+        q Q 
+        q q q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        n 
+        620 340 m
+604 334 l
+604 346 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        n 
+        620 340 m
+604 334 l
+604 346 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q Q 
+        q q Q 
+        Q 
+        q Q 
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+480 430 m
+488 430 502 430 510 430 c S Q
+        q Q 
+        q q q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        n 
+        510 430 m
+494 424 l
+494 436 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        n 
+        510 430 m
+494 424 l
+494 436 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q Q 
+        q q Q 
+        Q 
+        q Q 
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+590 430 m
+598 430 612 430 620 430 c S Q
+        q Q 
+        q q q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        n 
+        620 430 m
+604 424 l
+604 436 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        n 
+        620 430 m
+604 424 l
+604 436 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q Q 
+        q q Q 
+        Q 
+        q Q 
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+520 110 m
+528 110 546 110 560 110 c S Q
+        q Q 
+        q q q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        n 
+        560 110 m
+544 104 l
+544 116 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        n 
+        560 110 m
+544 104 l
+544 116 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q 0.959748 -0.000000 -0.000000 -0.959578 -763.000000 -0.000000 cm 
+        q 1 0 0 -1 523 94 cm 1 1 1 rg 0 0 7 -11 re f Q
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 523 94 Tm 0 -9 Td(T) Tj ET Q
+        q Q 
+        q q Q 
+        Q 
+        Q
+        Q
+
+endstream
+endobj
+7 0 obj
+  <<
+    /Type/Page
+    /Parent 3 0 R
+    /Resources 2 0 R
+    /MediaBox [0 0 571 819]
+    /Contents 6 0 R
+    /Group << /S /Transparency /CS /DeviceRGB /I false /K false >>
+  >>
+endobj
+8 0 obj
+  [ 750 750 278 278 355 556 556 889 667 191 333 333 389 584 278 333 278 278 556 556 556 556 556 556 556 556 556 556 278 278 584 
+  584 584 556 1015 667 667 722 722 667 611 778 722 278 500 667 556 833 722 778 667 778 722 667 611 722 667 944 667 667 611 
+  278 278 278 469 556 333 556 556 500 556 556 278 556 556 222 222 500 222 833 556 556 556 556 333 500 278 556 500 722 500 
+  500 500 334 260 334 584 750 556 750 222 556 333 1000 556 556 333 1000 667 333 1000 750 611 750 750 222 222 333 333 350 556 
+  1000 333 1000 500 333 944 750 500 667 278 333 556 556 556 556 260 556 333 737 370 556 584 333 737 552 400 549 333 333 333 
+  576 537 333 333 333 365 556 834 834 834 611 667 667 667 667 667 667 1000 722 667 667 667 667 278 278 278 278 722 722 778 
+  778 778 778 778 584 778 722 722 722 722 667 667 611 556 556 556 556 556 556 889 500 556 556 556 556 278 278 278 278 556 
+  556 556 556 556 556 556 549 611 556 556 556 556 500 556 500 ] 
+endobj
+9 0 obj
+  <<
+    /Type/FontDescriptor
+    /FontName/Arial
+    /Ascent 905/CapHeight 905/Descent -212
+    /Flags 32
+    /FontBBox [0 -212 1015 905]
+    /ItalicAngle 0/StemV 0
+  >>
+endobj
+10 0 obj
+  <<
+    /Type/Font/Subtype/TrueType/BaseFont/Arial/Encoding/WinAnsiEncoding
+    /FirstChar 30/LastChar 255
+    /Widths 8 0 R
+    /FontDescriptor 9 0 R
+  >>
+endobj
+2 0 obj
+  <<
+    /ProcSet [/PDF/Text/ImageC/ImageB]
+    /Font << /F0 10 0 R>>
+    /XObject << >>
+    /ExtGState <</SRCAND  <</Type /ExtGState/BM/Darken>> /SSMULT  <</Type /ExtGState/BM/Multiply>> /SSDIFF  <</Type /ExtGState/BM/Difference>> /SRCPAINT <</Type /ExtGState/BM/Lighten>> >>
+  >>
+endobj
+3 0 obj
+  <<
+    /Type/Pages
+    /MediaBox [0 0 572 820]
+    /Kids [ 5 0 R 7 0 R ]
+    /Count 2
+  >>
+endobj
+11 0 obj
+  <<
+    /Type/Catalog
+    /Pages 3 0 R
+    /OpenAction [ 5 0 R /XYZ null null null ]
+  >>
+endobj
+xref
+0 12
+0000000000 65536 f
+0000000017 00000 n
+0000177572 00000 n
+0000177877 00000 n
+0000000225 00000 n
+0000121191 00000 n
+0000121395 00000 n
+0000176027 00000 n
+0000176231 00000 n
+0000177195 00000 n
+0000177391 00000 n
+0000177993 00000 n
+trailer
+<<
+  /Size 12
+  /Root 11 0 R
+  /Info 1 0 R
+  /ID[<f2981b31a0136511fc2f47013b600eba><f2981b31a0136511fc2f47013b600eba>] 
+>>
+startxref
+178107
+%%EOF
diff --git a/RTCP/Cobalt/GPUProc/doc/cobalt-data-flow/Station Input Pipeline.pdf b/RTCP/Cobalt/GPUProc/doc/cobalt-data-flow/Station Input Pipeline.pdf
index b935178c5b3238f08dc3d5b4e61abd4d1291a96f..25b7e5e60bf04392dfeb0cb2f5221e133bf88f6c 100644
--- a/RTCP/Cobalt/GPUProc/doc/cobalt-data-flow/Station Input Pipeline.pdf	
+++ b/RTCP/Cobalt/GPUProc/doc/cobalt-data-flow/Station Input Pipeline.pdf	
@@ -2,11 +2,11 @@
 %âãÏÓ
 1 0 obj
   <<
-    /Author()/Title(Station Input Pipeline)/Subject()/Producer()/Keywords()/CreationDate(D:20140521163021+00'00')/ModDate(D:20140521163021+00'00')/Creator(Sub Systems, Inc.)
+    /Author()/Title(Station Input Pipeline)/Subject()/Producer()/Keywords()/CreationDate(D:20170827165308+00'00')/ModDate(D:20170827165308+00'00')/Creator(Sub Systems, Inc.)
   >>
 endobj
 4 0 obj
-  <</Length 33244>>
+  <</Length 36241>>
   stream
         q 0.750000 0 0 0.750000 0.000000 816.450012 cm 
         q  
@@ -19,7 +19,7 @@ endobj
         % VpExtX: 748, VpExtY: -1088 (RecNo: 4)
          
         % WinOrgX: 0, WinOrgY: 0 (RecNo: 5)
-        q q q q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q q q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         n 
         122 336 m
 122 308 100 286 72 286 c
@@ -30,7 +30,7 @@ h
         .753 .749 .753 rg .753 .749 .753 RG 1 w 1 J
 f Q
         Q 
-        q q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         n 
         122 336 m
 122 308 100 286 72 286 c
@@ -41,7 +41,7 @@ h
         0 0 0 rg .753 .749 .753 RG 1 w 1 J 1 j s Q
         Q 
         Q 
-        q q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         n 
         119 333 m
 119 360 97 382 69 382 c
@@ -52,7 +52,7 @@ h
         .988 .949 .890 rg 0 0 0 RG 1 w 1 J
 f Q
         Q 
-        q q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         n 
         119 333 m
 119 360 97 382 69 382 c
@@ -66,14 +66,14 @@ h
         q Q 
         q Q 
         q Q 
-        q q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         BT /F0 10.000000 Tf 0 g 1 0 0 -1 38 320 Tm 0 -9 Td(S) Tj 8 0 Td(t) Tj 3 0 Td(a) Tj 6 0 Td(t) Tj 3 0 Td(i) Tj 2 0 Td(o) Tj 6 0 Td(n) Tj 6 0 Td(I) Tj 3 0 Td(n) Tj 6 0 Td(p) Tj 6 0 Td(u) Tj 6 0 Td(t) Tj 3 0 Td(:) Tj 3 0 Td(:) Tj ET Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         BT /F0 10.000000 Tf 0 g 1 0 0 -1 26 333 Tm 0 -9 Td(r) Tj 3 0 Td(e) Tj 6 0 Td(a) Tj 6 0 Td(d) Tj 6 0 Td(R) Tj 8 0 Td(S) Tj 8 0 Td(P) Tj 8 0 Td(R) Tj 8 0 Td(e) Tj 6 0 Td(a) Tj 6 0 Td(l) Tj 2 0 Td(T) Tj 7 0 Td(i) Tj 2 0 Td(m) Tj 9 0 Td(e) Tj ET Q
         Q 
         Q 
         q Q 
-        q q q q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q q q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         n 
         22 85 m
 122 85 l
@@ -84,7 +84,7 @@ h
         .753 .749 .753 rg .753 .749 .753 RG 1 w 1 J
 f Q
         Q 
-        q q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         n 
         22 85 m
 122 85 l
@@ -95,7 +95,7 @@ f Q
         0 0 0 rg .753 .749 .753 RG 1 w 1 J 1 j s Q
         Q 
         Q 
-        q q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         n 
         19 82 m
 119 82 l
@@ -106,7 +106,7 @@ f Q
         .988 .949 .890 rg 0 0 0 RG 1 w 1 J
 f Q
         Q 
-        q q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         n 
         19 82 m
 119 82 l
@@ -120,25 +120,25 @@ f Q
         q Q 
         q Q 
         q Q 
-        q q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         BT /F0 10.000000 Tf 0 g 1 0 0 -1 43 110 Tm 0 -9 Td(R) Tj 8 0 Td(S) Tj 7 0 Td(P) Tj 7 0 Td( ) Tj 3 0 Td(b) Tj 6 0 Td(o) Tj 6 0 Td(a) Tj 6 0 Td(r) Tj 3 0 Td(d) Tj ET Q
         Q 
         Q 
-        q q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         0 0 0 RG 2 w 1 J
 120 187 m 220 187 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         0 0 0 RG 2 w 1 J
 120 237 m 220 237 l S Q
         q Q 
         q Q 
         q Q 
         q Q 
-        q q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         BT /F0 10.000000 Tf 0 g 1 0 0 -1 128 205 Tm 0 -9 Td(r) Tj 3 0 Td(s) Tj 6 0 Td(p) Tj 6 0 Td(D) Tj 8 0 Td(a) Tj 6 0 Td(t) Tj 3 0 Td(a) Tj 6 0 Td(P) Tj 8 0 Td(o) Tj 6 0 Td(o) Tj 6 0 Td(l) Tj 2 0 Td(.) Tj 3 0 Td(f) Tj 3 0 Td(i) Tj 2 0 Td(l) Tj 2 0 Td(l) Tj 2 0 Td(e) Tj 6 0 Td(d) Tj ET Q
         Q 
         Q 
-        q q q q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q q q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         n 
         330 328 m
 330 355 308 377 280 377 c
@@ -149,7 +149,7 @@ h
         .753 .749 .753 rg .753 .749 .753 RG 1 w 1 J
 f Q
         Q 
-        q q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         n 
         330 328 m
 330 355 308 377 280 377 c
@@ -160,7 +160,7 @@ h
         0 0 0 rg .753 .749 .753 RG 1 w 1 J 1 j s Q
         Q 
         Q 
-        q q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         n 
         327 325 m
 327 352 305 374 277 374 c
@@ -171,7 +171,7 @@ h
         .988 .949 .890 rg 0 0 0 RG 1 w 1 J
 f Q
         Q 
-        q q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         n 
         327 325 m
 327 352 305 374 277 374 c
@@ -185,28 +185,28 @@ h
         q Q 
         q Q 
         q Q 
-        q q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         BT /F0 10.000000 Tf 0 g 1 0 0 -1 246 312 Tm 0 -9 Td(S) Tj 8 0 Td(t) Tj 3 0 Td(a) Tj 6 0 Td(t) Tj 3 0 Td(i) Tj 2 0 Td(o) Tj 6 0 Td(n) Tj 6 0 Td(I) Tj 3 0 Td(n) Tj 6 0 Td(p) Tj 6 0 Td(u) Tj 6 0 Td(t) Tj 3 0 Td(:) Tj 3 0 Td(:) Tj ET Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         BT /F0 10.000000 Tf 0 g 1 0 0 -1 233 325 Tm 0 -9 Td(w) Tj 8 0 Td(r) Tj 3 0 Td(i) Tj 2 0 Td(t) Tj 3 0 Td(e) Tj 6 0 Td(R) Tj 8 0 Td(S) Tj 8 0 Td(P) Tj 7 0 Td(R) Tj 8 0 Td(e) Tj 6 0 Td(a) Tj 6 0 Td(l) Tj 2 0 Td(T) Tj 7 0 Td(i) Tj 2 0 Td(m) Tj 9 0 Td(e) Tj ET Q
         Q 
         Q 
         q Q 
-        q q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         0 0 0 RG 2 w 1 J
 123 418 m 223 418 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         0 0 0 RG 2 w 1 J
 123 468 m 223 468 l S Q
         q Q 
         q Q 
         q Q 
         q Q 
-        q q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         BT /F0 10.000000 Tf 0 g 1 0 0 -1 134 436 Tm 0 -9 Td(r) Tj 3 0 Td(s) Tj 6 0 Td(p) Tj 6 0 Td(D) Tj 8 0 Td(a) Tj 6 0 Td(t) Tj 2 0 Td(a) Tj 6 0 Td(P) Tj 7 0 Td(o) Tj 6 0 Td(o) Tj 6 0 Td(l) Tj 2 0 Td(.) Tj 2 0 Td(f) Tj 2 0 Td(r) Tj 3 0 Td(e) Tj 6 0 Td(e) Tj ET Q
         Q 
         Q 
-        q q q q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q q q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         n 
         509 326 m
 509 353 487 375 460 375 c
@@ -217,7 +217,7 @@ h
         .753 .749 .753 rg .753 .749 .753 RG 1 w 1 J
 f Q
         Q 
-        q q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         n 
         509 326 m
 509 353 487 375 460 375 c
@@ -228,7 +228,7 @@ h
         0 0 0 rg .753 .749 .753 RG 1 w 1 J 1 j s Q
         Q 
         Q 
-        q q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         n 
         506 323 m
 506 350 484 372 457 372 c
@@ -239,7 +239,7 @@ h
         .988 .949 .890 rg 0 0 0 RG 1 w 1 J
 f Q
         Q 
-        q q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         n 
         506 323 m
 506 350 484 372 457 372 c
@@ -253,28 +253,28 @@ h
         q Q 
         q Q 
         q Q 
-        q q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         BT /F0 10.000000 Tf 0 g 1 0 0 -1 425 310 Tm 0 -9 Td(S) Tj 8 0 Td(t) Tj 3 0 Td(a) Tj 6 0 Td(t) Tj 3 0 Td(i) Tj 2 0 Td(o) Tj 6 0 Td(n) Tj 6 0 Td(I) Tj 3 0 Td(n) Tj 6 0 Td(p) Tj 6 0 Td(u) Tj 6 0 Td(t) Tj 3 0 Td(:) Tj 3 0 Td(:) Tj ET Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         BT /F0 10.000000 Tf 0 g 1 0 0 -1 428 323 Tm 0 -9 Td(processInput) Tj ET Q
         Q 
         Q 
         q Q 
-        q q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         0 0 0 RG 2 w 1 J
 654 522 m 754 522 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         0 0 0 RG 2 w 1 J
 654 572 m 754 572 l S Q
         q Q 
         q Q 
         q Q 
         q Q 
-        q q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         BT /F0 10.000000 Tf 0 g 1 0 0 -1 660 540 Tm 0 -9 Td(m) Tj 9 0 Td(e) Tj 6 0 Td(t) Tj 3 0 Td(a) Tj 6 0 Td(D) Tj 8 0 Td(a) Tj 6 0 Td(t) Tj 3 0 Td(a) Tj 6 0 Td(P) Tj 8 0 Td(o) Tj 6 0 Td(o) Tj 6 0 Td(l) Tj 2 0 Td(.) Tj 2 0 Td(f) Tj 2 0 Td(r) Tj 3 0 Td(e) Tj 6 0 Td(e) Tj ET Q
         Q 
         Q 
-        q q q q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q q q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         n 
         635 707 m
 635 734 613 756 585 756 c
@@ -285,7 +285,7 @@ h
         .753 .749 .753 rg .753 .749 .753 RG 1 w 1 J
 f Q
         Q 
-        q q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         n 
         635 707 m
 635 734 613 756 585 756 c
@@ -296,7 +296,7 @@ h
         0 0 0 rg .753 .749 .753 RG 1 w 1 J 1 j s Q
         Q 
         Q 
-        q q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         n 
         632 704 m
 632 731 610 753 582 753 c
@@ -307,7 +307,7 @@ h
         .988 .949 .890 rg 0 0 0 RG 1 w 1 J
 f Q
         Q 
-        q q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         n 
         632 704 m
 632 731 610 753 582 753 c
@@ -321,42 +321,42 @@ h
         q Q 
         q Q 
         q Q 
-        q q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         BT /F0 10.000000 Tf 0 g 1 0 0 -1 540 691 Tm 0 -9 Td(S) Tj 8 0 Td(t) Tj 3 0 Td(a) Tj 6 0 Td(t) Tj 3 0 Td(i) Tj 2 0 Td(o) Tj 6 0 Td(n) Tj 6 0 Td(M) Tj 9 0 Td(e) Tj 6 0 Td(t) Tj 3 0 Td(a) Tj 6 0 Td(D) Tj 8 0 Td(a) Tj 6 0 Td(t) Tj 2 0 Td(a) Tj 6 0 Td(:) Tj 2 0 Td(:) Tj ET Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         BT /F0 10.000000 Tf 0 g 1 0 0 -1 540 704 Tm 0 -9 Td(c) Tj 5 0 Td(o) Tj 6 0 Td(m) Tj 9 0 Td(p) Tj 6 0 Td(u) Tj 6 0 Td(t) Tj 3 0 Td(e) Tj 6 0 Td(M) Tj 9 0 Td(e) Tj 6 0 Td(t) Tj 2 0 Td(a) Tj 6 0 Td(D) Tj 8 0 Td(a) Tj 6 0 Td(t) Tj 2 0 Td(a) Tj ET Q
         Q 
         Q 
         q Q 
-        q q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         0 0 0 RG 2 w 1 J
 411 520 m 511 520 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         0 0 0 RG 2 w 1 J
 411 570 m 511 570 l S Q
         q Q 
         q Q 
         q Q 
         q Q 
-        q q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         BT /F0 10.000000 Tf 0 g 1 0 0 -1 414 538 Tm 0 -9 Td(m) Tj 9 0 Td(e) Tj 6 0 Td(t) Tj 3 0 Td(a) Tj 6 0 Td(D) Tj 8 0 Td(a) Tj 6 0 Td(t) Tj 3 0 Td(a) Tj 6 0 Td(P) Tj 8 0 Td(o) Tj 6 0 Td(o) Tj 6 0 Td(l) Tj 2 0 Td(.) Tj 3 0 Td(f) Tj 3 0 Td(i) Tj 2 0 Td(l) Tj 2 0 Td(l) Tj 2 0 Td(e) Tj 6 0 Td(d) Tj ET Q
         Q 
         Q 
-        q q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         0 0 0 RG 2 w 1 J
 534 187 m 634 187 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         0 0 0 RG 2 w 1 J
 534 237 m 634 237 l S Q
         q Q 
         q Q 
         q Q 
         q Q 
-        q q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         BT /F0 10.000000 Tf 0 g 1 0 0 -1 559 205 Tm 0 -9 Td(m) Tj 10 0 Td(p) Tj 6 0 Td(i) Tj 2 0 Td(Q) Tj 9 0 Td(u) Tj 6 0 Td(e) Tj 6 0 Td(u) Tj 6 0 Td(e) Tj ET Q
         Q 
         Q 
-        q q q q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q q q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         n 
         754 324 m
 754 351 732 373 704 373 c
@@ -367,7 +367,7 @@ h
         .753 .749 .753 rg .753 .749 .753 RG 1 w 1 J
 f Q
         Q 
-        q q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         n 
         754 324 m
 754 351 732 373 704 373 c
@@ -378,7 +378,7 @@ h
         0 0 0 rg .753 .749 .753 RG 1 w 1 J 1 j s Q
         Q 
         Q 
-        q q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         n 
         751 321 m
 751 348 729 370 701 370 c
@@ -389,7 +389,7 @@ h
         .988 .949 .890 rg 0 0 0 RG 1 w 1 J
 f Q
         Q 
-        q q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         n 
         751 321 m
 751 348 729 370 701 370 c
@@ -403,14 +403,14 @@ h
         q Q 
         q Q 
         q Q 
-        q q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         BT /F0 10.000000 Tf 0 g 1 0 0 -1 672 308 Tm 0 -9 Td(M) Tj 9 0 Td(P) Tj 8 0 Td(I) Tj 3 0 Td(S) Tj 8 0 Td(e) Tj 6 0 Td(n) Tj 6 0 Td(d) Tj 6 0 Td(e) Tj 6 0 Td(r) Tj 3 0 Td(:) Tj 2 0 Td(:) Tj ET Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         BT /F0 10.000000 Tf 0 g 1 0 0 -1 676 321 Tm 0 -9 Td(sendBlocks) Tj ET Q
         Q 
         Q 
         q Q 
-        q q q q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q q q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         n 
         533 820 m
 633 820 l
@@ -421,7 +421,7 @@ h
         .753 .749 .753 rg .753 .749 .753 RG 1 w 1 J
 f Q
         Q 
-        q q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         n 
         533 820 m
 633 820 l
@@ -432,7 +432,7 @@ f Q
         0 0 0 rg .753 .749 .753 RG 1 w 1 J 1 j s Q
         Q 
         Q 
-        q q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         n 
         530 817 m
 630 817 l
@@ -443,7 +443,7 @@ f Q
         .988 .949 .890 rg 0 0 0 RG 1 w 1 J
 f Q
         Q 
-        q q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         n 
         530 817 m
 630 817 l
@@ -457,11 +457,11 @@ f Q
         q Q 
         q Q 
         q Q 
-        q q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         BT /F0 10.000000 Tf 0 g 1 0 0 -1 557 845 Tm 0 -9 Td(CasaCore) Tj ET Q
         Q 
         Q 
-        q q q q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q q q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         n 
         653 78 m
 753 78 l
@@ -472,7 +472,7 @@ f Q
         .753 .749 .753 rg .753 .749 .753 RG 1 w 1 J
 f Q
         Q 
-        q q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         n 
         653 78 m
 753 78 l
@@ -483,7 +483,7 @@ f Q
         0 0 0 rg .753 .749 .753 RG 1 w 1 J 1 j s Q
         Q 
         Q 
-        q q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         n 
         650 75 m
 750 75 l
@@ -494,7 +494,7 @@ f Q
         .988 .949 .890 rg 0 0 0 RG 1 w 1 J
 f Q
         Q 
-        q q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         n 
         650 75 m
 750 75 l
@@ -508,15 +508,15 @@ f Q
         q Q 
         q Q 
         q Q 
-        q q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         BT /F0 10.000000 Tf 0 g 1 0 0 -1 690 103 Tm 0 -9 Td(M) Tj 9 0 Td(P) Tj 8 0 Td(I) Tj ET Q
         Q 
         Q 
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         .753 .749 .753 rg 0 0 0 RG 1 w 1 J
 359 693 164 54 re f
 Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         .969 .953 .969 rg 0 0 0 RG 1 w 1 J
 356 678 m
 356 745 l
@@ -525,7 +525,7 @@ Q
 509 678 l
 356 678 l
 B Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         .831 .816 .831 rg 0 0 0 RG 1 w 1 J
 509 678 m
 509 690 l
@@ -534,20 +534,20 @@ B Q
 B Q
         q  
         % VpExtX: 748, VpExtY: 1088 (RecNo: 1956)
-        q 0.957952 -0.000000 -0.000000 0.958933 0.000000 -0.000000 cm 
+        q 0.957949 -0.000000 -0.000000 0.958892 0.000000 -0.000000 cm 
         BT /F1 10.000000 Tf 0 g 361 -702 Td(computeMetaData injects blocks ) Tj ET Q
-        q 0.957952 -0.000000 -0.000000 0.958933 0.000000 -0.000000 cm 
+        q 0.957949 -0.000000 -0.000000 0.958892 0.000000 -0.000000 cm 
         BT /F1 10.000000 Tf 0 g 361 -714 Td(into the system, and annotates ) Tj ET Q
-        q 0.957952 -0.000000 -0.000000 0.958933 0.000000 -0.000000 cm 
+        q 0.957949 -0.000000 -0.000000 0.958892 0.000000 -0.000000 cm 
         BT /F1 10.000000 Tf 0 g 361 -726 Td(them with meta data \(block ) Tj ET Q
-        q 0.957952 -0.000000 -0.000000 0.958933 0.000000 -0.000000 cm 
+        q 0.957949 -0.000000 -0.000000 0.958892 0.000000 -0.000000 cm 
         BT /F1 10.000000 Tf 0 g 361 -738 Td(number, delays, etc\).) Tj ET Q
         Q 
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         .753 .749 .753 rg 0 0 0 RG 1 w 1 J
 17 412 91 42 re f
 Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         .969 .953 .969 rg 0 0 0 RG 1 w 1 J
 14 397 m
 14 452 l
@@ -556,7 +556,7 @@ Q
 94 397 l
 14 397 l
 B Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         .831 .816 .831 rg 0 0 0 RG 1 w 1 J
 94 397 m
 94 409 l
@@ -565,49 +565,49 @@ B Q
 B Q
         q  
         % VpExtX: 748, VpExtY: 1088 (RecNo: 2009)
-        q 0.957952 -0.000000 -0.000000 0.958933 0.000000 -0.000000 cm 
+        q 0.957949 -0.000000 -0.000000 0.958892 0.000000 -0.000000 cm 
         BT /F1 10.000000 Tf 0 g 19 -421 Td(readRSP reads in ) Tj ET Q
-        q 0.957952 -0.000000 -0.000000 0.958933 0.000000 -0.000000 cm 
+        q 0.957949 -0.000000 -0.000000 0.958892 0.000000 -0.000000 cm 
         BT /F1 10.000000 Tf 0 g 19 -433 Td(bulk \(N\) using ) Tj ET Q
-        q 0.957952 -0.000000 -0.000000 0.958933 0.000000 -0.000000 cm 
+        q 0.957949 -0.000000 -0.000000 0.958892 0.000000 -0.000000 cm 
         BT /F1 10.000000 Tf 0 g 19 -445 Td(recvmmsg.) Tj ET Q
         Q 
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         .753 .749 .753 rg 0 0 0 RG 1 w 1 J
-318 220 114 54 re f
+308 230 114 54 re f
 Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         .969 .953 .969 rg 0 0 0 RG 1 w 1 J
-315 205 m
-315 272 l
-430 272 l
-430 217 l
-418 205 l
-315 205 l
+305 215 m
+305 282 l
+420 282 l
+420 227 l
+408 215 l
+305 215 l
 B Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         .831 .816 .831 rg 0 0 0 RG 1 w 1 J
-418 205 m
-418 217 l
-430 217 l
-418 205 l
+408 215 m
+408 227 l
+420 227 l
+408 215 l
 B Q
         q  
         % VpExtX: 748, VpExtY: 1088 (RecNo: 2060)
-        q 0.957952 -0.000000 -0.000000 0.958933 0.000000 -0.000000 cm 
-        BT /F1 10.000000 Tf 0 g 320 -229 Td(writeRSP fills a block with ) Tj ET Q
-        q 0.957952 -0.000000 -0.000000 0.958933 0.000000 -0.000000 cm 
-        BT /F1 10.000000 Tf 0 g 320 -241 Td(RSP data until the data is ) Tj ET Q
-        q 0.957952 -0.000000 -0.000000 0.958933 0.000000 -0.000000 cm 
-        BT /F1 10.000000 Tf 0 g 320 -253 Td(too new or until the ) Tj ET Q
-        q 0.957952 -0.000000 -0.000000 0.958933 0.000000 -0.000000 cm 
-        BT /F1 10.000000 Tf 0 g 320 -265 Td(deadline passes.) Tj ET Q
-        Q 
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q 0.957949 -0.000000 -0.000000 0.958892 0.000000 -0.000000 cm 
+        BT /F1 10.000000 Tf 0 g 310 -239 Td(writeRSP fills a block with ) Tj ET Q
+        q 0.957949 -0.000000 -0.000000 0.958892 0.000000 -0.000000 cm 
+        BT /F1 10.000000 Tf 0 g 310 -251 Td(RSP data until the data is ) Tj ET Q
+        q 0.957949 -0.000000 -0.000000 0.958892 0.000000 -0.000000 cm 
+        BT /F1 10.000000 Tf 0 g 310 -263 Td(too new or until the ) Tj ET Q
+        q 0.957949 -0.000000 -0.000000 0.958892 0.000000 -0.000000 cm 
+        BT /F1 10.000000 Tf 0 g 310 -275 Td(deadline passes.) Tj ET Q
+        Q 
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         .753 .749 .753 rg 0 0 0 RG 1 w 1 J
 260 604 170 42 re f
 Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         .969 .953 .969 rg 0 0 0 RG 1 w 1 J
 257 589 m
 257 644 l
@@ -616,7 +616,7 @@ Q
 416 589 l
 257 589 l
 B Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         .831 .816 .831 rg 0 0 0 RG 1 w 1 J
 416 589 m
 416 601 l
@@ -625,90 +625,290 @@ B Q
 B Q
         q  
         % VpExtX: 748, VpExtY: 1088 (RecNo: 2112)
-        q 0.957952 -0.000000 -0.000000 0.958933 0.000000 -0.000000 cm 
+        q 0.957949 -0.000000 -0.000000 0.958892 0.000000 -0.000000 cm 
         BT /F1 10.000000 Tf 0 g 262 -613 Td(The subbands are ordered by ) Tj ET Q
-        q 0.957952 -0.000000 -0.000000 0.958933 0.000000 -0.000000 cm 
+        q 0.957949 -0.000000 -0.000000 0.958892 0.000000 -0.000000 cm 
         BT /F1 10.000000 Tf 0 g 262 -625 Td(receiving rank, to send them in bulk ) Tj ET Q
-        q 0.957952 -0.000000 -0.000000 0.958933 0.000000 -0.000000 cm 
+        q 0.957949 -0.000000 -0.000000 0.958892 0.000000 -0.000000 cm 
         BT /F1 10.000000 Tf 0 g 262 -637 Td(over MPI.) Tj ET Q
         Q 
+        q q q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
+        n 
+        303 83 m
+403 83 l
+403 153 l
+303 153 l
+303 83 l
+
+        .753 .749 .753 rg .753 .749 .753 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
+        n 
+        303 83 m
+403 83 l
+403 153 l
+303 153 l
+303 83 l
+
+        0 0 0 rg .753 .749 .753 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
+        n 
+        300 80 m
+400 80 l
+400 150 l
+300 150 l
+300 80 l
+
+        .988 .949 .890 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
+        n 
+        300 80 m
+400 80 l
+400 150 l
+300 150 l
+300 80 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        q Q 
+        q Q 
         q Q 
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q Q 
+        q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 325 102 Tm 0 -9 Td(v) Tj 6 0 Td(i) Tj 2 0 Td(a) Tj 6 0 Td( ) Tj 3 0 Td(T) Tj 7 0 Td(C) Tj 8 0 Td(P) Tj 7 0 Td( ) Tj 3 0 Td(t) Tj 2 0 Td(o) Tj ET Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 324 115 Tm 0 -9 Td(o) Tj 6 0 Td(u) Tj 6 0 Td(t) Tj 3 0 Td(p) Tj 6 0 Td(u) Tj 6 0 Td(t) Tj 2 0 Td(P) Tj 7 0 Td(r) Tj 3 0 Td(o) Tj 6 0 Td(c) Tj ET Q
+        Q 
+        Q 
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         0 0 0 RG 1 w 1 J
-540 654 m
-528 639 500 602 476 570 c S Q
+621 654 m 626 647 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+629 643 m 634 636 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+637 632 m 643 625 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+646 621 m 651 614 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+654 610 m 660 603 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+663 599 m 668 592 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+671 588 m 677 581 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+680 577 m 684 572 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+621 654 m 626 639 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+621 654 m 634 645 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+703 522 m 703 515 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+703 511 m 703 504 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+703 500 m 703 493 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+703 489 m 703 482 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+703 478 m 703 471 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+703 467 m 703 460 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+703 456 m 703 449 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+703 445 m 703 438 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+703 434 m 703 427 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+703 423 m 703 416 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+703 412 m 703 405 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+703 401 m 703 394 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+703 390 m 703 383 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+703 379 m 703 372 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+703 522 m 698 507 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+703 522 m 708 507 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+328 331 m 335 331 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+339 331 m 346 331 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+350 331 m 357 331 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+361 331 m 368 331 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+372 331 m 379 331 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+383 331 m 390 331 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+394 331 m 401 331 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+405 331 m 407 331 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+328 331 m 343 326 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+328 331 m 343 336 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+195 418 m 201 411 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+204 407 m 210 400 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+214 396 m 220 389 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+224 385 m 230 378 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+195 418 m 201 403 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+195 418 m 209 410 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+116 383 m 122 390 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+126 394 m 132 401 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+136 405 m 143 412 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+147 416 m 149 418 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+116 383 m 130 390 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+116 383 m 123 397 l S Q
+        q Q 
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+701 271 m
+700 235 700 181 700 145 c S Q
         q Q 
-        q q q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         n 
-        476 570 m
-481 586 l
-490 579 l
+        700 145 m
+694 161 l
+706 161 l
 
         0 0 0 rg 0 0 0 RG 1 w 1 J
 f Q
         Q 
-        q q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         n 
-        476 570 m
-481 586 l
-490 579 l
+        700 145 m
+694 161 l
+706 161 l
 
         0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
         Q 
         Q 
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
-        q 1 0 0 -1 448 604 cm 1 1 1 rg 0 0 135 -11 re f Q
-        BT /F0 10.000000 Tf 0 g 1 0 0 -1 448 604 Tm 0 -9 Td([) Tj 3 0 Td(r) Tj 3 0 Td(e) Tj 6 0 Td(c) Tj 6 0 Td(e) Tj 6 0 Td(i) Tj 2 0 Td(v) Tj 6 0 Td(e) Tj 6 0 Td(r) Tj 3 0 Td(]) Tj 3 0 Td([) Tj 3 0 Td(s) Tj 6 0 Td(u) Tj 6 0 Td(b) Tj 6 0 Td(b) Tj 6 0 Td(a) Tj 6 0 Td(n) Tj 6 0 Td(d) Tj 6 0 Td(]) Tj 2 0 Td([) Tj 2 0 Td(s) Tj 5 0 Td(a) Tj 6 0 Td(m) Tj 9 0 Td(p) Tj 6 0 Td(l) Tj 2 0 Td(e) Tj 6 0 Td(]) Tj ET Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
+        q 1 0 0 -1 636 194 cm 1 1 1 rg 0 0 135 -11 re f Q
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 636 194 Tm 0 -9 Td([) Tj 3 0 Td(r) Tj 3 0 Td(e) Tj 6 0 Td(c) Tj 6 0 Td(e) Tj 6 0 Td(i) Tj 2 0 Td(v) Tj 6 0 Td(e) Tj 6 0 Td(r) Tj 3 0 Td(]) Tj 3 0 Td([) Tj 3 0 Td(s) Tj 6 0 Td(u) Tj 6 0 Td(b) Tj 6 0 Td(b) Tj 6 0 Td(a) Tj 6 0 Td(n) Tj 6 0 Td(d) Tj 6 0 Td(]) Tj 2 0 Td([) Tj 2 0 Td(s) Tj 5 0 Td(a) Tj 6 0 Td(m) Tj 9 0 Td(p) Tj 6 0 Td(l) Tj 2 0 Td(e) Tj 6 0 Td(]) Tj ET Q
         q Q 
         q q Q 
         Q 
         q Q 
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         0 0 0 RG 1 w 1 J
-458 520 m
-457 482 457 418 457 373 c S Q
+584 817 m
+585 816 584 789 583 754 c S Q
         q Q 
-        q q q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         n 
-        457 373 m
-451 389 l
-463 389 l
+        583 754 m
+578 770 l
+590 770 l
 
         0 0 0 rg 0 0 0 RG 1 w 1 J
 f Q
         Q 
-        q q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         n 
-        457 373 m
-451 389 l
-463 389 l
+        583 754 m
+578 770 l
+590 770 l
 
         0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
         Q 
         Q 
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
+        q 1 0 0 -1 512 784 cm 1 1 1 rg 0 0 151 -11 re f Q
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 512 784 Tm 0 -9 Td(d) Tj 6 0 Td(e) Tj 6 0 Td(l) Tj 2 0 Td(a) Tj 6 0 Td(y) Tj 6 0 Td(s) Tj 6 0 Td(A) Tj 8 0 Td(t) Tj 3 0 Td(B) Tj 8 0 Td(e) Tj 6 0 Td(g) Tj 6 0 Td(i) Tj 2 0 Td(n) Tj 6 0 Td(,) Tj 2 0 Td( ) Tj 3 0 Td(d) Tj 6 0 Td(e) Tj 6 0 Td(l) Tj 2 0 Td(a) Tj 6 0 Td(y) Tj 5 0 Td(s) Tj 5 0 Td(A) Tj 7 0 Td(f) Tj 2 0 Td(t) Tj 2 0 Td(e) Tj 6 0 Td(r) Tj 3 0 Td(E) Tj 7 0 Td(n) Tj 6 0 Td(d) Tj ET Q
         q Q 
         q q Q 
         Q 
         q Q 
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         0 0 0 RG 1 w 1 J
-507 282 m
-518 274 539 254 557 237 c S Q
+328 309 m
+351 302 385 302 407 308 c S Q
         q Q 
-        q q q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         n 
-        557 237 m
-541 244 l
-550 252 l
+        407 308 m
+393 298 l
+390 309 l
 
         0 0 0 rg 0 0 0 RG 1 w 1 J
 f Q
         Q 
-        q q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         n 
-        557 237 m
-541 244 l
-550 252 l
+        407 308 m
+393 298 l
+390 309 l
 
         0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
         Q 
@@ -717,39 +917,69 @@ f Q
         q q Q 
         Q 
         q Q 
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         0 0 0 RG 1 w 1 J
-614 237 m
-626 247 643 261 652 271 c S Q
+111 283 m
+119 273 136 253 150 237 c S Q
         q Q 
-        q q q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         n 
-        652 271 m
-645 255 l
-637 263 l
+        150 237 m
+135 245 l
+144 253 l
 
         0 0 0 rg 0 0 0 RG 1 w 1 J
 f Q
         Q 
-        q q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         n 
-        652 271 m
-645 255 l
-637 263 l
+        150 237 m
+135 245 l
+144 253 l
 
         0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
         Q 
         Q 
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
+        q 1 0 0 -1 111 256 cm 1 1 1 rg 0 0 35 -11 re f Q
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 111 256 Tm 0 -9 Td(RSP[N]) Tj ET Q
         q Q 
         q q Q 
         Q 
         q Q 
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+195 237 m
+208 250 224 267 231 275 c S Q
+        q Q 
+        q q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
+        n 
+        231 275 m
+225 259 l
+216 267 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
+        n 
+        231 275 m
+225 259 l
+216 267 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q Q 
+        q q Q 
+        Q 
+        q Q 
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         0 0 0 RG 1 w 1 J
 68 152 m
 67 217 67 273 67 283 c S Q
         q Q 
-        q q q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         n 
         67 283 m
 73 267 l
@@ -758,7 +988,7 @@ f Q
         0 0 0 rg 0 0 0 RG 1 w 1 J
 f Q
         Q 
-        q q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         n 
         67 283 m
 73 267 l
@@ -771,55 +1001,52 @@ f Q
         q q Q 
         Q 
         q Q 
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         0 0 0 RG 1 w 1 J
-701 271 m
-700 235 700 181 700 145 c S Q
+614 237 m
+626 247 643 261 652 271 c S Q
         q Q 
-        q q q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         n 
-        700 145 m
-694 161 l
-706 161 l
+        652 271 m
+645 255 l
+637 263 l
 
         0 0 0 rg 0 0 0 RG 1 w 1 J
 f Q
         Q 
-        q q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         n 
-        700 145 m
-694 161 l
-706 161 l
+        652 271 m
+645 255 l
+637 263 l
 
         0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
         Q 
         Q 
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
-        q 1 0 0 -1 636 194 cm 1 1 1 rg 0 0 135 -11 re f Q
-        BT /F0 10.000000 Tf 0 g 1 0 0 -1 636 194 Tm 0 -9 Td([) Tj 3 0 Td(r) Tj 3 0 Td(e) Tj 6 0 Td(c) Tj 6 0 Td(e) Tj 6 0 Td(i) Tj 2 0 Td(v) Tj 6 0 Td(e) Tj 6 0 Td(r) Tj 3 0 Td(]) Tj 3 0 Td([) Tj 3 0 Td(s) Tj 6 0 Td(u) Tj 6 0 Td(b) Tj 6 0 Td(b) Tj 6 0 Td(a) Tj 6 0 Td(n) Tj 6 0 Td(d) Tj 6 0 Td(]) Tj 2 0 Td([) Tj 2 0 Td(s) Tj 5 0 Td(a) Tj 6 0 Td(m) Tj 9 0 Td(p) Tj 6 0 Td(l) Tj 2 0 Td(e) Tj 6 0 Td(]) Tj ET Q
         q Q 
         q q Q 
         Q 
         q Q 
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         0 0 0 RG 1 w 1 J
-195 237 m
-208 250 224 267 231 275 c S Q
+507 282 m
+518 274 539 254 557 237 c S Q
         q Q 
-        q q q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         n 
-        231 275 m
-225 259 l
-216 267 l
+        557 237 m
+541 244 l
+550 252 l
 
         0 0 0 rg 0 0 0 RG 1 w 1 J
 f Q
         Q 
-        q q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         n 
-        231 275 m
-225 259 l
-216 267 l
+        557 237 m
+541 244 l
+550 252 l
 
         0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
         Q 
@@ -828,312 +1055,345 @@ f Q
         q q Q 
         Q 
         q Q 
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         0 0 0 RG 1 w 1 J
-111 283 m
-119 273 136 253 150 237 c S Q
+458 520 m
+457 482 457 418 457 373 c S Q
         q Q 
-        q q q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         n 
-        150 237 m
-135 245 l
-144 253 l
+        457 373 m
+451 389 l
+463 389 l
 
         0 0 0 rg 0 0 0 RG 1 w 1 J
 f Q
         Q 
-        q q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         n 
-        150 237 m
-135 245 l
-144 253 l
+        457 373 m
+451 389 l
+463 389 l
 
         0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
         Q 
         Q 
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
-        q 1 0 0 -1 111 256 cm 1 1 1 rg 0 0 35 -11 re f Q
-        BT /F0 10.000000 Tf 0 g 1 0 0 -1 111 256 Tm 0 -9 Td(RSP[N]) Tj ET Q
         q Q 
         q q Q 
         Q 
         q Q 
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         0 0 0 RG 1 w 1 J
-328 309 m
-351 302 385 302 407 308 c S Q
+540 654 m
+528 639 500 602 476 570 c S Q
         q Q 
-        q q q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         n 
-        407 308 m
-393 298 l
-390 309 l
+        476 570 m
+481 586 l
+490 579 l
 
         0 0 0 rg 0 0 0 RG 1 w 1 J
 f Q
         Q 
-        q q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         n 
-        407 308 m
-393 298 l
-390 309 l
+        476 570 m
+481 586 l
+490 579 l
 
         0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
         Q 
         Q 
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
+        q 1 0 0 -1 468 604 cm 1 1 1 rg 0 0 93 -11 re f Q
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 468 604 Tm 0 -9 Td([) Tj 3 0 Td(r) Tj 3 0 Td(e) Tj 6 0 Td(c) Tj 6 0 Td(e) Tj 6 0 Td(i) Tj 2 0 Td(v) Tj 6 0 Td(e) Tj 6 0 Td(r) Tj 3 0 Td(]) Tj 2 0 Td([) Tj 2 0 Td(s) Tj 5 0 Td(u) Tj 6 0 Td(b) Tj 6 0 Td(b) Tj 6 0 Td(a) Tj 6 0 Td(n) Tj 6 0 Td(d) Tj 6 0 Td(]) Tj ET Q
         q Q 
         q q Q 
         Q 
         q Q 
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         0 0 0 RG 1 w 1 J
-584 817 m
-585 816 584 789 583 754 c S Q
+277 275 m
+289 239 308 185 320 150 c S Q
         q Q 
-        q q q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         n 
-        583 754 m
-578 770 l
-590 770 l
+        320 150 m
+309 163 l
+321 167 l
 
         0 0 0 rg 0 0 0 RG 1 w 1 J
 f Q
         Q 
-        q q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
         n 
-        583 754 m
-578 770 l
-590 770 l
+        320 150 m
+309 163 l
+321 167 l
 
         0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
         Q 
         Q 
+        q 0.957949 -0.000000 -0.000000 -0.958892 0.000000 -0.000000 cm 
+        q 1 0 0 -1 257 179 cm 1 1 1 rg 0 0 121 -11 re f Q
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 257 179 Tm 0 -9 Td(R) Tj 8 0 Td(S) Tj 8 0 Td(P) Tj 8 0 Td( ) Tj 3 0 Td(r) Tj 3 0 Td(a) Tj 6 0 Td(w) Tj 8 0 Td( ) Tj 3 0 Td(\() Tj 3 0 Td(c) Tj 5 0 Td(o) Tj 6 0 Td(p) Tj 6 0 Td(y) Tj 5 0 Td(;) Tj 2 0 Td( ) Tj 3 0 Td(o) Tj 6 0 Td(p) Tj 6 0 Td(t) Tj 2 0 Td(i) Tj 2 0 Td(o) Tj 6 0 Td(n) Tj 6 0 Td(a) Tj 6 0 Td(l) Tj 2 0 Td(\)) Tj ET Q
         q Q 
         q q Q 
         Q 
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
-        0 0 0 RG 1 w 1 J
-116 383 m 122 390 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
-        0 0 0 RG 1 w 1 J
-126 394 m 132 401 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
-        0 0 0 RG 1 w 1 J
-136 405 m 143 412 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
-        0 0 0 RG 1 w 1 J
-147 416 m 149 418 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
-        0 0 0 RG 1 w 1 J
-116 383 m 130 390 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
-        0 0 0 RG 1 w 1 J
-116 383 m 123 397 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
-        0 0 0 RG 1 w 1 J
-195 418 m 201 411 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
-        0 0 0 RG 1 w 1 J
-204 407 m 210 400 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
-        0 0 0 RG 1 w 1 J
-214 396 m 220 389 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
-        0 0 0 RG 1 w 1 J
-224 385 m 230 378 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
-        0 0 0 RG 1 w 1 J
-195 418 m 201 403 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
-        0 0 0 RG 1 w 1 J
-195 418 m 209 410 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        Q
+        Q
+
+endstream
+endobj
+5 0 obj
+  <<
+    /Type/Page
+    /Parent 3 0 R
+    /Resources 2 0 R
+    /MediaBox [0 0 560 816]
+    /Contents 4 0 R
+    /Group << /S /Transparency /CS /DeviceRGB /I false /K false >>
+  >>
+endobj
+6 0 obj
+  <</Length 15178>>
+  stream
+        q 0.750000 0 0 0.750000 0.000000 816.450012 cm 
+        q  
+        % VpOrgX: 0, VpOrgY: 0 (RecNo: 1)
+         
+        % mm: 8 (RecNo: 2)
+         
+        % WinExtX: 780, WinExtY: 1134 (RecNo: 3)
+         
+        % VpExtX: 748, VpExtY: -1088 (RecNo: 4)
+         
+        % WinOrgX: 780, WinOrgY: 0 (RecNo: 5)
+        q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
         0 0 0 RG 1 w 1 J
-328 331 m 335 331 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+621 654 m 626 647 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
         0 0 0 RG 1 w 1 J
-339 331 m 346 331 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+629 643 m 634 636 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
         0 0 0 RG 1 w 1 J
-350 331 m 357 331 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+637 632 m 643 625 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
         0 0 0 RG 1 w 1 J
-361 331 m 368 331 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+646 621 m 651 614 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
         0 0 0 RG 1 w 1 J
-372 331 m 379 331 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+654 610 m 660 603 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
         0 0 0 RG 1 w 1 J
-383 331 m 390 331 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+663 599 m 668 592 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
         0 0 0 RG 1 w 1 J
-394 331 m 401 331 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+671 588 m 677 581 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
         0 0 0 RG 1 w 1 J
-405 331 m 407 331 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+680 577 m 684 572 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
         0 0 0 RG 1 w 1 J
-328 331 m 343 326 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+621 654 m 626 639 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
         0 0 0 RG 1 w 1 J
-328 331 m 343 336 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+621 654 m 634 645 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
         0 0 0 RG 1 w 1 J
 703 522 m 703 515 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
         0 0 0 RG 1 w 1 J
 703 511 m 703 504 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
         0 0 0 RG 1 w 1 J
 703 500 m 703 493 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
         0 0 0 RG 1 w 1 J
 703 489 m 703 482 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
         0 0 0 RG 1 w 1 J
 703 478 m 703 471 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
         0 0 0 RG 1 w 1 J
 703 467 m 703 460 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
         0 0 0 RG 1 w 1 J
 703 456 m 703 449 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
         0 0 0 RG 1 w 1 J
 703 445 m 703 438 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
         0 0 0 RG 1 w 1 J
 703 434 m 703 427 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
         0 0 0 RG 1 w 1 J
 703 423 m 703 416 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
         0 0 0 RG 1 w 1 J
 703 412 m 703 405 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
         0 0 0 RG 1 w 1 J
 703 401 m 703 394 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
         0 0 0 RG 1 w 1 J
 703 390 m 703 383 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
         0 0 0 RG 1 w 1 J
 703 379 m 703 372 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
         0 0 0 RG 1 w 1 J
 703 522 m 698 507 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
         0 0 0 RG 1 w 1 J
 703 522 m 708 507 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+        q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
         0 0 0 RG 1 w 1 J
-621 654 m 626 647 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+328 331 m 335 331 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
         0 0 0 RG 1 w 1 J
-629 643 m 634 636 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+339 331 m 346 331 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
         0 0 0 RG 1 w 1 J
-637 632 m 643 625 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+350 331 m 357 331 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
         0 0 0 RG 1 w 1 J
-646 621 m 651 614 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+361 331 m 368 331 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
         0 0 0 RG 1 w 1 J
-654 610 m 660 603 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+372 331 m 379 331 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
         0 0 0 RG 1 w 1 J
-663 599 m 668 592 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+383 331 m 390 331 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
         0 0 0 RG 1 w 1 J
-671 588 m 677 581 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+394 331 m 401 331 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
         0 0 0 RG 1 w 1 J
-680 577 m 684 572 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+405 331 m 407 331 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
         0 0 0 RG 1 w 1 J
-621 654 m 626 639 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 0.000000 -0.000000 cm 
+328 331 m 343 326 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
         0 0 0 RG 1 w 1 J
-621 654 m 634 645 l S Q
-        Q
-        Q
-
-endstream
-endobj
-5 0 obj
-  <<
-    /Type/Page
-    /Parent 3 0 R
-    /Resources 2 0 R
-    /MediaBox [0 0 560 816]
-    /Contents 4 0 R
-    /Group << /S /Transparency /CS /DeviceRGB /I false /K false >>
-  >>
-endobj
-6 0 obj
-  <</Length 13612>>
-  stream
-        q 0.750000 0 0 0.750000 0.000000 816.450012 cm 
-        q  
-        % VpOrgX: 0, VpOrgY: 0 (RecNo: 1)
-         
-        % mm: 8 (RecNo: 2)
-         
-        % WinExtX: 780, WinExtY: 1134 (RecNo: 3)
-         
-        % VpExtX: 748, VpExtY: -1088 (RecNo: 4)
-         
-        % WinOrgX: 780, WinOrgY: 0 (RecNo: 5)
+328 331 m 343 336 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+195 418 m 201 411 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+204 407 m 210 400 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+214 396 m 220 389 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+224 385 m 230 378 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+195 418 m 201 403 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+195 418 m 209 410 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+116 383 m 122 390 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+126 394 m 132 401 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+136 405 m 143 412 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+147 416 m 149 418 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+116 383 m 130 390 l S Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+116 383 m 123 397 l S Q
+        q Q 
+        q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
+        0 0 0 RG 1 w 1 J
+701 271 m
+700 235 700 181 700 145 c S Q
+        q Q 
+        q q q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
+        n 
+        700 145 m
+694 161 l
+706 161 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J
+f Q
+        Q 
+        q q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
+        n 
+        700 145 m
+694 161 l
+706 161 l
+
+        0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
+        Q 
+        Q 
+        q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
+        q 1 0 0 -1 636 194 cm 1 1 1 rg 0 0 135 -11 re f Q
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 636 194 Tm 0 -9 Td([) Tj 3 0 Td(r) Tj 3 0 Td(e) Tj 6 0 Td(c) Tj 6 0 Td(e) Tj 6 0 Td(i) Tj 2 0 Td(v) Tj 6 0 Td(e) Tj 6 0 Td(r) Tj 3 0 Td(]) Tj 3 0 Td([) Tj 3 0 Td(s) Tj 6 0 Td(u) Tj 6 0 Td(b) Tj 6 0 Td(b) Tj 6 0 Td(a) Tj 6 0 Td(n) Tj 6 0 Td(d) Tj 6 0 Td(]) Tj 2 0 Td([) Tj 2 0 Td(s) Tj 5 0 Td(a) Tj 6 0 Td(m) Tj 9 0 Td(p) Tj 6 0 Td(l) Tj 2 0 Td(e) Tj 6 0 Td(]) Tj ET Q
+        q Q 
+        q q Q 
+        Q 
         q Q 
-        q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
+        q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
         0 0 0 RG 1 w 1 J
-540 654 m
-528 639 500 602 476 570 c S Q
+584 817 m
+585 816 584 789 583 754 c S Q
         q Q 
-        q q q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
+        q q q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
         n 
-        476 570 m
-481 586 l
-490 579 l
+        583 754 m
+578 770 l
+590 770 l
 
         0 0 0 rg 0 0 0 RG 1 w 1 J
 f Q
         Q 
-        q q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
+        q q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
         n 
-        476 570 m
-481 586 l
-490 579 l
+        583 754 m
+578 770 l
+590 770 l
 
         0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
         Q 
         Q 
-        q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
-        q 1 0 0 -1 448 604 cm 1 1 1 rg 0 0 135 -11 re f Q
-        BT /F0 10.000000 Tf 0 g 1 0 0 -1 448 604 Tm 0 -9 Td([) Tj 3 0 Td(r) Tj 3 0 Td(e) Tj 6 0 Td(c) Tj 6 0 Td(e) Tj 6 0 Td(i) Tj 2 0 Td(v) Tj 6 0 Td(e) Tj 6 0 Td(r) Tj 3 0 Td(]) Tj 3 0 Td([) Tj 3 0 Td(s) Tj 6 0 Td(u) Tj 6 0 Td(b) Tj 6 0 Td(b) Tj 6 0 Td(a) Tj 6 0 Td(n) Tj 6 0 Td(d) Tj 6 0 Td(]) Tj 2 0 Td([) Tj 2 0 Td(s) Tj 5 0 Td(a) Tj 6 0 Td(m) Tj 9 0 Td(p) Tj 6 0 Td(l) Tj 2 0 Td(e) Tj 6 0 Td(]) Tj ET Q
+        q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
+        q 1 0 0 -1 512 784 cm 1 1 1 rg 0 0 151 -11 re f Q
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 512 784 Tm 0 -9 Td(d) Tj 6 0 Td(e) Tj 6 0 Td(l) Tj 2 0 Td(a) Tj 6 0 Td(y) Tj 6 0 Td(s) Tj 6 0 Td(A) Tj 8 0 Td(t) Tj 3 0 Td(B) Tj 8 0 Td(e) Tj 6 0 Td(g) Tj 6 0 Td(i) Tj 2 0 Td(n) Tj 6 0 Td(,) Tj 2 0 Td( ) Tj 3 0 Td(d) Tj 6 0 Td(e) Tj 6 0 Td(l) Tj 2 0 Td(a) Tj 6 0 Td(y) Tj 5 0 Td(s) Tj 5 0 Td(A) Tj 7 0 Td(f) Tj 2 0 Td(t) Tj 2 0 Td(e) Tj 6 0 Td(r) Tj 3 0 Td(E) Tj 7 0 Td(n) Tj 6 0 Td(d) Tj ET Q
         q Q 
         q q Q 
         Q 
         q Q 
-        q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
+        q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
         0 0 0 RG 1 w 1 J
-458 520 m
-457 482 457 418 457 373 c S Q
+328 309 m
+351 302 385 302 407 308 c S Q
         q Q 
-        q q q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
+        q q q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
         n 
-        457 373 m
-451 389 l
-463 389 l
+        407 308 m
+393 298 l
+390 309 l
 
         0 0 0 rg 0 0 0 RG 1 w 1 J
 f Q
         Q 
-        q q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
+        q q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
         n 
-        457 373 m
-451 389 l
-463 389 l
+        407 308 m
+393 298 l
+390 309 l
 
         0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
         Q 
@@ -1142,52 +1402,55 @@ f Q
         q q Q 
         Q 
         q Q 
-        q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
+        q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
         0 0 0 RG 1 w 1 J
-507 282 m
-518 274 539 254 557 237 c S Q
+111 283 m
+119 273 136 253 150 237 c S Q
         q Q 
-        q q q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
+        q q q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
         n 
-        557 237 m
-541 244 l
-550 252 l
+        150 237 m
+135 245 l
+144 253 l
 
         0 0 0 rg 0 0 0 RG 1 w 1 J
 f Q
         Q 
-        q q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
+        q q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
         n 
-        557 237 m
-541 244 l
-550 252 l
+        150 237 m
+135 245 l
+144 253 l
 
         0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
         Q 
         Q 
+        q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
+        q 1 0 0 -1 111 256 cm 1 1 1 rg 0 0 35 -11 re f Q
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 111 256 Tm 0 -9 Td(RSP[N]) Tj ET Q
         q Q 
         q q Q 
         Q 
         q Q 
-        q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
+        q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
         0 0 0 RG 1 w 1 J
-614 237 m
-626 247 643 261 652 271 c S Q
+195 237 m
+208 250 224 267 231 275 c S Q
         q Q 
-        q q q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
+        q q q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
         n 
-        652 271 m
-645 255 l
-637 263 l
+        231 275 m
+225 259 l
+216 267 l
 
         0 0 0 rg 0 0 0 RG 1 w 1 J
 f Q
         Q 
-        q q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
+        q q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
         n 
-        652 271 m
-645 255 l
-637 263 l
+        231 275 m
+225 259 l
+216 267 l
 
         0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
         Q 
@@ -1196,12 +1459,12 @@ f Q
         q q Q 
         Q 
         q Q 
-        q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
+        q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
         0 0 0 RG 1 w 1 J
 68 152 m
 67 217 67 273 67 283 c S Q
         q Q 
-        q q q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
+        q q q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
         n 
         67 283 m
 73 267 l
@@ -1210,7 +1473,7 @@ f Q
         0 0 0 rg 0 0 0 RG 1 w 1 J
 f Q
         Q 
-        q q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
+        q q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
         n 
         67 283 m
 73 267 l
@@ -1223,55 +1486,52 @@ f Q
         q q Q 
         Q 
         q Q 
-        q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
+        q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
         0 0 0 RG 1 w 1 J
-701 271 m
-700 235 700 181 700 145 c S Q
+614 237 m
+626 247 643 261 652 271 c S Q
         q Q 
-        q q q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
+        q q q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
         n 
-        700 145 m
-694 161 l
-706 161 l
+        652 271 m
+645 255 l
+637 263 l
 
         0 0 0 rg 0 0 0 RG 1 w 1 J
 f Q
         Q 
-        q q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
+        q q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
         n 
-        700 145 m
-694 161 l
-706 161 l
+        652 271 m
+645 255 l
+637 263 l
 
         0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
         Q 
         Q 
-        q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
-        q 1 0 0 -1 636 194 cm 1 1 1 rg 0 0 135 -11 re f Q
-        BT /F0 10.000000 Tf 0 g 1 0 0 -1 636 194 Tm 0 -9 Td([) Tj 3 0 Td(r) Tj 3 0 Td(e) Tj 6 0 Td(c) Tj 6 0 Td(e) Tj 6 0 Td(i) Tj 2 0 Td(v) Tj 6 0 Td(e) Tj 6 0 Td(r) Tj 3 0 Td(]) Tj 3 0 Td([) Tj 3 0 Td(s) Tj 6 0 Td(u) Tj 6 0 Td(b) Tj 6 0 Td(b) Tj 6 0 Td(a) Tj 6 0 Td(n) Tj 6 0 Td(d) Tj 6 0 Td(]) Tj 2 0 Td([) Tj 2 0 Td(s) Tj 5 0 Td(a) Tj 6 0 Td(m) Tj 9 0 Td(p) Tj 6 0 Td(l) Tj 2 0 Td(e) Tj 6 0 Td(]) Tj ET Q
         q Q 
         q q Q 
         Q 
         q Q 
-        q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
+        q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
         0 0 0 RG 1 w 1 J
-195 237 m
-208 250 224 267 231 275 c S Q
+507 282 m
+518 274 539 254 557 237 c S Q
         q Q 
-        q q q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
+        q q q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
         n 
-        231 275 m
-225 259 l
-216 267 l
+        557 237 m
+541 244 l
+550 252 l
 
         0 0 0 rg 0 0 0 RG 1 w 1 J
 f Q
         Q 
-        q q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
+        q q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
         n 
-        231 275 m
-225 259 l
-216 267 l
+        557 237 m
+541 244 l
+550 252 l
 
         0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
         Q 
@@ -1280,233 +1540,92 @@ f Q
         q q Q 
         Q 
         q Q 
-        q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
+        q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
         0 0 0 RG 1 w 1 J
-111 283 m
-119 273 136 253 150 237 c S Q
+458 520 m
+457 482 457 418 457 373 c S Q
         q Q 
-        q q q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
+        q q q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
         n 
-        150 237 m
-135 245 l
-144 253 l
+        457 373 m
+451 389 l
+463 389 l
 
         0 0 0 rg 0 0 0 RG 1 w 1 J
 f Q
         Q 
-        q q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
+        q q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
         n 
-        150 237 m
-135 245 l
-144 253 l
+        457 373 m
+451 389 l
+463 389 l
 
         0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
         Q 
         Q 
-        q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
-        q 1 0 0 -1 111 256 cm 1 1 1 rg 0 0 35 -11 re f Q
-        BT /F0 10.000000 Tf 0 g 1 0 0 -1 111 256 Tm 0 -9 Td(RSP[N]) Tj ET Q
         q Q 
         q q Q 
         Q 
         q Q 
-        q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
+        q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
         0 0 0 RG 1 w 1 J
-328 309 m
-351 302 385 302 407 308 c S Q
+540 654 m
+528 639 500 602 476 570 c S Q
         q Q 
-        q q q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
+        q q q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
         n 
-        407 308 m
-393 298 l
-390 309 l
+        476 570 m
+481 586 l
+490 579 l
 
         0 0 0 rg 0 0 0 RG 1 w 1 J
 f Q
         Q 
-        q q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
+        q q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
         n 
-        407 308 m
-393 298 l
-390 309 l
+        476 570 m
+481 586 l
+490 579 l
 
         0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
         Q 
         Q 
+        q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
+        q 1 0 0 -1 468 604 cm 1 1 1 rg 0 0 93 -11 re f Q
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 468 604 Tm 0 -9 Td([) Tj 3 0 Td(r) Tj 3 0 Td(e) Tj 6 0 Td(c) Tj 6 0 Td(e) Tj 6 0 Td(i) Tj 2 0 Td(v) Tj 6 0 Td(e) Tj 6 0 Td(r) Tj 3 0 Td(]) Tj 2 0 Td([) Tj 2 0 Td(s) Tj 5 0 Td(u) Tj 6 0 Td(b) Tj 6 0 Td(b) Tj 6 0 Td(a) Tj 6 0 Td(n) Tj 6 0 Td(d) Tj 6 0 Td(]) Tj ET Q
         q Q 
         q q Q 
         Q 
         q Q 
-        q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
+        q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
         0 0 0 RG 1 w 1 J
-584 817 m
-585 816 584 789 583 754 c S Q
+277 275 m
+289 239 308 185 320 150 c S Q
         q Q 
-        q q q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
+        q q q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
         n 
-        583 754 m
-578 770 l
-590 770 l
+        320 150 m
+309 163 l
+321 167 l
 
         0 0 0 rg 0 0 0 RG 1 w 1 J
 f Q
         Q 
-        q q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
+        q q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
         n 
-        583 754 m
-578 770 l
-590 770 l
+        320 150 m
+309 163 l
+321 167 l
 
         0 0 0 rg 0 0 0 RG 1 w 1 J 1 j s Q
         Q 
         Q 
+        q 0.957949 -0.000000 -0.000000 -0.958892 -747.200378 -0.000000 cm 
+        q 1 0 0 -1 257 179 cm 1 1 1 rg 0 0 121 -11 re f Q
+        BT /F0 10.000000 Tf 0 g 1 0 0 -1 257 179 Tm 0 -9 Td(R) Tj 8 0 Td(S) Tj 8 0 Td(P) Tj 8 0 Td( ) Tj 3 0 Td(r) Tj 3 0 Td(a) Tj 6 0 Td(w) Tj 8 0 Td( ) Tj 3 0 Td(\() Tj 3 0 Td(c) Tj 5 0 Td(o) Tj 6 0 Td(p) Tj 6 0 Td(y) Tj 5 0 Td(;) Tj 2 0 Td( ) Tj 3 0 Td(o) Tj 6 0 Td(p) Tj 6 0 Td(t) Tj 2 0 Td(i) Tj 2 0 Td(o) Tj 6 0 Td(n) Tj 6 0 Td(a) Tj 6 0 Td(l) Tj 2 0 Td(\)) Tj ET Q
         q Q 
         q q Q 
         Q 
-        q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
-        0 0 0 RG 1 w 1 J
-116 383 m 122 390 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
-        0 0 0 RG 1 w 1 J
-126 394 m 132 401 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
-        0 0 0 RG 1 w 1 J
-136 405 m 143 412 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
-        0 0 0 RG 1 w 1 J
-147 416 m 149 418 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
-        0 0 0 RG 1 w 1 J
-116 383 m 130 390 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
-        0 0 0 RG 1 w 1 J
-116 383 m 123 397 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
-        0 0 0 RG 1 w 1 J
-195 418 m 201 411 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
-        0 0 0 RG 1 w 1 J
-204 407 m 210 400 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
-        0 0 0 RG 1 w 1 J
-214 396 m 220 389 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
-        0 0 0 RG 1 w 1 J
-224 385 m 230 378 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
-        0 0 0 RG 1 w 1 J
-195 418 m 201 403 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
-        0 0 0 RG 1 w 1 J
-195 418 m 209 410 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
-        0 0 0 RG 1 w 1 J
-328 331 m 335 331 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
-        0 0 0 RG 1 w 1 J
-339 331 m 346 331 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
-        0 0 0 RG 1 w 1 J
-350 331 m 357 331 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
-        0 0 0 RG 1 w 1 J
-361 331 m 368 331 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
-        0 0 0 RG 1 w 1 J
-372 331 m 379 331 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
-        0 0 0 RG 1 w 1 J
-383 331 m 390 331 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
-        0 0 0 RG 1 w 1 J
-394 331 m 401 331 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
-        0 0 0 RG 1 w 1 J
-405 331 m 407 331 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
-        0 0 0 RG 1 w 1 J
-328 331 m 343 326 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
-        0 0 0 RG 1 w 1 J
-328 331 m 343 336 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
-        0 0 0 RG 1 w 1 J
-703 522 m 703 515 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
-        0 0 0 RG 1 w 1 J
-703 511 m 703 504 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
-        0 0 0 RG 1 w 1 J
-703 500 m 703 493 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
-        0 0 0 RG 1 w 1 J
-703 489 m 703 482 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
-        0 0 0 RG 1 w 1 J
-703 478 m 703 471 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
-        0 0 0 RG 1 w 1 J
-703 467 m 703 460 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
-        0 0 0 RG 1 w 1 J
-703 456 m 703 449 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
-        0 0 0 RG 1 w 1 J
-703 445 m 703 438 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
-        0 0 0 RG 1 w 1 J
-703 434 m 703 427 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
-        0 0 0 RG 1 w 1 J
-703 423 m 703 416 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
-        0 0 0 RG 1 w 1 J
-703 412 m 703 405 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
-        0 0 0 RG 1 w 1 J
-703 401 m 703 394 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
-        0 0 0 RG 1 w 1 J
-703 390 m 703 383 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
-        0 0 0 RG 1 w 1 J
-703 379 m 703 372 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
-        0 0 0 RG 1 w 1 J
-703 522 m 698 507 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
-        0 0 0 RG 1 w 1 J
-703 522 m 708 507 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
-        0 0 0 RG 1 w 1 J
-621 654 m 626 647 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
-        0 0 0 RG 1 w 1 J
-629 643 m 634 636 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
-        0 0 0 RG 1 w 1 J
-637 632 m 643 625 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
-        0 0 0 RG 1 w 1 J
-646 621 m 651 614 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
-        0 0 0 RG 1 w 1 J
-654 610 m 660 603 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
-        0 0 0 RG 1 w 1 J
-663 599 m 668 592 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
-        0 0 0 RG 1 w 1 J
-671 588 m 677 581 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
-        0 0 0 RG 1 w 1 J
-680 577 m 684 572 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
-        0 0 0 RG 1 w 1 J
-621 654 m 626 639 l S Q
-        q 0.957952 -0.000000 -0.000000 -0.958933 -747.202881 -0.000000 cm 
-        0 0 0 RG 1 w 1 J
-621 654 m 634 645 l S Q
         Q
         Q
 
@@ -1554,7 +1673,7 @@ endobj
   [ 500 500 274 284 392 591 539 818 800 230 302 302 417 684 217 400 217 390 539 539 539 539 539 539 539 539 539 539 217 217 684 
   684 684 448 955 645 573 619 701 506 488 686 710 266 357 580 471 898 748 754 560 754 598 531 524 687 621 934 590 553 570 
   302 379 302 684 415 268 509 588 462 589 523 313 589 566 242 242 497 242 861 566 586 588 589 348 424 339 566 479 723 459 
-  484 452 302 239 302 684 299 539 646 229 539 377 733 375 375 371 1210 531 316 931 646 570 646 646 229 229 377 377 406 500 
+  484 452 302 239 302 684 311 539 646 229 539 377 733 375 375 371 1210 531 316 931 646 570 646 646 229 229 377 377 406 500 
   1000 337 773 424 316 928 646 452 553 274 284 539 539 556 539 239 448 414 890 392 506 684 400 890 415 377 684 366 366 282 
   577 458 217 205 351 431 506 906 931 952 448 645 645 645 645 645 645 860 619 506 506 506 506 266 266 266 266 701 748 754 
   754 754 754 754 684 754 687 687 687 687 553 560 544 509 509 509 509 509 509 832 462 523 523 523 523 242 242 242 242 559 
@@ -1606,26 +1725,26 @@ xref
 0 15
 0000000000 65536 f
 0000000017 00000 n
-0000050295 00000 n
-0000050618 00000 n
+0000054858 00000 n
+0000055181 00000 n
 0000000221 00000 n
-0000033526 00000 n
-0000033730 00000 n
-0000047403 00000 n
-0000047607 00000 n
-0000048571 00000 n
-0000048767 00000 n
-0000048948 00000 n
-0000049908 00000 n
-0000050110 00000 n
-0000050734 00000 n
+0000036523 00000 n
+0000036727 00000 n
+0000051966 00000 n
+0000052170 00000 n
+0000053134 00000 n
+0000053330 00000 n
+0000053511 00000 n
+0000054471 00000 n
+0000054673 00000 n
+0000055297 00000 n
 trailer
 <<
   /Size 15
   /Root 14 0 R
   /Info 1 0 R
-  /ID[<77af1cb21b87bbb11acf523e135e76d2><77af1cb21b87bbb11acf523e135e76d2>] 
+  /ID[<4159d391db755c68da89bc40ced86b87><4159d391db755c68da89bc40ced86b87>] 
 >>
 startxref
-50848
+55411
 %%EOF
diff --git a/RTCP/Cobalt/GPUProc/doc/cobalt-data-flow/cobalt-data-flow.eap b/RTCP/Cobalt/GPUProc/doc/cobalt-data-flow/cobalt-data-flow.eap
index 2a67d0f69a127cc34f6f84e18e85aa4bb00b702f..793ce15d08e5165a96c69db20bc6f33585dd5f9e 100644
Binary files a/RTCP/Cobalt/GPUProc/doc/cobalt-data-flow/cobalt-data-flow.eap and b/RTCP/Cobalt/GPUProc/doc/cobalt-data-flow/cobalt-data-flow.eap differ
diff --git a/RTCP/Cobalt/GPUProc/doc/cobalt-data-flow/cobalt-data-flow.txt b/RTCP/Cobalt/GPUProc/doc/cobalt-data-flow/cobalt-data-flow.txt
index 641b5864caacf7bfbb954cbffb03fc4ef7ab417a..7e6e3890c002870985532e4da2afc800044a64aa 100644
--- a/RTCP/Cobalt/GPUProc/doc/cobalt-data-flow/cobalt-data-flow.txt
+++ b/RTCP/Cobalt/GPUProc/doc/cobalt-data-flow/cobalt-data-flow.txt
@@ -43,6 +43,7 @@ This is where it all starts: RSP packets are received for each station in the fo
 * StationInput::writeRSPRealTime (1)
 
 	Holds two blocks ("current" and "next") and reads RSP packets from the rspDataPool. Each RSP packet is written to "current" and/or "next", depending on their timestamp and coarse delay compensation.
+	Can also send a number of RSP packets directly across the network to OutputProc (TCP, best-effort (non-blocking)) for RSP raw output (optional).
 
 	Transports:
 		* rspDataPool.filled -> rspDataPool.free
@@ -176,7 +177,7 @@ The Correlator threads in outputProc use the following data flow:
 
 * InputThread::process (1 per file)
 
-	Reads blocks sent by GPUProc over Ethernet.
+	Reads blocks sent by GPUProc over Ethernet or Infiniband.
 
 	Transports:
 		* outputPool.free -> outputPool.filled
@@ -240,3 +241,13 @@ The BeamFormer threads in outputProc are more complicated, since they receive in
 
 	Stop conditions:
 		* input queue gives NULL
+
+-----------------------------------
+OutputProc [RSP raw]
+-----------------------------------
+	Same as OutputProc [correlator], except that:
+		'SubbandOutputThread::doWork (1 per file)'
+	becomes
+		'RSPRawOutputThread::doWork (1 per file)'
+	where file contains RSP data packets from 1 stream (sending RSP board) from 1 antenna field.
+
diff --git a/RTCP/Cobalt/GPUProc/doc/data-loss.txt b/RTCP/Cobalt/GPUProc/doc/data-loss.txt
new file mode 100644
index 0000000000000000000000000000000000000000..54e572bbc0bfc1cb4c5786b9d385b42e6ef21d42
--- /dev/null
+++ b/RTCP/Cobalt/GPUProc/doc/data-loss.txt
@@ -0,0 +1,192 @@
+This document describes how COBALT logs and processes data loss. Two forms of loss can be distinguished: input data loss and output data loss.
+
+---------------------
+Input data loss
+---------------------
+
+The data path for station input is:
+
+  station RSP board --> Ethernet --> COBALT server
+
+Total input loss occurs when:
+
+  * The station does not emit the datagrams from the RSP boards. See
+      * "rspctl --datastream" on the station's LCU to see if the data stream is enabled
+
+  * The station does not send the datagrams to the UDP port COBALT listens on:
+      * $LOFARROOT/etc/parset-additions.d/default/StationStreams.parset contains the addresses COBALT listens to
+      * $LOFARROOT/etc/RSPDriver.conf (on the station) contains the addresses the station sends to
+      * MAC, IP and port numbers need to match. Note that each station sends to the following ports for easy identification:
+
+             16093
+             ||_|\_ 1-digit bord number (0..3, and 6..9 for HBA1)
+             | \___ 3-digit station number
+             \_____ fixed prefix
+
+      * As root on COBALT, run "tcpdump -i <interface> udp -c 100", and check if the packets are received and correctly addressed.
+
+  * The network drops the datagrams due to routing issues.
+
+Fractional or total input loss occurs when:
+
+  * The network drops the datagrams due to throughput issues.
+
+  * The COBALT server IP stack drops the datagrams:
+      * This log line indicates that the packets were received but not processed.
+
+        >>> WARN  RTCP.Cobalt.GPUProc - Kernel dropped XXX UDP packets
+
+        - This counter indicates how many UDP packets were listened for but did not reach the application in time.
+        - This counter is node-specific and is thus reported in pairs as every host runs two instances.
+        - Each station emits ~50k packets per second, so judge the dropped counter accordingly.
+        - Possible causes:
+          * The COBALT server CPUs are overloaded. Run "top" to see if a specific core is loaded >95%.
+          * COBALT froze, for example due to InfiniBand errors. In that case, the above line is the only one being printed.
+          * OS scheduling inefficiencies occasionally cause the above log line to appear.
+
+  * The packets are received by COBALT but are not usable in the observation:
+      * The following log line indicates the packet receive rate and how many packets were discarded:
+
+        >>> INFO  RTCP.Cobalt.InputProc - [station CS005LBA] [board 0]  [PacketReader] 12207.1 pps: received 131072 packets: 0 bad timestamps, 0 bad clock/bitmode, 1 payload errors, 0 otherwise bad packets
+
+        - "bad timestamps" means the packet has timestamp -1 (0xFFFFFFFF), indicating problems with the station clock.
+        - "bad clock/bitmode" means the packet does not have the same clock (200/160) or bitmode (16/8/4) as the observation.
+        - "payload error" means the packet is marked as incomplete by the station.
+        - "otherwise bad" means the packet header is corrupted.
+
+  * COBALT is not running at real time, and is thus unable to keep up with the input data. This triggers many errors, but all cases devolve into printing:
+  
+        >>> ERROR RTCP.Cobalt.GPUProc - [block 1] Not running at real time! Deadline was 1.23456 seconds ago
+
+    Causes include:
+
+        - COBALT started after the start time of the observation. The error is then printed for block -1 and beyond. It may or may not catch up again.
+        - A CPU is overloaded (see "top" on all nodes).
+        - A GPU is overloaded, resulting in this log line at the end of an observation:
+
+      >>> ERROR RTCP.Cobalt.CoInterface - process                  : ran at 101.464843% of run-time budget
+
+Flagging
+---------------------
+
+Missing and corrupted/unacceptable station input results in those data being flagged. As we employ a conservative flagging strategy, the amount of data flagged is typically a lot higher than the amount of data not received correctly.
+
+---------------------
+Output data loss
+---------------------
+
+COBALT strives to write output data regardless of what input actually arrived. The input is collected into /blocks/ of typically ~1s. All blocks travel along the path:
+
+  Ethernet -> CPU (GPUProc) -> InfiniBand -> CPU (GPUProc) -> GPU -> CPU (GPUProc)
+
+after which the data are forwarded to the storage nodes (OutputProc). From that point on, data can be dropped if the system cannot sustain the data rates involved. Due to the way correlated (interferometry) and beamformed data are collected, we have to distinguish these two cases.
+
+// NOTES for log-line interpretation: //
+
+  * Each log line is printed as a summary at the end of the observation
+  * Lines are only printed if any loss occurred.
+  * Each processing step logs three metrics:
+      - "WARN  - Did not receive XX% of the data ...", indicates how much data arrived at that step.
+      - "ERROR - I lost XX% of the data ...", indicates how much data was dropped in THIS step.
+      - "WARN  - Did not send XX% of the data ...", indicates how much data was forwarded to the next step.
+
+Furthermore, several steps are monitored to keep up with real-time behaviour. Essentially, each 1s of data needs to be processed by a step within 1s. A budget overrun does not directly cause loss. Only if buffering before the step could not cover the jitter will loss occur. If a step overruns this budget significantly, a log is generated:
+
+      >>> WARN  RTCP.Cobalt.CoInterface - Run-time budget exceeded: transposeInput ran at 300.353% (took 0.11198 s, budget is 0.0372827 s)
+
+Statistics covering all runs of such a step is reported at the end. If more than 100% is reported, data loss is certain:
+
+      >>> INFO  RTCP.Cobalt.CoInterface - process                  : ran at 0.464843% of run-time budget
+
+Correlated data loss
+---------------------
+
+Each block represents an integration period of one subband when emitted from GPUProc, typically ~1s in size. Observations consist of at most 488 subbands in the common 8-bit mode (244 in 16-bit mode). The blocks of each subband are sent to the storage node that was assigned to store it.
+
+        1. The input data is collected in ~1s blocks and distributed over the Infiniband network over all the sockets (the first transpose). This is a lossless process, which means that any stalls propagate to the next loss point. [StationTranspose.cc]
+
+        2. Each socket collects each block from all stations, receiving only the subbands the socket is assigned to process. [Pipeline.cc]
+
+        3. For every subband, each block is forwarded to the GPU for processing, and the result is subsequently fetched back from the GPU, resulting in one or more blocks of output. If the integration period < block size, multiple integration periods are produced by the GPU per block of input. [Pipeline.cc, SubbandProc.cc]
+
+        4. If the integration period > block size, it is always a multiple. Multiple blocks are integrated on the CPU. [CorrelatorStep.cc]
+
+        5. The block size now represents the integration period, with block numbers to match. Data are sent to the data writer processes (OutputProc) running on the target storage cluster. This is the first loss point. Loss is summarised at the end of the observation, if any occurred: [Pipeline.cc]
+
+        >>> ERROR RTCP.Cobalt.GPUProc - [Correlator] I lost 5.1234% of the data for subband 3 to cpu05.cep4.control.lofar
+        >>> WARN  RTCP.Cobalt.GPUProc - [Correlator] Did not send 5.1234% of the data for subband 3 to cpu05.cep4.control.lofar
+
+        In case of loss, the real-time processor produces all blocks, but could not send all of them over the network to the storage node. Reasons include:
+          * The network cannot sustain the required throughput.
+          * The receiving storage node cannot sustain the required throughput to disk.
+          * The receiving storage node or OutputProc instance crashed (the the logs for outputproc@<hostname>).
+          * The receiving storage node or OutputProc instance started too late (check the timestamps in the log for outputProc@<hostname>).
+        It is not easy to distinguish between network and disk bottlenecks. OutputProc logging may provide clues whether it had problems processing
+        the data it received.
+
+        In the Correlated pipeline, this is the ONLY place in which loss can occur (barring OS/system errors). If the chain downstream (network,
+        OutputProc) cannot sustain the required rate, this is the place data is dropped. To analyse where the actual bottleneck lies, one needs
+        to look at the timers (see below).
+
+        6. OutputProc receives all blocks. Loss is reported at the end, and should mirror the loss reported by GPUProc for sending the data: [InputThread.cc]
+
+        >>> WARN  RTCP.Cobalt.OutputProc - [stream 3 file L123456_SAP000_SB003.MS] [InputThread] Did not receive 5.1234% of the data
+        >>> WARN  RTCP.Cobalt.OutputProc - [stream 3 file L123456_SAP000_SB003.MS] [InputThread] Did not send 5.1234% of the data
+
+        The input side of OutputProc also reports what it does not receive (and thus not forward), but cannot lose data by itself.
+
+        7. OutputProc will forward all received blocks to disk. Loss, if any, is reported at the end: [OutputThread.cc]
+
+        >>> WARN  RTCP.Cobalt.OutputProc - [stream 3 file L123456_SAP000_SB003.MS] [SubbandOutputThread] Did not receive 5.1234% of the data
+        >>> ERROR RTCP.Cobalt.OutputProc - [stream 3 file L123456_SAP000_SB003.MS] [SubbandOutputThread] I lost 1.0000% of the data
+        >>> WARN  RTCP.Cobalt.OutputProc - [stream 3 file L123456_SAP000_SB003.MS] [SubbandOutputThread] Did not send 6.1234% of the data
+
+        In rare cases, OutputProc itself drops data:
+          * If the target disk is full.
+          * If writing data to the target disk fails (file-system errors, etc).
+
+        8. Total end-to-end output loss is reported for ALL data products produced: [OutputThread.cc]
+
+        >>> INFO  RTCP.Cobalt.OutputProc - [stream 3 file L123456_SAP000_SB003.MS] [SubbandOutputThread] Total output data loss is 0.0000%.
+        >>> ERROR RTCP.Cobalt.OutputProc - [stream 3 file L123456_SAP000_SB003.MS] [SubbandOutputThread] Total output data loss is 6.1234%.
+
+        The line at INFO is there if there is no loss, ERROR otherwise. Note that this line is NOT printed if OutputProc did not start or crashed.
+
+
+Beam-formed data loss
+---------------------
+
+Each block represents an integration period of one subband when emitted from GPUProc, typically ~1s in size. Each TAB generates one block per subband. These blocks are subsequently transposed over the network to the storage nodes. Each storage node process (OutputProc) receives blocks for all the subbands that are part of the TABs that are to be stored on that node. Due to this additional complexity, loss can occur in more places than forr correlated data.
+
+        1. The Correlator pipeline steps are followed, up until results are produced by the GPU. For all beam-formed data product classes (Coherent, Incoherent), a block of output data is retrieved from the GPU, each representing ~1s. This block size persists throughout this process. Again, no loss occurs here.
+
+        2. The data are sent to the data-writer processes (OutputProc) running on the target storage cluster. A second transpose occurs here, in which for each subband, the data of the individual tied-array beams (TABs) are spread across the OutputProc processes that write those beams. Each OutputProc can write multiple TABs, which are multiplexed along a single connection with each GPUProc socket that provides input. Loss of data towards each node is reported at the end, if any: [Pipeline.cc, TABTranspose.cc]
+
+        >>> ERROR RTCP.Cobalt.CoInterface - [BeamFormer] I lost 5.1234% of the data to cpu05.cep4.control.lofar
+        >>> WARN  RTCP.Cobalt.CoInterface - [BeamFormer] Did not send 5.1234% of the data to cpu05.cep4.control.lofar
+
+        3. OutputProc receives subband data for each TAB from multiple GPUProc sockets. It has a buffer of 1s blocks of data to collect input for (BlockCollector::maxBlocksInFlight). If not all subband data is received in time, the block is forcefully emitted to the next step of the pipeline. In that case, loss occurs, which is reported at the end, if any: [TABTranspose.cc]:
+
+        >>> WARN  RTCP.Cobalt.CoInterface - [BlockCollector] Did not receive 5.1234% of the data
+        >>> ERROR RTCP.Cobalt.CoInterface - [BlockCollector] I lost 1.0000% of the data
+        >>> WARN  RTCP.Cobalt.CoInterface - [BlockCollector] Did not send 6.1234% of the data
+
+        Loss from this stage onwards indicates either all data is lost for a block, or some subbands are. Both are accumulated into
+        a single loss percentage.
+
+        An additional hint printed by OutputProc indicating that the network has throughput issues which could be mitigated with
+        bigger buffers. The reported loss is already included in the earlier figures:
+
+        >>> ERROR RTCP.Cobalt.CoInterface - [BlockCollector] Received 0.500% of the data too late. Consider increasing maxBlocksInFlight.
+
+        4. Collected blocks are sent to the OutputThread, which is responsible for writing them to disk. Loss here is rare, reasons are the same as those in the Correlator pipeline: [OutputThread.cc]
+
+        >>> WARN  RTCP.Cobalt.OutputProc - [stream 3 file L123456_S000_B003_P000.h5] [TABOutputThread] Did not receive 5.1234% of the data
+        >>> ERROR RTCP.Cobalt.OutputProc - [stream 3 file L123456_S000_B003_P000.h5] [TABOutputThread] I lost 1.0000% of the data
+        >>> WARN  RTCP.Cobalt.OutputProc - [stream 3 file L123456_S000_B003_P000.h5] [TABOutputThread] Did not send 6.1234% of the data
+
+        5. For each data product, a final loss percentage is printed, like in the Correlator pipeline. Note that this line is NOT printed if OutputProc did not start or crashed. [OutputThread.cc]:
+
+        >>> INFO  RTCP.Cobalt.OutputProc - [stream 3 file L123456_S000_B003_P000.h5] [TABOutputThread] Total output data loss is 0.0000%.
+        >>> ERROR RTCP.Cobalt.OutputProc - [stream 3 file L123456_S000_B003_P000.hS] [TABOutputThread] Total output data loss is 6.1234%.
+
diff --git a/RTCP/Cobalt/GPUProc/etc/CMakeLists.txt b/RTCP/Cobalt/GPUProc/etc/CMakeLists.txt
index aca4d465e8a6fe753855b479f5b4dbc66f669636..0ce714347b1f2533483b75601c84cb5697913410 100644
--- a/RTCP/Cobalt/GPUProc/etc/CMakeLists.txt
+++ b/RTCP/Cobalt/GPUProc/etc/CMakeLists.txt
@@ -23,5 +23,9 @@ file(GLOB _config_parsets_bin "${CMAKE_CURRENT_BINARY_DIR}/parset-additions.d/de
 install(FILES ${_config_parsets_bin} DESTINATION etc/parset-additions.d/default)
 #lofar_add_sysconf_files(${_config_parsets_bin})
 
+# To enable RSP raw data output, follow the instructions in the installed file below.
+# NOTE: We do *not* create the override/ directory here, because the roll-out scripts symlink it: some project specific overrides must outlive roll-outs.
+install(FILES "parset-additions.d/rspraw-enable.parset.OBSID" DESTINATION etc/parset-additions.d)
+
 # Install script to generate StationStreams.parset for the live test system.
 lofar_add_sbin_scripts(parset-additions.d/default/generateStationStreams.sh)
diff --git a/RTCP/Cobalt/GPUProc/etc/parset-additions.d/default/FinalMetaDataGatherer.parset.in b/RTCP/Cobalt/GPUProc/etc/parset-additions.d/default/FinalMetaDataGatherer.parset.in
index 59542dda9c6ff4242a92c5ea167ad08f479f08e8..da4b3fd7ee1159649304c4e1d7f81f7089c9b8e1 100644
--- a/RTCP/Cobalt/GPUProc/etc/parset-additions.d/default/FinalMetaDataGatherer.parset.in
+++ b/RTCP/Cobalt/GPUProc/etc/parset-additions.d/default/FinalMetaDataGatherer.parset.in
@@ -5,10 +5,10 @@
 Cobalt.FinalMetaDataGatherer.enabled = true
 
 # The database hostname to connect to:
-#   Production:  sasdb
-#   Development: sasdbtest (do not use here; prefer hostname redirection)
-# If empty (or missing), the default is used: sasdb
-Cobalt.FinalMetaDataGatherer.database.host = sasdb
+#   Production:  sasdb.control.lofar
+#   Development: sasdbtest.control.lofar (do not use here; prefer hostname redirection)
+# If empty (or missing), the default is used: sasdb.control.lofar
+Cobalt.FinalMetaDataGatherer.database.host = sasdb.control.lofar
 
 # The database port number to connect to.
 # If empty (or missing), the default used: 5432
diff --git a/RTCP/Cobalt/GPUProc/etc/parset-additions.d/default/HardwareList.parset b/RTCP/Cobalt/GPUProc/etc/parset-additions.d/default/HardwareList.parset
index f5ac9d995bb4d0b9304ae5390e5cda0e86b7ce40..2cb8d95630e62d7399fee0b0c331377a80ab049c 100644
--- a/RTCP/Cobalt/GPUProc/etc/parset-additions.d/default/HardwareList.parset
+++ b/RTCP/Cobalt/GPUProc/etc/parset-additions.d/default/HardwareList.parset
@@ -14,7 +14,7 @@ PIC.Core.Cobalt.localhost.gpus=[0]
 PIC.Core.Cobalt.gpu01_0.host=gpu01
 PIC.Core.Cobalt.gpu01_0.cpu=0
 PIC.Core.Cobalt.gpu01_0.mpi_nic=
-PIC.Core.Cobalt.gpu01_0.out_nic=[CEP4:ib0,DragNet:ib0]
+PIC.Core.Cobalt.gpu01_0.out_nic=[CEP4:ib0,DRAGNET:ib0]
 PIC.Core.Cobalt.gpu01_0.gpus=[0, 1]
 
 PIC.Core.Cobalt.gpu01_1.host=gpu01
@@ -27,119 +27,260 @@ PIC.Core.Cobalt.gpu01_1.gpus=[2, 3]
 PIC.Core.Cobalt.cbt001_0.host=cbt001
 PIC.Core.Cobalt.cbt001_0.cpu=0
 PIC.Core.Cobalt.cbt001_0.mpi_nic=mlx4_0
-PIC.Core.Cobalt.cbt001_0.out_nic=[CEP4:ib0,DragNet:ib0]
+PIC.Core.Cobalt.cbt001_0.out_nic=[CEP4:ib0,DRAGNET:ib0]
 PIC.Core.Cobalt.cbt001_0.gpus=[0, 1]
 
 PIC.Core.Cobalt.cbt001_1.host=cbt001
 PIC.Core.Cobalt.cbt001_1.cpu=1
 PIC.Core.Cobalt.cbt001_1.mpi_nic=mlx4_1
-PIC.Core.Cobalt.cbt001_1.out_nic=[CEP4:ib1,DragNet:ib1]
+PIC.Core.Cobalt.cbt001_1.out_nic=[CEP4:ib1,DRAGNET:ib1]
 PIC.Core.Cobalt.cbt001_1.gpus=[2, 3]
 
 PIC.Core.Cobalt.cbt002_0.host=cbt002
 PIC.Core.Cobalt.cbt002_0.cpu=0
 PIC.Core.Cobalt.cbt002_0.mpi_nic=mlx4_0
-PIC.Core.Cobalt.cbt002_0.out_nic=[CEP4:ib0,DragNet:ib0]
+PIC.Core.Cobalt.cbt002_0.out_nic=[CEP4:ib0,DRAGNET:ib0]
 PIC.Core.Cobalt.cbt002_0.gpus=[0, 1]
 
 PIC.Core.Cobalt.cbt002_1.host=cbt002
 PIC.Core.Cobalt.cbt002_1.cpu=1
 PIC.Core.Cobalt.cbt002_1.mpi_nic=mlx4_1
-PIC.Core.Cobalt.cbt002_1.out_nic=[CEP4:ib1,DragNet:ib1]
+PIC.Core.Cobalt.cbt002_1.out_nic=[CEP4:ib1,DRAGNET:ib1]
 PIC.Core.Cobalt.cbt002_1.gpus=[2, 3]
 
 PIC.Core.Cobalt.cbt003_0.host=cbt003
 PIC.Core.Cobalt.cbt003_0.cpu=0
 PIC.Core.Cobalt.cbt003_0.mpi_nic=mlx4_0
-PIC.Core.Cobalt.cbt003_0.out_nic=[CEP4:ib0,DragNet:ib0]
+PIC.Core.Cobalt.cbt003_0.out_nic=[CEP4:ib0,DRAGNET:ib0]
 PIC.Core.Cobalt.cbt003_0.gpus=[0, 1]
 
 PIC.Core.Cobalt.cbt003_1.host=cbt003
 PIC.Core.Cobalt.cbt003_1.cpu=1
 PIC.Core.Cobalt.cbt003_1.mpi_nic=mlx4_1
-PIC.Core.Cobalt.cbt003_1.out_nic=[CEP4:ib1,DragNet:ib1]
+PIC.Core.Cobalt.cbt003_1.out_nic=[CEP4:ib1,DRAGNET:ib1]
 PIC.Core.Cobalt.cbt003_1.gpus=[2, 3]
 
 PIC.Core.Cobalt.cbt004_0.host=cbt004
 PIC.Core.Cobalt.cbt004_0.cpu=0
 PIC.Core.Cobalt.cbt004_0.mpi_nic=mlx4_0
-PIC.Core.Cobalt.cbt004_0.out_nic=[CEP4:ib0,DragNet:ib0]
+PIC.Core.Cobalt.cbt004_0.out_nic=[CEP4:ib0,DRAGNET:ib0]
 PIC.Core.Cobalt.cbt004_0.gpus=[0, 1]
 
 PIC.Core.Cobalt.cbt004_1.host=cbt004
 PIC.Core.Cobalt.cbt004_1.cpu=1
 PIC.Core.Cobalt.cbt004_1.mpi_nic=mlx4_1
-PIC.Core.Cobalt.cbt004_1.out_nic=[CEP4:ib1,DragNet:ib1]
+PIC.Core.Cobalt.cbt004_1.out_nic=[CEP4:ib1,DRAGNET:ib1]
 PIC.Core.Cobalt.cbt004_1.gpus=[2, 3]
 
 PIC.Core.Cobalt.cbt005_0.host=cbt005
 PIC.Core.Cobalt.cbt005_0.cpu=0
 PIC.Core.Cobalt.cbt005_0.mpi_nic=mlx4_0
-PIC.Core.Cobalt.cbt005_0.out_nic=[CEP4:ib0,DragNet:ib0]
+PIC.Core.Cobalt.cbt005_0.out_nic=[CEP4:ib0,DRAGNET:ib0]
 PIC.Core.Cobalt.cbt005_0.gpus=[0, 1]
 
 PIC.Core.Cobalt.cbt005_1.host=cbt005
 PIC.Core.Cobalt.cbt005_1.cpu=1
 PIC.Core.Cobalt.cbt005_1.mpi_nic=mlx4_1
-PIC.Core.Cobalt.cbt005_1.out_nic=[CEP4:ib1,DragNet:ib1]
+PIC.Core.Cobalt.cbt005_1.out_nic=[CEP4:ib1,DRAGNET:ib1]
 PIC.Core.Cobalt.cbt005_1.gpus=[2, 3]
 
 PIC.Core.Cobalt.cbt006_0.host=cbt006
 PIC.Core.Cobalt.cbt006_0.cpu=0
 PIC.Core.Cobalt.cbt006_0.mpi_nic=mlx4_0
-PIC.Core.Cobalt.cbt006_0.out_nic=[CEP4:ib0,DragNet:ib0]
+PIC.Core.Cobalt.cbt006_0.out_nic=[CEP4:ib0,DRAGNET:ib0]
 PIC.Core.Cobalt.cbt006_0.gpus=[0, 1]
 
 PIC.Core.Cobalt.cbt006_1.host=cbt006
 PIC.Core.Cobalt.cbt006_1.cpu=1
 PIC.Core.Cobalt.cbt006_1.mpi_nic=mlx4_1
-PIC.Core.Cobalt.cbt006_1.out_nic=[CEP4:ib1,DragNet:ib1]
+PIC.Core.Cobalt.cbt006_1.out_nic=[CEP4:ib1,DRAGNET:ib1]
 PIC.Core.Cobalt.cbt006_1.gpus=[2, 3]
 
 PIC.Core.Cobalt.cbt007_0.host=cbt007
 PIC.Core.Cobalt.cbt007_0.cpu=0
 PIC.Core.Cobalt.cbt007_0.mpi_nic=mlx4_0
-PIC.Core.Cobalt.cbt007_0.out_nic=[CEP4:ib0,DragNet:ib0]
+PIC.Core.Cobalt.cbt007_0.out_nic=[CEP4:ib0,DRAGNET:ib0]
 PIC.Core.Cobalt.cbt007_0.gpus=[0, 1]
 
 PIC.Core.Cobalt.cbt007_1.host=cbt007
 PIC.Core.Cobalt.cbt007_1.cpu=1
 PIC.Core.Cobalt.cbt007_1.mpi_nic=mlx4_1
-PIC.Core.Cobalt.cbt007_1.out_nic=[CEP4:ib1,DragNet:ib1]
+PIC.Core.Cobalt.cbt007_1.out_nic=[CEP4:ib1,DRAGNET:ib1]
 PIC.Core.Cobalt.cbt007_1.gpus=[2, 3]
 
 PIC.Core.Cobalt.cbt008_0.host=cbt008
 PIC.Core.Cobalt.cbt008_0.cpu=0
 PIC.Core.Cobalt.cbt008_0.mpi_nic=mlx4_0
-PIC.Core.Cobalt.cbt008_0.out_nic=[CEP4:ib0,DragNet:ib0]
+PIC.Core.Cobalt.cbt008_0.out_nic=[CEP4:ib0,DRAGNET:ib0]
 PIC.Core.Cobalt.cbt008_0.gpus=[0, 1]
 
 PIC.Core.Cobalt.cbt008_1.host=cbt008
 PIC.Core.Cobalt.cbt008_1.cpu=1
 PIC.Core.Cobalt.cbt008_1.mpi_nic=mlx4_1
-PIC.Core.Cobalt.cbt008_1.out_nic=[CEP4:ib1,DragNet:ib1]
+PIC.Core.Cobalt.cbt008_1.out_nic=[CEP4:ib1,DRAGNET:ib1]
 PIC.Core.Cobalt.cbt008_1.gpus=[2, 3]
 
 PIC.Core.Cobalt.cbt009_0.host=cbt009
 PIC.Core.Cobalt.cbt009_0.cpu=0
 PIC.Core.Cobalt.cbt009_0.mpi_nic=mlx4_0
-PIC.Core.Cobalt.cbt009_0.out_nic=[CEP4:ib0,DragNet:ib0]
+PIC.Core.Cobalt.cbt009_0.out_nic=[CEP4:ib0,DRAGNET:ib0]
 PIC.Core.Cobalt.cbt009_0.gpus=[0, 1]
 
 PIC.Core.Cobalt.cbt009_1.host=cbt009
 PIC.Core.Cobalt.cbt009_1.cpu=1
 PIC.Core.Cobalt.cbt009_1.mpi_nic=mlx4_1
-PIC.Core.Cobalt.cbt009_1.out_nic=[CEP4:ib1,DragNet:ib1]
+PIC.Core.Cobalt.cbt009_1.out_nic=[CEP4:ib1,DRAGNET:ib1]
 PIC.Core.Cobalt.cbt009_1.gpus=[2, 3]
 
 PIC.Core.Cobalt.cbt010_0.host=cbt010
 PIC.Core.Cobalt.cbt010_0.cpu=0
 PIC.Core.Cobalt.cbt010_0.mpi_nic=mlx4_0
-PIC.Core.Cobalt.cbt010_0.out_nic=[CEP4:ib0,DragNet:ib0]
+PIC.Core.Cobalt.cbt010_0.out_nic=[CEP4:ib0,DRAGNET:ib0]
 PIC.Core.Cobalt.cbt010_0.gpus=[0, 1]
 
 PIC.Core.Cobalt.cbt010_1.host=cbt010
 PIC.Core.Cobalt.cbt010_1.cpu=1
 PIC.Core.Cobalt.cbt010_1.mpi_nic=mlx4_1
-PIC.Core.Cobalt.cbt010_1.out_nic=[CEP4:ib1,DragNet:ib1]
+PIC.Core.Cobalt.cbt010_1.out_nic=[CEP4:ib1,DRAGNET:ib1]
 PIC.Core.Cobalt.cbt010_1.gpus=[2, 3]
+
+# The DRAGNET cluster (without dragnet head node and dragproc node)
+
+PIC.Core.DRAGNET.drg01.host=drg01
+PIC.Core.DRAGNET.drg01.cpu=-1
+PIC.Core.DRAGNET.drg01.mpi_nic=
+PIC.Core.DRAGNET.drg01.out_nic=[CEP4:ib0,DRAGNET:ib0]
+PIC.Core.DRAGNET.drg01.gpus=[0, 1, 2, 3]
+
+PIC.Core.DRAGNET.drg02.host=drg02
+PIC.Core.DRAGNET.drg02.cpu=-1
+PIC.Core.DRAGNET.drg02.mpi_nic=
+PIC.Core.DRAGNET.drg02.out_nic=[CEP4:ib0,DRAGNET:ib0]
+PIC.Core.DRAGNET.drg02.gpus=[0, 1, 2, 3]
+
+PIC.Core.DRAGNET.drg03.host=drg03
+PIC.Core.DRAGNET.drg03.cpu=-1
+PIC.Core.DRAGNET.drg03.mpi_nic=
+PIC.Core.DRAGNET.drg03.out_nic=[CEP4:ib0,DRAGNET:ib0]
+PIC.Core.DRAGNET.drg03.gpus=[0, 1, 2, 3]
+
+PIC.Core.DRAGNET.drg04.host=drg04
+PIC.Core.DRAGNET.drg04.cpu=-1
+PIC.Core.DRAGNET.drg04.mpi_nic=
+PIC.Core.DRAGNET.drg04.out_nic=[CEP4:ib0,DRAGNET:ib0]
+PIC.Core.DRAGNET.drg04.gpus=[0, 1, 2, 3]
+
+PIC.Core.DRAGNET.drg05.host=drg05
+PIC.Core.DRAGNET.drg05.cpu=-1
+PIC.Core.DRAGNET.drg05.mpi_nic=
+PIC.Core.DRAGNET.drg05.out_nic=[CEP4:ib0,DRAGNET:ib0]
+PIC.Core.DRAGNET.drg05.gpus=[0, 1, 2, 3]
+
+PIC.Core.DRAGNET.drg06.host=drg06
+PIC.Core.DRAGNET.drg06.cpu=-1
+PIC.Core.DRAGNET.drg06.mpi_nic=
+PIC.Core.DRAGNET.drg06.out_nic=[CEP4:ib0,DRAGNET:ib0]
+PIC.Core.DRAGNET.drg06.gpus=[0, 1, 2, 3]
+
+PIC.Core.DRAGNET.drg07.host=drg07
+PIC.Core.DRAGNET.drg07.cpu=-1
+PIC.Core.DRAGNET.drg07.mpi_nic=
+PIC.Core.DRAGNET.drg07.out_nic=[CEP4:ib0,DRAGNET:ib0]
+PIC.Core.DRAGNET.drg07.gpus=[0, 1, 2, 3]
+
+PIC.Core.DRAGNET.drg08.host=drg08
+PIC.Core.DRAGNET.drg08.cpu=-1
+PIC.Core.DRAGNET.drg08.mpi_nic=
+PIC.Core.DRAGNET.drg08.out_nic=[CEP4:ib0,DRAGNET:ib0]
+PIC.Core.DRAGNET.drg08.gpus=[0, 1, 2, 3]
+
+PIC.Core.DRAGNET.drg09.host=drg09
+PIC.Core.DRAGNET.drg09.cpu=-1
+PIC.Core.DRAGNET.drg09.mpi_nic=
+PIC.Core.DRAGNET.drg09.out_nic=[CEP4:ib0,DRAGNET:ib0]
+PIC.Core.DRAGNET.drg09.gpus=[0, 1, 2, 3]
+
+PIC.Core.DRAGNET.drg10.host=drg10
+PIC.Core.DRAGNET.drg10.cpu=-1
+PIC.Core.DRAGNET.drg10.mpi_nic=
+PIC.Core.DRAGNET.drg10.out_nic=[CEP4:ib0,DRAGNET:ib0]
+PIC.Core.DRAGNET.drg10.gpus=[0, 1, 2, 3]
+
+PIC.Core.DRAGNET.drg11.host=drg11
+PIC.Core.DRAGNET.drg11.cpu=-1
+PIC.Core.DRAGNET.drg11.mpi_nic=
+PIC.Core.DRAGNET.drg11.out_nic=[CEP4:ib0,DRAGNET:ib0]
+PIC.Core.DRAGNET.drg11.gpus=[0, 1, 2, 3]
+
+PIC.Core.DRAGNET.drg12.host=drg12
+PIC.Core.DRAGNET.drg12.cpu=-1
+PIC.Core.DRAGNET.drg12.mpi_nic=
+PIC.Core.DRAGNET.drg12.out_nic=[CEP4:ib0,DRAGNET:ib0]
+PIC.Core.DRAGNET.drg12.gpus=[0, 1, 2, 3]
+
+PIC.Core.DRAGNET.drg13.host=drg13
+PIC.Core.DRAGNET.drg13.cpu=-1
+PIC.Core.DRAGNET.drg13.mpi_nic=
+PIC.Core.DRAGNET.drg13.out_nic=[CEP4:ib0,DRAGNET:ib0]
+PIC.Core.DRAGNET.drg13.gpus=[0, 1, 2, 3]
+
+PIC.Core.DRAGNET.drg14.host=drg14
+PIC.Core.DRAGNET.drg14.cpu=-1
+PIC.Core.DRAGNET.drg14.mpi_nic=
+PIC.Core.DRAGNET.drg14.out_nic=[CEP4:ib0,DRAGNET:ib0]
+PIC.Core.DRAGNET.drg14.gpus=[0, 1, 2, 3]
+
+PIC.Core.DRAGNET.drg15.host=drg15
+PIC.Core.DRAGNET.drg15.cpu=-1
+PIC.Core.DRAGNET.drg15.mpi_nic=
+PIC.Core.DRAGNET.drg15.out_nic=[CEP4:ib0,DRAGNET:ib0]
+PIC.Core.DRAGNET.drg15.gpus=[0, 1, 2, 3]
+
+PIC.Core.DRAGNET.drg16.host=drg16
+PIC.Core.DRAGNET.drg16.cpu=-1
+PIC.Core.DRAGNET.drg16.mpi_nic=
+PIC.Core.DRAGNET.drg16.out_nic=[CEP4:ib0,DRAGNET:ib0]
+PIC.Core.DRAGNET.drg16.gpus=[0, 1, 2, 3]
+
+PIC.Core.DRAGNET.drg17.host=drg17
+PIC.Core.DRAGNET.drg17.cpu=-1
+PIC.Core.DRAGNET.drg17.mpi_nic=
+PIC.Core.DRAGNET.drg17.out_nic=[CEP4:ib0,DRAGNET:ib0]
+PIC.Core.DRAGNET.drg17.gpus=[0, 1, 2, 3]
+
+PIC.Core.DRAGNET.drg18.host=drg18
+PIC.Core.DRAGNET.drg18.cpu=-1
+PIC.Core.DRAGNET.drg18.mpi_nic=
+PIC.Core.DRAGNET.drg18.out_nic=[CEP4:ib0,DRAGNET:ib0]
+PIC.Core.DRAGNET.drg18.gpus=[0, 1, 2, 3]
+
+PIC.Core.DRAGNET.drg19.host=drg19
+PIC.Core.DRAGNET.drg19.cpu=-1
+PIC.Core.DRAGNET.drg19.mpi_nic=
+PIC.Core.DRAGNET.drg19.out_nic=[CEP4:ib0,DRAGNET:ib0]
+PIC.Core.DRAGNET.drg19.gpus=[0, 1, 2, 3]
+
+PIC.Core.DRAGNET.drg20.host=drg20
+PIC.Core.DRAGNET.drg20.cpu=-1
+PIC.Core.DRAGNET.drg20.mpi_nic=
+PIC.Core.DRAGNET.drg20.out_nic=[CEP4:ib0,DRAGNET:ib0]
+PIC.Core.DRAGNET.drg20.gpus=[0, 1, 2, 3]
+
+PIC.Core.DRAGNET.drg21.host=drg21
+PIC.Core.DRAGNET.drg21.cpu=-1
+PIC.Core.DRAGNET.drg21.mpi_nic=
+PIC.Core.DRAGNET.drg21.out_nic=[CEP4:ib0,DRAGNET:ib0]
+PIC.Core.DRAGNET.drg21.gpus=[0, 1, 2, 3]
+
+PIC.Core.DRAGNET.drg22.host=drg22
+PIC.Core.DRAGNET.drg22.cpu=-1
+PIC.Core.DRAGNET.drg22.mpi_nic=
+PIC.Core.DRAGNET.drg22.out_nic=[CEP4:ib0,DRAGNET:ib0]
+PIC.Core.DRAGNET.drg22.gpus=[0, 1, 2, 3]
+
+PIC.Core.DRAGNET.drg23.host=drg23
+PIC.Core.DRAGNET.drg23.cpu=-1
+PIC.Core.DRAGNET.drg23.mpi_nic=
+PIC.Core.DRAGNET.drg23.out_nic=[CEP4:ib0,DRAGNET:ib0]
+PIC.Core.DRAGNET.drg23.gpus=[0, 1, 2, 3]
+
diff --git a/RTCP/Cobalt/GPUProc/etc/parset-additions.d/default/HardwareUsed.parset b/RTCP/Cobalt/GPUProc/etc/parset-additions.d/default/HardwareUsed.parset
index ac5194cf5ea677f37aea3b3bb4bec6fd8aacd593..5509586a4944363c7d04865d368715e30cfa5e6a 100644
--- a/RTCP/Cobalt/GPUProc/etc/parset-additions.d/default/HardwareUsed.parset
+++ b/RTCP/Cobalt/GPUProc/etc/parset-additions.d/default/HardwareUsed.parset
@@ -23,3 +23,26 @@ Cobalt.Nodes = [
   cbt008_1
 ]
 
+DRAGNET.Nodes = [
+  drg01,
+  drg02,
+  drg03,
+  drg04,
+  drg05,
+  drg06,
+  drg07,
+  drg08,
+  drg09,
+  drg10,
+  drg11,
+  drg12,
+  drg13,
+  drg14,
+  drg15,
+  drg16,
+  drg17,
+  drg18,
+  drg19,
+  drg20
+]
+
diff --git a/RTCP/Cobalt/GPUProc/etc/parset-additions.d/default/StationCalibration.parset b/RTCP/Cobalt/GPUProc/etc/parset-additions.d/default/StationCalibration.parset
index 7bca4a649a4d4e2a30f8716dce228070164d494e..3bfba042bcca70dceb4d083410ffe997a26e248f 100644
--- a/RTCP/Cobalt/GPUProc/etc/parset-additions.d/default/StationCalibration.parset
+++ b/RTCP/Cobalt/GPUProc/etc/parset-additions.d/default/StationCalibration.parset
@@ -4072,96 +4072,96 @@ PIC.Core.RS509HBA.HBA_DUAL_INNER.HBA_210_250.delay.X         = 0.000000e+00
 PIC.Core.RS509HBA.HBA_DUAL_INNER.HBA_210_250.delay.Y         = 0.000000e+00
 PIC.Core.DE601LBA.LBA_INNER.LBA_10_70.phase0.X               = 0.000000e+00
 PIC.Core.DE601LBA.LBA_INNER.LBA_10_70.phase0.Y               = 0.000000e+00
-PIC.Core.DE601LBA.LBA_INNER.LBA_10_70.delay.X                = 1.100000e-06
-PIC.Core.DE601LBA.LBA_INNER.LBA_10_70.delay.Y                = 1.100000e-06
+PIC.Core.DE601LBA.LBA_INNER.LBA_10_70.delay.X                = 0.000000e+00
+PIC.Core.DE601LBA.LBA_INNER.LBA_10_70.delay.Y                = 0.000000e+00
 PIC.Core.DE601LBA.LBA_INNER.LBA_30_70.phase0.X               = 0.000000e+00
 PIC.Core.DE601LBA.LBA_INNER.LBA_30_70.phase0.Y               = 0.000000e+00
-PIC.Core.DE601LBA.LBA_INNER.LBA_30_70.delay.X                = 1.100000e-06
-PIC.Core.DE601LBA.LBA_INNER.LBA_30_70.delay.Y                = 1.100000e-06
+PIC.Core.DE601LBA.LBA_INNER.LBA_30_70.delay.X                = 0.000000e+00
+PIC.Core.DE601LBA.LBA_INNER.LBA_30_70.delay.Y                = 0.000000e+00
 PIC.Core.DE601LBA.LBA_INNER.LBA_10_90.phase0.X               = 0.000000e+00
 PIC.Core.DE601LBA.LBA_INNER.LBA_10_90.phase0.Y               = 0.000000e+00
-PIC.Core.DE601LBA.LBA_INNER.LBA_10_90.delay.X                = 1.100000e-06
-PIC.Core.DE601LBA.LBA_INNER.LBA_10_90.delay.Y                = 1.100000e-06
+PIC.Core.DE601LBA.LBA_INNER.LBA_10_90.delay.X                = 0.000000e+00
+PIC.Core.DE601LBA.LBA_INNER.LBA_10_90.delay.Y                = 0.000000e+00
 PIC.Core.DE601LBA.LBA_INNER.LBA_30_90.phase0.X               = 0.000000e+00
 PIC.Core.DE601LBA.LBA_INNER.LBA_30_90.phase0.Y               = 0.000000e+00
-PIC.Core.DE601LBA.LBA_INNER.LBA_30_90.delay.X                = 1.100000e-06
-PIC.Core.DE601LBA.LBA_INNER.LBA_30_90.delay.Y                = 1.100000e-06
+PIC.Core.DE601LBA.LBA_INNER.LBA_30_90.delay.X                = 0.000000e+00
+PIC.Core.DE601LBA.LBA_INNER.LBA_30_90.delay.Y                = 0.000000e+00
 PIC.Core.DE601LBA.LBA_OUTER.LBA_10_70.phase0.X               = 0.000000e+00
 PIC.Core.DE601LBA.LBA_OUTER.LBA_10_70.phase0.Y               = 0.000000e+00
-PIC.Core.DE601LBA.LBA_OUTER.LBA_10_70.delay.X                = 1.100000e-06
-PIC.Core.DE601LBA.LBA_OUTER.LBA_10_70.delay.Y                = 1.100000e-06
+PIC.Core.DE601LBA.LBA_OUTER.LBA_10_70.delay.X                = 0.000000e+00
+PIC.Core.DE601LBA.LBA_OUTER.LBA_10_70.delay.Y                = 0.000000e+00
 PIC.Core.DE601LBA.LBA_OUTER.LBA_30_70.phase0.X               = 0.000000e+00
 PIC.Core.DE601LBA.LBA_OUTER.LBA_30_70.phase0.Y               = 0.000000e+00
-PIC.Core.DE601LBA.LBA_OUTER.LBA_30_70.delay.X                = 1.100000e-06
-PIC.Core.DE601LBA.LBA_OUTER.LBA_30_70.delay.Y                = 1.100000e-06
+PIC.Core.DE601LBA.LBA_OUTER.LBA_30_70.delay.X                = 0.000000e+00
+PIC.Core.DE601LBA.LBA_OUTER.LBA_30_70.delay.Y                = 0.000000e+00
 PIC.Core.DE601LBA.LBA_OUTER.LBA_10_90.phase0.X               = 0.000000e+00
 PIC.Core.DE601LBA.LBA_OUTER.LBA_10_90.phase0.Y               = 0.000000e+00
-PIC.Core.DE601LBA.LBA_OUTER.LBA_10_90.delay.X                = 1.100000e-06
-PIC.Core.DE601LBA.LBA_OUTER.LBA_10_90.delay.Y                = 1.100000e-06
+PIC.Core.DE601LBA.LBA_OUTER.LBA_10_90.delay.X                = 0.000000e+00
+PIC.Core.DE601LBA.LBA_OUTER.LBA_10_90.delay.Y                = 0.000000e+00
 PIC.Core.DE601LBA.LBA_OUTER.LBA_30_90.phase0.X               = 0.000000e+00
 PIC.Core.DE601LBA.LBA_OUTER.LBA_30_90.phase0.Y               = 0.000000e+00
-PIC.Core.DE601LBA.LBA_OUTER.LBA_30_90.delay.X                = 1.100000e-06
-PIC.Core.DE601LBA.LBA_OUTER.LBA_30_90.delay.Y                = 1.100000e-06
+PIC.Core.DE601LBA.LBA_OUTER.LBA_30_90.delay.X                = 0.000000e+00
+PIC.Core.DE601LBA.LBA_OUTER.LBA_30_90.delay.Y                = 0.000000e+00
 PIC.Core.DE601HBA.HBA_JOINED.HBA_110_190.phase0.X            = 0.000000e+00
 PIC.Core.DE601HBA.HBA_JOINED.HBA_110_190.phase0.Y            = 0.000000e+00
-PIC.Core.DE601HBA.HBA_JOINED.HBA_110_190.delay.X             = 1.100000e-06
-PIC.Core.DE601HBA.HBA_JOINED.HBA_110_190.delay.Y             = 1.100000e-06
+PIC.Core.DE601HBA.HBA_JOINED.HBA_110_190.delay.X             = 0.000000e+00
+PIC.Core.DE601HBA.HBA_JOINED.HBA_110_190.delay.Y             = 0.000000e+00
 PIC.Core.DE601HBA.HBA_JOINED.HBA_170_230.phase0.X            = 0.000000e+00
 PIC.Core.DE601HBA.HBA_JOINED.HBA_170_230.phase0.Y            = 0.000000e+00
-PIC.Core.DE601HBA.HBA_JOINED.HBA_170_230.delay.X             = 1.100000e-06
-PIC.Core.DE601HBA.HBA_JOINED.HBA_170_230.delay.Y             = 1.100000e-06
+PIC.Core.DE601HBA.HBA_JOINED.HBA_170_230.delay.X             = 0.000000e+00
+PIC.Core.DE601HBA.HBA_JOINED.HBA_170_230.delay.Y             = 0.000000e+00
 PIC.Core.DE601HBA.HBA_JOINED.HBA_210_250.phase0.X            = 0.000000e+00
 PIC.Core.DE601HBA.HBA_JOINED.HBA_210_250.phase0.Y            = 0.000000e+00
-PIC.Core.DE601HBA.HBA_JOINED.HBA_210_250.delay.X             = 1.100000e-06
-PIC.Core.DE601HBA.HBA_JOINED.HBA_210_250.delay.Y             = 1.100000e-06
+PIC.Core.DE601HBA.HBA_JOINED.HBA_210_250.delay.X             = 0.000000e+00
+PIC.Core.DE601HBA.HBA_JOINED.HBA_210_250.delay.Y             = 0.000000e+00
 PIC.Core.DE601HBA.HBA_DUAL.HBA_110_190.phase0.X              = 0.000000e+00
 PIC.Core.DE601HBA.HBA_DUAL.HBA_110_190.phase0.Y              = 0.000000e+00
-PIC.Core.DE601HBA.HBA_DUAL.HBA_110_190.delay.X               = 1.100000e-06
-PIC.Core.DE601HBA.HBA_DUAL.HBA_110_190.delay.Y               = 1.100000e-06
+PIC.Core.DE601HBA.HBA_DUAL.HBA_110_190.delay.X               = 0.000000e+00
+PIC.Core.DE601HBA.HBA_DUAL.HBA_110_190.delay.Y               = 0.000000e+00
 PIC.Core.DE601HBA.HBA_DUAL.HBA_170_230.phase0.X              = 0.000000e+00
 PIC.Core.DE601HBA.HBA_DUAL.HBA_170_230.phase0.Y              = 0.000000e+00
-PIC.Core.DE601HBA.HBA_DUAL.HBA_170_230.delay.X               = 1.100000e-06
-PIC.Core.DE601HBA.HBA_DUAL.HBA_170_230.delay.Y               = 1.100000e-06
+PIC.Core.DE601HBA.HBA_DUAL.HBA_170_230.delay.X               = 0.000000e+00
+PIC.Core.DE601HBA.HBA_DUAL.HBA_170_230.delay.Y               = 0.000000e+00
 PIC.Core.DE601HBA.HBA_DUAL.HBA_210_250.phase0.X              = 0.000000e+00
 PIC.Core.DE601HBA.HBA_DUAL.HBA_210_250.phase0.Y              = 0.000000e+00
-PIC.Core.DE601HBA.HBA_DUAL.HBA_210_250.delay.X               = 1.100000e-06
-PIC.Core.DE601HBA.HBA_DUAL.HBA_210_250.delay.Y               = 1.100000e-06
+PIC.Core.DE601HBA.HBA_DUAL.HBA_210_250.delay.X               = 0.000000e+00
+PIC.Core.DE601HBA.HBA_DUAL.HBA_210_250.delay.Y               = 0.000000e+00
 PIC.Core.DE601HBA.HBA_ZERO.HBA_110_190.phase0.X              = 0.000000e+00
 PIC.Core.DE601HBA.HBA_ZERO.HBA_110_190.phase0.Y              = 0.000000e+00
-PIC.Core.DE601HBA.HBA_ZERO.HBA_110_190.delay.X               = 1.100000e-06
-PIC.Core.DE601HBA.HBA_ZERO.HBA_110_190.delay.Y               = 1.100000e-06
+PIC.Core.DE601HBA.HBA_ZERO.HBA_110_190.delay.X               = 0.000000e+00
+PIC.Core.DE601HBA.HBA_ZERO.HBA_110_190.delay.Y               = 0.000000e+00
 PIC.Core.DE601HBA.HBA_ZERO.HBA_170_230.phase0.X              = 0.000000e+00
 PIC.Core.DE601HBA.HBA_ZERO.HBA_170_230.phase0.Y              = 0.000000e+00
-PIC.Core.DE601HBA.HBA_ZERO.HBA_170_230.delay.X               = 1.100000e-06
-PIC.Core.DE601HBA.HBA_ZERO.HBA_170_230.delay.Y               = 1.100000e-06
+PIC.Core.DE601HBA.HBA_ZERO.HBA_170_230.delay.X               = 0.000000e+00
+PIC.Core.DE601HBA.HBA_ZERO.HBA_170_230.delay.Y               = 0.000000e+00
 PIC.Core.DE601HBA.HBA_ZERO.HBA_210_250.phase0.X              = 0.000000e+00
 PIC.Core.DE601HBA.HBA_ZERO.HBA_210_250.phase0.Y              = 0.000000e+00
-PIC.Core.DE601HBA.HBA_ZERO.HBA_210_250.delay.X               = 1.100000e-06
-PIC.Core.DE601HBA.HBA_ZERO.HBA_210_250.delay.Y               = 1.100000e-06
+PIC.Core.DE601HBA.HBA_ZERO.HBA_210_250.delay.X               = 0.000000e+00
+PIC.Core.DE601HBA.HBA_ZERO.HBA_210_250.delay.Y               = 0.000000e+00
 PIC.Core.DE601HBA.HBA_ONE.HBA_110_190.phase0.X               = 0.000000e+00
 PIC.Core.DE601HBA.HBA_ONE.HBA_110_190.phase0.Y               = 0.000000e+00
-PIC.Core.DE601HBA.HBA_ONE.HBA_110_190.delay.X                = 1.100000e-06
-PIC.Core.DE601HBA.HBA_ONE.HBA_110_190.delay.Y                = 1.100000e-06
+PIC.Core.DE601HBA.HBA_ONE.HBA_110_190.delay.X                = 0.000000e+00
+PIC.Core.DE601HBA.HBA_ONE.HBA_110_190.delay.Y                = 0.000000e+00
 PIC.Core.DE601HBA.HBA_ONE.HBA_170_230.phase0.X               = 0.000000e+00
 PIC.Core.DE601HBA.HBA_ONE.HBA_170_230.phase0.Y               = 0.000000e+00
-PIC.Core.DE601HBA.HBA_ONE.HBA_170_230.delay.X                = 1.100000e-06
-PIC.Core.DE601HBA.HBA_ONE.HBA_170_230.delay.Y                = 1.100000e-06
+PIC.Core.DE601HBA.HBA_ONE.HBA_170_230.delay.X                = 0.000000e+00
+PIC.Core.DE601HBA.HBA_ONE.HBA_170_230.delay.Y                = 0.000000e+00
 PIC.Core.DE601HBA.HBA_ONE.HBA_210_250.phase0.X               = 0.000000e+00
 PIC.Core.DE601HBA.HBA_ONE.HBA_210_250.phase0.Y               = 0.000000e+00
-PIC.Core.DE601HBA.HBA_ONE.HBA_210_250.delay.X                = 1.100000e-06
-PIC.Core.DE601HBA.HBA_ONE.HBA_210_250.delay.Y                = 1.100000e-06
+PIC.Core.DE601HBA.HBA_ONE.HBA_210_250.delay.X                = 0.000000e+00
+PIC.Core.DE601HBA.HBA_ONE.HBA_210_250.delay.Y                = 0.000000e+00
 PIC.Core.DE601HBA.HBA_DUAL_INNER.HBA_110_190.phase0.X        = 0.000000e+00
 PIC.Core.DE601HBA.HBA_DUAL_INNER.HBA_110_190.phase0.Y        = 0.000000e+00
-PIC.Core.DE601HBA.HBA_DUAL_INNER.HBA_110_190.delay.X         = 1.100000e-06
-PIC.Core.DE601HBA.HBA_DUAL_INNER.HBA_110_190.delay.Y         = 1.100000e-06
+PIC.Core.DE601HBA.HBA_DUAL_INNER.HBA_110_190.delay.X         = 0.000000e+00
+PIC.Core.DE601HBA.HBA_DUAL_INNER.HBA_110_190.delay.Y         = 0.000000e+00
 PIC.Core.DE601HBA.HBA_DUAL_INNER.HBA_170_230.phase0.X        = 0.000000e+00
 PIC.Core.DE601HBA.HBA_DUAL_INNER.HBA_170_230.phase0.Y        = 0.000000e+00
-PIC.Core.DE601HBA.HBA_DUAL_INNER.HBA_170_230.delay.X         = 1.100000e-06
-PIC.Core.DE601HBA.HBA_DUAL_INNER.HBA_170_230.delay.Y         = 1.100000e-06
+PIC.Core.DE601HBA.HBA_DUAL_INNER.HBA_170_230.delay.X         = 0.000000e+00
+PIC.Core.DE601HBA.HBA_DUAL_INNER.HBA_170_230.delay.Y         = 0.000000e+00
 PIC.Core.DE601HBA.HBA_DUAL_INNER.HBA_210_250.phase0.X        = 0.000000e+00
 PIC.Core.DE601HBA.HBA_DUAL_INNER.HBA_210_250.phase0.Y        = 0.000000e+00
-PIC.Core.DE601HBA.HBA_DUAL_INNER.HBA_210_250.delay.X         = 1.100000e-06
-PIC.Core.DE601HBA.HBA_DUAL_INNER.HBA_210_250.delay.Y         = 1.100000e-06
+PIC.Core.DE601HBA.HBA_DUAL_INNER.HBA_210_250.delay.X         = 0.000000e+00
+PIC.Core.DE601HBA.HBA_DUAL_INNER.HBA_210_250.delay.Y         = 0.000000e+00
 PIC.Core.DE602LBA.LBA_INNER.LBA_10_70.phase0.X               = 0.000000e+00
 PIC.Core.DE602LBA.LBA_INNER.LBA_10_70.phase0.Y               = 0.000000e+00
 PIC.Core.DE602LBA.LBA_INNER.LBA_10_70.delay.X                = 0.000000e+00
@@ -4806,3 +4806,1475 @@ PIC.Core.UK608HBA.HBA_DUAL_INNER.HBA_210_250.phase0.X        = 0.000000e+00
 PIC.Core.UK608HBA.HBA_DUAL_INNER.HBA_210_250.phase0.Y        = 0.000000e+00
 PIC.Core.UK608HBA.HBA_DUAL_INNER.HBA_210_250.delay.X         = 0.000000e+00
 PIC.Core.UK608HBA.HBA_DUAL_INNER.HBA_210_250.delay.Y         = 0.000000e+00
+PIC.Core.CS001LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.CS001LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS001LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.X                = 4.675295e-06
+PIC.Core.CS001LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.Y                = 4.674852e-06
+PIC.Core.CS001LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.CS001LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS001LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.X                = 4.675295e-06
+PIC.Core.CS001LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.Y                = 4.674852e-06
+PIC.Core.CS001LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.CS001LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS001LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.X                = 4.675295e-06
+PIC.Core.CS001LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.Y                = 4.674852e-06
+PIC.Core.CS001LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.CS001LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS001LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.X                = 4.675295e-06
+PIC.Core.CS001LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.Y                = 4.674852e-06
+PIC.Core.CS002LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.CS002LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS002LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.X                = 6.895039e-06
+PIC.Core.CS002LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.Y                = 6.895581e-06
+PIC.Core.CS002LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.CS002LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS002LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.X                = 6.895039e-06
+PIC.Core.CS002LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.Y                = 6.895581e-06
+PIC.Core.CS002LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.CS002LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS002LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.X                = 6.895039e-06
+PIC.Core.CS002LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.Y                = 6.895581e-06
+PIC.Core.CS002LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.CS002LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS002LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.X                = 6.895039e-06
+PIC.Core.CS002LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.Y                = 6.895581e-06
+PIC.Core.CS003LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.CS003LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS003LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.X                = 5.490480e-06
+PIC.Core.CS003LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.Y                = 5.490185e-06
+PIC.Core.CS003LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.CS003LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS003LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.X                = 5.490480e-06
+PIC.Core.CS003LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.Y                = 5.490185e-06
+PIC.Core.CS003LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.CS003LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS003LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.X                = 5.490480e-06
+PIC.Core.CS003LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.Y                = 5.490185e-06
+PIC.Core.CS003LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.CS003LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS003LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.X                = 5.490480e-06
+PIC.Core.CS003LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.Y                = 5.490185e-06
+PIC.Core.CS004LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.CS004LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS004LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.X                = 6.470439e-06
+PIC.Core.CS004LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.Y                = 6.471039e-06
+PIC.Core.CS004LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.CS004LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS004LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.X                = 6.470439e-06
+PIC.Core.CS004LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.Y                = 6.471039e-06
+PIC.Core.CS004LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.CS004LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS004LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.X                = 6.470439e-06
+PIC.Core.CS004LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.Y                = 6.471039e-06
+PIC.Core.CS004LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.CS004LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS004LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.X                = 6.470439e-06
+PIC.Core.CS004LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.Y                = 6.471039e-06
+PIC.Core.CS005LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.CS005LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS005LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.X                = 7.121005e-06
+PIC.Core.CS005LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.Y                = 7.121630e-06
+PIC.Core.CS005LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.CS005LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS005LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.X                = 7.121005e-06
+PIC.Core.CS005LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.Y                = 7.121630e-06
+PIC.Core.CS005LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.CS005LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS005LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.X                = 7.121005e-06
+PIC.Core.CS005LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.Y                = 7.121630e-06
+PIC.Core.CS005LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.CS005LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS005LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.X                = 7.121005e-06
+PIC.Core.CS005LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.Y                = 7.121630e-06
+PIC.Core.CS006LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.CS006LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS006LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.X                = 6.466453e-06
+PIC.Core.CS006LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.Y                = 6.466862e-06
+PIC.Core.CS006LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.CS006LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS006LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.X                = 6.466453e-06
+PIC.Core.CS006LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.Y                = 6.466862e-06
+PIC.Core.CS006LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.CS006LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS006LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.X                = 6.466453e-06
+PIC.Core.CS006LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.Y                = 6.466862e-06
+PIC.Core.CS006LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.CS006LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS006LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.X                = 6.466453e-06
+PIC.Core.CS006LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.Y                = 6.466862e-06
+PIC.Core.CS007LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.CS007LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS007LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.X                = 6.495847e-06
+PIC.Core.CS007LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.Y                = 6.495400e-06
+PIC.Core.CS007LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.CS007LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS007LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.X                = 6.495847e-06
+PIC.Core.CS007LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.Y                = 6.495400e-06
+PIC.Core.CS007LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.CS007LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS007LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.X                = 6.495847e-06
+PIC.Core.CS007LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.Y                = 6.495400e-06
+PIC.Core.CS007LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.CS007LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS007LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.X                = 6.495847e-06
+PIC.Core.CS007LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.Y                = 6.495400e-06
+PIC.Core.CS011LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.CS011LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS011LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.X                = 7.487948e-06
+PIC.Core.CS011LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.Y                = 7.488310e-06
+PIC.Core.CS011LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.CS011LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS011LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.X                = 7.487948e-06
+PIC.Core.CS011LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.Y                = 7.488310e-06
+PIC.Core.CS011LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.CS011LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS011LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.X                = 7.487948e-06
+PIC.Core.CS011LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.Y                = 7.488310e-06
+PIC.Core.CS011LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.CS011LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS011LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.X                = 7.487948e-06
+PIC.Core.CS011LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.Y                = 7.488310e-06
+PIC.Core.CS013LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.CS013LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS013LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.X                = 8.708485e-06
+PIC.Core.CS013LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.Y                = 8.708511e-06
+PIC.Core.CS013LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.CS013LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS013LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.X                = 8.708485e-06
+PIC.Core.CS013LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.Y                = 8.708511e-06
+PIC.Core.CS013LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.CS013LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS013LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.X                = 8.708485e-06
+PIC.Core.CS013LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.Y                = 8.708511e-06
+PIC.Core.CS013LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.CS013LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS013LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.X                = 8.708485e-06
+PIC.Core.CS013LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.Y                = 8.708511e-06
+PIC.Core.CS017LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.CS017LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS017LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.X                = 1.534158e-05
+PIC.Core.CS017LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.Y                = 1.534011e-05
+PIC.Core.CS017LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.CS017LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS017LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.X                = 1.534158e-05
+PIC.Core.CS017LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.Y                = 1.534011e-05
+PIC.Core.CS017LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.CS017LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS017LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.X                = 1.534158e-05
+PIC.Core.CS017LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.Y                = 1.534011e-05
+PIC.Core.CS017LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.CS017LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS017LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.X                = 1.534158e-05
+PIC.Core.CS017LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.Y                = 1.534011e-05
+PIC.Core.CS021LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.CS021LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS021LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.X                = 5.978107e-06
+PIC.Core.CS021LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.Y                = 5.978842e-06
+PIC.Core.CS021LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.CS021LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS021LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.X                = 5.978107e-06
+PIC.Core.CS021LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.Y                = 5.978842e-06
+PIC.Core.CS021LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.CS021LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS021LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.X                = 5.978107e-06
+PIC.Core.CS021LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.Y                = 5.978842e-06
+PIC.Core.CS021LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.CS021LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS021LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.X                = 5.978107e-06
+PIC.Core.CS021LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.Y                = 5.978842e-06
+PIC.Core.CS024LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.CS024LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS024LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.X                = 4.574559e-06
+PIC.Core.CS024LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.Y                = 4.573567e-06
+PIC.Core.CS024LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.CS024LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS024LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.X                = 4.574559e-06
+PIC.Core.CS024LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.Y                = 4.573567e-06
+PIC.Core.CS024LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.CS024LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS024LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.X                = 4.574559e-06
+PIC.Core.CS024LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.Y                = 4.573567e-06
+PIC.Core.CS024LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.CS024LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS024LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.X                = 4.574559e-06
+PIC.Core.CS024LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.Y                = 4.573567e-06
+PIC.Core.CS026LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.CS026LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS026LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.X                = 1.612922e-05
+PIC.Core.CS026LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.Y                = 1.612964e-05
+PIC.Core.CS026LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.CS026LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS026LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.X                = 1.612922e-05
+PIC.Core.CS026LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.Y                = 1.612964e-05
+PIC.Core.CS026LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.CS026LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS026LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.X                = 1.612922e-05
+PIC.Core.CS026LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.Y                = 1.612964e-05
+PIC.Core.CS026LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.CS026LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS026LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.X                = 1.612922e-05
+PIC.Core.CS026LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.Y                = 1.612964e-05
+PIC.Core.CS028LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.CS028LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS028LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.X                = 1.687817e-05
+PIC.Core.CS028LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.Y                = 1.687941e-05
+PIC.Core.CS028LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.CS028LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS028LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.X                = 1.687817e-05
+PIC.Core.CS028LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.Y                = 1.687941e-05
+PIC.Core.CS028LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.CS028LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS028LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.X                = 1.687817e-05
+PIC.Core.CS028LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.Y                = 1.687941e-05
+PIC.Core.CS028LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.CS028LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS028LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.X                = 1.687817e-05
+PIC.Core.CS028LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.Y                = 1.687941e-05
+PIC.Core.CS030LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.CS030LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS030LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.X                = 9.644541e-06
+PIC.Core.CS030LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.Y                = 9.644413e-06
+PIC.Core.CS030LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.CS030LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS030LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.X                = 9.644541e-06
+PIC.Core.CS030LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.Y                = 9.644413e-06
+PIC.Core.CS030LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.CS030LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS030LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.X                = 9.644541e-06
+PIC.Core.CS030LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.Y                = 9.644413e-06
+PIC.Core.CS030LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.CS030LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS030LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.X                = 9.644541e-06
+PIC.Core.CS030LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.Y                = 9.644413e-06
+PIC.Core.CS031LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.CS031LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS031LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.X                = 6.284210e-06
+PIC.Core.CS031LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.Y                = 6.283419e-06
+PIC.Core.CS031LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.CS031LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS031LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.X                = 6.284210e-06
+PIC.Core.CS031LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.Y                = 6.283419e-06
+PIC.Core.CS031LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.CS031LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS031LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.X                = 6.284210e-06
+PIC.Core.CS031LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.Y                = 6.283419e-06
+PIC.Core.CS031LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.CS031LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS031LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.X                = 6.284210e-06
+PIC.Core.CS031LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.Y                = 6.283419e-06
+PIC.Core.CS032LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.CS032LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS032LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.X                = 8.475112e-06
+PIC.Core.CS032LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.Y                = 8.475084e-06
+PIC.Core.CS032LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.CS032LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS032LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.X                = 8.475112e-06
+PIC.Core.CS032LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.Y                = 8.475084e-06
+PIC.Core.CS032LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.CS032LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS032LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.X                = 8.475112e-06
+PIC.Core.CS032LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.Y                = 8.475084e-06
+PIC.Core.CS032LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.CS032LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS032LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.X                = 8.475112e-06
+PIC.Core.CS032LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.Y                = 8.475084e-06
+PIC.Core.CS101LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.CS101LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS101LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.X                = 1.507383e-05
+PIC.Core.CS101LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.Y                = 1.507351e-05
+PIC.Core.CS101LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.CS101LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS101LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.X                = 1.507383e-05
+PIC.Core.CS101LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.Y                = 1.507351e-05
+PIC.Core.CS101LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.CS101LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS101LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.X                = 1.507383e-05
+PIC.Core.CS101LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.Y                = 1.507351e-05
+PIC.Core.CS101LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.CS101LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS101LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.X                = 1.507383e-05
+PIC.Core.CS101LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.Y                = 1.507351e-05
+PIC.Core.CS103LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.CS103LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS103LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.X                = 3.541826e-05
+PIC.Core.CS103LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.Y                = 3.541774e-05
+PIC.Core.CS103LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.CS103LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS103LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.X                = 3.541826e-05
+PIC.Core.CS103LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.Y                = 3.541774e-05
+PIC.Core.CS103LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.CS103LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS103LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.X                = 3.541826e-05
+PIC.Core.CS103LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.Y                = 3.541774e-05
+PIC.Core.CS103LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.CS103LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS103LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.X                = 3.541826e-05
+PIC.Core.CS103LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.Y                = 3.541774e-05
+PIC.Core.CS201LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.CS201LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS201LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.X                = 1.737916e-05
+PIC.Core.CS201LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.Y                = 1.737889e-05
+PIC.Core.CS201LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.CS201LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS201LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.X                = 1.737916e-05
+PIC.Core.CS201LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.Y                = 1.737889e-05
+PIC.Core.CS201LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.CS201LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS201LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.X                = 1.737916e-05
+PIC.Core.CS201LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.Y                = 1.737889e-05
+PIC.Core.CS201LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.CS201LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS201LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.X                = 1.737916e-05
+PIC.Core.CS201LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.Y                = 1.737889e-05
+PIC.Core.CS301LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.CS301LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS301LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.X                = 7.618883e-06
+PIC.Core.CS301LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.Y                = 7.619549e-06
+PIC.Core.CS301LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.CS301LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS301LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.X                = 7.618883e-06
+PIC.Core.CS301LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.Y                = 7.619549e-06
+PIC.Core.CS301LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.CS301LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS301LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.X                = 7.618883e-06
+PIC.Core.CS301LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.Y                = 7.619549e-06
+PIC.Core.CS301LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.CS301LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS301LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.X                = 7.618883e-06
+PIC.Core.CS301LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.Y                = 7.619549e-06
+PIC.Core.CS302LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.CS302LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS302LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.X                = 1.225001e-05
+PIC.Core.CS302LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.Y                = 1.224991e-05
+PIC.Core.CS302LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.CS302LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS302LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.X                = 1.225001e-05
+PIC.Core.CS302LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.Y                = 1.224991e-05
+PIC.Core.CS302LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.CS302LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS302LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.X                = 1.225001e-05
+PIC.Core.CS302LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.Y                = 1.224991e-05
+PIC.Core.CS302LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.CS302LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS302LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.X                = 1.225001e-05
+PIC.Core.CS302LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.Y                = 1.224991e-05
+PIC.Core.CS401LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.CS401LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS401LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.X                = 7.852150e-06
+PIC.Core.CS401LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.Y                = 7.852323e-06
+PIC.Core.CS401LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.CS401LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS401LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.X                = 7.852150e-06
+PIC.Core.CS401LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.Y                = 7.852323e-06
+PIC.Core.CS401LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.CS401LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS401LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.X                = 7.852150e-06
+PIC.Core.CS401LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.Y                = 7.852323e-06
+PIC.Core.CS401LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.CS401LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS401LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.X                = 7.852150e-06
+PIC.Core.CS401LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.Y                = 7.852323e-06
+PIC.Core.CS501LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.CS501LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS501LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.X                = 1.651265e-05
+PIC.Core.CS501LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.Y                = 1.651265e-05
+PIC.Core.CS501LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.CS501LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS501LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.X                = 1.651265e-05
+PIC.Core.CS501LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.Y                = 1.651265e-05
+PIC.Core.CS501LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.CS501LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS501LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.X                = 1.651265e-05
+PIC.Core.CS501LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.Y                = 1.651265e-05
+PIC.Core.CS501LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.CS501LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS501LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.X                = 1.651265e-05
+PIC.Core.CS501LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.Y                = 1.651265e-05
+PIC.Core.RS106LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.RS106LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.RS106LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.X                = 0.000000e+00
+PIC.Core.RS106LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.Y                = 0.000000e+00
+PIC.Core.RS106LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.RS106LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.RS106LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.X                = 0.000000e+00
+PIC.Core.RS106LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.Y                = 0.000000e+00
+PIC.Core.RS106LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.RS106LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.RS106LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.X                = 0.000000e+00
+PIC.Core.RS106LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.Y                = 0.000000e+00
+PIC.Core.RS106LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.RS106LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.RS106LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.X                = 0.000000e+00
+PIC.Core.RS106LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.Y                = 0.000000e+00
+PIC.Core.RS205LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.RS205LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.RS205LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.X                = 0.000000e+00
+PIC.Core.RS205LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.Y                = 0.000000e+00
+PIC.Core.RS205LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.RS205LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.RS205LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.X                = 0.000000e+00
+PIC.Core.RS205LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.Y                = 0.000000e+00
+PIC.Core.RS205LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.RS205LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.RS205LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.X                = 0.000000e+00
+PIC.Core.RS205LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.Y                = 0.000000e+00
+PIC.Core.RS205LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.RS205LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.RS205LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.X                = 0.000000e+00
+PIC.Core.RS205LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.Y                = 0.000000e+00
+PIC.Core.RS208LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.RS208LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.RS208LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.X                = 0.000000e+00
+PIC.Core.RS208LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.Y                = 0.000000e+00
+PIC.Core.RS208LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.RS208LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.RS208LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.X                = 0.000000e+00
+PIC.Core.RS208LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.Y                = 0.000000e+00
+PIC.Core.RS208LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.RS208LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.RS208LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.X                = 0.000000e+00
+PIC.Core.RS208LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.Y                = 0.000000e+00
+PIC.Core.RS208LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.RS208LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.RS208LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.X                = 0.000000e+00
+PIC.Core.RS208LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.Y                = 0.000000e+00
+PIC.Core.RS210LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.RS210LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.RS210LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.X                = 0.000000e+00
+PIC.Core.RS210LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.Y                = 0.000000e+00
+PIC.Core.RS210LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.RS210LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.RS210LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.X                = 0.000000e+00
+PIC.Core.RS210LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.Y                = 0.000000e+00
+PIC.Core.RS210LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.RS210LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.RS210LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.X                = 0.000000e+00
+PIC.Core.RS210LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.Y                = 0.000000e+00
+PIC.Core.RS210LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.RS210LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.RS210LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.X                = 0.000000e+00
+PIC.Core.RS210LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.Y                = 0.000000e+00
+PIC.Core.RS305LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.RS305LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.RS305LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.X                = 0.000000e+00
+PIC.Core.RS305LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.Y                = 0.000000e+00
+PIC.Core.RS305LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.RS305LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.RS305LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.X                = 0.000000e+00
+PIC.Core.RS305LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.Y                = 0.000000e+00
+PIC.Core.RS305LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.RS305LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.RS305LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.X                = 0.000000e+00
+PIC.Core.RS305LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.Y                = 0.000000e+00
+PIC.Core.RS305LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.RS305LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.RS305LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.X                = 0.000000e+00
+PIC.Core.RS305LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.Y                = 0.000000e+00
+PIC.Core.RS306LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.RS306LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.RS306LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.X                = 0.000000e+00
+PIC.Core.RS306LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.Y                = 0.000000e+00
+PIC.Core.RS306LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.RS306LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.RS306LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.X                = 0.000000e+00
+PIC.Core.RS306LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.Y                = 0.000000e+00
+PIC.Core.RS306LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.RS306LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.RS306LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.X                = 0.000000e+00
+PIC.Core.RS306LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.Y                = 0.000000e+00
+PIC.Core.RS306LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.RS306LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.RS306LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.X                = 0.000000e+00
+PIC.Core.RS306LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.Y                = 0.000000e+00
+PIC.Core.RS307LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.RS307LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.RS307LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.X                = 0.000000e+00
+PIC.Core.RS307LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.Y                = 0.000000e+00
+PIC.Core.RS307LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.RS307LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.RS307LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.X                = 0.000000e+00
+PIC.Core.RS307LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.Y                = 0.000000e+00
+PIC.Core.RS307LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.RS307LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.RS307LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.X                = 0.000000e+00
+PIC.Core.RS307LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.Y                = 0.000000e+00
+PIC.Core.RS307LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.RS307LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.RS307LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.X                = 0.000000e+00
+PIC.Core.RS307LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.Y                = 0.000000e+00
+PIC.Core.RS310LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.RS310LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.RS310LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.X                = 0.000000e+00
+PIC.Core.RS310LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.Y                = 0.000000e+00
+PIC.Core.RS310LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.RS310LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.RS310LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.X                = 0.000000e+00
+PIC.Core.RS310LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.Y                = 0.000000e+00
+PIC.Core.RS310LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.RS310LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.RS310LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.X                = 0.000000e+00
+PIC.Core.RS310LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.Y                = 0.000000e+00
+PIC.Core.RS310LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.RS310LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.RS310LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.X                = 0.000000e+00
+PIC.Core.RS310LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.Y                = 0.000000e+00
+PIC.Core.RS406LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.RS406LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.RS406LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.X                = 0.000000e+00
+PIC.Core.RS406LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.Y                = 0.000000e+00
+PIC.Core.RS406LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.RS406LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.RS406LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.X                = 0.000000e+00
+PIC.Core.RS406LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.Y                = 0.000000e+00
+PIC.Core.RS406LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.RS406LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.RS406LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.X                = 0.000000e+00
+PIC.Core.RS406LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.Y                = 0.000000e+00
+PIC.Core.RS406LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.RS406LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.RS406LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.X                = 0.000000e+00
+PIC.Core.RS406LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.Y                = 0.000000e+00
+PIC.Core.RS407LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.RS407LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.RS407LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.X                = 0.000000e+00
+PIC.Core.RS407LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.Y                = 0.000000e+00
+PIC.Core.RS407LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.RS407LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.RS407LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.X                = 0.000000e+00
+PIC.Core.RS407LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.Y                = 0.000000e+00
+PIC.Core.RS407LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.RS407LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.RS407LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.X                = 0.000000e+00
+PIC.Core.RS407LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.Y                = 0.000000e+00
+PIC.Core.RS407LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.RS407LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.RS407LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.X                = 0.000000e+00
+PIC.Core.RS407LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.Y                = 0.000000e+00
+PIC.Core.RS409LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.RS409LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.RS409LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.X                = 0.000000e+00
+PIC.Core.RS409LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.Y                = 0.000000e+00
+PIC.Core.RS409LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.RS409LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.RS409LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.X                = 0.000000e+00
+PIC.Core.RS409LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.Y                = 0.000000e+00
+PIC.Core.RS409LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.RS409LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.RS409LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.X                = 0.000000e+00
+PIC.Core.RS409LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.Y                = 0.000000e+00
+PIC.Core.RS409LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.RS409LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.RS409LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.X                = 0.000000e+00
+PIC.Core.RS409LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.Y                = 0.000000e+00
+PIC.Core.RS503LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.RS503LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.RS503LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.X                = 0.000000e+00
+PIC.Core.RS503LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.Y                = 0.000000e+00
+PIC.Core.RS503LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.RS503LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.RS503LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.X                = 0.000000e+00
+PIC.Core.RS503LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.Y                = 0.000000e+00
+PIC.Core.RS503LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.RS503LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.RS503LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.X                = 0.000000e+00
+PIC.Core.RS503LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.Y                = 0.000000e+00
+PIC.Core.RS503LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.RS503LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.RS503LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.X                = 0.000000e+00
+PIC.Core.RS503LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.Y                = 0.000000e+00
+PIC.Core.RS508LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.RS508LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.RS508LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.X                = 0.000000e+00
+PIC.Core.RS508LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.Y                = 0.000000e+00
+PIC.Core.RS508LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.RS508LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.RS508LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.X                = 0.000000e+00
+PIC.Core.RS508LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.Y                = 0.000000e+00
+PIC.Core.RS508LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.RS508LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.RS508LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.X                = 0.000000e+00
+PIC.Core.RS508LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.Y                = 0.000000e+00
+PIC.Core.RS508LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.RS508LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.RS508LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.X                = 0.000000e+00
+PIC.Core.RS508LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.Y                = 0.000000e+00
+PIC.Core.RS509LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.RS509LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.RS509LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.X                = 0.000000e+00
+PIC.Core.RS509LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.Y                = 0.000000e+00
+PIC.Core.RS509LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.RS509LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.RS509LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.X                = 0.000000e+00
+PIC.Core.RS509LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.Y                = 0.000000e+00
+PIC.Core.RS509LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.RS509LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.RS509LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.X                = 0.000000e+00
+PIC.Core.RS509LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.Y                = 0.000000e+00
+PIC.Core.RS509LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.RS509LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.RS509LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.X                = 0.000000e+00
+PIC.Core.RS509LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.Y                = 0.000000e+00
+PIC.Core.DE601LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.DE601LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.DE601LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.X                = 0.000000e+00
+PIC.Core.DE601LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.Y                = 0.000000e+00
+PIC.Core.DE601LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.DE601LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.DE601LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.X                = 0.000000e+00
+PIC.Core.DE601LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.Y                = 0.000000e+00
+PIC.Core.DE601LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.DE601LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.DE601LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.X                = 0.000000e+00
+PIC.Core.DE601LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.Y                = 0.000000e+00
+PIC.Core.DE601LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.DE601LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.DE601LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.X                = 0.000000e+00
+PIC.Core.DE601LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.Y                = 0.000000e+00
+PIC.Core.DE602LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.DE602LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.DE602LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.X                = 0.000000e+00
+PIC.Core.DE602LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.Y                = 0.000000e+00
+PIC.Core.DE602LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.DE602LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.DE602LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.X                = 0.000000e+00
+PIC.Core.DE602LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.Y                = 0.000000e+00
+PIC.Core.DE602LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.DE602LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.DE602LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.X                = 0.000000e+00
+PIC.Core.DE602LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.Y                = 0.000000e+00
+PIC.Core.DE602LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.DE602LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.DE602LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.X                = 0.000000e+00
+PIC.Core.DE602LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.Y                = 0.000000e+00
+PIC.Core.DE603LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.DE603LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.DE603LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.X                = 0.000000e+00
+PIC.Core.DE603LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.Y                = 0.000000e+00
+PIC.Core.DE603LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.DE603LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.DE603LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.X                = 0.000000e+00
+PIC.Core.DE603LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.Y                = 0.000000e+00
+PIC.Core.DE603LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.DE603LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.DE603LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.X                = 0.000000e+00
+PIC.Core.DE603LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.Y                = 0.000000e+00
+PIC.Core.DE603LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.DE603LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.DE603LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.X                = 0.000000e+00
+PIC.Core.DE603LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.Y                = 0.000000e+00
+PIC.Core.DE604LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.DE604LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.DE604LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.X                = 0.000000e+00
+PIC.Core.DE604LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.Y                = 0.000000e+00
+PIC.Core.DE604LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.DE604LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.DE604LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.X                = 0.000000e+00
+PIC.Core.DE604LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.Y                = 0.000000e+00
+PIC.Core.DE604LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.DE604LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.DE604LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.X                = 0.000000e+00
+PIC.Core.DE604LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.Y                = 0.000000e+00
+PIC.Core.DE604LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.DE604LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.DE604LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.X                = 0.000000e+00
+PIC.Core.DE604LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.Y                = 0.000000e+00
+PIC.Core.DE605LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.DE605LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.DE605LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.X                = 0.000000e+00
+PIC.Core.DE605LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.Y                = 0.000000e+00
+PIC.Core.DE605LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.DE605LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.DE605LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.X                = 0.000000e+00
+PIC.Core.DE605LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.Y                = 0.000000e+00
+PIC.Core.DE605LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.DE605LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.DE605LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.X                = 0.000000e+00
+PIC.Core.DE605LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.Y                = 0.000000e+00
+PIC.Core.DE605LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.DE605LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.DE605LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.X                = 0.000000e+00
+PIC.Core.DE605LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.Y                = 0.000000e+00
+PIC.Core.FR606LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.FR606LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.FR606LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.X                = 0.000000e+00
+PIC.Core.FR606LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.Y                = 0.000000e+00
+PIC.Core.FR606LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.FR606LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.FR606LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.X                = 0.000000e+00
+PIC.Core.FR606LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.Y                = 0.000000e+00
+PIC.Core.FR606LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.FR606LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.FR606LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.X                = 0.000000e+00
+PIC.Core.FR606LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.Y                = 0.000000e+00
+PIC.Core.FR606LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.FR606LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.FR606LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.X                = 0.000000e+00
+PIC.Core.FR606LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.Y                = 0.000000e+00
+PIC.Core.SE607LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.SE607LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.SE607LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.X                = 0.000000e+00
+PIC.Core.SE607LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.Y                = 0.000000e+00
+PIC.Core.SE607LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.SE607LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.SE607LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.X                = 0.000000e+00
+PIC.Core.SE607LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.Y                = 0.000000e+00
+PIC.Core.SE607LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.SE607LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.SE607LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.X                = 0.000000e+00
+PIC.Core.SE607LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.Y                = 0.000000e+00
+PIC.Core.SE607LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.SE607LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.SE607LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.X                = 0.000000e+00
+PIC.Core.SE607LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.Y                = 0.000000e+00
+PIC.Core.UK608LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.UK608LBA.LBA_SPARSE_EVEN.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.UK608LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.X                = 0.000000e+00
+PIC.Core.UK608LBA.LBA_SPARSE_EVEN.LBA_10_70.delay.Y                = 0.000000e+00
+PIC.Core.UK608LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.UK608LBA.LBA_SPARSE_EVEN.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.UK608LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.X                = 0.000000e+00
+PIC.Core.UK608LBA.LBA_SPARSE_EVEN.LBA_30_70.delay.Y                = 0.000000e+00
+PIC.Core.UK608LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.UK608LBA.LBA_SPARSE_EVEN.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.UK608LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.X                = 0.000000e+00
+PIC.Core.UK608LBA.LBA_SPARSE_EVEN.LBA_10_90.delay.Y                = 0.000000e+00
+PIC.Core.UK608LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.UK608LBA.LBA_SPARSE_EVEN.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.UK608LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.X                = 0.000000e+00
+PIC.Core.UK608LBA.LBA_SPARSE_EVEN.LBA_30_90.delay.Y                = 0.000000e+00
+PIC.Core.CS001LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.CS001LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS001LBA.LBA_SPARSE_ODD.LBA_10_70.delay.X                = 4.675295e-06
+PIC.Core.CS001LBA.LBA_SPARSE_ODD.LBA_10_70.delay.Y                = 4.674852e-06
+PIC.Core.CS001LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.CS001LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS001LBA.LBA_SPARSE_ODD.LBA_30_70.delay.X                = 4.675295e-06
+PIC.Core.CS001LBA.LBA_SPARSE_ODD.LBA_30_70.delay.Y                = 4.674852e-06
+PIC.Core.CS001LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.CS001LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS001LBA.LBA_SPARSE_ODD.LBA_10_90.delay.X                = 4.675295e-06
+PIC.Core.CS001LBA.LBA_SPARSE_ODD.LBA_10_90.delay.Y                = 4.674852e-06
+PIC.Core.CS001LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.CS001LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS001LBA.LBA_SPARSE_ODD.LBA_30_90.delay.X                = 4.675295e-06
+PIC.Core.CS001LBA.LBA_SPARSE_ODD.LBA_30_90.delay.Y                = 4.674852e-06
+PIC.Core.CS002LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.CS002LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS002LBA.LBA_SPARSE_ODD.LBA_10_70.delay.X                = 6.895039e-06
+PIC.Core.CS002LBA.LBA_SPARSE_ODD.LBA_10_70.delay.Y                = 6.895581e-06
+PIC.Core.CS002LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.CS002LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS002LBA.LBA_SPARSE_ODD.LBA_30_70.delay.X                = 6.895039e-06
+PIC.Core.CS002LBA.LBA_SPARSE_ODD.LBA_30_70.delay.Y                = 6.895581e-06
+PIC.Core.CS002LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.CS002LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS002LBA.LBA_SPARSE_ODD.LBA_10_90.delay.X                = 6.895039e-06
+PIC.Core.CS002LBA.LBA_SPARSE_ODD.LBA_10_90.delay.Y                = 6.895581e-06
+PIC.Core.CS002LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.CS002LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS002LBA.LBA_SPARSE_ODD.LBA_30_90.delay.X                = 6.895039e-06
+PIC.Core.CS002LBA.LBA_SPARSE_ODD.LBA_30_90.delay.Y                = 6.895581e-06
+PIC.Core.CS003LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.CS003LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS003LBA.LBA_SPARSE_ODD.LBA_10_70.delay.X                = 5.490480e-06
+PIC.Core.CS003LBA.LBA_SPARSE_ODD.LBA_10_70.delay.Y                = 5.490185e-06
+PIC.Core.CS003LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.CS003LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS003LBA.LBA_SPARSE_ODD.LBA_30_70.delay.X                = 5.490480e-06
+PIC.Core.CS003LBA.LBA_SPARSE_ODD.LBA_30_70.delay.Y                = 5.490185e-06
+PIC.Core.CS003LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.CS003LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS003LBA.LBA_SPARSE_ODD.LBA_10_90.delay.X                = 5.490480e-06
+PIC.Core.CS003LBA.LBA_SPARSE_ODD.LBA_10_90.delay.Y                = 5.490185e-06
+PIC.Core.CS003LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.CS003LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS003LBA.LBA_SPARSE_ODD.LBA_30_90.delay.X                = 5.490480e-06
+PIC.Core.CS003LBA.LBA_SPARSE_ODD.LBA_30_90.delay.Y                = 5.490185e-06
+PIC.Core.CS004LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.CS004LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS004LBA.LBA_SPARSE_ODD.LBA_10_70.delay.X                = 6.470439e-06
+PIC.Core.CS004LBA.LBA_SPARSE_ODD.LBA_10_70.delay.Y                = 6.471039e-06
+PIC.Core.CS004LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.CS004LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS004LBA.LBA_SPARSE_ODD.LBA_30_70.delay.X                = 6.470439e-06
+PIC.Core.CS004LBA.LBA_SPARSE_ODD.LBA_30_70.delay.Y                = 6.471039e-06
+PIC.Core.CS004LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.CS004LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS004LBA.LBA_SPARSE_ODD.LBA_10_90.delay.X                = 6.470439e-06
+PIC.Core.CS004LBA.LBA_SPARSE_ODD.LBA_10_90.delay.Y                = 6.471039e-06
+PIC.Core.CS004LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.CS004LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS004LBA.LBA_SPARSE_ODD.LBA_30_90.delay.X                = 6.470439e-06
+PIC.Core.CS004LBA.LBA_SPARSE_ODD.LBA_30_90.delay.Y                = 6.471039e-06
+PIC.Core.CS005LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.CS005LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS005LBA.LBA_SPARSE_ODD.LBA_10_70.delay.X                = 7.121005e-06
+PIC.Core.CS005LBA.LBA_SPARSE_ODD.LBA_10_70.delay.Y                = 7.121630e-06
+PIC.Core.CS005LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.CS005LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS005LBA.LBA_SPARSE_ODD.LBA_30_70.delay.X                = 7.121005e-06
+PIC.Core.CS005LBA.LBA_SPARSE_ODD.LBA_30_70.delay.Y                = 7.121630e-06
+PIC.Core.CS005LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.CS005LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS005LBA.LBA_SPARSE_ODD.LBA_10_90.delay.X                = 7.121005e-06
+PIC.Core.CS005LBA.LBA_SPARSE_ODD.LBA_10_90.delay.Y                = 7.121630e-06
+PIC.Core.CS005LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.CS005LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS005LBA.LBA_SPARSE_ODD.LBA_30_90.delay.X                = 7.121005e-06
+PIC.Core.CS005LBA.LBA_SPARSE_ODD.LBA_30_90.delay.Y                = 7.121630e-06
+PIC.Core.CS006LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.CS006LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS006LBA.LBA_SPARSE_ODD.LBA_10_70.delay.X                = 6.466453e-06
+PIC.Core.CS006LBA.LBA_SPARSE_ODD.LBA_10_70.delay.Y                = 6.466862e-06
+PIC.Core.CS006LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.CS006LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS006LBA.LBA_SPARSE_ODD.LBA_30_70.delay.X                = 6.466453e-06
+PIC.Core.CS006LBA.LBA_SPARSE_ODD.LBA_30_70.delay.Y                = 6.466862e-06
+PIC.Core.CS006LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.CS006LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS006LBA.LBA_SPARSE_ODD.LBA_10_90.delay.X                = 6.466453e-06
+PIC.Core.CS006LBA.LBA_SPARSE_ODD.LBA_10_90.delay.Y                = 6.466862e-06
+PIC.Core.CS006LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.CS006LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS006LBA.LBA_SPARSE_ODD.LBA_30_90.delay.X                = 6.466453e-06
+PIC.Core.CS006LBA.LBA_SPARSE_ODD.LBA_30_90.delay.Y                = 6.466862e-06
+PIC.Core.CS007LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.CS007LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS007LBA.LBA_SPARSE_ODD.LBA_10_70.delay.X                = 6.495847e-06
+PIC.Core.CS007LBA.LBA_SPARSE_ODD.LBA_10_70.delay.Y                = 6.495400e-06
+PIC.Core.CS007LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.CS007LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS007LBA.LBA_SPARSE_ODD.LBA_30_70.delay.X                = 6.495847e-06
+PIC.Core.CS007LBA.LBA_SPARSE_ODD.LBA_30_70.delay.Y                = 6.495400e-06
+PIC.Core.CS007LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.CS007LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS007LBA.LBA_SPARSE_ODD.LBA_10_90.delay.X                = 6.495847e-06
+PIC.Core.CS007LBA.LBA_SPARSE_ODD.LBA_10_90.delay.Y                = 6.495400e-06
+PIC.Core.CS007LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.CS007LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS007LBA.LBA_SPARSE_ODD.LBA_30_90.delay.X                = 6.495847e-06
+PIC.Core.CS007LBA.LBA_SPARSE_ODD.LBA_30_90.delay.Y                = 6.495400e-06
+PIC.Core.CS011LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.CS011LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS011LBA.LBA_SPARSE_ODD.LBA_10_70.delay.X                = 7.487948e-06
+PIC.Core.CS011LBA.LBA_SPARSE_ODD.LBA_10_70.delay.Y                = 7.488310e-06
+PIC.Core.CS011LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.CS011LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS011LBA.LBA_SPARSE_ODD.LBA_30_70.delay.X                = 7.487948e-06
+PIC.Core.CS011LBA.LBA_SPARSE_ODD.LBA_30_70.delay.Y                = 7.488310e-06
+PIC.Core.CS011LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.CS011LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS011LBA.LBA_SPARSE_ODD.LBA_10_90.delay.X                = 7.487948e-06
+PIC.Core.CS011LBA.LBA_SPARSE_ODD.LBA_10_90.delay.Y                = 7.488310e-06
+PIC.Core.CS011LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.CS011LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS011LBA.LBA_SPARSE_ODD.LBA_30_90.delay.X                = 7.487948e-06
+PIC.Core.CS011LBA.LBA_SPARSE_ODD.LBA_30_90.delay.Y                = 7.488310e-06
+PIC.Core.CS013LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.CS013LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS013LBA.LBA_SPARSE_ODD.LBA_10_70.delay.X                = 8.708485e-06
+PIC.Core.CS013LBA.LBA_SPARSE_ODD.LBA_10_70.delay.Y                = 8.708511e-06
+PIC.Core.CS013LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.CS013LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS013LBA.LBA_SPARSE_ODD.LBA_30_70.delay.X                = 8.708485e-06
+PIC.Core.CS013LBA.LBA_SPARSE_ODD.LBA_30_70.delay.Y                = 8.708511e-06
+PIC.Core.CS013LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.CS013LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS013LBA.LBA_SPARSE_ODD.LBA_10_90.delay.X                = 8.708485e-06
+PIC.Core.CS013LBA.LBA_SPARSE_ODD.LBA_10_90.delay.Y                = 8.708511e-06
+PIC.Core.CS013LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.CS013LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS013LBA.LBA_SPARSE_ODD.LBA_30_90.delay.X                = 8.708485e-06
+PIC.Core.CS013LBA.LBA_SPARSE_ODD.LBA_30_90.delay.Y                = 8.708511e-06
+PIC.Core.CS017LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.CS017LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS017LBA.LBA_SPARSE_ODD.LBA_10_70.delay.X                = 1.534158e-05
+PIC.Core.CS017LBA.LBA_SPARSE_ODD.LBA_10_70.delay.Y                = 1.534011e-05
+PIC.Core.CS017LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.CS017LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS017LBA.LBA_SPARSE_ODD.LBA_30_70.delay.X                = 1.534158e-05
+PIC.Core.CS017LBA.LBA_SPARSE_ODD.LBA_30_70.delay.Y                = 1.534011e-05
+PIC.Core.CS017LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.CS017LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS017LBA.LBA_SPARSE_ODD.LBA_10_90.delay.X                = 1.534158e-05
+PIC.Core.CS017LBA.LBA_SPARSE_ODD.LBA_10_90.delay.Y                = 1.534011e-05
+PIC.Core.CS017LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.CS017LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS017LBA.LBA_SPARSE_ODD.LBA_30_90.delay.X                = 1.534158e-05
+PIC.Core.CS017LBA.LBA_SPARSE_ODD.LBA_30_90.delay.Y                = 1.534011e-05
+PIC.Core.CS021LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.CS021LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS021LBA.LBA_SPARSE_ODD.LBA_10_70.delay.X                = 5.978107e-06
+PIC.Core.CS021LBA.LBA_SPARSE_ODD.LBA_10_70.delay.Y                = 5.978842e-06
+PIC.Core.CS021LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.CS021LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS021LBA.LBA_SPARSE_ODD.LBA_30_70.delay.X                = 5.978107e-06
+PIC.Core.CS021LBA.LBA_SPARSE_ODD.LBA_30_70.delay.Y                = 5.978842e-06
+PIC.Core.CS021LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.CS021LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS021LBA.LBA_SPARSE_ODD.LBA_10_90.delay.X                = 5.978107e-06
+PIC.Core.CS021LBA.LBA_SPARSE_ODD.LBA_10_90.delay.Y                = 5.978842e-06
+PIC.Core.CS021LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.CS021LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS021LBA.LBA_SPARSE_ODD.LBA_30_90.delay.X                = 5.978107e-06
+PIC.Core.CS021LBA.LBA_SPARSE_ODD.LBA_30_90.delay.Y                = 5.978842e-06
+PIC.Core.CS024LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.CS024LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS024LBA.LBA_SPARSE_ODD.LBA_10_70.delay.X                = 4.574559e-06
+PIC.Core.CS024LBA.LBA_SPARSE_ODD.LBA_10_70.delay.Y                = 4.573567e-06
+PIC.Core.CS024LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.CS024LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS024LBA.LBA_SPARSE_ODD.LBA_30_70.delay.X                = 4.574559e-06
+PIC.Core.CS024LBA.LBA_SPARSE_ODD.LBA_30_70.delay.Y                = 4.573567e-06
+PIC.Core.CS024LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.CS024LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS024LBA.LBA_SPARSE_ODD.LBA_10_90.delay.X                = 4.574559e-06
+PIC.Core.CS024LBA.LBA_SPARSE_ODD.LBA_10_90.delay.Y                = 4.573567e-06
+PIC.Core.CS024LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.CS024LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS024LBA.LBA_SPARSE_ODD.LBA_30_90.delay.X                = 4.574559e-06
+PIC.Core.CS024LBA.LBA_SPARSE_ODD.LBA_30_90.delay.Y                = 4.573567e-06
+PIC.Core.CS026LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.CS026LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS026LBA.LBA_SPARSE_ODD.LBA_10_70.delay.X                = 1.612922e-05
+PIC.Core.CS026LBA.LBA_SPARSE_ODD.LBA_10_70.delay.Y                = 1.612964e-05
+PIC.Core.CS026LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.CS026LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS026LBA.LBA_SPARSE_ODD.LBA_30_70.delay.X                = 1.612922e-05
+PIC.Core.CS026LBA.LBA_SPARSE_ODD.LBA_30_70.delay.Y                = 1.612964e-05
+PIC.Core.CS026LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.CS026LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS026LBA.LBA_SPARSE_ODD.LBA_10_90.delay.X                = 1.612922e-05
+PIC.Core.CS026LBA.LBA_SPARSE_ODD.LBA_10_90.delay.Y                = 1.612964e-05
+PIC.Core.CS026LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.CS026LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS026LBA.LBA_SPARSE_ODD.LBA_30_90.delay.X                = 1.612922e-05
+PIC.Core.CS026LBA.LBA_SPARSE_ODD.LBA_30_90.delay.Y                = 1.612964e-05
+PIC.Core.CS028LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.CS028LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS028LBA.LBA_SPARSE_ODD.LBA_10_70.delay.X                = 1.687817e-05
+PIC.Core.CS028LBA.LBA_SPARSE_ODD.LBA_10_70.delay.Y                = 1.687941e-05
+PIC.Core.CS028LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.CS028LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS028LBA.LBA_SPARSE_ODD.LBA_30_70.delay.X                = 1.687817e-05
+PIC.Core.CS028LBA.LBA_SPARSE_ODD.LBA_30_70.delay.Y                = 1.687941e-05
+PIC.Core.CS028LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.CS028LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS028LBA.LBA_SPARSE_ODD.LBA_10_90.delay.X                = 1.687817e-05
+PIC.Core.CS028LBA.LBA_SPARSE_ODD.LBA_10_90.delay.Y                = 1.687941e-05
+PIC.Core.CS028LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.CS028LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS028LBA.LBA_SPARSE_ODD.LBA_30_90.delay.X                = 1.687817e-05
+PIC.Core.CS028LBA.LBA_SPARSE_ODD.LBA_30_90.delay.Y                = 1.687941e-05
+PIC.Core.CS030LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.CS030LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS030LBA.LBA_SPARSE_ODD.LBA_10_70.delay.X                = 9.644541e-06
+PIC.Core.CS030LBA.LBA_SPARSE_ODD.LBA_10_70.delay.Y                = 9.644413e-06
+PIC.Core.CS030LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.CS030LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS030LBA.LBA_SPARSE_ODD.LBA_30_70.delay.X                = 9.644541e-06
+PIC.Core.CS030LBA.LBA_SPARSE_ODD.LBA_30_70.delay.Y                = 9.644413e-06
+PIC.Core.CS030LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.CS030LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS030LBA.LBA_SPARSE_ODD.LBA_10_90.delay.X                = 9.644541e-06
+PIC.Core.CS030LBA.LBA_SPARSE_ODD.LBA_10_90.delay.Y                = 9.644413e-06
+PIC.Core.CS030LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.CS030LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS030LBA.LBA_SPARSE_ODD.LBA_30_90.delay.X                = 9.644541e-06
+PIC.Core.CS030LBA.LBA_SPARSE_ODD.LBA_30_90.delay.Y                = 9.644413e-06
+PIC.Core.CS031LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.CS031LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS031LBA.LBA_SPARSE_ODD.LBA_10_70.delay.X                = 6.284210e-06
+PIC.Core.CS031LBA.LBA_SPARSE_ODD.LBA_10_70.delay.Y                = 6.283419e-06
+PIC.Core.CS031LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.CS031LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS031LBA.LBA_SPARSE_ODD.LBA_30_70.delay.X                = 6.284210e-06
+PIC.Core.CS031LBA.LBA_SPARSE_ODD.LBA_30_70.delay.Y                = 6.283419e-06
+PIC.Core.CS031LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.CS031LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS031LBA.LBA_SPARSE_ODD.LBA_10_90.delay.X                = 6.284210e-06
+PIC.Core.CS031LBA.LBA_SPARSE_ODD.LBA_10_90.delay.Y                = 6.283419e-06
+PIC.Core.CS031LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.CS031LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS031LBA.LBA_SPARSE_ODD.LBA_30_90.delay.X                = 6.284210e-06
+PIC.Core.CS031LBA.LBA_SPARSE_ODD.LBA_30_90.delay.Y                = 6.283419e-06
+PIC.Core.CS032LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.CS032LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS032LBA.LBA_SPARSE_ODD.LBA_10_70.delay.X                = 8.475112e-06
+PIC.Core.CS032LBA.LBA_SPARSE_ODD.LBA_10_70.delay.Y                = 8.475084e-06
+PIC.Core.CS032LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.CS032LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS032LBA.LBA_SPARSE_ODD.LBA_30_70.delay.X                = 8.475112e-06
+PIC.Core.CS032LBA.LBA_SPARSE_ODD.LBA_30_70.delay.Y                = 8.475084e-06
+PIC.Core.CS032LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.CS032LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS032LBA.LBA_SPARSE_ODD.LBA_10_90.delay.X                = 8.475112e-06
+PIC.Core.CS032LBA.LBA_SPARSE_ODD.LBA_10_90.delay.Y                = 8.475084e-06
+PIC.Core.CS032LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.CS032LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS032LBA.LBA_SPARSE_ODD.LBA_30_90.delay.X                = 8.475112e-06
+PIC.Core.CS032LBA.LBA_SPARSE_ODD.LBA_30_90.delay.Y                = 8.475084e-06
+PIC.Core.CS101LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.CS101LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS101LBA.LBA_SPARSE_ODD.LBA_10_70.delay.X                = 1.507383e-05
+PIC.Core.CS101LBA.LBA_SPARSE_ODD.LBA_10_70.delay.Y                = 1.507351e-05
+PIC.Core.CS101LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.CS101LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS101LBA.LBA_SPARSE_ODD.LBA_30_70.delay.X                = 1.507383e-05
+PIC.Core.CS101LBA.LBA_SPARSE_ODD.LBA_30_70.delay.Y                = 1.507351e-05
+PIC.Core.CS101LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.CS101LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS101LBA.LBA_SPARSE_ODD.LBA_10_90.delay.X                = 1.507383e-05
+PIC.Core.CS101LBA.LBA_SPARSE_ODD.LBA_10_90.delay.Y                = 1.507351e-05
+PIC.Core.CS101LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.CS101LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS101LBA.LBA_SPARSE_ODD.LBA_30_90.delay.X                = 1.507383e-05
+PIC.Core.CS101LBA.LBA_SPARSE_ODD.LBA_30_90.delay.Y                = 1.507351e-05
+PIC.Core.CS103LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.CS103LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS103LBA.LBA_SPARSE_ODD.LBA_10_70.delay.X                = 3.541826e-05
+PIC.Core.CS103LBA.LBA_SPARSE_ODD.LBA_10_70.delay.Y                = 3.541774e-05
+PIC.Core.CS103LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.CS103LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS103LBA.LBA_SPARSE_ODD.LBA_30_70.delay.X                = 3.541826e-05
+PIC.Core.CS103LBA.LBA_SPARSE_ODD.LBA_30_70.delay.Y                = 3.541774e-05
+PIC.Core.CS103LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.CS103LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS103LBA.LBA_SPARSE_ODD.LBA_10_90.delay.X                = 3.541826e-05
+PIC.Core.CS103LBA.LBA_SPARSE_ODD.LBA_10_90.delay.Y                = 3.541774e-05
+PIC.Core.CS103LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.CS103LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS103LBA.LBA_SPARSE_ODD.LBA_30_90.delay.X                = 3.541826e-05
+PIC.Core.CS103LBA.LBA_SPARSE_ODD.LBA_30_90.delay.Y                = 3.541774e-05
+PIC.Core.CS201LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.CS201LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS201LBA.LBA_SPARSE_ODD.LBA_10_70.delay.X                = 1.737916e-05
+PIC.Core.CS201LBA.LBA_SPARSE_ODD.LBA_10_70.delay.Y                = 1.737889e-05
+PIC.Core.CS201LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.CS201LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS201LBA.LBA_SPARSE_ODD.LBA_30_70.delay.X                = 1.737916e-05
+PIC.Core.CS201LBA.LBA_SPARSE_ODD.LBA_30_70.delay.Y                = 1.737889e-05
+PIC.Core.CS201LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.CS201LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS201LBA.LBA_SPARSE_ODD.LBA_10_90.delay.X                = 1.737916e-05
+PIC.Core.CS201LBA.LBA_SPARSE_ODD.LBA_10_90.delay.Y                = 1.737889e-05
+PIC.Core.CS201LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.CS201LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS201LBA.LBA_SPARSE_ODD.LBA_30_90.delay.X                = 1.737916e-05
+PIC.Core.CS201LBA.LBA_SPARSE_ODD.LBA_30_90.delay.Y                = 1.737889e-05
+PIC.Core.CS301LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.CS301LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS301LBA.LBA_SPARSE_ODD.LBA_10_70.delay.X                = 7.618883e-06
+PIC.Core.CS301LBA.LBA_SPARSE_ODD.LBA_10_70.delay.Y                = 7.619549e-06
+PIC.Core.CS301LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.CS301LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS301LBA.LBA_SPARSE_ODD.LBA_30_70.delay.X                = 7.618883e-06
+PIC.Core.CS301LBA.LBA_SPARSE_ODD.LBA_30_70.delay.Y                = 7.619549e-06
+PIC.Core.CS301LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.CS301LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS301LBA.LBA_SPARSE_ODD.LBA_10_90.delay.X                = 7.618883e-06
+PIC.Core.CS301LBA.LBA_SPARSE_ODD.LBA_10_90.delay.Y                = 7.619549e-06
+PIC.Core.CS301LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.CS301LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS301LBA.LBA_SPARSE_ODD.LBA_30_90.delay.X                = 7.618883e-06
+PIC.Core.CS301LBA.LBA_SPARSE_ODD.LBA_30_90.delay.Y                = 7.619549e-06
+PIC.Core.CS302LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.CS302LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS302LBA.LBA_SPARSE_ODD.LBA_10_70.delay.X                = 1.225001e-05
+PIC.Core.CS302LBA.LBA_SPARSE_ODD.LBA_10_70.delay.Y                = 1.224991e-05
+PIC.Core.CS302LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.CS302LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS302LBA.LBA_SPARSE_ODD.LBA_30_70.delay.X                = 1.225001e-05
+PIC.Core.CS302LBA.LBA_SPARSE_ODD.LBA_30_70.delay.Y                = 1.224991e-05
+PIC.Core.CS302LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.CS302LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS302LBA.LBA_SPARSE_ODD.LBA_10_90.delay.X                = 1.225001e-05
+PIC.Core.CS302LBA.LBA_SPARSE_ODD.LBA_10_90.delay.Y                = 1.224991e-05
+PIC.Core.CS302LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.CS302LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS302LBA.LBA_SPARSE_ODD.LBA_30_90.delay.X                = 1.225001e-05
+PIC.Core.CS302LBA.LBA_SPARSE_ODD.LBA_30_90.delay.Y                = 1.224991e-05
+PIC.Core.CS401LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.CS401LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS401LBA.LBA_SPARSE_ODD.LBA_10_70.delay.X                = 7.852150e-06
+PIC.Core.CS401LBA.LBA_SPARSE_ODD.LBA_10_70.delay.Y                = 7.852323e-06
+PIC.Core.CS401LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.CS401LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS401LBA.LBA_SPARSE_ODD.LBA_30_70.delay.X                = 7.852150e-06
+PIC.Core.CS401LBA.LBA_SPARSE_ODD.LBA_30_70.delay.Y                = 7.852323e-06
+PIC.Core.CS401LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.CS401LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS401LBA.LBA_SPARSE_ODD.LBA_10_90.delay.X                = 7.852150e-06
+PIC.Core.CS401LBA.LBA_SPARSE_ODD.LBA_10_90.delay.Y                = 7.852323e-06
+PIC.Core.CS401LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.CS401LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS401LBA.LBA_SPARSE_ODD.LBA_30_90.delay.X                = 7.852150e-06
+PIC.Core.CS401LBA.LBA_SPARSE_ODD.LBA_30_90.delay.Y                = 7.852323e-06
+PIC.Core.CS501LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.CS501LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS501LBA.LBA_SPARSE_ODD.LBA_10_70.delay.X                = 1.651265e-05
+PIC.Core.CS501LBA.LBA_SPARSE_ODD.LBA_10_70.delay.Y                = 1.651265e-05
+PIC.Core.CS501LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.CS501LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.CS501LBA.LBA_SPARSE_ODD.LBA_30_70.delay.X                = 1.651265e-05
+PIC.Core.CS501LBA.LBA_SPARSE_ODD.LBA_30_70.delay.Y                = 1.651265e-05
+PIC.Core.CS501LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.CS501LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS501LBA.LBA_SPARSE_ODD.LBA_10_90.delay.X                = 1.651265e-05
+PIC.Core.CS501LBA.LBA_SPARSE_ODD.LBA_10_90.delay.Y                = 1.651265e-05
+PIC.Core.CS501LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.CS501LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.CS501LBA.LBA_SPARSE_ODD.LBA_30_90.delay.X                = 1.651265e-05
+PIC.Core.CS501LBA.LBA_SPARSE_ODD.LBA_30_90.delay.Y                = 1.651265e-05
+PIC.Core.RS106LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.RS106LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.RS106LBA.LBA_SPARSE_ODD.LBA_10_70.delay.X                = 0.000000e+00
+PIC.Core.RS106LBA.LBA_SPARSE_ODD.LBA_10_70.delay.Y                = 0.000000e+00
+PIC.Core.RS106LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.RS106LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.RS106LBA.LBA_SPARSE_ODD.LBA_30_70.delay.X                = 0.000000e+00
+PIC.Core.RS106LBA.LBA_SPARSE_ODD.LBA_30_70.delay.Y                = 0.000000e+00
+PIC.Core.RS106LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.RS106LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.RS106LBA.LBA_SPARSE_ODD.LBA_10_90.delay.X                = 0.000000e+00
+PIC.Core.RS106LBA.LBA_SPARSE_ODD.LBA_10_90.delay.Y                = 0.000000e+00
+PIC.Core.RS106LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.RS106LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.RS106LBA.LBA_SPARSE_ODD.LBA_30_90.delay.X                = 0.000000e+00
+PIC.Core.RS106LBA.LBA_SPARSE_ODD.LBA_30_90.delay.Y                = 0.000000e+00
+PIC.Core.RS205LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.RS205LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.RS205LBA.LBA_SPARSE_ODD.LBA_10_70.delay.X                = 0.000000e+00
+PIC.Core.RS205LBA.LBA_SPARSE_ODD.LBA_10_70.delay.Y                = 0.000000e+00
+PIC.Core.RS205LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.RS205LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.RS205LBA.LBA_SPARSE_ODD.LBA_30_70.delay.X                = 0.000000e+00
+PIC.Core.RS205LBA.LBA_SPARSE_ODD.LBA_30_70.delay.Y                = 0.000000e+00
+PIC.Core.RS205LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.RS205LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.RS205LBA.LBA_SPARSE_ODD.LBA_10_90.delay.X                = 0.000000e+00
+PIC.Core.RS205LBA.LBA_SPARSE_ODD.LBA_10_90.delay.Y                = 0.000000e+00
+PIC.Core.RS205LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.RS205LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.RS205LBA.LBA_SPARSE_ODD.LBA_30_90.delay.X                = 0.000000e+00
+PIC.Core.RS205LBA.LBA_SPARSE_ODD.LBA_30_90.delay.Y                = 0.000000e+00
+PIC.Core.RS208LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.RS208LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.RS208LBA.LBA_SPARSE_ODD.LBA_10_70.delay.X                = 0.000000e+00
+PIC.Core.RS208LBA.LBA_SPARSE_ODD.LBA_10_70.delay.Y                = 0.000000e+00
+PIC.Core.RS208LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.RS208LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.RS208LBA.LBA_SPARSE_ODD.LBA_30_70.delay.X                = 0.000000e+00
+PIC.Core.RS208LBA.LBA_SPARSE_ODD.LBA_30_70.delay.Y                = 0.000000e+00
+PIC.Core.RS208LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.RS208LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.RS208LBA.LBA_SPARSE_ODD.LBA_10_90.delay.X                = 0.000000e+00
+PIC.Core.RS208LBA.LBA_SPARSE_ODD.LBA_10_90.delay.Y                = 0.000000e+00
+PIC.Core.RS208LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.RS208LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.RS208LBA.LBA_SPARSE_ODD.LBA_30_90.delay.X                = 0.000000e+00
+PIC.Core.RS208LBA.LBA_SPARSE_ODD.LBA_30_90.delay.Y                = 0.000000e+00
+PIC.Core.RS210LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.RS210LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.RS210LBA.LBA_SPARSE_ODD.LBA_10_70.delay.X                = 0.000000e+00
+PIC.Core.RS210LBA.LBA_SPARSE_ODD.LBA_10_70.delay.Y                = 0.000000e+00
+PIC.Core.RS210LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.RS210LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.RS210LBA.LBA_SPARSE_ODD.LBA_30_70.delay.X                = 0.000000e+00
+PIC.Core.RS210LBA.LBA_SPARSE_ODD.LBA_30_70.delay.Y                = 0.000000e+00
+PIC.Core.RS210LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.RS210LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.RS210LBA.LBA_SPARSE_ODD.LBA_10_90.delay.X                = 0.000000e+00
+PIC.Core.RS210LBA.LBA_SPARSE_ODD.LBA_10_90.delay.Y                = 0.000000e+00
+PIC.Core.RS210LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.RS210LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.RS210LBA.LBA_SPARSE_ODD.LBA_30_90.delay.X                = 0.000000e+00
+PIC.Core.RS210LBA.LBA_SPARSE_ODD.LBA_30_90.delay.Y                = 0.000000e+00
+PIC.Core.RS305LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.RS305LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.RS305LBA.LBA_SPARSE_ODD.LBA_10_70.delay.X                = 0.000000e+00
+PIC.Core.RS305LBA.LBA_SPARSE_ODD.LBA_10_70.delay.Y                = 0.000000e+00
+PIC.Core.RS305LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.RS305LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.RS305LBA.LBA_SPARSE_ODD.LBA_30_70.delay.X                = 0.000000e+00
+PIC.Core.RS305LBA.LBA_SPARSE_ODD.LBA_30_70.delay.Y                = 0.000000e+00
+PIC.Core.RS305LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.RS305LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.RS305LBA.LBA_SPARSE_ODD.LBA_10_90.delay.X                = 0.000000e+00
+PIC.Core.RS305LBA.LBA_SPARSE_ODD.LBA_10_90.delay.Y                = 0.000000e+00
+PIC.Core.RS305LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.RS305LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.RS305LBA.LBA_SPARSE_ODD.LBA_30_90.delay.X                = 0.000000e+00
+PIC.Core.RS305LBA.LBA_SPARSE_ODD.LBA_30_90.delay.Y                = 0.000000e+00
+PIC.Core.RS306LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.RS306LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.RS306LBA.LBA_SPARSE_ODD.LBA_10_70.delay.X                = 0.000000e+00
+PIC.Core.RS306LBA.LBA_SPARSE_ODD.LBA_10_70.delay.Y                = 0.000000e+00
+PIC.Core.RS306LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.RS306LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.RS306LBA.LBA_SPARSE_ODD.LBA_30_70.delay.X                = 0.000000e+00
+PIC.Core.RS306LBA.LBA_SPARSE_ODD.LBA_30_70.delay.Y                = 0.000000e+00
+PIC.Core.RS306LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.RS306LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.RS306LBA.LBA_SPARSE_ODD.LBA_10_90.delay.X                = 0.000000e+00
+PIC.Core.RS306LBA.LBA_SPARSE_ODD.LBA_10_90.delay.Y                = 0.000000e+00
+PIC.Core.RS306LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.RS306LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.RS306LBA.LBA_SPARSE_ODD.LBA_30_90.delay.X                = 0.000000e+00
+PIC.Core.RS306LBA.LBA_SPARSE_ODD.LBA_30_90.delay.Y                = 0.000000e+00
+PIC.Core.RS307LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.RS307LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.RS307LBA.LBA_SPARSE_ODD.LBA_10_70.delay.X                = 0.000000e+00
+PIC.Core.RS307LBA.LBA_SPARSE_ODD.LBA_10_70.delay.Y                = 0.000000e+00
+PIC.Core.RS307LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.RS307LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.RS307LBA.LBA_SPARSE_ODD.LBA_30_70.delay.X                = 0.000000e+00
+PIC.Core.RS307LBA.LBA_SPARSE_ODD.LBA_30_70.delay.Y                = 0.000000e+00
+PIC.Core.RS307LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.RS307LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.RS307LBA.LBA_SPARSE_ODD.LBA_10_90.delay.X                = 0.000000e+00
+PIC.Core.RS307LBA.LBA_SPARSE_ODD.LBA_10_90.delay.Y                = 0.000000e+00
+PIC.Core.RS307LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.RS307LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.RS307LBA.LBA_SPARSE_ODD.LBA_30_90.delay.X                = 0.000000e+00
+PIC.Core.RS307LBA.LBA_SPARSE_ODD.LBA_30_90.delay.Y                = 0.000000e+00
+PIC.Core.RS310LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.RS310LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.RS310LBA.LBA_SPARSE_ODD.LBA_10_70.delay.X                = 0.000000e+00
+PIC.Core.RS310LBA.LBA_SPARSE_ODD.LBA_10_70.delay.Y                = 0.000000e+00
+PIC.Core.RS310LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.RS310LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.RS310LBA.LBA_SPARSE_ODD.LBA_30_70.delay.X                = 0.000000e+00
+PIC.Core.RS310LBA.LBA_SPARSE_ODD.LBA_30_70.delay.Y                = 0.000000e+00
+PIC.Core.RS310LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.RS310LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.RS310LBA.LBA_SPARSE_ODD.LBA_10_90.delay.X                = 0.000000e+00
+PIC.Core.RS310LBA.LBA_SPARSE_ODD.LBA_10_90.delay.Y                = 0.000000e+00
+PIC.Core.RS310LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.RS310LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.RS310LBA.LBA_SPARSE_ODD.LBA_30_90.delay.X                = 0.000000e+00
+PIC.Core.RS310LBA.LBA_SPARSE_ODD.LBA_30_90.delay.Y                = 0.000000e+00
+PIC.Core.RS406LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.RS406LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.RS406LBA.LBA_SPARSE_ODD.LBA_10_70.delay.X                = 0.000000e+00
+PIC.Core.RS406LBA.LBA_SPARSE_ODD.LBA_10_70.delay.Y                = 0.000000e+00
+PIC.Core.RS406LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.RS406LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.RS406LBA.LBA_SPARSE_ODD.LBA_30_70.delay.X                = 0.000000e+00
+PIC.Core.RS406LBA.LBA_SPARSE_ODD.LBA_30_70.delay.Y                = 0.000000e+00
+PIC.Core.RS406LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.RS406LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.RS406LBA.LBA_SPARSE_ODD.LBA_10_90.delay.X                = 0.000000e+00
+PIC.Core.RS406LBA.LBA_SPARSE_ODD.LBA_10_90.delay.Y                = 0.000000e+00
+PIC.Core.RS406LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.RS406LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.RS406LBA.LBA_SPARSE_ODD.LBA_30_90.delay.X                = 0.000000e+00
+PIC.Core.RS406LBA.LBA_SPARSE_ODD.LBA_30_90.delay.Y                = 0.000000e+00
+PIC.Core.RS407LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.RS407LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.RS407LBA.LBA_SPARSE_ODD.LBA_10_70.delay.X                = 0.000000e+00
+PIC.Core.RS407LBA.LBA_SPARSE_ODD.LBA_10_70.delay.Y                = 0.000000e+00
+PIC.Core.RS407LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.RS407LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.RS407LBA.LBA_SPARSE_ODD.LBA_30_70.delay.X                = 0.000000e+00
+PIC.Core.RS407LBA.LBA_SPARSE_ODD.LBA_30_70.delay.Y                = 0.000000e+00
+PIC.Core.RS407LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.RS407LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.RS407LBA.LBA_SPARSE_ODD.LBA_10_90.delay.X                = 0.000000e+00
+PIC.Core.RS407LBA.LBA_SPARSE_ODD.LBA_10_90.delay.Y                = 0.000000e+00
+PIC.Core.RS407LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.RS407LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.RS407LBA.LBA_SPARSE_ODD.LBA_30_90.delay.X                = 0.000000e+00
+PIC.Core.RS407LBA.LBA_SPARSE_ODD.LBA_30_90.delay.Y                = 0.000000e+00
+PIC.Core.RS409LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.RS409LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.RS409LBA.LBA_SPARSE_ODD.LBA_10_70.delay.X                = 0.000000e+00
+PIC.Core.RS409LBA.LBA_SPARSE_ODD.LBA_10_70.delay.Y                = 0.000000e+00
+PIC.Core.RS409LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.RS409LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.RS409LBA.LBA_SPARSE_ODD.LBA_30_70.delay.X                = 0.000000e+00
+PIC.Core.RS409LBA.LBA_SPARSE_ODD.LBA_30_70.delay.Y                = 0.000000e+00
+PIC.Core.RS409LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.RS409LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.RS409LBA.LBA_SPARSE_ODD.LBA_10_90.delay.X                = 0.000000e+00
+PIC.Core.RS409LBA.LBA_SPARSE_ODD.LBA_10_90.delay.Y                = 0.000000e+00
+PIC.Core.RS409LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.RS409LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.RS409LBA.LBA_SPARSE_ODD.LBA_30_90.delay.X                = 0.000000e+00
+PIC.Core.RS409LBA.LBA_SPARSE_ODD.LBA_30_90.delay.Y                = 0.000000e+00
+PIC.Core.RS503LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.RS503LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.RS503LBA.LBA_SPARSE_ODD.LBA_10_70.delay.X                = 0.000000e+00
+PIC.Core.RS503LBA.LBA_SPARSE_ODD.LBA_10_70.delay.Y                = 0.000000e+00
+PIC.Core.RS503LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.RS503LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.RS503LBA.LBA_SPARSE_ODD.LBA_30_70.delay.X                = 0.000000e+00
+PIC.Core.RS503LBA.LBA_SPARSE_ODD.LBA_30_70.delay.Y                = 0.000000e+00
+PIC.Core.RS503LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.RS503LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.RS503LBA.LBA_SPARSE_ODD.LBA_10_90.delay.X                = 0.000000e+00
+PIC.Core.RS503LBA.LBA_SPARSE_ODD.LBA_10_90.delay.Y                = 0.000000e+00
+PIC.Core.RS503LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.RS503LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.RS503LBA.LBA_SPARSE_ODD.LBA_30_90.delay.X                = 0.000000e+00
+PIC.Core.RS503LBA.LBA_SPARSE_ODD.LBA_30_90.delay.Y                = 0.000000e+00
+PIC.Core.RS508LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.RS508LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.RS508LBA.LBA_SPARSE_ODD.LBA_10_70.delay.X                = 0.000000e+00
+PIC.Core.RS508LBA.LBA_SPARSE_ODD.LBA_10_70.delay.Y                = 0.000000e+00
+PIC.Core.RS508LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.RS508LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.RS508LBA.LBA_SPARSE_ODD.LBA_30_70.delay.X                = 0.000000e+00
+PIC.Core.RS508LBA.LBA_SPARSE_ODD.LBA_30_70.delay.Y                = 0.000000e+00
+PIC.Core.RS508LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.RS508LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.RS508LBA.LBA_SPARSE_ODD.LBA_10_90.delay.X                = 0.000000e+00
+PIC.Core.RS508LBA.LBA_SPARSE_ODD.LBA_10_90.delay.Y                = 0.000000e+00
+PIC.Core.RS508LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.RS508LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.RS508LBA.LBA_SPARSE_ODD.LBA_30_90.delay.X                = 0.000000e+00
+PIC.Core.RS508LBA.LBA_SPARSE_ODD.LBA_30_90.delay.Y                = 0.000000e+00
+PIC.Core.RS509LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.RS509LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.RS509LBA.LBA_SPARSE_ODD.LBA_10_70.delay.X                = 0.000000e+00
+PIC.Core.RS509LBA.LBA_SPARSE_ODD.LBA_10_70.delay.Y                = 0.000000e+00
+PIC.Core.RS509LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.RS509LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.RS509LBA.LBA_SPARSE_ODD.LBA_30_70.delay.X                = 0.000000e+00
+PIC.Core.RS509LBA.LBA_SPARSE_ODD.LBA_30_70.delay.Y                = 0.000000e+00
+PIC.Core.RS509LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.RS509LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.RS509LBA.LBA_SPARSE_ODD.LBA_10_90.delay.X                = 0.000000e+00
+PIC.Core.RS509LBA.LBA_SPARSE_ODD.LBA_10_90.delay.Y                = 0.000000e+00
+PIC.Core.RS509LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.RS509LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.RS509LBA.LBA_SPARSE_ODD.LBA_30_90.delay.X                = 0.000000e+00
+PIC.Core.RS509LBA.LBA_SPARSE_ODD.LBA_30_90.delay.Y                = 0.000000e+00
+PIC.Core.DE601LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.DE601LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.DE601LBA.LBA_SPARSE_ODD.LBA_10_70.delay.X                = 0.000000e+00
+PIC.Core.DE601LBA.LBA_SPARSE_ODD.LBA_10_70.delay.Y                = 0.000000e+00
+PIC.Core.DE601LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.DE601LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.DE601LBA.LBA_SPARSE_ODD.LBA_30_70.delay.X                = 0.000000e+00
+PIC.Core.DE601LBA.LBA_SPARSE_ODD.LBA_30_70.delay.Y                = 0.000000e+00
+PIC.Core.DE601LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.DE601LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.DE601LBA.LBA_SPARSE_ODD.LBA_10_90.delay.X                = 0.000000e+00
+PIC.Core.DE601LBA.LBA_SPARSE_ODD.LBA_10_90.delay.Y                = 0.000000e+00
+PIC.Core.DE601LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.DE601LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.DE601LBA.LBA_SPARSE_ODD.LBA_30_90.delay.X                = 0.000000e+00
+PIC.Core.DE601LBA.LBA_SPARSE_ODD.LBA_30_90.delay.Y                = 0.000000e+00
+PIC.Core.DE602LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.DE602LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.DE602LBA.LBA_SPARSE_ODD.LBA_10_70.delay.X                = 0.000000e+00
+PIC.Core.DE602LBA.LBA_SPARSE_ODD.LBA_10_70.delay.Y                = 0.000000e+00
+PIC.Core.DE602LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.DE602LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.DE602LBA.LBA_SPARSE_ODD.LBA_30_70.delay.X                = 0.000000e+00
+PIC.Core.DE602LBA.LBA_SPARSE_ODD.LBA_30_70.delay.Y                = 0.000000e+00
+PIC.Core.DE602LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.DE602LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.DE602LBA.LBA_SPARSE_ODD.LBA_10_90.delay.X                = 0.000000e+00
+PIC.Core.DE602LBA.LBA_SPARSE_ODD.LBA_10_90.delay.Y                = 0.000000e+00
+PIC.Core.DE602LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.DE602LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.DE602LBA.LBA_SPARSE_ODD.LBA_30_90.delay.X                = 0.000000e+00
+PIC.Core.DE602LBA.LBA_SPARSE_ODD.LBA_30_90.delay.Y                = 0.000000e+00
+PIC.Core.DE603LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.DE603LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.DE603LBA.LBA_SPARSE_ODD.LBA_10_70.delay.X                = 0.000000e+00
+PIC.Core.DE603LBA.LBA_SPARSE_ODD.LBA_10_70.delay.Y                = 0.000000e+00
+PIC.Core.DE603LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.DE603LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.DE603LBA.LBA_SPARSE_ODD.LBA_30_70.delay.X                = 0.000000e+00
+PIC.Core.DE603LBA.LBA_SPARSE_ODD.LBA_30_70.delay.Y                = 0.000000e+00
+PIC.Core.DE603LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.DE603LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.DE603LBA.LBA_SPARSE_ODD.LBA_10_90.delay.X                = 0.000000e+00
+PIC.Core.DE603LBA.LBA_SPARSE_ODD.LBA_10_90.delay.Y                = 0.000000e+00
+PIC.Core.DE603LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.DE603LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.DE603LBA.LBA_SPARSE_ODD.LBA_30_90.delay.X                = 0.000000e+00
+PIC.Core.DE603LBA.LBA_SPARSE_ODD.LBA_30_90.delay.Y                = 0.000000e+00
+PIC.Core.DE604LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.DE604LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.DE604LBA.LBA_SPARSE_ODD.LBA_10_70.delay.X                = 0.000000e+00
+PIC.Core.DE604LBA.LBA_SPARSE_ODD.LBA_10_70.delay.Y                = 0.000000e+00
+PIC.Core.DE604LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.DE604LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.DE604LBA.LBA_SPARSE_ODD.LBA_30_70.delay.X                = 0.000000e+00
+PIC.Core.DE604LBA.LBA_SPARSE_ODD.LBA_30_70.delay.Y                = 0.000000e+00
+PIC.Core.DE604LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.DE604LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.DE604LBA.LBA_SPARSE_ODD.LBA_10_90.delay.X                = 0.000000e+00
+PIC.Core.DE604LBA.LBA_SPARSE_ODD.LBA_10_90.delay.Y                = 0.000000e+00
+PIC.Core.DE604LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.DE604LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.DE604LBA.LBA_SPARSE_ODD.LBA_30_90.delay.X                = 0.000000e+00
+PIC.Core.DE604LBA.LBA_SPARSE_ODD.LBA_30_90.delay.Y                = 0.000000e+00
+PIC.Core.DE605LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.DE605LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.DE605LBA.LBA_SPARSE_ODD.LBA_10_70.delay.X                = 0.000000e+00
+PIC.Core.DE605LBA.LBA_SPARSE_ODD.LBA_10_70.delay.Y                = 0.000000e+00
+PIC.Core.DE605LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.DE605LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.DE605LBA.LBA_SPARSE_ODD.LBA_30_70.delay.X                = 0.000000e+00
+PIC.Core.DE605LBA.LBA_SPARSE_ODD.LBA_30_70.delay.Y                = 0.000000e+00
+PIC.Core.DE605LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.DE605LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.DE605LBA.LBA_SPARSE_ODD.LBA_10_90.delay.X                = 0.000000e+00
+PIC.Core.DE605LBA.LBA_SPARSE_ODD.LBA_10_90.delay.Y                = 0.000000e+00
+PIC.Core.DE605LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.DE605LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.DE605LBA.LBA_SPARSE_ODD.LBA_30_90.delay.X                = 0.000000e+00
+PIC.Core.DE605LBA.LBA_SPARSE_ODD.LBA_30_90.delay.Y                = 0.000000e+00
+PIC.Core.FR606LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.FR606LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.FR606LBA.LBA_SPARSE_ODD.LBA_10_70.delay.X                = 0.000000e+00
+PIC.Core.FR606LBA.LBA_SPARSE_ODD.LBA_10_70.delay.Y                = 0.000000e+00
+PIC.Core.FR606LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.FR606LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.FR606LBA.LBA_SPARSE_ODD.LBA_30_70.delay.X                = 0.000000e+00
+PIC.Core.FR606LBA.LBA_SPARSE_ODD.LBA_30_70.delay.Y                = 0.000000e+00
+PIC.Core.FR606LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.FR606LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.FR606LBA.LBA_SPARSE_ODD.LBA_10_90.delay.X                = 0.000000e+00
+PIC.Core.FR606LBA.LBA_SPARSE_ODD.LBA_10_90.delay.Y                = 0.000000e+00
+PIC.Core.FR606LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.FR606LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.FR606LBA.LBA_SPARSE_ODD.LBA_30_90.delay.X                = 0.000000e+00
+PIC.Core.FR606LBA.LBA_SPARSE_ODD.LBA_30_90.delay.Y                = 0.000000e+00
+PIC.Core.SE607LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.SE607LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.SE607LBA.LBA_SPARSE_ODD.LBA_10_70.delay.X                = 0.000000e+00
+PIC.Core.SE607LBA.LBA_SPARSE_ODD.LBA_10_70.delay.Y                = 0.000000e+00
+PIC.Core.SE607LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.SE607LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.SE607LBA.LBA_SPARSE_ODD.LBA_30_70.delay.X                = 0.000000e+00
+PIC.Core.SE607LBA.LBA_SPARSE_ODD.LBA_30_70.delay.Y                = 0.000000e+00
+PIC.Core.SE607LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.SE607LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.SE607LBA.LBA_SPARSE_ODD.LBA_10_90.delay.X                = 0.000000e+00
+PIC.Core.SE607LBA.LBA_SPARSE_ODD.LBA_10_90.delay.Y                = 0.000000e+00
+PIC.Core.SE607LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.SE607LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.SE607LBA.LBA_SPARSE_ODD.LBA_30_90.delay.X                = 0.000000e+00
+PIC.Core.SE607LBA.LBA_SPARSE_ODD.LBA_30_90.delay.Y                = 0.000000e+00
+PIC.Core.UK608LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.X               = 0.000000e+00
+PIC.Core.UK608LBA.LBA_SPARSE_ODD.LBA_10_70.phase0.Y               = 0.000000e+00
+PIC.Core.UK608LBA.LBA_SPARSE_ODD.LBA_10_70.delay.X                = 0.000000e+00
+PIC.Core.UK608LBA.LBA_SPARSE_ODD.LBA_10_70.delay.Y                = 0.000000e+00
+PIC.Core.UK608LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.X               = 0.000000e+00
+PIC.Core.UK608LBA.LBA_SPARSE_ODD.LBA_30_70.phase0.Y               = 0.000000e+00
+PIC.Core.UK608LBA.LBA_SPARSE_ODD.LBA_30_70.delay.X                = 0.000000e+00
+PIC.Core.UK608LBA.LBA_SPARSE_ODD.LBA_30_70.delay.Y                = 0.000000e+00
+PIC.Core.UK608LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.X               = 0.000000e+00
+PIC.Core.UK608LBA.LBA_SPARSE_ODD.LBA_10_90.phase0.Y               = 0.000000e+00
+PIC.Core.UK608LBA.LBA_SPARSE_ODD.LBA_10_90.delay.X                = 0.000000e+00
+PIC.Core.UK608LBA.LBA_SPARSE_ODD.LBA_10_90.delay.Y                = 0.000000e+00
+PIC.Core.UK608LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.X               = 0.000000e+00
+PIC.Core.UK608LBA.LBA_SPARSE_ODD.LBA_30_90.phase0.Y               = 0.000000e+00
+PIC.Core.UK608LBA.LBA_SPARSE_ODD.LBA_30_90.delay.X                = 0.000000e+00
+PIC.Core.UK608LBA.LBA_SPARSE_ODD.LBA_30_90.delay.Y                = 0.000000e+00
diff --git a/RTCP/Cobalt/GPUProc/etc/parset-additions.d/default/StationPositions.parset b/RTCP/Cobalt/GPUProc/etc/parset-additions.d/default/StationPositions.parset
index 9f9e17c0c40abbbb58669c35a7050fd0153cdec7..cac9c4d78a3dd569dd5e0818fc33e64541c9d276 100644
--- a/RTCP/Cobalt/GPUProc/etc/parset-additions.d/default/StationPositions.parset
+++ b/RTCP/Cobalt/GPUProc/etc/parset-additions.d/default/StationPositions.parset
@@ -148,6 +148,9 @@ PIC.Core.DE609HBA.phaseCenter = [3727217.673, 655109.175, 5117003.123]
 PIC.Core.FR606LBA.phaseCenter = [4323979.809, 165608.773, 4670303.094]
 PIC.Core.FR606HBA.phaseCenter = [4324016.708, 165545.525, 4670271.363]
 
+PIC.Core.IE613LBA.phaseCenter = [3801633.528, -529021.899, 5076997.185]
+PIC.Core.IE613HBA.phaseCenter = [3801691.943, -528983.966, 5076957.924]
+
 PIC.Core.PL610LBA.phaseCenter = [3738425.932, 1148187.176, 5021750.597]
 PIC.Core.PL610HBA.phaseCenter = [3738462.416, 1148244.316, 5021710.658]
 
diff --git a/RTCP/Cobalt/GPUProc/etc/parset-additions.d/default/StationStreams.parset b/RTCP/Cobalt/GPUProc/etc/parset-additions.d/default/StationStreams.parset
index a300bea9bc7a9c69fcc459a6fc15a00398fa2141..046055700687759387ac0223036c5d33c21d03f7 100644
--- a/RTCP/Cobalt/GPUProc/etc/parset-additions.d/default/StationStreams.parset
+++ b/RTCP/Cobalt/GPUProc/etc/parset-additions.d/default/StationStreams.parset
@@ -219,6 +219,10 @@ PIC.Core.FR606HBA.RSP.ports     = [udp:10.211.1.105:16060, udp:10.212.1.105:1606
 PIC.Core.FR606HBA.RSP.receiver  = cbt005_1
 PIC.Core.FR606LBA.RSP.ports     = [udp:10.211.1.105:16060, udp:10.212.1.105:16061, udp:10.213.1.105:16062, udp:10.214.1.105:16063]
 PIC.Core.FR606LBA.RSP.receiver  = cbt005_1
+PIC.Core.IE613HBA.RSP.ports     = [udp:10.220.81.102:16130, udp:10.220.81.102:16131, udp:10.220.81.102:16132, udp:10.220.81.102:16133]
+PIC.Core.IE613HBA.RSP.receiver  = cbt002_1
+PIC.Core.IE613LBA.RSP.ports     = [udp:10.220.81.102:16130, udp:10.220.81.102:16131, udp:10.220.81.102:16132, udp:10.220.81.102:16133]
+PIC.Core.IE613LBA.RSP.receiver  = cbt002_1
 PIC.Core.PL610HBA.RSP.ports     = [udp:10.220.11.103:16100, udp:10.220.11.103:16101, udp:10.220.11.103:16102, udp:10.220.11.103:16103]
 PIC.Core.PL610HBA.RSP.receiver  = cbt003_1
 PIC.Core.PL610LBA.RSP.ports     = [udp:10.220.11.103:16100, udp:10.220.11.103:16101, udp:10.220.11.103:16102, udp:10.220.11.103:16103]
diff --git a/RTCP/Cobalt/GPUProc/etc/parset-additions.d/rspraw-enable.parset.OBSID b/RTCP/Cobalt/GPUProc/etc/parset-additions.d/rspraw-enable.parset.OBSID
new file mode 100644
index 0000000000000000000000000000000000000000..920201cb9f77d81f20975417017eaef0efa471a3
--- /dev/null
+++ b/RTCP/Cobalt/GPUProc/etc/parset-additions.d/rspraw-enable.parset.OBSID
@@ -0,0 +1,58 @@
+# rspraw-enable.parset.OBSID: override COBALT settings to enable RSP raw antenna field output
+#
+# $Id$
+
+# Basic Usage: After preparing an observation with desired station and freq settings, but before the MACScheduler
+#              starts it up (~2 mins before observation start time), run as lofarsys (!) on the COBALT head node:
+#
+#   cd /opt/lofar/etc/parset-additions.d/ && cp rspraw-enable.parset.OBSID override/rspraw-enable.parset.123456  # replace 123456 with your SAS ID
+
+# NOTE: This is a COBALT-only expert mode setting adjustment. While you really have to outstrip yourself to
+# screw up the system beyond this observation, little customization effort below is enough to screw up this observation.
+
+# By default, disable correlated and coherent stokes and incoherent stokes (processing and) output.
+# You can comment out or enable these to *also* get correlated and/or coherent stokes and/or incoherent stokes output;
+# provided that you specified all enabled settings properly.
+Observation.DataProducts.Output_Correlated.enabled=false
+Observation.DataProducts.Output_CoherentStokes.enabled=false
+Observation.DataProducts.Output_IncoherentStokes.enabled=false
+
+
+# Enable RSP raw output
+Observation.DataProducts.Output_RSPRaw.enabled=true
+
+# The following RSP raw settings are commented out by default, because then they are auto-detected from
+# correlated and/or beamformed settings, even if those are disabled just above. Feel free to customize.
+
+# Override start/stop times: Observation runs as specified, but RSP raw data is only written out for this interval.
+# The interval must be within the observation start/stop time interval.
+# Default: observation start/stop times
+#Cobalt.RSPRaw.startTime=2017-01-29 10:00:00
+#Cobalt.RSPRaw.stopTime=2017-01-29 11:00:00
+
+# Override station list: Observation uses stations as specified, but RSP raw data is only written for these stations.
+# The list must be a subset of the observation station set.
+# Default: the full set of observation stations
+#Cobalt.RSPRaw.stationList=[CS002, CS003]
+
+# Override beamlets: Observation uses beam and frequency settings as specified,
+# but RSP raw data is only written for the first N beamlets (whatever beams/subbands that corresponds to...).
+# The value is a list: one value per sending RSP board (stream) applied to all antenna fields, thus typically a list of length up to 4.
+# Each value must be within the valid range for the bit mode:
+#   16 bit: [ 61,  61,  61,  61] (thus max 244)
+#    8 bit: [122, 122, 122, 122] (thus max 488)
+#    4 bit: [244, 244, 244, 234] (thus max 966 (not 976: RSP firmware resource limitation))
+# Default: all observation beamlets
+#Cobalt.RSPRaw.nrBeamletsPerBoardList=[122, 122, 122, 122]
+
+# Override filenames and locations where RSP raw data is written to.
+# Note that the hostnames must be on the COBALT/CEP4 infiniband network (10G may also work; you may need to also override the network interface bound to...).
+# Prefer fully qualified domain names (FQDN), or CEP4:/path (per file) and the system will assign CEP4 nodes.
+# Note that you must provide (at least) enough filenames *and* locations (not either)! Typically, 4x the number of antenna fields.
+# Note that for locations, the 'CEP4:' cluster prefix can be used to auto-select CEP4 hostnames. For other output clusters specify real hostnames.
+# Default: Hostnames in locations: round robin over the set of correlated + coherent + incoherent hostnames.
+#          Default filename format: Lxxx_yyy_zzz_rsp.raw where xxx=OBS_ID, yyy=ANT_FIELD_NAME, zzz=BOARD_NR (+ Lxxx_yyy_zzz_rsp.raw.parset files).
+#Observation.DataProducts.Output_RSPRaw.filenames=[L123456_CS002HBA0_0_rsp.raw, L123456_CS002HBA0_1_rsp.raw, L123456_CS002HBA0_2_rsp.raw, L123456_CS002HBA0_3_rsp.raw, L123456_CS002HBA1_0_rsp.raw, L123456_CS002HBA1_1_rsp.raw, L123456_CS002HBA1_2_rsp.raw, L123456_CS002HBA1_3_rsp.raw, L123456_CS003HBA0_0_rsp.raw, L123456_CS003HBA0_1_rsp.raw, L123456_CS003HBA0_2_rsp.raw, L123456_CS003HBA0_3_rsp.raw, L123456_CS003HBA1_0_rsp.raw, L123456_CS003HBA1_1_rsp.raw, L123456_CS003HBA1_2_rsp.raw, L123456_CS003HBA1_3_rsp.raw]
+#Observation.DataProducts.Output_RSPRaw.locations=[CEP4:/data/projects/2017LOFAROBS/L123456/cs,CEP4:/data/projects/2017LOFAROBS/L123456/cs,CEP4:/data/projects/2017LOFAROBS/L123456/cs,CEP4:/data/projects/2017LOFAROBS/L123456/cs,CEP4:/data/projects/2017LOFAROBS/L123456/cs,CEP4:/data/projects/2017LOFAROBS/L123456/cs,CEP4:/data/projects/2017LOFAROBS/L123456/cs,CEP4:/data/projects/2017LOFAROBS/L123456/cs]
+#Observation.DataProducts.Output_RSPRaw.storageClusterName=CEP4
+
diff --git a/RTCP/Cobalt/GPUProc/src/CMakeLists.txt b/RTCP/Cobalt/GPUProc/src/CMakeLists.txt
index 6c839a1c517b4a8f848166c1f2bc467c815f1cae..fbc4e762035d4ad5f105eecbfe579d76eba16874 100644
--- a/RTCP/Cobalt/GPUProc/src/CMakeLists.txt
+++ b/RTCP/Cobalt/GPUProc/src/CMakeLists.txt
@@ -20,6 +20,7 @@ set(_gpuproc_sources
   Station/StationNodeAllocation.cc
   Station/StationInput.cc
   Station/StationTranspose.cc
+  Station/RSPRawSender.cc
   Storage/StorageProcess.cc
   Storage/StorageProcesses.cc
 )
diff --git a/RTCP/Cobalt/GPUProc/src/MPIReceiver.h b/RTCP/Cobalt/GPUProc/src/MPIReceiver.h
index 4ca0040b42522a00335d73d36c292e226c51247d..eeccb9516c7602f42c0b8183376b48cfb883f819 100644
--- a/RTCP/Cobalt/GPUProc/src/MPIReceiver.h
+++ b/RTCP/Cobalt/GPUProc/src/MPIReceiver.h
@@ -21,8 +21,8 @@
 // \file
 // Include for processor optimalizetion functionality
 
-#ifndef LOFAR_GPUPROC_MPI_UTILS_H
-#define LOFAR_GPUPROC_MPI_UTILS_H
+#ifndef LOFAR_GPUPROC_MPI_RECEIVER_H
+#define LOFAR_GPUPROC_MPI_RECEIVER_H
 
 #include <InputProc/Transpose/MPIUtil.h>
 #include <InputProc/SampleType.h>
diff --git a/RTCP/Cobalt/GPUProc/src/Station/RSPRawSender.cc b/RTCP/Cobalt/GPUProc/src/Station/RSPRawSender.cc
new file mode 100644
index 0000000000000000000000000000000000000000..8caeddd04b95050310b510fc18f0a744b32267b7
--- /dev/null
+++ b/RTCP/Cobalt/GPUProc/src/Station/RSPRawSender.cc
@@ -0,0 +1,211 @@
+//# RSPRawSender.cc: Sender for RSP raw output
+//# Copyright (C) 2017  ASTRON (Netherlands Institute for Radio Astronomy)
+//# P.O. Box 2, 7990 AA Dwingeloo, The Netherlands
+//#
+//# This file is part of the LOFAR software suite.
+//# The LOFAR software suite 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 3 of the License, or
+//# (at your option) any later version.
+//#
+//# The LOFAR software suite 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 the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
+//#
+//# $Id$
+
+#include <lofar_config.h>
+
+#include "RSPRawSender.h"
+
+#include <cstring>
+#include <fcntl.h>
+#include <sys/socket.h>
+#include <utility> // std::swap()
+#include <Common/LofarLogger.h>
+#include <Common/SystemCallException.h>
+#include <Stream/StreamFactory.h>
+
+using namespace std;
+
+namespace LOFAR {
+  namespace Cobalt {
+
+    RSPRawSender::RSPRawSender() :
+      itsStream(NULL),
+      itsSentMsgSizes(0),
+      itsMaxNrBeamletsToSend(0),
+      itsNrDroppedPackets(0)
+    {
+    }
+
+    RSPRawSender::RSPRawSender(unsigned maxNrPacketsPerTrySend, unsigned maxNrBeamletsToSend,
+                               const string& streamDesc, time_t deadline) :
+      itsStream(createStream(streamDesc, false, deadline)),
+      itsSentMsgSizes(maxNrPacketsPerTrySend), // trySend() in hot code: pre-allocate is easy and acceptable
+      itsMaxNrBeamletsToSend(maxNrBeamletsToSend),
+      itsNrDroppedPackets(0)
+    {
+      ASSERTSTR(maxNrPacketsPerTrySend > 0, "maxNrPacketsPerTrySend must be > 0");
+
+      // In RT mode InputProc threads may not block. Prefer not sent (i.e. dropped) packets.
+      if (deadline != 0) {
+        FileDescriptorBasedStream *fdStream = dynamic_cast<FileDescriptorBasedStream *>(itsStream.get());
+        if (fdStream != NULL) {
+          fdStream->fcntl(F_SETFL, fdStream->fcntl(F_GETFL) | O_NONBLOCK);
+        }
+      }
+    }
+
+    RSPRawSender::~RSPRawSender()
+    {
+      try {
+        trySendPending(); // try, but it may be way too late
+      } catch (SystemCallException& ) {
+        itsNrDroppedPackets += 1; // count partially sent as dropped now
+      }
+
+      if (itsNrDroppedPackets > 0) {
+        SocketStream *sockStream = dynamic_cast<SocketStream *>(itsStream.get());
+        if (sockStream == NULL) {
+          LOG_WARN_STR("RSPRawSender: number of RSP packets not sent: " << itsNrDroppedPackets);
+        } else {
+          LOG_WARN_STR("RSPRawSender " << sockStream->getHostname() << ':' << sockStream->getPort() <<
+                       " number of RSP packets not sent: " << itsNrDroppedPackets);
+        }
+      }
+    }
+
+    bool RSPRawSender::initialized() const
+    {
+      return itsStream != NULL;
+    }
+
+    void RSPRawSender::swap(RSPRawSender& other) /*noexcept*/
+    {
+      std::swap(itsStream, other.itsStream);
+      std::swap(itsSentMsgSizes, other.itsSentMsgSizes);
+      std::swap(itsMaxNrBeamletsToSend, other.itsMaxNrBeamletsToSend);
+      std::swap(itsNrDroppedPackets, other.itsNrDroppedPackets);
+    }
+
+    unsigned RSPRawSender::getNrDroppedPackets() const
+    {
+      return itsNrDroppedPackets;
+    }
+
+    void RSPRawSender::trySend(struct RSP *packets, unsigned nrPackets)
+    {
+      ASSERTSTR(nrPackets <= itsSentMsgSizes.size(), "nrPackets > max indicated when sender was constructed");
+
+      /*
+       * Patch packet headers if we need to send only the 1st N beamlets.
+       * Note: we assume all packets (per RSP board) have the same nrBeamlets and size.
+       * If not in nrBeamlets, we may incorrectly restore some of the packet headers below...
+       * If not in size, we may append bogus (or uninit data), but struct RSP is large enough.
+       */
+      const uint8 packetNrBeamlets = packets[0].header.nrBeamlets; // save to restore
+      if (itsMaxNrBeamletsToSend < packetNrBeamlets) {
+        for (unsigned i = 0; i < nrPackets; i++) {
+          packets[i].header.nrBeamlets = itsMaxNrBeamletsToSend;
+        }
+      }
+
+      unsigned packetSize = packets[0].packetSize();
+      SocketStream *sockStream = dynamic_cast<SocketStream *>(itsStream.get());
+      try {
+        if (sockStream != NULL && sockStream->protocol == SocketStream::UDP) {
+          trySendUdp(sockStream, packets, packetSize, nrPackets);
+        } else { // no SocketStream or SocketStream::TCP
+          trySendByteStream(packets, packetSize, nrPackets);
+        }
+      } catch (SystemCallException& exc) {
+        itsNrDroppedPackets += nrPackets;
+        if (exc.error == EAGAIN || exc.error == EWOULDBLOCK) {
+          LOG_WARN("RSPRawSender: sent fewer packets than requested to avoid blocking");
+        } else {
+          static bool errorSeen; // C++11: wrap into std::atomic, use mem order relaxed
+          if (!errorSeen) {
+            errorSeen = true;
+            SocketStream *sockStream = dynamic_cast<SocketStream *>(itsStream.get());
+            if (sockStream == NULL) {
+              LOG_ERROR_STR("RSPRawSender: " << exc.what()); // backtrace not useful here
+            } else {
+              LOG_ERROR_STR("RSPRawSender: stream: " << sockStream->getHostname() <<
+                            ':' << sockStream->getPort() << ' ' << exc.what()); // idem
+            }
+          }
+        }
+      }
+
+      if (itsMaxNrBeamletsToSend < packetNrBeamlets) {
+        for (unsigned i = 0; i < nrPackets; i++) {
+          packets[i].header.nrBeamlets = packetNrBeamlets; // restore
+        }
+      }
+    }
+
+    void RSPRawSender::trySendUdp(SocketStream *sockStream, struct RSP *packets,
+                                  unsigned packetSize, unsigned nrPackets)
+    {
+      /*
+       * MSG_CONFIRM: Inform link-layer to just send the data without periodic ARP probing.
+       * We haven't seen any replies (network peer doesn't send any in this case, with its downsides),
+       * but we cannot afford stalls.
+       */
+      unsigned nrSent = sockStream->sendmmsg(packets, packetSize, sizeof(struct RSP), itsSentMsgSizes, MSG_CONFIRM);
+      if (nrSent < nrPackets) { // don't check itsSentMsgSizes: resending remainders won't help with UDP (message oriented)
+        itsNrDroppedPackets += nrPackets - nrSent;
+        LOG_WARN("RSPRawSender::trySendUdp(): fewer sent to avoid blocking"); // not retried, not even in non-RT...
+      }
+    }
+
+    void RSPRawSender::trySendByteStream(struct RSP *packets, unsigned packetSize, unsigned nrPackets)
+    {
+      // With TCP we must avoid partial RSP frame transfer. Try sending any remaining data of 1 RSP packet first.
+      trySendPending(); // may throw
+
+      // Prepare writev(2)
+      // TODO: sendmmsg() has this too. Extract it, unify, and init iov in constructor. Bring recvmmsg() + users in line too.
+      vector<struct iovec> iov(nrPackets);
+      for (unsigned i = 0; i < nrPackets; i++) {
+        iov[i].iov_base = (char *)packets + i * sizeof(struct RSP);
+        iov[i].iov_len = packetSize;
+      }
+
+      size_t bytesSent = itsStream->tryWritev(&iov[0], nrPackets); // may throw
+      if (bytesSent < nrPackets * packetSize) {
+        // Drop, except for unsent data of partially sent packet (if so). Stash that to retry later.
+        unsigned nrSent = bytesSent / packetSize;
+        unsigned partialPacketSent = bytesSent % packetSize;
+        if (partialPacketSent != 0) {
+          LOG_WARN("RSPRawSender::trySendByteStream(): partial packet sent: will retry remainder later");
+          const char *data = (char *)iov[nrSent].iov_base + partialPacketSent;
+          size_t size = packetSize - partialPacketSent;
+          itsPendingData.resize(size);
+          std::memcpy(&itsPendingData[0], data, size);
+          nrSent += 1; // partially sent and stashed
+        }
+
+        itsNrDroppedPackets += nrPackets - nrSent;
+        LOG_WARN("RSPRawSender::trySendByteStream(): fewer sent to avoid blocking"); // not retried, not even in non-RT...
+      }
+    }
+
+    void RSPRawSender::trySendPending()
+    {
+      if (!itsPendingData.empty()) {
+        size_t bytesSent = itsStream->tryWrite(&itsPendingData[0], itsPendingData.size()); // may throw
+        size_t newSize = itsPendingData.size() - bytesSent;
+        std::memmove(&itsPendingData[0], &itsPendingData[bytesSent], newSize); // at most 8k
+        itsPendingData.resize(newSize);
+      }
+    }
+
+  } // namespace Cobalt
+} // namespace LOFAR
+
diff --git a/RTCP/Cobalt/GPUProc/src/Station/RSPRawSender.h b/RTCP/Cobalt/GPUProc/src/Station/RSPRawSender.h
new file mode 100644
index 0000000000000000000000000000000000000000..040e3ee1fcf38f8f11cbe21779d9cdae66f8f769
--- /dev/null
+++ b/RTCP/Cobalt/GPUProc/src/Station/RSPRawSender.h
@@ -0,0 +1,76 @@
+//# RSPRawSender.h: Sender for RSP raw output
+//# Copyright (C) 2017  ASTRON (Netherlands Institute for Radio Astronomy)
+//# P.O. Box 2, 7990 AA Dwingeloo, The Netherlands
+//#
+//# This file is part of the LOFAR software suite.
+//# The LOFAR software suite 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 3 of the License, or
+//# (at your option) any later version.
+//#
+//# The LOFAR software suite 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 the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
+//#
+//# $Id$
+
+#ifndef LOFAR_GPUPROC_RSPRAWSENDER_H
+#define LOFAR_GPUPROC_RSPRAWSENDER_H
+
+// \file
+// Sender for RSP raw output. Corresponding receiver: OutputProc/src/InputThread.h
+// Sender can also be used for COBALT RSP data piggy-backing.
+
+#include <ctime> // time_t
+#include <string>
+#include <Stream/SocketStream.h>
+#include <CoInterface/RSP.h>
+#include <CoInterface/SmartPtr.h>
+
+namespace LOFAR
+{
+  namespace Cobalt
+  {
+
+class RSPRawSender {
+public:
+  RSPRawSender();
+
+  // deadline is an absolute timestamp or 0 for no connection timeout (blocking).
+  RSPRawSender(unsigned maxNrPacketsPerTrySend, unsigned maxNrBeamletsToSend,
+               const std::string& streamDesc, time_t deadline = 0);
+
+  ~RSPRawSender();
+
+  bool initialized() const;
+
+  void swap(RSPRawSender& other) /*noexcept*/;
+
+  // Ensure nrPackets <= maxNrPacketsPerSend (passed upon object construction).
+  // If deadline (passed upon object construction) was non-zero, trySend() may drop packets to avoid blocking.
+  void trySend(struct RSP *packets, unsigned nrPackets);
+
+  unsigned getNrDroppedPackets() const;
+
+private:
+  void trySendUdp(SocketStream *sockStream, struct RSP *packets,
+                  unsigned packetSize, unsigned nrPackets);
+  void trySendByteStream(struct RSP *packets, unsigned packetSize, unsigned nrPackets);
+  void trySendPending();
+
+  SmartPtr<Stream> itsStream;
+  std::vector<unsigned> itsSentMsgSizes;
+  unsigned itsMaxNrBeamletsToSend;
+  unsigned itsNrDroppedPackets;
+  std::vector<unsigned char> itsPendingData; // w/ non-UDP to retry sending the remainder of a partially sent RSP packet
+};
+
+  } // namespace Cobalt
+} // namespace LOFAR
+
+#endif
+
diff --git a/RTCP/Cobalt/GPUProc/src/Station/StationInput.cc b/RTCP/Cobalt/GPUProc/src/Station/StationInput.cc
index 7d2775bec3237afd059939423d2684a78d1eaac6..bc88101ac3a450999e71435af6f5519b976cfb66 100644
--- a/RTCP/Cobalt/GPUProc/src/Station/StationInput.cc
+++ b/RTCP/Cobalt/GPUProc/src/Station/StationInput.cc
@@ -1,5 +1,5 @@
 //# StationInput.cc: Routines to manage I/O from the stations.
-//# Copyright (C) 2012-2013  ASTRON (Netherlands Institute for Radio Astronomy)
+//# Copyright (C) 2012-2013, 2017  ASTRON (Netherlands Institute for Radio Astronomy)
 //# P.O. Box 2, 7990 AA Dwingeloo, The Netherlands
 //#
 //# This file is part of the LOFAR software suite.
@@ -34,6 +34,8 @@
 #include <map>
 #include <vector>
 #include <string>
+#include <algorithm>
+#include <memory>
 #include <boost/format.hpp>
 
 #include <Common/LofarLogger.h>
@@ -53,7 +55,6 @@
 #include <InputProc/Buffer/BoardMode.h>
 #include <InputProc/Transpose/MapUtil.h>
 #include <InputProc/Delays/Delays.h>
-#include <InputProc/RSPTimeStamp.h>
 
 using namespace LOFAR;
 using namespace LOFAR::Cobalt;
@@ -149,7 +150,7 @@ namespace LOFAR {
         ASSERT(!mpiData);
 
         // Swap delay sets to accomplish delaysAtBegin = delaysAfterEnd
-        swap(delaysAtBegin, delaysAfterEnd);
+        std::swap(delaysAtBegin, delaysAfterEnd);
       }
 
       // Signal EOD
@@ -158,7 +159,8 @@ namespace LOFAR {
 
 
     StationInput::StationInput( const Parset &ps, size_t stationIdx,
-                                const SubbandDistribution &subbandDistribution )
+                                const SubbandDistribution &subbandDistribution,
+                                unsigned hostID )
     :
       ps(ps),
       stationIdx(stationIdx),
@@ -175,14 +177,21 @@ namespace LOFAR {
       targetSubbands(values(subbandDistribution)),
       beamletIndices(generateBeamletIndices())
     {
-      for (size_t i = 0; i < nrBoards; ++i) {
-        rspDataPool.push_back(new Pool<RSPData>(str(format("StationInput::rspDataPool[%u] [station %s]") % i % stationID.name()), ps.settings.realTime));
-      }
+      ASSERTSTR(nrBoards > 0, logPrefix << "No input streams");
 
       // Log all input descriptions
       LOG_INFO_STR(logPrefix << "Input streams: " << ps.settings.antennaFields.at(stationIdx).inputStreams);
 
-      ASSERTSTR(nrBoards > 0, logPrefix << "No input streams");
+      for (unsigned i = 0; i < nrBoards; ++i) {
+        rspDataPool.push_back(new Pool<RSPData>(str(format("StationInput::rspDataPool[%u] [station %s]") % i % stationID.name()),
+                                                ps.settings.realTime));
+      }
+
+      if (ps.settings.rspRaw.enabled &&
+          std::find(ps.settings.rspRaw.antennaFieldNames.begin(), ps.settings.rspRaw.antennaFieldNames.end(),
+                    stationID.name()) != ps.settings.rspRaw.antennaFieldNames.end()) {
+        initRspRaw(hostID);
+      }
     }
 
 
@@ -211,8 +220,8 @@ namespace LOFAR {
 
         // The corresponding (board,slot) combination for that subband,
         // for this station.
-        const size_t board = ps.settings.antennaFields[stationIdx].rspBoardMap[sb];
-        const size_t slot  = ps.settings.antennaFields[stationIdx].rspSlotMap[sb];
+        const unsigned board = ps.settings.antennaFields[stationIdx].rspBoardMap[sb];
+        const unsigned slot  = ps.settings.antennaFields[stationIdx].rspSlotMap[sb];
 
         ASSERT(board < nrBoards);
         ASSERT(slot < mode.nrBeamletsPerBoard());
@@ -226,7 +235,7 @@ namespace LOFAR {
     }
 
 
-    SmartPtr<Stream> StationInput::inputStream(size_t board) const
+    SmartPtr<Stream> StationInput::inputStream(unsigned board) const
     {
       SmartPtr<Stream> stream;
 
@@ -267,7 +276,41 @@ namespace LOFAR {
     }
 
 
-    void StationInput::readRSPRealTime( size_t board, MACIO::RTmetadata &mdLogger,
+    void StationInput::initRspRaw(unsigned hostID)
+    {
+      unsigned maxNrPacketsToSend = NONRT_PACKET_BATCH_SIZE;
+      time_t connTimeout = 0;
+      if (ps.settings.realTime) {
+        maxNrPacketsToSend = RT_PACKET_BATCH_SIZE;
+        connTimeout = std::time(NULL) + 3; // a few secs from now
+      }
+
+      rspRawSenders.resize(nrBoards);
+      #pragma omp parallel for num_threads(nrBoards)  // easy way to apply a single connTimeout to all
+      for (unsigned i = 0; i < nrBoards; ++i) {
+        if (ps.settings.rspRaw.nrBeamletsPerBoardList.at(i) == 0) {
+          continue;
+        }
+
+        unsigned fileIdx = ps.getRSPRawOutputStreamIdx(stationID.name(), i);
+// TODO: produce UDP stream descriptor for piggy backing instead of TCP for RSP raw storage
+        string desc = getStreamDescriptorBetweenIONandStorage(ps, RSP_RAW_DATA, fileIdx,
+                hostID < ps.settings.nodes.size() ? ps.settings.nodes[hostID].out_nic : "");
+        LOG_INFO_STR(logPrefix << "Opening RSP raw output stream for data from antenna field " <<
+                     stationID.name() << " board " << i << " with stream descriptor " << desc);
+
+        try {
+          RSPRawSender rspRawSender(maxNrPacketsToSend, ps.settings.rspRaw.nrBeamletsPerBoardList[i],
+                                    desc, connTimeout);
+          rspRawSenders[i].swap(rspRawSender); // swap into place (no need for vector of smart ptrs pre-C++11)
+        } catch (Exception &exc) { // TimeOutException, SystemCallException
+          LOG_ERROR_STR(logPrefix << "RSPRawSender creation failure for stream " << desc << ": " << exc);
+        }
+      }
+    }
+
+
+    void StationInput::readRSPRealTime( unsigned board, MACIO::RTmetadata &mdLogger,
                                         const string &mdKeyPrefix )
     {
       /*
@@ -345,7 +388,7 @@ namespace LOFAR {
       } else {
         // One core can't handle the load, so use multiple
     #   pragma omp parallel for num_threads(nrBoards)
-        for (size_t board = 0; board < nrBoards; board++) {
+        for (unsigned board = 0; board < nrBoards; board++) {
           //NSTimer copyRSPTimer(str(format("%s [board %i] copy RSP -> block") % logPrefix % board), true, true);
           OMPThread::ScopedName sn(str(format("%s wr %u") % ps.settings.antennaFields.at(stationIdx).name % board));
 
@@ -361,25 +404,44 @@ namespace LOFAR {
             // Write valid packets to the current and/or next packet
             //copyRSPTimer.start();
 
-            for (size_t p = 0; p < RT_PACKET_BATCH_SIZE; ++p) {
-              struct RSP &packet = rspData->packets[p];
+            if (ps.settings.correlator.enabled || ps.settings.beamFormer.enabled) {
+              for (unsigned p = 0; p < RT_PACKET_BATCH_SIZE; ++p) {
+                struct RSP &packet = rspData->packets[p];
 
-              if (packet.payloadError())
-                continue;
+                if (packet.payloadError())
+                  continue;
 
-              if (current.write(packet, beamletIndices, nrBeamletIndices)
-               && next) {
-                // We have data (potentially) spilling into `next'.
+                if (current.write(packet, beamletIndices, nrBeamletIndices) && next) {
+                  // We have data (potentially) spilling into `next'.
 
-                if (next->write(packet, beamletIndices, nrBeamletIndices)) {
-	          // Only emit log lines every minute seconds to prevent spam
-                  if (loggedSeenFutureData + mode.secondsToSamples(60) < now) {
-                    LOG_ERROR_STR(logPrefix << "Received data for several blocks into the future -- discarding.");
-                    loggedSeenFutureData = now;
+                  if (next->write(packet, beamletIndices, nrBeamletIndices)) {
+	                // Only emit log lines every minute seconds to prevent spam
+                    if (loggedSeenFutureData + mode.secondsToSamples(60) < now) {
+                      LOG_ERROR_STR(logPrefix << "Received data for several blocks into the future -- discarding.");
+                      loggedSeenFutureData = now;
+                    }
                   }
                 }
               }
             }
+
+            if (!rspRawSenders.empty() && rspRawSenders[board].initialized()) {
+              // Quick check on timestamp
+              // Don't cater for out-of-order input: the extra logic is not worth the benefit.
+              // We may not always get all RT_PACKET_BATCH_SIZE. PacketReader sets payloadError and 
+              // timestamp as invalid in remaining entries. Such timestamps are filtered here too.
+              unsigned nrPackets = RT_PACKET_BATCH_SIZE;
+              for (unsigned p = 0; p < nrPackets; p++) {
+                if (rspData->packets[p].header.timestamp >= ps.settings.rspRaw.stopTime ||
+                    rspData->packets[p].header.timestamp <  ps.settings.rspRaw.startTime) {
+                  nrPackets = p;
+                  break;
+                }
+              }
+              if (nrPackets > 0) {
+                rspRawSenders[board].trySend(&rspData->packets[0], nrPackets);
+              }
+            }
             //copyRSPTimer.stop();
 
             outputQueue.append(rspData);
@@ -415,7 +477,7 @@ namespace LOFAR {
       vector<bool> read_next_packet(nrBoards, true);
 
       for(;;) {
-        for(size_t board = 0; board < nrBoards; board++) {
+        for (unsigned board = 0; board < nrBoards; board++) {
           if (!read_next_packet[board] || !readers[board])
             continue;
 
@@ -433,18 +495,18 @@ namespace LOFAR {
         }
 
         // Determine which board provided the youngest packet
-        int youngest = -1;
+        unsigned youngest = nrBoards; // init to special (invalid) value
 
-        for (size_t board = 0; board < nrBoards; board++) {
+        for (unsigned board = 0; board < nrBoards; board++) {
           if (!readers[board])
             continue;
 
-          if (youngest == -1 || last_packets[youngest].timeStamp() > last_packets[board].timeStamp())
+          if (youngest == nrBoards || last_packets[youngest].timeStamp() > last_packets[board].timeStamp())
             youngest = board;
         }
 
         // Break if all streams turned out to be inactive
-        if (youngest == -1)
+        if (youngest == nrBoards)
           break;
 
         // Emit youngest packet
@@ -463,8 +525,8 @@ namespace LOFAR {
 
         // Next packet should only be read from the stream we
         // emitted from
-        for(size_t board = 0; board < nrBoards; board++)
-          read_next_packet[board] = (board == (size_t)youngest);
+        for (unsigned board = 0; board < nrBoards; board++)
+          read_next_packet[board] = (board == youngest);
       }
 
       // Signal EOD by inserting a packet beyond obs end
@@ -509,13 +571,22 @@ namespace LOFAR {
 
         // Only packet 0 is used in non-rt mode
 
-        if (current.write(data->packets[0], beamletIndices, nrBeamletIndices)) {
-          // We have data (potentially) spilling into `next'.
-          if (!next || next->write(data->packets[0], beamletIndices, nrBeamletIndices)) {
-            // Data is even later than next? Put this data back for a future block.
-            rspDataPool[0]->filled.prepend(data);
-            ASSERT(!data);
-            return;
+        if (ps.settings.correlator.enabled || ps.settings.beamFormer.enabled) {
+          if (current.write(data->packets[0], beamletIndices, nrBeamletIndices)) {
+            // We have data (potentially) spilling into `next'.
+            if (!next || next->write(data->packets[0], beamletIndices, nrBeamletIndices)) {
+              // Data is even later than next? Put this data back for a future block.
+              rspDataPool[0]->filled.prepend(data);
+              ASSERT(!data);
+              return;
+            }
+          }
+        }
+
+        if (!rspRawSenders.empty() && rspRawSenders[data->board].initialized()) {
+          if (data->packets[0].header.timestamp <  ps.settings.rspRaw.stopTime &&
+              data->packets[0].header.timestamp >= ps.settings.rspRaw.startTime) {
+            rspRawSenders[data->board].trySend(&data->packets[0], NONRT_PACKET_BATCH_SIZE);
           }
         }
 
@@ -573,7 +644,7 @@ namespace LOFAR {
 
           if (ps.settings.realTime) {
             #pragma omp parallel for num_threads(nrBoards)
-            for(size_t board = 0; board < nrBoards; board++) {
+            for (unsigned board = 0; board < nrBoards; board++) {
               try {
                 OMPThreadSet::ScopedRun sr(packetReaderThreads);
                 OMPThread::ScopedName sn(str(format("%s rd %u") % ps.settings.antennaFields.at(stationIdx).name % board));
@@ -651,13 +722,13 @@ namespace LOFAR {
 
 
     template<typename SampleT> void sendInputToPipeline(const Parset &ps, 
-            size_t stationIdx, const SubbandDistribution &subbandDistribution,
+            size_t stationIdx, const SubbandDistribution &subbandDistribution, unsigned hostID,
             MACIO::RTmetadata &mdLogger, const string &mdKeyPrefix, Trigger *stopSwitch)
     {
       // sanity check: Find out if we should actual start working here.
       StationMetaData<SampleT> sm(ps, stationIdx, subbandDistribution);
 
-      StationInput si(ps, stationIdx, subbandDistribution);
+      StationInput si(ps, stationIdx, subbandDistribution, hostID);
 
       const struct StationID stationID(StationID::parseFullFieldName(
         ps.settings.antennaFields.at(stationIdx).name));
@@ -712,7 +783,8 @@ namespace LOFAR {
         {
           OMPThread::ScopedName sn(str(format("%s send") % ps.settings.antennaFields.at(stationIdx).name));
 
-          sender.sendBlocks<SampleT>( mpiQueue, sm.metaDataPool.free );
+          bool skipDataTransfers = !ps.settings.correlator.enabled && !ps.settings.beamFormer.enabled;
+          sender.sendBlocks<SampleT>( mpiQueue, sm.metaDataPool.free, skipDataTransfers );
           LOG_INFO_STR(logPrefix << "MPISender: done");
         } 
       }
@@ -721,30 +793,29 @@ namespace LOFAR {
     }
 
     void sendInputToPipeline(const Parset &ps, size_t stationIdx, 
-                             const SubbandDistribution &subbandDistribution,
+                             const SubbandDistribution &subbandDistribution, unsigned hostID,
                              MACIO::RTmetadata &mdLogger, const string &mdKeyPrefix, Trigger *stopSwitch)
     {
       switch (ps.nrBitsPerSample()) {
         default:
         case 16: 
           sendInputToPipeline< SampleType<i16complex> >(ps, stationIdx,
-                                                        subbandDistribution,
+                                                        subbandDistribution, hostID,
                                                         mdLogger, mdKeyPrefix, stopSwitch);
           break;
 
         case 8: 
           sendInputToPipeline< SampleType< i8complex> >(ps, stationIdx,
-                                                        subbandDistribution,
+                                                        subbandDistribution, hostID,
                                                         mdLogger, mdKeyPrefix, stopSwitch);
           break;
 
         case 4: 
           sendInputToPipeline< SampleType< i4complex> >(ps, stationIdx,
-                                                        subbandDistribution,
+                                                        subbandDistribution, hostID,
                                                         mdLogger, mdKeyPrefix, stopSwitch);
           break;
       }
     }
   }
 }
-
diff --git a/RTCP/Cobalt/GPUProc/src/Station/StationInput.h b/RTCP/Cobalt/GPUProc/src/Station/StationInput.h
index b3f655b4dde27fe136f5ea86a4ad4512b881ba97..6b21f4d737ee1845a4a5db53e7de312885a12845 100644
--- a/RTCP/Cobalt/GPUProc/src/Station/StationInput.h
+++ b/RTCP/Cobalt/GPUProc/src/Station/StationInput.h
@@ -1,5 +1,5 @@
 //# StationInput.h: Routines to manage I/O from the stations.
-//# Copyright (C) 2012-2013  ASTRON (Netherlands Institute for Radio Astronomy)
+//# Copyright (C) 2012-2013, 2017  ASTRON (Netherlands Institute for Radio Astronomy)
 //# P.O. Box 2, 7990 AA Dwingeloo, The Netherlands
 //#
 //# This file is part of the LOFAR software suite.
@@ -34,12 +34,13 @@
 #include <CoInterface/SubbandMetaData.h>
 #include <CoInterface/Queue.h>
 #include <CoInterface/BestEffortQueue.h>
+#include <CoInterface/RSP.h>
+#include <CoInterface/RSPTimeStamp.h>
 #include <InputProc/Buffer/StationID.h>
 #include <InputProc/Buffer/BoardMode.h>
-#include <InputProc/RSPTimeStamp.h>
-#include <InputProc/Station/RSP.h>
 
 #include "StationTranspose.h"
+#include "RSPRawSender.h"
 
 namespace LOFAR {
   namespace Cobalt {
@@ -76,7 +77,8 @@ namespace LOFAR {
     class StationInput {
     public:
       StationInput( const Parset &ps, size_t stationIdx, 
-      const SubbandDistribution &subbandDistribution );
+                    const SubbandDistribution &subbandDistribution,
+                    unsigned hostID = 0 );
 
       template <typename SampleT>
       void processInput( Queue< SmartPtr< MPIData<SampleT> > > &inputQueue, 
@@ -86,14 +88,14 @@ namespace LOFAR {
     private:
       // Each packet is expected to have 16 samples per subband, i.e. ~80 us worth of data @ 200 MHz.
       // So 512 packets is ~40 ms of data.
-      static const unsigned RT_PACKET_BATCH_SIZE = 512;
+      static const unsigned RT_PACKET_BATCH_SIZE = 512;  // RSP raw sendmmsg(2) needs this to be <= UIO_MAXIOV (1024)
 
       static const unsigned NONRT_PACKET_BATCH_SIZE = 1;
 
       // Data received from an RSP board
       struct RSPData {
         std::vector<struct RSP> packets;
-        size_t board; // annotation used in non-rt mode
+        unsigned board; // annotation used in non-rt mode
 
         RSPData(size_t numPackets):
           packets(numPackets)
@@ -109,8 +111,9 @@ namespace LOFAR {
       const std::string logPrefix;
 
       const BoardMode mode;
-      const size_t nrBoards;
-      std::vector< SmartPtr< Pool< RSPData > > > rspDataPool; // [nrboards]
+      const unsigned nrBoards;
+      std::vector< SmartPtr< Pool< RSPData > > > rspDataPool; // [nrBoards]
+      std::vector<RSPRawSender> rspRawSenders; // [nrBoards] if RSP raw enabled and the antenna field is selected, else []
 
       // Whether we emitted certain errors (to prevent log spam)
       TimeStamp loggedSeenFutureData;
@@ -125,7 +128,9 @@ namespace LOFAR {
 
       MultiDimArray<ssize_t, 2> generateBeamletIndices();
 
-      SmartPtr<Stream> inputStream(size_t board) const;
+      SmartPtr<Stream> inputStream(unsigned board) const;
+
+      void initRspRaw(unsigned hostID);
 
       /*
        * Reads data from all the station input streams, and puts their packets in rspDataPool.
@@ -145,7 +150,7 @@ namespace LOFAR {
        *
        * Read data from one board in real-time mode.
        */
-      void readRSPRealTime( size_t board, MACIO::RTmetadata &mdLogger,
+      void readRSPRealTime( unsigned board, MACIO::RTmetadata &mdLogger,
                             const std::string &mdKeyPrefix );
 
       /*
@@ -166,6 +171,7 @@ namespace LOFAR {
 
     void sendInputToPipeline(const Parset &ps, size_t stationIdx,
                              const SubbandDistribution &subbandDistribution,
+                             unsigned hostID, // mpi rank for this node
                              MACIO::RTmetadata &mdLogger,
                              const std::string &mdKeyPrefix,
                              Trigger *stopSwitch = NULL);
diff --git a/RTCP/Cobalt/GPUProc/src/Station/StationTranspose.cc b/RTCP/Cobalt/GPUProc/src/Station/StationTranspose.cc
index 0250274652097a0bf475819c018e26af702b764e..5b0fb842850ed9f3857e9af0d31ecd2a9945d5cd 100644
--- a/RTCP/Cobalt/GPUProc/src/Station/StationTranspose.cc
+++ b/RTCP/Cobalt/GPUProc/src/Station/StationTranspose.cc
@@ -1,6 +1,7 @@
 //# StationTranspose.cc: Manages the transpose of station data, which exchanges
 //#                      [station][subband] to [subband][station] over MPI.
-//# Copyright (C) 2012-2013  ASTRON (Netherlands Institute for Radio Astronomy)
+//# Copyright (C) 2012-2013, 2017
+//# ASTRON (Netherlands Institute for Radio Astronomy)
 //# P.O. Box 2, 7990 AA Dwingeloo, The Netherlands
 //#
 //# This file is part of the LOFAR software suite.
@@ -195,7 +196,8 @@ namespace LOFAR {
     template struct MPIData< SampleType<i8complex> >;
     template struct MPIData< SampleType<i4complex> >;
 
-    MPISender::MPISender( const std::string &logPrefix, size_t stationIdx, const SubbandDistribution &subbandDistribution )
+    MPISender::MPISender( const std::string &logPrefix, size_t stationIdx,
+                          const SubbandDistribution &subbandDistribution )
     :
       logPrefix(logPrefix),
       stationIdx(stationIdx),
@@ -241,7 +243,9 @@ namespace LOFAR {
 
 
     template <typename SampleT>
-    void MPISender::sendBlocks( Queue< SmartPtr< MPIData<SampleT> > > &inputQueue, Queue< SmartPtr< MPIData<SampleT> > > &outputQueue )
+    void MPISender::sendBlocks( Queue< SmartPtr< MPIData<SampleT> > > &inputQueue,
+                                Queue< SmartPtr< MPIData<SampleT> > > &outputQueue,
+                                bool skipDataTransfers )
     {
       SmartPtr< MPIData<SampleT> > mpiData;
 
@@ -265,13 +269,16 @@ namespace LOFAR {
           nrFlaggedSamples += nrSamples - mpiData->metaData[sb].flags.count();
         }
 
-        LOG_DEBUG_STR(logPrefix << str(format("[block %d] Sending data") % block));
+        // Actual block sending can be skipped for RSP raw output only observations or some tests.
+        if (!skipDataTransfers) {
+          LOG_DEBUG_STR(logPrefix << str(format("[block %d] Sending data") % block));
 
-        mpiSendTimer.start();
-        sendBlock(*mpiData);
-        mpiSendTimer.stop();
+          mpiSendTimer.start();
+          sendBlock(*mpiData);
+          mpiSendTimer.stop();
 
-        LOG_DEBUG_STR(logPrefix << str(format("[block %d] Data sent") % block));
+          LOG_DEBUG_STR(logPrefix << str(format("[block %d] Data sent") % block));
+        }
 
         outputQueue.append(mpiData);
         ASSERT(!mpiData);
@@ -294,9 +301,15 @@ namespace LOFAR {
       LOG_INFO_STR(logPrefix << str(format("Average data loss/flagged: %.4f%%") % avgloss));
     }
 
-    template void MPISender::sendBlocks( Queue< SmartPtr< MPIData< SampleType<i16complex> > > > &inputQueue, Queue< SmartPtr< MPIData< SampleType<i16complex> > > > &outputQueue );
-    template void MPISender::sendBlocks( Queue< SmartPtr< MPIData< SampleType<i8complex> > > > &inputQueue, Queue< SmartPtr< MPIData< SampleType<i8complex> > > > &outputQueue );
-    template void MPISender::sendBlocks( Queue< SmartPtr< MPIData< SampleType<i4complex> > > > &inputQueue, Queue< SmartPtr< MPIData< SampleType<i4complex> > > > &outputQueue );
+    template void MPISender::sendBlocks( Queue< SmartPtr< MPIData< SampleType<i16complex> > > > &inputQueue,
+                                         Queue< SmartPtr< MPIData< SampleType<i16complex> > > > &outputQueue,
+                                         bool skipDataTransfers );
+    template void MPISender::sendBlocks( Queue< SmartPtr< MPIData< SampleType<i8complex> > > > &inputQueue,
+                                         Queue< SmartPtr< MPIData< SampleType<i8complex> > > > &outputQueue,
+                                         bool skipDataTransfers );
+    template void MPISender::sendBlocks( Queue< SmartPtr< MPIData< SampleType<i4complex> > > > &inputQueue,
+                                         Queue< SmartPtr< MPIData< SampleType<i4complex> > > > &outputQueue,
+                                         bool skipDataTransfers );
   }
 }
 
diff --git a/RTCP/Cobalt/GPUProc/src/Station/StationTranspose.h b/RTCP/Cobalt/GPUProc/src/Station/StationTranspose.h
index 6df17f21c03573e8a59401b98913dfb74cd2acef..36156bbe57c9a66fd2a318d1842d362f2feae819 100644
--- a/RTCP/Cobalt/GPUProc/src/Station/StationTranspose.h
+++ b/RTCP/Cobalt/GPUProc/src/Station/StationTranspose.h
@@ -1,6 +1,7 @@
 //# StationTranspose.h: Manages the transpose of station data, which exchanges
 //#                     [station][subband] to [subband][station] over MPI.
-//# Copyright (C) 2012-2013  ASTRON (Netherlands Institute for Radio Astronomy)
+//# Copyright (C) 2012-2013, 2017
+//# ASTRON (Netherlands Institute for Radio Astronomy)
 //# P.O. Box 2, 7990 AA Dwingeloo, The Netherlands
 //#
 //# This file is part of the LOFAR software suite.
@@ -26,11 +27,11 @@
 #include <map>
 #include <vector>
 
-#include <CoInterface/Parset.h>
+#include <CoInterface/MultiDimArray.h>
 #include <CoInterface/Queue.h>
 #include <CoInterface/SubbandMetaData.h>
-#include <InputProc/RSPTimeStamp.h>
-#include <InputProc/Station/RSP.h>
+#include <CoInterface/RSP.h>
+#include <CoInterface/RSPTimeStamp.h>
 
 #include <InputProc/Transpose/MPIProtocol.h>
 #include <InputProc/Transpose/MPIUtil.h>
@@ -127,22 +128,23 @@ namespace LOFAR {
 
     class MPISender {
     public:
-      MPISender( const std::string &logPrefix, size_t stationIdx, const SubbandDistribution &subbandDistribution );
-
-      /*
-       * Sends one block over MPI.
-       */
-      template <typename SampleT>
-      void sendBlock( MPIData<SampleT> &mpiData );
+      MPISender( const std::string &logPrefix, size_t stationIdx,
+                 const SubbandDistribution &subbandDistribution );
 
       /*
        * Sends blocks over MPI until a NULL is read from the inputQueue.
        *
        * For each block, serialiseMetaData() is called before sendBlock()
        * is used to send the block over MPI.
+       *
+       * For observations with only RSP raw output (or some tests),
+       * skipDataTransfers can be used to skip all MPI data sends.
+       * But always transfer the EOS block. Always do the queue operations.
        */
       template <typename SampleT>
-      void sendBlocks( Queue< SmartPtr< MPIData<SampleT> > > &inputQueue, Queue< SmartPtr< MPIData<SampleT> > > &outputQueue );
+      void sendBlocks( Queue< SmartPtr< MPIData<SampleT> > > &inputQueue,
+                       Queue< SmartPtr< MPIData<SampleT> > > &outputQueue,
+                       bool skipDataTransfers );
 
     private:
       const std::string logPrefix;
@@ -151,6 +153,13 @@ namespace LOFAR {
       const std::vector<int> targetRanks;
       std::vector<size_t> subbandOffsets;
       const size_t nrSubbands;
+
+
+      /*
+       * Sends one block over MPI.
+       */
+      template <typename SampleT>
+      void sendBlock( MPIData<SampleT> &mpiData );
     };
   }
 }
diff --git a/RTCP/Cobalt/GPUProc/src/cuda/Pipelines/Pipeline.cc b/RTCP/Cobalt/GPUProc/src/cuda/Pipelines/Pipeline.cc
index a168d03ebb2d77dfda1973d4a351efcbeb732727..ad70ed747797450a6e200a0b045c1e86b63e3a49 100644
--- a/RTCP/Cobalt/GPUProc/src/cuda/Pipelines/Pipeline.cc
+++ b/RTCP/Cobalt/GPUProc/src/cuda/Pipelines/Pipeline.cc
@@ -38,11 +38,11 @@
 #include <CoInterface/Align.h>
 #include <CoInterface/BudgetTimer.h>
 #include <CoInterface/Stream.h>
+#include <CoInterface/RSPTimeStamp.h>
 #include <GPUProc/gpu_utils.h>
 #include <GPUProc/global_defines.h>
 #include <GPUProc/Kernels/Kernel.h>
 #include <InputProc/SampleType.h>
-#include <InputProc/RSPTimeStamp.h>
 
 #include <InputProc/Transpose/MPIReceiveStations.h>
 #include <InputProc/Transpose/MPIProtocol.h>
@@ -146,7 +146,8 @@ namespace LOFAR
       // be in bulk: if processing is cheap, all subbands will be output right after they have been received.
       //
       // Allow queue to drop items older than 3 seconds.
-      multiSender(hostMap(ps, subbandIndices, hostID), ps, 3.0, hostID < ps.settings.nodes.size() ? ps.settings.nodes.at(hostID).out_nic : ""),
+      multiSender(hostMap(ps, subbandIndices, hostID), ps, 3.0,
+                  hostID < ps.settings.nodes.size() ? ps.settings.nodes[hostID].out_nic : ""),
       hostID(hostID)
     {
       ASSERTSTR(!devices.empty(), "Not bound to any GPU!");
@@ -786,6 +787,20 @@ namespace LOFAR
         else
           LOG_DEBUG_STR("[" << id << "] Done"); 
       }
+      // report statistics
+      if (ps.settings.correlator.enabled) {
+        const float didNotReceivePerc = 0.0; // no output loss possible so far
+        const float didNotSendPerc = 100.0 * correlatorLoss.blocksDropped / ps.settings.correlator.nrIntegrations;
+        const float lostPerc = didNotSendPerc - didNotReceivePerc;
+
+        if (lostPerc > 0)
+          LOG_ERROR_STR("[Correlator] I lost " << lostPerc << "% of the data for subband " << globalSubbandIdx << " to " << ps.settings.correlator.files[globalSubbandIdx].location.host);
+        if (didNotSendPerc > 0)
+          LOG_WARN_STR("[Correlator] Did not send " << didNotSendPerc << "% of the data for subband " << globalSubbandIdx << " to " << ps.settings.correlator.files[globalSubbandIdx].location.host);
+      }
+
+      // Per-subband loss of the BeamFormer is not really relevant due to the 2nd transpose to OutputProc.
+      // Instead, we report loss in the TABTranspose::MultiSender.
     }
 
 
@@ -794,22 +809,26 @@ namespace LOFAR
       Queue< SmartPtr<SubbandProcOutputData> > &inputQueue,
       Queue< SmartPtr<SubbandProcOutputData> > &outputQueue )
     {
-      NSTimer writeTimer(str(format("Pipeline::writeCorrelatedOutput(subband %u)") % globalSubbandIdx), true, true);
+      BudgetTimer writeTimer(
+        str(format("[subband %u] write correlated output") % globalSubbandIdx),
+        ps.settings.blockDuration(),
+        true, true);
 
       // Register our thread to be killable at exit
       OMPThreadSet::ScopedRun sr(outputThreads);
 
       SmartPtr<Stream> outputStream;
+      bool outputEnabled = true;
 
       if (ps.settings.correlator.enabled) {
         const string desc = getStreamDescriptorBetweenIONandStorage(ps, CORRELATED_DATA, globalSubbandIdx,
-          hostID < ps.settings.nodes.size() ? ps.settings.nodes.at(hostID).out_nic : "");
+          hostID < ps.settings.nodes.size() ? ps.settings.nodes[hostID].out_nic : "");
 
         try {
           outputStream = createStream(desc, false, 0);
         } catch (Exception &ex) {
           LOG_ERROR_STR("Error writing subband " << globalSubbandIdx << ", dropping all subsequent blocks: " << ex.what());
-          return;
+          outputEnabled = false;
         }
       }
 
@@ -820,23 +839,23 @@ namespace LOFAR
         const struct BlockID id = data->blockID;
         ASSERT( globalSubbandIdx == id.globalSubbandIdx );
 
-        if (data->emit_correlatedData) {
+        if (outputEnabled && data->emit_correlatedData) {
           ASSERT(ps.settings.correlator.enabled);
           ASSERT(outputStream.get());
 
           LOG_DEBUG_STR("[" << id << "] Writing start");
 
           // Write block to outputProc 
+          writeTimer.start();
           try {
-            writeTimer.start();
             for (size_t i = 0; i < data->correlatedData.subblocks.size(); ++i)
               data->correlatedData.subblocks[i]->write(outputStream.get(), true);
-            writeTimer.stop();
           } catch (Exception &ex) {
             // No reconnect, as outputProc doesn't yet re-listen when the conn drops.
             LOG_ERROR_STR("Error writing subband " << id.globalSubbandIdx << ", dropping all subsequent blocks: " << ex.what());
-            return;
+            outputEnabled = false;
           }
+          writeTimer.stop();
 
           if (id.localSubbandIdx == 0 || id.localSubbandIdx == subbandIndices.size() - 1)
             LOG_INFO_STR("[" << id << "] Done"); 
diff --git a/RTCP/Cobalt/GPUProc/src/rtcp.cc b/RTCP/Cobalt/GPUProc/src/rtcp.cc
index 5195a218163c312247a1b02150d494d2eb13dbb1..20ee60d73c7df4ad61964804ade48c73512ec12e 100644
--- a/RTCP/Cobalt/GPUProc/src/rtcp.cc
+++ b/RTCP/Cobalt/GPUProc/src/rtcp.cc
@@ -285,11 +285,13 @@ int main(int argc, char **argv)
   if(mpi.rank() >= 0 && (size_t)mpi.rank() < ps.settings.nodes.size()) {
     struct ObservationSettings::Node mynode = ps.settings.nodes.at(mpi.rank());
 
-    // set the processor affinity before any threads are created
-    setProcessorAffinity(mynode.cpu);
+    if (mynode.cpu != -1) {
+      // set the processor affinity before any threads are created
+      setProcessorAffinity(mynode.cpu);
+    }
 
 #ifdef HAVE_LIBNUMA
-    if (numa_available() != -1) {
+    if (mynode.cpu != -1 && numa_available() != -1) {
       // force node + memory binding for future allocations
       struct bitmask *numa_node = numa_allocate_nodemask();
       numa_bitmask_clearall(numa_node);
@@ -315,7 +317,7 @@ int main(int argc, char **argv)
 
       LOG_DEBUG_STR("Bound to memory on nodes " << nodestrs);
     } else {
-      LOG_WARN("Cannot bind memory (libnuma says there is no numa available)");
+      LOG_INFO("Cannot bind memory: cpu nr to bind to is set to -1 or libnuma reports NUMA is not available");
     }
 #else
     LOG_WARN("Cannot bind memory (no libnuma support)");
@@ -388,12 +390,13 @@ int main(int argc, char **argv)
 
   // Creation of pipelines cause fork/exec, which we need to
   // do before we start doing anything fancy with libraries and threads.
-  if (subbandIndices.empty()) {
-    // no operation -- don't even create a pipeline!
-    pipeline = NULL;
-  } else {
+  if ((ps.settings.correlator.enabled || ps.settings.beamFormer.enabled) &&
+      !subbandIndices.empty()) {
     pipeline = new Pipeline(ps, subbandIndices, devices,
                             MPI_receive_pool, mdLogger, mdKeyPrefix, mpi.rank());
+  } else {
+    // RSP raw data output or piggy-backing only, or software test without pipeline
+    pipeline = NULL;
   } 
 
   // After pipeline creation (post-fork()), allow creation of a thread to send
@@ -520,7 +523,7 @@ int main(int argc, char **argv)
             mdLogger.log(mdKeyPrefixInputProc + PN_CSI_CPU,  cpuNr);
 
 
-            sendInputToPipeline(ps, stat, subbandDistribution,
+            sendInputToPipeline(ps, stat, subbandDistribution, mpi.rank(),
                                 mdLogger, mdKeyPrefixInputProc, &stopSwitch);
           }
         }
@@ -538,8 +541,9 @@ int main(int argc, char **argv)
         {
           OMPThread::ScopedName sn("obs process");
 
-          // Process station data
-          if (!subbandDistribution[mpi.rank()].empty()) {
+          // Process station data if needed and if any
+          if ((ps.settings.correlator.enabled || ps.settings.beamFormer.enabled) &&
+              !subbandDistribution[mpi.rank()].empty()) {
             pipeline->processObservation();
           }
         }
diff --git a/RTCP/Cobalt/GPUProc/src/scripts/CobaltControl.sh b/RTCP/Cobalt/GPUProc/src/scripts/CobaltControl.sh
index e7786bbe05865677fd743e72609a641f31ba8328..6d818adcc6b9a5bf7545d9ce275b5b280a7af9fd 100755
--- a/RTCP/Cobalt/GPUProc/src/scripts/CobaltControl.sh
+++ b/RTCP/Cobalt/GPUProc/src/scripts/CobaltControl.sh
@@ -20,7 +20,7 @@ case $COMMAND in
     ;;
 
   stop)
-    for PIDFILE in $LOFARROOT/var/run/*.pid
+    for PIDFILE in $LOFARROOT/var/run/rtcp-*.pid
     do
       PID=`cat $PIDFILE`
       echo "Softly killing rtcp(${PID})"
@@ -33,10 +33,16 @@ case $COMMAND in
 
     PIDS=""
     OBSIDS=""
-    for PIDFILE in $LOFARROOT/var/run/*.pid
+    for PIDFILE in $LOFARROOT/var/run/rtcp-*.pid
     do
-      PIDS="$PIDS `cat $PIDFILE`"
-      OBSIDS="$OBSIDS `echo $PIDFILE | perl -ne '/rtcp-([0-9]+).pid/; print $1;'`"
+      # only include PID if process is still running
+      PID=`cat $PIDFILE`
+      PID=`ps -o pid --no-heading -p $PID`
+
+      if [ -n "$PID" ]; then
+        PIDS="$PIDS $PID"
+        OBSIDS="$OBSIDS `echo $PIDFILE | perl -ne '/rtcp-([0-9]+).pid/; print $1;'`"
+      fi
     done
 
     if [ -z "$OBSIDS" ]
diff --git a/RTCP/Cobalt/GPUProc/src/scripts/Cobalt_install.sh b/RTCP/Cobalt/GPUProc/src/scripts/Cobalt_install.sh
index 716c834131bee44f15a236886ce6c3190d8dd42f..1e8e982d748bfd93f9657c9825daffcb4de6440e 100755
--- a/RTCP/Cobalt/GPUProc/src/scripts/Cobalt_install.sh
+++ b/RTCP/Cobalt/GPUProc/src/scripts/Cobalt_install.sh
@@ -60,6 +60,7 @@ for HOST in ${HOSTS:-cbm001 cbm002 cbm003 cbm004 cbm005 cbm006 cbm007 cbm008 cbm
   # cap_net_raw:  allow binding sockets to NICs
   OUTPUTPROC_CAPABILITIES='cap_sys_nice,cap_ipc_lock'
   sudo /sbin/setcap \"\${OUTPUTPROC_CAPABILITIES}\"=ep bin/outputProc || true
+  sudo /sbin/setcap \"\${OUTPUTPROC_CAPABILITIES}\"=ep bin/TBB_Writer || true
   RTCP_CAPABILITIES='cap_net_raw,cap_sys_nice,cap_ipc_lock'
   sudo /sbin/setcap \"\${RTCP_CAPABILITIES}\"=ep bin/rtcp
   " || exit 1
diff --git a/RTCP/Cobalt/GPUProc/src/scripts/cobalt_functions.sh b/RTCP/Cobalt/GPUProc/src/scripts/cobalt_functions.sh
index 5530dbd94508cc989c8dd481a4b40ba34fba35dc..6b9ed462d89e0f3f25b1a4bc2d290b9e5fd8e694 100755
--- a/RTCP/Cobalt/GPUProc/src/scripts/cobalt_functions.sh
+++ b/RTCP/Cobalt/GPUProc/src/scripts/cobalt_functions.sh
@@ -36,7 +36,7 @@ function setkey {
   echo "$KEY = $VAL" >> "$PARSET"
 }
 
-COBALT_DATAPRODUCTS="Correlated CoherentStokes IncoherentStokes"
+COBALT_DATAPRODUCTS="Correlated CoherentStokes IncoherentStokes RSPRaw"
 
 function read_cluster_model {
   # HACK: Search for first cluster, and assume they're all the same. We support only output
@@ -53,10 +53,21 @@ function read_cluster_model {
     CEP4)
       HEADNODE=head01.cep4.control.lofar
       SLURM_PARTITION=cpu
-      COMPUTENODES="`ssh $HEADNODE sinfo --responding --states=idle,mixed,alloc --format=%n.cep4,%T --noheader --partition=$SLURM_PARTITION --sort=N | fgrep -v ,draining | cut -f1 -d,`"
+      SLURM_RESERVATION=cobalt
+      # Get the nodes in the cobalt reservation. The reservation must be active.
+      RESVNODES=$(ssh $HEADNODE scontrol show res -o $SLURM_RESERVATION  | perl -n -e 'm/Nodes=(.*?) .*State=ACTIVE/ ? print STDOUT $1 : die "No active cobalt reservation found"')
+      if [ $? -eq 0 ]; then
+        echo "Active reservation '$SLURM_RESERVATION' found, get online nodes in the reservation"
+        SINFO_FLAGS="--responding --states=idle,mixed,alloc,reserved -n $RESVNODES"
+      else 
+        echo "WARNING: No reservation '$SLURM_RESERVATION' found, defaulting to all online nodes in partition '$SLURM_PARTITION'"
+        SINFO_FLAGS="--responding --states=idle,mixed,alloc --partition=$SLURM_PARTITION"
+      fi
+      COMPUTENODES="$(ssh $HEADNODE sinfo --format=%n.cep4.infiniband.lofar,%T --noheader --sort=N $SINFO_FLAGS | fgrep -v ,draining | cut -f1 -d,)"
+      # OLD COMPUTENODES="`ssh $HEADNODE sinfo --responding --states=idle,mixed,alloc --format=%n.cep4.infiniband.lofar,%T --noheader --partition=$SLURM_PARTITION --sort=N | fgrep -v ,draining | cut -f1 -d,`"
       if [ -z "$COMPUTENODES" ]; then
         echo "ERROR: Could not obtain list of available CEP4 nodes. Defaulting to all."
-        COMPUTENODES="`seq -f "cpu%02.0f.cep4" 1 50`"
+        COMPUTENODES="`seq -f "cpu%02.0f.cep4.infiniband.lofar" 1 47`"
       fi
 
       GLOBALFS_DIR=/data
@@ -71,17 +82,19 @@ function read_cluster_model {
     DRAGNET)
       HEADNODE=dragnet.control.lofar
       SLURM_PARTITION=lofarobs  # NOTE: sinfo (without -a) only displays this partition for members of the lofarsys group (+ slurm,root)
-      COMPUTENODES="`ssh $HEADNODE sinfo --responding --states=idle,mixed,alloc --format=%n.control.lofar,%T --noheader --partition=$SLURM_PARTITION --sort=N | fgrep -v ,draining | cut -f1 -d,`"
+      COMPUTENODES="`ssh $HEADNODE sinfo --responding --states=idle,mixed,alloc --format=%n-ib.dragnet.infiniband.lofar,%T --noheader --partition=$SLURM_PARTITION --sort=N | fgrep -v ,draining | cut -f1 -d,`"
       if [ -z "$COMPUTENODES" ]; then
-        echo "ERROR: Could not obtain list of available DRAGNET nodes. Defaulting to drg01 - drg20 .control.lofar"
-        COMPUTENODES="`seq -f "drg%02.0f.control.lofar" 1 20`"
+        echo "ERROR: Could not obtain list of available DRAGNET nodes. Defaulting to drg01 - drg23 -ib.dragnet.infiniband.lofar"
+        COMPUTENODES="`seq -f "drg%02.0f-ib.dragnet.infiniband.lofar" 1 23`"
       fi
+      COMPUTENODES=$(echo $COMPUTENODES | sed -e s/dragproc-ib.dragnet.infiniband.lofar/dragproc-10g.online.lofar/g)  # dragproc has no infiniband i/f, so use 10g
 
       #SLURM=true
       SLURM=false # Don't use SLURM for now, let's get it working without it first
       GLOBALFS=false
       DOCKER=false
 
+      #OUTPUTPROC_ROOT="/opt/lofar_versions/${LOFAR_TAG}"  # allows testing releases without disturbing operations, but requires good LOFAR version sync between COBALT and DRAGNET
       OUTPUTPROC_ROOT="/opt/lofar"
       ;;
     localhost)
diff --git a/RTCP/Cobalt/GPUProc/src/scripts/cobaltswitch b/RTCP/Cobalt/GPUProc/src/scripts/cobaltswitch
index c2f5fdc8c2dd4a013aaddc6db32df8b50efbbb42..fef07c95efb305ac6ec17c3adbd7c794c6048cfd 100755
--- a/RTCP/Cobalt/GPUProc/src/scripts/cobaltswitch
+++ b/RTCP/Cobalt/GPUProc/src/scripts/cobaltswitch
@@ -59,9 +59,9 @@ if [ "$NEW_MODE" != "" ]; then
           echo "#       on `date +"%F %T"`"
           echo ""
           echo "# Route all meta data to the test systems"
-          echo "Cobalt.PVSSGateway.host = ccu099"
-          echo "Cobalt.Feedback.host = ccu099"
-          echo "Cobalt.FinalMetaDataGatherer.database.host = sasdbtest"
+          echo "Cobalt.PVSSGateway.host = ccu099.control.lofar"
+          echo "Cobalt.Feedback.host = ccu099.control.lofar"
+          echo "Cobalt.FinalMetaDataGatherer.database.host = sasdbtest.control.lofar"
           echo ""
           echo "# Use only cbt009 to observe"
           echo "Cobalt.Nodes = [cbt009_0, cbt009_1]"
diff --git a/RTCP/Cobalt/GPUProc/src/scripts/record_raw_data.sh b/RTCP/Cobalt/GPUProc/src/scripts/record_raw_data.sh
index ac5778c593be0636791f2ff41449739fc40d7ed2..fc5f4b44de4de364a99595066768ca726a2461a2 100755
--- a/RTCP/Cobalt/GPUProc/src/scripts/record_raw_data.sh
+++ b/RTCP/Cobalt/GPUProc/src/scripts/record_raw_data.sh
@@ -1,5 +1,12 @@
 #!/bin/bash
 #
+# NEW WAY:
+#
+# See GPUProc/etc/parset-additions.d/rspraw-enable.parset.OBSID
+#
+#
+# OLD WAY:
+#
 # To record raw data:
 #
 # 1. Define an observation in OTDB.
diff --git a/RTCP/Cobalt/GPUProc/src/scripts/runObservation.sh b/RTCP/Cobalt/GPUProc/src/scripts/runObservation.sh
index 54a9f36ab2fafb20880b5340b86f04ee14df736a..8f6257c5df433c97ace82c9813a5711d1f47fcd1 100755
--- a/RTCP/Cobalt/GPUProc/src/scripts/runObservation.sh
+++ b/RTCP/Cobalt/GPUProc/src/scripts/runObservation.sh
@@ -165,6 +165,9 @@ timeout -k2 1 /bin/true 2> /dev/null && KILLOPT=-k2
 OBSID=`getkey Observation.ObsID`
 echo "[cobalt] ObsID = $OBSID"
 
+PROJECT=`getkey Observation.Campaign.name`
+echo "[cobalt] Project = $PROJECT"
+
 # Remove stale feedback file (useful for testing)
 FEEDBACK_FILE=$LOFARROOT/var/run/Observation${OBSID}_feedback
 rm -f $FEEDBACK_FILE
@@ -191,14 +194,19 @@ then
   # Avoid passing on "*" if it matches nothing. Restore afterwards.
   nullglob_state=`shopt -p nullglob`
   shopt -s nullglob
-  cat $LOFARROOT/etc/parset-additions.d/default/*.parset \
+  for f in $LOFARROOT/etc/parset-additions.d/default/*.parset \
+      $LOFARROOT/etc/parset-additions.d/default/*.$PROJECT \
       $LOFARROOT/etc/parset-additions.d/default/*.$OBSID \
       $DOT_COBALT_DEFAULT \
       $PARSET \
       $LOFARROOT/etc/parset-additions.d/override/*.parset \
+      $LOFARROOT/etc/parset-additions.d/override/*.$PROJECT \
       $LOFARROOT/etc/parset-additions.d/override/*.$OBSID \
-      $DOT_COBALT_OVERRIDE \
-      > $AUGMENTED_PARSET || error "[parset] Could not create $AUGMENTED_PARSET"
+      $DOT_COBALT_OVERRIDE;
+  do
+      cat $f
+      echo "" # force newline in case the file does not end in one
+  done > $AUGMENTED_PARSET || error "[parset] Could not create $AUGMENTED_PARSET"
   eval $nullglob_state
 
   # Use the new one from now on
diff --git a/RTCP/Cobalt/GPUProc/src/scripts/watchlogs-multitail.conf b/RTCP/Cobalt/GPUProc/src/scripts/watchlogs-multitail.conf
index bba6f803801da3824a3882854451050b9a72fd74..3aa3a05a1c9b82defce4c781b59e95d82eaeb714 100644
--- a/RTCP/Cobalt/GPUProc/src/scripts/watchlogs-multitail.conf
+++ b/RTCP/Cobalt/GPUProc/src/scripts/watchlogs-multitail.conf
@@ -17,8 +17,10 @@ rule:ev:INFO  RTCP.Cobalt.GPUProc - Pipeline: Data flushed succesfully.
 rule:ev:INFO  RTCP.Cobalt.CoInterface - Block: written .* subbands, lost 0 subbands.
 
 rule:ev:\[Timer.h:[0-9]+\]
-rule:ev:INFO  RTCP.Cobalt.GPUProc - Queue
-rule:ev:INFO  RTCP.Cobalt.GPUProc - BestEffortQueue
+rule:ev:\[BudgetTimer.cc:[0-9]+\]
+rule:ev:\[PerformanceCounter.cc:[0-9]+\]
+rule:ev:INFO  RTCP.Cobalt.(GPUProc|OutputProc|CoInterface) - Queue
+rule:ev:INFO  RTCP.Cobalt.(GPUProc|OutputProc|CoInterface) - BestEffortQueue
 
 # ----- remove superfluous flagging lines (since all nodes receive all RSP boards in practice)
 rule:ev:^rtcp\:0[1-9]+.*Flagging
diff --git a/RTCP/Cobalt/GPUProc/test/CMakeLists.txt b/RTCP/Cobalt/GPUProc/test/CMakeLists.txt
index ed0b2bcdd8070e8ff6d32f46d619cbc408238f73..3bfc5a8ed25c5d2e339cf1b65e59e80533aa368f 100644
--- a/RTCP/Cobalt/GPUProc/test/CMakeLists.txt
+++ b/RTCP/Cobalt/GPUProc/test/CMakeLists.txt
@@ -10,6 +10,7 @@ lofar_add_test(tBandPass tBandPass.cc)
 lofar_add_test(t_cpu_utils t_cpu_utils.cc)
 lofar_add_test(t_generate_globalfs_locations)
 lofar_add_test(tMPIReceive tMPIReceive.cc)
+lofar_add_test(tRSPRawSender tRSPRawSender.cc)
 if(UNITTEST++_FOUND)
   lofar_add_test(t_gpu_utils t_gpu_utils)
   lofar_add_test(tStationInput tStationInput)
diff --git a/RTCP/Cobalt/GPUProc/test/tMPIReceive.cc b/RTCP/Cobalt/GPUProc/test/tMPIReceive.cc
index a5ae57a14910f926c74a31db032edebcdc8f8771..88673b74b50e0b997b09f61d6fdfec05a6ed31bf 100644
--- a/RTCP/Cobalt/GPUProc/test/tMPIReceive.cc
+++ b/RTCP/Cobalt/GPUProc/test/tMPIReceive.cc
@@ -106,7 +106,7 @@ int main(int argc, char **argv)
         }
 
         MACIO::RTmetadata rtmd(ps.settings.observationID, "", "");
-        sendInputToPipeline(ps, stat, subbandDistribution,
+        sendInputToPipeline(ps, stat, subbandDistribution, mpi.rank(),
                             rtmd, "rtmd key prefix");
         cout << "First ended" << endl;
       }
diff --git a/RTCP/Cobalt/GPUProc/test/tRSPRawSender.cc b/RTCP/Cobalt/GPUProc/test/tRSPRawSender.cc
new file mode 100644
index 0000000000000000000000000000000000000000..08cb07ad2ed0692ff565fa32a7fa8671ee7d5ff1
--- /dev/null
+++ b/RTCP/Cobalt/GPUProc/test/tRSPRawSender.cc
@@ -0,0 +1,75 @@
+//# tRSPRawSender.cc
+//# Copyright (C) 2017  ASTRON (Netherlands Institute for Radio Astronomy)
+//# P.O. Box 2, 7990 AA Dwingeloo, The Netherlands
+//#
+//# This file is part of the LOFAR software suite.
+//# The LOFAR software suite 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 3 of the License, or
+//# (at your option) any later version.
+//#
+//# The LOFAR software suite 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 the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
+//#
+//# $Id$
+
+#include <lofar_config.h>
+
+#include <omp.h>
+
+#include <Common/LofarLogger.h>
+#include <GPUProc/Station/RSPRawSender.h>
+
+using namespace LOFAR;
+using namespace LOFAR::Cobalt;
+using namespace std;
+
+static bool doSender(void)
+{
+//TODO RSPRawSender sender(...);
+
+  return true;
+}
+
+static bool doReceiver(void)
+{
+
+  return true;
+}
+
+static bool runTest(void)
+{
+  bool senderStatus;
+  bool receiverStatus;
+
+  // create sender and receiver in separate threads for easy testing
+# pragma omp parallel sections num_threads(2)
+  {
+#   pragma omp section
+    {
+      senderStatus = doSender();
+    }
+
+#   pragma omp section
+    {
+      receiverStatus = doReceiver();
+    }
+  }
+
+  return senderStatus && receiverStatus;
+}
+
+int main(void)
+{
+  INIT_LOGGER("tRSPRawSender");
+
+  bool status = runTest();
+
+  return !status;
+}
+
diff --git a/RTCP/Cobalt/GPUProc/test/tStationInput.cc b/RTCP/Cobalt/GPUProc/test/tStationInput.cc
index f39931daf70e1bb2958825070764ae0a5e5895ec..197ca6af63fba390554be4e1c968dfdd537c48bf 100644
--- a/RTCP/Cobalt/GPUProc/test/tStationInput.cc
+++ b/RTCP/Cobalt/GPUProc/test/tStationInput.cc
@@ -1,3 +1,23 @@
+//# tStationInput.cc
+//# Copyright (C) 2012-2014  ASTRON (Netherlands Institute for Radio Astronomy)
+//# P.O. Box 2, 7990 AA Dwingeloo, The Netherlands
+//#
+//# This file is part of the LOFAR software suite.
+//# The LOFAR software suite 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 3 of the License, or
+//# (at your option) any later version.
+//#
+//# The LOFAR software suite 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 the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
+//#
+//# $Id$
+
 #include <lofar_config.h>
 
 #include <GPUProc/Station/StationInput.h>
diff --git a/RTCP/Cobalt/InputProc/doc/capture-station-input.txt b/RTCP/Cobalt/InputProc/doc/capture-station-input.txt
index 8dfe4ccfa8af06f7e83e7e4a0972f298ceea5e50..d61af9425ce9f5e88412948c1d2a034880561a98 100644
--- a/RTCP/Cobalt/InputProc/doc/capture-station-input.txt
+++ b/RTCP/Cobalt/InputProc/doc/capture-station-input.txt
@@ -1,3 +1,15 @@
+COBALT capture-station-input.txt
+================================
+
+NEW WAY:
+
+See GPUProc/etc/parset-additions.d/rspraw-enable.parset.OBSID
+
+
+=========================================================================
+
+OLD WAY:
+
 To capture station input, one needs to set up a receiver per RSP board:
 
 1. Find out where each station sends its data to. Each antenna field
diff --git a/RTCP/Cobalt/InputProc/src/CMakeLists.txt b/RTCP/Cobalt/InputProc/src/CMakeLists.txt
index d35ae5b538d45f831e32383eda1c5cba759eba6c..598e87ff8e21d7df9b3d35605968aab359c98fd9 100644
--- a/RTCP/Cobalt/InputProc/src/CMakeLists.txt
+++ b/RTCP/Cobalt/InputProc/src/CMakeLists.txt
@@ -8,7 +8,6 @@ execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
 set(_inputproc_sources
   Package__Version.cc
   RSPBoards.cc
-  RSPTimeStamp.cc
   Buffer/Ranges.cc
   Buffer/StationID.cc
   Delays/Delays.cc
diff --git a/RTCP/Cobalt/InputProc/src/Delays/Delays.h b/RTCP/Cobalt/InputProc/src/Delays/Delays.h
index 085aa7ea2f433e0c7c799d872f1dd6f5fe07e36f..436ef5a07cb8adb3855f46ae7cc91742356f2e08 100644
--- a/RTCP/Cobalt/InputProc/src/Delays/Delays.h
+++ b/RTCP/Cobalt/InputProc/src/Delays/Delays.h
@@ -36,7 +36,7 @@
 #include <CoInterface/Parset.h>
 #include <CoInterface/SubbandMetaData.h>
 #include <CoInterface/SmartPtr.h>
-#include <InputProc/RSPTimeStamp.h>
+#include <CoInterface/RSPTimeStamp.h>
 
 #ifdef HAVE_CASACORE
 #include <measures/Measures/MeasConvert.h>
diff --git a/RTCP/Cobalt/InputProc/src/Delays/printDelays.cc b/RTCP/Cobalt/InputProc/src/Delays/printDelays.cc
index c42c1936334c8e3b9f0aa3af73375570eeff3e6c..da256306b32c7df642449f55dac3c6398c4ccb04 100644
--- a/RTCP/Cobalt/InputProc/src/Delays/printDelays.cc
+++ b/RTCP/Cobalt/InputProc/src/Delays/printDelays.cc
@@ -40,24 +40,8 @@ string printDouble3Vector( const vector<double> &vec )
   return str(format("[%.3f, %.3f, %.3f]") % vec[0] % vec[1] % vec[2]);
 }
 
-int main( int argc, char **argv )
-{
-  INIT_LOGGER( "printDelays" );
-
-  if (argc < 3) {
-    cerr << "Syntax: printDelays L1234.parset antenna_field_name" << endl;
-    exit(1);
-  }
-
-  Parset ps(argv[1]);
-  const string antennaFieldName = argv[2];
-
-  const ssize_t antennaFieldIdx = ps.settings.antennaFieldIndex(antennaFieldName);
-
-  if (antennaFieldIdx < 0) {
-    LOG_ERROR_STR("Could not find antenna field name in parset: " << antennaFieldName);
-    exit(1);
-  }
+void printDelays( const Parset &ps, ssize_t antennaFieldIdx ) {
+  const string antennaFieldName = ps.settings.antennaFields[antennaFieldIdx].name;
 
   /* Determine start/stop/blocksize parameters */
   const TimeStamp from(ps.settings.startTime * ps.settings.subbandWidth(), ps.settings.clockHz());
@@ -66,27 +50,17 @@ int main( int argc, char **argv )
   size_t blockSize = ps.settings.blockSize;
 
   /* Print header */
-  cout << "# Parset:           " << argv[1] << endl;
-  cout << "# Delay comp?:      " << ps.settings.delayCompensation.enabled << endl;
-  cout << "# Clock corr?:      " << ps.settings.corrections.clock << endl;
-  cout << "# Ref Phase center: " << printDouble3Vector(ps.settings.delayCompensation.referencePhaseCenter) << endl;
-  cout << "#" << endl;
   cout << "# Station:          " << antennaFieldName << endl;
   cout << "# Phase center:     " << printDouble3Vector(ps.settings.antennaFields[antennaFieldIdx].phaseCenter) << endl;
   cout << "# Clock correction: " << str(format("%.15f") % ps.settings.antennaFields[antennaFieldIdx].clockCorrection) << endl;
-  cout << "# Start:            " << from << endl;
-  cout << "# Stop:             " << to << endl;
-  cout << "# BlockSize:        " << blockSize << " samples" << endl;
-  cout << "#" << endl;
-  cout << "# Applied delay := delay + clockCorrection" << endl;
-  cout << "# block timestamp dir.x dir.y dir.z delay" << endl;
+  cout << "# block field timestamp dir.x dir.y dir.z delay" << endl;
   cout.flush();
 
   /* Start delay compensation thread */
   Delays delays(ps, antennaFieldIdx, from, blockSize);
 
   /* Produce and print delays for the whole observation */
-  for (TimeStamp current = from + block * blockSize; current + blockSize < to; current += blockSize, ++block) 
+  for (TimeStamp current = from + block * blockSize; current < to; current += blockSize, ++block) 
   {
     Delays::AllDelays delaySet(ps);
 
@@ -94,12 +68,67 @@ int main( int argc, char **argv )
 
 
     Delays::Delay d = delaySet.SAPs[0].SAP;
-    cout << str(format("%u %.15f %.15f %.15f %.15f %.15f")
+    cout << str(format("%9s %u %.15f %.15f %.15f %.15f %.15f")
+          % antennaFieldName
           % block
           % current.getSeconds()
           % d.direction[0] % d.direction[1] % d.direction[2]
           % d.delay) << endl;
   }
+}
+
+int main( int argc, char **argv )
+{
+  INIT_LOGGER( "printDelays" );
+
+  if (argc < 2) {
+    cerr << "Syntax: printDelays L1234.parset [antenna_field_name]" << endl;
+    exit(1);
+  }
+
+  Parset ps(argv[1]);
+
+  ssize_t antennaFieldIdx = -1;
+  
+  if (argc >= 3) {
+    const string antennaFieldName = argv[2];
+
+    antennaFieldIdx = ps.settings.antennaFieldIndex(antennaFieldName);
+
+    if (antennaFieldIdx < 0) {
+      LOG_ERROR_STR("Could not find antenna field name in parset: " << antennaFieldName);
+      exit(1);
+    }
+  }
+
+  const TimeStamp from(ps.settings.startTime * ps.settings.subbandWidth(), ps.settings.clockHz());
+  const TimeStamp to(ps.settings.stopTime * ps.settings.subbandWidth(), ps.settings.clockHz());
+  size_t blockSize = ps.settings.blockSize;
+
+  /* Print header */
+  cout << "# Parset:           " << argv[1] << endl;
+  cout << "# Delay comp?:      " << ps.settings.delayCompensation.enabled << endl;
+  cout << "# Clock corr?:      " << ps.settings.corrections.clock << endl;
+  cout << "# Ref Phase center: " << printDouble3Vector(ps.settings.delayCompensation.referencePhaseCenter) << endl;
+  cout << "#" << endl;
+  cout << "# Start:            " << from << endl;
+  cout << "# Stop:             " << to << endl;
+  cout << "# BlockSize:        " << blockSize << " samples" << endl;
+  cout << "#" << endl;
+  cout << "# Applied delay := delay + clockCorrection" << endl;
+  cout << "# Printed delays are those at beginning of reported block = end of previous block" << endl;
+  cout << "# COBALT does linear interpolation between begin and end delay for every block." << endl;
+  cout << endl;
+
+  if (antennaFieldIdx >= 0) {
+    // print specified field
+    printDelays(ps, antennaFieldIdx);
+  } else {
+    // print all fields
+    for (size_t f = 0; f < ps.settings.antennaFields.size(); ++f)
+      printDelays(ps, f);
+  }
+
 
   return 0;
 }
diff --git a/RTCP/Cobalt/InputProc/src/Station/Generator.h b/RTCP/Cobalt/InputProc/src/Station/Generator.h
index 22fcdcde5cb0162ea20b7b41db4d4d235a508304..a503382f8ea00f29a41573dca3e9ac8836052819 100644
--- a/RTCP/Cobalt/InputProc/src/Station/Generator.h
+++ b/RTCP/Cobalt/InputProc/src/Station/Generator.h
@@ -26,13 +26,13 @@
 
 #include <Stream/Stream.h>
 #include <CoInterface/SmartPtr.h>
+#include <CoInterface/RSP.h>
+#include <CoInterface/RSPTimeStamp.h>
 
 #include <InputProc/RSPBoards.h>
 #include <InputProc/Buffer/StationID.h>
-#include <InputProc/RSPTimeStamp.h>
 
 #include "PacketFactory.h"
-#include "RSP.h"
 
 namespace LOFAR
 {
diff --git a/RTCP/Cobalt/InputProc/src/Station/PacketFactory.h b/RTCP/Cobalt/InputProc/src/Station/PacketFactory.h
index 14d0166febc93e218107d9a18b3422c6fdcb8a76..4d3aad94b429080d8718cace71c74b6641a4702f 100644
--- a/RTCP/Cobalt/InputProc/src/Station/PacketFactory.h
+++ b/RTCP/Cobalt/InputProc/src/Station/PacketFactory.h
@@ -22,11 +22,10 @@
 #ifndef LOFAR_INPUT_PROC_PACKETFACTORY_H
 #define LOFAR_INPUT_PROC_PACKETFACTORY_H
 
-#include <InputProc/RSPTimeStamp.h>
+#include <CoInterface/RSP.h>
+#include <CoInterface/RSPTimeStamp.h>
 #include <InputProc/Buffer/BoardMode.h>
 
-#include "RSP.h"
-
 namespace LOFAR
 {
   namespace Cobalt
diff --git a/RTCP/Cobalt/InputProc/src/Station/PacketReader.cc b/RTCP/Cobalt/InputProc/src/Station/PacketReader.cc
index 1047c1fa2d41a02dcd1ccff83f3b7a76090ca0b0..84d5975274b1e3a4a11cb2e19514ad894b0e6eae 100644
--- a/RTCP/Cobalt/InputProc/src/Station/PacketReader.cc
+++ b/RTCP/Cobalt/InputProc/src/Station/PacketReader.cc
@@ -40,18 +40,22 @@ namespace LOFAR
 
     PacketReader::PacketReader( const std::string &logPrefix, Stream &inputStream,
                                 const BoardMode &mode )
-      :
-      logPrefix(str(boost::format("%s [PacketReader] ") % logPrefix)),
+    : mode(mode),
       inputStream(inputStream),
-      mode(mode),
+      logPrefix(str(boost::format("%s [PacketReader] ") % logPrefix)),
 
+      hadSizeError(false),
       nrReceived(0),
       nrBadMode(0),
       nrBadTime(0),
       nrBadData(0),
       nrBadOther(0),
-      hadSizeError(false),
-      lastLogTime(0)
+      totalNrReceived(0),
+      totalNrBadMode(0),
+      totalNrBadTime(0),
+      totalNrBadData(0),
+      totalNrBadOther(0),
+      lastLogTime(0.0)
     {
       // Partial reads are not supported on UDP streams, because each read()
       // will consume a full packet.
@@ -66,6 +70,25 @@ namespace LOFAR
       }
     }
 
+    PacketReader::~PacketReader()
+    {
+      const size_t totalNrDiscarded = totalNrBadMode + totalNrBadTime + totalNrBadData + totalNrBadOther;
+      const float lostPerc = totalNrReceived == 0.0 ? 0.0 : 100.0 * totalNrDiscarded / totalNrReceived;
+
+      if (lostPerc > 0) {
+        LOG_WARN_STR(logPrefix << "Total discarded packets is " << lostPerc << "%.");
+
+        if (totalNrBadMode > 0)
+          LOG_WARN_STR(logPrefix << "Total discarded packets due to bad clock/bitmode is " << (100.0 * totalNrBadMode / totalNrReceived) << "%.");
+        if (totalNrBadTime > 0)
+          LOG_WARN_STR(logPrefix << "Total discarded packets due to bad timestamps is " << (100.0 * totalNrBadTime / totalNrReceived) << "%.");
+        if (totalNrBadData > 0)
+          LOG_WARN_STR(logPrefix << "Total discarded packets due to payload errors is " << (100.0 * totalNrBadData / totalNrReceived) << "%.");
+        if (totalNrBadOther > 0)
+          LOG_WARN_STR(logPrefix << "Total discarded packets due to other reasons is " << (100.0 * totalNrBadOther / totalNrReceived) << "%.");
+      }
+    }
+
 
     void PacketReader::readPackets( std::vector<struct RSP> &packets )
     {
@@ -74,7 +97,9 @@ namespace LOFAR
       if (inputIsUDP) {
         SocketStream &sstream = dynamic_cast<SocketStream&>(inputStream);
 
-        vector<unsigned> recvdSizes(packets.size());
+        if (recvdSizes.size() != packets.size()) {
+          recvdSizes.resize(packets.size());
+        }
         numRead = sstream.recvmmsg(&packets[0], sizeof(struct RSP), recvdSizes);
 
         nrReceived += numRead;
@@ -93,6 +118,7 @@ namespace LOFAR
       // mark unused packet buffers as invalid
       for (size_t i = numRead; i < packets.size(); ++i) {
         packets[i].payloadError(true);
+        packets[i].timeStampError(); // easier for RSP raw code to filter
       }
     }
 
@@ -134,7 +160,7 @@ namespace LOFAR
       }
 
       // illegal version means illegal packet
-      if (packet.header.version < 2) {
+      if (packet.header.version < 3) {
         // This mainly catches packets that are all zero (f.e. /dev/zero or
         // null: streams).
         ++nrBadOther;
@@ -192,6 +218,13 @@ namespace LOFAR
       mdLogger.log(mdKeyPrefix + streamStr + ".rejected",
                    (int)round(nrBad / interval));
 
+      // Update totals
+      totalNrReceived += nrReceived;
+      totalNrBadTime += nrBadTime;
+      totalNrBadMode += nrBadMode;
+      totalNrBadData += nrBadData;
+      totalNrBadOther += nrBadOther;
+
       // Reset counters
       nrReceived = 0;
       nrBadTime = 0;
diff --git a/RTCP/Cobalt/InputProc/src/Station/PacketReader.h b/RTCP/Cobalt/InputProc/src/Station/PacketReader.h
index 2140a4c27172e4ab66cfc089e19976f81e55239c..1556d34e4e69097de623144213e9e05352af3a5d 100644
--- a/RTCP/Cobalt/InputProc/src/Station/PacketReader.h
+++ b/RTCP/Cobalt/InputProc/src/Station/PacketReader.h
@@ -22,13 +22,13 @@
 #define LOFAR_INPUT_PROC_PACKETREADER_H
 
 #include <string>
+#include <vector>
 
 #include <Common/Exception.h>
 #include <Stream/SocketStream.h>
 #include <MACIO/RTmetadata.h>
-#include <InputProc/Buffer/BoardMode.h>
-
-#include "RSP.h"
+#include <CoInterface/RSP.h>
+#include "../Buffer/BoardMode.h"
 
 namespace LOFAR
 {
@@ -48,6 +48,8 @@ namespace LOFAR
       PacketReader( const std::string &logPrefix, Stream &inputStream,
                     const BoardMode &mode = MODE_ANY );
 
+      ~PacketReader();
+
       // Reads a set of packets from the input stream. Sets the payloadError
       // flag for all invalid packets.
       void readPackets( std::vector<struct RSP> &packets );
@@ -62,29 +64,38 @@ namespace LOFAR
                          const std::string &mdKeyPrefix);
 
     private:
-      const std::string logPrefix;
+      // The mode against which to validate (ignored if mode == MODE_ANY)
+      const BoardMode mode;
 
       // The stream from which packets are read.
       Stream &inputStream;
 
-      // The mode against which to validate (ignored if mode == MODE_ANY)
-      const BoardMode mode;
+      // For SocketStream recvmmsg() to indicate max nr packets to receive and to return bytes sent.
+      std::vector<unsigned> recvdSizes;
+
+      const std::string logPrefix;
 
       // Whether inputStream is an UDP stream
       // UDP streams do not allow partial reads and can use recvmmsg(2) (Linux).
       bool inputIsUDP;
 
       // Statistics covering the packets read so far
+      bool hadSizeError; // already reported about wrongly sized packets since last logStatistics()
       size_t nrReceived; // nr. of packets received
       size_t nrBadMode; // nr. of packets with wrong mode (clock, bit mode)
       size_t nrBadTime; // nr. of packets with an illegal time stamp
       size_t nrBadData; // nr. of packets with payload errors
       size_t nrBadOther; // nr. of packets that are bad in another fashion (illegal header, packet size, etc)
 
-      bool hadSizeError; // already reported about wrongly sized packets since last logStatistics()
+      size_t totalNrReceived;
+      size_t totalNrBadMode;
+      size_t totalNrBadTime;
+      size_t totalNrBadData;
+      size_t totalNrBadOther;
 
       double lastLogTime; // time since last log print, to monitor data rates
 
+
       // numbytes is the actually received size, as indicated by the kernel
       bool validatePacket(const struct RSP &packet, size_t numbytes);
     };
diff --git a/RTCP/Cobalt/InputProc/src/Station/PacketStream.h b/RTCP/Cobalt/InputProc/src/Station/PacketStream.h
index 0e61ba0eb32a16077ff0335e89bee9818f71a63f..4354c9521da55eb44b52c0d9973eba49d066e01a 100644
--- a/RTCP/Cobalt/InputProc/src/Station/PacketStream.h
+++ b/RTCP/Cobalt/InputProc/src/Station/PacketStream.h
@@ -24,9 +24,9 @@
 
 #include <Stream/Stream.h>
 #include <Common/Thread/Cancellation.h>
-#include <InputProc/RSPTimeStamp.h>
+#include <CoInterface/RSP.h>
+#include <CoInterface/RSPTimeStamp.h>
 #include "PacketFactory.h"
-#include "RSP.h"
 
 namespace LOFAR
 {
@@ -53,23 +53,26 @@ namespace LOFAR
       {
         Cancellation::point();
 
-        if (current >= to)
+        if (size == 0) {
+          return 0;
+        }
+
+        if (current >= to) {
           THROW(EndOfStreamException, "No data beyond " << to);
+        }
 
         if (offset == 0) {
           // generate new packet
           factory.makePacket(packet, current, boardNr);
-
           current += packet.header.nrBlocks;
         }
 
-        size_t numBytes = std::min(packet.packetSize() - offset, size);
-
+        size_t pktSize = packet.packetSize();
+        size_t numBytes = std::min(pktSize - offset, size);
         memcpy(ptr, reinterpret_cast<char*>(&packet) + offset, numBytes);
 
         offset += numBytes;
-
-        if (offset == packet.packetSize()) {
+        if (offset == pktSize) {
           // written full packet, so we'll need a new one on next read
           offset = 0;
         }
@@ -77,13 +80,60 @@ namespace LOFAR
         return numBytes;
       }
 
-      virtual size_t tryWrite(const void *ptr, size_t size)
+      virtual size_t tryWrite(const void * /*ptr*/, size_t /*size*/)
       {
-        // not supported
-        (void)ptr;
-        (void)size;
+        THROW(NotImplemented, "Writing to PacketStream is not supported");
+      }
 
-        THROW(EndOfStreamException, "Writing to PacketStream is not supported");
+      virtual size_t tryReadv(const struct iovec *iov, int iovcnt)
+      {
+        Cancellation::point();
+
+        size_t nread = 0;
+        for (int i = 0; i < iovcnt; i++) {
+          if (iov[i].iov_len == 0) {
+            continue;
+          }
+
+          if (current >= to) {
+            if (nread == 0) {
+              THROW(EndOfStreamException, "No data beyond " << to);
+            } else {
+              break;
+            }
+          }
+
+          if (offset == 0) {
+            // generate new packet
+            factory.makePacket(packet, current, boardNr);
+            current += packet.header.nrBlocks;
+          }
+
+          size_t pktSize = packet.packetSize();
+          size_t numBytes = std::min(pktSize - offset, iov[i].iov_len);
+          memcpy(iov[i].iov_base, reinterpret_cast<char*>(&packet) + offset, numBytes);
+
+          offset += numBytes;
+          if (offset == pktSize) {
+            // written full packet, so we'll need a new one on next read
+            offset = 0;
+          }
+
+          nread += numBytes;
+
+          // Mimic tryRead() impl above: max 1 (partial) packet per buffer.
+          // Then we can only use the next iov if we could exactly fill the previous, else our retval is ambiguous.
+          if (numBytes < pktSize) {
+            break;
+          }
+        }
+
+        return nread;
+      }
+
+      virtual size_t tryWritev(const struct iovec * /*iov*/, int /*iovcnt*/)
+      {
+        THROW(NotImplemented, "Writing to PacketStream is not supported");
       }
 
     private:
diff --git a/RTCP/Cobalt/InputProc/src/Station/filterRSP.cc b/RTCP/Cobalt/InputProc/src/Station/filterRSP.cc
index 80dacfdf124dc21824d9d86867818cb6fcb0809a..a08a7c694b8873e70fb71e8fbf2258db561d540a 100644
--- a/RTCP/Cobalt/InputProc/src/Station/filterRSP.cc
+++ b/RTCP/Cobalt/InputProc/src/Station/filterRSP.cc
@@ -33,7 +33,7 @@
 #include <Stream/StreamFactory.h>
 #include <ApplCommon/PosixTime.h>
 #include <CoInterface/SmartPtr.h>
-#include "RSP.h"
+#include <CoInterface/RSP.h>
 #include "PacketReader.h"
 
 using namespace LOFAR;
diff --git a/RTCP/Cobalt/InputProc/src/Station/generateRSP.cc b/RTCP/Cobalt/InputProc/src/Station/generateRSP.cc
index 26c453f790e7708f478f822dd0ab22091fe4a911..315bf18f8fb7571bf5f0d8e7cc2603911419b24a 100644
--- a/RTCP/Cobalt/InputProc/src/Station/generateRSP.cc
+++ b/RTCP/Cobalt/InputProc/src/Station/generateRSP.cc
@@ -33,9 +33,9 @@
 #include <ApplCommon/PosixTime.h>
 #include <Stream/StreamFactory.h>
 #include <CoInterface/SmartPtr.h>
+#include <CoInterface/RSP.h>
+#include <CoInterface/RSPTimeStamp.h>
 #include <InputProc/Buffer/BoardMode.h>
-#include <InputProc/RSPTimeStamp.h>
-#include <InputProc/Station/RSP.h>
 #include <InputProc/Station/RSPPacketFactory.h>
 
 using namespace std;
diff --git a/RTCP/Cobalt/InputProc/src/Station/printRSP.cc b/RTCP/Cobalt/InputProc/src/Station/printRSP.cc
index 4ad2daeddcca35f017f8ee0307e0f80485ab4338..abd5da267a8dfff73efe717b2957804f66d6932c 100644
--- a/RTCP/Cobalt/InputProc/src/Station/printRSP.cc
+++ b/RTCP/Cobalt/InputProc/src/Station/printRSP.cc
@@ -21,8 +21,6 @@
 //# Always #include <lofar_config.h> first!
 #include <lofar_config.h>
 
-#include "RSP.h"
-
 #include <ctime>
 #include <cstring>
 #include <cstdlib>
@@ -33,7 +31,8 @@
 #include <Common/LofarLogger.h>
 #include <Common/DataConvert.h>
 #include <Stream/FileStream.h>
-#include <InputProc/RSPTimeStamp.h>
+#include <CoInterface/RSP.h>
+#include <CoInterface/RSPTimeStamp.h>
 
 using namespace LOFAR;
 using namespace LOFAR::Cobalt;
@@ -45,6 +44,7 @@ void report( const string &filename )
 
   struct RSP packet;
 
+  // NOTE: this program is used in output verification in some test case(s). Expect a few tests to break when changing output formatting.
   try {
     for(;;) {
       // read header
diff --git a/RTCP/Cobalt/InputProc/src/Station/repairRSP.cc b/RTCP/Cobalt/InputProc/src/Station/repairRSP.cc
index d45caa76b51b162a78a33422d604079c9d32073f..26c5d28e608a3608368816a5f8fdc0a2d2cfa605 100644
--- a/RTCP/Cobalt/InputProc/src/Station/repairRSP.cc
+++ b/RTCP/Cobalt/InputProc/src/Station/repairRSP.cc
@@ -33,7 +33,7 @@
 #include <ApplCommon/PosixTime.h>
 #include <Stream/StreamFactory.h>
 #include <CoInterface/SmartPtr.h>
-#include "RSP.h"
+#include <CoInterface/RSP.h>
 #include "PacketReader.h"
 
 using namespace LOFAR;
diff --git a/RTCP/Cobalt/InputProc/src/Transpose/MPISendStation.h b/RTCP/Cobalt/InputProc/src/Transpose/MPISendStation.h
index 122ac6c805a1db15b00bbc3d957f427cb2d5a7bd..aacf5e61d6a3652a801e94509a70c095508340ee 100644
--- a/RTCP/Cobalt/InputProc/src/Transpose/MPISendStation.h
+++ b/RTCP/Cobalt/InputProc/src/Transpose/MPISendStation.h
@@ -28,8 +28,8 @@
 #include <CoInterface/MultiDimArray.h>
 #include <CoInterface/SubbandMetaData.h>
 #include <CoInterface/SmartPtr.h>
+#include <CoInterface/RSPTimeStamp.h>
 
-#include <InputProc/RSPTimeStamp.h>
 #include "MPIProtocol.h"
 #include "MPIUtil.h"
 
diff --git a/RTCP/Cobalt/InputProc/src/WallClockTime.h b/RTCP/Cobalt/InputProc/src/WallClockTime.h
index 73fece5c1ac82e2192d4dab99390cf958ef7c20a..5211a3ffc060a7190a1f4e4a13223631bc1bd297 100644
--- a/RTCP/Cobalt/InputProc/src/WallClockTime.h
+++ b/RTCP/Cobalt/InputProc/src/WallClockTime.h
@@ -28,7 +28,7 @@
 
 #include <Common/Thread/Mutex.h>
 #include <Common/Thread/Condition.h>
-#include <InputProc/RSPTimeStamp.h>
+#include <CoInterface/RSPTimeStamp.h>
 
 
 namespace LOFAR
diff --git a/RTCP/Cobalt/InputProc/test/CMakeLists.txt b/RTCP/Cobalt/InputProc/test/CMakeLists.txt
index 5c9d7134fb8a880e65f33d6afa5a1667dd822c9f..f18cc90dac158c9ace99e76990a6f84e5a367dbd 100644
--- a/RTCP/Cobalt/InputProc/test/CMakeLists.txt
+++ b/RTCP/Cobalt/InputProc/test/CMakeLists.txt
@@ -6,10 +6,8 @@ if(UNITTEST++_FOUND)
   lofar_add_test(tRanges tRanges.cc)
 
   lofar_add_test(tDelays tDelays.cc)
-  lofar_add_test(tRSPTimeStamp tRSPTimeStamp.cc)
 endif(UNITTEST++_FOUND)
 
-lofar_add_test(tRSP tRSP.cc)
 lofar_add_test(tPacketReader tPacketReader.cc)
 lofar_add_test(tPacketFactory tPacketFactory.cc)
 lofar_add_test(tGenerator tGenerator.cc)
diff --git a/RTCP/Cobalt/InputProc/test/tPacketReader.cc b/RTCP/Cobalt/InputProc/test/tPacketReader.cc
index a689800de0a9123c892c5068d12d9f77ea6ca34b..3f5676bcdeafe53162582b0a61e0043f28529d92 100644
--- a/RTCP/Cobalt/InputProc/test/tPacketReader.cc
+++ b/RTCP/Cobalt/InputProc/test/tPacketReader.cc
@@ -25,8 +25,8 @@
 #include <Common/LofarLogger.h>
 #include <Stream/FileStream.h>
 
+#include <CoInterface/RSP.h>
 #include <InputProc/Station/PacketReader.h>
-#include <InputProc/Station/RSP.h>
 
 using namespace LOFAR;
 using namespace Cobalt;
diff --git a/RTCP/Cobalt/OutputProc/scripts/tbb-printframes.cc b/RTCP/Cobalt/OutputProc/scripts/tbb-printframes.cc
index e293b1aee9605d11515b4d2f448fe73506420089..1856d96ad06af8d59fd315f0c7bf0c1aaeded722 100644
--- a/RTCP/Cobalt/OutputProc/scripts/tbb-printframes.cc
+++ b/RTCP/Cobalt/OutputProc/scripts/tbb-printframes.cc
@@ -1,6 +1,6 @@
 /* tbb-printframes.cc
  * Author: Alexander S. van Amesfoort, ASTRON
- * Last-modified: Jun 2013
+ * Last-modified: Aug 2017
  * build: g++ -Wall -o tbb-printframes tbb-printframes.cc
  */
 
@@ -23,18 +23,14 @@ struct TBB_Header {
 
 	uint32_t seqNr;		// Used internally by TBB. Set to 0 by RSP (but written again before we receive it)
 	uint32_t time;		// Time instance in seconds of the first sample in payload
-	// The time field is relative, but if used as UNIX time, uint32_t will wrap at 06:28:15 UTC on 07 Feb 2106 (int32_t wraps at 03:14:08 UTC on 19 Jan 2038).
+        // The time field is relative, but if used as UNIX time, uint32_t wraps at 06:28:15 UTC on 07 Feb 2106
+        // (int32_t wraps at 03:14:08 UTC on 19 Jan 2038)
 
-	union {
-		// In transient mode indicates sample number of the first payload sample in current seconds interval.
-		uint32_t sampleNr;
-
-		// In spectral mode indicates frequency band and slice (transform block of 1024 samples) of first payload sample.
-		uint32_t bandSliceNr; // bandNr[9:0] and sliceNr[31:10].
-		// Avoid bit fields, (portable) compilation support is messy. Instead use mask and shift to decode.
-#define TBB_BAND_NR_MASK	((1 << 10) - 1) 
-#define TBB_SLICE_NR_SHIFT	10
-	};
+        // In transient mode indicates sample number of the first payload sample in current seconds interval.
+        // In spectral mode indicates frequency band and slice (transform block of 1024 samples) of first payload sample.
+        uint32_t sampleNrOrBandSliceNr; // in spectral mode: bandNr[9:0] and sliceNr[31:10].
+#define TBB_SLICE_NR_SHIFT      10
+#define TBB_BAND_NR_MASK        ((1 << TBB_SLICE_NR_SHIFT) - 1)
 
 	uint16_t nOfSamplesPerFrame; // Total number of samples in the frame payload
 	uint16_t nOfFreqBands;	// Number of frequency bands for each spectrum in spectral mode. Is set to 0 for transient mode.
@@ -63,23 +59,23 @@ void printHeader(const TBB_Header& h) {
 	bool transient = h.nOfFreqBands == 0;
 	if (transient) {
 		cout << "Transient" << endl;
-		cout << "Sample Nr:   " << h.sampleNr << endl;
+		cout << "Sample Nr:   " << h.sampleNrOrBandSliceNr << endl;
 	} else {
 		cout << "Spectral" << endl;
-		cout << "Band Nr:     " << (h.bandSliceNr & TBB_BAND_NR_MASK) << endl;
-		cout << "Slice Nr:    " << (h.bandSliceNr >> TBB_SLICE_NR_SHIFT) << endl;
+		cout << "Band Nr:     " << (h.sampleNrOrBandSliceNr & TBB_BAND_NR_MASK) << " (real packet headers indicate this may be not the band nr but an index(?))" << endl;
+		cout << "Slice Nr:    " << (h.sampleNrOrBandSliceNr >> TBB_SLICE_NR_SHIFT) << endl;
 	}
 	cout << "NSamples/fr: " << h.nOfSamplesPerFrame << endl;
 	if (!transient) {
 		cout << "NFreq Bands: " << h.nOfFreqBands << endl;
 
 		bool anyBandsPresent = false;
-		cout << "Band(s) present(?): ";
-		for (unsigned i = 0; i < 64; ++i) {
-			for (unsigned j = 8; j > 0; ) {
-				--j;
+		cout << "Band(s) present: ";
+		for (unsigned i = 0; i < 64; i++) {
+			for (unsigned j = 0; j < 8; j++) {
 				if (h.bandSel[i] & (1 << j)) {
-					cout << 8 * i + (8-1-j) << " ";
+                                        unsigned bandNr = 8 * i + j;
+					cout << bandNr << " ";
 					anyBandsPresent = true;
 				}
 			}
@@ -122,21 +118,20 @@ void printFakeInput() {
 	hdr0.sampleFreq = 200;
 	hdr0.seqNr = 10000;
 	hdr0.time = 1380240059;
-	hdr0.bandSliceNr = (17 << 10) | 11; // sliceNr=17; bandNr is 11
+	hdr0.sampleNrOrBandSliceNr = (17 << TBB_SLICE_NR_SHIFT) | 14; // sliceNr=17; bandNr is 14 (but from real data, the 1st band nr emitted is always 0, so maybe it's an index in the requested (but sorted?) band list?)
 	hdr0.nOfSamplesPerFrame = 487;
-	hdr0.nOfFreqBands = 487/8 * 7 + 7; // 427, as set in the sb bitmap below
+	hdr0.nOfFreqBands = 487/8 * 2 + 2; // 122, as set in the sb bitmap below
 
 	// subband bitmap
-	// I'm not 100% if the bits are populated from most to least significant...
 	int i;
 	for (i = 0; i < 487/8; i++)
-		hdr0.bandSel[i] = 0x7f;
-	hdr0.bandSel[i++] = 0xfe; // remaining 7 bits to cover all 487 meaningful bits
-	for ( ; i < 64; i++)
+		hdr0.bandSel[i] = 0x41; // in the 1st octet, this corresponds to bands 0 and 6
+	for ( ; i < 63; i++)
 		hdr0.bandSel[i] = 0;
+	hdr0.bandSel[i] = 0x82; // bands 505 and 511
 
 	hdr0.spare = 0;
-	hdr0.crc16 = 1;
+	hdr0.crc16 = 1; // some val, likely incorrect
 
 	printHeader(hdr0);
 }
diff --git a/RTCP/Cobalt/OutputProc/src/CMakeLists.txt b/RTCP/Cobalt/OutputProc/src/CMakeLists.txt
index 1646bd68ba413369a020210fa21bb6f57c3d266f..8f49b558927d3597d65e298e30f8c49a14400f95 100644
--- a/RTCP/Cobalt/OutputProc/src/CMakeLists.txt
+++ b/RTCP/Cobalt/OutputProc/src/CMakeLists.txt
@@ -23,7 +23,13 @@ lofar_add_library(outputproc
   CommonLofarAttributes.cc
   OutputThread.cc
   SubbandWriter.cc
+  RSPRawWriter.cc
+  TBB_Dipole.cc
+  TBB_Frame.cc
   TBB_StaticMapping.cc
+  TBB_Station.cc
+  TBB_StreamWriter.cc
+  TBB_Writer.cc
 )
 
 lofar_add_sbin_scripts(gnuplotMS.sh)
@@ -35,7 +41,7 @@ install(FILES
 
 lofar_add_bin_program(outputProc outputProc.cc)
 lofar_add_bin_program(versionoutputproc versionoutputproc.cc)
-lofar_add_bin_program(TBB_Writer TBB_Writer_main.cc TBB_Writer.cc)
+lofar_add_bin_program(TBB_Writer TBB_Writer_main.cc)
 
 lofar_add_sbin_program(createHeaders createHeaders.cc)
 lofar_add_sbin_program(plotMS plotMS.cc)
diff --git a/RTCP/Cobalt/OutputProc/src/CommonLofarAttributes.cc b/RTCP/Cobalt/OutputProc/src/CommonLofarAttributes.cc
index 1c1d9832a7a6b82f761fa9a6140128b4b17cbd7f..51b0c2298355a24e1e7fa1d7efed962c04cfb833 100644
--- a/RTCP/Cobalt/OutputProc/src/CommonLofarAttributes.cc
+++ b/RTCP/Cobalt/OutputProc/src/CommonLofarAttributes.cc
@@ -135,7 +135,7 @@ namespace LOFAR
       }
       // max freq is shifted if 2nd PPF is active for all types in obs
       // min freq is shifted if 2nd PPF is active for any type in obs
-      bool applyPPFtoMax = nrAppliedPPFs == parset.nrObsOutputTypes();
+      bool applyPPFtoMax = nrAppliedPPFs == parset.nrProcessedOutputTypes();
       bool applyPPFtoMin = nrAppliedPPFs > 0;
 
       vector<double> subbandCenterFrequencies(parset.settings.subbands.size());
diff --git a/RTCP/Cobalt/OutputProc/src/FastFileStream.h b/RTCP/Cobalt/OutputProc/src/FastFileStream.h
index 5b1c4335f83d3a46a627de78eb8bfa950c9505d6..07aa449251ac53805a4dc4585c14c456cd85afc4 100644
--- a/RTCP/Cobalt/OutputProc/src/FastFileStream.h
+++ b/RTCP/Cobalt/OutputProc/src/FastFileStream.h
@@ -43,7 +43,11 @@ namespace LOFAR
       virtual size_t size();
 
       // formally, the required alignment for O_DIRECT is determined by the file system
-      static const size_t alignment = 512;
+      // for local disks, 512 is a typical default.
+      // for Lustre, 4096 is required.
+      //
+      // use odirect.c to find the required alignment for a specific file system
+      static const size_t alignment = 4096;
     private:
       // writes the remainder, padded with zeros if needed. Returns the number of zero-pad bytes written.
       size_t writeRemainder();
diff --git a/RTCP/Cobalt/OutputProc/src/GPUProcIO.cc b/RTCP/Cobalt/OutputProc/src/GPUProcIO.cc
index 2de0dd6ea531f242f00aff12eaaaf908df65d480..b577f14322a1a921f6c2f0355e69ba5137f708b9 100644
--- a/RTCP/Cobalt/OutputProc/src/GPUProcIO.cc
+++ b/RTCP/Cobalt/OutputProc/src/GPUProcIO.cc
@@ -1,5 +1,6 @@
 //# GPUProcIO.cc: Routines for communicating with GPUProc
-//# Copyright (C) 2008-2014  ASTRON (Netherlands Institute for Radio Astronomy)
+//# Copyright (C) 2008-2014, 2017
+//# ASTRON (Netherlands Institute for Radio Astronomy)
 //# P.O. Box 2, 7990 AA Dwingeloo, The Netherlands
 //#
 //# This file is part of the LOFAR software suite.
@@ -51,6 +52,7 @@
 #include <CoInterface/SmartPtr.h>
 #include <CoInterface/SelfDestructTimer.h>
 #include "SubbandWriter.h"
+#include "RSPRawWriter.h"
 #include "OutputThread.h"
 
 using namespace LOFAR;
@@ -154,6 +156,7 @@ bool process(Stream &controlStream)
 
     vector<SmartPtr<SubbandWriter> > subbandWriters;
     vector<SmartPtr<TABOutputThread> > tabWriters;
+    vector<SmartPtr<RSPRawWriter> > rspRawWriters;
 
     /*
      * Construct writers
@@ -169,17 +172,17 @@ bool process(Stream &controlStream)
           continue;
         }
 
-        LOG_INFO_STR("starting with fileIdx " << fileIdx);
+        LOG_DEBUG_STR("starting with fileIdx " << fileIdx);
 
         mdLogger.log(mdKeyPrefix + PN_COP_STORAGE_HOST + '[' + lexical_cast<string>(fileIdx) + ']', myHostName);
 
-        string logPrefix = str(format("[obs %u correlated stream %3u] ")
-                               % parset.settings.observationID % fileIdx);
+        string logPrefix = str(format("[stream %3u file %s] ")
+                               % fileIdx % file.location.filename);
 
         SubbandWriter *writer = new SubbandWriter(parset, fileIdx, mdLogger, mdKeyPrefix, logPrefix);
         subbandWriters.push_back(writer);
 
-        LOG_INFO_STR("done with fileIdx " << fileIdx);
+        LOG_DEBUG_STR("done with fileIdx " << fileIdx);
       }
     }
 
@@ -198,10 +201,10 @@ bool process(Stream &controlStream)
           continue;
         }
 
-        const unsigned allFileIdx = fileIdx + parset.settings.correlator.files.size();
+        const unsigned allFileIdx = fileIdx + (parset.settings.correlator.enabled ? parset.settings.correlator.files.size() : 0);
         mdLogger.log(mdKeyPrefix + PN_COP_STORAGE_HOST + '[' + lexical_cast<string>(allFileIdx) + ']', myHostName);
 
-        LOG_INFO_STR("Allocating transpose buffers for " << file.location.filename);
+        LOG_DEBUG_STR("Allocating transpose buffers for " << file.location.filename);
 
         struct ObservationSettings::BeamFormer::StokesSettings &stokes =
           file.coherent ? parset.settings.beamFormer.coherentSettings
@@ -217,33 +220,56 @@ bool process(Stream &controlStream)
 
         arenas[fileIdx] = new MallocedArena(poolSize * (MultiDimArray<float,3>::nrElements(boost::extents[nrSamples][nrSubbands][nrChannels]) * sizeof(float) + alignment), alignment);
         allocators[fileIdx] = new SparseSetAllocator(*arenas[fileIdx]);
-        outputPools[fileIdx] = new Pool<TABTranspose::BeamformedData>(str(format("process::outputPool [file %u]") % fileIdx), parset.settings.realTime);
+        outputPools[fileIdx] = new Pool<TABTranspose::BeamformedData>(str(format("process::outputPool [stream %u]") % fileIdx), parset.settings.realTime);
 
         // Create and fill an outputPool for this fileIdx
-        for (size_t i = 0; i < poolSize; ++i) {
-	         outputPools[fileIdx]->free.append(new TABTranspose::BeamformedData(
-             boost::extents[nrSamples][nrSubbands][nrChannels],
-             boost::extents[nrSubbands][nrChannels],
-             *allocators[fileIdx]
-           ), false);
-        }
+        for (size_t i = 0; i < poolSize; ++i)
+	      outputPools[fileIdx]->free.append(new TABTranspose::BeamformedData(nrSubbands, nrChannels, nrSamples, *allocators[fileIdx]), false);
+
+        string logPrefix = str(format("[stream %3u file %s] ")
+                                                    % fileIdx % file.location.filename);
 
         // Create a collector for this fileIdx
-        // #blocks here is the number of blocks that can be constructed in parallel on
+        // #blocks here is the number of blocks that can be collected in parallel on
         // the input side (what the correlator sends)
         collectors[fileIdx] = new TABTranspose::BlockCollector(
-          *outputPools[fileIdx], fileIdx, nrSubbands, nrChannels, nrSamples, parset.settings.nrBlocks(), parset.settings.realTime ? 5 : 0);
+          *outputPools[fileIdx], fileIdx, nrSubbands, nrChannels, nrSamples, parset.settings.nrBlocks(), parset.settings.realTime ? 5 : 0, logPrefix);
 
-        string logPrefix = str(format("[obs %u beamformed stream %3u] ")
-                                                    % parset.settings.observationID % fileIdx);
-
-        LOG_INFO_STR("Setting up writer for " << file.location.filename);
+        LOG_DEBUG_STR("Setting up writer for " << file.location.filename);
 
         TABOutputThread *writer = new TABOutputThread(parset, fileIdx, *outputPools[fileIdx], mdLogger, mdKeyPrefix, logPrefix);
         tabWriters.push_back(writer);
       }
     }
 
+    if (parset.settings.rspRaw.enabled) {
+      for (size_t fileIdx = 0; fileIdx < parset.settings.rspRaw.files.size(); ++fileIdx)
+      {
+        struct ObservationSettings::RSPRaw::File &file = parset.settings.rspRaw.files[fileIdx];
+
+        if (myHostNames.find(file.location.host) == myHostNames.end()) {
+          continue;
+        }
+
+        LOG_INFO_STR("starting with RSP raw fileIdx " << fileIdx);
+
+        // The rest of the system doesn't know about RSP raw data output, but if monitoring did, enable this:
+        /*
+        const unsigned allFileIdx = fileIdx + (parset.settings.correlator.enabled ? parset.settings.correlator.files.size() : 0) +
+                                              (parset.settings.beamFormer.enabled ? parset.settings.beamFormer.files.size() : 0);
+        mdLogger.log(mdKeyPrefix + PN_COP_STORAGE_HOST + '[' + lexical_cast<string>(allFileIdx) + ']', myHostName);
+        */
+
+        string logPrefix = str(format("[obs %u RSP raw stream %3u] ")
+                               % parset.settings.observationID % fileIdx);
+
+        RSPRawWriter *writer = new RSPRawWriter(parset, fileIdx, mdLogger, mdKeyPrefix, logPrefix);
+        rspRawWriters.push_back(writer);
+
+        LOG_INFO_STR("done with RSP raw fileIdx " << fileIdx);
+      }
+    }
+
     LOG_INFO_STR("Finished setting up writers");
 
     /*
@@ -256,7 +282,7 @@ bool process(Stream &controlStream)
     TABTranspose::MultiReceiver mr("2nd-transpose-", collectors);
 
 
-#   pragma omp parallel sections num_threads(3)
+#   pragma omp parallel sections num_threads(4)
     {
       // Done signal from controller, by sending the final meta data
 #     pragma omp section
@@ -312,6 +338,18 @@ bool process(Stream &controlStream)
           tabWriters[i]->process();
         }
       }
+
+      // RSPRawWriters
+#     pragma omp section
+      {
+        OMPThread::ScopedName sn("rspRawWr");
+
+#       pragma omp parallel for num_threads(rspRawWriters.size())
+        for (int i = 0; i < (int)rspRawWriters.size(); ++i) {
+          OMPThread::ScopedName sn(str(format("rspRawWr %u") % rspRawWriters[i]->streamNr()));
+          rspRawWriters[i]->process();
+        }
+      }
     }
 
     /*
@@ -361,6 +399,21 @@ bool process(Stream &controlStream)
       bus.send(msg);
     }
 
+    // The rest of the system doesn't know about RSP raw data output, but if feedback did, enable this:
+    /*
+    for (size_t i = 0; i < rspRawWriters.size(); ++i) {
+      Protocols::TaskFeedbackDataproducts msg(
+        myName,
+        "",
+        str(boost::format("Feedback for RSP Raw Data, file nr %s") % rspRawWriters[i]->streamNr()),
+        str(format("%s") % parset.settings.momID),
+        str(format("%s") % parset.settings.observationID),
+        rspRawWriters[i]->feedbackLTA());
+
+      bus.send(msg);
+    }
+    */
+
     /*
      * SIGN OFF
      */
diff --git a/RTCP/Cobalt/OutputProc/src/GPUProcIO.h b/RTCP/Cobalt/OutputProc/src/GPUProcIO.h
index ba1ec28282962f4aeafd7570fde1f0ddedb7f857..dbab9c828e53b3f4bd919746f5fc75b475bafad8 100644
--- a/RTCP/Cobalt/OutputProc/src/GPUProcIO.h
+++ b/RTCP/Cobalt/OutputProc/src/GPUProcIO.h
@@ -1,5 +1,6 @@
 //# GPUProcIO.h
-//# Copyright (C) 2009-2014  ASTRON (Netherlands Institute for Radio Astronomy)
+//# Copyright (C) 2009-2014, 2017
+//# ASTRON (Netherlands Institute for Radio Astronomy)
 //# P.O. Box 2, 7990 AA Dwingeloo, The Netherlands
 //#
 //# This file is part of the LOFAR software suite.
@@ -34,7 +35,7 @@ namespace LOFAR
     // Receive and process a full observation. Will:
     //   * Receive a Parset over the controlStream
     //   * Fulfill roles for parset.settings.outputProcHosts[myRank]:
-    //       - Start SubbandWriters/TABWriters
+    //       - Start SubbandWriters/TABWriters/RSPRawWriters
     //       - Receive input and write output for all of them
     //   * Call readFinalMetaData to obtain the final metadata from GPUProc,
     //     and send it to all writers.
diff --git a/RTCP/Cobalt/OutputProc/src/InputThread.cc b/RTCP/Cobalt/OutputProc/src/InputThread.cc
index f520d26ddbeed9c844aa5f8d1354aacb7687bbbb..a34218e8269108a4361899cbe32b2f26825d26fd 100644
--- a/RTCP/Cobalt/OutputProc/src/InputThread.cc
+++ b/RTCP/Cobalt/OutputProc/src/InputThread.cc
@@ -1,5 +1,6 @@
 //# InputThread.cc
-//# Copyright (C) 2008-2013  ASTRON (Netherlands Institute for Radio Astronomy)
+//# Copyright (C) 2008-2013, 2017
+//# ASTRON (Netherlands Institute for Radio Astronomy)
 //# P.O. Box 2, 7990 AA Dwingeloo, The Netherlands
 //#
 //# This file is part of the LOFAR software suite.
@@ -34,15 +35,20 @@ namespace LOFAR
 {
   namespace Cobalt
   {
-    InputThread::InputThread(const Parset &parset,
+    InputThread::InputThread(const Parset &parset, OutputType outputType,
                              unsigned streamNr, Pool<StreamableData> &outputPool,
                              const std::string &logPrefix)
       :
       itsLogPrefix(logPrefix + "[InputThread] "),
-      itsInputDescriptor(getStreamDescriptorBetweenIONandStorage(parset, CORRELATED_DATA, streamNr)),
+      itsNrIntegrationsReceived(0),
+      itsNrIntegrations(outputType == CORRELATED_DATA ? parset.settings.correlator.nrIntegrations :
+                                                        parset.settings.nrRspRawBlocks()),
+      itsInputDescriptor(getStreamDescriptorBetweenIONandStorage(parset, outputType, streamNr)),
       itsOutputPool(outputPool),
       itsDeadline(parset.settings.realTime ? parset.settings.stopTime : 0)
     {
+      ASSERT((parset.settings.correlator.enabled && outputType == CORRELATED_DATA) ||
+             (parset.settings.rspRaw.enabled     && outputType == RSP_RAW_DATA));
     }
 
 
@@ -54,18 +60,29 @@ namespace LOFAR
         LOG_INFO_STR(itsLogPrefix << "Creating connection from " << itsInputDescriptor << ": done" );
 
         for(SmartPtr<StreamableData> data; (data = itsOutputPool.free.remove()) != NULL; itsOutputPool.filled.append(data)) {
-          data->read(streamFromION, true, 1); // Cobalt writes with an alignment of 1
+          data->read(streamFromION, 1); // Cobalt writes with an alignment of 1
+          ++itsNrIntegrationsReceived; // for RSP_RAW_DATA we need to count bytes, but N/A here
 
-          LOG_DEBUG_STR(itsLogPrefix << "Read block with seqno = " << data->sequenceNumber());
+          LOG_DEBUG_STR(itsLogPrefix << "Received data block with seq nr " << data->sequenceNumber());
         }
       } catch (TimeOutException &) {
         LOG_WARN_STR(itsLogPrefix << "Connection from " << itsInputDescriptor << " timed out");
       } catch (EndOfStreamException &) {
-        LOG_INFO_STR(itsLogPrefix << "Connection from " << itsInputDescriptor << " closed");
+        LOG_INFO_STR(itsLogPrefix << "Connection from " << itsInputDescriptor << " closed by foreign host");
       } catch (SystemCallException &ex) {
         LOG_WARN_STR(itsLogPrefix << "Connection from " << itsInputDescriptor << " failed: " << ex.text());
       }
 
+      // report statistics
+      const float didNotReceivePerc = itsNrIntegrations == 0 ? 0.0 : 100.0 - 100.0 * itsNrIntegrationsReceived / itsNrIntegrations;
+      const float didNotSendPerc = didNotReceivePerc;
+
+      if (didNotReceivePerc > 0)
+        LOG_WARN_STR(itsLogPrefix << "Did not receive " << didNotReceivePerc << "% of the data: received=" <<
+                     itsNrIntegrationsReceived << " expected=" << itsNrIntegrations);
+      if (didNotSendPerc > 0)
+        LOG_WARN_STR(itsLogPrefix << "Did not send " << didNotSendPerc << "% of the data");
+
       // Append end-of-stream marker
       itsOutputPool.filled.append(NULL);
     }
diff --git a/RTCP/Cobalt/OutputProc/src/InputThread.h b/RTCP/Cobalt/OutputProc/src/InputThread.h
index 30bf2218c91189cae469caae16a16dbd0ea5ee60..515aa20dcf858010ee8b7159588eddec4e8a1e15 100644
--- a/RTCP/Cobalt/OutputProc/src/InputThread.h
+++ b/RTCP/Cobalt/OutputProc/src/InputThread.h
@@ -1,5 +1,6 @@
 //# InputThread.h
-//# Copyright (C) 2008-2013  ASTRON (Netherlands Institute for Radio Astronomy)
+//# Copyright (C) 2008-2013, 2017
+//# ASTRON (Netherlands Institute for Radio Astronomy)
 //# P.O. Box 2, 7990 AA Dwingeloo, The Netherlands
 //#
 //# This file is part of the LOFAR software suite.
@@ -28,6 +29,7 @@
 #include <CoInterface/Parset.h>
 #include <CoInterface/Pool.h>
 #include <CoInterface/StreamableData.h>
+#include <CoInterface/OutputTypes.h>
 
 
 namespace LOFAR
@@ -42,12 +44,13 @@ namespace LOFAR
      * The Stream is created from the parset through using
      * getStreamDescriptorBetweenIONandStorage.
      *
-     * This class is designed to handle visibilities only.
+     * This class is designed to handle visibility (UV) and RSP raw data.
      */
     class InputThread
     {
     public:
       InputThread(const Parset &parset,
+                  OutputType outputType,
                   unsigned streamNr,
                   Pool<StreamableData> &outputPool,
                   const std::string &logPrefix);
@@ -55,7 +58,14 @@ namespace LOFAR
       virtual void process();
 
     private:
-      const std::string itsLogPrefix, itsInputDescriptor;
+      const std::string itsLogPrefix;
+
+      // We receive integration "blocks" (UV);
+      // for RSP raw it is a stream of (up to) some block size bytes.
+      size_t itsNrIntegrationsReceived;
+      const size_t itsNrIntegrations;
+
+      const std::string itsInputDescriptor;
       Pool<StreamableData> &itsOutputPool;
       const double itsDeadline;
     };
diff --git a/RTCP/Cobalt/OutputProc/src/MSWriterDAL.cc b/RTCP/Cobalt/OutputProc/src/MSWriterDAL.cc
index 8b4aed8d6a14b233ce9ba91b04bd4436d027a3d9..6bf21ba685d6aa00dc89ed3d6395045429b19c5e 100644
--- a/RTCP/Cobalt/OutputProc/src/MSWriterDAL.cc
+++ b/RTCP/Cobalt/OutputProc/src/MSWriterDAL.cc
@@ -78,8 +78,8 @@ namespace LOFAR
     // uses global locks too anyway.
     static Mutex HDF5Mutex;
 
-    template <typename T,unsigned DIM>
-    MSWriterDAL<T,DIM>::MSWriterDAL (const string &filename,
+    template <typename T,unsigned DIM, unsigned FLAGS_DIM>
+    MSWriterDAL<T,DIM,FLAGS_DIM>::MSWriterDAL (const string &filename,
      const Parset &parset,
      unsigned fileno)
       :
@@ -113,8 +113,8 @@ namespace LOFAR
       itsConfigurationPrefix = fb.beamFormedPrefix(itsFileNr);
     }
 
-    template <typename T,unsigned DIM>
-    void MSWriterDAL<T,DIM>::init()
+    template <typename T,unsigned DIM, unsigned FLAGS_DIM>
+    void MSWriterDAL<T,DIM,FLAGS_DIM>::init()
     {
       string h5filename = forceextension(itsFilename, ".h5");
       string rawfilename = forceextension(itsFilename, ".raw");
@@ -451,15 +451,15 @@ namespace LOFAR
       stokesDS.nofSamples().value = dims[0];
     }
 
-    template <typename T,unsigned DIM>
-    MSWriterDAL<T,DIM>::~MSWriterDAL()
+    template <typename T,unsigned DIM, unsigned FLAGS_DIM>
+    MSWriterDAL<T,DIM,FLAGS_DIM>::~MSWriterDAL()
     {
     }
 
-    template <typename T,unsigned DIM>
-    void MSWriterDAL<T,DIM>::write(StreamableData *data)
+    template <typename T,unsigned DIM, unsigned FLAGS_DIM>
+    void MSWriterDAL<T,DIM,FLAGS_DIM>::write(StreamableData *data)
     {
-      SampleData<T,DIM> *sdata = dynamic_cast<SampleData<T,DIM> *>(data);
+      SampleData<T,DIM,FLAGS_DIM> *sdata = dynamic_cast<SampleData<T,DIM,FLAGS_DIM> *>(data);
 
       ASSERT( data );
       ASSERT( sdata );
diff --git a/RTCP/Cobalt/OutputProc/src/MSWriterDAL.h b/RTCP/Cobalt/OutputProc/src/MSWriterDAL.h
index 8f9c552cbde8a5aa01535de8fdab279e0c7b43ab..ca25c939e1f5bda3f25865a58bbe533d31ac5265 100644
--- a/RTCP/Cobalt/OutputProc/src/MSWriterDAL.h
+++ b/RTCP/Cobalt/OutputProc/src/MSWriterDAL.h
@@ -38,7 +38,7 @@ namespace LOFAR
 
   namespace Cobalt
   {
-    template<typename T, unsigned DIM>
+    template<typename T, unsigned DIM, unsigned FLAGS_DIM=1>
     class MSWriterDAL : public MSWriterFile
     {
     public:
diff --git a/RTCP/Cobalt/OutputProc/src/MSWriterFile.cc b/RTCP/Cobalt/OutputProc/src/MSWriterFile.cc
index ebbea6c74b6ba4794414fd889a32fcd6ecb7a3c1..e789a08069cbc0450cbdf8114fc9785af914bbac 100644
--- a/RTCP/Cobalt/OutputProc/src/MSWriterFile.cc
+++ b/RTCP/Cobalt/OutputProc/src/MSWriterFile.cc
@@ -1,5 +1,6 @@
 //# MSWriterFile.cc: a raw file writer
-//# Copyright (C) 2009-2013  ASTRON (Netherlands Institute for Radio Astronomy)
+//# Copyright (C) 2009-2013, 2016
+//# ASTRON (Netherlands Institute for Radio Astronomy)
 //# P.O. Box 2, 7990 AA Dwingeloo, The Netherlands
 //#
 //# This file is part of the LOFAR software suite.
@@ -90,7 +91,7 @@ namespace LOFAR
 
     void MSWriterFile::write(StreamableData *data)
     {
-      data->write(&itsFile, true, 512);
+      data->write(&itsFile, 512);
     }
 
 
diff --git a/RTCP/Cobalt/OutputProc/src/MSWriterFile.h b/RTCP/Cobalt/OutputProc/src/MSWriterFile.h
index 9bbaba94bd4f776ca16aab26445c0abdaf0df396..4a1476bc7a4cdde6e1b4bd6d64b82b114a812de6 100644
--- a/RTCP/Cobalt/OutputProc/src/MSWriterFile.h
+++ b/RTCP/Cobalt/OutputProc/src/MSWriterFile.h
@@ -21,11 +21,32 @@
 #ifndef LOFAR_STORAGE_MSWRITERFILE_H
 #define LOFAR_STORAGE_MSWRITERFILE_H
 
+// O_DIRECT gave us bad performance on CEP4. Compare:
+/*
+
+root@cpu01 ~]# dd if=/dev/zero of=/data/test/throughput.dd bs=104857600 count=10 oflag=direct
+10+0 records in
+10+0 records out
+1048576000 bytes (1.0 GB) copied, 60.8431 s, 17.2 MB/s
+
+[root@cpu01 ~]# dd if=/dev/zero of=/data/test/throughput.dd bs=104857600 count=10
+10+0 records in
+10+0 records out
+1048576000 bytes (1.0 GB) copied, 0.879391 s, 1.2 GB/s
+
+*/
+//#define USE_O_DIRECT
+
+#ifdef USE_O_DIRECT
+#include "FastFileStream.h"
+#else
+#include <Stream/FileStream.h>
+#endif
+
 #include <string>
 
 #include <CoInterface/StreamableData.h>
 #include "MSWriter.h"
-#include <Stream/FileStream.h>
 
 namespace LOFAR
 {
@@ -49,7 +70,11 @@ namespace LOFAR
       virtual size_t getDataSize();
 
     protected:
+#ifdef USE_O_DIRECT
+      FastFileStream itsFile;
+#else
       FileStream itsFile;
+#endif
     };
 
 
diff --git a/RTCP/Cobalt/OutputProc/src/MSWriterNull.cc b/RTCP/Cobalt/OutputProc/src/MSWriterNull.cc
index 4260d4c06a8b8b71e5293d68c5d0ba8b21ba8868..f1043edc4e5546cf536b0bc38a25173f42130c06 100644
--- a/RTCP/Cobalt/OutputProc/src/MSWriterNull.cc
+++ b/RTCP/Cobalt/OutputProc/src/MSWriterNull.cc
@@ -51,7 +51,7 @@ namespace LOFAR
 
     void MSWriterNull::write(StreamableData *data)
     {
-      // We do not know why the creation of the propper writer failed.
+      // We do not know why the creation of the proper writer failed.
       // Assume nothing and only report that we did not write anything
       itsConfiguration.replace("percentageWritten", str(format("%u") % 0));
       itsConfiguration.replace("size", str(format("%u") % getDataSize()));
diff --git a/RTCP/Cobalt/OutputProc/src/MeasurementSetFormat.cc b/RTCP/Cobalt/OutputProc/src/MeasurementSetFormat.cc
index 6439e976674fbfe93239a2be55214fd2c687f159..307df94e145e3b12541b31def242f357c8671969 100644
--- a/RTCP/Cobalt/OutputProc/src/MeasurementSetFormat.cc
+++ b/RTCP/Cobalt/OutputProc/src/MeasurementSetFormat.cc
@@ -698,5 +698,5 @@ namespace LOFAR
 
 
   } // namespace Cobalt
-} // namepsace LOFAR
+} // namespace LOFAR
 
diff --git a/RTCP/Cobalt/OutputProc/src/OutputThread.cc b/RTCP/Cobalt/OutputProc/src/OutputThread.cc
index 689d8396545b905a1430fda569650cd100236dbc..a1dce26c390251149258d8dc94afaa1d77eeaf78 100644
--- a/RTCP/Cobalt/OutputProc/src/OutputThread.cc
+++ b/RTCP/Cobalt/OutputProc/src/OutputThread.cc
@@ -1,5 +1,6 @@
 //# OutputThread.cc:
-//# Copyright (C) 2009-2013  ASTRON (Netherlands Institute for Radio Astronomy)
+//# Copyright (C) 2009-2013, 2017
+//# ASTRON (Netherlands Institute for Radio Astronomy)
 //# P.O. Box 2, 7990 AA Dwingeloo, The Netherlands
 //#
 //# This file is part of the LOFAR software suite.
@@ -24,6 +25,8 @@
 #include "OutputThread.h"
 
 #include <unistd.h>
+#include <set>
+#include <sstream>
 #include <iomanip>
 #include <boost/lexical_cast.hpp>
 #include <boost/format.hpp>
@@ -31,11 +34,13 @@
 #include <Common/SystemCallException.h>
 #include <Common/Thread/Mutex.h>
 #include <Common/Thread/Cancellation.h>
+#include <Common/StreamUtil.h> // LOFAR::print()
 #include <ApplCommon/PVSSDatapointDefs.h>
 
 #include <CoInterface/OutputTypes.h>
 #include <CoInterface/Exceptions.h>
 #include <CoInterface/LTAFeedback.h>
+#include <CoInterface/BudgetTimer.h>
 
 #if defined HAVE_AIPSPP
 #include <casa/Exceptions/Error.h>
@@ -69,8 +74,11 @@ namespace LOFAR
       itsTargetDirectory(targetDirectory),
       itsBlocksWritten(0),
       itsBlocksDropped(0),
+      itsBlocksDroppedByMe(0),
+      itsFractionalBlocksWritten(0.0),
       itsNrExpectedBlocks(0),
       itsNextSequenceNumber(0),
+      itsBlockDuration(parset.settings.blockDuration()),
       itsOutputPool(outputPool)
     {
     }
@@ -85,39 +93,50 @@ namespace LOFAR
     {
       // TODO: check for dropped data at end of observation
 
-      size_t droppedBlocks = data->sequenceNumber() - itsNextSequenceNumber;
-
       ASSERTSTR(data->sequenceNumber() >= itsNextSequenceNumber, "Received block nr " << data->sequenceNumber() << " out of order! I expected nothing before " << itsNextSequenceNumber);
 
+      size_t droppedBlocks = data->sequenceNumber() - itsNextSequenceNumber;
+
       const string streamNrStr = '[' + lexical_cast<string>(itsStreamNr) + ']';
 
       if (droppedBlocks > 0) {
         itsBlocksDropped += droppedBlocks;
 
-        LOG_WARN_STR(itsLogPrefix << "Just dropped " << droppedBlocks << " blocks. Dropped " << itsBlocksDropped << " blocks and written " << itsBlocksWritten << " blocks so far.");
+        LOG_WARN_STR(itsLogPrefix << "Did not receive " << droppedBlocks << " blocks");
 
         itsMdLogger.log(itsMdKeyPrefix + PN_COP_DROPPED + streamNrStr,
-                        itsBlocksDropped * static_cast<float>(itsParset.settings.blockDuration()));
+                        itsBlocksDropped * static_cast<float>(itsBlockDuration));
       }
 
-      itsNextSequenceNumber = data->sequenceNumber() + 1;
+      if (data->doReadWithSequenceNumber()) {
+        itsNextSequenceNumber = data->sequenceNumber() + 1;
+      } // else, droppedBlocks is useless, but itsBlocksWritten is valid
       itsBlocksWritten++;
+      itsFractionalBlocksWritten += 1.0 - data->outputLossFraction(); // doubles have enough precision for this to go well
 
       itsMdLogger.log(itsMdKeyPrefix + PN_COP_DROPPING + streamNrStr,
                       droppedBlocks > 0); // logged too late if dropping: not anymore...
       itsMdLogger.log(itsMdKeyPrefix + PN_COP_WRITTEN  + streamNrStr,
-                      itsBlocksWritten * static_cast<float>(itsParset.settings.blockDuration()));
+                      itsBlocksWritten * static_cast<float>(itsBlockDuration));
     }
 
 
     template<typename T> void OutputThread<T>::doWork()
     {
+      BudgetTimer writeTimer(
+        "writeOutput",
+        itsBlockDuration,
+        true, true);
+
       for (SmartPtr<T> data; (data = itsOutputPool.filled.remove()) != 0; itsOutputPool.free.append(data)) {
         if (itsParset.settings.realTime) {
           try {
+            BudgetTimer::StartStop ss(writeTimer);
+
             itsWriter->write(data);
           } catch (SystemCallException &ex) {
             LOG_WARN_STR(itsLogPrefix << "OutputThread caught non-fatal exception: " << ex.what());
+            itsBlocksDroppedByMe++;
             continue;
           }
         } else { // no try/catch: any loss (e.g. disk full) is fatal in non-real-time mode
@@ -127,7 +146,7 @@ namespace LOFAR
         checkForDroppedData(data);
 
         // print debug info for the other blocks
-        LOG_DEBUG_STR(itsLogPrefix << "Written block with seqno = " << data->sequenceNumber() << ", " << itsBlocksWritten << " blocks written (" << itsWriter->percentageWritten() << "%), " << itsBlocksDropped << " blocks dropped");
+        LOG_DEBUG_STR(itsLogPrefix << "Written block with seqno = " << data->sequenceNumber() << "(which was " << (100.0 - 100.0 * data->outputLossFraction()) << "% complete), " << itsBlocksWritten << " blocks written, " << itsBlocksDropped << " blocks not received");
       }
     }
 
@@ -155,9 +174,24 @@ namespace LOFAR
 
     template<typename T> void OutputThread<T>::cleanUp() const
     {
-      float dropPercent = itsBlocksWritten + itsBlocksDropped == 0 ? 0.0 : (100.0 * itsBlocksDropped) / (itsBlocksWritten + itsBlocksDropped);
-
-      LOG_INFO_STR(itsLogPrefix << "Finished writing: " << itsBlocksWritten << " blocks written (" << itsWriter->percentageWritten() << "%), " << itsBlocksDropped << " blocks dropped: " << std::setprecision(3) << dropPercent << "% lost" );
+      // report statistics
+      const float lostPerc = 100.0 * itsBlocksDroppedByMe / itsNrExpectedBlocks;
+      const float didNotSendPerc = itsNrExpectedBlocks == 0 ? 0.0 : 100.0 - 100.0 * itsFractionalBlocksWritten / itsNrExpectedBlocks;
+      const float didNotReceivePerc = didNotSendPerc + lostPerc;
+
+      if (didNotReceivePerc > 0)
+        LOG_WARN_STR(itsLogPrefix << "Did not receive " << didNotReceivePerc << "% of the data");
+      if (lostPerc > 0)
+        LOG_ERROR_STR(itsLogPrefix << "I lost " << lostPerc << "% of the data");
+      if (didNotSendPerc > 0)
+        LOG_WARN_STR(itsLogPrefix << "Did not send " << didNotSendPerc << "% of the data");
+
+      LOG_INFO_STR(itsLogPrefix << "Finished writing " << itsBlocksWritten << " blocks, dropped " << itsBlocksDropped << " blocks.");
+
+      if (didNotSendPerc > 0)
+        LOG_ERROR_STR(itsLogPrefix << "Total output data loss is " << didNotSendPerc << "%.");
+      else
+        LOG_INFO_STR(itsLogPrefix << "Total output data loss is " << didNotSendPerc << "%.");
     }
 
 
@@ -239,8 +273,12 @@ namespace LOFAR
         }
 
 #       pragma omp section
-        init();
+        {
+          init();
+        }
       }
+
+      LOG_INFO_STR(itsLogPrefix << "Finalised data product.");
     }
 
     // Make required instantiations
@@ -262,6 +300,7 @@ namespace LOFAR
           logPrefix + "[SubbandOutputThread] ",
           targetDirectory)
     {
+      itsBlockDuration = parset.settings.correlator.integrationTime();
     }
 
 
@@ -277,33 +316,27 @@ namespace LOFAR
       const std::string fileName = itsParset.getFileName(CORRELATED_DATA, itsStreamNr);
 
       const std::string path = directoryName + "/" + fileName;
+      LOG_INFO_STR(itsLogPrefix << "Writing correlated data to " << path);
 
-      try
-      {
-        LOG_INFO_STR(itsLogPrefix << "Writing to " << path);
+      if (itsParset.settings.realTime) {
+        try {
+          itsWriter = new MSWriterCorrelated(itsLogPrefix, path, itsParset, itsStreamNr);
 
-        itsWriter = new MSWriterCorrelated(itsLogPrefix, path, itsParset, itsStreamNr);
+          logInitialStreamMetadataEvents("Correlated", fileName, directoryName);
+        } catch (Exception &ex) {
+          LOG_ERROR_STR(itsLogPrefix << "Cannot open " << path << ": " << ex);
+          itsWriter = new MSWriterNull(itsParset);
 
-        logInitialStreamMetadataEvents("Correlated", fileName, directoryName);
-      } 
-      catch (Exception &ex) 
-      {
-        LOG_ERROR_STR(itsLogPrefix << "Cannot open " << path << ": " << ex);
-        if (!itsParset.settings.realTime)
-          THROW(StorageException, ex); 
-
-        itsWriter = new MSWriterNull(itsParset);
 #if defined HAVE_AIPSPP
-      } 
-      catch (casa::AipsError &ex)
-      {
-        LOG_ERROR_STR(itsLogPrefix << "Caught AipsError: " << ex.what());
-
-        if (!itsParset.settings.realTime)    
-          THROW(StorageException, ex.what()); 
-
-        itsWriter = new MSWriterNull(itsParset);
+        } catch (casa::AipsError &ex) {
+          LOG_ERROR_STR(itsLogPrefix << "Caught AipsError: " << ex.what());
+          itsWriter = new MSWriterNull(itsParset);
 #endif
+        }
+      } else { // don't handle exception in non-RT: it is fatal: avoid rethrow for a clean stracktrace
+        itsWriter = new MSWriterCorrelated(itsLogPrefix, path, itsParset, itsStreamNr);
+
+        logInitialStreamMetadataEvents("Correlated", fileName, directoryName);
       }
 
       itsNrExpectedBlocks = itsParset.settings.correlator.nrIntegrations;
@@ -341,40 +374,172 @@ namespace LOFAR
       const std::string fileName = itsParset.getFileName(BEAM_FORMED_DATA, itsStreamNr);
 
       const std::string path = directoryName + "/" + fileName;
+      LOG_INFO_STR(itsLogPrefix << "Writing beamformed data to " << path);
 
-      try
-      {
-        LOG_INFO_STR(itsLogPrefix << "Writing to " << path);
+      if (itsParset.settings.realTime) {
+        try {
+#ifdef HAVE_DAL
+          itsWriter = new MSWriterDAL<float,3>(path, itsParset, itsStreamNr);
+#else
+          itsWriter = new MSWriterFile(path);
+#endif
+          logInitialStreamMetadataEvents("Beamformed", fileName, directoryName);
 
+        } catch (Exception &ex) {
+          LOG_ERROR_STR(itsLogPrefix << "Cannot open " << path << ": " << ex);
+          itsWriter = new MSWriterNull(itsParset);
+
+#if defined HAVE_AIPSPP
+        } catch (casa::AipsError &ex) {
+          LOG_ERROR_STR(itsLogPrefix << "Caught AipsError: " << ex.what());
+          itsWriter = new MSWriterNull(itsParset);
+#endif
+        }
+      } else { // don't handle exception in non-RT: it is fatal: avoid rethrow for a clean stracktrace
 #ifdef HAVE_DAL
-        itsWriter = new MSWriterDAL<float,3>(path, itsParset, itsStreamNr);
+        itsWriter = new MSWriterDAL<float,3,1>(path, itsParset, itsStreamNr);
 #else
         itsWriter = new MSWriterFile(path);
 #endif
-
         logInitialStreamMetadataEvents("Beamformed", fileName, directoryName);
       }
-      catch (Exception &ex)
-      {
-        LOG_ERROR_STR(itsLogPrefix << "Cannot open " << path << ": " << ex);
-        if (!itsParset.settings.realTime)
-          THROW(StorageException, ex);
 
-        itsWriter = new MSWriterNull(itsParset);
-#if defined HAVE_AIPSPP
-      } 
-      catch (casa::AipsError &ex) 
+      itsNrExpectedBlocks = itsParset.settings.nrBlocks();
+    }
+
+
+    RSPRawOutputThread::RSPRawOutputThread(const Parset &parset,
+          unsigned streamNr, Pool<StreamableData> &outputPool,
+          RTmetadata &mdLogger, const std::string &mdKeyPrefix,
+          const std::string &logPrefix, const std::string &targetDirectory)
+      :
+      OutputThread<StreamableData>(
+          parset,
+          streamNr,
+          outputPool,
+          mdLogger,
+          mdKeyPrefix,
+          logPrefix + "[RSPRawOutputThread] ",
+          targetDirectory)
+    {
+    }
+
+    void RSPRawOutputThread::createMS()
+    {
+      // Unlike the other output types, there is no need to grab casacoreMutex
+      // or delay cancellation, because the RSP raw writer does not use casacore or libhdf5.
+
+      const std::string directoryName =
+        itsTargetDirectory == ""
+        ? itsParset.getDirectoryName(RSP_RAW_DATA, itsStreamNr)
+        : itsTargetDirectory;
+      const std::string fileName = itsParset.getFileName(RSP_RAW_DATA, itsStreamNr);
+
+      const std::string path = directoryName + "/" + fileName;
+      LOG_INFO_STR(itsLogPrefix << "Writing RSP raw data to " << path);
+
+      // Write parset as observation metadata. We end up with many duplicate files,
+      // but at least we get the parset, even if storage node(s) fail.
+      Parset rspRawParset = makeRspRawParset();
+
+      if (itsParset.settings.realTime) {
+        try {
+          itsWriter = new MSWriterFile(path);
+          rspRawParset.writeFile(path + ".parset"); // relies on (recursive) mkdir by MSWriterFile()
+
+          // The rest of the system doesn't know about RSP raw data output, but if monitoring did, enable this:
+          //logInitialStreamMetadataEvents("RSPRaw", fileName, directoryName);
+        } catch (Exception& ex) {
+          LOG_ERROR_STR(itsLogPrefix << "Cannot open " << path << ": " << ex);
+          itsWriter = new MSWriterNull(itsParset);
+        }
+      } else { // don't handle exception in non-RT: it is fatal: avoid rethrow for a clean stracktrace
+        itsWriter = new MSWriterFile(path);
+        rspRawParset.writeFile(path + ".parset"); // relies on (recursive) mkdir by MSWriterFile()
+
+        // The rest of the system doesn't know about RSP raw data output, but if monitoring did, enable this:
+        //logInitialStreamMetadataEvents("RSPRaw", fileName, directoryName);
+      }
+
+      // NOTE: for RSP raw we need to count bytes instead of blocks, but N/A here.
+      itsNrExpectedBlocks = itsParset.settings.nrRspRawBlocks();
+    }
+
+    Parset RSPRawOutputThread::makeRspRawParset()
+    {
+      LOG_INFO("makeRspRawParset() begin");
+
+      Parset rspRawParset(itsParset);
+
+      // Patch several parset key values for easy setup of (single node) offline reprocessing.
+      rspRawParset.replace("Observation.startTime",
+                           LOFAR::timeString(rspRawParset.settings.rspRaw.startTime, true, "%F %T"));
+      rspRawParset.replace("Observation.stopTime",
+                           LOFAR::timeString(rspRawParset.settings.rspRaw.stopTime,  true, "%F %T"));
+      rspRawParset.replace("Cobalt.realTime", "false");
+      rspRawParset.replace("Observation.DataProducts.Output_RSPRaw.enabled", "false");
+
+      const unsigned nrBoards = rspRawParset.settings.rspRaw.nrBeamletsPerBoardList.size();
+      set<string> stationNameSet;
+      for (unsigned af = 0; af < rspRawParset.settings.rspRaw.antennaFieldNames.size(); ++af)
       {
-        LOG_ERROR_STR(itsLogPrefix << "Caught AipsError: " << ex.what());
-        if ( !itsParset.settings.realTime)       
-          THROW(StorageException, ex.what());  
+        const string antFieldName = rspRawParset.settings.rspRaw.antennaFieldNames[af].fullName();
 
-        itsWriter = new MSWriterNull(itsParset);
-#endif
+        string rspPortsValue(1, '[');
+        string dataslotListValue(1, '[');
+        string rspBoardListValue(1, '[');
+        for (unsigned b = 0; b < nrBoards; ++b)
+        {
+          unsigned nrBeamlets = rspRawParset.settings.rspRaw.nrBeamletsPerBoardList[b];
+          if (nrBeamlets == 0) {
+            // It is valid to completely filter streams, but they must all be at the end in the list.
+            // If nrBeamlets half-way is 0 we cannot generate a valid dataslot list, which computes nrBeamlets-1.
+            for (++b; b < nrBoards; ++b) {
+              if (nrBeamlets != 0) {
+                LOG_WARN_STR("makeRspRawParset(): empty nr beamlets per board found for antenna field " <<
+                             antFieldName << " followed by non-empty nr beamlets. Observation data output unaffected, " <<
+                             "but cannot write valid DataslotList in RSP *output* parset to support offline post-processing.");
+                break;
+              }
+            }
+            break;
+          }
+
+          if (b > 0) {
+            rspPortsValue += ", ";
+            dataslotListValue += ", ";
+            rspBoardListValue += ", ";
+          }
+
+          rspPortsValue += "file:" + rspRawParset.getFileName(RSP_RAW_DATA, af * nrBoards + b);
+
+          dataslotListValue += str(boost::format("0..%u") % (nrBeamlets - 1));
+          rspBoardListValue += str(boost::format("%u*%u") % nrBeamlets % b);
+
+          stationNameSet.insert(rspRawParset.settings.rspRaw.antennaFieldNames[af].station);
+        }
+
+        rspPortsValue.push_back(']');
+        rspRawParset.replace("PIC.Core." + antFieldName + ".RSP.ports", rspPortsValue);
+        rspRawParset.replace("PIC.Core." + antFieldName + ".RSP.receiver", "localhost");
+
+        dataslotListValue.push_back(']');
+        rspRawParset.replace("Observation.Dataslots." + antFieldName + ".DataslotList", dataslotListValue);
+        rspBoardListValue.push_back(']');
+        rspRawParset.replace("Observation.Dataslots." + antFieldName + ".RSPBoardList", rspBoardListValue);
       }
 
-      itsNrExpectedBlocks = itsParset.settings.nrBlocks();
+      ostringstream stationListStr;
+      LOFAR::print(stationListStr, stationNameSet.begin(), stationNameSet.end(), ",", "[", "]");
+      rspRawParset.replace("Observation.VirtualInstrument.stationList", stationListStr.str());
+
+      rspRawParset.updateSettings(); // not needed and may WARN, but does some checks and to return valid obj
+
+      LOG_INFO("makeRspRawParset() end");
+
+      return rspRawParset;
     }
+
   } // namespace Cobalt
 } // namespace LOFAR
 
diff --git a/RTCP/Cobalt/OutputProc/src/OutputThread.h b/RTCP/Cobalt/OutputProc/src/OutputThread.h
index 106fe70ae3bc137859b320cb444377fa9fc60e3a..1d9d5694d665fe9d62b3c6172b5f94fa82bda680 100644
--- a/RTCP/Cobalt/OutputProc/src/OutputThread.h
+++ b/RTCP/Cobalt/OutputProc/src/OutputThread.h
@@ -1,5 +1,6 @@
 //# OutputThread.h
-//# Copyright (C) 2009-2013  ASTRON (Netherlands Institute for Radio Astronomy)
+//# Copyright (C) 2009-2013, 2017
+//# ASTRON (Netherlands Institute for Radio Astronomy)
 //# P.O. Box 2, 7990 AA Dwingeloo, The Netherlands
 //#
 //# This file is part of the LOFAR software suite.
@@ -33,6 +34,7 @@
 #include <CoInterface/TABTranspose.h>
 #include <CoInterface/FinalMetaData.h>
 #include <CoInterface/Pool.h>
+#include <CoInterface/Parset.h>
 
 #include "MSWriter.h"
 
@@ -94,9 +96,11 @@ namespace LOFAR
       const std::string itsLogPrefix;
       const std::string itsTargetDirectory;
 
-      size_t itsBlocksWritten, itsBlocksDropped;
+      size_t itsBlocksWritten, itsBlocksDropped, itsBlocksDroppedByMe;
+      double itsFractionalBlocksWritten;
       size_t itsNrExpectedBlocks;
       size_t itsNextSequenceNumber;
+      double itsBlockDuration; // seconds
 
       Pool<T> &itsOutputPool;
 
@@ -139,6 +143,25 @@ namespace LOFAR
     };
 
 
+    /*
+     * RSPRawOutputThread specialises in creating *_rsp.raw
+     * files for raw RSP antenna field data.
+     */
+    class RSPRawOutputThread: public OutputThread<StreamableData>
+    {
+    public:
+      RSPRawOutputThread(const Parset &parset, unsigned streamNr,
+                         Pool<StreamableData> &outputPool,
+                         RTmetadata &mdLogger, const std::string &mdKeyPrefix,
+                         const std::string &logPrefix,
+                         const std::string &targetDirectory = "");
+
+      virtual void createMS();
+
+    private:
+      Parset makeRspRawParset();
+    };
+
   } // namespace Cobalt
 } // namespace LOFAR
 
diff --git a/RTCP/Cobalt/OutputProc/src/RSPRawWriter.cc b/RTCP/Cobalt/OutputProc/src/RSPRawWriter.cc
new file mode 100644
index 0000000000000000000000000000000000000000..4d6d467bf13168e5ef481e9e0e80e771fb47f615
--- /dev/null
+++ b/RTCP/Cobalt/OutputProc/src/RSPRawWriter.cc
@@ -0,0 +1,92 @@
+//# RSPRawWriter.cc: Write raw data stream of an RSP board to storage
+//# Copyright (C) 2017  ASTRON (Netherlands Institute for Radio Astronomy)
+//# P.O. Box 2, 7990 AA Dwingeloo, The Netherlands
+//#
+//# This file is part of the LOFAR software suite.
+//# The LOFAR software suite 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 3 of the License, or
+//# (at your option) any later version.
+//#
+//# The LOFAR software suite 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 the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
+//#
+//# $Id$
+
+#include <lofar_config.h>
+
+#include "RSPRawWriter.h"
+
+#include <CoInterface/OMPThread.h>
+#include <Common/Timer.h>
+
+#include <boost/format.hpp>
+using boost::format;
+
+namespace LOFAR
+{
+  namespace Cobalt
+  {
+    RSPRawWriter::RSPRawWriter(const Parset &parset, unsigned streamNr,
+        RTmetadata &mdLogger, const std::string &mdKeyPrefix,
+        const std::string &logPrefix)
+    :
+      itsStreamNr(streamNr),
+      itsOutputPool(str(format("RSPRawWriter::itsOutputPool [stream %u]") % streamNr), parset.settings.realTime),
+      itsInputThread(parset, RSP_RAW_DATA, streamNr, itsOutputPool, logPrefix),
+      itsOutputThread(parset, streamNr, itsOutputPool, mdLogger, mdKeyPrefix, logPrefix)
+    {
+      NSTimer timer(str(format("preallocator %u") % itsStreamNr), true, true);
+
+      for (unsigned i = 0; i < preAllocateReceiveQueue; i++) {
+        timer.start();
+
+        LOG_DEBUG_STR(str(format("[stream %u] Allocating element %u") % itsStreamNr % i));
+        RSPRawData *data = new RSPRawData();
+        LOG_DEBUG_STR(str(format("[stream %u] Appending element %u") % itsStreamNr % i));
+        itsOutputPool.free.append(data);
+
+        timer.stop();
+      }
+    }
+
+
+    void RSPRawWriter::process()
+    {
+#     pragma omp parallel sections num_threads(2)
+      {
+#       pragma omp section
+        {
+          OMPThread::ScopedName sn(str(format("RSPRaw input %u") % itsStreamNr));
+
+          itsInputThread.process();
+        }
+
+#       pragma omp section
+        {
+          OMPThread::ScopedName sn(str(format("RSPRaw output %u") % itsStreamNr));
+
+          itsOutputThread.process();
+        }
+      }
+    }
+
+
+    void RSPRawWriter::fini( const FinalMetaData &finalMetaData )
+    {
+      itsOutputThread.fini(finalMetaData);
+    }
+
+
+    ParameterSet RSPRawWriter::feedbackLTA() const
+    {
+      return itsOutputThread.feedbackLTA();
+    }
+  } // namespace Cobalt
+} // namespace LOFAR
+
diff --git a/RTCP/Cobalt/OutputProc/src/RSPRawWriter.h b/RTCP/Cobalt/OutputProc/src/RSPRawWriter.h
new file mode 100644
index 0000000000000000000000000000000000000000..2f1b45245d0af72b17326204bf55c939f65457b7
--- /dev/null
+++ b/RTCP/Cobalt/OutputProc/src/RSPRawWriter.h
@@ -0,0 +1,75 @@
+//# RSPRawWriter.h: Write raw data stream of an RSP board to storage
+//# Copyright (C) 2017  ASTRON (Netherlands Institute for Radio Astronomy)
+//# P.O. Box 2, 7990 AA Dwingeloo, The Netherlands
+//#
+//# This file is part of the LOFAR software suite.
+//# The LOFAR software suite 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 3 of the License, or
+//# (at your option) any later version.
+//#
+//# The LOFAR software suite 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 the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
+//#
+//# $Id$
+
+#ifndef LOFAR_STORAGE_RSPBOARDWRITER_H
+#define LOFAR_STORAGE_RSPBOARDWRITER_H
+
+#include <string>
+
+#include <CoInterface/Parset.h>
+#include <CoInterface/Pool.h>
+#include <CoInterface/StreamableData.h>
+#include <CoInterface/FinalMetaData.h>
+#include "InputThread.h"
+#include "OutputThread.h"
+
+namespace LOFAR
+{
+  namespace Cobalt
+  {
+    /*
+     * RSPRawWriter is responsible for completely handling the reception
+     * and writing of one stream of data from an RSP board (via InputProc/GPUProc).
+     *
+     * It maintains an InputThread and RSPRawOutputThread, connected by
+     * an internal Pool<> of data blocks.
+     */
+    class RSPRawWriter
+    {
+    public:
+      RSPRawWriter(const Parset &parset,
+                   unsigned streamNr,
+                   RTmetadata &mdLogger,
+                   const std::string &mdKeyPrefix,
+                   const std::string &logPrefix);
+
+      void process();
+
+      void fini(const FinalMetaData &finalMetaData);
+
+      ParameterSet feedbackLTA() const;
+
+      unsigned streamNr() const { return itsStreamNr; }
+
+    private:
+      static const unsigned preAllocateReceiveQueue = 32; // number of elements to construct before starting
+
+      const unsigned itsStreamNr;
+
+      Pool<StreamableData> itsOutputPool;
+
+      InputThread itsInputThread;
+      RSPRawOutputThread itsOutputThread;
+    };
+  } // namespace Cobalt
+} // namespace LOFAR
+
+#endif
+
diff --git a/RTCP/Cobalt/OutputProc/src/SubbandWriter.cc b/RTCP/Cobalt/OutputProc/src/SubbandWriter.cc
index 20a616788a319901ae5e18e44e7378420c702878..10e2041003301595cf30e973c84b5cc0431d9728 100644
--- a/RTCP/Cobalt/OutputProc/src/SubbandWriter.cc
+++ b/RTCP/Cobalt/OutputProc/src/SubbandWriter.cc
@@ -1,5 +1,6 @@
-//# SubbandWriter.cc: Writes visibilities and beam-formed data
-//# Copyright (C) 2008-2013  ASTRON (Netherlands Institute for Radio Astronomy)
+//# SubbandWriter.cc: Write a subband of visibility data (UV) to storage
+//# Copyright (C) 2008-2013, 2017
+//# ASTRON (Netherlands Institute for Radio Astronomy)
 //# P.O. Box 2, 7990 AA Dwingeloo, The Netherlands
 //#
 //# This file is part of the LOFAR software suite.
@@ -42,7 +43,7 @@ namespace LOFAR
       itsArena(0),
       itsAllocator(0),
       itsOutputPool(str(format("SubbandWriter::itsOutputPool [stream %u]") % streamNr), parset.settings.realTime),
-      itsInputThread(parset, streamNr, itsOutputPool, logPrefix),
+      itsInputThread(parset, CORRELATED_DATA, streamNr, itsOutputPool, logPrefix),
       itsOutputThread(parset, streamNr, itsOutputPool, mdLogger, mdKeyPrefix, logPrefix),
       itsAlignment(512),
       itsNrStations(parset.settings.correlator.stations.size()),
@@ -94,14 +95,14 @@ namespace LOFAR
 
 #       pragma omp section
         {
-          OMPThread::ScopedName sn(str(format("input %u") % itsStreamNr));
+          OMPThread::ScopedName sn(str(format("uv input %u") % itsStreamNr));
 
           itsInputThread.process();
         }
 
 #       pragma omp section
         {
-          OMPThread::ScopedName sn(str(format("output %u") % itsStreamNr));
+          OMPThread::ScopedName sn(str(format("uv output %u") % itsStreamNr));
 
           itsOutputThread.process();
         }
diff --git a/RTCP/Cobalt/OutputProc/src/SubbandWriter.h b/RTCP/Cobalt/OutputProc/src/SubbandWriter.h
index 10eaa727098accf096d757b90a19a5acc7197bc9..9127148ec04bcc24376f66a2263b7f706ed3ef5e 100644
--- a/RTCP/Cobalt/OutputProc/src/SubbandWriter.h
+++ b/RTCP/Cobalt/OutputProc/src/SubbandWriter.h
@@ -1,5 +1,6 @@
-//# SubbandWriter.h: Write visibilites and beam-formed data
-//# Copyright (C) 2008-2013  ASTRON (Netherlands Institute for Radio Astronomy)
+//# SubbandWriter.h: Write a subband of visibility data (UV) to storage
+//# Copyright (C) 2008-2013, 2017
+//# ASTRON (Netherlands Institute for Radio Astronomy)
 //# P.O. Box 2, 7990 AA Dwingeloo, The Netherlands
 //#
 //# This file is part of the LOFAR software suite.
@@ -23,7 +24,6 @@
 
 #include <string>
 
-#include <CoInterface/OutputTypes.h>
 #include <CoInterface/Parset.h>
 #include <CoInterface/Pool.h>
 #include <CoInterface/Allocator.h>
diff --git a/RTCP/Cobalt/OutputProc/src/TBB_Dipole.cc b/RTCP/Cobalt/OutputProc/src/TBB_Dipole.cc
new file mode 100644
index 0000000000000000000000000000000000000000..fc933f1b89f351e4e267a39875d31f66ca903bd8
--- /dev/null
+++ b/RTCP/Cobalt/OutputProc/src/TBB_Dipole.cc
@@ -0,0 +1,561 @@
+//# TBB_Dipole.cc: TBB per-dipole routines to store incoming TBB data
+//# Copyright (C) 2012-2017  ASTRON (Netherlands Institute for Radio Astronomy)
+//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
+//#
+//# This file is part of the LOFAR software suite.
+//# The LOFAR software suite 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 3 of the License, or
+//# (at your option) any later version.
+//#
+//# The LOFAR software suite 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 the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
+//#
+//# $Id$
+
+#include <lofar_config.h>
+
+#include "TBB_Dipole.h"
+#include <cstring>
+#include <unistd.h>
+#include <endian.h>
+#if __BYTE_ORDER != __BIG_ENDIAN && __BYTE_ORDER != __LITTLE_ENDIAN
+#error Byte order is neither big endian nor little endian: not supported
+#endif
+#include <boost/lexical_cast.hpp>
+#include <boost/format.hpp>
+
+#ifdef basename // some glibc have this as a macro
+#undef basename
+#endif
+#include <Common/SystemUtil.h>
+#include <Common/LofarLogger.h>
+#include <Common/SystemCallException.h>
+
+namespace LOFAR
+{
+  namespace Cobalt
+  {
+
+    using namespace std;
+
+    // LCS/Stream FileStream does not wrap pwrite(2). No other LOFAR source uses it, so define it here in the same way.
+    static size_t tryPWrite(int fd, const void *ptr, size_t size, off_t offset)
+    {
+      ssize_t bytes = ::pwrite(fd, ptr, size, offset);
+      if (bytes < 0)
+        THROW_SYSCALL("pwrite");
+      return bytes;
+    }
+
+    static void pwrite(int fd, const void *ptr, size_t size, off_t offset)
+    {
+      while (true) {
+        size_t bytes = tryPWrite(fd, ptr, size, offset);
+        size -= bytes;
+        if (size == 0) {
+          return;
+        }
+        offset += bytes;
+        ptr = static_cast<const char *>(ptr) + bytes;
+      }
+    }
+
+
+    TBB_Dipole::TBB_Dipole()
+      : itsDataset(),
+        itsLastLogErrorTime(0)
+    {
+    }
+
+    // Do not use. Only needed for vector<TBB_Dipole>(N).
+    TBB_Dipole::TBB_Dipole(const TBB_Dipole& rhs)
+      : itsDataset(),
+        itsLastLogErrorTime(rhs.itsLastLogErrorTime)
+    {
+    }
+
+    TBB_Dipole::~TBB_Dipole()
+    {
+      // Executed by the main thread after joined with all workers, so no need to lock or delay cancellation.
+      if (isInitialized()) {
+        unsigned sb;
+        if (doTransient()) {
+          sb = 0;
+        } else { // spectral mode
+          // TODO: As long as we don't know dump duration / length beforehand, the best we can do here is write from the 1st used itsDumpInfo element. 
+          for (sb = 0; sb < itsDumpInfo.size(); sb++) {
+            if (!!itsDumpInfo[sb].itsRawFile) { // initialized
+              break; // found
+            }
+          }
+          if (sb == RSP_NR_SUBBANDS) { // not found: ensure attribs below can be written
+            sb = 0;
+            itsDumpInfo[sb].itsDatasetLen = 0;
+          }
+        }
+
+        try {
+          if (doTransient()) {
+            itsDataset->resize1D(itsDumpInfo[sb].itsDatasetLen);
+          } else { // spectral mode
+            itsDataset->resize1D(itsDumpInfo[sb].itsDatasetLen * 2); // TODO: remove times 2 once DAL supports TBB spectral dataset of complex<int16_t>. Also, use resize() if switched to create() (2D).
+          }
+        } catch (exception& exc) { // dal::DALException, or std::bad_alloc from vector constr
+          LOG_WARN("TBB: failed to resize HDF5 dipole dataset to external data size: " + string(exc.what()));
+        }
+
+        try {
+          // Thus in values (scalar for transient mode, complex for subband mode)
+          itsDataset->dataLength().value = itsDumpInfo[sb].itsDatasetLen;
+        } catch (dal::DALException& exc) {
+          LOG_WARN("TBB: failed to set dipole DATA_LENGTH attribute: " + string(exc.what()));
+        }
+        try {
+          /*
+           * We write flags at the end, because HDF5 attributes can only be (re)set, not updated.
+           * TODO: If an .h5 internal (non-chunked!) 1D dataset would be possible without pre-specifying size,
+           * that would be better. Then we can write flags while data comes in. Else, leave as-is.
+           */
+          itsDataset->flagOffsets().create(itsDumpInfo[sb].itsFlagOffsets.size()).set(itsDumpInfo[sb].itsFlagOffsets);
+        } catch (dal::DALException& exc) {
+          LOG_WARN("TBB: failed to set dipole FLAG_OFFSETS attribute: " + string(exc.what()));
+        }
+      }
+    }
+
+    void TBB_Dipole::init(const TBB_Header& header, const Parset& parset,
+                          const StationMetaData& stationMetaData,
+                          const vector<double>& allSubbandCentralFreqs, const string& h5Filename,
+                          dal::TBB_Station& station, Mutex& h5Mutex)
+    {
+      const bool doTransientMode = allSubbandCentralFreqs.empty(); // cannot use doTransient() yet
+      const string rawFilename = getRawFilename(h5Filename, doTransientMode,
+                                                header.rspID, header.rcuID);
+      string filename;
+
+      if (doTransientMode) {
+        itsDumpInfo.resize(1);
+        filename = rawFilename;
+        itsDumpInfo[0].itsRawFile = SmartPtr<FileStream>(new FileStream(filename, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH));
+        itsDumpInfo[0].itsDatasetLen = 0;
+        itsDumpInfo[0].itsTime0 = header.time;
+        itsDumpInfo[0].itsSampleNrOrSliceNr0 = getTransientModeSampleNr(header);
+      } else { // spectral mode 
+        /*
+         * For spectral mode, we store 1 subband per file (until LOFAR control writes dump duration or length in the parset).
+         * DAL is not ready yet for spectral mode and takes 1 raw filename.
+         * For now, iterate backwards to pass the 1st raw filename to createTBB_DipoleDataset().
+         */
+        itsDumpInfo.resize(RSP_NR_SUBBANDS); // preallocate all is easy, safe and good enough
+        for (unsigned sb = allSubbandCentralFreqs.size(); sb-- > 0; ) {
+          if (allSubbandCentralFreqs[sb] == 0.0) {
+            continue; // subband not dumped (according to parset)
+          }
+          filename = str(boost::format(rawFilename) % sb);
+          itsDumpInfo[sb].itsRawFile = SmartPtr<FileStream>(new FileStream(filename, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH));
+          itsDumpInfo[sb].itsDatasetLen = 0;
+          // itsDumpInfo[sb].itsTime0 is lazily initialized later (cannot init for all subbands with 1st packet)
+          // itsDumpInfo[sb].itsSampleNrOrSliceNr0 is laziliy initialized later (idem)
+        }
+      }
+
+      {
+        ScopedLock h5OutLock(h5Mutex);
+        initTBB_DipoleDataset(header, parset, stationMetaData,
+                              allSubbandCentralFreqs, filename, station);
+      }
+    }
+
+    bool TBB_Dipole::isInitialized() const
+    {
+      return !!itsDataset;
+    }
+
+    bool TBB_Dipole::doTransient() const
+    {
+      return itsDumpInfo.size() == 1;
+    }
+
+    string TBB_Dipole::getRawFilename(const string& h5Filename, bool doTransient,
+                                      unsigned rspID, unsigned rcuID)
+    {
+      string rawFilename = h5Filename;
+      string rspRcuSbStr = str(boost::format("_RSP%03u_RCU%03u") % rspID % rcuID);
+      if (!doTransient) {
+        rspRcuSbStr.append("_SB%03u"); // insert conv specifier for subband nr in spectral mode (can be removed when all stored in 1 file)
+      }
+      size_t pos = rawFilename.find('_', rawFilename.find('_') + 1);
+      rawFilename.insert(pos, rspRcuSbStr); // insert _RSPxxx_RCUxxx after station name (2nd '_')
+      rawFilename.resize(rawFilename.size() - (sizeof(".h5") - 1));
+      rawFilename.append(".raw");
+      return rawFilename;
+    }
+
+    // Add a new flag range at the end or extend the last stored flag range. 'len' may not be 0.
+    void TBB_Dipole::appendFlags(DumpInfo& di, uint64_t offset, size_t len)
+    {
+      if (di.itsFlagOffsets.empty() || offset > di.itsFlagOffsets.back().end) {
+        di.itsFlagOffsets.push_back(dal::Range(offset, offset + len));
+      } else { // extend
+        di.itsFlagOffsets.back().end += len;
+      }
+    }
+
+    uint32_t TBB_Dipole::getTransientModeSampleNr(const TBB_Header& header) const
+    {
+      /*
+       * In transient mode, at 200 MHz we get DEFAULT_TBB_TRANSIENT_NSAMPLES (1024) samples per frame: 195312.5 frames/s.
+       * This means that every 2 seconds, a frame overlaps a seconds boundary. But the sample values generated
+       * by the RSPs start at zero for each second, even if it should start at 512 for odd timestamps at 200 MHz.
+       * At 160 MHz sample rate, an integer number of frames fits in a second (156250), so no correction is needed.
+       */
+      uint32_t sampleNr = header.sampleNrOrBandSliceNr;
+      if (header.sampleFreq == 200 && header.time & 1) {
+        sampleNr += DEFAULT_TBB_TRANSIENT_NSAMPLES / 2;
+      }
+      return sampleNr;
+    }
+
+    void TBB_Dipole::processTransientFrameData(const TBB_Frame& frame)
+    {
+      /*
+       * Out-of-order frame arrival has not been seen for Dutch stations. TBB from int'l stations is not (yet) dumped to CEP.
+       * We could support out-of-order arrival, except for packets that appear to be overtaken by the 1st packet received,
+       * but this makes flagging lost packets more complicated than how we deal with it using appendFlags() below.
+       * Also, fake out-of-order occurs when data is dumped (incorrectly) across the frozen TBB write pointer (LOFAR control bug).
+       */
+      DumpInfo& di = itsDumpInfo[0];
+      uint32_t sampleNr = getTransientModeSampleNr(frame.header);
+      if (frame.header.time < di.itsTime0 ||
+          (frame.header.time == di.itsTime0 && sampleNr < di.itsSampleNrOrSliceNr0)) {
+        logErrorRateLimited(&itsLastLogErrorTime, "TBB: unhandled out-of-order packet: " +
+                                                  frame.header.to_string());
+        return;
+      }
+
+      uint64_t offset = (frame.header.time - di.itsTime0) * frame.header.sampleFreq * 1000000;
+      offset += sampleNr - di.itsSampleNrOrSliceNr0;
+
+      /*
+       * Flag lost frame(s) (assume no out-of-order).
+       * Assumes all frames (except maybe the last) have the same nr of samples.
+       * This cannot detect lost frames at the end of a dataset.
+       */
+      int64_t nskipped = offset - di.itsDatasetLen; // should be > 0, but do signed cmp to avoid crazy flagging range
+      if (nskipped > 0) {
+        appendFlags(di, di.itsDatasetLen, (uint64_t)nskipped);
+      }
+
+      // On a data checksum error or all zeros, flag these samples.
+      if (!crc32tbb(&frame.payload, frame.header.nOfSamplesPerFrame)) {
+        appendFlags(di, offset, frame.header.nOfSamplesPerFrame);
+        uint32_t crc32;
+        memcpy(&crc32, &frame.payload.data[frame.header.nOfSamplesPerFrame], sizeof crc32); // strict-aliasing safe
+        logErrorRateLimited(&itsLastLogErrorTime, "TBB: crc32 error: " + frame.header.to_string() +
+                                                  " crc32: " + boost::lexical_cast<string>(crc32));
+      } else if (hasAllZeroDataSamples(frame.payload, frame.header.nOfSamplesPerFrame)) {
+        appendFlags(di, offset, frame.header.nOfSamplesPerFrame);
+      }
+
+      // Since we are writing around HDF5, there is no need to lock. Resize the HDF5 dataset in the destructor.
+      pwrite(di.itsRawFile->fd, frame.payload.data, frame.header.nOfSamplesPerFrame * sizeof(int16_t),
+             (off_t)(offset * sizeof(int16_t)));
+      di.itsDatasetLen = offset + frame.header.nOfSamplesPerFrame;
+    }
+
+    void TBB_Dipole::processSpectralFrameData(const TBB_Frame& frame)
+    {
+      // NOTE: only intends to support TBB-ALERT subband mode, and normal subband mode with 1 band per packet!
+
+      /*
+       * NOTE: frame header bandSel may have multiple bits set.
+       * Atm, we don't support this, because the (other) bandNr sub-field in the header appears odd wrt the spec
+       * (e.g. 0 even if band 0 is not dumped (maybe it's an index?)) for multi-subband dumps.
+       * The TBB-ALERT subband mode firmware does not send (parts of) multiple subbands per packet anyway.
+       */
+      unsigned bandSelNr = frame.header.getFirstBandSelNr();
+      if (bandSelNr == RSP_NR_SUBBANDS) {
+        logErrorRateLimited(&itsLastLogErrorTime, "TBB: dropping packet: subband mode, but empty bandSel bitmap in packet header");
+        return;
+      }
+      DumpInfo& di = itsDumpInfo[bandSelNr];
+      if (!di.itsRawFile) { // not initialized: band not to be expected according to parset
+        logErrorRateLimited(&itsLastLogErrorTime, "TBB: dropping packet: packet subband nr not in parset Observation.TBB.TBBsetting.subbandList: " +
+                                                  boost::lexical_cast<string>(bandSelNr));
+        return;
+      }
+
+      // Lazily initialize last part of dump info struct from 1st frame received
+      if (di.itsTime0 == 0) {
+        di.itsTime0 = frame.header.time;
+        di.itsSampleNrOrSliceNr0 = frame.header.sampleNrOrBandSliceNr >> TBB_SLICE_NR_SHIFT;
+      }
+
+      /*
+       * Out-of-order frame arrival has not been seen for Dutch stations. TBB from int'l stations is not (yet) dumped to CEP.
+       * We could support out-of-order arrival, except for packets that appear to be overtaken by the 1st packet received,
+       * but this makes flagging lost packets more complicated than how we deal with it using appendFlags() below.
+       * Also, fake out-of-order occurs when data is dumped (incorrectly) across the frozen TBB write pointer (LOFAR control bug).
+       */
+      uint32_t sliceNr = frame.header.sampleNrOrBandSliceNr >> TBB_SLICE_NR_SHIFT;
+      if (frame.header.time < di.itsTime0 ||
+          (frame.header.time == di.itsTime0 && sliceNr < di.itsSampleNrOrSliceNr0)) {
+        logErrorRateLimited(&itsLastLogErrorTime, "TBB: unhandled out-of-order packet: " +
+                                                  frame.header.to_string());
+        return;
+      }
+
+      // With a 200 MHz sample freq, even seconds have 1 extra slice (that actually falls half-way).
+      uint64_t offset = (frame.header.time - di.itsTime0) * frame.header.sampleFreq * 1000000 / SPECTRAL_TRANSFORM_SIZE;
+      if (frame.header.sampleFreq == 200) { // NOTE: untested body: when can I have enough test data from a working firmware in subband mode?!?
+        unsigned time0 = di.itsTime0;
+        if (frame.header.time > time0 && !(time0 & 1)) {
+          offset += 1; // 1st packet was in an even second and this packet is after that second: 1 extra slice fitted in that second
+          time0 += 1; // avoid duplicate offset compensation next
+        }
+        offset += (frame.header.time - time0) / 2; // 1 extra slice every 2 seconds
+      }
+      offset += sliceNr - di.itsSampleNrOrSliceNr0;
+
+      /*
+       * Flag lost frame(s) (assumes no out-of-order).
+       * Assumes all frames (except maybe the last) have the same nr of samples (fine).
+       * This cannot detect lost frames at the end of a dataset.
+       */
+      int64_t nskipped = offset - di.itsDatasetLen; // should be > 0, but do signed cmp to avoid crazy flagging range
+      if (nskipped > 0) {
+        appendFlags(di, di.itsDatasetLen, (uint64_t)nskipped);
+      }
+
+      /*
+       * On a data checksum error or all zeros, flag these samples.
+       * TBB Design Doc states the crc32 is computed for transient data only,
+       * but the firmware developer (Wietse Poiesz) says it is also valid for spectral data.
+       * But in data dumps I've seen, it looked invalid for the first spectral frame each second; recheck this (?).
+       */
+      if (0) { // !crc32tbb(frame.payload.data, 2 * frame.header.nOfSamplesPerFrame)) {
+        appendFlags(di, offset, frame.header.nOfSamplesPerFrame); // in (complex) values
+        uint32_t crc32;
+        memcpy(&crc32, &frame.payload.data[2 * frame.header.nOfSamplesPerFrame], sizeof crc32); // strict-aliasing safe
+        logErrorRateLimited(&itsLastLogErrorTime, "TBB: crc32 error: " + frame.header.to_string() +
+                                                  " crc32: " + boost::lexical_cast<string>(crc32));
+      } else if (hasAllZeroDataSamples(frame.payload, 2 * frame.header.nOfSamplesPerFrame)) {
+        appendFlags(di, offset, frame.header.nOfSamplesPerFrame); // in (complex) values
+      }
+
+      //unsigned bandNr = frame.header.sampleNrOrBandSliceNr & TBB_BAND_NR_MASK; // atm unused; from data it appears not to be a subband number; is it a subband idx?
+
+      // NOTE: only intends to support TBB-ALERT subband mode, and normal subband mode with 1 band per packet!
+
+      // Since we are writing around HDF5, there is no need to lock. Resize the HDF5 dataset in the destructor.
+      pwrite(di.itsRawFile->fd, frame.payload.data, frame.header.nOfSamplesPerFrame * 2 * sizeof(int16_t),
+             (off_t)(offset * 2 * sizeof(int16_t)));
+      di.itsDatasetLen = offset + frame.header.nOfSamplesPerFrame; // in (complex) values
+    }
+
+    void TBB_Dipole::initTBB_DipoleDataset(const TBB_Header& header, const Parset& parset,
+                                           const StationMetaData& stationMetaData,
+                                           const vector<double>& /*allSubbandCentralFreqs*/,
+                                           const string& rawFilename,
+                                           dal::TBB_Station& station)
+    {
+      const string filename = LOFAR::basename(rawFilename); // don't store paths in HDF5
+
+      // Override endianess. TBB data is always stored little endian and also received as such, so written as-is on any platform.
+      if (doTransient()) {
+        itsDataset.reset(new dal::TBB_DipoleDataset(station.dipole(header.stationID, header.rspID, header.rcuID)));
+        itsDataset->create1D(0, -1, filename, itsDataset->LITTLE);
+
+        itsDataset->sampleNumber().value = getTransientModeSampleNr(header);
+      } else { // spectral mode
+        itsDataset.reset(new dal::TBB_DipoleDataset(station.dipole(header.stationID, header.rspID, header.rcuID)));
+/*        itsDataset = new dal::TBB_SubbandsDataset(station.subbands(header.stationID, header.rspID, header.rcuID)); TODO: something like this with new DAL version */
+/* kept code around in case needed for when DAL properly supports subband mode
+        vector<double> usedSubbandCentralFreqs;
+        for (unsigned i = 0; i < allSubbandCentralFreqs.size(); i++) {
+          if (allSubbandCentralFreqs[i] != 0.0) {
+            usedSubbandCentralFreqs.push_back(allSubbandCentralFreqs[i]);
+          }
+        }
+
+        vector<ssize_t> dims(2), maxdims(2);
+        dims[0] = 0;
+        dims[1] = usedSubbandCentralFreqs.size(); // create() will throw if this is 0
+        maxdims[0] = -1; // only the 1st dim can be extendible
+        maxdims[1] = usedSubbandCentralFreqs.size();
+        itsDataset->create(dims, maxdims, filename, itsDataset->LITTLE);
+*/
+        itsDataset->create1D(0, -1, filename, itsDataset->LITTLE);
+/* TODO: enable with new DAL version
+        itsDataset->sliceNumber().value = header.sampleNrOrBandSliceNr >> TBB_SLICE_NR_SHIFT;
+        itsDataset->spectralNofBands().value = usedSubbandCentralFreqs.size();
+        itsDataset->spectralBands().create(usedSubbandCentralFreqs.size()).set(usedSubbandCentralFreqs);
+        itsDataset->spectralBandsUnit().value = "MHz";
+*/
+      }
+      LOG_INFO_STR("TBB: Created HDF5 Dataset for rsp,rcu " << (unsigned)header.rspID << ',' << (unsigned)header.rcuID << " for raw file " << filename);
+
+      itsDataset->groupType().value = "DipoleDataset";
+      itsDataset->stationID().value = header.stationID;
+      itsDataset->rspID().value = header.rspID;
+      itsDataset->rcuID().value = header.rcuID;
+
+      itsDataset->sampleFrequency().value = header.sampleFreq;
+      itsDataset->sampleFrequencyUnit().value = "MHz";
+
+      itsDataset->time().value = header.time; // in seconds
+
+      itsDataset->samplesPerFrame().value = header.nOfSamplesPerFrame; // possibly sanitized
+      //itsDataset->dataLength().value is set at the end (destr)
+      //itsDataset->flagOffsets().value is set at the end (destr)
+      itsDataset->nyquistZone().value = parset.settings.nyquistZone();
+
+      //#include "MAC/APL/PIC/RSP_Driver/src/CableSettings.h" or "RCUCables.h"
+      // Cable delays (optional) from static meta data.
+      //itsDataset->cableDelay().value = ???; // TODO
+      //itsDataset->cableDelayUnit().value = "ns";
+
+      /*
+         > No DIPOLE_CALIBRATION_DELAY_VALUE
+         > No DIPOLE_CALIBRATION_DELAY_UNIT
+         These can be calculated from the values in the LOFAR calibration
+         tables, but we can do that ourselves as long as the calibration table
+         values for each dipole are written to the new keyword. Sander: please put them in; see the code ref below.
+         DIPOLE_CALIBRATION_GAIN_CURVE.
+
+         // Use StaticMetaData/CalTables
+
+         calibration delay value en unit zijn nuttiger
+         en is het beste om die er gelijk in te schrijven
+         momenteel
+         In /opt/cep/lus/daily/Mon/src/code/src/PyCRTools/modules/metadata.py
+         heb ik code om de calibratie tabellen uit te lezen
+         De functie: getStationPhaseCalibration
+         elke .dat file bevat 96*512*2 doubles
+         voor 96 rcus, 512 frequenties, een complexe waarde
+         maar nu vraag ik me wel weer af of de frequenties of de rcus eerst komen
+       */
+      //NL stations: 768 kB, Int'l: 1.5 MB. Drop optional ASCI header. See also Station/StationCal/writeCalTable.m
+      //itsDataset->dipoleCalibrationDelay().value = ???; // Pim can compute this from the GainCurve below
+      //itsDataset->dipoleCalibrationDelayUnit().value = 's';
+      //itsDataset->dipoleCalibrationGainCurve().create(???.size()).set(???); // st cal table
+      //write cal tables into proper n-dimensional h5 data set, not attribute! Add access functions to DAL?
+
+      // Skip if station is not participating in the observation (should not happen).
+      if (stationMetaData.available && 2u * 3u * header.rcuID + 2u < stationMetaData.antPositions.size()) { // bounds check for antPositions[]
+        /*TODO
+         * Selecting the right positions depends on the antenna set. Checking vs the tables in
+         * lhn001:/home/veen/lus/src/code/data/lofar/antennapositions/ can help, but their repos may be outdated.
+         */
+        vector<double> antPos(3);
+        antPos[0] = stationMetaData.antPositions[2u * 3u * header.rcuID];
+        antPos[1] = stationMetaData.antPositions[2u * 3u * header.rcuID + 1u];
+        antPos[2] = stationMetaData.antPositions[2u * 3u * header.rcuID + 2u];
+        itsDataset->antennaPosition().create(antPos.size()).set(antPos); // absolute position
+
+        itsDataset->antennaPositionUnit().value = "m";
+        itsDataset->antennaPositionFrame().value = parset.positionType(); // "ITRF"
+
+        /*
+         * The normal vector and rotation matrix are actually per antenna field,
+         * but given the HBA0/HBA1 "ears" depending on antenna set, it was
+         * decided to store them per antenna.
+         */
+        itsDataset->antennaNormalVector().create(stationMetaData.normalVector.size()).set(stationMetaData.normalVector);       // 3 doubles
+        itsDataset->antennaRotationMatrix().create(stationMetaData.rotationMatrix.size()).set(stationMetaData.rotationMatrix); // 9 doubles, 3x3, row-major
+      }
+
+      // Tile beam is the analog beam. Only HBA can have one analog beam; optional.
+      if (parset.settings.anaBeam.enabled) {
+        vector<double> anaBeamDir(2);
+        anaBeamDir[0] = parset.settings.anaBeam.direction.angle1;
+        anaBeamDir[1] = parset.settings.anaBeam.direction.angle2;
+        itsDataset->tileBeam().create(anaBeamDir.size()).set(anaBeamDir);
+        itsDataset->tileBeamUnit().value = "m";
+        itsDataset->tileBeamFrame().value = parset.settings.anaBeam.direction.type;
+
+        //itsDataset->tileBeamDipoles().create(???.size()).set(???);
+
+        //itsDataset->tileCoefUnit().value = ???;
+        //itsDataset->tileBeamCoefs().value = ???;
+
+        // Relative position within the tile.
+        //itsDataset->tileDipolePosition().value = ???;
+        //itsDataset->tileDipolePositionUnit().value = ???;
+        //itsDataset->tileDipolePositionFrame().value = ???;
+      }
+
+      // TODO: TABs: support >1 TABS and add coh/incoh (this is for SAP 0, coh TAB 0), direction (incl type)
+      double dpMeas;
+      if (!parset.settings.beamFormer.anyCoherentTABs()) {
+        dpMeas = 0.0;
+      } else {
+        dpMeas = -1.0;
+        for (unsigned sap = 0; sap < parset.settings.beamFormer.SAPs.size(); sap++) {
+          for (unsigned tab = 0; tab < parset.settings.beamFormer.SAPs[sap].TABs.size(); tab++) {
+            const ObservationSettings::BeamFormer::TAB &t = parset.settings.beamFormer.SAPs[sap].TABs[tab];
+            if (t.coherent) {
+              dpMeas = t.dispersionMeasure;
+              break;
+            }
+          }
+          if (dpMeas != -1.0) {
+            break;
+          }
+        }
+      }
+      itsDataset->dispersionMeasure().value = dpMeas;
+      itsDataset->dispersionMeasureUnit().value = "pc/cm^3";
+    }
+
+    /*
+     * NOTE: The nTrSamples arg is without the space taken by the crc32 in payload (drop too small frames earlier)
+     * and in terms of the transient sample size, i.e. sizeof(int16_t).
+     */
+    bool TBB_Dipole::crc32tbb(const TBB_Payload* payload, size_t nTrSamples)
+    {
+      itsCrc32gen.reset();
+
+      const char* ptr = reinterpret_cast<const char*>(payload->data); // to char* for strict-aliasing
+      for (unsigned i = 0; i < nTrSamples * sizeof(int16_t); i += 2) {
+        int16_t val;
+        memcpy(&val, &ptr[i], sizeof val); // strict-aliasing safe
+        val = __bswap_16(val);
+        itsCrc32gen.process_bytes(&val, sizeof val);
+      }
+
+      // It is also possible to process crc32val and see if checksum() equals 0.
+      uint32_t crc32val;
+      memcpy(&crc32val, &ptr[nTrSamples * sizeof(int16_t)], sizeof crc32val); // idem
+#if __BYTE_ORDER == __BIG_ENDIAN
+      crc32val = __bswap_32(crc32val);
+#endif
+      return itsCrc32gen.checksum() == crc32val;
+    }
+
+    bool TBB_Dipole::hasAllZeroDataSamples(const TBB_Payload& payload, unsigned nTrSamples) const
+    {
+      /*
+       * Good (noisy) data may have a few consecutive zero values, so this loop terminates
+       * quickly, unless the antenna is broken or disabled, which happens sometimes.
+       * Another reason for all zeros is that a wave generator is used and set to zero amp (pointless).
+       * Unfortunately, the crc32 variant used does not reject all zeros (checksum 0).
+       */
+      for (unsigned i = 0; i < nTrSamples; i++) {
+        if (payload.data[i] != 0) {
+          return false;
+        }
+      }
+
+      return true;
+    }
+
+  } // namespace Cobalt
+} // namespace LOFAR
+
diff --git a/RTCP/Cobalt/OutputProc/src/TBB_Dipole.h b/RTCP/Cobalt/OutputProc/src/TBB_Dipole.h
new file mode 100644
index 0000000000000000000000000000000000000000..3dd5d4f2e2994a981c1cc126533f90946ebf85f7
--- /dev/null
+++ b/RTCP/Cobalt/OutputProc/src/TBB_Dipole.h
@@ -0,0 +1,110 @@
+//# TBB_Dipole.h: TBB per-dipole routines to store incoming TBB data
+//# Copyright (C) 2012-2017  ASTRON (Netherlands Institute for Radio Astronomy)
+//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
+//#
+//# This file is part of the LOFAR software suite.
+//# The LOFAR software suite 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 3 of the License, or
+//# (at your option) any later version.
+//#
+//# The LOFAR software suite 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 the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
+//#
+//# $Id$
+
+#ifndef LOFAR_COBALT_OUTPUTPROC_TBBDIPOLE_H
+#define LOFAR_COBALT_OUTPUTPROC_TBBDIPOLE_H 1
+
+#include "TBB_Frame.h"
+#include <boost/scoped_ptr.hpp>
+#include <boost/crc.hpp>
+
+#include <Common/Thread/Mutex.h>
+#include <Stream/FileStream.h>
+#include <CoInterface/Parset.h>
+#include <CoInterface/SmartPtr.h> // when switching to C++11, replace SmartPtr with unique_ptr
+
+#include <dal/lofar/TBB_File.h>   // https://github.com/nextgen-astrodata/DAL
+
+namespace LOFAR
+{
+  namespace Cobalt
+  {
+
+    class TBB_Dipole
+    {
+      /*
+       * Note: Users don't want 1 raw file per dipole, and certainly not 1 raw file per subband (spectral mode).
+       * But as long as LOFAR control doesn't provide dump duration or length in the parset, we cannot easily do any better.
+       * In spectral mode, it is better for dispersed dumps and post-processing to store whole subbands (instead of spectra).
+       * DAL doesn't support a subband nr in a DipoleDataset, so in the .h5 can only refer to 1 raw file...
+       * Once LOFAR control supplies suitable parsets with ALL metadata, dumpInfo can be dumped...
+       */
+      boost::scoped_ptr<dal::TBB_DipoleDataset> itsDataset;
+
+      struct DumpInfo {
+        SmartPtr<LOFAR::FileStream> itsRawFile;
+        std::vector<dal::Range> itsFlagOffsets;
+        unsigned long long itsDatasetLen; // in values, including holes from missing data
+
+        // These 2 fields are lazily initialized from the 1st received frame
+        uint32_t itsTime0; // seconds
+        uint32_t itsSampleNrOrSliceNr0; // transient mode: sampleNr; spectral mode: sliceNr
+      };
+      std::vector<DumpInfo> itsDumpInfo; // size: transient mode: 1, spectral mode: RSP_NR_SUBBANDS (indexed by band nr)
+
+      time_t itsLastLogErrorTime;
+
+      /*
+       * Same truncated polynomial as standard crc32, but with:
+       *   initial_remainder=0, final_xor_value=0, reflected_input=false, reflected_remainder_output=false
+       * The boost::crc_optimal<> declarations precompute lookup tables,
+       * so do not declare inside the checking routine. (Still, for every TBB_Dipole...)
+       */
+      boost::crc_optimal<32, 0x04C11DB7 /*, 0, 0, false, false*/> itsCrc32gen;
+
+      // do not use
+      TBB_Dipole& operator=(const TBB_Dipole& rhs);
+
+    public:
+      TBB_Dipole();
+      TBB_Dipole(const TBB_Dipole& rhs); // do not use; only for TBB_Station std::vector<TBB_Dipole>(N) constr
+      ~TBB_Dipole();
+
+      // All TBB_Dipole objects are default constructed in a vector, so have init().
+      void init(const TBB_Header& header, const Parset& parset, const StationMetaData& stationMetaData,
+                const std::vector<double>& allSubbandCentralFreqs, const std::string& h5Filename,
+                dal::TBB_Station& station, Mutex& h5Mutex);
+
+      // Output threads
+      bool isInitialized() const;
+
+      void processTransientFrameData(const TBB_Frame& frame);
+      void processSpectralFrameData(const TBB_Frame& frame);
+
+    private:
+      bool doTransient() const;
+      uint32_t getTransientModeSampleNr(const TBB_Header& header) const;
+      static std::string getRawFilename(const std::string& h5Filename, bool doTransient,
+                                        unsigned rspID, unsigned rcuID);
+      void appendFlags(DumpInfo& di, size_t offset, size_t len);
+      // initTBB_DipoleDataset() must be called with the global h5Mutex held.
+      void initTBB_DipoleDataset(const TBB_Header& header, const Parset& parset,
+                                 const StationMetaData& stationMetaData,
+                                 const std::vector<double>& allSubbandCentralFreqs,
+                                 const std::string& rawFilename, dal::TBB_Station& station);
+      bool crc32tbb(const TBB_Payload* payload, size_t nTrSamples);
+      bool hasAllZeroDataSamples(const TBB_Payload& payload, unsigned nTrSamples) const;
+    };
+
+  } // namespace Cobalt
+} // namespace LOFAR
+
+#endif
+
diff --git a/RTCP/Cobalt/OutputProc/src/TBB_Frame.cc b/RTCP/Cobalt/OutputProc/src/TBB_Frame.cc
new file mode 100644
index 0000000000000000000000000000000000000000..de8dded5350c95a0bb1ebcf4d25855034fbfbaab
--- /dev/null
+++ b/RTCP/Cobalt/OutputProc/src/TBB_Frame.cc
@@ -0,0 +1,75 @@
+//# TBB_Frame.cc: TBB packet definitions
+//# Copyright (C) 2012-2017  ASTRON (Netherlands Institute for Radio Astronomy)
+//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
+//#
+//# This file is part of the LOFAR software suite.
+//# The LOFAR software suite 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 3 of the License, or
+//# (at your option) any later version.
+//#
+//# The LOFAR software suite 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 the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
+//#
+//# $Id$
+
+#include <lofar_config.h>
+
+#include "TBB_Frame.h"
+#include <climits> // CHAR_BIT
+#include <strings.h> // ffs()
+#include <boost/format.hpp>
+
+#include <Common/LofarLogger.h>
+
+namespace LOFAR
+{
+  namespace Cobalt
+  {
+
+    using namespace std;
+
+    void logErrorRateLimited(time_t *lastErrorTime, const string& msg)
+    {
+      const int logErrorRateSecs = 1;
+      time_t ts = ::time(NULL);
+      if (ts > *lastErrorTime + logErrorRateSecs) {
+        *lastErrorTime = ts;
+        LOG_ERROR(msg);
+      }
+    }
+
+
+    const unsigned TBB_Frame::transientFrameSize = sizeof(TBB_Header) +
+              DEFAULT_TBB_TRANSIENT_NSAMPLES * sizeof(int16_t) + /*crc32:*/sizeof(uint32_t);
+    const unsigned TBB_Frame::spectralFrameSize = sizeof(TBB_Header) +
+              MAX_TBB_SPECTRAL_NSAMPLES * 2 * sizeof(int16_t) + /*crc32:*/sizeof(uint32_t);
+
+    unsigned TBB_Header::getFirstBandSelNr() const
+    {
+      // 64 bit scans would be ~8x faster, but require fixes for band order (and endian)
+      for (unsigned i = 0; i < sizeof(bandSel) / sizeof(bandSel[0]); i++) {
+        int pos = ::ffs(bandSel[i]); // ffs() returns 1-indexed val, or 0 if not found
+        if (pos != 0) {
+          return i * CHAR_BIT + pos - 1;
+        }
+      }
+      return RSP_NR_SUBBANDS; // invalid band nr: not found
+    }
+
+    // or make operator<<(ostream& out, ...) as we used to have. Missing from to_string(): bandSel bitfield
+    string TBB_Header::to_string() const
+    {
+      return str(boost::format("stationID=%u rspID=%u rcuID=%u sampleFreq=%u seqNr=%u time=%u sampleNr_or_bandSliceNr=%u nOfSamplesPerFrame=%u nOfFreqBands=%u spare=%u crc16=%u") %
+                 (unsigned)stationID % (unsigned)rspID % (unsigned)rcuID % (unsigned)sampleFreq % seqNr % time %
+                 sampleNrOrBandSliceNr % nOfSamplesPerFrame % nOfFreqBands % spare % crc16);
+    }
+
+  } // namespace Cobalt
+} // namespace LOFAR
+
diff --git a/RTCP/Cobalt/OutputProc/src/TBB_Frame.h b/RTCP/Cobalt/OutputProc/src/TBB_Frame.h
new file mode 100644
index 0000000000000000000000000000000000000000..fda504b29d6ce8bb816c99d56a2f3c9e201e1a06
--- /dev/null
+++ b/RTCP/Cobalt/OutputProc/src/TBB_Frame.h
@@ -0,0 +1,135 @@
+//# TBB_Frame.h: TBB packet definitions
+//# Copyright (C) 2012-2017  ASTRON (Netherlands Institute for Radio Astronomy)
+//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
+//#
+//# This file is part of the LOFAR software suite.
+//# The LOFAR software suite 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 3 of the License, or
+//# (at your option) any later version.
+//#
+//# The LOFAR software suite 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 the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
+//#
+//# $Id$
+
+#ifndef LOFAR_COBALT_OUTPUTPROC_TBBFRAME_H
+#define LOFAR_COBALT_OUTPUTPROC_TBBFRAME_H 1
+
+#include <stdint.h>
+#include <ctime>
+#include <string>
+#include <vector>
+#include <map>
+
+namespace LOFAR
+{
+  namespace Cobalt
+  {
+
+    /*
+     * Incoming UDP frame format.
+     * From 'TBB Design Description.doc', Doc.id: LOFAR-ASTRON-SDD-047, rev. 2.8 (2009-11-30), by Arie Doorduin, Wietse Poiesz
+     * available at: http://www.lofar.org/project/lofardoc/document.php
+     *
+     * There are two types of data that can be transferred: transient data and spectral (subband) data. Everything is in little-endian byte order.
+     */
+    struct TBB_Header {
+      uint8_t stationID;        // Data source station identifier
+      uint8_t rspID;            // Data source RSP board identifier
+      uint8_t rcuID;            // Data source RCU board identifier
+      uint8_t sampleFreq;       // Sample frequency in MHz of the RCU boards: 160 or 200
+
+      uint32_t seqNr;           // Used internally by TBB. Set to 0 by RSP before computing crc16 (but written again before we receive it)
+      uint32_t time;            // Time instance in seconds of the first sample in payload
+      // The time field is relative, but if used as UNIX time, uint32_t wraps at 06:28:15 UTC on 07 Feb 2106
+      // (int32_t wraps at 03:14:08 UTC on 19 Jan 2038)
+
+      // In transient mode indicates sample number of the first payload sample in current seconds interval.
+      // In spectral mode indicates frequency band and slice (transform block of 1024 samples) of first payload sample.
+      uint32_t sampleNrOrBandSliceNr; // in spectral mode: bandNr[9:0] and sliceNr[31:10].
+#define TBB_SLICE_NR_SHIFT      10
+#define TBB_BAND_NR_MASK        ((1 << TBB_SLICE_NR_SHIFT) - 1)
+
+      uint16_t nOfSamplesPerFrame; // Total number of samples in the frame payload
+      uint16_t nOfFreqBands;    // Number of frequency bands for each spectrum in spectral mode. Is set to 0 for transient mode. Descriptive for this packet's payload.
+
+      uint8_t bandSel[64];      // Each bit in the band selector field indicates whether the band with the bit index is present in the spectrum or not.
+
+      uint16_t spare;           // For future use. Set to 0.
+      uint16_t crc16;           // CRC16 over frame header, with seqNr set to 0.
+
+
+      // Returns lowest band nr bit set in bandSel, or RSP_NR_SUBBANDS if not found.
+      unsigned getFirstBandSelNr() const;
+
+      std::string to_string() const;
+    };
+
+    struct TBB_Payload {
+      /*
+       * In transient mode, a sample is a signed 12 bit integer. In spectral mode, it is a complex int16_t.
+       * In the TBBs, transient samples are packed (2 samples per 3 bytes) with the checksum all the way at the end. This changes on transfer.
+       *
+       * TBB stores a frame in 2040 bytes (actually, 2048 with preamble and gaps). It sends a frame at a time, so derive our max from it.
+       */
+#define MAX_TBB_DATA_SIZE               (2040 - sizeof(TBB_Header) - sizeof(uint32_t))  // 1948: TBB frame size without header and payload crc32.
+
+#define MAX_TBB_TRANSIENT_NSAMPLES      (MAX_TBB_DATA_SIZE / 3 * 2)  // 1298 (.666: 1 byte padding when indeed 1298 samples would ever be stored in TBB)
+#define MAX_TBB_SPECTRAL_NSAMPLES       (MAX_TBB_DATA_SIZE / (2 * sizeof(int16_t)))     // 487
+
+      // Unpacked, sign-extended (for transient) samples without padding, i.e. as received.
+      // Frames might not be full; the doc says the crc32 is always sent right after (no padding),
+      // so we include the crc32 in 'data', but note that the crc32 is a little endian uint32_t, hence ' + 2'.
+#ifndef MAX
+#define MAX(a, b)       ((a) > (b) ? (a) : (b))
+#endif
+      int16_t data[MAX(MAX_TBB_TRANSIENT_NSAMPLES, 2 * MAX_TBB_SPECTRAL_NSAMPLES) + 2];
+
+      // For transient, TBB always sends sends 1024 samples per frame (from the spec and seen in data).
+      // For spectral, it depends on the nr of subbands (max is equal to MAX_TBB_SPECTRAL_NSAMPLES).
+
+#define SPECTRAL_TRANSFORM_SIZE         1024  // RSP FFT block size
+#define RSP_NR_SUBBANDS                 (SPECTRAL_TRANSFORM_SIZE / 2)  // equal to nr bits in TBB_Header::bandSel[]
+
+#define DEFAULT_TBB_TRANSIENT_NSAMPLES  1024  // for spectral it depends on #subbands
+    };
+
+    struct TBB_Frame {
+      static const unsigned transientFrameSize;
+      static const unsigned spectralFrameSize;
+
+      TBB_Header header;
+      TBB_Payload payload;
+    };
+
+
+    // Station meta data from other sources than the parset.
+    struct StationMetaData {
+      // If we receive data from a station not in the obs, we won't have all the meta data.
+      bool available;
+
+      // from the antenna field files
+      std::vector<double> antPositions;
+      std::vector<double> normalVector;     // [3]
+      std::vector<double> rotationMatrix;   // [3, 3] row-major order
+
+      // from the station calibration table files
+      //...
+    };
+
+    typedef std::map<unsigned, StationMetaData> StationMetaDataMap; // stationID -> StationMetaData
+
+
+    void logErrorRateLimited(time_t *lastErrorTime, const std::string& msg);
+
+  } // namespace Cobalt
+} // namespace LOFAR
+
+#endif
+
diff --git a/RTCP/Cobalt/OutputProc/src/TBB_StaticMapping.h b/RTCP/Cobalt/OutputProc/src/TBB_StaticMapping.h
index d5e56bbc1333ddda04bcd8d6b10db30ca1ecf1db..5b67c1585e7034ce7b33bcc136038a6c072b8fe3 100644
--- a/RTCP/Cobalt/OutputProc/src/TBB_StaticMapping.h
+++ b/RTCP/Cobalt/OutputProc/src/TBB_StaticMapping.h
@@ -1,5 +1,4 @@
 //# TBB_StaticMapping.h: TBB static station-node mapping class
-//# Can be used to parse LOFAR/MAC/Deployment/data/StaticMetaData/TBBConnections.dat
 //# Copyright (C) 2012-2013  ASTRON (Netherlands Institute for Radio Astronomy)
 //# P.O. Box 2, 7990 AA Dwingeloo, The Netherlands
 //#
@@ -31,6 +30,7 @@ namespace LOFAR
 namespace Cobalt
 {
 
+  // Can be used to parse LOFAR/MAC/Deployment/data/StaticMetaData/TBBConnections.dat
   class TBB_StaticMapping
   {
   public:
diff --git a/RTCP/Cobalt/OutputProc/src/TBB_Station.cc b/RTCP/Cobalt/OutputProc/src/TBB_Station.cc
new file mode 100644
index 0000000000000000000000000000000000000000..da020abb0afc66fcbcb566aa9bd66752c658c796
--- /dev/null
+++ b/RTCP/Cobalt/OutputProc/src/TBB_Station.cc
@@ -0,0 +1,219 @@
+//# TBB_Station.cc: TBB per-station routines
+//# Copyright (C) 2012-2017  ASTRON (Netherlands Institute for Radio Astronomy)
+//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
+//#
+//# This file is part of the LOFAR software suite.
+//# The LOFAR software suite 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 3 of the License, or
+//# (at your option) any later version.
+//#
+//# The LOFAR software suite 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 the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
+//#
+//# $Id$
+
+#include <lofar_config.h>
+
+#include "TBB_Station.h"
+#include <boost/format.hpp>
+
+#ifdef basename // some glibc have this as a macro
+#undef basename
+#endif
+#include <Common/SystemUtil.h>
+#include <Common/LofarLogger.h>
+#include <Common/LofarConstants.h>
+#include "CommonLofarAttributes.h"
+
+namespace LOFAR
+{
+  namespace Cobalt
+  {
+
+    using namespace std;
+
+    TBB_Station::TBB_Station(const string& stationName, Mutex& h5Mutex, const Parset& parset,
+                             const vector<double>& allSubbandCentralFreqs,
+                             const StationMetaData& stationMetaData, const string& h5Filename)
+      : itsH5File(dal::TBB_File(h5Filename, dal::TBB_File::CREATE)),
+        itsH5Mutex(h5Mutex),
+        itsStation(itsH5File.station(stationName)),
+        itsDipoles(MAX_RSPBOARDS /* = per station*/ * NR_RCUS_PER_RSPBOARD), // = 192 for int'l stations
+        itsParset(parset),
+        itsAllSubbandCentralFreqs(allSubbandCentralFreqs),
+        itsStationMetaData(stationMetaData),
+        itsH5Filename(h5Filename)
+    {
+      LOG_INFO("TBB: Created HDF5 file " + LOFAR::basename(h5Filename));
+
+      writeCommonLofarAttributes(itsH5File, parset);
+      initTBB_RootAttributesAndGroups(stationName);
+    }
+
+    TBB_Station::~TBB_Station()
+    {
+      /*
+       * Apart from the main thread, also potentially (rarely) executed by an output thread on failed
+       * to insert new TBB_Station object into an std::map. For the output thread case, do dc and slH5.
+       */
+      ScopedDelayCancellation dc;
+      try {
+        ScopedLock slH5(itsH5Mutex);
+        itsStation.nofDipoles().value = itsStation.dipoles().size();
+      } catch (exception& exc) { // dal::DALException or worse
+        LOG_WARN("TBB: failed to set station NOF_DIPOLES attribute: " + string(exc.what()));
+      }
+    }
+
+    void TBB_Station::processPayload(const TBB_Frame& frame)
+    {
+      // Guard against bogus incoming rsp/rcu IDs with at().
+      TBB_Dipole& dipole = itsDipoles.at(frame.header.rspID * NR_RCUS_PER_RSPBOARD + frame.header.rcuID);
+
+      // Each dipole stream is sent to a single port (thread), so no need to grab a mutex here to avoid double init.
+      if (!dipole.isInitialized()) {
+        // Do pass a ref to the h5 mutex for when writing into the HDF5 file.
+        dipole.init(frame.header, itsParset, itsStationMetaData,
+                    itsAllSubbandCentralFreqs, itsH5Filename, itsStation, itsH5Mutex);
+      }
+
+      if (doTransient()) {
+        dipole.processTransientFrameData(frame);
+      } else { // spectral mode
+        dipole.processSpectralFrameData(frame);
+      }
+    }
+
+    bool TBB_Station::doTransient() const
+    {
+      return itsAllSubbandCentralFreqs.empty();
+    }
+
+    // The writer creates one HDF5 file per station, so create only one Station Group here.
+    void TBB_Station::initTBB_RootAttributesAndGroups(const string& stName)
+    {
+      if (doTransient()) {
+        itsH5File.operatingMode().value = "transient";
+      } else {
+        itsH5File.operatingMode().value = "spectral";
+/*        itsH5File.spectralTransformSize().value = SPECTRAL_TRANSFORM_SIZE; TODO: enable with new DAL version */
+      }
+
+      itsStation.create();
+      itsH5File.nofStations().value = 1u;
+      initStationGroup(itsStation, stName);
+
+      // Trigger Group
+      dal::TBB_Trigger tg(itsH5File.trigger());
+      tg.create();
+      initTriggerGroup(tg);
+    }
+
+    void TBB_Station::initStationGroup(dal::TBB_Station& st, const string& stName)
+    {
+      st.groupType().value = "StationGroup";
+      st.stationName().value = stName;
+
+      // Phase centers (named 'position(s)' here and there
+      // For now, store 'LBA' or 'HBA' phase centers. TODO: Also store:
+      // - LOFAR reference phase center (in another HDF5 group)
+      // - if HBA_<any>, always store phase centers for HBA and also HBA0 & HBA1 (core stations)
+      //   so CR and other TBB users can process in whatever way they want. (reqs new DAL)
+      const string antFieldName = stName + itsParset.getString("Observation.antennaArray"); // LBA or HBA (not HBA0, HBA1)
+      try {
+        const vector<double> stPos = itsParset.position(antFieldName);
+        if (stPos.size() != 3) {
+          throw APSException("antenna field position vector must be of size 3 instead of " + stPos.size());
+        }
+        // TODO: is phaseReference, only LBA or HBA (not HBA0 or HBA1) atm
+        st.stationPosition().create(stPos.size()).set(stPos);
+        st.stationPositionUnit().value = "m";
+        st.stationPositionFrame().value = itsParset.positionType();
+      } catch (APSException& exc) {
+        LOG_WARN("TBB: failed to write antenna field phase centers: " + exc.text());
+      }
+
+      // digital beam(s)
+      if (itsParset.settings.SAPs.size() > 0) { // TODO: adapt DAL, so we can write all digital beams instead of only SAP 0, analog too if tiles (HBA)
+        vector<double> beamDir(2);
+        beamDir[0] = itsParset.settings.SAPs[0].direction.angle1;
+        beamDir[1] = itsParset.settings.SAPs[0].direction.angle2;
+        st.beamDirection().create(beamDir.size()).set(beamDir);
+        st.beamDirectionUnit().value = "m";
+        st.beamDirectionFrame().value = itsParset.settings.SAPs[0].direction.type;
+      }
+
+      try {
+        // Delay coefficients as applied by COBALT
+        // For now, store avg of delay_x and delay_y as clock correction; HBA_DUAL modes get HBA_JOINED vals for the mo. TODO: Instead, store:
+        // - all delay.x, delay.y, phase0.x, phase0.y (reqs new DAL), for:
+        // - used array mode (for a HBA_DUAL mode this gives 2x the vals) plus if HBA_<any> all of: HBA_ZERO, HBA_ONE, HBA_JOINED (skip one if used array mode or if not contained in used mode) (only for proper freq band) (reqs new DAL)
+
+        string antSet = itsParset.settings.antennaSet;
+        if (antSet.find("HBA_DUAL") != string::npos) { // HBA_DUAL or HBA_DUAL_INNER
+          antSet = "HBA_JOINED"; // current fmt has 1 attrib, so resort to this for the mo
+        }
+/*
+        int afIdx = itsParset.settings.antennaFieldIndex(antFieldName); // NOTE: fails for HBA_DUAL modes
+        if (afIdx == -1) { // TODO: have antennaFieldIndex() throw instead of return -1
+          throw APSException("antenna field not found: " + antFieldName);
+        }
+        double delay_x = itsParset.settings.antennaFields[afIdx].delay.x;
+        double delay_y = itsParset.settings.antennaFields[afIdx].delay.y;
+        double phase_x = itsParset.settings.antennaFields[afIdx].phase.x;
+        double phase_y = itsParset.settings.antennaFields[afIdx].phase.y;
+*/
+        double delay_x = itsParset.getDouble(str(boost::format("PIC.Core.%s.%s.%s.delay.X") % antFieldName % antSet % itsParset.settings.bandFilter)/*, 0.0*/);
+        double delay_y = itsParset.getDouble(str(boost::format("PIC.Core.%s.%s.%s.delay.Y") % antFieldName % antSet % itsParset.settings.bandFilter)/*, 0.0*/);
+        double clockCorr = 0.5 * (delay_x + delay_y); // TODO: remove this backwards compat, since nobody uses TBB clock corr yet
+        st.clockOffset().value = clockCorr;
+        st.clockOffsetUnit().value = "s";
+      } catch (APSException& exc) {
+        LOG_WARN("TBB: failed to write antenna field delays and phase0 values: " + exc.text());
+      }
+
+      //st.nofDipoles.value is set at the end (destr)
+    }
+
+    void TBB_Station::initTriggerGroup(dal::TBB_Trigger& tg)
+    {
+      tg.groupType().value = "TriggerGroup";
+      tg.triggerType().value = "Unknown";
+      tg.triggerVersion().value = 0; // There is no trigger algorithm info available to us yet.
+
+      // Trigger parameters (how to decide if there is a trigger; per obs)
+      try {
+        tg.paramCoincidenceChannels().value = itsParset.getInt   ("Observation.ObservationControl.StationControl.TBBControl.NoCoincChann");
+        tg.paramCoincidenceTime().value = itsParset.getDouble("Observation.ObservationControl.StationControl.TBBControl.CoincidenceTime");
+        tg.paramDirectionFit().value = itsParset.getString("Observation.ObservationControl.StationControl.TBBControl.DoDirectionFit");
+        tg.paramElevationMin().value = itsParset.getDouble("Observation.ObservationControl.StationControl.TBBControl.MinElevation");
+        tg.paramFitVarianceMax().value = itsParset.getDouble("Observation.ObservationControl.StationControl.TBBControl.MaxFitVariance");
+        //itsParset.getString("Observation.ObservationControl.StationControl.TBBControl.ParamExtension");
+      } catch (APSException& exc) {
+        LOG_WARN("TBB: Failed to write trigger parameters: " + exc.text());
+      }
+
+      // Trigger data (per trigger)
+      // N/A atm
+
+      /*
+       * It is very likely that the remaining (optional) attributes and the trigger alg
+       * will undergo many changes. TBB user/science applications will have to retrieve and
+       * set the remaining fields "by hand" for a while using e.g. DAL by checking and
+       * specifying each attribute name presumed available.
+       * Until it is clear what is needed and available, this cannot be standardized.
+       *
+       * If you add fields using parset getTYPE(), catch the possible APSException as above.
+       */
+
+    }
+
+  } // namespace Cobalt
+} // namespace LOFAR
+
diff --git a/RTCP/Cobalt/OutputProc/src/TBB_Station.h b/RTCP/Cobalt/OutputProc/src/TBB_Station.h
new file mode 100644
index 0000000000000000000000000000000000000000..23cd5f80aa2072895ea979a0bfe956973cf605f6
--- /dev/null
+++ b/RTCP/Cobalt/OutputProc/src/TBB_Station.h
@@ -0,0 +1,71 @@
+//# TBB_Station.h: TBB per-station routines
+//# Copyright (C) 2012-2017  ASTRON (Netherlands Institute for Radio Astronomy)
+//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
+//#
+//# This file is part of the LOFAR software suite.
+//# The LOFAR software suite 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 3 of the License, or
+//# (at your option) any later version.
+//#
+//# The LOFAR software suite 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 the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
+//#
+//# $Id$
+
+#ifndef LOFAR_COBALT_OUTPUTPROC_TBBSTATION_H
+#define LOFAR_COBALT_OUTPUTPROC_TBBSTATION_H 1
+
+#include "TBB_Dipole.h"
+
+namespace LOFAR
+{
+  namespace Cobalt
+  {
+
+    class TBB_Station
+    {
+      dal::TBB_File itsH5File;
+      Mutex& itsH5Mutex;
+
+      dal::TBB_Station itsStation;
+      std::vector<TBB_Dipole> itsDipoles;
+      const Parset& itsParset;
+      const std::vector<double>& itsAllSubbandCentralFreqs; // size: transient mode: 0, spectral mode: RSP_NR_SUBBANDS
+      const StationMetaData& itsStationMetaData;
+      const std::string itsH5Filename;
+
+      // do not use
+      TBB_Station();
+      TBB_Station(const TBB_Station& station);
+      TBB_Station& operator=(const TBB_Station& rhs);
+
+    public:
+      // This constructor must be called with the h5Mutex already held.
+      // The caller must still unlock after the return, the constructor does not use the passed ref to unlock.
+      TBB_Station(const std::string& stationName, Mutex& h5Mutex, const Parset& parset,
+                  const std::vector<double>& allSubbandCentralFreqs,
+                  const StationMetaData& stationMetaData, const std::string& h5Filename);
+      ~TBB_Station();
+
+      // Output threads
+      void processPayload(const TBB_Frame& frame);
+
+    private:
+      bool doTransient() const;
+
+      void initTBB_RootAttributesAndGroups(const std::string& stName);
+      void initStationGroup(dal::TBB_Station& st, const std::string& stName);
+      void initTriggerGroup(dal::TBB_Trigger& tg);
+    };
+
+  } // namespace Cobalt
+} // namespace LOFAR
+
+#endif
+
diff --git a/RTCP/Cobalt/OutputProc/src/TBB_StreamWriter.cc b/RTCP/Cobalt/OutputProc/src/TBB_StreamWriter.cc
new file mode 100644
index 0000000000000000000000000000000000000000..0e34a5e1992b0b02ad91c52c43d255b8e531b4d4
--- /dev/null
+++ b/RTCP/Cobalt/OutputProc/src/TBB_StreamWriter.cc
@@ -0,0 +1,305 @@
+//# TBB_StreamWriter.cc: manage incoming TBB stream from 1 station with in-/output thread pair
+//# Copyright (C) 2012-2017  ASTRON (Netherlands Institute for Radio Astronomy)
+//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
+//#
+//# This file is part of the LOFAR software suite.
+//# The LOFAR software suite 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 3 of the License, or
+//# (at your option) any later version.
+//#
+//# The LOFAR software suite 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 the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
+//#
+//# $Id$
+
+#include <lofar_config.h>
+
+#include "TBB_StreamWriter.h"
+#include <csignal>
+#include <endian.h>
+#if __BYTE_ORDER != __BIG_ENDIAN && __BYTE_ORDER != __LITTLE_ENDIAN
+#error Byte order is neither big endian nor little endian: not supported
+#endif
+#include <boost/lexical_cast.hpp>
+#include <boost/format.hpp>
+
+#include <Common/LofarLogger.h>
+#include <Stream/StreamFactory.h>
+#include "TBB_Writer.h"
+
+namespace LOFAR
+{
+  namespace Cobalt
+  {
+
+    using namespace std;
+
+    static void maskSignals()
+    {
+      sigset_t sigset_all_masked;
+      ::sigfillset(&sigset_all_masked);
+      int rv;
+      if ((rv = ::pthread_sigmask(SIG_SETMASK, &sigset_all_masked, NULL)) != 0) {
+        LOG_WARN("TBB: maskSignals(): pthread_sigmask() failed: " + boost::lexical_cast<string>(rv));
+      }
+    }
+
+
+    TBB_StreamWriter::TBB_StreamWriter(TBB_Writer& writer, const string& inputStreamName,
+                                       const string& logPrefix,
+                                       int& inExitStatus, int& outExitStatus)
+      : itsWriter(writer),
+        itsLogPrefix(logPrefix),
+        itsLastLogErrorTime(0),
+        itsInputStreamName(inputStreamName),
+        itsInExitStatus(inExitStatus),
+        itsOutExitStatus(outExitStatus),
+        itsInputTimeoutStamp()
+    {
+      for (unsigned i = 0; i < theirNrFrameBuffers; i++) {
+        itsFreeQueue.append(&itsFrameBuffers[i]);
+      }
+
+#ifdef TBB_DUMP_RAW_STATION_FRAMES
+      struct timeval ts;
+      ::gettimeofday(&ts, NULL);
+      string rawStDataFilename = str(boost::format("tbb_raw_station_frames_%ld_%p.fraw") % ts.tv_sec % (void*)itsFrameBuffers);
+      try {
+        itsRawStationData = new FileStream(rawStDataFilename, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH);
+      } catch (exception& exc) {
+        LOG_WARN(itsLogPrefix + "Failed to open raw station data file: " + exc.what());
+      }
+#endif
+
+      itsOutputThread.reset(new Thread(this, &TBB_StreamWriter::mainOutputLoop, "TBB-out-thr", logPrefix + "OutputThread: "));
+      try {
+        itsInputThread.reset(new Thread(this, &TBB_StreamWriter::mainInputLoop, "TBB-in-thr", logPrefix + "InputThread: "));
+      } catch (exception& ) {
+        itsReceiveQueue.append(NULL); // tell output thread to stop
+        throw;
+      }
+      // Don't change any member vars here, as threads have already started
+    }
+
+    TBB_StreamWriter::~TBB_StreamWriter()
+    {
+      itsInputThread->cancel(); // input thread will notify output thread via NULL message
+    }
+
+    time_t TBB_StreamWriter::getTimeoutStampSec() const
+    {
+      return itsInputTimeoutStamp.tv_sec; // racy read (and no access once guarantee), but only to terminate after timeout
+    }
+
+    void TBB_StreamWriter::frameHeaderLittleToHost(TBB_Header& header) const
+    {
+      header.seqNr = le32toh(header.seqNr);
+      header.time = le32toh(header.time);
+      header.sampleNrOrBandSliceNr = le32toh(header.sampleNrOrBandSliceNr);
+      header.nOfSamplesPerFrame = le16toh(header.nOfSamplesPerFrame);
+      header.nOfFreqBands = le16toh(header.nOfFreqBands);
+      header.spare = le16toh(header.spare);
+      header.crc16 = le16toh(header.crc16);
+    }
+
+    /*
+     * Assumes that the seqNr field in the TBB_Frame at buf has been zeroed.
+     * Takes a ptr to a complete header. (Drop too small frames earlier.)
+     */
+    bool TBB_StreamWriter::crc16tbb(const TBB_Header* header)
+    {
+      itsCrc16gen.reset();
+
+      const char* ptr = reinterpret_cast<const char*>(header); // to char* for strict-aliasing
+      for (unsigned i = 0; i < sizeof(*header) - sizeof(header->crc16); i += 2) {
+        int16_t val;
+        memcpy(&val, &ptr[i], sizeof val); // strict-aliasing safe
+        val = __bswap_16(val);
+        itsCrc16gen.process_bytes(&val, sizeof val);
+      }
+
+      // It is also possible to process header->crc16 and see if checksum() equals 0.
+      uint16_t crc16val = header->crc16;
+#if __BYTE_ORDER == __BIG_ENDIAN
+      crc16val = __bswap_16(crc16val);
+#endif
+      return itsCrc16gen.checksum() == crc16val;
+    }
+
+    bool TBB_StreamWriter::doTransient() const
+    {
+      return itsWriter.getAllSubbandCentralFreqs().empty();
+    }
+
+    bool TBB_StreamWriter::checkHeader(TBB_Header& header, unsigned receivedSize)
+    {
+      if (receivedSize < sizeof(TBB_Header)) {
+        logErrorRateLimited(&itsLastLogErrorTime, itsLogPrefix + "dropping too small frame size: " +
+                                                  boost::lexical_cast<string>(receivedSize));
+        return false;
+      }
+
+      uint32_t seqNr = header.seqNr; // save (little endian)
+      header.seqNr = 0; // for crc computation
+      bool crcOk = crc16tbb(&header);
+      header.seqNr = seqNr; // restore (but seqNr not used except in error msg)
+      frameHeaderLittleToHost(header);
+      if (!crcOk) {
+        /*
+         * The TBB spec states that each frame has the same fixed length, so the previous values are a good base guess if the header crc fails.
+         * But it is not clear if it is worth the effort to try to guess to fix something up. For now, drop and log.
+         */
+        logErrorRateLimited(&itsLastLogErrorTime, itsLogPrefix + "crc16 error: " + header.to_string());
+        return false;
+      }
+
+      if (header.sampleFreq != itsWriter.getSampleFreqMHz()) {
+        logErrorRateLimited(&itsLastLogErrorTime, itsLogPrefix + "dropping frame with unexpected sampleFreq in header: " +
+                                                  boost::lexical_cast<string>((unsigned)header.sampleFreq));
+        return false;
+      }
+
+      // NOTE: in spectral mode, TBB_Dipole code only supports packets with 1 band in a packet. Already enforce here.
+      if ( ( doTransient() && (header.nOfFreqBands != 0 || sizeof(TBB_Header) +
+             header.nOfSamplesPerFrame *     sizeof(int16_t) + /*crc32:*/sizeof(uint32_t) != TBB_Frame::transientFrameSize) ) ||
+           (!doTransient() && (header.nOfFreqBands != 1 || sizeof(TBB_Header) +
+             header.nOfSamplesPerFrame * 2 * sizeof(int16_t) + /*crc32:*/sizeof(uint32_t) != TBB_Frame::spectralFrameSize)) ) {
+        logErrorRateLimited(&itsLastLogErrorTime, itsLogPrefix + "dropping frame with unexpected header field nOfFreqBands: " +
+                                                  boost::lexical_cast<string>(header.nOfFreqBands) +
+                                                  " or nOfSamplesPerFrame in header: " +
+                                                  boost::lexical_cast<string>(header.nOfSamplesPerFrame));
+        return false;
+      }
+
+      return true;
+    }
+
+    void TBB_StreamWriter::mainInputLoop()
+    {
+      // Mask all signals for workers to force signal delivery to the main thread.
+      maskSignals();
+
+      // Always (try to) notify output thread to stop at the end, else we may hang.
+      class NotifyOutputThread
+      {
+        Queue<TBB_Frame*>& queue;
+      public:
+        NotifyOutputThread(Queue<TBB_Frame*>& queue) : queue(queue) { }
+
+        ~NotifyOutputThread() {
+          try {
+            queue.append(NULL);
+          } catch (exception& exc) {
+            LOG_WARN("TBB: may have failed to notify output thread to terminate: " + string(exc.what()));
+          }
+        }
+      } notifyOutThr(itsReceiveQueue);
+
+      boost::scoped_ptr<Stream> stream;
+      try {
+        stream.reset(createStream(itsInputStreamName, true));
+      } catch (Exception& exc) { // SystemCallException or CoInterfaceException (or TimeOutException)
+        LOG_WARN(itsLogPrefix + exc.text());
+        return;
+      }
+      LOG_INFO(itsLogPrefix + "reading incoming data from " + itsInputStreamName);
+
+      const unsigned expectedFrameSize = doTransient() ? TBB_Frame::transientFrameSize : TBB_Frame::spectralFrameSize;
+      while (true) {
+        TBB_Frame* frame;
+
+        try {
+          frame = itsFreeQueue.remove();
+          unsigned nread = stream->tryRead(frame, expectedFrameSize); // read() once for udp
+
+          // Notify master that we are still busy.
+          ::gettimeofday(&itsInputTimeoutStamp, NULL);
+
+#ifdef TBB_DUMP_RAW_STATION_FRAMES
+          if (itsRawStationData) {
+            try {
+              itsRawStationData->write(frame, nread);
+            } catch (exception& exc) {
+              LOG_WARN(itsLogPrefix + "failed to write raw station input frame to file " + exc.text());
+            }
+          }
+#endif
+
+          if (checkHeader(frame->header, nread)) {
+            itsReceiveQueue.append(frame);
+          } else {
+            itsFreeQueue.append(frame); // drop bad frame
+          }
+        } catch (EndOfStreamException& ) { // after end of stream, for input from file or pipe
+          itsInExitStatus = EXIT_SUCCESS;
+          break;
+        } catch (exception& exc) {
+          LOG_FATAL(itsLogPrefix + exc.what());
+          break;
+        } catch (...) { // thread cancellation exc induced after timeout, for input from udp
+          itsInExitStatus = EXIT_SUCCESS;
+          throw; // mandatory
+        }
+      }
+    }
+
+    void TBB_StreamWriter::mainOutputLoop()
+    {
+      // Mask all signals for workers to force delivery to the main thread.
+      maskSignals();
+
+      bool running = true;
+      while (running) {
+        TBB_Frame *frame;
+        try {
+          frame = NULL;
+          frame = itsReceiveQueue.remove();
+          if (frame == NULL) {
+            itsOutExitStatus = EXIT_SUCCESS;
+            break;
+          }
+
+#ifdef TBB_PRINT_QUEUE_LEN
+          LOG_INFO(itsLogPrefix + "recvqsz=" + boost::lexical_cast<string>(itsReceiveQueue.size()));
+#endif
+
+          itsWriter.getStation(frame->header)->processPayload(*frame);
+
+          // Tolerate the following exceptions. Maybe next rsp/rcu is ok; probably not...
+        } catch (SystemCallException& exc) {
+          LOG_WARN(itsLogPrefix + exc.text());
+        } catch (StorageException& exc) {
+          LOG_WARN_STR(itsLogPrefix << exc);
+        } catch (dal::DALException& exc) {
+          LOG_WARN(itsLogPrefix + exc.what());
+        } catch (out_of_range& exc) {
+          LOG_WARN(itsLogPrefix + exc.what());
+        } catch (Exception& exc) {
+          // Config/parset errors are fatal.
+          LOG_FATAL_STR(itsLogPrefix << exc);
+          running = false;
+        } catch (exception& exc) {
+          // Other errors are fatal.
+          LOG_FATAL(itsLogPrefix + exc.what());
+          running = false;
+        }
+
+        if (frame != NULL) {
+          try {
+            itsFreeQueue.append(frame);
+          } catch (exception& exc) {
+            LOG_WARN(itsLogPrefix + "may have lost a frame buffer (2): " + exc.what());
+          }
+        }
+      }
+    }
+
+  } // namespace Cobalt
+} // namespace LOFAR
+
diff --git a/RTCP/Cobalt/OutputProc/src/TBB_StreamWriter.h b/RTCP/Cobalt/OutputProc/src/TBB_StreamWriter.h
new file mode 100644
index 0000000000000000000000000000000000000000..8b897eb250305fe1cd7dc470234c280c03715011
--- /dev/null
+++ b/RTCP/Cobalt/OutputProc/src/TBB_StreamWriter.h
@@ -0,0 +1,115 @@
+//# TBB_StreamWriter.h: manage incoming TBB stream from 1 station with in-/output thread pair
+//# Copyright (C) 2012-2017  ASTRON (Netherlands Institute for Radio Astronomy)
+//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
+//#
+//# This file is part of the LOFAR software suite.
+//# The LOFAR software suite 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 3 of the License, or
+//# (at your option) any later version.
+//#
+//# The LOFAR software suite 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 the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
+//#
+//# $Id$
+
+#ifndef LOFAR_COBALT_OUTPUTPROC_TBBSTREAMWRITER_H
+#define LOFAR_COBALT_OUTPUTPROC_TBBSTREAMWRITER_H 1
+
+#ifndef USE_THREADS // from the LOFAR build system
+#error The TBB writer needs multi-threading (USE_THREADS).
+#endif
+
+#include "TBB_Frame.h"
+#include <sys/time.h>
+#include <boost/scoped_ptr.hpp>
+#include <boost/crc.hpp>
+
+#include <Common/Thread/Thread.h>
+#include <Common/Thread/Queue.h>
+#include <Stream/FileStream.h>
+
+namespace LOFAR
+{
+  namespace Cobalt
+  {
+
+    class TBB_Writer;
+
+    class TBB_StreamWriter
+    {
+      /*
+       * - The input thread receives incoming TBB frame headers, checks the header CRC, and puts them in a frameQueue.
+       * - The output thread checks the data CRC, creates an HDF5 file per station, creates groups and datasets,
+       *   writes the data, and returns empty frame pointers through the emptyQueue back to the input thread.
+       *
+       * On timeouts for all input threads, the main thread sends C++ thread cancellations. Input appends a NULL msg to notify output.
+       * This isolates (soft) real-time input from HDF5/disk latencies, and the HDF5 C library from C++ cancellation exceptions.
+       */
+
+      /*
+       * Queue size: With TBB_PRINT_QUEUE_LEN defined, the max used buffer size observed was 343.
+       * This was for 1 udp stream (instead of 6 or 12) from 1 station. Having 1024 buffers per thread seems reasonable.
+       */
+      static const unsigned theirNrFrameBuffers = 1024;
+
+      TBB_Frame itsFrameBuffers[theirNrFrameBuffers];
+
+      // Thread-safe queue with pointers that point into itsFrameBuffers.
+      Queue<TBB_Frame*> itsReceiveQueue; // input  -> output thread
+      Queue<TBB_Frame*> itsFreeQueue;    // output -> input  thread
+
+      TBB_Writer& itsWriter;
+      boost::crc_optimal<16, 0x8005 /*, 0, 0, false, false*/> itsCrc16gen;
+#ifdef TBB_DUMP_RAW_STATION_FRAMES
+      boost::scoped_ptr<LOFAR::FileStream> itsRawStationData;
+#endif
+      const std::string& itsLogPrefix;
+      time_t itsLastLogErrorTime;
+      const std::string& itsInputStreamName;
+      int& itsInExitStatus;
+      int& itsOutExitStatus;
+
+      // See TBB_Writer_main.cc::doTBB_Run() why this is used racily for now.
+      struct timeval itsInputTimeoutStamp;
+
+      boost::scoped_ptr<Thread> itsOutputThread;
+      boost::scoped_ptr<Thread> itsInputThread;
+      // Thread objects must be last in TBB_StreamWriter for safe destruction.
+
+
+      // do not use
+      TBB_StreamWriter();
+      TBB_StreamWriter(const TBB_StreamWriter& rhs);
+      TBB_StreamWriter& operator=(const TBB_StreamWriter& rhs);
+
+    public:
+      TBB_StreamWriter(TBB_Writer& writer, const std::string& inputStreamName,
+                       const std::string& logPrefix, int& inExitStatus, int& outExitStatus);
+      ~TBB_StreamWriter();
+
+      // Main thread
+      time_t getTimeoutStampSec() const;
+
+    private:
+      // Input threads
+      void frameHeaderLittleToHost(TBB_Header& fh) const;
+      bool crc16tbb(const TBB_Header* header);
+      bool doTransient() const;
+      bool checkHeader(TBB_Header& header, unsigned receivedSize);
+      void mainInputLoop();
+
+      // Output threads
+      void mainOutputLoop();
+    };
+
+  } // namespace Cobalt
+} // namespace LOFAR
+
+#endif
+
diff --git a/RTCP/Cobalt/OutputProc/src/TBB_Writer.cc b/RTCP/Cobalt/OutputProc/src/TBB_Writer.cc
index e0c09a301cb33b736234c0893cdaf809b24a3c2c..90ff8757e70e908a545779171a67c141b6b17930 100644
--- a/RTCP/Cobalt/OutputProc/src/TBB_Writer.cc
+++ b/RTCP/Cobalt/OutputProc/src/TBB_Writer.cc
@@ -1,5 +1,5 @@
 //# TBB_Writer.cc: Write TBB data into an HDF5 file
-//# Copyright (C) 2012-2015  ASTRON (Netherlands Institute for Radio Astronomy)
+//# Copyright (C) 2012-2017  ASTRON (Netherlands Institute for Radio Astronomy)
 //# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
 //#
 //# This file is part of the LOFAR software suite.
@@ -20,52 +20,21 @@
 
 #include <lofar_config.h>
 
-#ifdef HAVE_DAL
-
-#define _FILE_OFFSET_BITS 64
 #include "TBB_Writer.h"
 
-#include <cstddef>
-#include <cstring>
-#include <csignal>
-#include <ctime>
 #include <cerrno>
 #include <sys/types.h>
-#include <sys/stat.h>
 #include <sys/time.h>
 #include <unistd.h>
-#include <endian.h>
-#if __BYTE_ORDER != __BIG_ENDIAN && __BYTE_ORDER != __LITTLE_ENDIAN
-#error Byte order is neither big endian nor little endian: not supported
-#endif
-
-#include <iostream>
-#include <sstream>
-#include <algorithm>
-#include <boost/format.hpp> // TODO: replace formatString() usage by boost::format() in all TBB Writer sources
+#include <boost/format.hpp>
 
-#include <Common/LofarConstants.h>
 #include <Common/LofarLogger.h>
-#ifdef basename // some glibc have this as a macro
-#undef basename
-#endif
-#include <Common/SystemUtil.h>
-#include <Common/SystemCallException.h>
-#include <Common/StringUtil.h>
-#include <Common/StreamUtil.h>
-#include <ApplCommon/AntField.h>
-#include <Stream/StreamFactory.h>
-#include <CoInterface/Exceptions.h>
-#include <OutputProc/CommonLofarAttributes.h>
 
 #include <dal/lofar/StationNames.h>
 
 #define TBB_TRANSIENT_MODE                      1
 #define TBB_SPECTRAL_MODE                       2
 
-#define RSP_NR_SUBBANDS                         512
-#define INVALID_SUBBAND_STORAGE_INDEX           UINT_MAX
-
 namespace LOFAR
 {
   namespace Cobalt
@@ -73,1152 +42,129 @@ namespace LOFAR
 
     using namespace std;
 
-    EXCEPTION_CLASS(TBB_MalformedFrameException, StorageException);
-
-    // The output_format is without seconds. The output_size is including the terminating NUL char.
-    static string formatFilenameTimestamp(const struct timeval& tv, const char* output_format,
-                                          const char* output_format_secs, size_t output_size)
-    {
-      struct tm tm;
-      ::gmtime_r(&tv.tv_sec, &tm);
-      double secs = tm.tm_sec + tv.tv_usec / 1000000.0;
-
-      vector<char> date(output_size);
-
-      size_t nwritten = ::strftime(&date[0], output_size, output_format, &tm);
-      if (nwritten == 0) {
-        date[0] = '\0';
-      }
-      (void)::snprintf(&date[0] + nwritten, output_size - nwritten, output_format_secs, secs);
-
-      return string(&date[0]);
-    }
-
-    // FileStream doesn't do pwrite(2). Nobody else needs it, so define it here, but in the same way.
-    static size_t tryPWrite(int fd, const void *ptr, size_t size, off_t offset)
-    {
-      ssize_t bytes = ::pwrite(fd, ptr, size, offset);
-      if (bytes < 0)
-        THROW_SYSCALL("pwrite");
-      return bytes;
-    }
-
-    static void pwrite(int fd, const void *ptr, size_t size, off_t offset)
-    {
-      while (size > 0) {
-        size_t bytes = tryPWrite(fd, ptr, size, offset);
-        size -= bytes;
-        offset += bytes;
-        ptr = static_cast<const char *>(ptr) + bytes;
-      }
-    }
-
-    static ostream& operator<<(ostream& out, const TBB_Header& h)
-    {
-      out << (unsigned)h.stationID << " " << (unsigned)h.rspID << " " << (unsigned)h.rcuID << " " << (unsigned)h.sampleFreq <<
-      " " << h.seqNr << " " << h.time << " " << (h.nOfFreqBands == 0 ? h.sampleNr : h.bandSliceNr) << " " << h.nOfSamplesPerFrame <<
-      " " << h.nOfFreqBands << " " << h.spare << " " << h.crc16; // casts uin8_t to unsigned to avoid printing as char
-      return out;
-    }
-
-//////////////////////////////////////////////////////////////////////////////
-
-    TBB_Dipole::TBB_Dipole()
-      : itsRawOut(NULL) // needed, setting the others is superfluous
-      , itsDataset(NULL)
-      , itsFlagOffsets()
-      , itsSampleFreq(0)
-      , itsNrSubbands(0)
-      , itsTime(0)
-      , itsExpSampleNr(0) // also inits itsExpSliceNr
-      , itsDatasetLen(0)
-    {
-    }
-
-    // Do not use. Only needed for vector<TBB_Dipole>(N).
-    TBB_Dipole::TBB_Dipole(const TBB_Dipole& rhs)
-      : itsRawOut(NULL) // idem. FileStream has no copy constr, but only copied before really set, so NULL is fine.
-      , itsDataset(rhs.itsDataset)
-      , itsFlagOffsets(rhs.itsFlagOffsets)
-      , itsSampleFreq(rhs.itsSampleFreq)
-      , itsNrSubbands(rhs.itsNrSubbands)
-      , itsTime(rhs.itsTime)
-      , itsExpSampleNr(rhs.itsExpSampleNr)
-      , itsDatasetLen(rhs.itsDatasetLen)
-    {
-    }
-
-    TBB_Dipole::~TBB_Dipole()
-    {
-      // Executed by the main thread after joined with all workers, so no need to lock or delay cancellation.
-      if (isInitialized()) {
-        try {
-          if (itsNrSubbands == 0) { // transient mode
-            itsDataset->resize1D(itsDatasetLen);
-          } else { // spectral mode
-            vector<ssize_t> newDims(2);
-            newDims[0] = itsDatasetLen;
-            newDims[1] = itsNrSubbands; // only the 1st dim can be extended
-            itsDataset->resize(newDims);
-          }
-        } catch (exception& exc) { // dal::DALException, or std::bad_alloc from vector constr
-          LOG_WARN_STR("TBB: failed to resize HDF5 dipole dataset to external data size: " << exc.what());
-        }
-
-        try {
-          itsDataset->dataLength().value = static_cast<unsigned long long>(itsDatasetLen);
-        } catch (dal::DALException& exc) {
-          LOG_WARN_STR("TBB: failed to set dipole DATA_LENGTH attribute: " << exc.what());
-        }
-        try {
-          itsDataset->flagOffsets().create(itsFlagOffsets.size()).set(itsFlagOffsets);
-        } catch (dal::DALException& exc) {
-          LOG_WARN_STR("TBB: failed to set dipole FLAG_OFFSETS attribute: " << exc.what());
-        }
-
-        delete itsDataset;
-        delete itsRawOut;
-      }
-    }
-
-    void TBB_Dipole::init(const TBB_Header& header, const Parset& parset,
-                          const StationMetaData& stationMetaData,
-                          const SubbandInfo& subbandInfo, const string& rawFilename,
-                          dal::TBB_Station& station, Mutex& h5Mutex)
-    {
-      itsSampleFreq = static_cast<uint32_t>(header.sampleFreq) * 1000000;
-      itsNrSubbands = header.nOfFreqBands;
-      if (itsNrSubbands > subbandInfo.centralFreqs.size()) {
-        throw StorageException("TBB: dropping frame with invalid nOfFreqBands");
-      }
-
-      itsRawOut = new FileStream(rawFilename, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH);
-
-      {
-        ScopedLock h5OutLock(h5Mutex);
-        try {
-          initTBB_DipoleDataset(header, parset, stationMetaData, subbandInfo, rawFilename, station);
-        } catch (exception& ) {
-          /*
-           * This nonsense is needed, because FileStream has no FileStream() and open() (and swap()),
-           * and since we know the filename only at runtime (timestamp), we need itsRawOut to be a raw ptr.
-           * We already have a raw ptr for the dataset and >1 raw ptr in 1 C++ class becomes buggy or messy.
-           */
-          delete itsRawOut;
-          itsRawOut = NULL;
-          throw;
-        }
-      }
-
-      itsTime = header.time;
-      if (itsNrSubbands == 0) { // transient mode
-        itsExpSampleNr = header.sampleNr;
-      } else { // spectral mode
-        itsExpSliceNr = header.bandSliceNr >> TBB_SLICE_NR_SHIFT;
-      }
-      itsDatasetLen = 0; // already 0, for completeness
-    }
-
-    bool TBB_Dipole::isInitialized() const
-    {
-      return itsRawOut != NULL;
-    }
-
-    // Add a new flag range at the end or extend the last stored flag range. 'len' may not be 0.
-    void TBB_Dipole::appendFlags(size_t offset, size_t len)
-    {
-      if (itsFlagOffsets.empty() || offset > itsFlagOffsets.back().end) {
-        itsFlagOffsets.push_back(dal::Range(offset, offset + len));
-      } else { // extend
-        itsFlagOffsets.back().end += len;
-      }
-    }
-
-    void TBB_Dipole::processTransientFrameData(const TBB_Frame& frame)
-    {
-      /*
-       * Out-of-order or duplicate frames are very unlikely in the LOFAR TBB setup,
-       * but let us know if it ever happens, then we will adapt this code and appendFlags().
-       * Update: it happens when data is dumped (incorrectly) across the frozen TBB write pointer. (TODO: deal with this one time data shift)
-       */
-      if (frame.header.time < itsTime || (frame.header.time == itsTime && frame.header.sampleNr < itsExpSampleNr)) {
-        LOG_WARN_STR("TBB: Unhandled out-of-order or duplicate frame: " <<
-                     (unsigned)frame.header.stationID << " " << (unsigned)frame.header.rspID << " " << (unsigned)frame.header.rcuID <<
-                     " " << frame.header.time << " " << itsTime << " " << frame.header.sampleNr << " " << itsExpSampleNr);
-        return;
-      }
-
-      off_t offset = 0;
-      if (frame.header.time == itsTime) {
-        offset = itsDatasetLen + frame.header.sampleNr - itsExpSampleNr;
-      } else { // crossed a seconds boundary, potentially more than once on excessive frame loss
-        // A dump does not have to start at a sec bound, so up till the first bound, we may have had fewer than itsSampleFreq samples.
-        if (itsDatasetLen < (int32_t)itsSampleFreq) {
-          offset = itsDatasetLen;
-          itsTime++;
-        }
-        offset += (off_t)(frame.header.time - itsTime) * itsSampleFreq;
-
-        uint32_t newSecSampleNr0 = frame.header.sampleNr & (frame.header.nOfSamplesPerFrame - 1); // 0, or 512 by correctSampleNr()
-        offset += frame.header.sampleNr - newSecSampleNr0;
-      }
-
-      /*
-       * Flag lost frame(s) (assume no out-of-order, see below). Assumes all frames have the same nr of samples.
-       * This cannot detect lost frames at the end of a dataset.
-       */
-      size_t nskipped = offset - itsDatasetLen;
-      if (nskipped > 0) {
-        appendFlags(itsDatasetLen, nskipped);
-        itsRawOut->skip(nskipped * sizeof(frame.payload.data[0])); // skip space of lost frame(s)
-      }
-
-      /*
-       * On a data checksum error, flag these samples.
-       * Flag zeroed payloads too, as incredibly unlikely to be correct (unless wave generator used and set to zero amp (pointless)), but not rejected by crc32tbb.
-       */
-      if (!crc32tbb(&frame.payload, frame.header.nOfSamplesPerFrame)) {
-        appendFlags(offset, frame.header.nOfSamplesPerFrame);
-        uint32_t crc32;
-        memcpy(&crc32, &frame.payload.data[frame.header.nOfSamplesPerFrame], sizeof crc32); // strict-aliasing safe
-        LOG_WARN_STR("TBB: crc32: " << frame.header << " " << crc32);
-      } else if (hasAllZeroDataSamples(frame.payload, frame.header.nOfSamplesPerFrame)) {
-        appendFlags(offset, frame.header.nOfSamplesPerFrame);
-      }
-
-      // Since we are writing around HDF5, there is no need to lock. Resize the HDF5 dataset at the end (destr).
-      itsRawOut->write(frame.payload.data, static_cast<size_t>(frame.header.nOfSamplesPerFrame) * sizeof(frame.payload.data[0]));
-
-      itsTime = frame.header.time;
-      itsExpSampleNr = frame.header.sampleNr + frame.header.nOfSamplesPerFrame;
-      itsDatasetLen = offset + frame.header.nOfSamplesPerFrame;
-    }
-
-    void TBB_Dipole::processSpectralFrameData(const TBB_Frame& frame, const SubbandInfo& subbandInfo)
-    {
-      /*
-       * Out-of-order or duplicate frames are very unlikely in the LOFAR TBB setup,
-       * but let us know if it ever happens, then we will adapt this code and appendFlags().
-       * Update: it happens when data is dumped (incorrectly) across the frozen TBB write pointer. (TODO: deal with this one time data shift)
-       */
-      uint32_t sliceNr = frame.header.bandSliceNr >> TBB_SLICE_NR_SHIFT; // cannot sanitize fully: too large values indicate lost data: flag
-      if (frame.header.time < itsTime || (frame.header.time == itsTime && sliceNr < itsExpSliceNr)) {
-        LOG_WARN_STR("TBB: Unhandled out-of-order or duplicate frame: " <<
-                     (unsigned)frame.header.stationID << " " << (unsigned)frame.header.rspID << " " << (unsigned)frame.header.rcuID <<
-                     " " << frame.header.time << " " << itsTime << " " << frame.header.bandSliceNr << " " << itsExpSliceNr);
-        return;
-      }
-
-      off_t offset = 0;
-      if (frame.header.time == itsTime) {
-        offset = itsDatasetLen + sliceNr - itsExpSliceNr;
-      } else { // crossed a seconds boundary, potentially more than once on excessive frame loss
-        // A dump does not have to start at a sec bound, so up till the first bound, we may have had fewer than itsSampleFreq samples.
-        if (itsDatasetLen < (int32_t)itsSampleFreq) {
-          offset = itsDatasetLen;
-          itsTime++;
-        }
-        offset += (off_t)(frame.header.time - itsTime) * itsSampleFreq + sliceNr;
-      }
-
-      /*
-       * Flag lost frame(s) (assume no out-of-order, see below). Assumes all frames have the same nr of samples (fine).
-       * This cannot detect lost frames at the end of a dataset.
-       */
-      size_t nskipped = offset - itsDatasetLen;
-      if (nskipped > 0) {
-        appendFlags(itsDatasetLen, nskipped); // no need to skip/lseek; we use pwrite() below
-      }
-
-      /*
-       * On a data checksum error, flag these samples.
-       * Flag zeroed payloads too, as incredibly unlikely to be correct (unless wave generator used and set to zero amp (pointless)), but not rejected by crc32tbb.
-       *
-       * TBB Design Doc states the crc32 is computed for transient data only, but it is also valid for spectral data.
-       * Except that it looks invalid for the first spectral frame each second, so skip checking those. // TODO: enable 'sliceNr != 0 && ' below after verifying with recent real data
-       */
-      unsigned nSamplesPerSubband = frame.header.nOfSamplesPerFrame / itsNrSubbands; // any remainder is zeroed until the crc32
-      if (0/*sliceNr != 0 && */ /*!crc32tbb(&frame.payload, 2 * MAX_TBB_SPECTRAL_NSAMPLES)*/) {
-        appendFlags(offset, nSamplesPerSubband);
-        uint32_t crc32;
-        memcpy(&crc32, &frame.payload.data[2 * MAX_TBB_SPECTRAL_NSAMPLES], sizeof crc32); // strict-aliasing safe
-        LOG_WARN_STR("TBB: crc32: " << frame.header << " " << crc32);
-      } else if (hasAllZeroDataSamples(frame.payload, 2 * frame.header.nOfSamplesPerFrame)) {
-        appendFlags(offset, nSamplesPerSubband);
-      }
-
-      /*
-       * In practice, each frame contains the same number of samples for all subbands, so the received band number is always 0.
-       * Hence, disable support for cross-frame slices, such that in spectral mode we can also store flags in 1D.
-       */
-      /*unsigned bandNr = frame.header.bandSliceNr & TBB_BAND_NR_MASK;
-         if (bandNr + itsNrSubbands >= RSP_NR_SUBBANDS) {
-              LOG_WARN("TBB: Incorrect band number has been corrected to 0");
-              bandNr = 0; // safe default
-         }*/
-      // Data arrives interleaved, so reorder, one sample at a time. Esp. inefficient if only 1 subband, but fast enough.
-      for (unsigned i = 0; i < nSamplesPerSubband; ++i) {
-        for (unsigned j = 0; j < itsNrSubbands; ++j) {
-          off_t sampleOffset = (offset + subbandInfo.storageIndices[j /*(bandNr + j) % itsNrSubbands*/] * SPECTRAL_TRANSFORM_SIZE) * 2 * sizeof(frame.payload.data[0]);
-          pwrite(itsRawOut->fd, &frame.payload.data[2 * (i * itsNrSubbands + j)], 2 * sizeof(frame.payload.data[0]), sampleOffset);
-        }
-        offset += 1;
-      }
-
-      itsTime = frame.header.time;
-      itsExpSliceNr = sliceNr + nSamplesPerSubband;
-      itsDatasetLen = offset;
-    }
-
-    void TBB_Dipole::initTBB_DipoleDataset(const TBB_Header& header, const Parset& parset,
-                                           const StationMetaData& stationMetaData,
-                                           const SubbandInfo& subbandInfo,
-                                           const string& rawFilename, dal::TBB_Station& station)
-    {
-      itsDataset = new dal::TBB_DipoleDataset(station.dipole(header.stationID, header.rspID, header.rcuID)); // TODO: remove with new DAL version (see below)
-      const string filename = LOFAR::basename(rawFilename); // don't store paths in HDF5
-
-      // Override endianess. TBB data is always stored little endian and also received as such, so written as-is on any platform.
-      if (subbandInfo.centralFreqs.empty()) { // transient mode
-/* TODO: enable with new DAL version
-        dal::TBB_DipoleDataset* dpDataset = new dal::TBB_DipoleDataset(station.dipole(header.stationID, header.rspID, header.rcuID));
-        itsDataset = static_cast<dal::TBB_Dataset<short>*>(dpDataset);
-*/
-
-        itsDataset->create1D(0, -1, filename, itsDataset->LITTLE);
-
-/*        dpDataset->sampleNumber().value = header.sampleNr; TODO: enable with new DAL version */
-        itsDataset->sampleNumber().value = header.sampleNr;
-      } else { // spectral mode
-/* TODO: enable with new DAL version
-        dal::TBB_SubbandsDataset* sbDataset = new dal::TBB_SubbandsDataset(station.subbands(header.stationID, header.rspID, header.rcuID));
-        itsDataset = reinterpret_cast<dal::TBB_Dataset<short>*>(sbDataset); // not so nice
-*/
-
-        vector<ssize_t> dims(2), maxdims(2);
-        dims[0] = 0;
-        dims[1] = itsNrSubbands; // TODO: can be 0 for some reason, then create() throws. Shouldn't happen. Fix it.
-        maxdims[0] = -1; // only the 1st dim can be extendible
-        maxdims[1] = itsNrSubbands;
-        itsDataset->create(dims, maxdims, filename, itsDataset->LITTLE);
-
-/* TODO: enable with new DAL version
-        sbDataset->sliceNumber().value = header.bandSliceNr >> TBB_SLICE_NR_SHIFT;
-        sbDataset->spectralNofBands().value = itsNrSubbands;
-        sbDataset->spectralBands().create(itsNrSubbands).set(subbandInfo.centralFreqs);
-        sbDataset->spectralBandsUnit().value = "MHz";
-*/
-      }
-      LOG_INFO_STR("Created HDF5 Dataset for rsp,rcu " << (unsigned) header.rspID << ',' << (unsigned)header.rcuID << " for raw file " << filename);
-
-      itsDataset->groupType().value = "DipoleDataset";
-      itsDataset->stationID().value = header.stationID;
-      itsDataset->rspID().value = header.rspID;
-      itsDataset->rcuID().value = header.rcuID;
-
-      itsDataset->sampleFrequency().value = header.sampleFreq;
-      itsDataset->sampleFrequencyUnit().value = "MHz";
-
-      itsDataset->time().value = header.time; // in seconds
-
-      itsDataset->samplesPerFrame().value = header.nOfSamplesPerFrame; // possibly sanitized
-      //itsDataset->dataLength().value is set at the end (destr)
-      //itsDataset->flagOffsets().value is set at the end (destr) // TODO: attrib -> 1D dataset
-      itsDataset->nyquistZone().value = parset.settings.nyquistZone();
-
-      //#include "MAC/APL/PIC/RSP_Driver/src/CableSettings.h" or "RCUCables.h"
-      // Cable delays (optional) from static meta data.
-      //itsDataset->cableDelay().value = ???; // TODO
-      //itsDataset->cableDelayUnit().value = "ns";
-
-      /*
-         > No DIPOLE_CALIBRATION_DELAY_VALUE
-         > No DIPOLE_CALIBRATION_DELAY_UNIT
-         These can be calculated from the values in the LOFAR calibration
-         tables, but we can do that ourselves as long as the calibration table
-         values for each dipole are written to the new keyword. Sander: please put them in; see the code ref below.
-         DIPOLE_CALIBRATION_GAIN_CURVE.
-
-         // Use StaticMetaData/CalTables
-
-         calibration delay value en unit zijn nuttiger
-         en is het beste om die er gelijk in te schrijven
-         momenteel
-         In /opt/cep/lus/daily/Mon/src/code/src/PyCRTools/modules/metadata.py
-         heb ik code om de calibratie tabellen uit te lezen
-         De functie: getStationPhaseCalibration
-         elke .dat file bevat 96*512*2 doubles
-         voor 96 rcus, 512 frequenties, een complexe waarde
-         maar nu vraag ik me wel weer af of de frequenties of de rcus eerst komen
-       */
-      //NL stations: 768 kB, Int'l: 1.5 MB. Drop optional ASCI header. See also Station/StationCal/writeCalTable.m
-      //itsDataset->dipoleCalibrationDelay().value = ???; // Pim can compute this from the GainCurve below
-      //itsDataset->dipoleCalibrationDelayUnit().value = 's';
-      //itsDataset->dipoleCalibrationGainCurve().create(???.size()).set(???); // st cal table
-      //write cal tables into proper n-dimensional h5 data set, not attribute! Add access functions to DAL?
-
-      // Skip if station is not participating in the observation (should not happen).
-      if (stationMetaData.available && 2u * 3u * header.rcuID + 2u < stationMetaData.antPositions.size()) {
-        /*TODO
-         * Selecting the right positions depends on the antenna set. Checking vs the tables in
-         * lhn001:/home/veen/lus/src/code/data/lofar/antennapositions/ can help, but their repos may be outdated.
-         */
-        vector<double> antPos(3);
-        antPos[0] = stationMetaData.antPositions[2u * 3u * header.rcuID];
-        antPos[1] = stationMetaData.antPositions[2u * 3u * header.rcuID + 1u];
-        antPos[2] = stationMetaData.antPositions[2u * 3u * header.rcuID + 2u];
-        itsDataset->antennaPosition().create(antPos.size()).set(antPos); // absolute position
-
-        itsDataset->antennaPositionUnit().value = "m";
-        itsDataset->antennaPositionFrame().value = parset.positionType(); // "ITRF"
-
-        /*
-         * The normal vector and rotation matrix are actually per antenna field,
-         * but given the HBA0/HBA1 "ears" depending on antenna set, it was
-         * decided to store them per antenna.
-         */
-        itsDataset->antennaNormalVector().create(stationMetaData.normalVector.size()).set(stationMetaData.normalVector);       // 3 doubles
-        itsDataset->antennaRotationMatrix().create(stationMetaData.rotationMatrix.size()).set(stationMetaData.rotationMatrix); // 9 doubles, 3x3, row-major
-      }
-
-      // Tile beam is the analog beam. Only HBA can have one analog beam; optional.
-      if (parset.settings.anaBeam.enabled) {
-        vector<double> anaBeamDir(2);
-        anaBeamDir[0] = parset.settings.anaBeam.direction.angle1;
-        anaBeamDir[1] = parset.settings.anaBeam.direction.angle2;
-        itsDataset->tileBeam().create(anaBeamDir.size()).set(anaBeamDir);
-        itsDataset->tileBeamUnit().value = "m";
-        itsDataset->tileBeamFrame().value = parset.settings.anaBeam.direction.type;
-
-        //itsDataset->tileBeamDipoles().create(???.size()).set(???);
-
-        //itsDataset->tileCoefUnit().value = ???;
-        //itsDataset->tileBeamCoefs().value = ???;
-
-        // Relative position within the tile.
-        //itsDataset->tileDipolePosition().value = ???;
-        //itsDataset->tileDipolePositionUnit().value = ???;
-        //itsDataset->tileDipolePositionFrame().value = ???;
-      }
-
-      // TODO: TABs: support >1 TABS and add coh/incoh (this is for SAP 0, coh TAB 0), direction (incl type)
-      double dpMeas;
-      if (!parset.settings.beamFormer.anyCoherentTABs()) {
-        dpMeas = 0.0;
-      } else {
-        dpMeas = -1.0;
-        for (unsigned sap = 0; sap < parset.settings.beamFormer.SAPs.size(); sap++) {
-          for (unsigned tab = 0; tab < parset.settings.beamFormer.SAPs[sap].TABs.size(); tab++) {
-            const ObservationSettings::BeamFormer::TAB &t = parset.settings.beamFormer.SAPs[sap].TABs[tab];
-            if (t.coherent) {
-              dpMeas = t.dispersionMeasure;
-              break;
-            }
-          }
-          if (dpMeas != -1.0) {
-            break;
-          }
-        }
-      }
-      itsDataset->dispersionMeasure().value = dpMeas;
-      itsDataset->dispersionMeasureUnit().value = "pc/cm^3";
-    }
-
-    bool TBB_Dipole::hasAllZeroDataSamples(const TBB_Payload& payload, size_t nTrSamples) const
-    {
-      /*
-       * Good data only has a few consecutive zero values, so this loop terminates
-       * quickly, unless the antenna is broken or disabled, which happens sometimes.
-       */
-      for (size_t i = 0; i < nTrSamples; i++) {
-        if (payload.data[i] != 0) {
-          return false;
-        }
-      }
-
-      return true;
-    }
-
-//////////////////////////////////////////////////////////////////////////////
-
-    TBB_Station::TBB_Station(const string& stationName, Mutex& h5Mutex, const Parset& parset,
-                             const StationMetaData& stationMetaData, const string& h5Filename)
-      : itsH5File(dal::TBB_File(h5Filename, dal::TBB_File::CREATE))
-      , itsH5Mutex(h5Mutex)
-      , itsStation(itsH5File.station(stationName))
-      , itsDipoles(MAX_RSPBOARDS /* = per station*/ * NR_RCUS_PER_RSPBOARD) // = 192 for int'l stations
-      , itsParset(parset)
-      , itsStationMetaData(stationMetaData)
-      , itsSubbandInfo(getSubbandInfo(parset))
-      , itsH5Filename(h5Filename)
+    TBB_Writer::TBB_Writer(const vector<string>& inputStreamNames, const Parset& parset,
+                           const StationMetaDataMap& stationMetaDataMap,
+                           const string& outDir, const string& logPrefix,
+                           vector<int>& thrExitStatus)
+      : itsParset(parset),
+        itsAllSubbandCentralFreqs(createAllSubbandCentralFreqs(parset)),
+        itsStationMetaDataMap(stationMetaDataMap),
+        itsOutDir(outDir),
+        itsNrSubbands(parset.getUint32Vector("Observation.TBB.TBBsetting.subbandList", true).size()),
+        itsRunNr(0)
     {
-      LOG_INFO_STR("Created HDF5 file " << LOFAR::basename(h5Filename));
-
-      writeCommonLofarAttributes(itsH5File, parset);
-      initTBB_RootAttributesAndGroups(stationName);
-    }
+      itsUnknownStationMetaData.available = false;
 
-    TBB_Station::~TBB_Station()
-    {
-      /*
-       * Apart from the main thread, also potentially (rarely) executed by an output thread on failed
-       * to insert new TBB_Station object into an std::map. For the output thread case, do dc and slH5.
-       */
-      ScopedDelayCancellation dc;
-      try {
-        ScopedLock slH5(itsH5Mutex);
-        itsStation.nofDipoles().value = itsStation.dipoles().size();
-      } catch (exception& exc) { // dal::DALException or worse
-        LOG_WARN_STR("TBB: failed to set station NOF_DIPOLES attribute: " << exc.what());
+      itsStreamWriters.reserve(inputStreamNames.size());
+      for (unsigned i = 0; i < inputStreamNames.size(); i++) {
+        itsStreamWriters.push_back(SmartPtr<TBB_StreamWriter>(new TBB_StreamWriter(*this,
+            inputStreamNames[i], logPrefix, thrExitStatus.at(2 * i), thrExitStatus.at(2 * i + 1))));
       }
     }
 
-    double TBB_Station::getSubbandCentralFreq(unsigned subbandNr, unsigned nyquistZone, double sampleFreq) const
-    {
-      return (nyquistZone - 1 + (double)subbandNr / RSP_NR_SUBBANDS) * sampleFreq / 2.0;
-    }
-
-    SubbandInfo TBB_Station::getSubbandInfo(const Parset& parset) const
+    vector<double> TBB_Writer::createAllSubbandCentralFreqs(const Parset& parset) const
     {
-      SubbandInfo info;
+      vector<double> centralFreqs;
 
-      int operatingMode = itsParset.getInt("Observation.TBB.TBBsetting.operatingMode", 0);
+      int operatingMode = parset.getInt("Observation.TBB.TBBsetting.operatingMode", 0);
       if (operatingMode == TBB_SPECTRAL_MODE) {
         vector<unsigned> tbbSubbandList(parset.getUint32Vector("Observation.TBB.TBBsetting.subbandList", true));
-        if (tbbSubbandList.empty() || tbbSubbandList.size() > MAX_TBB_SPECTRAL_NSAMPLES) {
-          throw CoInterfaceException("TBB: spectral mode selected, but empty or too long subband list provided");
+        size_t nrSubbands = tbbSubbandList.size();
+        if (nrSubbands == 0 || nrSubbands > MAX_TBB_SPECTRAL_NSAMPLES) {
+          throw APSException("TBB: spectral mode selected, but empty or too long Observation.TBB.TBBsetting.subbandList");
+        }
+        std::sort  (tbbSubbandList.begin(), tbbSubbandList.end());
+        std::unique(tbbSubbandList.begin(), tbbSubbandList.end());
+        if (nrSubbands != tbbSubbandList.size()) {
+          throw APSException("TBB: duplicate subband numbers in Observation.TBB.TBBsetting.subbandList");
+        }
+        if (tbbSubbandList.back() >= RSP_NR_SUBBANDS) { // sorted, so checking last value suffices
+          throw APSException("TBB: subband number out of range [0, 512) in Observation.TBB.TBBsetting.subbandList");
         }
-        sort(tbbSubbandList.begin(), tbbSubbandList.end());
 
         unsigned nyquistZone = parset.settings.nyquistZone();
         unsigned sampleFreq = parset.settings.clockMHz;
-        info.centralFreqs.reserve(tbbSubbandList.size());
-        for (size_t i = 0; i < tbbSubbandList.size(); ++i) {
-          info.centralFreqs.push_back(getSubbandCentralFreq(tbbSubbandList[i], nyquistZone, sampleFreq));
-        }
-
-        // "Invert" tbbSubbandList, such that we can later simply lookup where to store a subband.
-        info.storageIndices.resize(RSP_NR_SUBBANDS, INVALID_SUBBAND_STORAGE_INDEX); // TODO: check for the invalid idx at frame rx
+        centralFreqs.resize(RSP_NR_SUBBANDS);
         for (unsigned i = 0; i < tbbSubbandList.size(); ++i) {
-          unsigned sbNr = tbbSubbandList[i];
-          if (sbNr >= RSP_NR_SUBBANDS) {
-            throw CoInterfaceException("TBB: indicated subband number too high");
-          }
-          info.storageIndices[sbNr] = i;
+          centralFreqs[tbbSubbandList[i]] = subbandCentralFreq(tbbSubbandList[i], nyquistZone, sampleFreq);
         }
+      } else if (operatingMode != TBB_TRANSIENT_MODE) {
+        throw APSException("TBB: invalid Observation.TBB.TBBsetting.operatingMode");
       }
 
-      return info;
+      return centralFreqs;
     }
 
-    string TBB_Station::getRawFilename(unsigned rspID, unsigned rcuID) const
+    double TBB_Writer::subbandCentralFreq(unsigned subbandNr, unsigned nyquistZone, double sampleFreq)
     {
-      string rawFilename(itsH5Filename);
-      string rsprcuStr(formatString("_%03u%03u", rspID, rcuID));
-      size_t pos = rawFilename.find('_', rawFilename.find('_') + 1);
-      rawFilename.insert(pos, rsprcuStr); // insert _rsp/rcu IDs after station name (2nd '_')
-      rawFilename.resize(rawFilename.size() - (sizeof(".h5") - 1));
-      rawFilename.append(".raw");
-      return rawFilename;
+      return (nyquistZone - 1 + (double)subbandNr / RSP_NR_SUBBANDS) * sampleFreq * 0.5;
     }
 
-    void TBB_Station::processPayload(const TBB_Frame& frame)
-    {
-      // Guard against bogus incoming rsp/rcu IDs with at().
-      TBB_Dipole& dipole(itsDipoles.at(frame.header.rspID * NR_RCUS_PER_RSPBOARD + frame.header.rcuID));
-
-      // Each dipole stream is sent to a single port (thread), so no need to grab a mutex here to avoid double init.
-      if (!dipole.isInitialized()) {
-        string rawFilename(getRawFilename(frame.header.rspID, frame.header.rcuID));
-        // Do pass a ref to the h5 mutex for when writing into the HDF5 file.
-        dipole.init(frame.header, itsParset, itsStationMetaData, itsSubbandInfo,
-                    rawFilename, itsStation, itsH5Mutex);
-      }
-
-      if (itsSubbandInfo.centralFreqs.empty()) { // transient mode
-        dipole.processTransientFrameData(frame);
-      } else { // spectral mode
-        dipole.processSpectralFrameData(frame, itsSubbandInfo);
-      }
-    }
-
-    // The writer creates one HDF5 file per station, so create only one Station Group here.
-    void TBB_Station::initTBB_RootAttributesAndGroups(const string& stName)
-    {
-      int operatingMode = itsParset.getInt("Observation.TBB.TBBsetting.operatingMode", 0);
-      if (operatingMode == TBB_SPECTRAL_MODE) {
-        itsH5File.operatingMode().value = "spectral";
-/*        itsH5File.spectralTransformSize().value = SPECTRAL_TRANSFORM_SIZE; TODO: enable with new DAL version */
-      } else {
-        itsH5File.operatingMode().value = "transient";
-      }
-
-      itsStation.create();
-      itsH5File.nofStations().value = 1u;
-      initStationGroup(itsStation, stName);
-
-      // Trigger Group
-      dal::TBB_Trigger tg(itsH5File.trigger());
-      tg.create();
-      initTriggerGroup(tg);
-    }
-
-    void TBB_Station::initStationGroup(dal::TBB_Station& st, const string& stName)
-    {
-      st.groupType().value = "StationGroup";
-      st.stationName().value = stName;
-
-      // Phase centers (named 'position(s)' here and there
-      // For now, store 'LBA' or 'HBA' phase centers. TODO: Also store:
-      // - LOFAR reference phase center (in another HDF5 group)
-      // - if HBA_<any>, always store phase centers for HBA and also HBA0 & HBA1 (core stations)
-      //   so CR and other TBB users can process in whatever way they want. (reqs new DAL)
-      const string antFieldName = stName + itsParset.getString("Observation.antennaArray"); // LBA or HBA (not HBA0, HBA1)
-      try {
-        const vector<double> stPos = itsParset.position(antFieldName);
-        if (stPos.size() != 3) {
-          throw APSException("antenna field position vector must be of size 3 instead of " + stPos.size());
-        }
-        // TODO: is phaseReference, only LBA or HBA (not HBA0 or HBA1) atm
-        st.stationPosition().create(stPos.size()).set(stPos);
-        st.stationPositionUnit().value = "m";
-        st.stationPositionFrame().value = itsParset.positionType();
-      } catch (APSException& exc) {
-        LOG_WARN_STR("TBB: failed to write antenna field phase centers: " << exc);
-      }
-
-      // digital beam(s)
-      if (itsParset.settings.SAPs.size() > 0) { // TODO: adapt DAL, so we can write all digital beams instead of only SAP 0, analog too if tiles (HBA)
-        vector<double> beamDir(2);
-        beamDir[0] = itsParset.settings.SAPs[0].direction.angle1;
-        beamDir[1] = itsParset.settings.SAPs[0].direction.angle2;
-        st.beamDirection().create(beamDir.size()).set(beamDir);
-        st.beamDirectionUnit().value = "m";
-        st.beamDirectionFrame().value = itsParset.settings.SAPs[0].direction.type;
-      }
-
-      try {
-        // Delay coefficients as applied by COBALT
-        // For now, store avg of delay_x and delay_y as clock correction; HBA_DUAL modes get HBA_JOINED vals for the mo. TODO: Instead, store:
-        // - all delay.x, delay.y, phase0.x, phase0.y (reqs new DAL), for:
-        // - used array mode (for a HBA_DUAL mode this gives 2x the vals) plus if HBA_<any> all of: HBA_ZERO, HBA_ONE, HBA_JOINED (skip one if used array mode or if not contained in used mode) (only for proper freq band) (reqs new DAL)
-
-        string antSet = itsParset.settings.antennaSet;
-        if (antSet.find("HBA_DUAL") != string::npos) { // HBA_DUAL or HBA_DUAL_INNER
-          antSet = "HBA_JOINED"; // current fmt has 1 attrib, so resort to this for the mo
-        }
-/*
-        int afIdx = itsParset.settings.antennaFieldIndex(antFieldName); // Note: fails for HBA_DUAL modes
-        if (afIdx == -1) { // TODO: have antennaFieldIndex() throw instead of return -1
-          throw APSException("antenna field not found: " + antFieldName);
-        }
-        double delay_x = itsParset.settings.antennaFields[afIdx].delay.x;
-        double delay_y = itsParset.settings.antennaFields[afIdx].delay.y;
-        double phase_x = itsParset.settings.antennaFields[afIdx].phase.x;
-        double phase_y = itsParset.settings.antennaFields[afIdx].phase.y;
-*/
-        double delay_x = itsParset.getDouble(str(boost::format("PIC.Core.%s.%s.%s.delay.X") % antFieldName % antSet % itsParset.settings.bandFilter)/*, 0.0*/);
-        double delay_y = itsParset.getDouble(str(boost::format("PIC.Core.%s.%s.%s.delay.Y") % antFieldName % antSet % itsParset.settings.bandFilter)/*, 0.0*/);
-        double clockCorr = 0.5 * (delay_x + delay_y); // TODO: remove this backwards compat, since nobody uses TBB clock corr yet
-        st.clockOffset().value = clockCorr;
-        st.clockOffsetUnit().value = "s";
-      } catch (APSException& exc) {
-        LOG_WARN_STR("TBB: failed to write antenna field delays and phase0 values: " << exc);
-      }
-
-      //st.nofDipoles.value is set at the end (destr)
-    }
-
-    void TBB_Station::initTriggerGroup(dal::TBB_Trigger& tg)
-    {
-      tg.groupType().value = "TriggerGroup";
-      tg.triggerType().value = "Unknown";
-      tg.triggerVersion().value = 0; // There is no trigger algorithm info available to us yet.
-
-      // Trigger parameters (how to decide if there is a trigger; per obs)
-      try {
-        tg.paramCoincidenceChannels().value = itsParset.getInt   ("Observation.ObservationControl.StationControl.TBBControl.NoCoincChann");
-        tg.paramCoincidenceTime().value = itsParset.getDouble("Observation.ObservationControl.StationControl.TBBControl.CoincidenceTime");
-        tg.paramDirectionFit().value = itsParset.getString("Observation.ObservationControl.StationControl.TBBControl.DoDirectionFit");
-        tg.paramElevationMin().value = itsParset.getDouble("Observation.ObservationControl.StationControl.TBBControl.MinElevation");
-        tg.paramFitVarianceMax().value = itsParset.getDouble("Observation.ObservationControl.StationControl.TBBControl.MaxFitVariance");
-        //itsParset.getString("Observation.ObservationControl.StationControl.TBBControl.ParamExtension");
-      } catch (APSException& exc) {
-        LOG_WARN_STR("TBB: Failed to write trigger parameters: " << exc);
-      }
-
-      // Trigger data (per trigger)
-      // N/A atm
-
-      /*
-       * It is very likely that the remaining (optional) attributes and the trigger alg
-       * will undergo many changes. TBB user/science applications will have to retrieve and
-       * set the remaining fields "by hand" for a while using e.g. DAL by checking and
-       * specifying each attribute name presumed available.
-       * Until it is clear what is needed and available, this cannot be standardized.
-       *
-       * If you add fields using parset getTYPE(), catch the possible APSException as above.
-       */
-
-    }
-
-//////////////////////////////////////////////////////////////////////////////
-
-    TBB_StreamWriter::TBB_StreamWriter(TBB_Writer& writer, const string& inputStreamName,
-                                       size_t expNTrSamples, const string& logPrefix,
-                                       int& inExitStatus, int& outExitStatus)
-      : itsWriter(writer)
-      , itsInputStreamName(inputStreamName)
-      , itsExpFrameSize(sizeof(TBB_Header) + expNTrSamples * sizeof(int16_t) + sizeof(uint32_t))
-      , itsLogPrefix(logPrefix)
-      , itsInExitStatus(inExitStatus)
-      , itsOutExitStatus(outExitStatus)
-#ifdef TBB_DUMP_RAW_STATION_FRAMES
-      , itsRawStationData(NULL)
-#endif
-    {
-      itsFrameBuffers = new TBB_Frame[nrFrameBuffers];
-      //itsReceiveQueue.reserve(nrFrameBuffers); // Queue does not support this...
-      try {
-        for (unsigned i = nrFrameBuffers; i > 0; ) {
-          itsFreeQueue.append(&itsFrameBuffers[--i]);
-        }
-      } catch (exception& exc) {
-        delete[] itsFrameBuffers;
-        throw;
-      }
-
-      itsTimeoutStamp.tv_sec = 0;
-      itsTimeoutStamp.tv_usec = 0;
-
-      itsOutputThread = NULL;
-      try {
-        itsOutputThread = new Thread(this, &TBB_StreamWriter::mainOutputLoop, logPrefix + "OutputThread: ");
-        itsInputThread = new Thread(this, &TBB_StreamWriter::mainInputLoop,  logPrefix + "InputThread: ");
-      } catch (exception& exc) {
-        if (itsOutputThread != NULL) {
-          try {
-            itsReceiveQueue.append(NULL); // tell output thread to stop
-          } catch (exception& exc) {
-            LOG_WARN_STR("TBB: failed to notify output thread to terminate: " << exc.what());
-          }
-          delete itsOutputThread;
-        }
-        delete[] itsFrameBuffers;
-        throw;
-      }
-
-#ifdef TBB_DUMP_RAW_STATION_FRAMES
-      struct timeval ts;
-      ::gettimeofday(&ts, NULL);
-      string rawStDataFilename("tbb_raw_station_frames_" + formatString("%ld_%p", ts.tv_sec, (void*)itsFrameBuffers) + ".fraw");
-      try {
-        itsRawStationData = new FileStream(rawStDataFilename, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH);
-      } catch (exception& exc) {
-        LOG_WARN_STR("Failed to open raw station data file: " << exc.what());
-      }
-#endif
-    }
-
-    TBB_StreamWriter::~TBB_StreamWriter()
-    {
-      // Only cancel the input thread, which will notify the output thread.
-      itsInputThread->cancel();
-
-#ifdef TBB_DUMP_RAW_STATION_FRAMES
-      delete itsRawStationData;
-#endif
-      delete itsInputThread;
-      delete itsOutputThread;
-      delete[] itsFrameBuffers;
-    }
-
-    time_t TBB_StreamWriter::getTimeoutStampSec() const
-    {
-      return itsTimeoutStamp.tv_sec; // racy read (and no access once guarantee), but only to terminate after timeout
-    }
-
-    void TBB_StreamWriter::frameHeaderLittleToHost(TBB_Header& header) const
-    {
-      header.seqNr = le32toh(header.seqNr);
-      header.time = le32toh(header.time);
-      header.sampleNr = le32toh(header.sampleNr);
-      header.nOfSamplesPerFrame = le16toh(header.nOfSamplesPerFrame);
-      header.nOfFreqBands = le16toh(header.nOfFreqBands);
-      header.spare = le16toh(header.spare);
-      header.crc16 = le16toh(header.crc16);
-    }
-
-    void TBB_StreamWriter::correctSampleNr(TBB_Header& header) const
-    {
-      /*
-       * LOFAR uses a sample rate of either 200 or 160 MHz.
-       * In transient mode, at 200 MHz we get 1024 samples per frame, and thus 195312.5 frames per second.
-       * This means that every 2 seconds, a frame overlaps a seconds boundary. But the sample values generated
-       * by the RSPs start at zero for each second, even if it should start at 512 for odd timestamps at 200 MHz.
-       * At 160 MHz sample rate, an integer number of frames fits in a second (156250), so no correction is needed.
-       */
-      if (header.sampleFreq == 200 && header.time & 1) {
-        header.sampleNr += header.nOfSamplesPerFrame / 2;
-      }
-    }
-
-    /*
-     * Assumes that the seqNr field in the TBB_Frame at buf has been zeroed.
-     * Takes a ptr to a complete header. (Drop too small frames earlier.)
-     */
-    bool TBB_StreamWriter::crc16tbb(const TBB_Header* header)
-    {
-      itsCrc16gen.reset();
-
-      const char* ptr = reinterpret_cast<const char*>(header); // to char* for strict-aliasing
-      for (unsigned i = 0; i < sizeof(*header) - sizeof(header->crc16); i += 2) {
-        int16_t val;
-        memcpy(&val, &ptr[i], sizeof val); // strict-aliasing safe
-        val = __bswap_16(val);
-        itsCrc16gen.process_bytes(&val, sizeof val);
-      }
-
-      // It is also possible to process header->crc16 and see if checksum() equals 0.
-      uint16_t crc16val = header->crc16;
-#if __BYTE_ORDER == __BIG_ENDIAN
-      crc16val = __bswap_16(crc16val);
-#endif
-      return itsCrc16gen.checksum() == crc16val;
-    }
-
-    /*
-     * Note: The nTrSamples arg is without the space taken by the crc32 in payload (drop too small frames earlier)
-     * and in terms of the transient sample size, i.e. sizeof(int16_t).
-     */
-    bool TBB_Dipole::crc32tbb(const TBB_Payload* payload, size_t nTrSamples)
-    {
-      itsCrc32gen.reset();
-
-      const char* ptr = reinterpret_cast<const char*>(payload->data); // to char* for strict-aliasing
-      for (unsigned i = 0; i < nTrSamples * sizeof(int16_t); i += 2) {
-        int16_t val;
-        memcpy(&val, &ptr[i], sizeof val); // strict-aliasing safe
-        val = __bswap_16(val);
-        itsCrc32gen.process_bytes(&val, sizeof val);
-      }
-
-      // It is also possible to process crc32val and see if checksum() equals 0.
-      uint32_t crc32val;
-      memcpy(&crc32val, &ptr[nTrSamples * sizeof(int16_t)], sizeof crc32val); // idem
-#if __BYTE_ORDER == __BIG_ENDIAN
-      crc32val = __bswap_32(crc32val);
-#endif
-      return itsCrc32gen.checksum() == crc32val;
-    }
-
-    /*
-     * Process the incoming TBB header.
-     * Note that this function may update the header, but not its crc, so you cannot re-verify it.
-     */
-    void TBB_StreamWriter::processHeader(TBB_Header& header, size_t recvPayloadSize)
-    {
-      uint32_t seqNr = header.seqNr; // save (little endian)
-      header.seqNr = 0; // for crc computation
-      bool crcOk = crc16tbb(&header);
-      header.seqNr = seqNr; // restore (but seqNr not used except in exception msg)
-      frameHeaderLittleToHost(header);
-      if (!crcOk) {
-        /*
-         * The TBB spec states that each frame has the same fixed length, so the previous values are a good base guess if the header crc fails.
-         * But it is not clear if it is worth the effort to try to guess to fix something up. For now, drop and log.
-         */
-        THROW(TBB_MalformedFrameException, "crc16: " << header);
-      }
-
-      /*
-       * Use received size instead of received nOfSamplesPerFrame header field to access data, to be safe.
-       * Just write it into the header; it's most likely already there.
-       */
-      if (recvPayloadSize < 2 * sizeof(int16_t) + sizeof(uint32_t)) {
-        // Drop it. The data crc routine only works for at least 2 transient or 1 spectral sample(s) + a crc32.
-        THROW(TBB_MalformedFrameException, "dropping too small frame: " << recvPayloadSize);
-      }
-      // Verify indicated sample freq, also to reject zeroed headers, which the crc16tbb does not reject.
-      if (header.sampleFreq != 200 && header.sampleFreq != 160) {
-        THROW(TBB_MalformedFrameException, "dropping frame with invalid sample frequency in frame header: " << header.sampleFreq);
-      }
-
-      size_t sampleSize;
-      if (header.nOfFreqBands == 0) { // transient mode TODO: do not rely on data to check data size!
-        correctSampleNr(header);
-        sampleSize = sizeof(int16_t);
-      } else { // spectral mode
-        sampleSize = 2 * sizeof(int16_t);
-      }
-      // Div with a bad recvPayloadSize could round. Causes crc32 error at worst, but avoids wrong or misaligned memory access.
-      header.nOfSamplesPerFrame = (recvPayloadSize - sizeof(uint32_t)) / sampleSize;
-    }
-
-    void TBB_StreamWriter::mainInputLoop()
-    {
-      // Always (try to) notify output thread to stop at the end, else we may hang.
-      class NotifyOutputThread
-      {
-        Queue<TBB_Frame*>& queue;
-      public:
-        NotifyOutputThread(Queue<TBB_Frame*>& queue) : queue(queue)
-        {
-        }
-        ~NotifyOutputThread()
-        {
-          try {
-            queue.append(NULL);
-          } catch (exception& exc) {
-            LOG_WARN_STR("TBB: may have failed to notify output thread to terminate: " << exc.what());
-          }
-        }
-      } notifyOutThr(itsReceiveQueue);
-
-      Stream* stream;
-      try {
-        stream = createStream(itsInputStreamName, true);
-      } catch (Exception& exc) { // SystemCallException or CoInterfaceException (or TimeOutException)
-        LOG_WARN_STR(itsLogPrefix << exc);
-        return;
-      }
-      LOG_INFO_STR(itsLogPrefix << "reading incoming data from " << itsInputStreamName);
-
-      while (1) {
-        TBB_Frame* frame;
-
-        try {
-          frame = itsFreeQueue.remove();
-
-          size_t nread = stream->tryRead(frame, itsExpFrameSize); // read() once for udp
-
-          // Notify master that we are still busy. (Racy, but ok, see the timeoutstamp decl.)
-          ::gettimeofday(&itsTimeoutStamp, NULL);
-
-#ifdef TBB_DUMP_RAW_STATION_FRAMES
-          if (itsRawStationData != NULL) {
-            try {
-              itsRawStationData->write(frame, nread);
-            } catch (exception& exc) {
-              LOG_WARN_STR(itsLogPrefix << "failed to write raw station input frame to file " << exc.what());
-            }
-          }
-#endif
-
-          if (nread < sizeof(TBB_Header)) {
-            throw TBB_MalformedFrameException("dropping too small frame");
-          }
-          processHeader(frame->header, nread - sizeof(TBB_Header));
-
-          itsReceiveQueue.append(frame);
-
-        } catch (TBB_MalformedFrameException& mffExc) {
-          // don't print stacktrace on (every) broken incoming frame
-          LOG_WARN_STR(itsLogPrefix << mffExc.what());
-          try {
-            itsFreeQueue.append(frame);
-          } catch (exception& exc) {
-            LOG_WARN_STR(itsLogPrefix << "may have lost a frame buffer (1): " << exc.what());
-          }
-        } catch (EndOfStreamException& ) { // after end of stream, for input from file or pipe
-          itsInExitStatus = 0;
-          break;
-        } catch (exception& exc) {
-          LOG_FATAL_STR(itsLogPrefix << exc.what());
-          break;
-        } catch (...) { // thread cancellation exc induced after timeout, for input from udp
-          delete stream;
-          itsInExitStatus = 0;
-          throw; // mandatory
-        }
-      }
-
-      delete stream;
-    }
-
-    void TBB_StreamWriter::mainOutputLoop()
-    {
-      bool running = true;
-      while (running) {
-        TBB_Frame* frame;
-        try {
-          frame = NULL;
-          frame = itsReceiveQueue.remove();
-          if (frame == NULL) {
-            itsOutExitStatus = 0;
-            break;
-          }
-
-#ifdef TBB_PRINT_QUEUE_LEN
-          LOG_INFO_STR(itsLogPrefix << "recvqsz=" << itsReceiveQueue.size());
-#endif
-
-          TBB_Station* station = itsWriter.getStation(frame->header);
-          station->processPayload(*frame);
-
-          // Tolerate the following exceptions. Maybe next rsp/rcu is ok; probably fatal too...
-        } catch (SystemCallException& exc) {
-          LOG_WARN_STR(itsLogPrefix << exc);
-        } catch (StorageException& exc) {
-          LOG_WARN_STR(itsLogPrefix << exc);
-        } catch (dal::DALException& exc) {
-          LOG_WARN_STR(itsLogPrefix << exc.what());
-        } catch (out_of_range& exc) {
-          LOG_WARN_STR(itsLogPrefix << exc.what());
-        } catch (Exception& exc) {
-          // Config/parset errors are fatal.
-          LOG_FATAL_STR(itsLogPrefix << exc);
-          running = false;
-        } catch (exception& exc) {
-          // Other errors are fatal.
-          LOG_FATAL_STR(itsLogPrefix << exc.what());
-          running = false;
-        }
-
-        if (frame != NULL) {
-          try {
-            itsFreeQueue.append(frame);
-          } catch (exception& exc) {
-            LOG_WARN_STR(itsLogPrefix << "may have lost a frame buffer (2): " << exc.what());
-          }
-        }
-      }
-    }
-
-//////////////////////////////////////////////////////////////////////////////
-
-    TBB_Writer::TBB_Writer(const vector<string>& inputStreamNames, const Parset& parset,
-                           const StationMetaDataMap& stationMetaDataMap,
-                           const string& outDir, const string& logPrefix,
-                           vector<int>& thrExitStatus)
-      : itsParset(parset)
-      , itsStationMetaDataMap(stationMetaDataMap)
-      , itsOutDir(outDir)
-      , itsRunNr(0)
-    {
-      // Mask all signals to inherit for workers. This forces signals to be delivered to the main thread.
-      struct SigMask {
-        sigset_t sigset_old;
-
-        SigMask()
-        {
-          sigset_t sigset_all_masked;
-          ::sigfillset(&sigset_all_masked);
-          if (::pthread_sigmask(SIG_SETMASK, &sigset_all_masked, &sigset_old) != 0) {
-            LOG_WARN_STR("TBB: pthread_sigmask() failed to mask signals to inherit for worker threads.");
-          }
-        }
-
-        ~SigMask()
-        {
-          if (::pthread_sigmask(SIG_SETMASK, &sigset_old, NULL) != 0) {
-            LOG_WARN_STR("TBB: pthread_sigmask() failed to restore signals. We may be deaf to signals.");
-          }
-        }
-      } sigm;
-
-      itsUnknownStationMetaData.available = false;
-
-      size_t expNTrSamples; // in terms of the transient sample size
-      int operatingMode = itsParset.getInt("Observation.TBB.TBBsetting.operatingMode", 0);
-      if (operatingMode == TBB_TRANSIENT_MODE) {
-        expNTrSamples = DEFAULT_TBB_TRANSIENT_NSAMPLES;
-      } else if (operatingMode == TBB_SPECTRAL_MODE) {
-        expNTrSamples = 2 * MAX_TBB_SPECTRAL_NSAMPLES;
-      } else {
-        expNTrSamples = DEFAULT_TBB_TRANSIENT_NSAMPLES;
-        LOG_WARN("TBB: Failed to get operating mode from parset, assuming transient");
-      }
-
-      itsStreamWriters.reserve(inputStreamNames.size());
-      for (unsigned i = 0; i < inputStreamNames.size(); i++) {
-        itsStreamWriters.push_back(new TBB_StreamWriter(*this, inputStreamNames[i], expNTrSamples,
-                                                        logPrefix, thrExitStatus[2 * i], thrExitStatus[2 * i + 1]));
-      }
-    }
-
-    TBB_Writer::~TBB_Writer()
-    {
-      for (unsigned i = itsStreamWriters.size(); i > 0; ) {
-        delete itsStreamWriters[--i];
-      }
-
-      map<unsigned, TBB_Station* >::iterator it(itsStations.begin());
-      for (; it != itsStations.end(); ++it) {
-        delete it->second;
-      }
-    }
-
-    TBB_Station* TBB_Writer::getStation(const TBB_Header& header)
+    TBB_Station *TBB_Writer::getStation(const TBB_Header& header)
     {
       ScopedLock sl(itsStationsMutex); // protect against insert below
-      map<unsigned, TBB_Station*>::iterator stIt(itsStations.find(header.stationID));
+      map<unsigned, SmartPtr<TBB_Station> >::iterator stIt(itsStations.find(header.stationID));
       if (stIt != itsStations.end()) {
-        return stIt->second; // common case
+        return stIt->second.get(); // common case
       }
 
       // Create new station with HDF5 file and station HDF5 group.
-      string stationName(dal::stationIDToName(header.stationID));
-      string h5Filename(createNewTBB_H5Filename(header, stationName));
+      string stationName = dal::stationIDToName(header.stationID);
+      string h5Filename = createNewTBB_H5Filename(header, stationName);
       StationMetaDataMap::const_iterator stMdIt(itsStationMetaDataMap.find(header.stationID));
       // If not found, station is not participating in the observation. Should not happen, but don't panic.
       const StationMetaData& stMetaData = stMdIt == itsStationMetaDataMap.end() ? itsUnknownStationMetaData : stMdIt->second;
 
-      TBB_Station* station;
+      SmartPtr<TBB_Station> station;
       {
         ScopedLock slH5(itsH5Mutex);
-        station = new TBB_Station(stationName, itsH5Mutex, itsParset, stMetaData, h5Filename);
-      }
-
-      try {
-        return itsStations.insert(make_pair(header.stationID, station)).first->second;
-      } catch (exception& exc) {
-        delete station;
-        throw;
+        station = new TBB_Station(stationName, itsH5Mutex, itsParset,
+                                  itsAllSubbandCentralFreqs, stMetaData, h5Filename);
       }
+      return itsStations.insert(make_pair(header.stationID, station)).first->second.get();
     }
 
     string TBB_Writer::createNewTBB_H5Filename(const TBB_Header& header, const string& stationName)
     {
-      const string typeExt("tbb.h5");
-      string obsIDStr(formatString("%u", itsParset.settings.observationID));
-
       // Use the recording time of the first (received) frame as timestamp.
       struct timeval tv;
       tv.tv_sec = header.time;
       unsigned long usecNr;
-      if (header.nOfFreqBands == 0) { // transient mode
-        usecNr = header.sampleNr;
+      if (itsAllSubbandCentralFreqs.empty()) { // transient mode
+        usecNr = header.sampleNrOrBandSliceNr; // we use an uncorrected sampleNr on 200 MHz clock if 'time & 1', but ok for filenames
       } else { // spectral mode
-        usecNr = header.bandSliceNr >> TBB_SLICE_NR_SHIFT;
+        usecNr = header.sampleNrOrBandSliceNr >> TBB_SLICE_NR_SHIFT;
       }
-      tv.tv_usec = static_cast<unsigned long>(round( static_cast<double>(usecNr) / header.sampleFreq ));
+      tv.tv_usec = (unsigned long)(round( (double)usecNr / header.sampleFreq ));
 
       // Generate the output filename, because for TBB it is not in the parset.
       // From LOFAR-USG-ICD005 spec named "LOFAR Data Format ICD File Naming Conventions", by A. Alexov et al.
       const char output_format[] = "D%Y%m%dT%H%M"; // without secs
       const char output_format_secs[] = "%06.3fZ"; // total width of ss.sss is 6
       const char output_format_example[] = "DYYYYMMDDTHHMMSS.SSSZ";
-      string triggerDateTime(formatFilenameTimestamp(tv, output_format, output_format_secs, sizeof(output_format_example)));
-      string h5Filename(itsOutDir + "L" + obsIDStr + "_" + stationName + "_" + triggerDateTime + "_" + typeExt);
+      const string triggerDateTime = formatFilenameTimestamp(tv, output_format, output_format_secs,
+                                                             sizeof(output_format_example));
+      const string typeExt("tbb.h5");
+      string h5Filename = str(boost::format("%sL%u_%s_%s_%s") % itsOutDir % itsParset.settings.observationID %
+                              stationName % triggerDateTime % typeExt);
 
       // If the file already exists, add a run nr and retry. (might race and doesn't check .raw, but good enough)
       // If >1 stations per node, start at the prev run nr if any (hence itsRunNr).
       if (itsRunNr == 0) {
-        if (::access(h5Filename.c_str(), F_OK) != 0 && errno == ENOENT) {
+        if (::access(h5Filename.c_str(), F_OK) != 0 && errno == ENOENT) { // TODO: access(2) is wrong: it tests real instead of effective uid/gid (idem below)
           // Does not exist (or broken dir after all, or dangling sym link...). Try this one.
           return h5Filename;
-        } else {         // exists, inc run number
+        } else { // exists, inc run number
           itsRunNr = 1;
         }
       }
 
       size_t pos = h5Filename.size() - typeExt.size();
-      string runNrStr(formatString("R%03u_", itsRunNr));
+      string runNrStr = str(boost::format("R%03u_") % itsRunNr);
       h5Filename.insert(pos, runNrStr);
       while (itsRunNr < 1000 && ( ::access(h5Filename.c_str(), F_OK) == 0 || errno != ENOENT )) {
         itsRunNr += 1;
-        runNrStr = formatString("R%03u_", itsRunNr);
+        runNrStr = str(boost::format("R%03u_") % itsRunNr);
         h5Filename.replace(pos, runNrStr.size(), runNrStr);
       }
       if (itsRunNr == 1000) { // run number is supposed to fit in 3 digits
@@ -1228,13 +174,40 @@ namespace LOFAR
       return h5Filename;
     }
 
+    // The output_format is without seconds. The output_size is including the terminating NUL char.
+    string TBB_Writer::formatFilenameTimestamp(const struct timeval& tv, const char* output_format,
+                                               const char* output_format_secs, size_t output_size)
+    {
+      struct tm tm;
+      ::gmtime_r(&tv.tv_sec, &tm);
+      double secs = tm.tm_sec + tv.tv_usec / 1000000.0;
+
+      vector<char> date(output_size);
+
+      size_t nwritten = ::strftime(&date[0], output_size, output_format, &tm);
+      if (nwritten == 0) {
+        date[0] = '\0';
+      }
+      (void)::snprintf(&date[0] + nwritten, output_size - nwritten, output_format_secs, secs);
+
+      return string(&date[0]);
+    }
+
+    unsigned TBB_Writer::getSampleFreqMHz() const
+    {
+      return itsParset.settings.clockMHz;
+    }
+
+    const vector<double>& TBB_Writer::getAllSubbandCentralFreqs() const
+    {
+      return itsAllSubbandCentralFreqs;
+    }
+
     time_t TBB_Writer::getTimeoutStampSec(unsigned streamWriterNr) const
     {
-      return itsStreamWriters[streamWriterNr]->getTimeoutStampSec();
+      return itsStreamWriters.at(streamWriterNr)->getTimeoutStampSec();
     }
 
   } // namespace Cobalt
 } // namespace LOFAR
 
-#endif // HAVE_DAL
-
diff --git a/RTCP/Cobalt/OutputProc/src/TBB_Writer.h b/RTCP/Cobalt/OutputProc/src/TBB_Writer.h
index ba6d0c3d008876fa0f1b862fc25071dc1ba5ea48..b9a2dc36e3409178bf92feb5a7b577782bb21490 100644
--- a/RTCP/Cobalt/OutputProc/src/TBB_Writer.h
+++ b/RTCP/Cobalt/OutputProc/src/TBB_Writer.h
@@ -1,5 +1,5 @@
-//# TBB_Writer.h: Data structures and defs to write TBB data into an HDF5 file
-//# Copyright (C) 2012-2015  ASTRON (Netherlands Institute for Radio Astronomy)
+//# TBB_Writer.h: Manage TBB StreamWriter objects, 1 per incoming station
+//# Copyright (C) 2012-2017  ASTRON (Netherlands Institute for Radio Astronomy)
 //# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
 //#
 //# This file is part of the LOFAR software suite.
@@ -21,305 +21,35 @@
 #ifndef LOFAR_COBALT_OUTPUTPROC_TBBWRITER_H
 #define LOFAR_COBALT_OUTPUTPROC_TBBWRITER_H 1
 
-#include <stdint.h>
-
-#include <string>
-#include <vector>
-#include <map>
-#include <boost/crc.hpp>
-
-#include <Common/LofarTypes.h>
-#ifndef USE_THREADS
-#error The TBB writer needs USE_THREADS to build and operate.
-#endif
-#include <Common/Thread/Thread.h>
-#include <Common/Thread/Queue.h>
-#include <Stream/FileStream.h>
-#include <CoInterface/Parset.h>
-#include <OutputProc/Package__Version.h>
-
-#ifdef HAVE_DAL
-#include <dal/lofar/TBB_File.h>
-#endif
+#include "TBB_Station.h"
+#include "TBB_StreamWriter.h"
 
 namespace LOFAR
 {
   namespace Cobalt
   {
 
-    /*
-     * Incoming UDP frame format.
-     * From 'TBB Design Description.doc', Doc.id: LOFAR-ASTRON-SDD-047, rev. 2.8 (2009-11-30), by Arie Doorduin, Wietse Poiesz
-     * available at: http://www.lofar.org/project/lofardoc/document.php
-     * Old rev. 2.0 (2006-10-3): http://lus.lofar.org/wiki/lib/exe/fetch.php?media=documents:sdd:lofar-astron-sdd-047_tbb_design_description.pdf
-     *
-     * There are two types of data that can be transferred: transient data and spectral (subband) data. Everything is in little-endian byte order.
-     */
-    struct TBB_Header {
-      uint8_t stationID;        // Data source station identifier
-      uint8_t rspID;            // Data source RSP board identifier
-      uint8_t rcuID;            // Data source RCU board identifier
-      uint8_t sampleFreq;       // Sample frequency in MHz of the RCU boards
-
-      uint32_t seqNr;           // Used internally by TBB. Set to 0 by RSP (but written again before we receive it)
-      uint32_t time;            // Time instance in seconds of the first sample in payload
-      // The time field is relative, but if used as UNIX time, uint32_t will wrap at 06:28:15 UTC on 07 Feb 2106 (int32_t wraps at 03:14:08 UTC on 19 Jan 2038).
-
-      union {
-        // In transient mode indicates sample number of the first payload sample in current seconds interval.
-        uint32_t sampleNr;
-
-        // In spectral mode indicates frequency band and slice (transform block of 1024 samples) of first payload sample.
-        uint32_t bandSliceNr;   // bandNr[9:0] and sliceNr[31:10].
-#define TBB_BAND_NR_MASK        ((1 << 10) - 1)
-#define TBB_SLICE_NR_SHIFT      10
-      };
-
-      uint16_t nOfSamplesPerFrame; // Total number of samples in the frame payload
-      uint16_t nOfFreqBands;    // Number of frequency bands for each spectrum in spectral mode. Is set to 0 for transient mode.
-
-      uint8_t bandSel[64];      // Each bit in the band selector field indicates whether the band with the bit index is present in the spectrum or not.
-
-      uint16_t spare;           // For future use. Set to 0.
-      uint16_t crc16;           // CRC16 over frame header, with seqNr set to 0.
-    };
-
-    struct TBB_Payload {
-      /*
-       * In transient mode, a sample is a signed 12 bit integer. In spectral mode, it is a complex int16_t.
-       * In the TBBs, transient samples are packed (2 samples per 3 bytes) with the checksum all the way at the end. This changes on transfer.
-       *
-       * TBB stores a frame in 2040 bytes (actually, 2048 with preamble and gaps). It sends a frame at a time, so derive our max from it.
-       */
-#define MAX_TBB_DATA_SIZE               (2040 - sizeof(TBB_Header) - sizeof(uint32_t))  // 1948: TBB frame size without header and payload crc32.
-
-#define MAX_TBB_TRANSIENT_NSAMPLES      (MAX_TBB_DATA_SIZE / 3 * 2)  // 1298 (.666: 1 byte padding when indeed 1298 samples would ever be stored in TBB)
-#define MAX_TBB_SPECTRAL_NSAMPLES       (MAX_TBB_DATA_SIZE / (2 * sizeof(int16_t)))     // 487
-
-      // Unpacked, sign-extended (for transient) samples without padding, i.e. as received.
-      // Frames might not be full; the doc says the crc32 is always sent right after (no padding), (but this is false for spectral),
-      // so we include the crc32 in 'data', but note that the crc32 is a little endian uint32_t, hence ' + 2'.
-#ifndef MAX
-#define MAX(a, b)       ((a) > (b) ? (a) : (b))
-#endif
-      int16_t data[MAX(MAX_TBB_TRANSIENT_NSAMPLES, 2 * MAX_TBB_SPECTRAL_NSAMPLES) + 2];
-
-      // For transient, TBB always sends sends 1024 samples per frame (from the spec and from the data).
-      // For spectral, it depends on the nr of subbands (max is equal to MAX_TBB_SPECTRAL_NSAMPLES).
-      // TBB sends as many samples for all subbands as it can fit; e.g. with 5 subbands, each frame has 485 samples.
-
-#define SPECTRAL_TRANSFORM_SIZE         1024  // RSP FFT block size
-
-#define DEFAULT_TBB_TRANSIENT_NSAMPLES  1024  // for spectral it depends on #subbands
-    };
-
-    struct TBB_Frame {
-      TBB_Header header;
-      TBB_Payload payload;
-    };
-
-    // Station meta data from other sources than the parset.
-    struct StationMetaData {
-      // If we receive data from a station not in the obs, we won't have all the meta data.
-      bool available;
-
-      // from the antenna field files
-      std::vector<double> antPositions;
-      std::vector<double> normalVector;     // [3]
-      std::vector<double> rotationMatrix;   // [3, 3] row-major order
-
-      // from the station calibration table files
-      //...
-    };
-
-    // From station ID to a vector of antenna position coordinate components.
-    typedef std::map<unsigned, StationMetaData> StationMetaDataMap;
-
-    struct SubbandInfo {
-      std::vector<double>   centralFreqs;   // empty in transient mode
-      std::vector<unsigned> storageIndices; // idem
-    };
-
-#ifdef HAVE_DAL
-    class TBB_Dipole
-    {
-      LOFAR::FileStream*       itsRawOut;
-/*      dal::TBB_Dataset<short>* itsDataset;  TODO: enable with new DAL version */
-      dal::TBB_DipoleDataset*  itsDataset;
-      std::vector<dal::Range>  itsFlagOffsets;
-
-      uint32_t itsSampleFreq; // Hz
-      unsigned itsNrSubbands; // spectral mode only, 0 in transient mode
-
-      uint32_t itsTime;       // seconds
-      union {
-        uint32_t itsExpSampleNr; // transient mode
-        uint32_t itsExpSliceNr;  // spectral mode
-      };
-      ssize_t itsDatasetLen;
-
-      // Same truncated polynomial as standard crc32, but with initial_remainder=0, final_xor_value=0, reflected_input=false, reflected_remainder_output=false.
-      // The boost::crc_optimal<> declarations precompute lookup tables, so do not declare inside the checking routine. (Still, for every TBB_Dipole...)
-      boost::crc_optimal<32, 0x04C11DB7 /*, 0, 0, false, false*/> itsCrc32gen;
-
-      // do not use
-      TBB_Dipole& operator=(const TBB_Dipole& rhs);
-
-    public:
-      TBB_Dipole();
-      TBB_Dipole(const TBB_Dipole& rhs); // do not use; only for TBB_Station vector<TBB_Dipole>(N) constr
-      ~TBB_Dipole();
-
-      // Output threads
-      bool isInitialized() const;
-
-      // All TBB_Dipole objects are default constructed in a vector, so have init().
-      void init(const TBB_Header& header, const Parset& parset, const StationMetaData& stationMetaData,
-                const SubbandInfo& subbandInfo, const std::string& rawFilename, dal::TBB_Station& station,
-                Mutex& h5Mutex);
-
-      void processTransientFrameData(const TBB_Frame& frame);
-      void processSpectralFrameData(const TBB_Frame& frame, const SubbandInfo& subbandInfo);
-
-    private:
-      void appendFlags(size_t offset, size_t len);
-      // initTBB_DipoleDataset() must be called with the global h5Mutex held.
-      void initTBB_DipoleDataset(const TBB_Header& header, const Parset& parset,
-                                 const StationMetaData& stationMetaData, const SubbandInfo& subbandInfo,
-                                 const std::string& rawFilename, dal::TBB_Station& station);
-      bool hasAllZeroDataSamples(const TBB_Payload& payload, size_t nTrSamples) const;
-      bool crc32tbb(const TBB_Payload* payload, size_t nTrSamples);
-    };
-
-    class TBB_Station
-    {
-      dal::TBB_File itsH5File;
-      Mutex& itsH5Mutex;
-      dal::TBB_Station itsStation;
-      std::vector<TBB_Dipole> itsDipoles;
-      const Parset& itsParset;
-      const StationMetaData& itsStationMetaData;
-      const SubbandInfo itsSubbandInfo; // for spectral mode
-      const std::string itsH5Filename;
-
-      double getSubbandCentralFreq(unsigned subbandNr, unsigned nyquistZone, double sampleFreq) const;
-      SubbandInfo getSubbandInfo(const Parset& parset) const;
-      std::string getRawFilename(unsigned rspID, unsigned rcuID) const;
-
-      // do not use
-      TBB_Station();
-      TBB_Station(const TBB_Station& station);
-      TBB_Station& operator=(const TBB_Station& rhs);
-
-    public:
-      // This constructor must be called with the h5Mutex already held.
-      // The caller must still unlock after the return, the constructor does not use the passed ref to unlock.
-      TBB_Station(const string& stationName, Mutex& h5Mutex, const Parset& parset,
-                  const StationMetaData& stationMetaData, const std::string& h5Filename);
-      ~TBB_Station();
-
-      // Output threads
-      void processPayload(const TBB_Frame& frame);
-
-    private:
-      void initTBB_RootAttributesAndGroups(const std::string& stName);
-      void initStationGroup(dal::TBB_Station& st, const std::string& stName);
-      void initTriggerGroup(dal::TBB_Trigger& tg);
-    };
-
-    class TBB_Writer;
-
-    class TBB_StreamWriter
-    {
-      /*
-       * - The input thread receives incoming TBB frame headers, checks the header CRC, and puts them in a frameQueue.
-       * - The output thread checks the data CRC, creates an HDF5 file per station, creates groups and datasets,
-       *   writes the data, and returns empty frame pointers through the emptyQueue back to the input thread.
-       *
-       * On timeouts for all input threads, the main thread sends C++ thread cancellations. Input appends a NULL msg to notify output.
-       * This isolates (soft) real-time input from HDF5/disk latencies, and the HDF5 C library from C++ cancellation exceptions.
-       */
-
-      /*
-       * Queue size: With TBB_PRINT_QUEUE_LEN defined, the max used buffer size observed was 343.
-       * This was for 1 udp stream (instead of 6 or 12) from 1 station. Having 1024 buffers per thread seems reasonable.
-       */
-      static const unsigned nrFrameBuffers = 1024;
-
-      TBB_Frame* itsFrameBuffers;
-
-      // Queue pointers point into itsFrameBuffers.
-      Queue<TBB_Frame*> itsReceiveQueue; // input  -> output thread
-      Queue<TBB_Frame*> itsFreeQueue;    // output -> input  thread
-
-      TBB_Writer& itsWriter;
-      const std::string& itsInputStreamName;
-      const unsigned itsExpFrameSize;
-      const std::string& itsLogPrefix;
-      int& itsInExitStatus;
-      int& itsOutExitStatus;
-
-      // See TBB_Writer_main.cc::doTBB_Run() why this is used racily for now.
-      // Inflate struct timeval to 64 bytes (typical LEVEL1_DCACHE_LINESIZE). Unnecessary...
-      struct timeval itsTimeoutStamp __attribute__((aligned(64)));
-
-      boost::crc_optimal<16, 0x8005 /*, 0, 0, false, false*/> itsCrc16gen;
-
-#ifdef TBB_DUMP_RAW_STATION_FRAMES
-      LOFAR::FileStream* itsRawStationData;
-#endif
-
-      // Thread objects must be last in TBB_StreamWriter for safe destruction.
-      Thread* itsOutputThread;
-      Thread* itsInputThread;
-
-      // do not use
-      TBB_StreamWriter();
-      TBB_StreamWriter(const TBB_StreamWriter& rhs);
-      TBB_StreamWriter& operator=(const TBB_StreamWriter& rhs);
-
-    public:
-      TBB_StreamWriter(TBB_Writer& writer, const std::string& inputStreamName,
-                       size_t expNTrSamples, const std::string& logPrefix,
-                       int& inExitStatus, int& outExitStatus);
-      ~TBB_StreamWriter();
-
-      // Main thread
-      time_t getTimeoutStampSec() const;
-
-    private:
-      // Input threads
-      void frameHeaderLittleToHost(TBB_Header& fh) const;
-      void correctSampleNr(TBB_Header& header) const;
-      bool crc16tbb(const TBB_Header* header);
-      void processHeader(TBB_Header& header, size_t recvPayloadSize);
-      void mainInputLoop();
-
-      // Output threads
-      void mainOutputLoop();
-    };
-
     class TBB_Writer
     {
-      // Usually, we handle only 1 station, but users have request to support multiple concurrently.
-      // The LOFAR system could better use different input streams (udp ports), but we/they are busy.
-      // map from stationID to a TBB_Station*
-      std::map<unsigned, TBB_Station*> itsStations;
-      Mutex itsStationsMutex;
-
       // Global H5 mutex. All HDF5 operations go under a single mutex, incl file creation:
-      // don't depend on the HDF5 lib being compiled with --thread-safe.
-      Mutex itsH5Mutex;
+      // we don't depend on the HDF5 lib being compiled with --thread-safe.
+      Mutex itsH5Mutex; // used in ~Station(), so declared before itsStations below for proper destruction order
+
+      // Usually, we handle only 1 station per writer, but users have requested to support multiple concurrently (still needed?).
+      std::map<unsigned, SmartPtr<TBB_Station> > itsStations; // stationID -> SmartPtr<TBB_Station>
+      Mutex itsStationsMutex;
 
       const Parset& itsParset;
+      const std::vector<double> itsAllSubbandCentralFreqs; // size: transient mode: 0, spectral mode: RSP_NR_SUBBANDS
       const StationMetaDataMap& itsStationMetaDataMap;
       StationMetaData itsUnknownStationMetaData; // referred to for data from unknown stations (fallback)
       const std::string& itsOutDir;
+      const unsigned itsNrSubbands;
 
       unsigned itsRunNr;
 
-      std::vector<TBB_StreamWriter*> itsStreamWriters;
-      // NOTE: do not add vars here; leave itsStreamWriters last for safe thread destruction!
+      std::vector<SmartPtr<TBB_StreamWriter> > itsStreamWriters;
+      // Note: do not add vars here; leave itsStreamWriters last for safe thread destruction!
 
       // do not use
       TBB_Writer();
@@ -329,22 +59,30 @@ namespace LOFAR
     public:
       TBB_Writer(const std::vector<std::string>& inputStreamNames, const Parset& parset,
                  const StationMetaDataMap& stationMetaDataMap, const std::string& outDir,
-                 const std::string& logPrefix, vector<int>& thrExitStatus);
-      ~TBB_Writer();
-
-      // Output threads
-      TBB_Station* getStation(const TBB_Header& header);
-      // Must be called holding itsStationsMutex.
-      std::string createNewTBB_H5Filename(const TBB_Header& header, const std::string& stationName);
+                 const std::string& logPrefix, std::vector<int>& thrExitStatus);
 
       // Main thread
       time_t getTimeoutStampSec(unsigned streamWriterNr) const;
-    };
 
-#endif // HAVE_DAL
+      // StreamWriter Output threads
+      TBB_Station *getStation(const TBB_Header& header);
+      std::string createNewTBB_H5Filename(const TBB_Header& header, const std::string& stationName);
+
+      unsigned getSampleFreqMHz() const;
+      const std::vector<double>& getAllSubbandCentralFreqs() const;
+
+    private:
+      // Returns vector of size RSP_NR_SUBBANDS for easy indexing.
+      // NOTE: only sets freqs of used subbands, others are 0.0.
+      std::vector<double> createAllSubbandCentralFreqs(const Parset& parset) const; // MHz
+      static double subbandCentralFreq(unsigned subbandNr, unsigned nyquistZone, double sampleFreq);
+
+      static std::string formatFilenameTimestamp(const struct timeval& tv, const char* output_format,
+                                                 const char* output_format_secs, size_t output_size);
+    };
 
   } // namespace Cobalt
 } // namespace LOFAR
 
-#endif // LOFAR_COBALT_OUTPUTPROC_TBBWRITER_H
+#endif
 
diff --git a/RTCP/Cobalt/OutputProc/src/TBB_Writer.log_prop b/RTCP/Cobalt/OutputProc/src/TBB_Writer.log_prop
index ef4d59f0d25a43450ee3705e352c28c7f0b7374a..c9e4bebd98a1f6e349d532839feeac95caa3e819 100644
--- a/RTCP/Cobalt/OutputProc/src/TBB_Writer.log_prop
+++ b/RTCP/Cobalt/OutputProc/src/TBB_Writer.log_prop
@@ -11,4 +11,4 @@ log4cplus.logger.LCS.MSLofar=WARN, STDOUT
 # Logging to console
 log4cplus.appender.STDOUT=log4cplus::ConsoleAppender
 log4cplus.appender.STDOUT.layout=log4cplus::PatternLayout
-log4cplus.appender.STDOUT.layout.ConversionPattern=TBB_Writer@%h %D{%Y-%m-%d %H:%M:%S.%q} %-5p %c{3} - %m [%b:%L]%n
+log4cplus.appender.STDOUT.layout.ConversionPattern=TBB_Writer@%h %D{%Y-%m-%d %H:%M:%S.%q} %-5p - %m%n
diff --git a/RTCP/Cobalt/OutputProc/src/TBB_Writer_main.cc b/RTCP/Cobalt/OutputProc/src/TBB_Writer_main.cc
index 13fc820080230a81006b7f463e2915e66cfaa804..65c22dfe8a580d41dbf43e3dcddd9d840e5ea636 100644
--- a/RTCP/Cobalt/OutputProc/src/TBB_Writer_main.cc
+++ b/RTCP/Cobalt/OutputProc/src/TBB_Writer_main.cc
@@ -1,5 +1,5 @@
 //# TBB_Writer_main.cc: LOFAR Transient Buffer Boards (TBB) Data Writer
-//# Copyright (C) 2012-2015  ASTRON (Netherlands Institute for Radio Astronomy)
+//# Copyright (C) 2012-2017  ASTRON (Netherlands Institute for Radio Astronomy)
 //# P.O. Box 2, 7990 AA Dwingeloo, The Netherlands.
 //#
 //# This program is free software: you can redistribute it and/or modify
@@ -19,16 +19,15 @@
 
 #include <lofar_config.h>               // before any other include
 
-#define _FILE_OFFSET_BITS 64
 #include <cstddef>
 #include <cstdlib>
 #include <csignal>
 #include <cstring>
 #include <cerrno>
-#include <libgen.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/time.h>
+#include <sys/resource.h>
 #include <unistd.h>
 #include <getopt.h>
 
@@ -39,17 +38,12 @@
 #include <boost/lexical_cast.hpp>
 
 #include <Common/LofarLogger.h>
-#include <Common/StringUtil.h>
 #include <Common/IOPriority.h>
 #include <ApplCommon/StationConfig.h>
 #include <ApplCommon/AntField.h>
-#include <CoInterface/Exceptions.h>
+#include <OutputProc/Package__Version.h>
 
-#ifdef HAVE_DAL
-#  include <dal/lofar/StationNames.h>
-#else
-#  warning The TBB writer may be built without DAL, but will not write any output
-#endif
+#include <dal/lofar/StationNames.h>     // https://github.com/nextgen-astrodata/DAL
 
 #include "TBB_Writer.h"
 
@@ -102,6 +96,23 @@ static void setTermSigsHandler()
   }
 }
 
+// Seems that CentOS and Ubuntu by default allow raising soft to 4096. Rejected under valgrind.
+static void setMaxOpenFileDescriptors(rlim_t soft)
+{
+  struct rlimit rl;
+  if (getrlimit(RLIMIT_NOFILE, &rl) < 0) { // get rl.rlim_max
+    LOG_WARN("TBB: failed to getrlimit(RLIMIT_NOFILE, ...) to then increase max nr of open file descriptors");
+  }
+
+  if (rl.rlim_cur < soft) {
+    rl.rlim_cur = soft;
+    if (setrlimit(RLIMIT_NOFILE, &rl) < 0) {
+      LOG_WARN(string("TBB: failed to setrlimit(RLIMIT_NOFILE, ") +
+               boost::lexical_cast<string>(soft) + ") to increase max nr of open file descriptors");
+    }
+  }
+}
+
 static vector<string> getTBB_InputStreamNames(const string& input, vector<uint16_t>& ports)
 {
   vector<string> allInputStreamNames;
@@ -109,7 +120,7 @@ static vector<string> getTBB_InputStreamNames(const string& input, vector<uint16
     for (vector<uint16_t>::iterator it = ports.begin(); it != ports.end(); ++it) {
       // 0.0.0.0: could restrict to station IPs/network, but need netmask lookup
       // and allow localhost. Not critical: data arrives via a separate VLAN.
-      string streamName(input + ":0.0.0.0:" + LOFAR::formatString("%hu", *it));
+      string streamName(input + ":0.0.0.0:" + boost::lexical_cast<string>(*it));
       allInputStreamNames.push_back(streamName);
     }
   } else { // file or named pipe input
@@ -125,7 +136,7 @@ static vector<string> getTBB_InputStreamNames(const string& input, vector<uint16
     } else { // expand e.g. file:x%y-%.raw into {file:x%y-0.raw, file:x%y-1.raw, ..., file:x%y-11.raw}
       for (unsigned i = 0; i < ports.size(); ++i) {
         string streamName(input);
-        streamName.replace(placeholderPos, 1, LOFAR::formatString("%u", i));
+        streamName.replace(placeholderPos, 1, boost::lexical_cast<string>(i));
         if (access(streamName.c_str() + colonPos + 1, R_OK) == 0) {
           allInputStreamNames.push_back(streamName);
         }
@@ -206,16 +217,12 @@ static LOFAR::Cobalt::StationMetaDataMap getExternalStationMetaData(const LOFAR:
       stMetaData.normalVector = antField.normVector(fieldIdx).second;
       stMetaData.rotationMatrix = antField.rotationMatrix(fieldIdx).second;
 
-#ifdef HAVE_DAL
       stMdMap.insert(make_pair(dal::stationNameToID(stName), stMetaData));
-#endif
     }
   } catch (LOFAR::AssertError& exc) {
     // Throwing AssertError already sends a message to the logger.
-#ifdef HAVE_DAL
   } catch (dal::DALValueError& exc) {
     throw LOFAR::Cobalt::StorageException(exc.what());
-#endif
   }
 
   return stMdMap;
@@ -224,17 +231,11 @@ static LOFAR::Cobalt::StationMetaDataMap getExternalStationMetaData(const LOFAR:
 static int doTBB_Run(const vector<string>& inputStreamNames, const LOFAR::Cobalt::Parset& parset,
                      const LOFAR::Cobalt::StationMetaDataMap& stMdMap, struct progArgs& args)
 {
-  string logPrefix("TBB obs " + LOFAR::formatString("%u", parset.settings.observationID) + ": ");
+  string logPrefix("TBB obs " + boost::lexical_cast<string>(parset.settings.observationID) + ": ");
 
-  vector<int> thrExitStatus(2 * inputStreamNames.size(), 1);
-  int status = 1;
+  vector<int> thrExitStatus(2 * inputStreamNames.size(), EXIT_FAILURE);
+  int status = EXIT_FAILURE;
   try {
-#ifndef HAVE_DAL
-    // Allow building without DAL (some users don't need TBB_Writer), but bail if run.
-    (void)stMdMap; // silence compiler warning
-    (void)args; // idem
-    throw LOFAR::APSException("TBB_Writer needs but was not built with DAL");
-#else
     // When this obj goes out of scope, worker threads are cancelled and joined with.
     LOFAR::Cobalt::TBB_Writer writer(inputStreamNames, parset, stMdMap, args.outputDir, logPrefix, thrExitStatus);
 
@@ -272,18 +273,18 @@ static int doTBB_Run(const vector<string>& inputStreamNames, const LOFAR::Cobalt
       }
     } while (nrWorkersDone < inputStreamNames.size());
 
-    status = 0;
-#endif
+    status = EXIT_SUCCESS;
+
   } catch (LOFAR::Exception& exc) {
     LOG_FATAL_STR(logPrefix << "LOFAR::Exception: " << exc);
   } catch (exception& exc) {
-    LOG_FATAL_STR(logPrefix << "std::exception: " << exc.what());
+    LOG_FATAL(logPrefix + "std::exception: " + exc.what());
   }
 
-  // Propagate exit status != 0 from any input or output worker thread.
+  // Propagate exit status != EXIT_SUCCESS from any input or output worker thread.
   for (unsigned i = 0; i < thrExitStatus.size(); ++i) {
-    if (thrExitStatus[i] != 0) {
-      status = 1;
+    if (thrExitStatus[i] != EXIT_SUCCESS) {
+      status = EXIT_FAILURE;
       break;
     }
   }
@@ -333,7 +334,7 @@ static void printUsage(const char* progname)
 
 static int parseArgs(int argc, char *argv[], struct progArgs* args)
 {
-  int status = 0;
+  int status = EXIT_SUCCESS;
 
   bool parsetFilenameSpecified = false; // there is no default parset filename, so not passing it is fatal 
   // Default values
@@ -384,7 +385,7 @@ static int parseArgs(int argc, char *argv[], struct progArgs* args)
       }
       if ((err = isAccessibleDirname(args->stCalTablesDir)) != 0) {
         cerr << "TBB: station cal tab dir argument value " << optarg << ": " << strerror(err) << endl;
-        status = 1;
+        status = EXIT_FAILURE;
       }
       break;
     case 'm':
@@ -394,7 +395,7 @@ static int parseArgs(int argc, char *argv[], struct progArgs* args)
       }
       if ((err = isAccessibleDirname(args->staticMetaDataDir)) != 0) {
         cerr << "TBB: antenna field dir argument value " << optarg << ": " << strerror(err) << endl;
-        status = 1;
+        status = EXIT_FAILURE;
       }
       break;
     case 'o':
@@ -404,7 +405,7 @@ static int parseArgs(int argc, char *argv[], struct progArgs* args)
       }
       if ((err = isAccessibleDirname(args->outputDir)) != 0) {
         cerr << "TBB: output dir argument value " << optarg << ": " << strerror(err) << endl;
-        status = 1;
+        status = EXIT_FAILURE;
       }
       break;
     case 'i':
@@ -414,7 +415,7 @@ static int parseArgs(int argc, char *argv[], struct progArgs* args)
         args->input = optarg;
       } else {
         cerr << "TBB: Invalid input argument value: " << optarg << endl;
-        status = 1;
+        status = EXIT_FAILURE;
       }
       break;
     case 'p':
@@ -436,7 +437,7 @@ static int parseArgs(int argc, char *argv[], struct progArgs* args)
         }
       } catch (boost::bad_lexical_cast& exc) {
         cerr << "TBB: Invalid port argument value: " << optarg << endl;
-        status = 1;
+        status = EXIT_FAILURE;
       }
       break;
     case 't':
@@ -444,7 +445,7 @@ static int parseArgs(int argc, char *argv[], struct progArgs* args)
         args->timeoutVal.tv_sec = boost::lexical_cast<unsigned long>(optarg);
       } catch (boost::bad_lexical_cast& /*exc*/) {
         cerr << "TBB: Invalid timeout argument value: " << optarg << endl;
-        status = 1;
+        status = EXIT_FAILURE;
       }
       break;
     case 'k':
@@ -452,7 +453,7 @@ static int parseArgs(int argc, char *argv[], struct progArgs* args)
         args->keepRunning = boost::lexical_cast<bool>(optarg);
       } catch (boost::bad_lexical_cast& /*exc*/) {
         cerr << "TBB: Invalid keeprunning argument value: " << optarg << endl;
-        status = 1;
+        status = EXIT_FAILURE;
       }
       break;
     case 'h':
@@ -460,7 +461,7 @@ static int parseArgs(int argc, char *argv[], struct progArgs* args)
       return 2;
     default: // '?'
       cerr << "TBB: Invalid program argument or missing argument value: " << argv[optind - 1] << endl;
-      status = 1;
+      status = EXIT_FAILURE;
       break;
     }
   }
@@ -472,12 +473,12 @@ static int parseArgs(int argc, char *argv[], struct progArgs* args)
       oss << " " << argv[optind++]; // good enough
     }
     cerr << oss.str() << endl;
-    status = 1;
+    status = EXIT_FAILURE;
   }
 
   if (!parsetFilenameSpecified) {
     cerr << "TBB: parameter set file must be specified on command-line" << endl;
-    status = 1;
+    status = EXIT_FAILURE;
   }
 
   return status;
@@ -490,27 +491,30 @@ int main(int argc, char* argv[])
   struct progArgs args;
   int err;
 
-  if ((err = parseArgs(argc, argv, &args)) != 0) {
-    if (err == 2) {
-      err = 0;
+  if ((err = parseArgs(argc, argv, &args)) != EXIT_SUCCESS) {
+    if (err == 2) { // h or v option
+      err = EXIT_SUCCESS;
     }
     printUsage(argv[0]);
     return err;
   }
 
   INIT_LOGGER("TBB_Writer");
-  LOG_INFO_STR("TBB_Writer version " << LOFAR::OutputProcVersion::getVersion() <<
-               " r" << LOFAR::OutputProcVersion::getRevision());
+  LOG_INFO("TBB_Writer version " + LOFAR::OutputProcVersion::getVersion() +
+               " r" + LOFAR::OutputProcVersion::getRevision());
 
   setTermSigsHandler();
 
+  // Increase soft limit to typical hard limit for when one writer receives from many stations.
+  setMaxOpenFileDescriptors(4096);
+
   const vector<string> inputStreamNames(getTBB_InputStreamNames(args.input, args.ports));
   if (inputStreamNames.empty()) {
     LOG_FATAL("TBB: none of the input streams is accessible to read from");
-    return 1;
+    return EXIT_FAILURE;
   }
 
-  err = 1;
+  err = EXIT_FAILURE;
   try {
     LOFAR::Cobalt::Parset parset(args.parsetFilename);
 
@@ -530,21 +534,23 @@ int main(int argc, char* argv[])
     do {
       err += doTBB_Run(inputStreamNames, parset, stMdMap, args);
     } while (args.keepRunning && err < 100);
-    if (err == 100) { // Nr of dumps per obs was estimated to fit in 3 digits.
+    if (err == 100) {
       LOG_FATAL("TBB: Reached max nr of errors seen. Shutting down to avoid filling up storage with logging crap.");
     }
 
     // Config exceptions (opening or parsing) are fatal. Too bad we cannot have it in one type.
   } catch (LOFAR::Cobalt::CoInterfaceException& exc) {
-    LOG_FATAL_STR("TBB: Required parset key/values missing: " << exc);
+    LOG_FATAL("TBB: Required parset key/values missing: " + exc.text());
   } catch (LOFAR::APSException& exc) {
-    LOG_FATAL_STR("TBB: Parameterset error: " << exc);
+    LOG_FATAL("TBB: Parameterset error: " + exc.text());
   } catch (LOFAR::AssertError& exc) {
     LOG_FATAL_STR("TBB: Assert error: " << exc);
   } catch (LOFAR::Cobalt::StorageException& exc) {
     LOG_FATAL_STR("TBB: Antenna field files: " << exc);
   }
 
-  return err != 0;
+  err = !!err;
+  LOG_INFO("TBB: exiting with status " + boost::lexical_cast<string>(err));
+  return err;
 }
 
diff --git a/RTCP/Cobalt/OutputProc/src/createHeaders.cc b/RTCP/Cobalt/OutputProc/src/createHeaders.cc
index 67e677b14df516e5549f74777ab4d80c8d0654aa..4659eacc066cfec22fef5919d9f4c9f08d96e10a 100644
--- a/RTCP/Cobalt/OutputProc/src/createHeaders.cc
+++ b/RTCP/Cobalt/OutputProc/src/createHeaders.cc
@@ -1,5 +1,6 @@
-//# createHeaders.cc: Generates all .h5/.MS files given a (OLAP) parset
-//# Copyright (C) 2012-2013  ASTRON (Netherlands Institute for Radio Astronomy)
+//# createHeaders.cc: Generates all .h5/.MS/_rsp.raw files given a COBALT parset
+//# Copyright (C) 2012-2013, 2017
+//# ASTRON (Netherlands Institute for Radio Astronomy)
 //# P.O. Box 2, 7990 AA Dwingeloo, The Netherlands
 //#
 //# This file is part of the LOFAR software suite.
@@ -83,6 +84,19 @@ int main(int argc, char *argv[])
     }
   }
 
+  // Process RSP raw data
+  if (parset.settings.rspRaw.enabled) {
+    for (size_t fileIdx = 0; fileIdx < parset.settings.rspRaw.files.size(); ++fileIdx)
+    {
+      string logPrefix = str(format("[RSPraw stream %3u] ") % fileIdx);
+
+      Pool<StreamableData> outputPool(logPrefix, true);
+
+      RSPRawOutputThread writer(parset, fileIdx, outputPool, rtmd, "rtmd key prefix", logPrefix, ".");
+      writer.createMS();
+    }
+  }
+
   return 0;
 }
 
diff --git a/RTCP/Cobalt/OutputProc/src/odirect.c b/RTCP/Cobalt/OutputProc/src/odirect.c
new file mode 100644
index 0000000000000000000000000000000000000000..a2fc52706ab4d46ec2a9b084dea7b6c2af36a77a
--- /dev/null
+++ b/RTCP/Cobalt/OutputProc/src/odirect.c
@@ -0,0 +1,70 @@
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+/*
+ * Test program for finding the alignment required for O_DIRECT. To use:
+ *
+ * cd <target file system>
+ * g++ odirect.c -o odirect
+ * ./odirect
+ *
+ * Make sure you're allowed to write.
+ */
+
+#define FILENAME "test.out"
+
+int test(int ALIGNMENT, int BUFSIZE) {
+  void *buf;
+
+  if (posix_memalign(&buf, ALIGNMENT, BUFSIZE) < 0) {
+    perror("posix_memalign");
+    return 1;
+  }
+
+  int fd = open(FILENAME, O_DIRECT | O_SYNC | O_RDWR | O_CREAT | O_TRUNC);
+
+  if (fd < 0) {
+    perror("open");
+    return 1;
+  }
+
+  if (unlink(FILENAME) < 0) {
+    perror("unlink");
+    return 1;
+  }
+
+  if (write(fd, buf, BUFSIZE) < 0) {
+    perror("write");
+    return 1;
+  }
+
+  if (close(fd) < 0) {
+    perror("close");
+    return 1;
+  }
+
+  return 0;
+}
+
+int main()
+{
+  int PAGE_SIZE, result;
+
+  printf("writing to %s\n", FILENAME);
+
+  for( PAGE_SIZE = 16384; PAGE_SIZE >= 4; PAGE_SIZE /= 2) {
+    printf("trying page size %d...\n", PAGE_SIZE);
+    result = test(PAGE_SIZE, PAGE_SIZE);
+
+    if (result) {
+      puts("failure");
+      exit(1);
+    }
+  }
+}
+
+
diff --git a/RTCP/Cobalt/OutputProc/src/plotMS.cc b/RTCP/Cobalt/OutputProc/src/plotMS.cc
index e98d90c5cde7f6b057143aa2868200923ef74328..ca1e47ceebd722688b400410cb72dc29c6c656ee 100644
--- a/RTCP/Cobalt/OutputProc/src/plotMS.cc
+++ b/RTCP/Cobalt/OutputProc/src/plotMS.cc
@@ -186,7 +186,7 @@ int main(int argc, char *argv[])
 
     for(;; ) {
       try {
-        data->read(&datafile, true, 512);
+        data->read(&datafile, 512);
       } catch (EndOfStreamException &) {
         break;
       }
diff --git a/RTCP/Cobalt/OutputProc/test/CMakeLists.txt b/RTCP/Cobalt/OutputProc/test/CMakeLists.txt
index d71a47e3e8bbf8bf0f1535548508904765949566..5fcbb2c649bd6690bc003844e306ade153f2401a 100644
--- a/RTCP/Cobalt/OutputProc/test/CMakeLists.txt
+++ b/RTCP/Cobalt/OutputProc/test/CMakeLists.txt
@@ -19,5 +19,6 @@ lofar_add_test(tMSWriterCorrelated tMSWriterCorrelated.cc)
 lofar_add_test(tDAL tDAL.cc)
 lofar_add_test(tFastFileStream tFastFileStream.cc)
 lofar_add_test(tTBB_StaticMapping tTBB_StaticMapping.cc)
-#lofar_add_test(tTBB_Writer)
+lofar_add_test(tTBB_Writer-transient)
+lofar_add_test(tTBB_Writer-spectral)
 
diff --git a/RTCP/Cobalt/OutputProc/test/tMSWriterDAL.cc b/RTCP/Cobalt/OutputProc/test/tMSWriterDAL.cc
index c15a2b1a03a621a5f56c7ec603a12c49bc60c43d..3dfc126944eafcea2a95e7000ade4a0f1ec9c231 100644
--- a/RTCP/Cobalt/OutputProc/test/tMSWriterDAL.cc
+++ b/RTCP/Cobalt/OutputProc/test/tMSWriterDAL.cc
@@ -52,9 +52,9 @@ int main()
 
     const size_t nrSubbands = parset.settings.SAPs[file.sapNr].subbands.size();
 
-    SampleData<float,3,2> data(
+    SampleData<float,3,1> data(
         boost::extents[sset.nrSamples][nrSubbands][sset.nrChannels],
-        boost::extents[nrSubbands][sset.nrChannels]);
+        boost::extents[nrSubbands]);
 
     memset(data.samples.origin(), 0, data.samples.num_elements() * sizeof *data.samples.origin());
 
diff --git a/RTCP/Cobalt/OutputProc/test/tSubbandWriter.cc b/RTCP/Cobalt/OutputProc/test/tSubbandWriter.cc
index d51f882ab7177d1daa52a45c53155b1a2a40c906..23afabfd4e97dc7fcdf12d97cf4d5d1ec975d631 100644
--- a/RTCP/Cobalt/OutputProc/test/tSubbandWriter.cc
+++ b/RTCP/Cobalt/OutputProc/test/tSubbandWriter.cc
@@ -118,7 +118,7 @@ SUITE(SubbandWriter)
           *(data.visibilities.origin() + i) = complex<float>(i, 2*i);
         }
 
-        data.write(inputStream, true, 1);
+        data.write(inputStream, 1);
       }
     }
 
@@ -128,7 +128,7 @@ SUITE(SubbandWriter)
 
       CorrelatedData data(ps.nrMergedStations(), ps.settings.correlator.nrChannels, ps.settings.correlator.nrSamplesPerIntegration(), heapAllocator, 512);
 
-      data.read(&f, true, 512);
+      data.read(&f, 512);
 
       for (size_t i = 0; i < data.visibilities.num_elements(); ++i) {
         CHECK_EQUAL(complex<float>(i, 2*i), *(data.visibilities.origin() + i));
diff --git a/RTCP/Cobalt/OutputProc/test/tTBB_Writer-spectral.in_1/CS011-AntennaField.conf b/RTCP/Cobalt/OutputProc/test/tTBB_Writer-spectral.in_1/CS011-AntennaField.conf
new file mode 100644
index 0000000000000000000000000000000000000000..e1f47190eb997d4b5dd55ca8244e92af0d995483
--- /dev/null
+++ b/RTCP/Cobalt/OutputProc/test/tTBB_Writer-spectral.in_1/CS011-AntennaField.conf
@@ -0,0 +1,196 @@
+# Blitz-0.10 formatted
+#
+# AntennaPositions for CS011
+# ITRF2005 target_date = 2015.5
+# Created: 2015-01-20 21:24:07
+#
+
+NORMAL_VECTOR LBA
+(0,2) [   0.598753   0.072099   0.797682 ]
+
+ROTATION_MATRIX LBA
+(0,2) x (0,2) [
+ -0.1195950000  -0.7919540000   0.5987530000 
+  0.9928230000  -0.0954190000   0.0720990000 
+  0.0000330000   0.6030780000   0.7976820000 
+]
+
+LBA
+(0,2) [ 3826667.025700000 461285.896091000 5064801.620 ]
+(0,95) x (0,1) x (0,2) [
+  0.000000   0.000000   0.000000     0.000000   0.000000   0.000000 
+ -2.019000  -0.243001   1.538000    -2.019000  -0.243001   1.538000 
+ -1.338000   2.104999   0.814000    -1.338000   2.104999   0.814000 
+  0.800000   2.363000  -0.814000     0.800000   2.363000  -0.814000 
+  2.019000   0.243000  -1.538000     2.019000   0.243000  -1.538000 
+  1.338000  -2.105000  -0.814000     1.338000  -2.105000  -0.814000 
+ -0.800000  -2.363000   0.814000    -0.800000  -2.363000   0.814000 
+  2.281000   4.879000  -2.153000     2.281000   4.879000  -2.153000 
+  4.349000   1.739000  -3.421000     4.349000   1.739000  -3.421000 
+  4.381000  -2.215000  -3.088000     4.381000  -2.215000  -3.088000 
+  2.364000  -5.132000  -1.311000     2.364000  -5.132000  -1.311000 
+ -0.759000  -5.647000   1.081000    -0.759000  -5.647000   1.081000 
+ -3.528000  -3.521001   2.966000    -3.528000  -3.521001   2.966000 
+ -4.645000   0.252999   3.464000    -4.645000   0.252999   3.464000 
+ -3.589000   3.908999   2.341000    -3.589000   3.908999   2.341000 
+ -0.853000   5.735000   0.122000    -0.853000   5.735000   0.122000 
+ -0.725000   9.294000  -0.296000    -0.725000   9.294000  -0.296000 
+  2.199000   9.309000  -2.492000     2.199000   9.309000  -2.492000 
+  5.838000   6.892000  -5.005000     5.838000   6.892000  -5.005000 
+  8.074000   0.050000  -6.065000     8.074000   0.050000  -6.065000 
+  7.865000  -3.141000  -5.620000     7.865000  -3.141000  -5.620000 
+  6.243000  -6.801000  -4.071000     6.243000  -6.801000  -4.071000 
+  3.199000  -8.511000  -1.632000     3.199000  -8.511000  -1.632000 
+ -1.427000  -8.674001   1.855000    -1.427000  -8.674001   1.855000 
+ -5.128000  -7.192001   4.499000    -5.128000  -7.192001   4.499000 
+ -7.354000  -3.665001   5.852000    -7.354000  -3.665001   5.852000 
+ -7.457000   0.267999   5.573000    -7.457000   0.267999   5.573000 
+ -6.327000   4.813999   4.314000    -6.327000   4.813999   4.314000 
+ -3.824000   8.094999   2.139000    -3.824000   8.094999   2.139000 
+ -0.004000  14.289000  -1.288000    -0.004000  14.289000  -1.288000 
+  3.053000  14.024000  -3.559000     3.053000  14.024000  -3.559000 
+  5.163000  12.207000  -4.979000     5.163000  12.207000  -4.979000 
+  9.227000   5.785000  -7.448000     9.227000   5.785000  -7.448000 
+ 11.393000   4.358001  -8.945000    11.393000   4.358001  -8.945000 
+ 10.512000  -2.962999  -7.622000    10.512000  -2.962999  -7.622000 
+  8.916000  -7.506000  -6.014000     8.916000  -7.506000  -6.014000 
+  7.445000 -12.372000  -4.470000     7.445000 -12.372000  -4.470000 
+  4.760000 -12.393000  -2.453000     4.760000 -12.393000  -2.453000 
+  1.017000 -13.001000   0.411000     1.017000 -13.001000   0.411000 
+ -4.531000 -11.595001   4.449000    -4.531000 -11.595001   4.449000 
+ -6.626000 -10.494001   5.922000    -6.626000 -10.494001   5.922000 
+ -9.170000  -6.059001   7.431000    -9.170000  -6.059001   7.431000 
+-11.674000  -3.166002   9.049000   -11.674000  -3.166002   9.049000 
+-10.651000   5.502999   7.498000   -10.651000   5.502999   7.498000 
+ -8.997000   8.785999   5.959000    -8.997000   8.785999   5.959000 
+ -6.091000  12.684999   3.425000    -6.091000  12.684999   3.425000 
+-40.727000 -37.669004  33.975000   -40.727000 -37.669004  33.975000 
+-32.498010  52.829996  19.618000   -32.498010  52.829996  19.618000 
+ -5.279000  16.988999   2.427000    -5.279000  16.988999   2.427000 
+ -4.300000  19.731999   1.444000    -4.300000  19.731999   1.444000 
+  8.052000  17.126000  -7.592000     8.052000  17.126000  -7.592000 
+ 15.453000   3.477001 -11.914000    15.453000   3.477001 -11.914000 
+ 16.459000  -1.337999 -12.234000    16.459000  -1.337999 -12.234000 
+ 11.810000 -11.640999  -7.813000    11.810000 -11.640999  -7.813000 
+  2.627000 -17.706000  -0.371000     2.627000 -17.706000  -0.371000 
+ -3.459000 -19.669001   4.374000    -3.459000 -19.669001   4.374000 
+-11.947000  -9.349002   9.812000   -11.947000  -9.349002   9.812000 
+-15.666000  -2.401002  11.976000   -15.666000  -2.401002  11.976000 
+-14.129000   7.221998   9.953000   -14.129000   7.221998   9.953000 
+-16.462000  15.003998  11.001000   -16.462000  15.003998  11.001000 
+ -8.632000  23.031999   4.398000    -8.632000  23.031999   4.398000 
+  1.438000  25.118000  -3.350000     1.438000  25.118000  -3.350000 
+  6.399000  23.796000  -6.954000     6.399000  23.796000  -6.954000 
+ 12.757000  20.518001 -11.430000    12.757000  20.518001 -11.430000 
+ 18.686000   4.176001 -14.404000    18.686000   4.176001 -14.404000 
+ 19.492000  -3.757999 -14.291000    19.492000  -3.757999 -14.291000 
+ 16.667000 -16.912999 -10.981000    16.667000 -16.912999 -10.981000 
+  7.089000 -23.917000  -3.160000     7.089000 -23.917000  -3.160000 
+ -0.089000 -25.938000   2.411000    -0.089000 -25.938000   2.411000 
+ -8.944000 -21.431001   8.650000    -8.944000 -21.431001   8.650000 
+-19.236000 -11.046002  15.437000   -19.236000 -11.046002  15.437000 
+-21.248000   6.582998  15.354000   -21.248000   6.582998  15.354000 
+-23.336000  20.235997  15.687000   -23.336000  20.235997  15.687000 
+-13.234000  27.461998   7.451000   -13.234000  27.461998   7.451000 
+ -2.097000  31.197999  -1.246000    -2.097000  31.197999  -1.246000 
+  4.262000  31.808000  -6.074000     4.262000  31.808000  -6.074000 
+ 17.427000  21.632001 -15.036000    17.427000  21.632001 -15.036000 
+ 26.446000   6.977002 -20.481000    26.446000   6.977002 -20.481000 
+ 27.157000  -5.282998 -19.907000    27.157000  -5.282998 -19.907000 
+ 22.433000 -12.213998 -15.734000    22.433000 -12.213998 -15.734000 
+ 18.923000 -25.900999 -11.863000    18.923000 -25.900999 -11.863000 
+  5.317000 -33.495000  -0.964000     5.317000 -33.495000  -0.964000 
+ -1.856000 -33.457001   4.417000    -1.856000 -33.457001   4.417000 
+-14.240000 -28.700002  13.283000   -14.240000 -28.700002  13.283000 
+-18.109000 -21.804002  15.564000   -18.109000 -21.804002  15.564000 
+-26.330000  -3.453003  20.076000   -26.330000  -3.453003  20.076000 
+-24.549000   2.737997  18.179000   -24.549000   2.737997  18.179000 
+-29.331000   4.991997  21.565000   -29.331000   4.991997  21.565000 
+-14.547000  38.445998   7.445000   -14.547000  38.445998   7.445000 
+  5.953000  38.755000  -7.971000     5.953000  38.755000  -7.971000 
+ 21.123000  31.107002 -18.667000    21.123000  31.107002 -18.667000 
+ 28.337000  17.349002 -22.838000    28.337000  17.349002 -22.838000 
+ 25.809000 -27.254998 -16.909000    25.809000 -27.254998 -16.909000 
+  9.401000 -35.116999  -3.883000     9.401000 -35.116999  -3.883000 
+ -2.563000 -40.984001   5.628000    -2.563000 -40.984001   5.628000 
+-29.080000 -11.615003  22.878000   -29.080000 -11.615003  22.878000 
+]
+
+HBA
+(0,2) [ 3826643.147700000 461290.840088000 5064819.097 ]
+(0,47) x (0,1) x (0,2) [
+-16.060000 -65.451001  17.970000   -16.060000 -65.451001  17.970000 
+-16.102000 -60.319001  17.538000   -16.102000 -60.319001  17.538000 
+-11.893000 -70.808001  15.327000   -11.893000 -70.808001  15.327000 
+-11.935000 -65.676001  14.894000   -11.935000 -65.676001  14.894000 
+-11.977000 -60.544001  14.462000   -11.977000 -60.544001  14.462000 
+-12.020000 -55.413001  14.031000   -12.020000 -55.413001  14.031000 
+ -7.726990 -76.164000  12.683000    -7.726990 -76.164000  12.683000 
+ -7.769000 -71.032000  12.251000    -7.769000 -71.032000  12.251000 
+ -7.811000 -65.901000  11.819000    -7.811000 -65.901000  11.819000 
+ -7.854000 -60.770000  11.387000    -7.854000 -60.770000  11.387000 
+ -7.896000 -55.638000  10.955000    -7.896000 -55.638000  10.955000 
+ -7.938000 -50.506000  10.523000    -7.938000 -50.506000  10.523000 
+ -3.601990 -76.389000   9.607000    -3.601990 -76.389000   9.607000 
+ -3.643990 -71.257000   9.175000    -3.643990 -71.257000   9.175000 
+ -3.686000 -66.126000   8.743000    -3.686000 -66.126000   8.743000 
+ -3.729000 -60.994000   8.311000    -3.729000 -60.994000   8.311000 
+ -3.771000 -55.863000   7.879000    -3.771000 -55.863000   7.879000 
+ -3.813000 -50.731000   7.447000    -3.813000 -50.731000   7.447000 
+  0.481010 -71.483000   6.099000     0.481010 -71.483000   6.099000 
+  0.438000 -66.351000   5.668000     0.438000 -66.351000   5.668000 
+  0.396000 -61.219000   5.236000     0.396000 -61.219000   5.236000 
+  0.354000 -56.087000   4.803000     0.354000 -56.087000   4.803000 
+  4.563000 -66.575999   2.592000     4.563000 -66.575999   2.592000 
+  4.521000 -61.443999   2.160000     4.521000 -61.443999   2.160000 
+ -4.520010  61.445000  -2.161000    -4.520010  61.445000  -2.161000 
+ -4.562010  66.576000  -2.594000    -4.562010  66.576000  -2.594000 
+ -0.354010  56.088000  -4.805000    -0.354010  56.088000  -4.805000 
+ -0.396010  61.219000  -5.237000    -0.396010  61.219000  -5.237000 
+ -0.438010  66.351000  -5.669000    -0.438010  66.351000  -5.669000 
+ -0.481010  71.483000  -6.101000    -0.481010  71.483000  -6.101000 
+  3.812990  50.732001  -7.448000     3.812990  50.732001  -7.448000 
+  3.770990  55.863001  -7.881000     3.770990  55.863001  -7.881000 
+  3.728990  60.994001  -8.313000     3.728990  60.994001  -8.313000 
+  3.685990  66.126001  -8.744000     3.685990  66.126001  -8.744000 
+  3.643990  71.258001  -9.177000     3.643990  71.258001  -9.177000 
+  3.601990  76.390001  -9.609000     3.601990  76.390001  -9.609000 
+  7.937990  50.506001 -10.524000     7.937990  50.506001 -10.524000 
+  7.895990  55.638001 -10.956000     7.895990  55.638001 -10.956000 
+  7.853990  60.770001 -11.389000     7.853990  60.770001 -11.389000 
+  7.810990  65.902001 -11.820000     7.810990  65.902001 -11.820000 
+  7.768990  71.033001 -12.252000     7.768990  71.033001 -12.252000 
+  7.726990  76.164001 -12.685000     7.726990  76.164001 -12.685000 
+ 12.020990  55.413001 -14.032000    12.020990  55.413001 -14.032000 
+ 11.977990  60.545001 -14.464000    11.977990  60.545001 -14.464000 
+ 11.935990  65.677001 -14.896000    11.935990  65.677001 -14.896000 
+ 11.892990  70.808001 -15.328000    11.892990  70.808001 -15.328000 
+ 16.101990  60.319002 -17.539000    16.101990  60.319002 -17.539000 
+ 16.059990  65.451002 -17.972000    16.059990  65.451002 -17.972000 
+]
+
+NORMAL_VECTOR HBA0
+(0,2) [   0.598753   0.072099   0.797682 ]
+
+ROTATION_MATRIX HBA0
+(0,2) x (0,2) [
+ -0.1195950000  -0.7919540000   0.5987530000 
+  0.9928230000  -0.0954190000   0.0720990000 
+  0.0000330000   0.6030780000   0.7976820000 
+]
+
+HBA0
+(0,2) [ 3826637.377700000 461227.392088000 5064829.162 ]
+
+NORMAL_VECTOR HBA1
+(0,2) [   0.598753   0.072099   0.797682 ]
+
+ROTATION_MATRIX HBA1
+(0,2) x (0,2) [
+ -0.1195950000  -0.7919540000   0.5987530000 
+  0.9928230000  -0.0954190000   0.0720990000 
+  0.0000330000   0.6030780000   0.7976820000 
+]
+
+HBA1
+(0,2) [ 3826648.917690000 461354.288089000 5064809.031 ]
diff --git a/RTCP/Cobalt/OutputProc/test/tTBB_Writer-spectral.in_1/CS013-AntennaField.conf b/RTCP/Cobalt/OutputProc/test/tTBB_Writer-spectral.in_1/CS013-AntennaField.conf
new file mode 100644
index 0000000000000000000000000000000000000000..e1404b3b4fc05f389cabc75116468f3a2bde7ea3
--- /dev/null
+++ b/RTCP/Cobalt/OutputProc/test/tTBB_Writer-spectral.in_1/CS013-AntennaField.conf
@@ -0,0 +1,196 @@
+# Blitz-0.10 formatted
+#
+# AntennaPositions for CS013
+# ITRF2005 target_date = 2015.5
+# Created: 2015-01-20 21:24:07
+#
+
+NORMAL_VECTOR LBA
+(0,2) [   0.598753   0.072099   0.797682 ]
+
+ROTATION_MATRIX LBA
+(0,2) x (0,2) [
+ -0.1195950000  -0.7919540000   0.5987530000 
+  0.9928230000  -0.0954190000   0.0720990000 
+  0.0000330000   0.6030780000   0.7976820000 
+]
+
+LBA
+(0,2) [ 3826346.221730000 460792.158060000 5065087.164 ]
+(0,95) x (0,1) x (0,2) [
+  0.000000   0.000000   0.000000     0.000000   0.000000   0.000000 
+ -2.019000  -0.243000   1.538000    -2.019000  -0.243000   1.538000 
+ -1.338000   2.105000   0.814000    -1.338000   2.105000   0.814000 
+  0.800000   2.363000  -0.814000     0.800000   2.363000  -0.814000 
+  2.019000   0.243001  -1.538000     2.019000   0.243001  -1.538000 
+  1.338000  -2.104999  -0.814000     1.338000  -2.104999  -0.814000 
+ -0.800000  -2.363000   0.814000    -0.800000  -2.363000   0.814000 
+  2.364000  -5.131999  -1.311000     2.364000  -5.131999  -1.311000 
+ -0.759000  -5.647000   1.081000    -0.759000  -5.647000   1.081000 
+ -3.528000  -3.521000   2.966000    -3.528000  -3.521000   2.966000 
+ -4.645000   0.253000   3.464000    -4.645000   0.253000   3.464000 
+ -3.589000   3.909000   2.341000    -3.589000   3.909000   2.341000 
+ -0.853000   5.735000   0.122000    -0.853000   5.735000   0.122000 
+  2.282000   4.878001  -2.153000     2.282000   4.878001  -2.153000 
+  4.349000   1.739001  -3.421000     4.349000   1.739001  -3.421000 
+  4.381000  -2.214999  -3.088000     4.381000  -2.214999  -3.088000 
+  6.802000  -4.298999  -4.717000     6.802000  -4.298999  -4.717000 
+  5.486000  -7.465999  -3.443000     5.486000  -7.465999  -3.443000 
+  2.155000 -10.073999  -0.707000     2.155000 -10.073999  -0.707000 
+ -3.624000  -8.747000   3.511000    -3.624000  -8.747000   3.511000 
+ -5.751000  -6.778000   4.929000    -5.751000  -6.778000   4.929000 
+ -7.565000  -3.023000   5.952000    -7.565000  -3.023000   5.952000 
+ -7.377000   1.200000   5.429000    -7.377000   1.200000   5.429000 
+ -5.394000   6.284000   3.481000    -5.394000   6.284000   3.481000 
+ -2.685000   9.472000   1.159000    -2.685000   9.472000   1.159000 
+  0.780000   9.948000  -1.484000     0.780000   9.948000  -1.484000 
+  3.565000   7.907001  -3.391000     3.565000   7.907001  -3.391000 
+  6.220000   4.201001  -5.048000     6.220000   4.201001  -5.048000 
+  7.371000  -0.296999  -5.506000     7.371000  -0.296999  -5.506000 
+  9.954000  -7.808999  -6.766000     9.954000  -7.808999  -6.766000 
+  8.384000 -10.966999  -5.302000     8.384000 -10.966999  -5.302000 
+  6.162000 -12.251999  -3.518000     6.162000 -12.251999  -3.518000 
+ -0.152000 -13.128000   1.301000    -0.152000 -13.128000   1.301000 
+ -2.127000 -14.688000   2.924000    -2.127000 -14.688000   2.924000 
+ -6.827000  -9.732000   6.004000    -6.827000  -9.732000   6.004000 
+ -9.268000  -5.525000   7.456000    -9.268000  -5.525000   7.456000 
+-11.990000  -1.274001   9.115000   -11.990000  -1.274001   9.115000 
+-10.788000   1.634999   7.950000   -10.788000   1.634999   7.950000 
+ -9.515000   6.010999   6.599000    -9.515000   6.010999   6.599000 
+ -6.022000  11.235000   3.505000    -6.022000  11.235000   3.505000 
+ -4.306000  12.895000   2.067000    -4.306000  12.895000   2.067000 
+ -0.065000  13.217000  -1.146000    -0.065000  13.217000  -1.146000 
+  3.084000  14.339001  -3.611000     3.084000  14.339001  -3.611000 
+  8.659000   8.494001  -7.267000     8.659000   8.494001  -7.267000 
+ 10.195000   4.913001  -8.097000    10.195000   4.913001  -8.097000 
+ 11.595000  -0.358999  -8.671000    11.595000  -0.358999  -8.671000 
+ -7.780010  64.587000   0.002000    -7.780010  64.587000   0.002000 
+ 51.520000   6.207005 -39.233000    51.520000   6.207005 -39.233000 
+ 14.224000  -3.588998 -10.352000    14.224000  -3.588998 -10.352000 
+ 15.691000  -6.145998 -11.222000    15.691000  -6.145998 -11.222000 
+  8.279000 -18.062999  -4.582000     8.279000 -18.062999  -4.582000 
+ -4.581000 -18.591000   5.119000    -4.581000 -18.591000   5.119000 
+ -8.390000 -17.045000   7.838000    -8.390000 -17.045000   7.838000 
+-13.459000  -6.389001  10.680000   -13.459000  -6.389001  10.680000 
+-13.522000   6.845999   9.531000   -13.522000   6.845999   9.531000 
+-12.131000  14.491999   7.796000   -12.131000  14.491999   7.796000 
+ -1.097000  18.015000  -0.805000    -1.097000  18.015000  -0.805000 
+  5.427000  18.232001  -5.721000     5.427000  18.232001  -5.721000 
+ 11.432000  11.311001  -9.603000    11.432000  11.311001  -9.603000 
+ 17.909000   9.575002 -14.308000    17.909000   9.575002 -14.308000 
+ 19.953000  -3.272998 -14.681000    19.953000  -3.272998 -14.681000 
+ 16.842000 -15.289998 -11.260000    16.842000 -15.289998 -11.260000 
+ 13.673000 -19.923998  -8.463000    13.673000 -19.923998  -8.463000 
+  8.509000 -24.998999  -4.128000     8.509000 -24.998999  -4.128000 
+ -5.559000 -22.465000   6.203000    -5.559000 -22.465000   6.203000 
+-11.450000 -18.997001  10.311000   -11.450000 -18.997001  10.311000 
+-19.331000  -8.752001  15.301000   -19.331000  -8.752001  15.301000 
+-19.869000   5.422998  14.424000   -19.869000   5.422998  14.424000 
+-18.025000  14.279999  12.239000   -18.025000  14.279999  12.239000 
+-10.873000  21.379999   6.229000   -10.873000  21.379999   6.229000 
+  1.023000  26.816000  -3.192000     1.023000  26.816000  -3.192000 
+ 14.212000  19.348002 -12.417000    14.212000  19.348002 -12.417000 
+ 24.668000  14.137003 -19.794000    24.668000  14.137003 -19.794000 
+ 25.123000  -0.724997 -18.792000    25.123000  -0.724997 -18.792000 
+ 22.679000 -14.796997 -15.685000    22.679000 -14.796997 -15.685000 
+ 20.222000 -21.997998 -13.191000    20.222000 -21.997998 -13.191000 
+  7.169000 -30.651999  -2.611000     7.169000 -30.651999  -2.611000 
+ -7.125000 -32.377000   8.274000    -7.125000 -32.377000   8.274000 
+-15.985000 -26.441001  14.389000   -15.985000 -26.441001  14.389000 
+-18.672000 -17.549001  15.602000   -18.672000 -17.549001  15.602000 
+-26.614000  -6.273002  20.544000   -26.614000  -6.273002  20.544000 
+-25.737000  12.574998  18.182000   -25.737000  12.574998  18.182000 
+-22.461000  20.300998  15.025000   -22.461000  20.300998  15.025000 
+-13.535000  31.074999   7.351000   -13.535000  31.074999   7.351000 
+ -6.980000  31.482000   2.394000    -6.980000  31.482000   2.394000 
+  9.526000  30.326001  -9.891000     9.526000  30.326001  -9.891000 
+ 13.031000  25.015002 -12.042000    13.031000  25.015002 -12.042000 
+ 16.768000  28.949002 -15.203000    16.768000  28.949002 -15.203000 
+ 33.368000  -5.313996 -24.566000    33.368000  -5.313996 -24.566000 
+ 24.293000 -27.622997 -15.738000    24.293000 -27.622997 -15.738000 
+ 12.093010 -39.823998  -5.478000    12.093010 -39.823998  -5.478000 
+ -0.758000 -40.093000   4.192000    -0.758000 -40.093000   4.192000 
+-30.677000 -12.969003  24.199000   -30.677000 -12.969003  24.199000 
+-28.718000   9.050998  20.738000   -28.718000   9.050998  20.738000 
+-27.383000  25.180998  18.278000   -27.383000  25.180998  18.278000 
+  5.088000  37.759001  -7.232000     5.088000  37.759001  -7.232000 
+]
+
+HBA
+(0,2) [ 3826360.485730000 460815.243062000 5065074.371 ]
+(0,47) x (0,1) x (0,2) [
+-50.283010  48.846995  33.328000   -50.283010  48.846995  33.328000 
+-47.346010  52.249995  30.816000   -47.346010  52.249995  30.816000 
+-50.325010  41.595995  34.015000   -50.325010  41.595995  34.015000 
+-47.388010  44.998995  31.502000   -47.388010  44.998995  31.502000 
+-44.449010  48.401995  28.989000   -44.449010  48.401995  28.989000 
+-41.512010  51.803996  26.477000   -41.512010  51.803996  26.477000 
+-50.367010  34.344995  34.702000   -50.367010  34.344995  34.702000 
+-47.429010  37.748995  32.189000   -47.429010  37.748995  32.189000 
+-44.492010  41.150995  29.677000   -44.492010  41.150995  29.677000 
+-41.554010  44.553996  27.164000   -41.554010  44.553996  27.164000 
+-38.617010  47.956996  24.651000   -38.617010  47.956996  24.651000 
+-35.679010  51.359996  22.138000   -35.679010  51.359996  22.138000 
+-47.472010  30.496995  32.876000   -47.472010  30.496995  32.876000 
+-44.534010  33.899995  30.363000   -44.534010  33.899995  30.363000 
+-41.596010  37.302996  27.851000   -41.596010  37.302996  27.851000 
+-38.658010  40.705996  25.338000   -38.658010  40.705996  25.338000 
+-35.721010  44.108996  22.826000   -35.721010  44.108996  22.826000 
+-32.783010  47.512997  20.313000   -32.783010  47.512997  20.313000 
+-41.638010  30.052996  28.538000   -41.638010  30.052996  28.538000 
+-38.701010  33.455996  26.025000   -38.701010  33.455996  26.025000 
+-35.763010  36.858996  23.512000   -35.763010  36.858996  23.512000 
+-32.826010  40.261997  21.000000   -32.826010  40.261997  21.000000 
+-35.805010  29.607996  24.199000   -35.805010  29.607996  24.199000 
+-32.867010  33.009997  21.687000   -32.867010  33.009997  21.687000 
+ 32.866000 -33.010997 -21.686000    32.866000 -33.010997 -21.686000 
+ 35.803000 -29.607997 -24.198000    35.803000 -29.607997 -24.198000 
+ 32.824000 -40.261997 -20.999000    32.824000 -40.261997 -20.999000 
+ 35.761000 -36.858997 -23.512000    35.761000 -36.858997 -23.512000 
+ 38.699000 -33.455997 -26.024990    38.699000 -33.455997 -26.024990 
+ 41.637000 -30.052996 -28.536990    41.637000 -30.052996 -28.536990 
+ 32.781010 -47.512997 -20.312000    32.781010 -47.512997 -20.312000 
+ 35.719010 -44.108997 -22.824990    35.719010 -44.108997 -22.824990 
+ 38.657000 -40.705997 -25.336990    38.657000 -40.705997 -25.336990 
+ 41.595000 -37.302996 -27.849990    41.595000 -37.302996 -27.849990 
+ 44.532000 -33.899996 -30.362990    44.532000 -33.899996 -30.362990 
+ 47.470000 -30.497996 -32.875990    47.470000 -30.497996 -32.875990 
+ 35.677010 -51.359997 -22.137990    35.677010 -51.359997 -22.137990 
+ 38.615010 -47.956997 -24.650990    38.615010 -47.956997 -24.650990 
+ 41.552010 -44.553996 -27.162990    41.552010 -44.553996 -27.162990 
+ 44.490010 -41.151996 -29.675990    44.490010 -41.151996 -29.675990 
+ 47.428010 -37.748996 -32.187990    47.428010 -37.748996 -32.187990 
+ 50.366000 -34.344995 -34.700990    50.366000 -34.344995 -34.700990 
+ 41.510010 -51.803996 -26.475990    41.510010 -51.803996 -26.475990 
+ 44.448010 -48.401996 -28.988990    44.448010 -48.401996 -28.988990 
+ 47.386010 -44.998996 -31.501990    47.386010 -44.998996 -31.501990 
+ 50.323010 -41.595995 -34.013990    50.323010 -41.595995 -34.013990 
+ 47.344010 -52.249996 -30.814990    47.344010 -52.249996 -30.814990 
+ 50.281010 -48.846995 -33.326990    50.281010 -48.846995 -33.326990 
+]
+
+NORMAL_VECTOR HBA0
+(0,2) [   0.598753   0.072099   0.797682 ]
+
+ROTATION_MATRIX HBA0
+(0,2) x (0,2) [
+ -0.1195950000  -0.7919540000   0.5987530000 
+  0.9928230000  -0.0954190000   0.0720990000 
+  0.0000330000   0.6030780000   0.7976820000 
+]
+
+HBA0
+(0,2) [ 3826318.910720000 460856.172058000 5065101.878 ]
+
+NORMAL_VECTOR HBA1
+(0,2) [   0.598753   0.072099   0.797682 ]
+
+ROTATION_MATRIX HBA1
+(0,2) x (0,2) [
+ -0.1195950000  -0.7919540000   0.5987530000 
+  0.9928230000  -0.0954190000   0.0720990000 
+  0.0000330000   0.6030780000   0.7976820000 
+]
+
+HBA1
+(0,2) [ 3826402.059740000 460774.314066000 5065046.864 ]
diff --git a/RTCP/Cobalt/OutputProc/test/tTBB_Writer-spectral.in_1/L121213_CS013_D20170711T094130.000Z_tbb.h5.selected-attribs.txt b/RTCP/Cobalt/OutputProc/test/tTBB_Writer-spectral.in_1/L121213_CS013_D20170711T094130.000Z_tbb.h5.selected-attribs.txt
new file mode 100644
index 0000000000000000000000000000000000000000..594c647cbd1ed86d1679211d07c6f745bd7a9cbc
--- /dev/null
+++ b/RTCP/Cobalt/OutputProc/test/tTBB_Writer-spectral.in_1/L121213_CS013_D20170711T094130.000Z_tbb.h5.selected-attribs.txt
@@ -0,0 +1,59 @@
+HDF5 "L121213_CS013_D20170711T094130.000Z_tbb.h5" {
+ATTRIBUTE "TELESCOPE" {
+   DATATYPE  H5T_STRING {
+      STRSIZE H5T_VARIABLE;
+      STRPAD H5T_STR_NULLTERM;
+      CSET H5T_CSET_ASCII;
+      CTYPE H5T_C_S1;
+   }
+   DATASPACE  SCALAR
+   DATA {
+   (0): "LOFAR"
+   }
+}
+ATTRIBUTE "OPERATING_MODE" {
+   DATATYPE  H5T_STRING {
+      STRSIZE H5T_VARIABLE;
+      STRPAD H5T_STR_NULLTERM;
+      CSET H5T_CSET_ASCII;
+      CTYPE H5T_C_S1;
+   }
+   DATASPACE  SCALAR
+   DATA {
+   (0): "spectral"
+   }
+}
+ATTRIBUTE "STATION_NAME" {
+   DATATYPE  H5T_STRING {
+      STRSIZE H5T_VARIABLE;
+      STRPAD H5T_STR_NULLTERM;
+      CSET H5T_CSET_ASCII;
+      CTYPE H5T_C_S1;
+   }
+   DATASPACE  SCALAR
+   DATA {
+   (0): "CS013"
+   }
+}
+ATTRIBUTE "STATION_POSITION" {
+   DATATYPE  H5T_IEEE_F64LE
+   DATASPACE  SIMPLE { ( 3 ) / ( 3 ) }
+   DATA {
+   (0): 3.82636e+06, 460815, 5.06507e+06
+   }
+}
+ATTRIBUTE "DATA_LENGTH" {
+   DATATYPE  H5T_STD_U64LE
+   DATASPACE  SCALAR
+   DATA {
+   (0): 4870
+   }
+}
+ATTRIBUTE "TIME" {
+   DATATYPE  H5T_STD_U32LE
+   DATASPACE  SCALAR
+   DATA {
+   (0): 1499766090
+   }
+}
+}
diff --git a/RTCP/Cobalt/OutputProc/test/tTBB_Writer-spectral.in_1/sb_20170711_094130_1310_sb99-100dupl.dat b/RTCP/Cobalt/OutputProc/test/tTBB_Writer-spectral.in_1/sb_20170711_094130_1310_sb99-100dupl.dat
new file mode 100644
index 0000000000000000000000000000000000000000..5c289f056ee0cbdf84283022f5232b0cb0004b1f
Binary files /dev/null and b/RTCP/Cobalt/OutputProc/test/tTBB_Writer-spectral.in_1/sb_20170711_094130_1310_sb99-100dupl.dat differ
diff --git a/RTCP/Cobalt/OutputProc/test/tTBB_Writer-spectral.in_1/tTBB_Writer-spectral-refout.raw b/RTCP/Cobalt/OutputProc/test/tTBB_Writer-spectral.in_1/tTBB_Writer-spectral-refout.raw
new file mode 100644
index 0000000000000000000000000000000000000000..fbcc8ff5627cd76e8f34e21f0dd905dfe33c3587
Binary files /dev/null and b/RTCP/Cobalt/OutputProc/test/tTBB_Writer-spectral.in_1/tTBB_Writer-spectral-refout.raw differ
diff --git a/RTCP/Cobalt/OutputProc/test/tTBB_Writer-spectral.parset b/RTCP/Cobalt/OutputProc/test/tTBB_Writer-spectral.parset
index f066c4325bb4d5b9a07ad40463c28a88c963a0cb..7498337b6c584c43abe121d28e562b29f0dbcc47 100644
--- a/RTCP/Cobalt/OutputProc/test/tTBB_Writer-spectral.parset
+++ b/RTCP/Cobalt/OutputProc/test/tTBB_Writer-spectral.parset
@@ -1,95 +1,47 @@
-ApplCtrl.application = CorrAppl
-ApplCtrl.procesOrder = []
-ApplCtrl.processes = [CorrProc]
-ApplCtrl.resultfile = '/opt/lofar/share/ACC_CCU001:OnlineControl[0]{59640}_CorrAppl_result.param'
-ApplCtrl.timeout_createsubsets = 30s
-ApplCtrl.timeout_define = 30s
-ApplCtrl.timeout_info = 30s
-ApplCtrl.timeout_init = 30s
-ApplCtrl.timeout_kill = 30s
-ApplCtrl.timeout_pause = 90s
-ApplCtrl.timeout_quit = 10s
-ApplCtrl.timeout_recover = 30s
-ApplCtrl.timeout_reinit = 30s
-ApplCtrl.timeout_release = 30s
-ApplCtrl.timeout_run = 90s
-ApplCtrl.timeout_snapshot = 30s
-ApplCtrl.timeout_startup = 30s
-CorrAppl.CorrProc._ACnode = bgfen0
-CorrAppl.CorrProc._ACport = 3922
-CorrAppl.CorrProc._executable = CN_Processing
-CorrAppl.CorrProc._hostname = bgstfen
-CorrAppl.CorrProc._nodes = []
-CorrAppl.CorrProc._startstopType = bgl
-CorrAppl.CorrProc.workingdir = /opt/lofar/bin/
-CorrAppl._hostname = bgstfen
-CorrAppl.extraInfo = [OLAP,PIC]
-CorrAppl.procesOrder = []
-CorrAppl.processes = [CorrProc]
-OLAP.BeamsAreTransposed = True
-OLAP.CNProc.coresPerPset = 64
-OLAP.CNProc.integrationSteps = 3072
-OLAP.CNProc.nrPPFTaps = 16
-OLAP.CNProc.partition = R00
-OLAP.CNProc.phaseOnePsets = [46,34,36,38,33,35,37,50,48,32,39,42,51,44,58,41,40,54,43,45,26,47,52,55,23,49,60,62,30,53,63,31]
-OLAP.CNProc.phaseOneTwoCores = [0..63]
-OLAP.CNProc.phaseThreeCores = [0..63]
-OLAP.CNProc.phaseThreePsets = [0..63]
-OLAP.CNProc.phaseTwoPsets = [0..63]
-OLAP.CNProc.tabList = []
-OLAP.CNProc.usedCores = [0..63]
-Cobalt.BeamFormer.CoherentStokes.nrChannelsPerSubband = 16
-Cobalt.BeamFormer.CoherentStokes.subbandsPerFile = 244
-Cobalt.BeamFormer.CoherentStokes.timeIntegrationFactor = 64
-Cobalt.BeamFormer.CoherentStokes.which = I
-Cobalt.BeamFormer.IncoherentStokes.nrChannelsPerSubband = 16
-Cobalt.BeamFormer.IncoherentStokes.subbandsPerFile = 244
-Cobalt.BeamFormer.IncoherentStokes.timeIntegrationFactor = 64
-Cobalt.BeamFormer.IncoherentStokes.which = I
-OLAP.Correlator.integrationTime = 1
-OLAP.DelayComp.nrCalcDelays = 16
-OLAP.DelayComp.positionType = ITRF
-OLAP.IONProc.PLC_controlled = T
-Cobalt.Correlator.nrBlocksPerIntegration = 4
-OLAP.IONProc.psetList = [10.170.0.1,10.170.0.2,10.170.0.5,10.170.0.6,10.170.0.9,10.170.0.10,10.170.0.13,10.170.0.14,10.170.0.17,10.170.0.18,10.170.0.21,10.170.0.22,10.170.0.25,10.170.0.26,10.170.0.29,10.170.0.30,10.170.0.33,10.170.0.34,10.170.0.37,10.170.0.38,10.170.0.41,10.170.0.42,10.170.0.45,10.170.0.46,10.170.0.49,10.170.0.50,10.170.0.53,10.170.0.54,10.170.0.57,10.170.0.58,10.170.0.61,10.170.0.62,10.170.0.129,10.170.0.130,10.170.0.133,10.170.0.134,10.170.0.137,10.170.0.138,10.170.0.141,10.170.0.142,10.170.0.145,10.170.0.146,10.170.0.149,10.170.0.150,10.170.0.153,10.170.0.154,10.170.0.157,10.170.0.158,10.170.0.161,10.170.0.162,10.170.0.165,10.170.0.166,10.170.0.169,10.170.0.170,10.170.0.173,10.170.0.174,10.170.0.177,10.170.0.178,10.170.0.181,10.170.0.182,10.170.0.185,10.170.0.186,10.170.0.189,10.170.0.190]
-OLAP.IncoherentStokesAreTransposed = True
-OLAP.OLAP_Conn.IONProc_CNProc_Transport = FCNP
-OLAP.OLAP_Conn.IONProc_Storage_Transport = TCP
-OLAP.PPF = True
-Cobalt.BeamFormer.flysEye = false
-OLAP.PencilInfo.storageNodeList = [0,1]
-OLAP.Storage.AntennaFieldsDir = /data/home/lofarsys/production/lofar/etc/StaticMetaData
-OLAP.Storage.AntennaSetsConf = /data/home/lofarsys/production/lofar/etc/AntennaSets.conf
-OLAP.Storage.HBADeltasDir = /data/home/lofarsys/production/lofar/etc/StaticMetaData
-OLAP.Storage.hosts = [locus072,locus088]
-OLAP.Storage.msWriter = /data/home/lofarsys/production/lofar/bin/Storage_main
-OLAP.Storage.sshIdentityFile = /globalhome/lofarsystem/.ssh/id_rsa
-OLAP.Storage.targetDirectory = /data
-OLAP.Storage.userName = lofarsys
-OLAP.StorageProc.subbandsPerMS = 1
-Cobalt.BeamFormer.coherentDedisperseChannels = false
+Observation.TBB.TBBsetting.RCUs=[]
+Observation.TBB.TBBsetting.baselevel=127
+Observation.TBB.TBBsetting.filter=0
+Observation.TBB.TBBsetting.filter0_coeff0=0
+Observation.TBB.TBBsetting.filter0_coeff1=0
+Observation.TBB.TBBsetting.filter0_coeff2=0
+Observation.TBB.TBBsetting.filter0_coeff3=0
+Observation.TBB.TBBsetting.filter1_coeff0=0
+Observation.TBB.TBBsetting.filter1_coeff1=0
+Observation.TBB.TBBsetting.filter1_coeff2=0
+Observation.TBB.TBBsetting.filter1_coeff3=0
+Observation.TBB.TBBsetting.operatingMode=2  # 1: transient mode, 2: spectral mode
+Observation.TBB.TBBsetting.startlevel=7
+Observation.TBB.TBBsetting.stoplevel=7
+Observation.TBB.TBBsetting.subbandList=[99,100]  # required for spectral mode
+Observation.TBB.TBBsetting.triggerMode=1
+Observation.TBB.TBBsetting.window=1M
+
+Observation.ObservationControl.StationControl.TBBControl.CoincidenceTime=0
+Observation.ObservationControl.StationControl.TBBControl.DoDirectionFit=none
+Observation.ObservationControl.StationControl.TBBControl.MaxFitVariance=0
+Observation.ObservationControl.StationControl.TBBControl.MinElevation=0
+Observation.ObservationControl.StationControl.TBBControl.NoCoincChann=0
+Observation.ObservationControl.StationControl.TBBControl.ParamExtension=
+
+Cobalt.realTime = true
+Observation.ObsID = 121213
+Observation.momID = 9
+Cobalt.commandStream = null:
+Observation.startTime = '2017-07-11 09:30:00'
+Observation.stopTime = '2017-07-11 09:45:00'
+Observation.sampleClock = 200
+Observation.nrBitsPerSample = 8
 Cobalt.correctBandPass = true
-Cobalt.correctClocks = T
+Cobalt.correctClocks = true
+Cobalt.BeamFormer.coherentDedisperseChannels = false
 Cobalt.delayCompensation = true
-OLAP.dispersionMeasure = 0
-OLAP.maxNetworkDelay = 0.25
-Observation.nrBitsPerSample = 16
-OLAP.nrPsets = 64
-OLAP.nrSecondsOfBuffer = 2.5
-OLAP.nrSubbandsPerFrame = 61
-OLAP.nrTimesInFrame = 16
-Cobalt.realTime = true
-OLAP.storageNodeList = [122*0,122*1]
-OLAP.storageStationNames = [CS001LBA,CS002LBA,CS003LBA,CS004LBA,CS005LBA,CS006LBA,CS007LBA,CS011LBA,CS017LBA,CS021LBA,CS024LBA,CS026LBA,CS028LBA,CS030LBA,CS031LBA,CS032LBA,CS101LBA,CS103LBA,CS201LBA,CS301LBA,CS302LBA,CS401LBA,CS501LBA,RS106LBA,RS205LBA,RS208LBA,RS306LBA,RS307LBA,RS406LBA,RS503LBA,RS508LBA,RS509LBA]
-OLAP.tiedArrayStationNames = []
-Observation.AnaBeam.angle1 = 0
-Observation.AnaBeam.angle2 = 0
-Observation.AnaBeam.directionType = J2000
-Observation.AnaBeam.duration = 0
-Observation.AnaBeam.maximizeDuration = false
-Observation.AnaBeam.rank = 1
-Observation.AnaBeam.startTime = 
-Observation.AnaBeam.target = 
+Observation.referencePhaseCenter = [3826577.066,461022.948,5064892.786]
+Observation.antennaArray = HBA
+Observation.antennaSet = HBA_DUAL
+Observation.bandFilter = HBA_110_190
+Observation.nrPolarisations = 2
+Observation.nrBeams = 2
+
 Observation.Beam[0].TiedArrayBeam[0].angle1 = 0.0
 Observation.Beam[0].TiedArrayBeam[0].angle2 = 0.0
 Observation.Beam[0].TiedArrayBeam[0].coherent = true
@@ -110,890 +62,145 @@ Observation.Beam[0].beamletList = []
 Observation.Beam[0].directionType = J2000
 Observation.Beam[0].duration = 900
 Observation.Beam[0].maximizeDuration = false
-Observation.Beam[0].momID = 119965
+Observation.Beam[0].momID = 9
 Observation.Beam[0].nrTabRings = 0
 Observation.Beam[0].nrTiedArrayBeams = 2
-Observation.Beam[0].startTime = 
-Observation.Beam[0].subbandList = [175..418]
+Observation.Beam[0].startTime =
+Observation.Beam[0].subbandList = [99..100]
 Observation.Beam[0].tabRingSize = 0.0
 Observation.Beam[0].target = B0329+54
-Observation.Beamformer.stationList = []
-Observation.Campaign.CO_I = 'Pizzo, Dr. Roberto Francesco'
-Observation.Campaign.PI = 'Polatidis, Dr Antonios'
-Observation.Campaign.contact = 'Polatidis, Dr Antonios'
-Observation.Campaign.name = 2012LOFAROBS
-Observation.Campaign.title = 2012LOFAROBS
-Observation.DataProducts.Input_Beamformed.dirmask = 
-Observation.DataProducts.Input_Beamformed.enabled = false
-Observation.DataProducts.Input_Beamformed.filenames = []
-Observation.DataProducts.Input_Beamformed.identifications = []
-Observation.DataProducts.Input_Beamformed.locations = []
-Observation.DataProducts.Input_Beamformed.mountpoints = []
-Observation.DataProducts.Input_Beamformed.namemask = 
-Observation.DataProducts.Input_Beamformed.skip = []
-Observation.DataProducts.Input_CoherentStokes.dirmask = 
-Observation.DataProducts.Input_CoherentStokes.enabled = false
-Observation.DataProducts.Input_CoherentStokes.filenames = []
-Observation.DataProducts.Input_CoherentStokes.identifications = []
-Observation.DataProducts.Input_CoherentStokes.locations = []
-Observation.DataProducts.Input_CoherentStokes.mountpoints = []
-Observation.DataProducts.Input_CoherentStokes.namemask = 
-Observation.DataProducts.Input_CoherentStokes.skip = []
-Observation.DataProducts.Input_Correlated.dirmask = 
-Observation.DataProducts.Input_Correlated.enabled = false
-Observation.DataProducts.Input_Correlated.filenames = []
-Observation.DataProducts.Input_Correlated.identifications = []
-Observation.DataProducts.Input_Correlated.locations = []
-Observation.DataProducts.Input_Correlated.mountpoints = []
-Observation.DataProducts.Input_Correlated.namemask = 
-Observation.DataProducts.Input_Correlated.skip = []
-Observation.DataProducts.Input_IncoherentStokes.dirmask = 
-Observation.DataProducts.Input_IncoherentStokes.enabled = false
-Observation.DataProducts.Input_IncoherentStokes.filenames = []
-Observation.DataProducts.Input_IncoherentStokes.identifications = []
-Observation.DataProducts.Input_IncoherentStokes.locations = []
-Observation.DataProducts.Input_IncoherentStokes.mountpoints = []
-Observation.DataProducts.Input_IncoherentStokes.namemask = 
-Observation.DataProducts.Input_IncoherentStokes.skip = []
-Observation.DataProducts.Input_InstrumentModel.dirmask = 
-Observation.DataProducts.Input_InstrumentModel.enabled = false
-Observation.DataProducts.Input_InstrumentModel.filenames = []
-Observation.DataProducts.Input_InstrumentModel.identifications = []
-Observation.DataProducts.Input_InstrumentModel.locations = []
-Observation.DataProducts.Input_InstrumentModel.mountpoints = []
-Observation.DataProducts.Input_InstrumentModel.namemask = 
-Observation.DataProducts.Input_InstrumentModel.skip = []
-Observation.DataProducts.Input_SkyImage.dirmask = 
-Observation.DataProducts.Input_SkyImage.enabled = false
-Observation.DataProducts.Input_SkyImage.filenames = []
-Observation.DataProducts.Input_SkyImage.identifications = []
-Observation.DataProducts.Input_SkyImage.locations = []
-Observation.DataProducts.Input_SkyImage.mountpoints = []
-Observation.DataProducts.Input_SkyImage.namemask = 
-Observation.DataProducts.Input_SkyImage.skip = []
-Observation.DataProducts.Output_Beamformed.archived = false
-Observation.DataProducts.Output_Beamformed.deleted = false
-Observation.DataProducts.Output_Beamformed.dirmask = 
-Observation.DataProducts.Output_Beamformed.enabled = True
-Observation.DataProducts.Output_Beamformed.filenames = [L59640_SAP000_B000_S0_P000_bf.raw,L59640_SAP000_B001_S0_P000_bf.raw]
-Observation.DataProducts.Output_Beamformed.identifications = []
-Observation.DataProducts.Output_Beamformed.locations = [locus072:/data/L59640/,locus088:/data/L59640/]
-Observation.DataProducts.Output_Beamformed.mountpoints = []
-Observation.DataProducts.Output_Beamformed.namemask = 
-Observation.DataProducts.Output_Beamformed.percentageWritten = []
-Observation.DataProducts.Output_Beamformed.retentiontime = 14
-Observation.DataProducts.Output_Beamformed.skip = []
-Observation.DataProducts.Output_CoherentStokes.archived = false
-Observation.DataProducts.Output_CoherentStokes.deleted = false
-Observation.DataProducts.Output_CoherentStokes.dirmask = L${OBSID}
+
+Observation.Beam[1].TiedArrayBeam[0].angle1 = 0.0
+Observation.Beam[1].TiedArrayBeam[0].angle2 = 0.0
+Observation.Beam[1].TiedArrayBeam[0].coherent = true
+Observation.Beam[1].TiedArrayBeam[0].directionType = J2000
+Observation.Beam[1].TiedArrayBeam[0].dispersionMeasure = 0
+Observation.Beam[1].TiedArrayBeam[0].specificationType = manual
+Observation.Beam[1].TiedArrayBeam[0].stationList = []
+Observation.Beam[1].TiedArrayBeam[1].angle1 = 0.8293449206762021
+Observation.Beam[1].TiedArrayBeam[1].angle2 = 0.8525764650544495
+Observation.Beam[1].TiedArrayBeam[1].coherent = false
+Observation.Beam[1].TiedArrayBeam[1].directionType = J2000
+Observation.Beam[1].TiedArrayBeam[1].dispersionMeasure = 0
+Observation.Beam[1].TiedArrayBeam[1].specificationType = manual
+Observation.Beam[1].TiedArrayBeam[1].stationList = []
+Observation.Beam[1].angle1 = 0.8293449206762021
+Observation.Beam[1].angle2 = 0.8525764650544495
+Observation.Beam[1].beamletList = []
+Observation.Beam[1].directionType = J2000
+Observation.Beam[1].duration = 900
+Observation.Beam[1].maximizeDuration = false
+Observation.Beam[1].momID = 9
+Observation.Beam[1].nrTabRings = 0
+Observation.Beam[1].nrTiedArrayBeams = 2
+Observation.Beam[1].startTime =
+Observation.Beam[1].subbandList = [200..201]
+Observation.Beam[1].tabRingSize = 0.0
+Observation.Beam[1].target = -0.1 test offset from Beam0 (B0329+54)
+
+Observation.AnaBeam.angle1 = 0.9293449206762021
+Observation.AnaBeam.angle2 = 0.9525764650544495
+Observation.AnaBeam.directionType = J2000
+Observation.AnaBeam.duration = 900
+Observation.AnaBeam.maximizeDuration = false
+Observation.AnaBeam.rank = 1
+Observation.AnaBeam.startTime =
+Observation.AnaBeam.target = B0329+54
+
+Cobalt.blockSize=196608
+Observation.VirtualInstrument.stationList = [CS011, CS013]
+
+PIC.Core.CS011HBA.phaseCenter=[3826643.191, 461290.793, 5064819.069]
+PIC.Core.CS011HBA.HBA_JOINED.HBA_110_190.delay.X=7.487948e-06
+PIC.Core.CS011HBA.HBA_JOINED.HBA_110_190.delay.Y=7.488310e-06
+PIC.Core.CS011HBA.HBA_JOINED.HBA_110_190.phase0.X=0.000000e+00
+PIC.Core.CS011HBA.HBA_JOINED.HBA_110_190.phase0.Y=0.000000e+00
+PIC.Core.CS011HBA0.HBA_DUAL_INNER.HBA_110_190.delay.X=7.487901e-06
+PIC.Core.CS011HBA0.HBA_DUAL_INNER.HBA_110_190.delay.Y=7.488469e-06
+PIC.Core.CS011HBA0.HBA_DUAL_INNER.HBA_110_190.phase0.X=0.000000e+00
+PIC.Core.CS011HBA0.HBA_DUAL_INNER.HBA_110_190.phase0.Y=0.000000e+00
+PIC.Core.CS011HBA0.RSP.ports=[udp:cbt003-10GB02:10110, udp:cbt003-10GB02:10111, udp:cbt003-10GB02:10112, udp:cbt003-10GB02:10113]
+PIC.Core.CS011HBA0.RSP.receiver=cbt003_0
+PIC.Core.CS011HBA0.phaseCenter=[3826637.421, 461227.345, 5064829.134]
+PIC.Core.CS011HBA1.HBA_DUAL_INNER.HBA_110_190.delay.X=7.487994e-06
+PIC.Core.CS011HBA1.HBA_DUAL_INNER.HBA_110_190.delay.Y=7.488150e-06
+PIC.Core.CS011HBA1.HBA_DUAL_INNER.HBA_110_190.phase0.X=0.000000e+00
+PIC.Core.CS011HBA1.HBA_DUAL_INNER.HBA_110_190.phase0.Y=0.000000e+00
+PIC.Core.CS011HBA1.RSP.ports=[udp:cbt003-10GB02:10116, udp:cbt003-10GB02:10117, udp:cbt003-10GB02:10118, udp:cbt003-10GB02:10119]
+PIC.Core.CS011HBA1.RSP.receiver=cbt003_0
+PIC.Core.CS011HBA1.phaseCenter=[3826648.961, 461354.241, 5064809.003]
+
+PIC.Core.CS013HBA.phaseCenter=[3826360.529, 460815.196, 5065074.343]
+PIC.Core.CS013HBA.HBA_JOINED.HBA_110_190.delay.X=8.708485e-06
+PIC.Core.CS013HBA.HBA_JOINED.HBA_110_190.delay.Y=8.708511e-06
+PIC.Core.CS013HBA.HBA_JOINED.HBA_110_190.phase0.X=0.000000e+00
+PIC.Core.CS013HBA.HBA_JOINED.HBA_110_190.phase0.Y=0.000000e+00
+PIC.Core.CS013HBA0.HBA_DUAL_INNER.HBA_110_190.delay.X=8.708572e-06
+PIC.Core.CS013HBA0.HBA_DUAL_INNER.HBA_110_190.delay.Y=8.708498e-06
+PIC.Core.CS013HBA0.HBA_DUAL_INNER.HBA_110_190.phase0.X=0.000000e+00
+PIC.Core.CS013HBA0.HBA_DUAL_INNER.HBA_110_190.phase0.Y=0.000000e+00
+PIC.Core.CS013HBA0.RSP.ports=[udp:cbt005-10GB02:10130, udp:cbt005-10GB02:10131, udp:cbt005-10GB02:10132, udp:cbt005-10GB02:10133]
+PIC.Core.CS013HBA0.RSP.receiver=cbt005_0
+PIC.Core.CS013HBA0.phaseCenter=[3826318.954, 460856.125, 5065101.850]
+PIC.Core.CS013HBA1.HBA_DUAL_INNER.HBA_110_190.delay.X=8.708397e-06
+PIC.Core.CS013HBA1.HBA_DUAL_INNER.HBA_110_190.delay.Y=8.708523e-06
+PIC.Core.CS013HBA1.HBA_DUAL_INNER.HBA_110_190.phase0.X=0.000000e+00
+PIC.Core.CS013HBA1.HBA_DUAL_INNER.HBA_110_190.phase0.Y=0.000000e+00
+PIC.Core.CS013HBA1.RSP.ports=[udp:cbt005-10GB02:10136, udp:cbt005-10GB02:10137, udp:cbt005-10GB02:10138, udp:cbt005-10GB02:10139]
+PIC.Core.CS013HBA1.RSP.receiver=cbt005_0
+PIC.Core.CS013HBA1.phaseCenter=[3826402.103, 460774.267, 5065046.836]
+
+Observation.Dataslots.CS011HBA0.DataslotList=[0..121,0..121,0..121,0..119]
+Observation.Dataslots.CS011HBA0.RSPBoardList=[122*0,122*1,122*2,120*3]
+Observation.Dataslots.CS011HBA1.DataslotList=[0..121,0..121,0..121,0..119]
+Observation.Dataslots.CS011HBA1.RSPBoardList=[122*0,122*1,122*2,120*3]
+Observation.Dataslots.CS013HBA0.DataslotList=[0..121,0..121,0..121,0..119]
+Observation.Dataslots.CS013HBA0.RSPBoardList=[122*0,122*1,122*2,120*3]
+Observation.Dataslots.CS013HBA1.DataslotList=[0..121,0..121,0..121,0..119]
+Observation.Dataslots.CS013HBA1.RSPBoardList=[122*0,122*1,122*2,120*3]
+
+Cobalt.Nodes=[cbt009_0, cbt009_1]
+PIC.Core.Cobalt.cbt009_0.cpu=0
+PIC.Core.Cobalt.cbt009_0.gpus=[0, 1]
+PIC.Core.Cobalt.cbt009_0.host=cbt009
+PIC.Core.Cobalt.cbt009_0.mpi_nic=mlx4_0
+PIC.Core.Cobalt.cbt009_0.out_nic=[CEP4:ib0,DRAGNET:ib0]
+PIC.Core.Cobalt.cbt009_1.cpu=1
+PIC.Core.Cobalt.cbt009_1.gpus=[2, 3]
+PIC.Core.Cobalt.cbt009_1.host=cbt009
+PIC.Core.Cobalt.cbt009_1.mpi_nic=mlx4_1
+PIC.Core.Cobalt.cbt009_1.out_nic=[CEP4:ib1,DRAGNET:ib1]
+
+Cobalt.Correlator.nrChannelsPerSubband = 64
+Cobalt.Correlator.nrBlocksPerIntegration = 1
+Cobalt.Correlator.nrIntegrationsPerBlock = 1
+
+Cobalt.BeamFormer.flysEye = false
+Cobalt.BeamFormer.nrDelayCompensationChannels = 256
+Cobalt.BeamFormer.nrHighResolutionChannels = 256
+
+Cobalt.BeamFormer.CoherentStokes.nrChannelsPerSubband = 1
+Cobalt.BeamFormer.CoherentStokes.subbandsPerFile = 20
+Cobalt.BeamFormer.CoherentStokes.timeIntegrationFactor = 2
+Cobalt.BeamFormer.CoherentStokes.which = I
+Cobalt.BeamFormer.IncoherentStokes.nrChannelsPerSubband = 16
+Cobalt.BeamFormer.IncoherentStokes.subbandsPerFile = 512
+Cobalt.BeamFormer.IncoherentStokes.timeIntegrationFactor = 4
+Cobalt.BeamFormer.IncoherentStokes.which = IQUV
+
+Observation.DataProducts.Output_Correlated.enabled = true
+Observation.DataProducts.Output_Correlated.filenames = [L121213_SAP000_SB099_uv.MS, L121213_SAP000_SB100_uv.MS, L121213_SAP000_SB200_uv.MS, L121213_SAP000_SB201_uv.MS]
+Observation.DataProducts.Output_Correlated.locations = [4*CEP4:cpu01.cep4:/data/projects/TT0_000/L121213/uv]
 Observation.DataProducts.Output_CoherentStokes.enabled = true
-Observation.DataProducts.Output_CoherentStokes.filenames = []
-Observation.DataProducts.Output_CoherentStokes.identifications = []
-Observation.DataProducts.Output_CoherentStokes.locations = []
-Observation.DataProducts.Output_CoherentStokes.mountpoints = [locus072:/data]
-Observation.DataProducts.Output_CoherentStokes.namemask = L${OBSID}_SAP${SAP}_B${BEAM}_S${STOKES}_P${PART}_bf.raw
-Observation.DataProducts.Output_CoherentStokes.percentageWritten = []
-Observation.DataProducts.Output_CoherentStokes.retentiontime = 14
-Observation.DataProducts.Output_CoherentStokes.skip = []
-Observation.DataProducts.Output_Correlated.archived = false
-Observation.DataProducts.Output_Correlated.deleted = false
-Observation.DataProducts.Output_Correlated.dirmask = 
-Observation.DataProducts.Output_Correlated.enabled = false
-Observation.DataProducts.Output_Correlated.filenames = []
-Observation.DataProducts.Output_Correlated.identifications = []
-Observation.DataProducts.Output_Correlated.locations = []
-Observation.DataProducts.Output_Correlated.mountpoints = []
-Observation.DataProducts.Output_Correlated.namemask = 
-Observation.DataProducts.Output_Correlated.percentageWritten = []
-Observation.DataProducts.Output_Correlated.retentiontime = 14
-Observation.DataProducts.Output_Correlated.skip = []
-Observation.DataProducts.Output_IncoherentStokes.archived = false
-Observation.DataProducts.Output_IncoherentStokes.deleted = false
-Observation.DataProducts.Output_IncoherentStokes.dirmask = L${OBSID}
+Observation.DataProducts.Output_CoherentStokes.filenames = [L121213_SAP000_B000_S0_P000_bf.h5, L121213_SAP001_B000_S0_P000_bf.h5]
+Observation.DataProducts.Output_CoherentStokes.locations = [2*CEP4:cpu20.cep4:/data/projects/TT0_000/L121213/cs]
 Observation.DataProducts.Output_IncoherentStokes.enabled = true
-Observation.DataProducts.Output_IncoherentStokes.filenames = []
-Observation.DataProducts.Output_IncoherentStokes.identifications = []
-Observation.DataProducts.Output_IncoherentStokes.locations = []
-Observation.DataProducts.Output_IncoherentStokes.mountpoints = [locus088:/data]
-Observation.DataProducts.Output_IncoherentStokes.namemask = L${OBSID}_SAP${SAP}_B${BEAM}_S${STOKES}_P${PART}_bf.raw
-Observation.DataProducts.Output_IncoherentStokes.percentageWritten = []
-Observation.DataProducts.Output_IncoherentStokes.retentiontime = 14
-Observation.DataProducts.Output_IncoherentStokes.skip = []
-Observation.DataProducts.Output_InstrumentModel.archived = false
-Observation.DataProducts.Output_InstrumentModel.deleted = false
-Observation.DataProducts.Output_InstrumentModel.dirmask = 
-Observation.DataProducts.Output_InstrumentModel.enabled = false
-Observation.DataProducts.Output_InstrumentModel.filenames = []
-Observation.DataProducts.Output_InstrumentModel.identifications = []
-Observation.DataProducts.Output_InstrumentModel.locations = []
-Observation.DataProducts.Output_InstrumentModel.mountpoints = []
-Observation.DataProducts.Output_InstrumentModel.namemask = 
-Observation.DataProducts.Output_InstrumentModel.percentageWritten = []
-Observation.DataProducts.Output_InstrumentModel.retentiontime = 14
-Observation.DataProducts.Output_InstrumentModel.skip = []
-Observation.DataProducts.Output_SkyImage.archived = false
-Observation.DataProducts.Output_SkyImage.deleted = false
-Observation.DataProducts.Output_SkyImage.dirmask = 
-Observation.DataProducts.Output_SkyImage.enabled = false
-Observation.DataProducts.Output_SkyImage.filenames = []
-Observation.DataProducts.Output_SkyImage.identifications = []
-Observation.DataProducts.Output_SkyImage.locations = []
-Observation.DataProducts.Output_SkyImage.mountpoints = []
-Observation.DataProducts.Output_SkyImage.namemask = 
-Observation.DataProducts.Output_SkyImage.percentageWritten = []
-Observation.DataProducts.Output_SkyImage.retentiontime = 14
-Observation.DataProducts.Output_SkyImage.skip = []
-Observation.DataProducts.Output_Trigger.dirmask = L${YEAR}_${OBSID}
-Observation.DataProducts.Output_Trigger.enabled = False
-Observation.DataProducts.Output_Trigger.namemask = L${OBSID}_SAP${SAP}_B${BEAM}_S${STOKES}_P${PART}_bf.trigger
-Observation.DataProducts.nrOfOutput_BeamFormed_ = 0
-Observation.DataProducts.nrOfOutput_Correlated_ = 0
-Observation.DataProducts.nrOfOutput_InstrumentModels_ = 0
-Observation.DataProducts.nrOfOutput_SkyImages_ = 0
-Observation.Dataslots.CS001LBA.DataslotList = [0..60,0..60,0..60,0..60]
-Observation.Dataslots.CS001LBA.RSPBoardList = [61*0,61*1,61*2,61*3]
-Observation.Dataslots.CS002LBA.DataslotList = [0..60,0..60,0..60,0..60]
-Observation.Dataslots.CS002LBA.RSPBoardList = [61*0,61*1,61*2,61*3]
-Observation.Dataslots.CS003LBA.DataslotList = [0..60,0..60,0..60,0..60]
-Observation.Dataslots.CS003LBA.RSPBoardList = [61*0,61*1,61*2,61*3]
-Observation.Dataslots.CS004LBA.DataslotList = [0..60,0..60,0..60,0..60]
-Observation.Dataslots.CS004LBA.RSPBoardList = [61*0,61*1,61*2,61*3]
-Observation.Dataslots.CS005LBA.DataslotList = [0..60,0..60,0..60,0..60]
-Observation.Dataslots.CS005LBA.RSPBoardList = [61*0,61*1,61*2,61*3]
-Observation.Dataslots.CS006LBA.DataslotList = [0..60,0..60,0..60,0..60]
-Observation.Dataslots.CS006LBA.RSPBoardList = [61*0,61*1,61*2,61*3]
-Observation.Dataslots.CS007LBA.DataslotList = [0..60,0..60,0..60,0..60]
-Observation.Dataslots.CS007LBA.RSPBoardList = [61*0,61*1,61*2,61*3]
-Observation.Dataslots.CS011LBA.DataslotList = [0..60,0..60,0..60,0..60]
-Observation.Dataslots.CS011LBA.RSPBoardList = [61*0,61*1,61*2,61*3]
-Observation.Dataslots.CS017LBA.DataslotList = [0..60,0..60,0..60,0..60]
-Observation.Dataslots.CS017LBA.RSPBoardList = [61*0,61*1,61*2,61*3]
-Observation.Dataslots.CS021LBA.DataslotList = [0..60,0..60,0..60,0..60]
-Observation.Dataslots.CS021LBA.RSPBoardList = [61*0,61*1,61*2,61*3]
-Observation.Dataslots.CS024LBA.DataslotList = [0..60,0..60,0..60,0..60]
-Observation.Dataslots.CS024LBA.RSPBoardList = [61*0,61*1,61*2,61*3]
-Observation.Dataslots.CS026LBA.DataslotList = [0..60,0..60,0..60,0..60]
-Observation.Dataslots.CS026LBA.RSPBoardList = [61*0,61*1,61*2,61*3]
-Observation.Dataslots.CS028LBA.DataslotList = [0..60,0..60,0..60,0..60]
-Observation.Dataslots.CS028LBA.RSPBoardList = [61*0,61*1,61*2,61*3]
-Observation.Dataslots.CS030LBA.DataslotList = [0..60,0..60,0..60,0..60]
-Observation.Dataslots.CS030LBA.RSPBoardList = [61*0,61*1,61*2,61*3]
-Observation.Dataslots.CS031LBA.DataslotList = [0..60,0..60,0..60,0..60]
-Observation.Dataslots.CS031LBA.RSPBoardList = [61*0,61*1,61*2,61*3]
-Observation.Dataslots.CS032LBA.DataslotList = [0..60,0..60,0..60,0..60]
-Observation.Dataslots.CS032LBA.RSPBoardList = [61*0,61*1,61*2,61*3]
-Observation.Dataslots.CS101LBA.DataslotList = [0..60,0..60,0..60,0..60]
-Observation.Dataslots.CS101LBA.RSPBoardList = [61*0,61*1,61*2,61*3]
-Observation.Dataslots.CS103LBA.DataslotList = [0..60,0..60,0..60,0..60]
-Observation.Dataslots.CS103LBA.RSPBoardList = [61*0,61*1,61*2,61*3]
-Observation.Dataslots.CS201LBA.DataslotList = [0..60,0..60,0..60,0..60]
-Observation.Dataslots.CS201LBA.RSPBoardList = [61*0,61*1,61*2,61*3]
-Observation.Dataslots.CS301LBA.DataslotList = [0..60,0..60,0..60,0..60]
-Observation.Dataslots.CS301LBA.RSPBoardList = [61*0,61*1,61*2,61*3]
-Observation.Dataslots.CS302LBA.DataslotList = [0..60,0..60,0..60,0..60]
-Observation.Dataslots.CS302LBA.RSPBoardList = [61*0,61*1,61*2,61*3]
-Observation.Dataslots.CS401LBA.DataslotList = [0..60,0..60,0..60,0..60]
-Observation.Dataslots.CS401LBA.RSPBoardList = [61*0,61*1,61*2,61*3]
-Observation.Dataslots.CS501LBA.DataslotList = [0..60,0..60,0..60,0..60]
-Observation.Dataslots.CS501LBA.RSPBoardList = [61*0,61*1,61*2,61*3]
-Observation.Dataslots.DataslotInfo.DataslotList = []
-Observation.Dataslots.DataslotInfo.RSPBoardList = []
-Observation.Dataslots.RS106LBA.DataslotList = [0..60,0..60,0..60,0..60]
-Observation.Dataslots.RS106LBA.RSPBoardList = [61*0,61*1,61*2,61*3]
-Observation.Dataslots.RS205LBA.DataslotList = [0..60,0..60,0..60,0..60]
-Observation.Dataslots.RS205LBA.RSPBoardList = [61*0,61*1,61*2,61*3]
-Observation.Dataslots.RS208LBA.DataslotList = [0..60,0..60,0..60,0..60]
-Observation.Dataslots.RS208LBA.RSPBoardList = [61*0,61*1,61*2,61*3]
-Observation.Dataslots.RS306LBA.DataslotList = [0..60,0..60,0..60,0..60]
-Observation.Dataslots.RS306LBA.RSPBoardList = [61*0,61*1,61*2,61*3]
-Observation.Dataslots.RS307LBA.DataslotList = [0..60,0..60,0..60,0..60]
-Observation.Dataslots.RS307LBA.RSPBoardList = [61*0,61*1,61*2,61*3]
-Observation.Dataslots.RS406LBA.DataslotList = [0..60,0..60,0..60,0..60]
-Observation.Dataslots.RS406LBA.RSPBoardList = [61*0,61*1,61*2,61*3]
-Observation.Dataslots.RS503LBA.DataslotList = [0..60,0..60,0..60,0..60]
-Observation.Dataslots.RS503LBA.RSPBoardList = [61*0,61*1,61*2,61*3]
-Observation.Dataslots.RS508LBA.DataslotList = [0..60,0..60,0..60,0..60]
-Observation.Dataslots.RS508LBA.RSPBoardList = [61*0,61*1,61*2,61*3]
-Observation.Dataslots.RS509LBA.DataslotList = [0..60,0..60,0..60,0..60]
-Observation.Dataslots.RS509LBA.RSPBoardList = [61*0,61*1,61*2,61*3]
-Observation.KSPType = surveys
-Observation.ObsID = 59640
-Observation.ObservationControl.OnlineControl.ApplCtrl.application = []
-Observation.ObservationControl.OnlineControl.ApplCtrl.procesOrder = []
-Observation.ObservationControl.OnlineControl.ApplCtrl.processes = []
-Observation.ObservationControl.OnlineControl.ApplCtrl.resultfile = ../log/ACC.result
-Observation.ObservationControl.OnlineControl.ApplCtrl.timeout_createsubsets = 30s
-Observation.ObservationControl.OnlineControl.ApplCtrl.timeout_define = 30s
-Observation.ObservationControl.OnlineControl.ApplCtrl.timeout_info = 30s
-Observation.ObservationControl.OnlineControl.ApplCtrl.timeout_init = 30s
-Observation.ObservationControl.OnlineControl.ApplCtrl.timeout_kill = 30s
-Observation.ObservationControl.OnlineControl.ApplCtrl.timeout_pause = 90s
-Observation.ObservationControl.OnlineControl.ApplCtrl.timeout_quit = 10s
-Observation.ObservationControl.OnlineControl.ApplCtrl.timeout_recover = 30s
-Observation.ObservationControl.OnlineControl.ApplCtrl.timeout_reinit = 30s
-Observation.ObservationControl.OnlineControl.ApplCtrl.timeout_release = 30s
-Observation.ObservationControl.OnlineControl.ApplCtrl.timeout_run = 90s
-Observation.ObservationControl.OnlineControl.ApplCtrl.timeout_snapshot = 30s
-Observation.ObservationControl.OnlineControl.ApplCtrl.timeout_startup = 30s
-Observation.ObservationControl.OnlineControl.CorrAppl.CorrProc._executable = CN_Processing
-Observation.ObservationControl.OnlineControl.CorrAppl.CorrProc._hostname = bgstfen
-Observation.ObservationControl.OnlineControl.CorrAppl.CorrProc._nodes = []
-Observation.ObservationControl.OnlineControl.CorrAppl.CorrProc._startstopType = bgl
-Observation.ObservationControl.OnlineControl.CorrAppl.CorrProc.workingdir = /opt/lofar/bin/
-Observation.ObservationControl.OnlineControl.CorrAppl._hostname = bgstfen
-Observation.ObservationControl.OnlineControl.CorrAppl.extraInfo = [OLAP,PIC]
-Observation.ObservationControl.OnlineControl.CorrAppl.procesOrder = []
-Observation.ObservationControl.OnlineControl.CorrAppl.processes = [CorrProc]
-Observation.ObservationControl.OnlineControl.OLAP.CNProc.coresPerPset = 64
-Observation.ObservationControl.OnlineControl.OLAP.CNProc.integrationSteps = 768
-Observation.ObservationControl.OnlineControl.OLAP.CNProc.nrPPFTaps = 16
-Observation.ObservationControl.OnlineControl.OLAP.CNProc.phaseOnePsets = []
-Observation.ObservationControl.OnlineControl.OLAP.CNProc.phaseThreePsets = []
-Observation.ObservationControl.OnlineControl.OLAP.CNProc.phaseTwoPsets = []
-Observation.ObservationControl.OnlineControl.OLAP.CNProc.usedCores = [0..63]
-Observation.ObservationControl.OnlineControl.Cobalt.BeamFormer.CoherentStokes.nrChannelsPerSubband = 0
-Observation.ObservationControl.OnlineControl.Cobalt.BeamFormer.CoherentStokes.subbandsPerFile = 244
-Observation.ObservationControl.OnlineControl.Cobalt.BeamFormer.CoherentStokes.timeIntegrationFactor = 64
-Observation.ObservationControl.OnlineControl.Cobalt.BeamFormer.CoherentStokes.which = I
-Observation.ObservationControl.OnlineControl.Cobalt.BeamFormer.IncoherentStokes.nrChannelsPerSubband = 0
-Observation.ObservationControl.OnlineControl.Cobalt.BeamFormer.IncoherentStokes.subbandsPerFile = 244
-Observation.ObservationControl.OnlineControl.Cobalt.BeamFormer.IncoherentStokes.timeIntegrationFactor = 64
-Observation.ObservationControl.OnlineControl.Cobalt.BeamFormer.IncoherentStokes.which = I
-Observation.ObservationControl.OnlineControl.OLAP.Correlator.integrationTime = 1
-Observation.ObservationControl.OnlineControl.OLAP.DelayComp.nrCalcDelays = 16
-Observation.ObservationControl.OnlineControl.OLAP.DelayComp.positionType = ITRF
-Observation.ObservationControl.OnlineControl.Cobalt.Correlator.nrBlocksPerIntegration = 30
-Observation.ObservationControl.OnlineControl.OLAP.OLAP_Conn.IONProc_CNProc_Transport = FCNP
-Observation.ObservationControl.OnlineControl.Cobalt.BeamFormer.flysEye = false
-Observation.ObservationControl.OnlineControl.OLAP.StorageProc.subbandsPerMS = 1
-Observation.ObservationControl.OnlineControl.Cobalt.BeamFormer.coherentDedisperseChannels = false
-Observation.ObservationControl.OnlineControl.Cobalt.correctBandPass = true
-Observation.ObservationControl.OnlineControl.Cobalt.delayCompensation = true
-Observation.ObservationControl.OnlineControl.OLAP.maxNetworkDelay = 0.25
-Observation.ObservationControl.OnlineControl.Observation.nrBitsPerSample = 16
-Observation.ObservationControl.OnlineControl.OLAP.nrSecondsOfBuffer = 2.5
-Observation.ObservationControl.OnlineControl.OLAP.nrSubbandsPerFrame = 61
-Observation.ObservationControl.OnlineControl.OLAP.nrTimesInFrame = 16
-Observation.ObservationControl.OnlineControl.Cobalt.realTime = true
-Observation.ObservationControl.OnlineControl.OLAP.storageStationNames = AllStations
-Observation.ObservationControl.OnlineControl._hostname = CCU001
-Observation.ObservationControl.OnlineControl.applOrder = [CorrAppl]
-Observation.ObservationControl.OnlineControl.applications = [CorrAppl]
-Observation.ObservationControl.OnlineControl.inspectionHost = 
-Observation.ObservationControl.OnlineControl.inspectionProgram = 
-Observation.ObservationControl.StationControl.TBBControl.CoincidenceTime = 0
-Observation.ObservationControl.StationControl.TBBControl.DoDirectionFit = none
-Observation.ObservationControl.StationControl.TBBControl.MaxFitVariance = 0
-Observation.ObservationControl.StationControl.TBBControl.MinElevation = 0
-Observation.ObservationControl.StationControl.TBBControl.NoCoincChann = 0
-Observation.ObservationControl.StationControl.TBBControl.ParamExtension = 
-Observation.ObservationControl.StationControl._hostname = [CS001,CS002,CS003,CS004,CS005,CS006,CS007,CS011,CS017,CS021,CS024,CS026,CS028,CS030,CS031,CS032,CS101,CS103,CS201,CS301,CS302,CS401,CS501,RS106,RS205,RS208,RS306,RS307,RS406,RS503,RS508,RS509]
-Observation.ObservationControl.StationControl.tbbPiggybackAllowed = false
-Observation.ObservationControl._hostname = MCU001
-Observation.ObservationControl.heartbeatInterval = 10
-Observation.ObserverName = unknown
-Observation.ProjectName = unknown
-Observation.Scheduler.contactEmail = 
-Observation.Scheduler.contactName = 
-Observation.Scheduler.contactPhone = 
-Observation.Scheduler.firstPossibleDay = 0
-Observation.Scheduler.fixedDay = false
-Observation.Scheduler.fixedTime = false
-Observation.Scheduler.lastPossibleDay = 0
-Observation.Scheduler.late = false
-Observation.Scheduler.nightTimeWeightFactor = 0
-Observation.Scheduler.predMaxTimeDif = 
-Observation.Scheduler.predMinTimeDif = 
-Observation.Scheduler.predecessors = []
-Observation.Scheduler.priority = 0.0
-Observation.Scheduler.reason = 
-Observation.Scheduler.referenceFrame = 0
-Observation.Scheduler.reservation = 0
-Observation.Scheduler.storageSelectionMode = 1
-Observation.Scheduler.taskDuration = 900
-Observation.Scheduler.taskID = 63
-Observation.Scheduler.taskName = 'LBAm1 18-06-2012'
-Observation.Scheduler.taskType = 0
-Observation.Scheduler.windowMaximumTime = 
-Observation.Scheduler.windowMinimumTime = 
-Observation.TBB.TBBsetting.RCUs = []
-Observation.TBB.TBBsetting.baselevel = 127
-Observation.TBB.TBBsetting.filter = 0
-Observation.TBB.TBBsetting.filter0_coeff0 = 0
-Observation.TBB.TBBsetting.filter0_coeff1 = 0
-Observation.TBB.TBBsetting.filter0_coeff2 = 0
-Observation.TBB.TBBsetting.filter0_coeff3 = 0
-Observation.TBB.TBBsetting.filter1_coeff0 = 0
-Observation.TBB.TBBsetting.filter1_coeff1 = 0
-Observation.TBB.TBBsetting.filter1_coeff2 = 0
-Observation.TBB.TBBsetting.filter1_coeff3 = 0
-Observation.TBB.TBBsetting.operatingMode = 2
-Observation.TBB.TBBsetting.startlevel = 7
-Observation.TBB.TBBsetting.stoplevel = 7
-Observation.TBB.TBBsetting.subbandList = [0..486]
-Observation.TBB.TBBsetting.subbandList2 = [175..418]
-Observation.TBB.TBBsetting.subbandListLBA30_ALL = [154-397]
-Observation.TBB.TBBsetting.subbandListHBA115_ALL = [77-320]
-Observation.TBB.TBBsetting.subbandListHBA148_ALL = [245-488]
-Observation.TBB.TBBsetting.subbandListHBA180_ALL = [128-371]
-Observation.TBB.TBBsetting.subbandListHBA210_ALL = [52-255]
-Observation.TBB.TBBsetting.triggerMode = 1
-Observation.TBB.TBBsetting.window = 1M
-Observation.VirtualInstrument.imageNodeList = []
-Observation.VirtualInstrument.minimalNrStations = 1
-Observation.VirtualInstrument.partitionList = [R00]
-Observation.VirtualInstrument.stationList = [CS001,CS002,CS003,CS004,CS005,CS006,CS007,CS011,CS017,CS021,CS024,CS026,CS028,CS030,CS031,CS032,CS101,CS103,CS201,CS301,CS302,CS401,CS501,RS106,RS205,RS208,RS306,RS307,RS406,RS503,RS508,RS509]
-Observation.VirtualInstrument.stationSet = Custom
-Observation.VirtualInstrument.storageCapacity = 760
-Observation.VirtualInstrument.storageNodeList = []
-Observation.antennaArray = LBA
-Observation.antennaSet = LBA_INNER
-Observation.bandFilter = LBA_10_90
-Observation.beamList = [244*0]
-Observation.channelWidth = 762.939453125
-Cobalt.Correlator.nrChannelsPerSubband = 16
-Observation.claimPeriod = 50
-Observation.clockMode = <<Clock200
-Observation.existingAntennaFields = [LBA,HBA,HBA0,HBA1]
-Observation.existingStations = [CS001,CS002,CS003,CS004,CS005,CS006,CS007,CS011,CS013,CS017,CS021,CS024,CS026,CS028,CS030,CS031,CS101,CS103,CS201,CS301,CS302,CS401,CS501,RS106,RS205,RS208,RS306,RS307,RS406,RS503,DE601,DE602,DE603,DE604,DE605,FR606,UK608]
-Observation.longBaselines = false
-Observation.nrAnaBeams = 0
-Observation.nrBeamformers = 0
-Observation.nrBeams = 1
-Observation.nrPolarisations = 2
-Observation.nrSlotsInFrame = 61
-Observation.nrTBBSettings = 0
-Observation.preparePeriod = 30
-Observation.processSubtype = 'Beam Observation'
-Observation.processType = Observation
-Observation.receiverList = []
-Observation.referencePhaseCenter = [3826577.066,461022.948,5064892.786]
-Observation.rspBoardList = [244*0]
-Observation.rspSlotList = [244*0]
-Observation.sampleClock = 200
-Observation.samplesPerSecond = 196608
-Observation.startTime = '2012-06-19 08:00:00'
-Observation.stopTime = '2012-06-19 16:15:00'
-Observation.strategy = default
-Observation.subbandList = [175..418]
-Observation.subbandWidth = 195.3125
-Observation.topologyID = 
-PIC.Core.CS001HBA.clockCorrectionTime = 0
-PIC.Core.CS001HBA.phaseCenter = [3826937.810,460938.526,5064630.696]
-PIC.Core.CS001HBA0.clockCorrectionTime = 0
-PIC.Core.CS001HBA0.phaseCenter = [3826896.235,460979.455,5064658.203]
-PIC.Core.CS001HBA1.clockCorrectionTime = 0
-PIC.Core.CS001HBA1.phaseCenter = [3826979.384,460897.597,5064603.189]
-PIC.Core.CS001LBA.clockCorrectionTime = 0
-PIC.Core.CS001LBA.phaseCenter = [3826923.546,460915.441,5064643.489]
-PIC.Core.CS001LBA.position = [3826923.546,460915.441,5064643.489]
-PIC.Core.CS002HBA.clockCorrectionTime = 8.318569e-06
-PIC.Core.CS002HBA.phaseCenter = [3826583.278,460955.756,5064894.197]
-PIC.Core.CS002HBA0.clockCorrectionTime = 8.318834e-06
-PIC.Core.CS002HBA0.phaseCenter = [3826600.961,460953.402,5064881.136]
-PIC.Core.CS002HBA1.clockCorrectionTime = 8.318304e-06
-PIC.Core.CS002HBA1.phaseCenter = [3826565.594,460958.110,5064907.258]
-PIC.Core.CS002LBA.clockCorrectionTime = 8.339918e-06
-PIC.Core.CS002LBA.phaseCenter = [3826577.066,461022.948,5064892.786]
-PIC.Core.CS002LBA.position = [3826577.066,461022.948,5064892.786]
-PIC.Core.CS003HBA.clockCorrectionTime = 6.917899e-06
-PIC.Core.CS003HBA.phaseCenter = [3826494.580,461017.698,5064955.176]
-PIC.Core.CS003HBA0.clockCorrectionTime = 6.917926e-06
-PIC.Core.CS003HBA0.phaseCenter = [3826471.348,461000.138,5064974.201]
-PIC.Core.CS003HBA1.clockCorrectionTime = 6.917872e-06
-PIC.Core.CS003HBA1.phaseCenter = [3826517.812,461035.258,5064936.150]
-PIC.Core.CS003LBA.clockCorrectionTime = 6.936566e-06
-PIC.Core.CS003LBA.phaseCenter = [3826516.748,460930.066,5064946.457]
-PIC.Core.CS003LBA.position = [3826516.748,460930.066,5064946.457]
-PIC.Core.CS004HBA.clockCorrectionTime = 7.889733e-06
-PIC.Core.CS004HBA.phaseCenter = [3826582.556,460891.662,5064900.532]
-PIC.Core.CS004HBA0.clockCorrectionTime = 7.889961e-06
-PIC.Core.CS004HBA0.phaseCenter = [3826585.626,460865.844,5064900.561]
-PIC.Core.CS004HBA1.clockCorrectionTime = 7.889505e-06
-PIC.Core.CS004HBA1.phaseCenter = [3826579.486,460917.480,5064900.502]
-PIC.Core.CS004LBA.clockCorrectionTime = 7.905512e-06
-PIC.Core.CS004LBA.phaseCenter = [3826654.197,460939.576,5064842.426]
-PIC.Core.CS004LBA.position = [3826654.197,460939.576,5064842.426]
-PIC.Core.CS005HBA.clockCorrectionTime = 8.541942e-06
-PIC.Core.CS005HBA.phaseCenter = [3826666.177,461005.533,5064827.472]
-PIC.Core.CS005HBA0.clockCorrectionTime = 8.542093e-06
-PIC.Core.CS005HBA0.phaseCenter = [3826701.160,460989.250,5064802.685]
-PIC.Core.CS005HBA1.clockCorrectionTime = 8.541791e-06
-PIC.Core.CS005HBA1.phaseCenter = [3826631.194,461021.815,5064852.259]
-PIC.Core.CS005LBA.clockCorrectionTime = 8.556805e-06
-PIC.Core.CS005LBA.phaseCenter = [3826668.750,461069.550,5064819.754]
-PIC.Core.CS005LBA.position = [3826668.750,461069.550,5064819.754]
-PIC.Core.CS006HBA.clockCorrectionTime = 7.882660e-06
-PIC.Core.CS006HBA.phaseCenter = [3826633.141,461108.369,5064842.975]
-PIC.Core.CS006HBA0.clockCorrectionTime = 7.882360e-06
-PIC.Core.CS006HBA0.phaseCenter = [3826653.783,461136.440,5064824.943]
-PIC.Core.CS006HBA1.clockCorrectionTime = 7.882960e-06
-PIC.Core.CS006HBA1.phaseCenter = [3826612.499,461080.298,5064861.006]
-PIC.Core.CS006LBA.clockCorrectionTime = 7.905282e-06
-PIC.Core.CS006LBA.phaseCenter = [3826596.730,461145.178,5064866.978]
-PIC.Core.CS006LBA.position = [3826596.730,461145.178,5064866.978]
-PIC.Core.CS007HBA.clockCorrectionTime = 7.913140e-06
-PIC.Core.CS007HBA.phaseCenter = [3826508.368,461126.726,5064934.972]
-PIC.Core.CS007HBA0.clockCorrectionTime = 7.913020e-06
-PIC.Core.CS007HBA0.phaseCenter = [3826478.715,461083.720,5064961.117]
-PIC.Core.CS007HBA1.clockCorrectionTime = 7.913260e-06
-PIC.Core.CS007HBA1.phaseCenter = [3826538.021,461169.731,5064908.827]
-PIC.Core.CS007LBA.clockCorrectionTime = 7.928823e-06
-PIC.Core.CS007LBA.phaseCenter = [3826533.361,461098.966,5064918.721]
-PIC.Core.CS007LBA.position = [3826533.361,461098.966,5064918.721]
-PIC.Core.CS011HBA.clockCorrectionTime = 0
-PIC.Core.CS011HBA.phaseCenter = [3826643.191,461290.793,5064819.069]
-PIC.Core.CS011HBA0.clockCorrectionTime = 0
-PIC.Core.CS011HBA0.phaseCenter = [3826637.421,461227.345,5064829.134]
-PIC.Core.CS011HBA1.clockCorrectionTime = 0
-PIC.Core.CS011HBA1.phaseCenter = [3826648.961,461354.241,5064809.003]
-PIC.Core.CS011LBA.clockCorrectionTime = 0
-PIC.Core.CS011LBA.phaseCenter = [3826667.069,461285.849,5064801.592]
-PIC.Core.CS011LBA.position = [3826667.069,461285.849,5064801.592]
-PIC.Core.CS013HBA.clockCorrectionTime = 0
-PIC.Core.CS013HBA.phaseCenter = [3826360.529,460815.196,5065074.343]
-PIC.Core.CS013HBA0.clockCorrectionTime = 0
-PIC.Core.CS013HBA0.phaseCenter = [3826318.954,460856.125,5065101.850]
-PIC.Core.CS013HBA1.clockCorrectionTime = 0
-PIC.Core.CS013HBA1.phaseCenter = [3826402.103,460774.267,5065046.836]
-PIC.Core.CS013LBA.clockCorrectionTime = 0
-PIC.Core.CS013LBA.phaseCenter = [3826346.265,460792.111,5065087.136]
-PIC.Core.CS017HBA.clockCorrectionTime = 0
-PIC.Core.CS017HBA.phaseCenter = [3826452.439,461529.979,5064940.511]
-PIC.Core.CS017HBA0.clockCorrectionTime = 0
-PIC.Core.CS017HBA0.phaseCenter = [3826405.095,461507.460,5064978.083]
-PIC.Core.CS017HBA1.clockCorrectionTime = 0
-PIC.Core.CS017HBA1.phaseCenter = [3826499.783,461552.498,5064902.938]
-PIC.Core.CS017LBA.clockCorrectionTime = 0
-PIC.Core.CS017LBA.phaseCenter = [3826462.054,461501.950,5064935.827]
-PIC.Core.CS017LBA.position = [3826462.054,461501.950,5064935.827]
-PIC.Core.CS021HBA.clockCorrectionTime = 0
-PIC.Core.CS021HBA.phaseCenter = [3826416.158,460510.576,5065060.187]
-PIC.Core.CS021HBA0.clockCorrectionTime = 0
-PIC.Core.CS021HBA0.phaseCenter = [3826463.502,460533.094,5065022.614]
-PIC.Core.CS021HBA1.clockCorrectionTime = 0
-PIC.Core.CS021HBA1.phaseCenter = [3826368.813,460488.057,5065097.759]
-PIC.Core.CS021LBA.clockCorrectionTime = 0
-PIC.Core.CS021LBA.phaseCenter = [3826406.543,460538.604,5065064.870]
-PIC.Core.CS021LBA.position = [3826406.543,460538.604,5065064.870]
-PIC.Core.CS024HBA.clockCorrectionTime = 0
-PIC.Core.CS024HBA.phaseCenter = [3827170.849,461381.379,5064416.362]
-PIC.Core.CS024HBA0.clockCorrectionTime = 0
-PIC.Core.CS024HBA0.phaseCenter = [3827218.193,461403.898,5064378.790]
-PIC.Core.CS024HBA1.clockCorrectionTime = 0
-PIC.Core.CS024HBA1.phaseCenter = [3827123.504,461358.861,5064453.935]
-PIC.Core.CS024LBA.clockCorrectionTime = 0
-PIC.Core.CS024LBA.phaseCenter = [3827161.234,461409.408,5064421.046]
-PIC.Core.CS024LBA.position = [3827161.234,461409.408,5064421.046]
-PIC.Core.CS026HBA.clockCorrectionTime = 0
-PIC.Core.CS026HBA.phaseCenter = [3826376.653,461846.767,5064968.706]
-PIC.Core.CS026HBA0.clockCorrectionTime = 0
-PIC.Core.CS026HBA0.phaseCenter = [3826418.227,461805.837,5064941.199]
-PIC.Core.CS026HBA1.clockCorrectionTime = 0
-PIC.Core.CS026HBA1.phaseCenter = [3826335.078,461887.696,5064996.213]
-PIC.Core.CS026LBA.clockCorrectionTime = 0
-PIC.Core.CS026LBA.phaseCenter = [3826390.916,461869.852,5064955.913]
-PIC.Core.CS026LBA.position = [3826390.916,461869.852,5064955.913]
-PIC.Core.CS028HBA.clockCorrectionTime = 0
-PIC.Core.CS028HBA.phaseCenter = [3825614.709,461283.678,5065591.532]
-PIC.Core.CS028HBA0.clockCorrectionTime = 0
-PIC.Core.CS028HBA0.phaseCenter = [3825573.134,461324.607,5065619.039]
-PIC.Core.CS028HBA1.clockCorrectionTime = 0
-PIC.Core.CS028HBA1.phaseCenter = [3825656.283,461242.749,5065564.025]
-PIC.Core.CS028LBA.clockCorrectionTime = 0
-PIC.Core.CS028LBA.phaseCenter = [3825600.445,461260.593,5065604.325]
-PIC.Core.CS028LBA.position = [3825600.445,461260.593,5065604.325]
-PIC.Core.CS030HBA.clockCorrectionTime = 0
-PIC.Core.CS030HBA.phaseCenter = [3826000.003,460364.303,5065385.121]
-PIC.Core.CS030HBA0.clockCorrectionTime = 0
-PIC.Core.CS030HBA0.phaseCenter = [3826041.577,460323.374,5065357.614]
-PIC.Core.CS030HBA1.clockCorrectionTime = 0
-PIC.Core.CS030HBA1.phaseCenter = [3825958.428,460405.233,5065412.628]
-PIC.Core.CS030LBA.clockCorrectionTime = 0
-PIC.Core.CS030LBA.phaseCenter = [3826014.266,460387.389,5065372.328]
-PIC.Core.CS030LBA.position = [3826014.266,460387.389,5065372.328]
-PIC.Core.CS031HBA.clockCorrectionTime = 0
-PIC.Core.CS031HBA.phaseCenter = [3826430.381,460301.862,5065068.278]
-PIC.Core.CS031HBA0.clockCorrectionTime = 0
-PIC.Core.CS031HBA0.phaseCenter = [3826383.037,460279.343,5065105.850]
-PIC.Core.CS031HBA1.clockCorrectionTime = 0
-PIC.Core.CS031HBA1.phaseCenter = [3826477.725,460324.381,5065030.705]
-PIC.Core.CS031LBA.clockCorrectionTime = 0
-PIC.Core.CS031LBA.phaseCenter = [3826439.996,460273.833,5065063.594]
-PIC.Core.CS031LBA.position = [3826439.996,460273.833,5065063.594]
-PIC.Core.CS032HBA.clockCorrectionTime = 0
-PIC.Core.CS032HBA.phaseCenter = [3826905.837,460410.995,5064702.499]
-PIC.Core.CS032HBA0.clockCorrectionTime = 0
-PIC.Core.CS032HBA0.phaseCenter = [3826864.262,460451.924,5064730.006]
-PIC.Core.CS032HBA1.clockCorrectionTime = 0
-PIC.Core.CS032HBA1.phaseCenter = [3826947.411,460370.066,5064674.992]
-PIC.Core.CS032LBA.clockCorrectionTime = 0
-PIC.Core.CS032LBA.phaseCenter = [3826891.573,460387.910,5064715.292]
-PIC.Core.CS032LBA.position = [3826891.573,460387.910,5064715.292]
-PIC.Core.CS101HBA.clockCorrectionTime = 0
-PIC.Core.CS101HBA.phaseCenter = [3825857.958,461661.510,5065374.102]
-PIC.Core.CS101HBA0.clockCorrectionTime = 0
-PIC.Core.CS101HBA0.phaseCenter = [3825905.302,461684.028,5065336.529]
-PIC.Core.CS101HBA1.clockCorrectionTime = 0
-PIC.Core.CS101HBA1.phaseCenter = [3825810.613,461638.991,5065411.674]
-PIC.Core.CS101LBA.clockCorrectionTime = 0
-PIC.Core.CS101LBA.phaseCenter = [3825848.343,461689.538,5065378.785]
-PIC.Core.CS101LBA.position = [3825848.343,461689.538,5065378.785]
-PIC.Core.CS103HBA.clockCorrectionTime = 0
-PIC.Core.CS103HBA.phaseCenter = [3826290.016,462800.003,5064947.127]
-PIC.Core.CS103HBA0.clockCorrectionTime = 0
-PIC.Core.CS103HBA0.phaseCenter = [3826331.590,462759.074,5064919.620]
-PIC.Core.CS103HBA1.clockCorrectionTime = 0
-PIC.Core.CS103HBA1.phaseCenter = [3826248.441,462840.933,5064974.634]
-PIC.Core.CS103LBA.clockCorrectionTime = 0
-PIC.Core.CS103LBA.phaseCenter = [3826304.279,462823.089,5064934.334]
-PIC.Core.CS103LBA.position = [3826304.279,462823.089,5064934.334]
-PIC.Core.CS201HBA.clockCorrectionTime = 0
-PIC.Core.CS201HBA.phaseCenter = [3826685.051,461918.691,5064731.315]
-PIC.Core.CS201HBA0.clockCorrectionTime = 0
-PIC.Core.CS201HBA0.phaseCenter = [3826679.281,461855.243,5064741.380]
-PIC.Core.CS201HBA1.clockCorrectionTime = 0
-PIC.Core.CS201HBA1.phaseCenter = [3826690.821,461982.139,5064721.249]
-PIC.Core.CS201LBA.clockCorrectionTime = 0
-PIC.Core.CS201LBA.phaseCenter = [3826708.929,461913.747,5064713.838]
-PIC.Core.CS201LBA.position = [3826708.929,461913.747,5064713.838]
-PIC.Core.CS301HBA.clockCorrectionTime = 0
-PIC.Core.CS301HBA.phaseCenter = [3827453.340,460985.281,5064240.201]
-PIC.Core.CS301HBA0.clockCorrectionTime = 0
-PIC.Core.CS301HBA0.phaseCenter = [3827459.109,461048.728,5064230.136]
-PIC.Core.CS301HBA1.clockCorrectionTime = 0
-PIC.Core.CS301HBA1.phaseCenter = [3827447.570,460921.833,5064250.266]
-PIC.Core.CS301LBA.clockCorrectionTime = 0
-PIC.Core.CS301LBA.phaseCenter = [3827429.462,460990.224,5064257.677]
-PIC.Core.CS301LBA.position = [3827429.462,460990.224,5064257.677]
-PIC.Core.CS302HBA.clockCorrectionTime = 0
-PIC.Core.CS302HBA.phaseCenter = [3827931.652,459769.554,5064002.807]
-PIC.Core.CS302HBA0.clockCorrectionTime = 0
-PIC.Core.CS302HBA0.phaseCenter = [3827973.226,459728.624,5063975.300]
-PIC.Core.CS302HBA1.clockCorrectionTime = 0
-PIC.Core.CS302HBA1.phaseCenter = [3827890.077,459810.483,5064030.313]
-PIC.Core.CS302LBA.clockCorrectionTime = 0
-PIC.Core.CS302LBA.phaseCenter = [3827945.916,459792.639,5063990.016]
-PIC.Core.CS302LBA.position = [3827945.916,459792.639,5063990.016]
-PIC.Core.CS401HBA.clockCorrectionTime = 8.069737e-06
-PIC.Core.CS401HBA.phaseCenter = [3826789.982,460095.444,5064818.996]
-PIC.Core.CS401HBA0.clockCorrectionTime = 8.069604e-06
-PIC.Core.CS401HBA0.phaseCenter = [3826795.752,460158.894,5064808.929]
-PIC.Core.CS401HBA1.clockCorrectionTime = 8.069870e-06
-PIC.Core.CS401HBA1.phaseCenter = [3826784.211,460031.993,5064829.062]
-PIC.Core.CS401LBA.clockCorrectionTime = 8.06397e-06
-PIC.Core.CS401LBA.phaseCenter = [3826766.106,460100.388,5064836.470]
-PIC.Core.CS401LBA.position = [3826766.106,460100.388,5064836.470]
-PIC.Core.CS501HBA.clockCorrectionTime = 0
-PIC.Core.CS501HBA.phaseCenter = [3825616.164,460670.139,5065645.456]
-PIC.Core.CS501HBA0.clockCorrectionTime = 0
-PIC.Core.CS501HBA0.phaseCenter = [3825568.820,460647.620,5065683.028]
-PIC.Core.CS501HBA1.clockCorrectionTime = 0
-PIC.Core.CS501HBA1.phaseCenter = [3825663.508,460692.658,5065607.883]
-PIC.Core.CS501LBA.clockCorrectionTime = 0
-PIC.Core.CS501LBA.phaseCenter = [3825625.779,460642.110,5065640.772]
-PIC.Core.CS501LBA.position = [3825625.779,460642.110,5065640.772]
-PIC.Core.DE601HBA.clockCorrectionTime = 1.1e-6
-PIC.Core.DE601HBA.phaseCenter = [4034099.840,487013.425,4900229.635]
-PIC.Core.DE601LBA.clockCorrectionTime = 1.1e-6
-PIC.Core.DE601LBA.phaseCenter = [4034036.396,487026.791,4900279.047]
-PIC.Core.DE602HBA.clockCorrectionTime = 0
-PIC.Core.DE602HBA.phaseCenter = [4152568.006,828789.153,4754362.203]
-PIC.Core.DE602LBA.clockCorrectionTime = 0
-PIC.Core.DE602LBA.phaseCenter = [4152560.658,828869.076,4754357.155]
-PIC.Core.DE603HBA.clockCorrectionTime = 0
-PIC.Core.DE603HBA.phaseCenter = [3940295.706,816722.865,4932394.416]
-PIC.Core.DE603LBA.clockCorrectionTime = 0
-PIC.Core.DE603LBA.phaseCenter = [3940284.908,816802.334,4932393.021]
-PIC.Core.DE604HBA.clockCorrectionTime = 0
-PIC.Core.DE604HBA.phaseCenter = [3796379.823,877614.130,5032712.528]
-PIC.Core.DE604LBA.clockCorrectionTime = 0
-PIC.Core.DE604LBA.phaseCenter = [3796327.178,877591.636,5032757.508]
-PIC.Core.DE605HBA.clockCorrectionTime = 0
-PIC.Core.DE605HBA.phaseCenter = [4005681.020,450968.643,4926458.211]
-PIC.Core.DE605LBA.clockCorrectionTime = 0
-PIC.Core.DE605LBA.phaseCenter = [4005681.355,450968.621,4926457.941]
-PIC.Core.FR606HBA.clockCorrectionTime = 0
-PIC.Core.FR606HBA.phaseCenter = [4324016.708,165545.525,4670271.363]
-PIC.Core.FR606LBA.clockCorrectionTime = 0
-PIC.Core.FR606LBA.phaseCenter = [4323979.809,165608.773,4670303.094]
-PIC.Core.IONProc.R00[0].inputs = []
-PIC.Core.IONProc.R00[10].inputs = []
-PIC.Core.IONProc.R00[11].inputs = []
-PIC.Core.IONProc.R00[12].inputs = []
-PIC.Core.IONProc.R00[13].inputs = []
-PIC.Core.IONProc.R00[14].inputs = []
-PIC.Core.IONProc.R00[15].inputs = []
-PIC.Core.IONProc.R00[16].inputs = []
-PIC.Core.IONProc.R00[17].inputs = []
-PIC.Core.IONProc.R00[18].inputs = []
-PIC.Core.IONProc.R00[19].inputs = []
-PIC.Core.IONProc.R00[1].inputs = []
-PIC.Core.IONProc.R00[20].inputs = []
-PIC.Core.IONProc.R00[21].inputs = []
-PIC.Core.IONProc.R00[22].inputs = []
-PIC.Core.IONProc.R00[23].inputs = [RS205LBA/RSP0,RS205LBA/RSP1,RS205LBA/RSP2,RS205LBA/RSP3]
-PIC.Core.IONProc.R00[24].inputs = []
-PIC.Core.IONProc.R00[25].inputs = []
-PIC.Core.IONProc.R00[26].inputs = [CS302LBA/RSP0,CS302LBA/RSP1,CS302LBA/RSP2,CS302LBA/RSP3]
-PIC.Core.IONProc.R00[27].inputs = []
-PIC.Core.IONProc.R00[28].inputs = []
-PIC.Core.IONProc.R00[29].inputs = []
-PIC.Core.IONProc.R00[2].inputs = []
-PIC.Core.IONProc.R00[30].inputs = [RS406LBA/RSP0,RS406LBA/RSP1,RS406LBA/RSP2,RS406LBA/RSP3]
-PIC.Core.IONProc.R00[31].inputs = [RS509LBA/RSP0,RS509LBA/RSP1,RS509LBA/RSP2,RS509LBA/RSP3]
-PIC.Core.IONProc.R00[32].inputs = [CS021LBA/RSP0,CS021LBA/RSP1,CS021LBA/RSP2,CS021LBA/RSP3]
-PIC.Core.IONProc.R00[33].inputs = [CS005LBA/RSP0,CS005LBA/RSP1,CS005LBA/RSP2,CS005LBA/RSP3]
-PIC.Core.IONProc.R00[34].inputs = [CS002LBA/RSP0,CS002LBA/RSP1,CS002LBA/RSP2,CS002LBA/RSP3]
-PIC.Core.IONProc.R00[35].inputs = [CS006LBA/RSP0,CS006LBA/RSP1,CS006LBA/RSP2,CS006LBA/RSP3]
-PIC.Core.IONProc.R00[36].inputs = [CS003LBA/RSP0,CS003LBA/RSP1,CS003LBA/RSP2,CS003LBA/RSP3]
-PIC.Core.IONProc.R00[37].inputs = [CS007LBA/RSP0,CS007LBA/RSP1,CS007LBA/RSP2,CS007LBA/RSP3]
-PIC.Core.IONProc.R00[38].inputs = [CS004LBA/RSP0,CS004LBA/RSP1,CS004LBA/RSP2,CS004LBA/RSP3]
-PIC.Core.IONProc.R00[39].inputs = [CS024LBA/RSP0,CS024LBA/RSP1,CS024LBA/RSP2,CS024LBA/RSP3]
-PIC.Core.IONProc.R00[3].inputs = []
-PIC.Core.IONProc.R00[40].inputs = [CS101LBA/RSP0,CS101LBA/RSP1,CS101LBA/RSP2,CS101LBA/RSP3]
-PIC.Core.IONProc.R00[41].inputs = [CS032LBA/RSP0,CS032LBA/RSP1,CS032LBA/RSP2,CS032LBA/RSP3]
-PIC.Core.IONProc.R00[42].inputs = [CS026LBA/RSP0,CS026LBA/RSP1,CS026LBA/RSP2,CS026LBA/RSP3]
-PIC.Core.IONProc.R00[43].inputs = [CS201LBA/RSP0,CS201LBA/RSP1,CS201LBA/RSP2,CS201LBA/RSP3]
-PIC.Core.IONProc.R00[44].inputs = [CS030LBA/RSP0,CS030LBA/RSP1,CS030LBA/RSP2,CS030LBA/RSP3]
-PIC.Core.IONProc.R00[45].inputs = [CS301LBA/RSP0,CS301LBA/RSP1,CS301LBA/RSP2,CS301LBA/RSP3]
-PIC.Core.IONProc.R00[46].inputs = [CS001LBA/RSP0,CS001LBA/RSP1,CS001LBA/RSP2,CS001LBA/RSP3]
-PIC.Core.IONProc.R00[47].inputs = [CS401LBA/RSP0,CS401LBA/RSP1,CS401LBA/RSP2,CS401LBA/RSP3]
-PIC.Core.IONProc.R00[48].inputs = [CS017LBA/RSP0,CS017LBA/RSP1,CS017LBA/RSP2,CS017LBA/RSP3]
-PIC.Core.IONProc.R00[49].inputs = [RS208LBA/RSP0,RS208LBA/RSP1,RS208LBA/RSP2,RS208LBA/RSP3]
-PIC.Core.IONProc.R00[4].inputs = []
-PIC.Core.IONProc.R00[50].inputs = [CS011LBA/RSP0,CS011LBA/RSP1,CS011LBA/RSP2,CS011LBA/RSP3]
-PIC.Core.IONProc.R00[51].inputs = [CS028LBA/RSP0,CS028LBA/RSP1,CS028LBA/RSP2,CS028LBA/RSP3]
-PIC.Core.IONProc.R00[52].inputs = [CS501LBA/RSP0,CS501LBA/RSP1,CS501LBA/RSP2,CS501LBA/RSP3]
-PIC.Core.IONProc.R00[53].inputs = [RS503LBA/RSP0,RS503LBA/RSP1,RS503LBA/RSP2,RS503LBA/RSP3]
-PIC.Core.IONProc.R00[54].inputs = [CS103LBA/RSP0,CS103LBA/RSP1,CS103LBA/RSP2,CS103LBA/RSP3]
-PIC.Core.IONProc.R00[55].inputs = [RS106LBA/RSP0,RS106LBA/RSP1,RS106LBA/RSP2,RS106LBA/RSP3]
-PIC.Core.IONProc.R00[56].inputs = []
-PIC.Core.IONProc.R00[57].inputs = []
-PIC.Core.IONProc.R00[58].inputs = [CS031LBA/RSP0,CS031LBA/RSP1,CS031LBA/RSP2,CS031LBA/RSP3]
-PIC.Core.IONProc.R00[59].inputs = []
-PIC.Core.IONProc.R00[5].inputs = []
-PIC.Core.IONProc.R00[60].inputs = [RS306LBA/RSP0,RS306LBA/RSP1,RS306LBA/RSP2,RS306LBA/RSP3]
-PIC.Core.IONProc.R00[61].inputs = []
-PIC.Core.IONProc.R00[62].inputs = [RS307LBA/RSP0,RS307LBA/RSP1,RS307LBA/RSP2,RS307LBA/RSP3]
-PIC.Core.IONProc.R00[63].inputs = [RS508LBA/RSP0,RS508LBA/RSP1,RS508LBA/RSP2,RS508LBA/RSP3]
-PIC.Core.IONProc.R00[6].inputs = []
-PIC.Core.IONProc.R00[7].inputs = []
-PIC.Core.IONProc.R00[8].inputs = []
-PIC.Core.IONProc.R00[9].inputs = []
-PIC.Core.RS106HBA.clockCorrectionTime = 0
-PIC.Core.RS106HBA.phaseCenter = [3829205.598,469142.533,5062181.002]
-PIC.Core.RS106LBA.clockCorrectionTime = 0
-PIC.Core.RS106LBA.phaseCenter = [3829261.425,469162.285,5062137.310]
-PIC.Core.RS106LBA.position = [3829261.425,469162.285,5062137.310]
-PIC.Core.RS205HBA.clockCorrectionTime = 0
-PIC.Core.RS205HBA.phaseCenter = [3831479.670,463487.529,5060989.903]
-PIC.Core.RS205LBA.clockCorrectionTime = 0
-PIC.Core.RS205LBA.phaseCenter = [3831438.563,463435.440,5061025.466]
-PIC.Core.RS205LBA.position = [3831438.563,463435.440,5061025.466]
-PIC.Core.RS208HBA.clockCorrectionTime = 0
-PIC.Core.RS208HBA.phaseCenter = [3847753.310,466962.809,5048397.244]
-PIC.Core.RS208LBA.clockCorrectionTime = 0
-PIC.Core.RS208LBA.phaseCenter = [3847810.051,466929.706,5048357.222]
-PIC.Core.RS208LBA.position = [3847810.051,466929.706,5048357.222]
-PIC.Core.RS306HBA.clockCorrectionTime = 0
-PIC.Core.RS306HBA.phaseCenter = [3829771.249,452761.702,5063243.181]
-PIC.Core.RS306LBA.clockCorrectionTime = 0
-PIC.Core.RS306LBA.phaseCenter = [3829791.808,452829.848,5063221.590]
-PIC.Core.RS306LBA.position = [3829791.808,452829.848,5063221.590]
-PIC.Core.RS307HBA.clockCorrectionTime = 0
-PIC.Core.RS307HBA.phaseCenter = [3837964.520,449627.261,5057357.585]
-PIC.Core.RS307LBA.clockCorrectionTime = 0
-PIC.Core.RS307LBA.phaseCenter = [3837940.949,449560.756,5057381.288]
-PIC.Core.RS307LBA.position = [3837940.949,449560.756,5057381.288]
-PIC.Core.RS406HBA.clockCorrectionTime = 0
-PIC.Core.RS406HBA.phaseCenter = [3818424.939,452020.269,5071817.644]
-PIC.Core.RS406LBA.clockCorrectionTime = 0
-PIC.Core.RS406LBA.phaseCenter = [3818467.634,451974.601,5071790.597]
-PIC.Core.RS406LBA.position = [3818467.634,451974.601,5071790.597]
-PIC.Core.RS503HBA.clockCorrectionTime = 0
-PIC.Core.RS503HBA.phaseCenter = [3824138.566,459476.972,5066858.578]
-PIC.Core.RS503LBA.clockCorrectionTime = 0
-PIC.Core.RS503LBA.phaseCenter = [3824090.452,459438.282,5066898.190]
-PIC.Core.RS503LBA.position = [3824090.452,459438.282,5066898.190]
-PIC.Core.RS508HBA.clockCorrectionTime = 0
-PIC.Core.RS508HBA.phaseCenter = [3797136.484,463114.447,5086651.286]
-PIC.Core.RS508LBA.clockCorrectionTime = 0
-PIC.Core.RS508LBA.phaseCenter = [3797202.116,463087.509,5086605.037]
-PIC.Core.RS508LBA.position = [3797202.116,463087.509,5086605.037]
-PIC.Core.RS509HBA.clockCorrectionTime = 0
-PIC.Core.RS509HBA.phaseCenter = [3783537.525,450130.064,5097866.146]
-PIC.Core.RS509LBA.clockCorrectionTime = 0
-PIC.Core.RS509LBA.phaseCenter = [3783579.131,450178.882,5097830.835]
-PIC.Core.RS509LBA.position = [3783579.131,450178.882,5097830.835]
-PIC.Core.S1.phaseCenter = [3826615.56096,460986.585898,5064718.84237]
-PIC.Core.S10.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S129.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S13.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S130.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S133.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S134.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S137.phaseCenter = [3826967.64713,460904.072585,5064612.8258]
-PIC.Core.S138.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S14.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S141.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S142.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S145.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S146.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S149.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S150.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S153.phaseCenter = [3826967.64713,460904.072585,5064612.8258]
-PIC.Core.S154.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S157.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S158.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S161.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S162.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S165.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S166.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S169.phaseCenter = [3826967.64713,460904.072585,5064612.8258]
-PIC.Core.S17.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S170.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S173.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S174.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S177.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S178.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S18.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S181.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S182.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S185.phaseCenter = [3826967.64713,460904.072585,5064612.8258]
-PIC.Core.S186.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S189.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S190.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S2.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S21.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S22.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S25.phaseCenter = [3826967.64713,460904.072585,5064612.8258]
-PIC.Core.S26.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S29.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S30.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S33.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S34.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S37.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S38.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S41.phaseCenter = [3826967.64713,460904.072585,5064612.8258]
-PIC.Core.S42.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S45.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S46.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S49.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S5.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S50.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S53.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S54.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S57.phaseCenter = [3826967.64713,460904.072585,5064612.8258]
-PIC.Core.S58.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S6.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S61.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S62.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S9.phaseCenter = [3826967.64713,460904.072585,5064612.8258]
-PIC.Core.SE607HBA.clockCorrectionTime = 0
-PIC.Core.SE607HBA.phaseCenter = [3370271.657,712125.881,5349991.165]
-PIC.Core.SE607LBA.clockCorrectionTime = 0
-PIC.Core.SE607LBA.phaseCenter = [3370286.931,712053.871,5349991.459]
-PIC.Core.CS001LBA.RSP.ports = [0.0.0.0:4346,0.0.0.0:4347,0.0.0.0:4348,0.0.0.0:4349]
-PIC.Core.CS002LBA.RSP.ports = [0.0.0.0:4346,0.0.0.0:4347,0.0.0.0:4348,0.0.0.0:4349]
-PIC.Core.CS003LBA.RSP.ports = [0.0.0.0:4346,0.0.0.0:4347,0.0.0.0:4348,0.0.0.0:4349]
-PIC.Core.CS004LBA.RSP.ports = [0.0.0.0:4346,0.0.0.0:4347,0.0.0.0:4348,0.0.0.0:4349]
-PIC.Core.CS005LBA.RSP.ports = [0.0.0.0:4346,0.0.0.0:4347,0.0.0.0:4348,0.0.0.0:4349]
-PIC.Core.CS006LBA.RSP.ports = [0.0.0.0:4346,0.0.0.0:4347,0.0.0.0:4348,0.0.0.0:4349]
-PIC.Core.CS007LBA.RSP.ports = [0.0.0.0:4346,0.0.0.0:4347,0.0.0.0:4348,0.0.0.0:4349]
-PIC.Core.CS011LBA.RSP.ports = [0.0.0.0:4346,0.0.0.0:4347,0.0.0.0:4348,0.0.0.0:4349]
-PIC.Core.CS017LBA.RSP.ports = [0.0.0.0:4346,0.0.0.0:4347,0.0.0.0:4348,0.0.0.0:4349]
-PIC.Core.CS021LBA.RSP.ports = [0.0.0.0:4346,0.0.0.0:4347,0.0.0.0:4348,0.0.0.0:4349]
-PIC.Core.CS024LBA.RSP.ports = [0.0.0.0:4346,0.0.0.0:4347,0.0.0.0:4348,0.0.0.0:4349]
-PIC.Core.CS026LBA.RSP.ports = [0.0.0.0:4346,0.0.0.0:4347,0.0.0.0:4348,0.0.0.0:4349]
-PIC.Core.CS028LBA.RSP.ports = [0.0.0.0:4346,0.0.0.0:4347,0.0.0.0:4348,0.0.0.0:4349]
-PIC.Core.CS030LBA.RSP.ports = [0.0.0.0:4346,0.0.0.0:4347,0.0.0.0:4348,0.0.0.0:4349]
-PIC.Core.CS031LBA.RSP.ports = [0.0.0.0:4346,0.0.0.0:4347,0.0.0.0:4348,0.0.0.0:4349]
-PIC.Core.CS032LBA.RSP.ports = [0.0.0.0:4346,0.0.0.0:4347,0.0.0.0:4348,0.0.0.0:4349]
-PIC.Core.CS101LBA.RSP.ports = [0.0.0.0:4346,0.0.0.0:4347,0.0.0.0:4348,0.0.0.0:4349]
-PIC.Core.CS103LBA.RSP.ports = [0.0.0.0:4346,0.0.0.0:4347,0.0.0.0:4348,0.0.0.0:4349]
-PIC.Core.CS201LBA.RSP.ports = [0.0.0.0:4346,0.0.0.0:4347,0.0.0.0:4348,0.0.0.0:4349]
-PIC.Core.CS301LBA.RSP.ports = [0.0.0.0:4346,0.0.0.0:4347,0.0.0.0:4348,0.0.0.0:4349]
-PIC.Core.CS302LBA.RSP.ports = [0.0.0.0:4346,0.0.0.0:4347,0.0.0.0:4348,0.0.0.0:4349]
-PIC.Core.CS401LBA.RSP.ports = [0.0.0.0:4346,0.0.0.0:4347,0.0.0.0:4348,0.0.0.0:4349]
-PIC.Core.CS501LBA.RSP.ports = [0.0.0.0:4346,0.0.0.0:4347,0.0.0.0:4348,0.0.0.0:4349]
-PIC.Core.RS106LBA.RSP.ports = [0.0.0.0:4346,0.0.0.0:4347,0.0.0.0:4348,0.0.0.0:4349]
-PIC.Core.RS205LBA.RSP.ports = [0.0.0.0:4346,0.0.0.0:4347,0.0.0.0:4348,0.0.0.0:4349]
-PIC.Core.RS208LBA.RSP.ports = [0.0.0.0:4346,0.0.0.0:4347,0.0.0.0:4348,0.0.0.0:4349]
-PIC.Core.RS306LBA.RSP.ports = [0.0.0.0:4346,0.0.0.0:4347,0.0.0.0:4348,0.0.0.0:4349]
-PIC.Core.RS307LBA.RSP.ports = [0.0.0.0:4346,0.0.0.0:4347,0.0.0.0:4348,0.0.0.0:4349]
-PIC.Core.RS406LBA.RSP.ports = [0.0.0.0:4346,0.0.0.0:4347,0.0.0.0:4348,0.0.0.0:4349]
-PIC.Core.RS503LBA.RSP.ports = [0.0.0.0:4346,0.0.0.0:4347,0.0.0.0:4348,0.0.0.0:4349]
-PIC.Core.RS508LBA.RSP.ports = [0.0.0.0:4346,0.0.0.0:4347,0.0.0.0:4348,0.0.0.0:4349]
-PIC.Core.RS509LBA.RSP.ports = [0.0.0.0:4346,0.0.0.0:4347,0.0.0.0:4348,0.0.0.0:4349]
-PIC.Core.T1.phaseCenter = [3826615.56096,460986.585898,5064718.84237]
-PIC.Core.T10.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T129.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T13.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T130.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T133.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T134.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T137.phaseCenter = [3826967.64713,460904.072585,5064612.8258]
-PIC.Core.T138.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T14.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T141.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T142.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T145.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T146.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T149.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T150.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T153.phaseCenter = [3826967.64713,460904.072585,5064612.8258]
-PIC.Core.T154.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T157.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T158.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T161.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T162.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T165.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T166.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T169.phaseCenter = [3826967.64713,460904.072585,5064612.8258]
-PIC.Core.T17.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T170.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T173.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T174.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T177.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T178.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T18.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T181.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T182.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T185.phaseCenter = [3826967.64713,460904.072585,5064612.8258]
-PIC.Core.T186.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T189.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T190.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T2.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T21.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T22.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T25.phaseCenter = [3826967.64713,460904.072585,5064612.8258]
-PIC.Core.T26.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T29.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T30.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T33.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T34.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T37.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T38.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T41.phaseCenter = [3826967.64713,460904.072585,5064612.8258]
-PIC.Core.T42.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T45.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T46.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T49.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T5.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T50.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T53.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T54.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T57.phaseCenter = [3826967.64713,460904.072585,5064612.8258]
-PIC.Core.T58.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T6.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T61.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T62.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T9.phaseCenter = [3826967.64713,460904.072585,5064612.8258]
-PIC.Core.UK608HBA.clockCorrectionTime = 0
-PIC.Core.UK608HBA.phaseCenter = [4008461.941,-100376.609,4943716.874]
-PIC.Core.UK608LBA.clockCorrectionTime = 0
-PIC.Core.UK608LBA.phaseCenter = [4008438.457,-100309.725,4943735.828]
-_DPname = LOFAR_ObsSW_TempObs0054
-_parsetPrefix = CorrAppl.CorrProc.
-_processName = CorrProc
+Observation.DataProducts.Output_IncoherentStokes.filenames = [L121213_SAP000_B001_S0_P000_bf.h5, L121213_SAP000_B001_S1_P000_bf.h5, L121213_SAP000_B001_S2_P000_bf.h5, L121213_SAP000_B001_S3_P000_bf.h5, L121213_SAP001_B001_S0_P000_bf.h5, L121213_SAP001_B001_S1_P000_bf.h5, L121213_SAP001_B001_S2_P000_bf.h5, L121213_SAP001_B001_S3_P000_bf.h5]
+Observation.DataProducts.Output_IncoherentStokes.locations = [8*CEP4:cpu40.cep4:/data/projects/TT0_000/L121213/is]
+
+Observation.Campaign.name="TT0_000"
+Observation.Campaign.title="TEST: Terminally Extensive Settings for Testing"
+Observation.Campaign.PI="Testing, Dr. Random"
+Observation.Campaign.CO_I="Bias, Dr. Slanted"
+Observation.Campaign.contact="Testing, Dr. Random"
+
diff --git a/RTCP/Cobalt/OutputProc/test/tTBB_Writer-spectral.run b/RTCP/Cobalt/OutputProc/test/tTBB_Writer-spectral.run
new file mode 100755
index 0000000000000000000000000000000000000000..451cd6994dbf56176a89ea5735bb9d26af8bc34f
--- /dev/null
+++ b/RTCP/Cobalt/OutputProc/test/tTBB_Writer-spectral.run
@@ -0,0 +1,38 @@
+#!/bin/bash
+# tTBB_Writer-spectral.run
+
+rm -f L121213_CS013_D20170711T094130.000Z_tbb.h5 L121213_CS013_RSP001_RCU010_SB099_D20170711T094130.000Z_tbb.raw L121213_CS013_RSP001_RCU010_SB100_D20170711T094130.000Z_tbb.raw
+
+status=0
+
+TBB_Writer --parset=tTBB_Writer-spectral.parset --staticmetadatadir=tTBB_Writer-spectral.in_1 --outputdir=. --input=file:tTBB_Writer-spectral.in_1/sb_20170711_094130_1310_sb99-100dupl.dat --timeout=1 --keeprunning=0 || status=1
+
+# Check some .h5 attributes vs a reference output
+# Older HDF5 1.8 versions (e.g. 1.8.4) print e.g.: 'ATTRIBUTE "STATION_CS011/STATION_NAME" {' instead of: 'ATTRIBUTE "STATION_NAME" {' and different spacing.
+# Use sed magic to strip the HDF5 dirname and use diff with -b. (Better: use h5diff.)
+h5dump -a TELESCOPE \
+       -a OPERATING_MODE \
+       -a STATION_CS013/STATION_NAME \
+       -a STATION_CS013/STATION_POSITION \
+       -a STATION_CS013/DIPOLE_013001010/DATA_LENGTH \
+       -a STATION_CS013/DIPOLE_013001010/TIME \
+       L121213_CS013_D20170711T094130.000Z_tbb.h5 | \
+  sed -r -e 's/^ATTRIBUTE "([[:alnum:]_]+\/)*([[:alnum:]_]+)"/ATTRIBUTE "\2"/' > \
+    L121213_CS013_D20170711T094130.000Z_tbb.h5.selected-attribs.txt || status=1
+
+diff -b L121213_CS013_D20170711T094130.000Z_tbb.h5.selected-attribs.txt tTBB_Writer-spectral.in_1/L121213_CS013_D20170711T094130.000Z_tbb.h5.selected-attribs.txt || status=1
+
+# Check .raw file vs a reference output (.raw outputs for both subbands are the same here, so check vs the same refout)
+diff L121213_CS013_RSP001_RCU010_SB099_D20170711T094130.000Z_tbb.raw tTBB_Writer-spectral.in_1/tTBB_Writer-spectral-refout.raw || status=1
+diff L121213_CS013_RSP001_RCU010_SB100_D20170711T094130.000Z_tbb.raw tTBB_Writer-spectral.in_1/tTBB_Writer-spectral-refout.raw || status=1
+
+
+if [ $status -eq 1 ]; then
+  echo
+  echo "Printing all (20) TBB input frames to ease debugging / test fixing"
+  tbb-printframes tTBB_Writer-spectral.in_1/sb_20170711_094130_1310_sb99-100dupl.dat 20
+else
+  rm -f L121213_CS013_D20170711T094130.000Z_tbb.h5 L121213_CS013_RSP001_RCU010_SB099_D20170711T094130.000Z_tbb.raw L121213_CS013_RSP001_RCU010_SB100_D20170711T094130.000Z_tbb.raw L121213_CS013_D20110719T110541.036Z_tbb.h5.selected-attribs.txt
+fi
+
+[ $status -eq 0 ]
diff --git a/RTCP/Cobalt/OutputProc/test/tTBB_Writer-spectral.sh b/RTCP/Cobalt/OutputProc/test/tTBB_Writer-spectral.sh
new file mode 100755
index 0000000000000000000000000000000000000000..8bcde5afcc3b08aed61078f6b085501427cc2a7f
--- /dev/null
+++ b/RTCP/Cobalt/OutputProc/test/tTBB_Writer-spectral.sh
@@ -0,0 +1,2 @@
+#!/bin/sh
+./runctest.sh tTBB_Writer-spectral
diff --git a/RTCP/Cobalt/OutputProc/test/tTBB_Writer-transient.in_1/CS011-AntennaField.conf b/RTCP/Cobalt/OutputProc/test/tTBB_Writer-transient.in_1/CS011-AntennaField.conf
new file mode 100644
index 0000000000000000000000000000000000000000..e1f47190eb997d4b5dd55ca8244e92af0d995483
--- /dev/null
+++ b/RTCP/Cobalt/OutputProc/test/tTBB_Writer-transient.in_1/CS011-AntennaField.conf
@@ -0,0 +1,196 @@
+# Blitz-0.10 formatted
+#
+# AntennaPositions for CS011
+# ITRF2005 target_date = 2015.5
+# Created: 2015-01-20 21:24:07
+#
+
+NORMAL_VECTOR LBA
+(0,2) [   0.598753   0.072099   0.797682 ]
+
+ROTATION_MATRIX LBA
+(0,2) x (0,2) [
+ -0.1195950000  -0.7919540000   0.5987530000 
+  0.9928230000  -0.0954190000   0.0720990000 
+  0.0000330000   0.6030780000   0.7976820000 
+]
+
+LBA
+(0,2) [ 3826667.025700000 461285.896091000 5064801.620 ]
+(0,95) x (0,1) x (0,2) [
+  0.000000   0.000000   0.000000     0.000000   0.000000   0.000000 
+ -2.019000  -0.243001   1.538000    -2.019000  -0.243001   1.538000 
+ -1.338000   2.104999   0.814000    -1.338000   2.104999   0.814000 
+  0.800000   2.363000  -0.814000     0.800000   2.363000  -0.814000 
+  2.019000   0.243000  -1.538000     2.019000   0.243000  -1.538000 
+  1.338000  -2.105000  -0.814000     1.338000  -2.105000  -0.814000 
+ -0.800000  -2.363000   0.814000    -0.800000  -2.363000   0.814000 
+  2.281000   4.879000  -2.153000     2.281000   4.879000  -2.153000 
+  4.349000   1.739000  -3.421000     4.349000   1.739000  -3.421000 
+  4.381000  -2.215000  -3.088000     4.381000  -2.215000  -3.088000 
+  2.364000  -5.132000  -1.311000     2.364000  -5.132000  -1.311000 
+ -0.759000  -5.647000   1.081000    -0.759000  -5.647000   1.081000 
+ -3.528000  -3.521001   2.966000    -3.528000  -3.521001   2.966000 
+ -4.645000   0.252999   3.464000    -4.645000   0.252999   3.464000 
+ -3.589000   3.908999   2.341000    -3.589000   3.908999   2.341000 
+ -0.853000   5.735000   0.122000    -0.853000   5.735000   0.122000 
+ -0.725000   9.294000  -0.296000    -0.725000   9.294000  -0.296000 
+  2.199000   9.309000  -2.492000     2.199000   9.309000  -2.492000 
+  5.838000   6.892000  -5.005000     5.838000   6.892000  -5.005000 
+  8.074000   0.050000  -6.065000     8.074000   0.050000  -6.065000 
+  7.865000  -3.141000  -5.620000     7.865000  -3.141000  -5.620000 
+  6.243000  -6.801000  -4.071000     6.243000  -6.801000  -4.071000 
+  3.199000  -8.511000  -1.632000     3.199000  -8.511000  -1.632000 
+ -1.427000  -8.674001   1.855000    -1.427000  -8.674001   1.855000 
+ -5.128000  -7.192001   4.499000    -5.128000  -7.192001   4.499000 
+ -7.354000  -3.665001   5.852000    -7.354000  -3.665001   5.852000 
+ -7.457000   0.267999   5.573000    -7.457000   0.267999   5.573000 
+ -6.327000   4.813999   4.314000    -6.327000   4.813999   4.314000 
+ -3.824000   8.094999   2.139000    -3.824000   8.094999   2.139000 
+ -0.004000  14.289000  -1.288000    -0.004000  14.289000  -1.288000 
+  3.053000  14.024000  -3.559000     3.053000  14.024000  -3.559000 
+  5.163000  12.207000  -4.979000     5.163000  12.207000  -4.979000 
+  9.227000   5.785000  -7.448000     9.227000   5.785000  -7.448000 
+ 11.393000   4.358001  -8.945000    11.393000   4.358001  -8.945000 
+ 10.512000  -2.962999  -7.622000    10.512000  -2.962999  -7.622000 
+  8.916000  -7.506000  -6.014000     8.916000  -7.506000  -6.014000 
+  7.445000 -12.372000  -4.470000     7.445000 -12.372000  -4.470000 
+  4.760000 -12.393000  -2.453000     4.760000 -12.393000  -2.453000 
+  1.017000 -13.001000   0.411000     1.017000 -13.001000   0.411000 
+ -4.531000 -11.595001   4.449000    -4.531000 -11.595001   4.449000 
+ -6.626000 -10.494001   5.922000    -6.626000 -10.494001   5.922000 
+ -9.170000  -6.059001   7.431000    -9.170000  -6.059001   7.431000 
+-11.674000  -3.166002   9.049000   -11.674000  -3.166002   9.049000 
+-10.651000   5.502999   7.498000   -10.651000   5.502999   7.498000 
+ -8.997000   8.785999   5.959000    -8.997000   8.785999   5.959000 
+ -6.091000  12.684999   3.425000    -6.091000  12.684999   3.425000 
+-40.727000 -37.669004  33.975000   -40.727000 -37.669004  33.975000 
+-32.498010  52.829996  19.618000   -32.498010  52.829996  19.618000 
+ -5.279000  16.988999   2.427000    -5.279000  16.988999   2.427000 
+ -4.300000  19.731999   1.444000    -4.300000  19.731999   1.444000 
+  8.052000  17.126000  -7.592000     8.052000  17.126000  -7.592000 
+ 15.453000   3.477001 -11.914000    15.453000   3.477001 -11.914000 
+ 16.459000  -1.337999 -12.234000    16.459000  -1.337999 -12.234000 
+ 11.810000 -11.640999  -7.813000    11.810000 -11.640999  -7.813000 
+  2.627000 -17.706000  -0.371000     2.627000 -17.706000  -0.371000 
+ -3.459000 -19.669001   4.374000    -3.459000 -19.669001   4.374000 
+-11.947000  -9.349002   9.812000   -11.947000  -9.349002   9.812000 
+-15.666000  -2.401002  11.976000   -15.666000  -2.401002  11.976000 
+-14.129000   7.221998   9.953000   -14.129000   7.221998   9.953000 
+-16.462000  15.003998  11.001000   -16.462000  15.003998  11.001000 
+ -8.632000  23.031999   4.398000    -8.632000  23.031999   4.398000 
+  1.438000  25.118000  -3.350000     1.438000  25.118000  -3.350000 
+  6.399000  23.796000  -6.954000     6.399000  23.796000  -6.954000 
+ 12.757000  20.518001 -11.430000    12.757000  20.518001 -11.430000 
+ 18.686000   4.176001 -14.404000    18.686000   4.176001 -14.404000 
+ 19.492000  -3.757999 -14.291000    19.492000  -3.757999 -14.291000 
+ 16.667000 -16.912999 -10.981000    16.667000 -16.912999 -10.981000 
+  7.089000 -23.917000  -3.160000     7.089000 -23.917000  -3.160000 
+ -0.089000 -25.938000   2.411000    -0.089000 -25.938000   2.411000 
+ -8.944000 -21.431001   8.650000    -8.944000 -21.431001   8.650000 
+-19.236000 -11.046002  15.437000   -19.236000 -11.046002  15.437000 
+-21.248000   6.582998  15.354000   -21.248000   6.582998  15.354000 
+-23.336000  20.235997  15.687000   -23.336000  20.235997  15.687000 
+-13.234000  27.461998   7.451000   -13.234000  27.461998   7.451000 
+ -2.097000  31.197999  -1.246000    -2.097000  31.197999  -1.246000 
+  4.262000  31.808000  -6.074000     4.262000  31.808000  -6.074000 
+ 17.427000  21.632001 -15.036000    17.427000  21.632001 -15.036000 
+ 26.446000   6.977002 -20.481000    26.446000   6.977002 -20.481000 
+ 27.157000  -5.282998 -19.907000    27.157000  -5.282998 -19.907000 
+ 22.433000 -12.213998 -15.734000    22.433000 -12.213998 -15.734000 
+ 18.923000 -25.900999 -11.863000    18.923000 -25.900999 -11.863000 
+  5.317000 -33.495000  -0.964000     5.317000 -33.495000  -0.964000 
+ -1.856000 -33.457001   4.417000    -1.856000 -33.457001   4.417000 
+-14.240000 -28.700002  13.283000   -14.240000 -28.700002  13.283000 
+-18.109000 -21.804002  15.564000   -18.109000 -21.804002  15.564000 
+-26.330000  -3.453003  20.076000   -26.330000  -3.453003  20.076000 
+-24.549000   2.737997  18.179000   -24.549000   2.737997  18.179000 
+-29.331000   4.991997  21.565000   -29.331000   4.991997  21.565000 
+-14.547000  38.445998   7.445000   -14.547000  38.445998   7.445000 
+  5.953000  38.755000  -7.971000     5.953000  38.755000  -7.971000 
+ 21.123000  31.107002 -18.667000    21.123000  31.107002 -18.667000 
+ 28.337000  17.349002 -22.838000    28.337000  17.349002 -22.838000 
+ 25.809000 -27.254998 -16.909000    25.809000 -27.254998 -16.909000 
+  9.401000 -35.116999  -3.883000     9.401000 -35.116999  -3.883000 
+ -2.563000 -40.984001   5.628000    -2.563000 -40.984001   5.628000 
+-29.080000 -11.615003  22.878000   -29.080000 -11.615003  22.878000 
+]
+
+HBA
+(0,2) [ 3826643.147700000 461290.840088000 5064819.097 ]
+(0,47) x (0,1) x (0,2) [
+-16.060000 -65.451001  17.970000   -16.060000 -65.451001  17.970000 
+-16.102000 -60.319001  17.538000   -16.102000 -60.319001  17.538000 
+-11.893000 -70.808001  15.327000   -11.893000 -70.808001  15.327000 
+-11.935000 -65.676001  14.894000   -11.935000 -65.676001  14.894000 
+-11.977000 -60.544001  14.462000   -11.977000 -60.544001  14.462000 
+-12.020000 -55.413001  14.031000   -12.020000 -55.413001  14.031000 
+ -7.726990 -76.164000  12.683000    -7.726990 -76.164000  12.683000 
+ -7.769000 -71.032000  12.251000    -7.769000 -71.032000  12.251000 
+ -7.811000 -65.901000  11.819000    -7.811000 -65.901000  11.819000 
+ -7.854000 -60.770000  11.387000    -7.854000 -60.770000  11.387000 
+ -7.896000 -55.638000  10.955000    -7.896000 -55.638000  10.955000 
+ -7.938000 -50.506000  10.523000    -7.938000 -50.506000  10.523000 
+ -3.601990 -76.389000   9.607000    -3.601990 -76.389000   9.607000 
+ -3.643990 -71.257000   9.175000    -3.643990 -71.257000   9.175000 
+ -3.686000 -66.126000   8.743000    -3.686000 -66.126000   8.743000 
+ -3.729000 -60.994000   8.311000    -3.729000 -60.994000   8.311000 
+ -3.771000 -55.863000   7.879000    -3.771000 -55.863000   7.879000 
+ -3.813000 -50.731000   7.447000    -3.813000 -50.731000   7.447000 
+  0.481010 -71.483000   6.099000     0.481010 -71.483000   6.099000 
+  0.438000 -66.351000   5.668000     0.438000 -66.351000   5.668000 
+  0.396000 -61.219000   5.236000     0.396000 -61.219000   5.236000 
+  0.354000 -56.087000   4.803000     0.354000 -56.087000   4.803000 
+  4.563000 -66.575999   2.592000     4.563000 -66.575999   2.592000 
+  4.521000 -61.443999   2.160000     4.521000 -61.443999   2.160000 
+ -4.520010  61.445000  -2.161000    -4.520010  61.445000  -2.161000 
+ -4.562010  66.576000  -2.594000    -4.562010  66.576000  -2.594000 
+ -0.354010  56.088000  -4.805000    -0.354010  56.088000  -4.805000 
+ -0.396010  61.219000  -5.237000    -0.396010  61.219000  -5.237000 
+ -0.438010  66.351000  -5.669000    -0.438010  66.351000  -5.669000 
+ -0.481010  71.483000  -6.101000    -0.481010  71.483000  -6.101000 
+  3.812990  50.732001  -7.448000     3.812990  50.732001  -7.448000 
+  3.770990  55.863001  -7.881000     3.770990  55.863001  -7.881000 
+  3.728990  60.994001  -8.313000     3.728990  60.994001  -8.313000 
+  3.685990  66.126001  -8.744000     3.685990  66.126001  -8.744000 
+  3.643990  71.258001  -9.177000     3.643990  71.258001  -9.177000 
+  3.601990  76.390001  -9.609000     3.601990  76.390001  -9.609000 
+  7.937990  50.506001 -10.524000     7.937990  50.506001 -10.524000 
+  7.895990  55.638001 -10.956000     7.895990  55.638001 -10.956000 
+  7.853990  60.770001 -11.389000     7.853990  60.770001 -11.389000 
+  7.810990  65.902001 -11.820000     7.810990  65.902001 -11.820000 
+  7.768990  71.033001 -12.252000     7.768990  71.033001 -12.252000 
+  7.726990  76.164001 -12.685000     7.726990  76.164001 -12.685000 
+ 12.020990  55.413001 -14.032000    12.020990  55.413001 -14.032000 
+ 11.977990  60.545001 -14.464000    11.977990  60.545001 -14.464000 
+ 11.935990  65.677001 -14.896000    11.935990  65.677001 -14.896000 
+ 11.892990  70.808001 -15.328000    11.892990  70.808001 -15.328000 
+ 16.101990  60.319002 -17.539000    16.101990  60.319002 -17.539000 
+ 16.059990  65.451002 -17.972000    16.059990  65.451002 -17.972000 
+]
+
+NORMAL_VECTOR HBA0
+(0,2) [   0.598753   0.072099   0.797682 ]
+
+ROTATION_MATRIX HBA0
+(0,2) x (0,2) [
+ -0.1195950000  -0.7919540000   0.5987530000 
+  0.9928230000  -0.0954190000   0.0720990000 
+  0.0000330000   0.6030780000   0.7976820000 
+]
+
+HBA0
+(0,2) [ 3826637.377700000 461227.392088000 5064829.162 ]
+
+NORMAL_VECTOR HBA1
+(0,2) [   0.598753   0.072099   0.797682 ]
+
+ROTATION_MATRIX HBA1
+(0,2) x (0,2) [
+ -0.1195950000  -0.7919540000   0.5987530000 
+  0.9928230000  -0.0954190000   0.0720990000 
+  0.0000330000   0.6030780000   0.7976820000 
+]
+
+HBA1
+(0,2) [ 3826648.917690000 461354.288089000 5064809.031 ]
diff --git a/RTCP/Cobalt/OutputProc/test/tTBB_Writer-transient.in_1/CS013-AntennaField.conf b/RTCP/Cobalt/OutputProc/test/tTBB_Writer-transient.in_1/CS013-AntennaField.conf
new file mode 100644
index 0000000000000000000000000000000000000000..e1404b3b4fc05f389cabc75116468f3a2bde7ea3
--- /dev/null
+++ b/RTCP/Cobalt/OutputProc/test/tTBB_Writer-transient.in_1/CS013-AntennaField.conf
@@ -0,0 +1,196 @@
+# Blitz-0.10 formatted
+#
+# AntennaPositions for CS013
+# ITRF2005 target_date = 2015.5
+# Created: 2015-01-20 21:24:07
+#
+
+NORMAL_VECTOR LBA
+(0,2) [   0.598753   0.072099   0.797682 ]
+
+ROTATION_MATRIX LBA
+(0,2) x (0,2) [
+ -0.1195950000  -0.7919540000   0.5987530000 
+  0.9928230000  -0.0954190000   0.0720990000 
+  0.0000330000   0.6030780000   0.7976820000 
+]
+
+LBA
+(0,2) [ 3826346.221730000 460792.158060000 5065087.164 ]
+(0,95) x (0,1) x (0,2) [
+  0.000000   0.000000   0.000000     0.000000   0.000000   0.000000 
+ -2.019000  -0.243000   1.538000    -2.019000  -0.243000   1.538000 
+ -1.338000   2.105000   0.814000    -1.338000   2.105000   0.814000 
+  0.800000   2.363000  -0.814000     0.800000   2.363000  -0.814000 
+  2.019000   0.243001  -1.538000     2.019000   0.243001  -1.538000 
+  1.338000  -2.104999  -0.814000     1.338000  -2.104999  -0.814000 
+ -0.800000  -2.363000   0.814000    -0.800000  -2.363000   0.814000 
+  2.364000  -5.131999  -1.311000     2.364000  -5.131999  -1.311000 
+ -0.759000  -5.647000   1.081000    -0.759000  -5.647000   1.081000 
+ -3.528000  -3.521000   2.966000    -3.528000  -3.521000   2.966000 
+ -4.645000   0.253000   3.464000    -4.645000   0.253000   3.464000 
+ -3.589000   3.909000   2.341000    -3.589000   3.909000   2.341000 
+ -0.853000   5.735000   0.122000    -0.853000   5.735000   0.122000 
+  2.282000   4.878001  -2.153000     2.282000   4.878001  -2.153000 
+  4.349000   1.739001  -3.421000     4.349000   1.739001  -3.421000 
+  4.381000  -2.214999  -3.088000     4.381000  -2.214999  -3.088000 
+  6.802000  -4.298999  -4.717000     6.802000  -4.298999  -4.717000 
+  5.486000  -7.465999  -3.443000     5.486000  -7.465999  -3.443000 
+  2.155000 -10.073999  -0.707000     2.155000 -10.073999  -0.707000 
+ -3.624000  -8.747000   3.511000    -3.624000  -8.747000   3.511000 
+ -5.751000  -6.778000   4.929000    -5.751000  -6.778000   4.929000 
+ -7.565000  -3.023000   5.952000    -7.565000  -3.023000   5.952000 
+ -7.377000   1.200000   5.429000    -7.377000   1.200000   5.429000 
+ -5.394000   6.284000   3.481000    -5.394000   6.284000   3.481000 
+ -2.685000   9.472000   1.159000    -2.685000   9.472000   1.159000 
+  0.780000   9.948000  -1.484000     0.780000   9.948000  -1.484000 
+  3.565000   7.907001  -3.391000     3.565000   7.907001  -3.391000 
+  6.220000   4.201001  -5.048000     6.220000   4.201001  -5.048000 
+  7.371000  -0.296999  -5.506000     7.371000  -0.296999  -5.506000 
+  9.954000  -7.808999  -6.766000     9.954000  -7.808999  -6.766000 
+  8.384000 -10.966999  -5.302000     8.384000 -10.966999  -5.302000 
+  6.162000 -12.251999  -3.518000     6.162000 -12.251999  -3.518000 
+ -0.152000 -13.128000   1.301000    -0.152000 -13.128000   1.301000 
+ -2.127000 -14.688000   2.924000    -2.127000 -14.688000   2.924000 
+ -6.827000  -9.732000   6.004000    -6.827000  -9.732000   6.004000 
+ -9.268000  -5.525000   7.456000    -9.268000  -5.525000   7.456000 
+-11.990000  -1.274001   9.115000   -11.990000  -1.274001   9.115000 
+-10.788000   1.634999   7.950000   -10.788000   1.634999   7.950000 
+ -9.515000   6.010999   6.599000    -9.515000   6.010999   6.599000 
+ -6.022000  11.235000   3.505000    -6.022000  11.235000   3.505000 
+ -4.306000  12.895000   2.067000    -4.306000  12.895000   2.067000 
+ -0.065000  13.217000  -1.146000    -0.065000  13.217000  -1.146000 
+  3.084000  14.339001  -3.611000     3.084000  14.339001  -3.611000 
+  8.659000   8.494001  -7.267000     8.659000   8.494001  -7.267000 
+ 10.195000   4.913001  -8.097000    10.195000   4.913001  -8.097000 
+ 11.595000  -0.358999  -8.671000    11.595000  -0.358999  -8.671000 
+ -7.780010  64.587000   0.002000    -7.780010  64.587000   0.002000 
+ 51.520000   6.207005 -39.233000    51.520000   6.207005 -39.233000 
+ 14.224000  -3.588998 -10.352000    14.224000  -3.588998 -10.352000 
+ 15.691000  -6.145998 -11.222000    15.691000  -6.145998 -11.222000 
+  8.279000 -18.062999  -4.582000     8.279000 -18.062999  -4.582000 
+ -4.581000 -18.591000   5.119000    -4.581000 -18.591000   5.119000 
+ -8.390000 -17.045000   7.838000    -8.390000 -17.045000   7.838000 
+-13.459000  -6.389001  10.680000   -13.459000  -6.389001  10.680000 
+-13.522000   6.845999   9.531000   -13.522000   6.845999   9.531000 
+-12.131000  14.491999   7.796000   -12.131000  14.491999   7.796000 
+ -1.097000  18.015000  -0.805000    -1.097000  18.015000  -0.805000 
+  5.427000  18.232001  -5.721000     5.427000  18.232001  -5.721000 
+ 11.432000  11.311001  -9.603000    11.432000  11.311001  -9.603000 
+ 17.909000   9.575002 -14.308000    17.909000   9.575002 -14.308000 
+ 19.953000  -3.272998 -14.681000    19.953000  -3.272998 -14.681000 
+ 16.842000 -15.289998 -11.260000    16.842000 -15.289998 -11.260000 
+ 13.673000 -19.923998  -8.463000    13.673000 -19.923998  -8.463000 
+  8.509000 -24.998999  -4.128000     8.509000 -24.998999  -4.128000 
+ -5.559000 -22.465000   6.203000    -5.559000 -22.465000   6.203000 
+-11.450000 -18.997001  10.311000   -11.450000 -18.997001  10.311000 
+-19.331000  -8.752001  15.301000   -19.331000  -8.752001  15.301000 
+-19.869000   5.422998  14.424000   -19.869000   5.422998  14.424000 
+-18.025000  14.279999  12.239000   -18.025000  14.279999  12.239000 
+-10.873000  21.379999   6.229000   -10.873000  21.379999   6.229000 
+  1.023000  26.816000  -3.192000     1.023000  26.816000  -3.192000 
+ 14.212000  19.348002 -12.417000    14.212000  19.348002 -12.417000 
+ 24.668000  14.137003 -19.794000    24.668000  14.137003 -19.794000 
+ 25.123000  -0.724997 -18.792000    25.123000  -0.724997 -18.792000 
+ 22.679000 -14.796997 -15.685000    22.679000 -14.796997 -15.685000 
+ 20.222000 -21.997998 -13.191000    20.222000 -21.997998 -13.191000 
+  7.169000 -30.651999  -2.611000     7.169000 -30.651999  -2.611000 
+ -7.125000 -32.377000   8.274000    -7.125000 -32.377000   8.274000 
+-15.985000 -26.441001  14.389000   -15.985000 -26.441001  14.389000 
+-18.672000 -17.549001  15.602000   -18.672000 -17.549001  15.602000 
+-26.614000  -6.273002  20.544000   -26.614000  -6.273002  20.544000 
+-25.737000  12.574998  18.182000   -25.737000  12.574998  18.182000 
+-22.461000  20.300998  15.025000   -22.461000  20.300998  15.025000 
+-13.535000  31.074999   7.351000   -13.535000  31.074999   7.351000 
+ -6.980000  31.482000   2.394000    -6.980000  31.482000   2.394000 
+  9.526000  30.326001  -9.891000     9.526000  30.326001  -9.891000 
+ 13.031000  25.015002 -12.042000    13.031000  25.015002 -12.042000 
+ 16.768000  28.949002 -15.203000    16.768000  28.949002 -15.203000 
+ 33.368000  -5.313996 -24.566000    33.368000  -5.313996 -24.566000 
+ 24.293000 -27.622997 -15.738000    24.293000 -27.622997 -15.738000 
+ 12.093010 -39.823998  -5.478000    12.093010 -39.823998  -5.478000 
+ -0.758000 -40.093000   4.192000    -0.758000 -40.093000   4.192000 
+-30.677000 -12.969003  24.199000   -30.677000 -12.969003  24.199000 
+-28.718000   9.050998  20.738000   -28.718000   9.050998  20.738000 
+-27.383000  25.180998  18.278000   -27.383000  25.180998  18.278000 
+  5.088000  37.759001  -7.232000     5.088000  37.759001  -7.232000 
+]
+
+HBA
+(0,2) [ 3826360.485730000 460815.243062000 5065074.371 ]
+(0,47) x (0,1) x (0,2) [
+-50.283010  48.846995  33.328000   -50.283010  48.846995  33.328000 
+-47.346010  52.249995  30.816000   -47.346010  52.249995  30.816000 
+-50.325010  41.595995  34.015000   -50.325010  41.595995  34.015000 
+-47.388010  44.998995  31.502000   -47.388010  44.998995  31.502000 
+-44.449010  48.401995  28.989000   -44.449010  48.401995  28.989000 
+-41.512010  51.803996  26.477000   -41.512010  51.803996  26.477000 
+-50.367010  34.344995  34.702000   -50.367010  34.344995  34.702000 
+-47.429010  37.748995  32.189000   -47.429010  37.748995  32.189000 
+-44.492010  41.150995  29.677000   -44.492010  41.150995  29.677000 
+-41.554010  44.553996  27.164000   -41.554010  44.553996  27.164000 
+-38.617010  47.956996  24.651000   -38.617010  47.956996  24.651000 
+-35.679010  51.359996  22.138000   -35.679010  51.359996  22.138000 
+-47.472010  30.496995  32.876000   -47.472010  30.496995  32.876000 
+-44.534010  33.899995  30.363000   -44.534010  33.899995  30.363000 
+-41.596010  37.302996  27.851000   -41.596010  37.302996  27.851000 
+-38.658010  40.705996  25.338000   -38.658010  40.705996  25.338000 
+-35.721010  44.108996  22.826000   -35.721010  44.108996  22.826000 
+-32.783010  47.512997  20.313000   -32.783010  47.512997  20.313000 
+-41.638010  30.052996  28.538000   -41.638010  30.052996  28.538000 
+-38.701010  33.455996  26.025000   -38.701010  33.455996  26.025000 
+-35.763010  36.858996  23.512000   -35.763010  36.858996  23.512000 
+-32.826010  40.261997  21.000000   -32.826010  40.261997  21.000000 
+-35.805010  29.607996  24.199000   -35.805010  29.607996  24.199000 
+-32.867010  33.009997  21.687000   -32.867010  33.009997  21.687000 
+ 32.866000 -33.010997 -21.686000    32.866000 -33.010997 -21.686000 
+ 35.803000 -29.607997 -24.198000    35.803000 -29.607997 -24.198000 
+ 32.824000 -40.261997 -20.999000    32.824000 -40.261997 -20.999000 
+ 35.761000 -36.858997 -23.512000    35.761000 -36.858997 -23.512000 
+ 38.699000 -33.455997 -26.024990    38.699000 -33.455997 -26.024990 
+ 41.637000 -30.052996 -28.536990    41.637000 -30.052996 -28.536990 
+ 32.781010 -47.512997 -20.312000    32.781010 -47.512997 -20.312000 
+ 35.719010 -44.108997 -22.824990    35.719010 -44.108997 -22.824990 
+ 38.657000 -40.705997 -25.336990    38.657000 -40.705997 -25.336990 
+ 41.595000 -37.302996 -27.849990    41.595000 -37.302996 -27.849990 
+ 44.532000 -33.899996 -30.362990    44.532000 -33.899996 -30.362990 
+ 47.470000 -30.497996 -32.875990    47.470000 -30.497996 -32.875990 
+ 35.677010 -51.359997 -22.137990    35.677010 -51.359997 -22.137990 
+ 38.615010 -47.956997 -24.650990    38.615010 -47.956997 -24.650990 
+ 41.552010 -44.553996 -27.162990    41.552010 -44.553996 -27.162990 
+ 44.490010 -41.151996 -29.675990    44.490010 -41.151996 -29.675990 
+ 47.428010 -37.748996 -32.187990    47.428010 -37.748996 -32.187990 
+ 50.366000 -34.344995 -34.700990    50.366000 -34.344995 -34.700990 
+ 41.510010 -51.803996 -26.475990    41.510010 -51.803996 -26.475990 
+ 44.448010 -48.401996 -28.988990    44.448010 -48.401996 -28.988990 
+ 47.386010 -44.998996 -31.501990    47.386010 -44.998996 -31.501990 
+ 50.323010 -41.595995 -34.013990    50.323010 -41.595995 -34.013990 
+ 47.344010 -52.249996 -30.814990    47.344010 -52.249996 -30.814990 
+ 50.281010 -48.846995 -33.326990    50.281010 -48.846995 -33.326990 
+]
+
+NORMAL_VECTOR HBA0
+(0,2) [   0.598753   0.072099   0.797682 ]
+
+ROTATION_MATRIX HBA0
+(0,2) x (0,2) [
+ -0.1195950000  -0.7919540000   0.5987530000 
+  0.9928230000  -0.0954190000   0.0720990000 
+  0.0000330000   0.6030780000   0.7976820000 
+]
+
+HBA0
+(0,2) [ 3826318.910720000 460856.172058000 5065101.878 ]
+
+NORMAL_VECTOR HBA1
+(0,2) [   0.598753   0.072099   0.797682 ]
+
+ROTATION_MATRIX HBA1
+(0,2) x (0,2) [
+ -0.1195950000  -0.7919540000   0.5987530000 
+  0.9928230000  -0.0954190000   0.0720990000 
+  0.0000330000   0.6030780000   0.7976820000 
+]
+
+HBA1
+(0,2) [ 3826402.059740000 460774.314066000 5065046.864 ]
diff --git a/RTCP/Cobalt/OutputProc/test/tTBB_Writer-transient.in_1/L121212_CS011_D20110719T110541.036Z_tbb.h5.selected-attribs.txt b/RTCP/Cobalt/OutputProc/test/tTBB_Writer-transient.in_1/L121212_CS011_D20110719T110541.036Z_tbb.h5.selected-attribs.txt
new file mode 100644
index 0000000000000000000000000000000000000000..f820af50b66c209a152e45987b2508b80f83bc11
--- /dev/null
+++ b/RTCP/Cobalt/OutputProc/test/tTBB_Writer-transient.in_1/L121212_CS011_D20110719T110541.036Z_tbb.h5.selected-attribs.txt
@@ -0,0 +1,66 @@
+HDF5 "L121212_CS011_D20110719T110541.036Z_tbb.h5" {
+ATTRIBUTE "TELESCOPE" {
+   DATATYPE  H5T_STRING {
+      STRSIZE H5T_VARIABLE;
+      STRPAD H5T_STR_NULLTERM;
+      CSET H5T_CSET_ASCII;
+      CTYPE H5T_C_S1;
+   }
+   DATASPACE  SCALAR
+   DATA {
+   (0): "LOFAR"
+   }
+}
+ATTRIBUTE "OPERATING_MODE" {
+   DATATYPE  H5T_STRING {
+      STRSIZE H5T_VARIABLE;
+      STRPAD H5T_STR_NULLTERM;
+      CSET H5T_CSET_ASCII;
+      CTYPE H5T_C_S1;
+   }
+   DATASPACE  SCALAR
+   DATA {
+   (0): "transient"
+   }
+}
+ATTRIBUTE "STATION_NAME" {
+   DATATYPE  H5T_STRING {
+      STRSIZE H5T_VARIABLE;
+      STRPAD H5T_STR_NULLTERM;
+      CSET H5T_CSET_ASCII;
+      CTYPE H5T_C_S1;
+   }
+   DATASPACE  SCALAR
+   DATA {
+   (0): "CS011"
+   }
+}
+ATTRIBUTE "STATION_POSITION" {
+   DATATYPE  H5T_IEEE_F64LE
+   DATASPACE  SIMPLE { ( 3 ) / ( 3 ) }
+   DATA {
+   (0): 3.82664e+06, 461291, 5.06482e+06
+   }
+}
+ATTRIBUTE "DATA_LENGTH" {
+   DATATYPE  H5T_STD_U64LE
+   DATASPACE  SCALAR
+   DATA {
+   (0): 1024000
+   }
+}
+ATTRIBUTE "SAMPLE_NUMBER" {
+   DATATYPE  H5T_STD_U32LE
+   DATASPACE  SCALAR
+   DATA {
+   (0): 7284224
+   }
+}
+ATTRIBUTE "TIME" {
+   DATATYPE  H5T_STD_U32LE
+   DATASPACE  SCALAR
+   DATA {
+   (0): 1311073541
+   }
+}
+}
diff --git a/RTCP/Cobalt/OutputProc/test/tTBB_Writer-transient.in_1/rw_20110719_110541_1110.dat b/RTCP/Cobalt/OutputProc/test/tTBB_Writer-transient.in_1/rw_20110719_110541_1110.dat
new file mode 100644
index 0000000000000000000000000000000000000000..85e5cb3ef7447ff8763f1564ae7a20306f22832d
Binary files /dev/null and b/RTCP/Cobalt/OutputProc/test/tTBB_Writer-transient.in_1/rw_20110719_110541_1110.dat differ
diff --git a/RTCP/Cobalt/OutputProc/test/tTBB_Writer-transient.in_1/tTBB_Writer-transient-refout.raw b/RTCP/Cobalt/OutputProc/test/tTBB_Writer-transient.in_1/tTBB_Writer-transient-refout.raw
new file mode 100644
index 0000000000000000000000000000000000000000..fe9c5debb8285b8b6995f44f34935edb9f169704
Binary files /dev/null and b/RTCP/Cobalt/OutputProc/test/tTBB_Writer-transient.in_1/tTBB_Writer-transient-refout.raw differ
diff --git a/RTCP/Cobalt/OutputProc/test/tTBB_Writer-transient.parset b/RTCP/Cobalt/OutputProc/test/tTBB_Writer-transient.parset
index f79495fdb130d6d16d34d5179bab52d95d700a77..360778dcce53884b5f8467cdd206d7f3b7934e17 100644
--- a/RTCP/Cobalt/OutputProc/test/tTBB_Writer-transient.parset
+++ b/RTCP/Cobalt/OutputProc/test/tTBB_Writer-transient.parset
@@ -1,95 +1,47 @@
-ApplCtrl.application = CorrAppl
-ApplCtrl.procesOrder = []
-ApplCtrl.processes = [CorrProc]
-ApplCtrl.resultfile = '/opt/lofar/share/ACC_CCU001:OnlineControl[0]{59640}_CorrAppl_result.param'
-ApplCtrl.timeout_createsubsets = 30s
-ApplCtrl.timeout_define = 30s
-ApplCtrl.timeout_info = 30s
-ApplCtrl.timeout_init = 30s
-ApplCtrl.timeout_kill = 30s
-ApplCtrl.timeout_pause = 90s
-ApplCtrl.timeout_quit = 10s
-ApplCtrl.timeout_recover = 30s
-ApplCtrl.timeout_reinit = 30s
-ApplCtrl.timeout_release = 30s
-ApplCtrl.timeout_run = 90s
-ApplCtrl.timeout_snapshot = 30s
-ApplCtrl.timeout_startup = 30s
-CorrAppl.CorrProc._ACnode = bgfen0
-CorrAppl.CorrProc._ACport = 3922
-CorrAppl.CorrProc._executable = CN_Processing
-CorrAppl.CorrProc._hostname = bgstfen
-CorrAppl.CorrProc._nodes = []
-CorrAppl.CorrProc._startstopType = bgl
-CorrAppl.CorrProc.workingdir = /opt/lofar/bin/
-CorrAppl._hostname = bgstfen
-CorrAppl.extraInfo = [OLAP,PIC]
-CorrAppl.procesOrder = []
-CorrAppl.processes = [CorrProc]
-OLAP.BeamsAreTransposed = True
-OLAP.CNProc.coresPerPset = 64
-OLAP.CNProc.integrationSteps = 3072
-OLAP.CNProc.nrPPFTaps = 16
-OLAP.CNProc.partition = R00
-OLAP.CNProc.phaseOnePsets = [46,34,36,38,33,35,37,50,48,32,39,42,51,44,58,41,40,54,43,45,26,47,52,55,23,49,60,62,30,53,63,31]
-OLAP.CNProc.phaseOneTwoCores = [0..63]
-OLAP.CNProc.phaseThreeCores = [0..63]
-OLAP.CNProc.phaseThreePsets = [0..63]
-OLAP.CNProc.phaseTwoPsets = [0..63]
-OLAP.CNProc.tabList = []
-OLAP.CNProc.usedCores = [0..63]
-Cobalt.BeamFormer.CoherentStokes.nrChannelsPerSubband = 16
-Cobalt.BeamFormer.CoherentStokes.subbandsPerFile = 244
-Cobalt.BeamFormer.CoherentStokes.timeIntegrationFactor = 64
-Cobalt.BeamFormer.CoherentStokes.which = I
-Cobalt.BeamFormer.IncoherentStokes.nrChannelsPerSubband = 16
-Cobalt.BeamFormer.IncoherentStokes.subbandsPerFile = 244
-Cobalt.BeamFormer.IncoherentStokes.timeIntegrationFactor = 64
-Cobalt.BeamFormer.IncoherentStokes.which = I
-OLAP.Correlator.integrationTime = 1
-OLAP.DelayComp.nrCalcDelays = 16
-OLAP.DelayComp.positionType = ITRF
-OLAP.IONProc.PLC_controlled = T
-Cobalt.Correlator.nrBlocksPerIntegration = 4
-OLAP.IONProc.psetList = [10.170.0.1,10.170.0.2,10.170.0.5,10.170.0.6,10.170.0.9,10.170.0.10,10.170.0.13,10.170.0.14,10.170.0.17,10.170.0.18,10.170.0.21,10.170.0.22,10.170.0.25,10.170.0.26,10.170.0.29,10.170.0.30,10.170.0.33,10.170.0.34,10.170.0.37,10.170.0.38,10.170.0.41,10.170.0.42,10.170.0.45,10.170.0.46,10.170.0.49,10.170.0.50,10.170.0.53,10.170.0.54,10.170.0.57,10.170.0.58,10.170.0.61,10.170.0.62,10.170.0.129,10.170.0.130,10.170.0.133,10.170.0.134,10.170.0.137,10.170.0.138,10.170.0.141,10.170.0.142,10.170.0.145,10.170.0.146,10.170.0.149,10.170.0.150,10.170.0.153,10.170.0.154,10.170.0.157,10.170.0.158,10.170.0.161,10.170.0.162,10.170.0.165,10.170.0.166,10.170.0.169,10.170.0.170,10.170.0.173,10.170.0.174,10.170.0.177,10.170.0.178,10.170.0.181,10.170.0.182,10.170.0.185,10.170.0.186,10.170.0.189,10.170.0.190]
-OLAP.IncoherentStokesAreTransposed = True
-OLAP.OLAP_Conn.IONProc_CNProc_Transport = FCNP
-OLAP.OLAP_Conn.IONProc_Storage_Transport = TCP
-OLAP.PPF = True
-Cobalt.BeamFormer.flysEye = false
-OLAP.PencilInfo.storageNodeList = [0,1]
-OLAP.Storage.AntennaFieldsDir = /data/home/lofarsys/production/lofar/etc/StaticMetaData
-OLAP.Storage.AntennaSetsConf = /data/home/lofarsys/production/lofar/etc/AntennaSets.conf
-OLAP.Storage.HBADeltasDir = /data/home/lofarsys/production/lofar/etc/StaticMetaData
-OLAP.Storage.hosts = [locus072,locus088]
-OLAP.Storage.msWriter = /data/home/lofarsys/production/lofar/bin/Storage_main
-OLAP.Storage.sshIdentityFile = /globalhome/lofarsystem/.ssh/id_rsa
-OLAP.Storage.targetDirectory = /data
-OLAP.Storage.userName = lofarsys
-OLAP.StorageProc.subbandsPerMS = 1
-Cobalt.BeamFormer.coherentDedisperseChannels = false
+Observation.TBB.TBBsetting.RCUs=[]
+Observation.TBB.TBBsetting.baselevel=127
+Observation.TBB.TBBsetting.filter=0
+Observation.TBB.TBBsetting.filter0_coeff0=0
+Observation.TBB.TBBsetting.filter0_coeff1=0
+Observation.TBB.TBBsetting.filter0_coeff2=0
+Observation.TBB.TBBsetting.filter0_coeff3=0
+Observation.TBB.TBBsetting.filter1_coeff0=0
+Observation.TBB.TBBsetting.filter1_coeff1=0
+Observation.TBB.TBBsetting.filter1_coeff2=0
+Observation.TBB.TBBsetting.filter1_coeff3=0
+Observation.TBB.TBBsetting.operatingMode=1  # 1: transient mode, 2: spectral mode
+Observation.TBB.TBBsetting.startlevel=7
+Observation.TBB.TBBsetting.stoplevel=7
+Observation.TBB.TBBsetting.subbandList=[]  # required for spectral mode
+Observation.TBB.TBBsetting.triggerMode=1
+Observation.TBB.TBBsetting.window=1M
+
+Observation.ObservationControl.StationControl.TBBControl.CoincidenceTime=0
+Observation.ObservationControl.StationControl.TBBControl.DoDirectionFit=none
+Observation.ObservationControl.StationControl.TBBControl.MaxFitVariance=0
+Observation.ObservationControl.StationControl.TBBControl.MinElevation=0
+Observation.ObservationControl.StationControl.TBBControl.NoCoincChann=0
+Observation.ObservationControl.StationControl.TBBControl.ParamExtension=
+
+Cobalt.realTime = true
+Observation.ObsID = 121212
+Observation.momID = 8
+Cobalt.commandStream = null:
+Observation.startTime = '2011-07-19 11:00:00'
+Observation.stopTime = '2011-07-19 11:15:00'
+Observation.sampleClock = 200
+Observation.nrBitsPerSample = 8
 Cobalt.correctBandPass = true
-Cobalt.correctClocks = T
+Cobalt.correctClocks = true
+Cobalt.BeamFormer.coherentDedisperseChannels = false
 Cobalt.delayCompensation = true
-OLAP.dispersionMeasure = 0
-OLAP.maxNetworkDelay = 0.25
-Observation.nrBitsPerSample = 16
-OLAP.nrPsets = 64
-OLAP.nrSecondsOfBuffer = 2.5
-OLAP.nrSubbandsPerFrame = 61
-OLAP.nrTimesInFrame = 16
-Cobalt.realTime = true
-OLAP.storageNodeList = [122*0,122*1]
-OLAP.storageStationNames = [CS001LBA,CS002LBA,CS003LBA,CS004LBA,CS005LBA,CS006LBA,CS007LBA,CS011LBA,CS017LBA,CS021LBA,CS024LBA,CS026LBA,CS028LBA,CS030LBA,CS031LBA,CS032LBA,CS101LBA,CS103LBA,CS201LBA,CS301LBA,CS302LBA,CS401LBA,CS501LBA,RS106LBA,RS205LBA,RS208LBA,RS306LBA,RS307LBA,RS406LBA,RS503LBA,RS508LBA,RS509LBA]
-OLAP.tiedArrayStationNames = []
-Observation.AnaBeam.angle1 = 0
-Observation.AnaBeam.angle2 = 0
-Observation.AnaBeam.directionType = J2000
-Observation.AnaBeam.duration = 0
-Observation.AnaBeam.maximizeDuration = false
-Observation.AnaBeam.rank = 1
-Observation.AnaBeam.startTime = 
-Observation.AnaBeam.target = 
+Observation.referencePhaseCenter = [3826577.066,461022.948,5064892.786]
+Observation.antennaArray = HBA
+Observation.antennaSet = HBA_DUAL
+Observation.bandFilter = HBA_110_190
+Observation.nrPolarisations = 2
+Observation.nrBeams = 2
+
 Observation.Beam[0].TiedArrayBeam[0].angle1 = 0.0
 Observation.Beam[0].TiedArrayBeam[0].angle2 = 0.0
 Observation.Beam[0].TiedArrayBeam[0].coherent = true
@@ -110,884 +62,145 @@ Observation.Beam[0].beamletList = []
 Observation.Beam[0].directionType = J2000
 Observation.Beam[0].duration = 900
 Observation.Beam[0].maximizeDuration = false
-Observation.Beam[0].momID = 119965
+Observation.Beam[0].momID = 8
 Observation.Beam[0].nrTabRings = 0
 Observation.Beam[0].nrTiedArrayBeams = 2
-Observation.Beam[0].startTime = 
-Observation.Beam[0].subbandList = [175..418]
+Observation.Beam[0].startTime =
+Observation.Beam[0].subbandList = [100..101]
 Observation.Beam[0].tabRingSize = 0.0
 Observation.Beam[0].target = B0329+54
-Observation.Beamformer.stationList = []
-Observation.Campaign.CO_I = 'Pizzo, Dr. Roberto Francesco'
-Observation.Campaign.PI = 'Polatidis, Dr Antonios'
-Observation.Campaign.contact = 'Polatidis, Dr Antonios'
-Observation.Campaign.name = 2012LOFAROBS
-Observation.Campaign.title = 2012LOFAROBS
-Observation.DataProducts.Input_Beamformed.dirmask = 
-Observation.DataProducts.Input_Beamformed.enabled = false
-Observation.DataProducts.Input_Beamformed.filenames = []
-Observation.DataProducts.Input_Beamformed.identifications = []
-Observation.DataProducts.Input_Beamformed.locations = []
-Observation.DataProducts.Input_Beamformed.mountpoints = []
-Observation.DataProducts.Input_Beamformed.namemask = 
-Observation.DataProducts.Input_Beamformed.skip = []
-Observation.DataProducts.Input_CoherentStokes.dirmask = 
-Observation.DataProducts.Input_CoherentStokes.enabled = false
-Observation.DataProducts.Input_CoherentStokes.filenames = []
-Observation.DataProducts.Input_CoherentStokes.identifications = []
-Observation.DataProducts.Input_CoherentStokes.locations = []
-Observation.DataProducts.Input_CoherentStokes.mountpoints = []
-Observation.DataProducts.Input_CoherentStokes.namemask = 
-Observation.DataProducts.Input_CoherentStokes.skip = []
-Observation.DataProducts.Input_Correlated.dirmask = 
-Observation.DataProducts.Input_Correlated.enabled = false
-Observation.DataProducts.Input_Correlated.filenames = []
-Observation.DataProducts.Input_Correlated.identifications = []
-Observation.DataProducts.Input_Correlated.locations = []
-Observation.DataProducts.Input_Correlated.mountpoints = []
-Observation.DataProducts.Input_Correlated.namemask = 
-Observation.DataProducts.Input_Correlated.skip = []
-Observation.DataProducts.Input_IncoherentStokes.dirmask = 
-Observation.DataProducts.Input_IncoherentStokes.enabled = false
-Observation.DataProducts.Input_IncoherentStokes.filenames = []
-Observation.DataProducts.Input_IncoherentStokes.identifications = []
-Observation.DataProducts.Input_IncoherentStokes.locations = []
-Observation.DataProducts.Input_IncoherentStokes.mountpoints = []
-Observation.DataProducts.Input_IncoherentStokes.namemask = 
-Observation.DataProducts.Input_IncoherentStokes.skip = []
-Observation.DataProducts.Input_InstrumentModel.dirmask = 
-Observation.DataProducts.Input_InstrumentModel.enabled = false
-Observation.DataProducts.Input_InstrumentModel.filenames = []
-Observation.DataProducts.Input_InstrumentModel.identifications = []
-Observation.DataProducts.Input_InstrumentModel.locations = []
-Observation.DataProducts.Input_InstrumentModel.mountpoints = []
-Observation.DataProducts.Input_InstrumentModel.namemask = 
-Observation.DataProducts.Input_InstrumentModel.skip = []
-Observation.DataProducts.Input_SkyImage.dirmask = 
-Observation.DataProducts.Input_SkyImage.enabled = false
-Observation.DataProducts.Input_SkyImage.filenames = []
-Observation.DataProducts.Input_SkyImage.identifications = []
-Observation.DataProducts.Input_SkyImage.locations = []
-Observation.DataProducts.Input_SkyImage.mountpoints = []
-Observation.DataProducts.Input_SkyImage.namemask = 
-Observation.DataProducts.Input_SkyImage.skip = []
-Observation.DataProducts.Output_Beamformed.archived = false
-Observation.DataProducts.Output_Beamformed.deleted = false
-Observation.DataProducts.Output_Beamformed.dirmask = 
-Observation.DataProducts.Output_Beamformed.enabled = True
-Observation.DataProducts.Output_Beamformed.filenames = [L59640_SAP000_B000_S0_P000_bf.raw,L59640_SAP000_B001_S0_P000_bf.raw]
-Observation.DataProducts.Output_Beamformed.identifications = []
-Observation.DataProducts.Output_Beamformed.locations = [locus072:/data/L59640/,locus088:/data/L59640/]
-Observation.DataProducts.Output_Beamformed.mountpoints = []
-Observation.DataProducts.Output_Beamformed.namemask = 
-Observation.DataProducts.Output_Beamformed.percentageWritten = []
-Observation.DataProducts.Output_Beamformed.retentiontime = 14
-Observation.DataProducts.Output_Beamformed.skip = []
-Observation.DataProducts.Output_CoherentStokes.archived = false
-Observation.DataProducts.Output_CoherentStokes.deleted = false
-Observation.DataProducts.Output_CoherentStokes.dirmask = L${OBSID}
+
+Observation.Beam[1].TiedArrayBeam[0].angle1 = 0.0
+Observation.Beam[1].TiedArrayBeam[0].angle2 = 0.0
+Observation.Beam[1].TiedArrayBeam[0].coherent = true
+Observation.Beam[1].TiedArrayBeam[0].directionType = J2000
+Observation.Beam[1].TiedArrayBeam[0].dispersionMeasure = 0
+Observation.Beam[1].TiedArrayBeam[0].specificationType = manual
+Observation.Beam[1].TiedArrayBeam[0].stationList = []
+Observation.Beam[1].TiedArrayBeam[1].angle1 = 0.8293449206762021
+Observation.Beam[1].TiedArrayBeam[1].angle2 = 0.8525764650544495
+Observation.Beam[1].TiedArrayBeam[1].coherent = false
+Observation.Beam[1].TiedArrayBeam[1].directionType = J2000
+Observation.Beam[1].TiedArrayBeam[1].dispersionMeasure = 0
+Observation.Beam[1].TiedArrayBeam[1].specificationType = manual
+Observation.Beam[1].TiedArrayBeam[1].stationList = []
+Observation.Beam[1].angle1 = 0.8293449206762021
+Observation.Beam[1].angle2 = 0.8525764650544495
+Observation.Beam[1].beamletList = []
+Observation.Beam[1].directionType = J2000
+Observation.Beam[1].duration = 900
+Observation.Beam[1].maximizeDuration = false
+Observation.Beam[1].momID = 8
+Observation.Beam[1].nrTabRings = 0
+Observation.Beam[1].nrTiedArrayBeams = 2
+Observation.Beam[1].startTime =
+Observation.Beam[1].subbandList = [200..201]
+Observation.Beam[1].tabRingSize = 0.0
+Observation.Beam[1].target = -0.1 test offset from Beam0 (B0329+54)
+
+Observation.AnaBeam.angle1 = 0.9293449206762021
+Observation.AnaBeam.angle2 = 0.9525764650544495
+Observation.AnaBeam.directionType = J2000
+Observation.AnaBeam.duration = 900
+Observation.AnaBeam.maximizeDuration = false
+Observation.AnaBeam.rank = 1
+Observation.AnaBeam.startTime =
+Observation.AnaBeam.target = B0329+54
+
+Cobalt.blockSize=196608
+Observation.VirtualInstrument.stationList = [CS011, CS013]
+
+PIC.Core.CS011HBA.phaseCenter=[3826643.191, 461290.793, 5064819.069]
+PIC.Core.CS011HBA.HBA_JOINED.HBA_110_190.delay.X=7.487948e-06
+PIC.Core.CS011HBA.HBA_JOINED.HBA_110_190.delay.Y=7.488310e-06
+PIC.Core.CS011HBA.HBA_JOINED.HBA_110_190.phase0.X=0.000000e+00
+PIC.Core.CS011HBA.HBA_JOINED.HBA_110_190.phase0.Y=0.000000e+00
+PIC.Core.CS011HBA0.HBA_DUAL_INNER.HBA_110_190.delay.X=7.487901e-06
+PIC.Core.CS011HBA0.HBA_DUAL_INNER.HBA_110_190.delay.Y=7.488469e-06
+PIC.Core.CS011HBA0.HBA_DUAL_INNER.HBA_110_190.phase0.X=0.000000e+00
+PIC.Core.CS011HBA0.HBA_DUAL_INNER.HBA_110_190.phase0.Y=0.000000e+00
+PIC.Core.CS011HBA0.RSP.ports=[udp:cbt003-10GB02:10110, udp:cbt003-10GB02:10111, udp:cbt003-10GB02:10112, udp:cbt003-10GB02:10113]
+PIC.Core.CS011HBA0.RSP.receiver=cbt003_0
+PIC.Core.CS011HBA0.phaseCenter=[3826637.421, 461227.345, 5064829.134]
+PIC.Core.CS011HBA1.HBA_DUAL_INNER.HBA_110_190.delay.X=7.487994e-06
+PIC.Core.CS011HBA1.HBA_DUAL_INNER.HBA_110_190.delay.Y=7.488150e-06
+PIC.Core.CS011HBA1.HBA_DUAL_INNER.HBA_110_190.phase0.X=0.000000e+00
+PIC.Core.CS011HBA1.HBA_DUAL_INNER.HBA_110_190.phase0.Y=0.000000e+00
+PIC.Core.CS011HBA1.RSP.ports=[udp:cbt003-10GB02:10116, udp:cbt003-10GB02:10117, udp:cbt003-10GB02:10118, udp:cbt003-10GB02:10119]
+PIC.Core.CS011HBA1.RSP.receiver=cbt003_0
+PIC.Core.CS011HBA1.phaseCenter=[3826648.961, 461354.241, 5064809.003]
+
+PIC.Core.CS013HBA.phaseCenter=[3826360.529, 460815.196, 5065074.343]
+PIC.Core.CS013HBA.HBA_JOINED.HBA_110_190.delay.X=8.708485e-06
+PIC.Core.CS013HBA.HBA_JOINED.HBA_110_190.delay.Y=8.708511e-06
+PIC.Core.CS013HBA.HBA_JOINED.HBA_110_190.phase0.X=0.000000e+00
+PIC.Core.CS013HBA.HBA_JOINED.HBA_110_190.phase0.Y=0.000000e+00
+PIC.Core.CS013HBA0.HBA_DUAL_INNER.HBA_110_190.delay.X=8.708572e-06
+PIC.Core.CS013HBA0.HBA_DUAL_INNER.HBA_110_190.delay.Y=8.708498e-06
+PIC.Core.CS013HBA0.HBA_DUAL_INNER.HBA_110_190.phase0.X=0.000000e+00
+PIC.Core.CS013HBA0.HBA_DUAL_INNER.HBA_110_190.phase0.Y=0.000000e+00
+PIC.Core.CS013HBA0.RSP.ports=[udp:cbt005-10GB02:10130, udp:cbt005-10GB02:10131, udp:cbt005-10GB02:10132, udp:cbt005-10GB02:10133]
+PIC.Core.CS013HBA0.RSP.receiver=cbt005_0
+PIC.Core.CS013HBA0.phaseCenter=[3826318.954, 460856.125, 5065101.850]
+PIC.Core.CS013HBA1.HBA_DUAL_INNER.HBA_110_190.delay.X=8.708397e-06
+PIC.Core.CS013HBA1.HBA_DUAL_INNER.HBA_110_190.delay.Y=8.708523e-06
+PIC.Core.CS013HBA1.HBA_DUAL_INNER.HBA_110_190.phase0.X=0.000000e+00
+PIC.Core.CS013HBA1.HBA_DUAL_INNER.HBA_110_190.phase0.Y=0.000000e+00
+PIC.Core.CS013HBA1.RSP.ports=[udp:cbt005-10GB02:10136, udp:cbt005-10GB02:10137, udp:cbt005-10GB02:10138, udp:cbt005-10GB02:10139]
+PIC.Core.CS013HBA1.RSP.receiver=cbt005_0
+PIC.Core.CS013HBA1.phaseCenter=[3826402.103, 460774.267, 5065046.836]
+
+Observation.Dataslots.CS011HBA0.DataslotList=[0..121,0..121,0..121,0..119]
+Observation.Dataslots.CS011HBA0.RSPBoardList=[122*0,122*1,122*2,120*3]
+Observation.Dataslots.CS011HBA1.DataslotList=[0..121,0..121,0..121,0..119]
+Observation.Dataslots.CS011HBA1.RSPBoardList=[122*0,122*1,122*2,120*3]
+Observation.Dataslots.CS013HBA0.DataslotList=[0..121,0..121,0..121,0..119]
+Observation.Dataslots.CS013HBA0.RSPBoardList=[122*0,122*1,122*2,120*3]
+Observation.Dataslots.CS013HBA1.DataslotList=[0..121,0..121,0..121,0..119]
+Observation.Dataslots.CS013HBA1.RSPBoardList=[122*0,122*1,122*2,120*3]
+
+Cobalt.Nodes=[cbt009_0, cbt009_1]
+PIC.Core.Cobalt.cbt009_0.cpu=0
+PIC.Core.Cobalt.cbt009_0.gpus=[0, 1]
+PIC.Core.Cobalt.cbt009_0.host=cbt009
+PIC.Core.Cobalt.cbt009_0.mpi_nic=mlx4_0
+PIC.Core.Cobalt.cbt009_0.out_nic=[CEP4:ib0,DRAGNET:ib0]
+PIC.Core.Cobalt.cbt009_1.cpu=1
+PIC.Core.Cobalt.cbt009_1.gpus=[2, 3]
+PIC.Core.Cobalt.cbt009_1.host=cbt009
+PIC.Core.Cobalt.cbt009_1.mpi_nic=mlx4_1
+PIC.Core.Cobalt.cbt009_1.out_nic=[CEP4:ib1,DRAGNET:ib1]
+
+Cobalt.Correlator.nrChannelsPerSubband = 64
+Cobalt.Correlator.nrBlocksPerIntegration = 1
+Cobalt.Correlator.nrIntegrationsPerBlock = 1
+
+Cobalt.BeamFormer.flysEye = false
+Cobalt.BeamFormer.nrDelayCompensationChannels = 256
+Cobalt.BeamFormer.nrHighResolutionChannels = 256
+
+Cobalt.BeamFormer.CoherentStokes.nrChannelsPerSubband = 1
+Cobalt.BeamFormer.CoherentStokes.subbandsPerFile = 20
+Cobalt.BeamFormer.CoherentStokes.timeIntegrationFactor = 2
+Cobalt.BeamFormer.CoherentStokes.which = I
+Cobalt.BeamFormer.IncoherentStokes.nrChannelsPerSubband = 16
+Cobalt.BeamFormer.IncoherentStokes.subbandsPerFile = 512
+Cobalt.BeamFormer.IncoherentStokes.timeIntegrationFactor = 4
+Cobalt.BeamFormer.IncoherentStokes.which = IQUV
+
+Observation.DataProducts.Output_Correlated.enabled = true
+Observation.DataProducts.Output_Correlated.filenames = [L121212_SAP000_SB100_uv.MS, L121212_SAP000_SB101_uv.MS, L121212_SAP000_SB200_uv.MS, L121212_SAP000_SB201_uv.MS]
+Observation.DataProducts.Output_Correlated.locations = [4*CEP4:cpu01.cep4:/data/projects/TT0_000/L121212/uv]
 Observation.DataProducts.Output_CoherentStokes.enabled = true
-Observation.DataProducts.Output_CoherentStokes.filenames = []
-Observation.DataProducts.Output_CoherentStokes.identifications = []
-Observation.DataProducts.Output_CoherentStokes.locations = []
-Observation.DataProducts.Output_CoherentStokes.mountpoints = [locus072:/data]
-Observation.DataProducts.Output_CoherentStokes.namemask = L${OBSID}_SAP${SAP}_B${BEAM}_S${STOKES}_P${PART}_bf.raw
-Observation.DataProducts.Output_CoherentStokes.percentageWritten = []
-Observation.DataProducts.Output_CoherentStokes.retentiontime = 14
-Observation.DataProducts.Output_CoherentStokes.skip = []
-Observation.DataProducts.Output_Correlated.archived = false
-Observation.DataProducts.Output_Correlated.deleted = false
-Observation.DataProducts.Output_Correlated.dirmask = 
-Observation.DataProducts.Output_Correlated.enabled = false
-Observation.DataProducts.Output_Correlated.filenames = []
-Observation.DataProducts.Output_Correlated.identifications = []
-Observation.DataProducts.Output_Correlated.locations = []
-Observation.DataProducts.Output_Correlated.mountpoints = []
-Observation.DataProducts.Output_Correlated.namemask = 
-Observation.DataProducts.Output_Correlated.percentageWritten = []
-Observation.DataProducts.Output_Correlated.retentiontime = 14
-Observation.DataProducts.Output_Correlated.skip = []
-Observation.DataProducts.Output_IncoherentStokes.archived = false
-Observation.DataProducts.Output_IncoherentStokes.deleted = false
-Observation.DataProducts.Output_IncoherentStokes.dirmask = L${OBSID}
+Observation.DataProducts.Output_CoherentStokes.filenames = [L121212_SAP000_B000_S0_P000_bf.h5, L121212_SAP001_B000_S0_P000_bf.h5]
+Observation.DataProducts.Output_CoherentStokes.locations = [2*CEP4:cpu20.cep4:/data/projects/TT0_000/L121212/cs]
 Observation.DataProducts.Output_IncoherentStokes.enabled = true
-Observation.DataProducts.Output_IncoherentStokes.filenames = []
-Observation.DataProducts.Output_IncoherentStokes.identifications = []
-Observation.DataProducts.Output_IncoherentStokes.locations = []
-Observation.DataProducts.Output_IncoherentStokes.mountpoints = [locus088:/data]
-Observation.DataProducts.Output_IncoherentStokes.namemask = L${OBSID}_SAP${SAP}_B${BEAM}_S${STOKES}_P${PART}_bf.raw
-Observation.DataProducts.Output_IncoherentStokes.percentageWritten = []
-Observation.DataProducts.Output_IncoherentStokes.retentiontime = 14
-Observation.DataProducts.Output_IncoherentStokes.skip = []
-Observation.DataProducts.Output_InstrumentModel.archived = false
-Observation.DataProducts.Output_InstrumentModel.deleted = false
-Observation.DataProducts.Output_InstrumentModel.dirmask = 
-Observation.DataProducts.Output_InstrumentModel.enabled = false
-Observation.DataProducts.Output_InstrumentModel.filenames = []
-Observation.DataProducts.Output_InstrumentModel.identifications = []
-Observation.DataProducts.Output_InstrumentModel.locations = []
-Observation.DataProducts.Output_InstrumentModel.mountpoints = []
-Observation.DataProducts.Output_InstrumentModel.namemask = 
-Observation.DataProducts.Output_InstrumentModel.percentageWritten = []
-Observation.DataProducts.Output_InstrumentModel.retentiontime = 14
-Observation.DataProducts.Output_InstrumentModel.skip = []
-Observation.DataProducts.Output_SkyImage.archived = false
-Observation.DataProducts.Output_SkyImage.deleted = false
-Observation.DataProducts.Output_SkyImage.dirmask = 
-Observation.DataProducts.Output_SkyImage.enabled = false
-Observation.DataProducts.Output_SkyImage.filenames = []
-Observation.DataProducts.Output_SkyImage.identifications = []
-Observation.DataProducts.Output_SkyImage.locations = []
-Observation.DataProducts.Output_SkyImage.mountpoints = []
-Observation.DataProducts.Output_SkyImage.namemask = 
-Observation.DataProducts.Output_SkyImage.percentageWritten = []
-Observation.DataProducts.Output_SkyImage.retentiontime = 14
-Observation.DataProducts.Output_SkyImage.skip = []
-Observation.DataProducts.Output_Trigger.dirmask = L${YEAR}_${OBSID}
-Observation.DataProducts.Output_Trigger.enabled = False
-Observation.DataProducts.Output_Trigger.namemask = L${OBSID}_SAP${SAP}_B${BEAM}_S${STOKES}_P${PART}_bf.trigger
-Observation.DataProducts.nrOfOutput_BeamFormed_ = 0
-Observation.DataProducts.nrOfOutput_Correlated_ = 0
-Observation.DataProducts.nrOfOutput_InstrumentModels_ = 0
-Observation.DataProducts.nrOfOutput_SkyImages_ = 0
-Observation.Dataslots.CS001LBA.DataslotList = [0..60,0..60,0..60,0..60]
-Observation.Dataslots.CS001LBA.RSPBoardList = [61*0,61*1,61*2,61*3]
-Observation.Dataslots.CS002LBA.DataslotList = [0..60,0..60,0..60,0..60]
-Observation.Dataslots.CS002LBA.RSPBoardList = [61*0,61*1,61*2,61*3]
-Observation.Dataslots.CS003LBA.DataslotList = [0..60,0..60,0..60,0..60]
-Observation.Dataslots.CS003LBA.RSPBoardList = [61*0,61*1,61*2,61*3]
-Observation.Dataslots.CS004LBA.DataslotList = [0..60,0..60,0..60,0..60]
-Observation.Dataslots.CS004LBA.RSPBoardList = [61*0,61*1,61*2,61*3]
-Observation.Dataslots.CS005LBA.DataslotList = [0..60,0..60,0..60,0..60]
-Observation.Dataslots.CS005LBA.RSPBoardList = [61*0,61*1,61*2,61*3]
-Observation.Dataslots.CS006LBA.DataslotList = [0..60,0..60,0..60,0..60]
-Observation.Dataslots.CS006LBA.RSPBoardList = [61*0,61*1,61*2,61*3]
-Observation.Dataslots.CS007LBA.DataslotList = [0..60,0..60,0..60,0..60]
-Observation.Dataslots.CS007LBA.RSPBoardList = [61*0,61*1,61*2,61*3]
-Observation.Dataslots.CS011LBA.DataslotList = [0..60,0..60,0..60,0..60]
-Observation.Dataslots.CS011LBA.RSPBoardList = [61*0,61*1,61*2,61*3]
-Observation.Dataslots.CS017LBA.DataslotList = [0..60,0..60,0..60,0..60]
-Observation.Dataslots.CS017LBA.RSPBoardList = [61*0,61*1,61*2,61*3]
-Observation.Dataslots.CS021LBA.DataslotList = [0..60,0..60,0..60,0..60]
-Observation.Dataslots.CS021LBA.RSPBoardList = [61*0,61*1,61*2,61*3]
-Observation.Dataslots.CS024LBA.DataslotList = [0..60,0..60,0..60,0..60]
-Observation.Dataslots.CS024LBA.RSPBoardList = [61*0,61*1,61*2,61*3]
-Observation.Dataslots.CS026LBA.DataslotList = [0..60,0..60,0..60,0..60]
-Observation.Dataslots.CS026LBA.RSPBoardList = [61*0,61*1,61*2,61*3]
-Observation.Dataslots.CS028LBA.DataslotList = [0..60,0..60,0..60,0..60]
-Observation.Dataslots.CS028LBA.RSPBoardList = [61*0,61*1,61*2,61*3]
-Observation.Dataslots.CS030LBA.DataslotList = [0..60,0..60,0..60,0..60]
-Observation.Dataslots.CS030LBA.RSPBoardList = [61*0,61*1,61*2,61*3]
-Observation.Dataslots.CS031LBA.DataslotList = [0..60,0..60,0..60,0..60]
-Observation.Dataslots.CS031LBA.RSPBoardList = [61*0,61*1,61*2,61*3]
-Observation.Dataslots.CS032LBA.DataslotList = [0..60,0..60,0..60,0..60]
-Observation.Dataslots.CS032LBA.RSPBoardList = [61*0,61*1,61*2,61*3]
-Observation.Dataslots.CS101LBA.DataslotList = [0..60,0..60,0..60,0..60]
-Observation.Dataslots.CS101LBA.RSPBoardList = [61*0,61*1,61*2,61*3]
-Observation.Dataslots.CS103LBA.DataslotList = [0..60,0..60,0..60,0..60]
-Observation.Dataslots.CS103LBA.RSPBoardList = [61*0,61*1,61*2,61*3]
-Observation.Dataslots.CS201LBA.DataslotList = [0..60,0..60,0..60,0..60]
-Observation.Dataslots.CS201LBA.RSPBoardList = [61*0,61*1,61*2,61*3]
-Observation.Dataslots.CS301LBA.DataslotList = [0..60,0..60,0..60,0..60]
-Observation.Dataslots.CS301LBA.RSPBoardList = [61*0,61*1,61*2,61*3]
-Observation.Dataslots.CS302LBA.DataslotList = [0..60,0..60,0..60,0..60]
-Observation.Dataslots.CS302LBA.RSPBoardList = [61*0,61*1,61*2,61*3]
-Observation.Dataslots.CS401LBA.DataslotList = [0..60,0..60,0..60,0..60]
-Observation.Dataslots.CS401LBA.RSPBoardList = [61*0,61*1,61*2,61*3]
-Observation.Dataslots.CS501LBA.DataslotList = [0..60,0..60,0..60,0..60]
-Observation.Dataslots.CS501LBA.RSPBoardList = [61*0,61*1,61*2,61*3]
-Observation.Dataslots.DataslotInfo.DataslotList = []
-Observation.Dataslots.DataslotInfo.RSPBoardList = []
-Observation.Dataslots.RS106LBA.DataslotList = [0..60,0..60,0..60,0..60]
-Observation.Dataslots.RS106LBA.RSPBoardList = [61*0,61*1,61*2,61*3]
-Observation.Dataslots.RS205LBA.DataslotList = [0..60,0..60,0..60,0..60]
-Observation.Dataslots.RS205LBA.RSPBoardList = [61*0,61*1,61*2,61*3]
-Observation.Dataslots.RS208LBA.DataslotList = [0..60,0..60,0..60,0..60]
-Observation.Dataslots.RS208LBA.RSPBoardList = [61*0,61*1,61*2,61*3]
-Observation.Dataslots.RS306LBA.DataslotList = [0..60,0..60,0..60,0..60]
-Observation.Dataslots.RS306LBA.RSPBoardList = [61*0,61*1,61*2,61*3]
-Observation.Dataslots.RS307LBA.DataslotList = [0..60,0..60,0..60,0..60]
-Observation.Dataslots.RS307LBA.RSPBoardList = [61*0,61*1,61*2,61*3]
-Observation.Dataslots.RS406LBA.DataslotList = [0..60,0..60,0..60,0..60]
-Observation.Dataslots.RS406LBA.RSPBoardList = [61*0,61*1,61*2,61*3]
-Observation.Dataslots.RS503LBA.DataslotList = [0..60,0..60,0..60,0..60]
-Observation.Dataslots.RS503LBA.RSPBoardList = [61*0,61*1,61*2,61*3]
-Observation.Dataslots.RS508LBA.DataslotList = [0..60,0..60,0..60,0..60]
-Observation.Dataslots.RS508LBA.RSPBoardList = [61*0,61*1,61*2,61*3]
-Observation.Dataslots.RS509LBA.DataslotList = [0..60,0..60,0..60,0..60]
-Observation.Dataslots.RS509LBA.RSPBoardList = [61*0,61*1,61*2,61*3]
-Observation.KSPType = surveys
-Observation.ObsID = 59640
-Observation.ObservationControl.OnlineControl.ApplCtrl.application = []
-Observation.ObservationControl.OnlineControl.ApplCtrl.procesOrder = []
-Observation.ObservationControl.OnlineControl.ApplCtrl.processes = []
-Observation.ObservationControl.OnlineControl.ApplCtrl.resultfile = ../log/ACC.result
-Observation.ObservationControl.OnlineControl.ApplCtrl.timeout_createsubsets = 30s
-Observation.ObservationControl.OnlineControl.ApplCtrl.timeout_define = 30s
-Observation.ObservationControl.OnlineControl.ApplCtrl.timeout_info = 30s
-Observation.ObservationControl.OnlineControl.ApplCtrl.timeout_init = 30s
-Observation.ObservationControl.OnlineControl.ApplCtrl.timeout_kill = 30s
-Observation.ObservationControl.OnlineControl.ApplCtrl.timeout_pause = 90s
-Observation.ObservationControl.OnlineControl.ApplCtrl.timeout_quit = 10s
-Observation.ObservationControl.OnlineControl.ApplCtrl.timeout_recover = 30s
-Observation.ObservationControl.OnlineControl.ApplCtrl.timeout_reinit = 30s
-Observation.ObservationControl.OnlineControl.ApplCtrl.timeout_release = 30s
-Observation.ObservationControl.OnlineControl.ApplCtrl.timeout_run = 90s
-Observation.ObservationControl.OnlineControl.ApplCtrl.timeout_snapshot = 30s
-Observation.ObservationControl.OnlineControl.ApplCtrl.timeout_startup = 30s
-Observation.ObservationControl.OnlineControl.CorrAppl.CorrProc._executable = CN_Processing
-Observation.ObservationControl.OnlineControl.CorrAppl.CorrProc._hostname = bgstfen
-Observation.ObservationControl.OnlineControl.CorrAppl.CorrProc._nodes = []
-Observation.ObservationControl.OnlineControl.CorrAppl.CorrProc._startstopType = bgl
-Observation.ObservationControl.OnlineControl.CorrAppl.CorrProc.workingdir = /opt/lofar/bin/
-Observation.ObservationControl.OnlineControl.CorrAppl._hostname = bgstfen
-Observation.ObservationControl.OnlineControl.CorrAppl.extraInfo = [OLAP,PIC]
-Observation.ObservationControl.OnlineControl.CorrAppl.procesOrder = []
-Observation.ObservationControl.OnlineControl.CorrAppl.processes = [CorrProc]
-Observation.ObservationControl.OnlineControl.OLAP.CNProc.coresPerPset = 64
-Observation.ObservationControl.OnlineControl.OLAP.CNProc.integrationSteps = 768
-Observation.ObservationControl.OnlineControl.OLAP.CNProc.nrPPFTaps = 16
-Observation.ObservationControl.OnlineControl.OLAP.CNProc.phaseOnePsets = []
-Observation.ObservationControl.OnlineControl.OLAP.CNProc.phaseThreePsets = []
-Observation.ObservationControl.OnlineControl.OLAP.CNProc.phaseTwoPsets = []
-Observation.ObservationControl.OnlineControl.OLAP.CNProc.usedCores = [0..63]
-Observation.ObservationControl.OnlineControl.Cobalt.BeamFormer.CoherentStokes.nrChannelsPerSubband = 0
-Observation.ObservationControl.OnlineControl.Cobalt.BeamFormer.CoherentStokes.subbandsPerFile = 244
-Observation.ObservationControl.OnlineControl.Cobalt.BeamFormer.CoherentStokes.timeIntegrationFactor = 64
-Observation.ObservationControl.OnlineControl.Cobalt.BeamFormer.CoherentStokes.which = I
-Observation.ObservationControl.OnlineControl.Cobalt.BeamFormer.IncoherentStokes.nrChannelsPerSubband = 0
-Observation.ObservationControl.OnlineControl.Cobalt.BeamFormer.IncoherentStokes.subbandsPerFile = 244
-Observation.ObservationControl.OnlineControl.Cobalt.BeamFormer.IncoherentStokes.timeIntegrationFactor = 64
-Observation.ObservationControl.OnlineControl.Cobalt.BeamFormer.IncoherentStokes.which = I
-Observation.ObservationControl.OnlineControl.OLAP.Correlator.integrationTime = 1
-Observation.ObservationControl.OnlineControl.OLAP.DelayComp.nrCalcDelays = 16
-Observation.ObservationControl.OnlineControl.OLAP.DelayComp.positionType = ITRF
-Observation.ObservationControl.OnlineControl.Cobalt.Correlator.nrBlocksPerIntegration = 30
-Observation.ObservationControl.OnlineControl.OLAP.OLAP_Conn.IONProc_CNProc_Transport = FCNP
-Observation.ObservationControl.OnlineControl.Cobalt.BeamFormer.flysEye = false
-Observation.ObservationControl.OnlineControl.OLAP.StorageProc.subbandsPerMS = 1
-Observation.ObservationControl.OnlineControl.Cobalt.BeamFormer.coherentDedisperseChannels = false
-Observation.ObservationControl.OnlineControl.Cobalt.correctBandPass = true
-Observation.ObservationControl.OnlineControl.Cobalt.delayCompensation = true
-Observation.ObservationControl.OnlineControl.OLAP.maxNetworkDelay = 0.25
-Observation.ObservationControl.OnlineControl.Observation.nrBitsPerSample = 16
-Observation.ObservationControl.OnlineControl.OLAP.nrSecondsOfBuffer = 2.5
-Observation.ObservationControl.OnlineControl.OLAP.nrSubbandsPerFrame = 61
-Observation.ObservationControl.OnlineControl.OLAP.nrTimesInFrame = 16
-Observation.ObservationControl.OnlineControl.Cobalt.realTime = true
-Observation.ObservationControl.OnlineControl.OLAP.storageStationNames = AllStations
-Observation.ObservationControl.OnlineControl._hostname = CCU001
-Observation.ObservationControl.OnlineControl.applOrder = [CorrAppl]
-Observation.ObservationControl.OnlineControl.applications = [CorrAppl]
-Observation.ObservationControl.OnlineControl.inspectionHost = 
-Observation.ObservationControl.OnlineControl.inspectionProgram = 
-Observation.ObservationControl.StationControl.TBBControl.CoincidenceTime = 0
-Observation.ObservationControl.StationControl.TBBControl.DoDirectionFit = none
-Observation.ObservationControl.StationControl.TBBControl.MaxFitVariance = 0
-Observation.ObservationControl.StationControl.TBBControl.MinElevation = 0
-Observation.ObservationControl.StationControl.TBBControl.NoCoincChann = 0
-Observation.ObservationControl.StationControl.TBBControl.ParamExtension = 
-Observation.ObservationControl.StationControl._hostname = [CS001,CS002,CS003,CS004,CS005,CS006,CS007,CS011,CS017,CS021,CS024,CS026,CS028,CS030,CS031,CS032,CS101,CS103,CS201,CS301,CS302,CS401,CS501,RS106,RS205,RS208,RS306,RS307,RS406,RS503,RS508,RS509]
-Observation.ObservationControl.StationControl.tbbPiggybackAllowed = false
-Observation.ObservationControl._hostname = MCU001
-Observation.ObservationControl.heartbeatInterval = 10
-Observation.ObserverName = unknown
-Observation.ProjectName = unknown
-Observation.Scheduler.contactEmail = 
-Observation.Scheduler.contactName = 
-Observation.Scheduler.contactPhone = 
-Observation.Scheduler.firstPossibleDay = 0
-Observation.Scheduler.fixedDay = false
-Observation.Scheduler.fixedTime = false
-Observation.Scheduler.lastPossibleDay = 0
-Observation.Scheduler.late = false
-Observation.Scheduler.nightTimeWeightFactor = 0
-Observation.Scheduler.predMaxTimeDif = 
-Observation.Scheduler.predMinTimeDif = 
-Observation.Scheduler.predecessors = []
-Observation.Scheduler.priority = 0.0
-Observation.Scheduler.reason = 
-Observation.Scheduler.referenceFrame = 0
-Observation.Scheduler.reservation = 0
-Observation.Scheduler.storageSelectionMode = 1
-Observation.Scheduler.taskDuration = 900
-Observation.Scheduler.taskID = 63
-Observation.Scheduler.taskName = 'LBAm1 18-06-2012'
-Observation.Scheduler.taskType = 0
-Observation.Scheduler.windowMaximumTime = 
-Observation.Scheduler.windowMinimumTime = 
-Observation.TBB.TBBsetting.RCUs = []
-Observation.TBB.TBBsetting.baselevel = 127
-Observation.TBB.TBBsetting.filter = 0
-Observation.TBB.TBBsetting.filter0_coeff0 = 0
-Observation.TBB.TBBsetting.filter0_coeff1 = 0
-Observation.TBB.TBBsetting.filter0_coeff2 = 0
-Observation.TBB.TBBsetting.filter0_coeff3 = 0
-Observation.TBB.TBBsetting.filter1_coeff0 = 0
-Observation.TBB.TBBsetting.filter1_coeff1 = 0
-Observation.TBB.TBBsetting.filter1_coeff2 = 0
-Observation.TBB.TBBsetting.filter1_coeff3 = 0
-Observation.TBB.TBBsetting.operatingMode = 1
-Observation.TBB.TBBsetting.startlevel = 7
-Observation.TBB.TBBsetting.stoplevel = 7
-Observation.TBB.TBBsetting.subbandList = []
-Observation.TBB.TBBsetting.triggerMode = 1
-Observation.TBB.TBBsetting.window = 1M
-Observation.VirtualInstrument.imageNodeList = []
-Observation.VirtualInstrument.minimalNrStations = 1
-Observation.VirtualInstrument.partitionList = [R00]
-Observation.VirtualInstrument.stationList = [CS001,CS002,CS003,CS004,CS005,CS006,CS007,CS011,CS017,CS021,CS024,CS026,CS028,CS030,CS031,CS032,CS101,CS103,CS201,CS301,CS302,CS401,CS501,RS106,RS205,RS208,RS306,RS307,RS406,RS503,RS508,RS509]
-Observation.VirtualInstrument.stationSet = Custom
-Observation.VirtualInstrument.storageCapacity = 760
-Observation.VirtualInstrument.storageNodeList = []
-Observation.antennaArray = LBA
-Observation.antennaSet = LBA_INNER
-Observation.bandFilter = LBA_10_90
-Observation.beamList = [244*0]
-Observation.channelWidth = 762.939453125
-Cobalt.Correlator.nrChannelsPerSubband = 16
-Observation.claimPeriod = 50
-Observation.clockMode = <<Clock200
-Observation.existingAntennaFields = [LBA,HBA,HBA0,HBA1]
-Observation.existingStations = [CS001,CS002,CS003,CS004,CS005,CS006,CS007,CS011,CS013,CS017,CS021,CS024,CS026,CS028,CS030,CS031,CS101,CS103,CS201,CS301,CS302,CS401,CS501,RS106,RS205,RS208,RS306,RS307,RS406,RS503,DE601,DE602,DE603,DE604,DE605,FR606,UK608]
-Observation.longBaselines = false
-Observation.nrAnaBeams = 0
-Observation.nrBeamformers = 0
-Observation.nrBeams = 1
-Observation.nrPolarisations = 2
-Observation.nrSlotsInFrame = 61
-Observation.nrTBBSettings = 0
-Observation.preparePeriod = 30
-Observation.processSubtype = 'Beam Observation'
-Observation.processType = Observation
-Observation.receiverList = []
-Observation.referencePhaseCenter = [3826577.066,461022.948,5064892.786]
-Observation.rspBoardList = [244*0]
-Observation.rspSlotList = [244*0]
-Observation.sampleClock = 200
-Observation.samplesPerSecond = 196608
-Observation.startTime = '2012-06-19 08:00:00'
-Observation.stopTime = '2012-06-19 16:15:00'
-Observation.strategy = default
-Observation.subbandList = [175..418]
-Observation.subbandWidth = 195.3125
-Observation.topologyID = 
-PIC.Core.CS001HBA.clockCorrectionTime = 0
-PIC.Core.CS001HBA.phaseCenter = [3826937.810,460938.526,5064630.696]
-PIC.Core.CS001HBA0.clockCorrectionTime = 0
-PIC.Core.CS001HBA0.phaseCenter = [3826896.235,460979.455,5064658.203]
-PIC.Core.CS001HBA1.clockCorrectionTime = 0
-PIC.Core.CS001HBA1.phaseCenter = [3826979.384,460897.597,5064603.189]
-PIC.Core.CS001LBA.clockCorrectionTime = 0
-PIC.Core.CS001LBA.phaseCenter = [3826923.546,460915.441,5064643.489]
-PIC.Core.CS001LBA.position = [3826923.546,460915.441,5064643.489]
-PIC.Core.CS002HBA.clockCorrectionTime = 8.318569e-06
-PIC.Core.CS002HBA.phaseCenter = [3826583.278,460955.756,5064894.197]
-PIC.Core.CS002HBA0.clockCorrectionTime = 8.318834e-06
-PIC.Core.CS002HBA0.phaseCenter = [3826600.961,460953.402,5064881.136]
-PIC.Core.CS002HBA1.clockCorrectionTime = 8.318304e-06
-PIC.Core.CS002HBA1.phaseCenter = [3826565.594,460958.110,5064907.258]
-PIC.Core.CS002LBA.clockCorrectionTime = 8.339918e-06
-PIC.Core.CS002LBA.phaseCenter = [3826577.066,461022.948,5064892.786]
-PIC.Core.CS002LBA.position = [3826577.066,461022.948,5064892.786]
-PIC.Core.CS003HBA.clockCorrectionTime = 6.917899e-06
-PIC.Core.CS003HBA.phaseCenter = [3826494.580,461017.698,5064955.176]
-PIC.Core.CS003HBA0.clockCorrectionTime = 6.917926e-06
-PIC.Core.CS003HBA0.phaseCenter = [3826471.348,461000.138,5064974.201]
-PIC.Core.CS003HBA1.clockCorrectionTime = 6.917872e-06
-PIC.Core.CS003HBA1.phaseCenter = [3826517.812,461035.258,5064936.150]
-PIC.Core.CS003LBA.clockCorrectionTime = 6.936566e-06
-PIC.Core.CS003LBA.phaseCenter = [3826516.748,460930.066,5064946.457]
-PIC.Core.CS003LBA.position = [3826516.748,460930.066,5064946.457]
-PIC.Core.CS004HBA.clockCorrectionTime = 7.889733e-06
-PIC.Core.CS004HBA.phaseCenter = [3826582.556,460891.662,5064900.532]
-PIC.Core.CS004HBA0.clockCorrectionTime = 7.889961e-06
-PIC.Core.CS004HBA0.phaseCenter = [3826585.626,460865.844,5064900.561]
-PIC.Core.CS004HBA1.clockCorrectionTime = 7.889505e-06
-PIC.Core.CS004HBA1.phaseCenter = [3826579.486,460917.480,5064900.502]
-PIC.Core.CS004LBA.clockCorrectionTime = 7.905512e-06
-PIC.Core.CS004LBA.phaseCenter = [3826654.197,460939.576,5064842.426]
-PIC.Core.CS004LBA.position = [3826654.197,460939.576,5064842.426]
-PIC.Core.CS005HBA.clockCorrectionTime = 8.541942e-06
-PIC.Core.CS005HBA.phaseCenter = [3826666.177,461005.533,5064827.472]
-PIC.Core.CS005HBA0.clockCorrectionTime = 8.542093e-06
-PIC.Core.CS005HBA0.phaseCenter = [3826701.160,460989.250,5064802.685]
-PIC.Core.CS005HBA1.clockCorrectionTime = 8.541791e-06
-PIC.Core.CS005HBA1.phaseCenter = [3826631.194,461021.815,5064852.259]
-PIC.Core.CS005LBA.clockCorrectionTime = 8.556805e-06
-PIC.Core.CS005LBA.phaseCenter = [3826668.750,461069.550,5064819.754]
-PIC.Core.CS005LBA.position = [3826668.750,461069.550,5064819.754]
-PIC.Core.CS006HBA.clockCorrectionTime = 7.882660e-06
-PIC.Core.CS006HBA.phaseCenter = [3826633.141,461108.369,5064842.975]
-PIC.Core.CS006HBA0.clockCorrectionTime = 7.882360e-06
-PIC.Core.CS006HBA0.phaseCenter = [3826653.783,461136.440,5064824.943]
-PIC.Core.CS006HBA1.clockCorrectionTime = 7.882960e-06
-PIC.Core.CS006HBA1.phaseCenter = [3826612.499,461080.298,5064861.006]
-PIC.Core.CS006LBA.clockCorrectionTime = 7.905282e-06
-PIC.Core.CS006LBA.phaseCenter = [3826596.730,461145.178,5064866.978]
-PIC.Core.CS006LBA.position = [3826596.730,461145.178,5064866.978]
-PIC.Core.CS007HBA.clockCorrectionTime = 7.913140e-06
-PIC.Core.CS007HBA.phaseCenter = [3826508.368,461126.726,5064934.972]
-PIC.Core.CS007HBA0.clockCorrectionTime = 7.913020e-06
-PIC.Core.CS007HBA0.phaseCenter = [3826478.715,461083.720,5064961.117]
-PIC.Core.CS007HBA1.clockCorrectionTime = 7.913260e-06
-PIC.Core.CS007HBA1.phaseCenter = [3826538.021,461169.731,5064908.827]
-PIC.Core.CS007LBA.clockCorrectionTime = 7.928823e-06
-PIC.Core.CS007LBA.phaseCenter = [3826533.361,461098.966,5064918.721]
-PIC.Core.CS007LBA.position = [3826533.361,461098.966,5064918.721]
-PIC.Core.CS011HBA.clockCorrectionTime = 0
-PIC.Core.CS011HBA.phaseCenter = [3826643.191,461290.793,5064819.069]
-PIC.Core.CS011HBA0.clockCorrectionTime = 0
-PIC.Core.CS011HBA0.phaseCenter = [3826637.421,461227.345,5064829.134]
-PIC.Core.CS011HBA1.clockCorrectionTime = 0
-PIC.Core.CS011HBA1.phaseCenter = [3826648.961,461354.241,5064809.003]
-PIC.Core.CS011LBA.clockCorrectionTime = 0
-PIC.Core.CS011LBA.phaseCenter = [3826667.069,461285.849,5064801.592]
-PIC.Core.CS011LBA.position = [3826667.069,461285.849,5064801.592]
-PIC.Core.CS013HBA.clockCorrectionTime = 0
-PIC.Core.CS013HBA.phaseCenter = [3826360.529,460815.196,5065074.343]
-PIC.Core.CS013HBA0.clockCorrectionTime = 0
-PIC.Core.CS013HBA0.phaseCenter = [3826318.954,460856.125,5065101.850]
-PIC.Core.CS013HBA1.clockCorrectionTime = 0
-PIC.Core.CS013HBA1.phaseCenter = [3826402.103,460774.267,5065046.836]
-PIC.Core.CS013LBA.clockCorrectionTime = 0
-PIC.Core.CS013LBA.phaseCenter = [3826346.265,460792.111,5065087.136]
-PIC.Core.CS017HBA.clockCorrectionTime = 0
-PIC.Core.CS017HBA.phaseCenter = [3826452.439,461529.979,5064940.511]
-PIC.Core.CS017HBA0.clockCorrectionTime = 0
-PIC.Core.CS017HBA0.phaseCenter = [3826405.095,461507.460,5064978.083]
-PIC.Core.CS017HBA1.clockCorrectionTime = 0
-PIC.Core.CS017HBA1.phaseCenter = [3826499.783,461552.498,5064902.938]
-PIC.Core.CS017LBA.clockCorrectionTime = 0
-PIC.Core.CS017LBA.phaseCenter = [3826462.054,461501.950,5064935.827]
-PIC.Core.CS017LBA.position = [3826462.054,461501.950,5064935.827]
-PIC.Core.CS021HBA.clockCorrectionTime = 0
-PIC.Core.CS021HBA.phaseCenter = [3826416.158,460510.576,5065060.187]
-PIC.Core.CS021HBA0.clockCorrectionTime = 0
-PIC.Core.CS021HBA0.phaseCenter = [3826463.502,460533.094,5065022.614]
-PIC.Core.CS021HBA1.clockCorrectionTime = 0
-PIC.Core.CS021HBA1.phaseCenter = [3826368.813,460488.057,5065097.759]
-PIC.Core.CS021LBA.clockCorrectionTime = 0
-PIC.Core.CS021LBA.phaseCenter = [3826406.543,460538.604,5065064.870]
-PIC.Core.CS021LBA.position = [3826406.543,460538.604,5065064.870]
-PIC.Core.CS024HBA.clockCorrectionTime = 0
-PIC.Core.CS024HBA.phaseCenter = [3827170.849,461381.379,5064416.362]
-PIC.Core.CS024HBA0.clockCorrectionTime = 0
-PIC.Core.CS024HBA0.phaseCenter = [3827218.193,461403.898,5064378.790]
-PIC.Core.CS024HBA1.clockCorrectionTime = 0
-PIC.Core.CS024HBA1.phaseCenter = [3827123.504,461358.861,5064453.935]
-PIC.Core.CS024LBA.clockCorrectionTime = 0
-PIC.Core.CS024LBA.phaseCenter = [3827161.234,461409.408,5064421.046]
-PIC.Core.CS024LBA.position = [3827161.234,461409.408,5064421.046]
-PIC.Core.CS026HBA.clockCorrectionTime = 0
-PIC.Core.CS026HBA.phaseCenter = [3826376.653,461846.767,5064968.706]
-PIC.Core.CS026HBA0.clockCorrectionTime = 0
-PIC.Core.CS026HBA0.phaseCenter = [3826418.227,461805.837,5064941.199]
-PIC.Core.CS026HBA1.clockCorrectionTime = 0
-PIC.Core.CS026HBA1.phaseCenter = [3826335.078,461887.696,5064996.213]
-PIC.Core.CS026LBA.clockCorrectionTime = 0
-PIC.Core.CS026LBA.phaseCenter = [3826390.916,461869.852,5064955.913]
-PIC.Core.CS026LBA.position = [3826390.916,461869.852,5064955.913]
-PIC.Core.CS028HBA.clockCorrectionTime = 0
-PIC.Core.CS028HBA.phaseCenter = [3825614.709,461283.678,5065591.532]
-PIC.Core.CS028HBA0.clockCorrectionTime = 0
-PIC.Core.CS028HBA0.phaseCenter = [3825573.134,461324.607,5065619.039]
-PIC.Core.CS028HBA1.clockCorrectionTime = 0
-PIC.Core.CS028HBA1.phaseCenter = [3825656.283,461242.749,5065564.025]
-PIC.Core.CS028LBA.clockCorrectionTime = 0
-PIC.Core.CS028LBA.phaseCenter = [3825600.445,461260.593,5065604.325]
-PIC.Core.CS028LBA.position = [3825600.445,461260.593,5065604.325]
-PIC.Core.CS030HBA.clockCorrectionTime = 0
-PIC.Core.CS030HBA.phaseCenter = [3826000.003,460364.303,5065385.121]
-PIC.Core.CS030HBA0.clockCorrectionTime = 0
-PIC.Core.CS030HBA0.phaseCenter = [3826041.577,460323.374,5065357.614]
-PIC.Core.CS030HBA1.clockCorrectionTime = 0
-PIC.Core.CS030HBA1.phaseCenter = [3825958.428,460405.233,5065412.628]
-PIC.Core.CS030LBA.clockCorrectionTime = 0
-PIC.Core.CS030LBA.phaseCenter = [3826014.266,460387.389,5065372.328]
-PIC.Core.CS030LBA.position = [3826014.266,460387.389,5065372.328]
-PIC.Core.CS031HBA.clockCorrectionTime = 0
-PIC.Core.CS031HBA.phaseCenter = [3826430.381,460301.862,5065068.278]
-PIC.Core.CS031HBA0.clockCorrectionTime = 0
-PIC.Core.CS031HBA0.phaseCenter = [3826383.037,460279.343,5065105.850]
-PIC.Core.CS031HBA1.clockCorrectionTime = 0
-PIC.Core.CS031HBA1.phaseCenter = [3826477.725,460324.381,5065030.705]
-PIC.Core.CS031LBA.clockCorrectionTime = 0
-PIC.Core.CS031LBA.phaseCenter = [3826439.996,460273.833,5065063.594]
-PIC.Core.CS031LBA.position = [3826439.996,460273.833,5065063.594]
-PIC.Core.CS032HBA.clockCorrectionTime = 0
-PIC.Core.CS032HBA.phaseCenter = [3826905.837,460410.995,5064702.499]
-PIC.Core.CS032HBA0.clockCorrectionTime = 0
-PIC.Core.CS032HBA0.phaseCenter = [3826864.262,460451.924,5064730.006]
-PIC.Core.CS032HBA1.clockCorrectionTime = 0
-PIC.Core.CS032HBA1.phaseCenter = [3826947.411,460370.066,5064674.992]
-PIC.Core.CS032LBA.clockCorrectionTime = 0
-PIC.Core.CS032LBA.phaseCenter = [3826891.573,460387.910,5064715.292]
-PIC.Core.CS032LBA.position = [3826891.573,460387.910,5064715.292]
-PIC.Core.CS101HBA.clockCorrectionTime = 0
-PIC.Core.CS101HBA.phaseCenter = [3825857.958,461661.510,5065374.102]
-PIC.Core.CS101HBA0.clockCorrectionTime = 0
-PIC.Core.CS101HBA0.phaseCenter = [3825905.302,461684.028,5065336.529]
-PIC.Core.CS101HBA1.clockCorrectionTime = 0
-PIC.Core.CS101HBA1.phaseCenter = [3825810.613,461638.991,5065411.674]
-PIC.Core.CS101LBA.clockCorrectionTime = 0
-PIC.Core.CS101LBA.phaseCenter = [3825848.343,461689.538,5065378.785]
-PIC.Core.CS101LBA.position = [3825848.343,461689.538,5065378.785]
-PIC.Core.CS103HBA.clockCorrectionTime = 0
-PIC.Core.CS103HBA.phaseCenter = [3826290.016,462800.003,5064947.127]
-PIC.Core.CS103HBA0.clockCorrectionTime = 0
-PIC.Core.CS103HBA0.phaseCenter = [3826331.590,462759.074,5064919.620]
-PIC.Core.CS103HBA1.clockCorrectionTime = 0
-PIC.Core.CS103HBA1.phaseCenter = [3826248.441,462840.933,5064974.634]
-PIC.Core.CS103LBA.clockCorrectionTime = 0
-PIC.Core.CS103LBA.phaseCenter = [3826304.279,462823.089,5064934.334]
-PIC.Core.CS103LBA.position = [3826304.279,462823.089,5064934.334]
-PIC.Core.CS201HBA.clockCorrectionTime = 0
-PIC.Core.CS201HBA.phaseCenter = [3826685.051,461918.691,5064731.315]
-PIC.Core.CS201HBA0.clockCorrectionTime = 0
-PIC.Core.CS201HBA0.phaseCenter = [3826679.281,461855.243,5064741.380]
-PIC.Core.CS201HBA1.clockCorrectionTime = 0
-PIC.Core.CS201HBA1.phaseCenter = [3826690.821,461982.139,5064721.249]
-PIC.Core.CS201LBA.clockCorrectionTime = 0
-PIC.Core.CS201LBA.phaseCenter = [3826708.929,461913.747,5064713.838]
-PIC.Core.CS201LBA.position = [3826708.929,461913.747,5064713.838]
-PIC.Core.CS301HBA.clockCorrectionTime = 0
-PIC.Core.CS301HBA.phaseCenter = [3827453.340,460985.281,5064240.201]
-PIC.Core.CS301HBA0.clockCorrectionTime = 0
-PIC.Core.CS301HBA0.phaseCenter = [3827459.109,461048.728,5064230.136]
-PIC.Core.CS301HBA1.clockCorrectionTime = 0
-PIC.Core.CS301HBA1.phaseCenter = [3827447.570,460921.833,5064250.266]
-PIC.Core.CS301LBA.clockCorrectionTime = 0
-PIC.Core.CS301LBA.phaseCenter = [3827429.462,460990.224,5064257.677]
-PIC.Core.CS301LBA.position = [3827429.462,460990.224,5064257.677]
-PIC.Core.CS302HBA.clockCorrectionTime = 0
-PIC.Core.CS302HBA.phaseCenter = [3827931.652,459769.554,5064002.807]
-PIC.Core.CS302HBA0.clockCorrectionTime = 0
-PIC.Core.CS302HBA0.phaseCenter = [3827973.226,459728.624,5063975.300]
-PIC.Core.CS302HBA1.clockCorrectionTime = 0
-PIC.Core.CS302HBA1.phaseCenter = [3827890.077,459810.483,5064030.313]
-PIC.Core.CS302LBA.clockCorrectionTime = 0
-PIC.Core.CS302LBA.phaseCenter = [3827945.916,459792.639,5063990.016]
-PIC.Core.CS302LBA.position = [3827945.916,459792.639,5063990.016]
-PIC.Core.CS401HBA.clockCorrectionTime = 8.069737e-06
-PIC.Core.CS401HBA.phaseCenter = [3826789.982,460095.444,5064818.996]
-PIC.Core.CS401HBA0.clockCorrectionTime = 8.069604e-06
-PIC.Core.CS401HBA0.phaseCenter = [3826795.752,460158.894,5064808.929]
-PIC.Core.CS401HBA1.clockCorrectionTime = 8.069870e-06
-PIC.Core.CS401HBA1.phaseCenter = [3826784.211,460031.993,5064829.062]
-PIC.Core.CS401LBA.clockCorrectionTime = 8.06397e-06
-PIC.Core.CS401LBA.phaseCenter = [3826766.106,460100.388,5064836.470]
-PIC.Core.CS401LBA.position = [3826766.106,460100.388,5064836.470]
-PIC.Core.CS501HBA.clockCorrectionTime = 0
-PIC.Core.CS501HBA.phaseCenter = [3825616.164,460670.139,5065645.456]
-PIC.Core.CS501HBA0.clockCorrectionTime = 0
-PIC.Core.CS501HBA0.phaseCenter = [3825568.820,460647.620,5065683.028]
-PIC.Core.CS501HBA1.clockCorrectionTime = 0
-PIC.Core.CS501HBA1.phaseCenter = [3825663.508,460692.658,5065607.883]
-PIC.Core.CS501LBA.clockCorrectionTime = 0
-PIC.Core.CS501LBA.phaseCenter = [3825625.779,460642.110,5065640.772]
-PIC.Core.CS501LBA.position = [3825625.779,460642.110,5065640.772]
-PIC.Core.DE601HBA.clockCorrectionTime = 1.1e-6
-PIC.Core.DE601HBA.phaseCenter = [4034099.840,487013.425,4900229.635]
-PIC.Core.DE601LBA.clockCorrectionTime = 1.1e-6
-PIC.Core.DE601LBA.phaseCenter = [4034036.396,487026.791,4900279.047]
-PIC.Core.DE602HBA.clockCorrectionTime = 0
-PIC.Core.DE602HBA.phaseCenter = [4152568.006,828789.153,4754362.203]
-PIC.Core.DE602LBA.clockCorrectionTime = 0
-PIC.Core.DE602LBA.phaseCenter = [4152560.658,828869.076,4754357.155]
-PIC.Core.DE603HBA.clockCorrectionTime = 0
-PIC.Core.DE603HBA.phaseCenter = [3940295.706,816722.865,4932394.416]
-PIC.Core.DE603LBA.clockCorrectionTime = 0
-PIC.Core.DE603LBA.phaseCenter = [3940284.908,816802.334,4932393.021]
-PIC.Core.DE604HBA.clockCorrectionTime = 0
-PIC.Core.DE604HBA.phaseCenter = [3796379.823,877614.130,5032712.528]
-PIC.Core.DE604LBA.clockCorrectionTime = 0
-PIC.Core.DE604LBA.phaseCenter = [3796327.178,877591.636,5032757.508]
-PIC.Core.DE605HBA.clockCorrectionTime = 0
-PIC.Core.DE605HBA.phaseCenter = [4005681.020,450968.643,4926458.211]
-PIC.Core.DE605LBA.clockCorrectionTime = 0
-PIC.Core.DE605LBA.phaseCenter = [4005681.355,450968.621,4926457.941]
-PIC.Core.FR606HBA.clockCorrectionTime = 0
-PIC.Core.FR606HBA.phaseCenter = [4324016.708,165545.525,4670271.363]
-PIC.Core.FR606LBA.clockCorrectionTime = 0
-PIC.Core.FR606LBA.phaseCenter = [4323979.809,165608.773,4670303.094]
-PIC.Core.IONProc.R00[0].inputs = []
-PIC.Core.IONProc.R00[10].inputs = []
-PIC.Core.IONProc.R00[11].inputs = []
-PIC.Core.IONProc.R00[12].inputs = []
-PIC.Core.IONProc.R00[13].inputs = []
-PIC.Core.IONProc.R00[14].inputs = []
-PIC.Core.IONProc.R00[15].inputs = []
-PIC.Core.IONProc.R00[16].inputs = []
-PIC.Core.IONProc.R00[17].inputs = []
-PIC.Core.IONProc.R00[18].inputs = []
-PIC.Core.IONProc.R00[19].inputs = []
-PIC.Core.IONProc.R00[1].inputs = []
-PIC.Core.IONProc.R00[20].inputs = []
-PIC.Core.IONProc.R00[21].inputs = []
-PIC.Core.IONProc.R00[22].inputs = []
-PIC.Core.IONProc.R00[23].inputs = [RS205LBA/RSP0,RS205LBA/RSP1,RS205LBA/RSP2,RS205LBA/RSP3]
-PIC.Core.IONProc.R00[24].inputs = []
-PIC.Core.IONProc.R00[25].inputs = []
-PIC.Core.IONProc.R00[26].inputs = [CS302LBA/RSP0,CS302LBA/RSP1,CS302LBA/RSP2,CS302LBA/RSP3]
-PIC.Core.IONProc.R00[27].inputs = []
-PIC.Core.IONProc.R00[28].inputs = []
-PIC.Core.IONProc.R00[29].inputs = []
-PIC.Core.IONProc.R00[2].inputs = []
-PIC.Core.IONProc.R00[30].inputs = [RS406LBA/RSP0,RS406LBA/RSP1,RS406LBA/RSP2,RS406LBA/RSP3]
-PIC.Core.IONProc.R00[31].inputs = [RS509LBA/RSP0,RS509LBA/RSP1,RS509LBA/RSP2,RS509LBA/RSP3]
-PIC.Core.IONProc.R00[32].inputs = [CS021LBA/RSP0,CS021LBA/RSP1,CS021LBA/RSP2,CS021LBA/RSP3]
-PIC.Core.IONProc.R00[33].inputs = [CS005LBA/RSP0,CS005LBA/RSP1,CS005LBA/RSP2,CS005LBA/RSP3]
-PIC.Core.IONProc.R00[34].inputs = [CS002LBA/RSP0,CS002LBA/RSP1,CS002LBA/RSP2,CS002LBA/RSP3]
-PIC.Core.IONProc.R00[35].inputs = [CS006LBA/RSP0,CS006LBA/RSP1,CS006LBA/RSP2,CS006LBA/RSP3]
-PIC.Core.IONProc.R00[36].inputs = [CS003LBA/RSP0,CS003LBA/RSP1,CS003LBA/RSP2,CS003LBA/RSP3]
-PIC.Core.IONProc.R00[37].inputs = [CS007LBA/RSP0,CS007LBA/RSP1,CS007LBA/RSP2,CS007LBA/RSP3]
-PIC.Core.IONProc.R00[38].inputs = [CS004LBA/RSP0,CS004LBA/RSP1,CS004LBA/RSP2,CS004LBA/RSP3]
-PIC.Core.IONProc.R00[39].inputs = [CS024LBA/RSP0,CS024LBA/RSP1,CS024LBA/RSP2,CS024LBA/RSP3]
-PIC.Core.IONProc.R00[3].inputs = []
-PIC.Core.IONProc.R00[40].inputs = [CS101LBA/RSP0,CS101LBA/RSP1,CS101LBA/RSP2,CS101LBA/RSP3]
-PIC.Core.IONProc.R00[41].inputs = [CS032LBA/RSP0,CS032LBA/RSP1,CS032LBA/RSP2,CS032LBA/RSP3]
-PIC.Core.IONProc.R00[42].inputs = [CS026LBA/RSP0,CS026LBA/RSP1,CS026LBA/RSP2,CS026LBA/RSP3]
-PIC.Core.IONProc.R00[43].inputs = [CS201LBA/RSP0,CS201LBA/RSP1,CS201LBA/RSP2,CS201LBA/RSP3]
-PIC.Core.IONProc.R00[44].inputs = [CS030LBA/RSP0,CS030LBA/RSP1,CS030LBA/RSP2,CS030LBA/RSP3]
-PIC.Core.IONProc.R00[45].inputs = [CS301LBA/RSP0,CS301LBA/RSP1,CS301LBA/RSP2,CS301LBA/RSP3]
-PIC.Core.IONProc.R00[46].inputs = [CS001LBA/RSP0,CS001LBA/RSP1,CS001LBA/RSP2,CS001LBA/RSP3]
-PIC.Core.IONProc.R00[47].inputs = [CS401LBA/RSP0,CS401LBA/RSP1,CS401LBA/RSP2,CS401LBA/RSP3]
-PIC.Core.IONProc.R00[48].inputs = [CS017LBA/RSP0,CS017LBA/RSP1,CS017LBA/RSP2,CS017LBA/RSP3]
-PIC.Core.IONProc.R00[49].inputs = [RS208LBA/RSP0,RS208LBA/RSP1,RS208LBA/RSP2,RS208LBA/RSP3]
-PIC.Core.IONProc.R00[4].inputs = []
-PIC.Core.IONProc.R00[50].inputs = [CS011LBA/RSP0,CS011LBA/RSP1,CS011LBA/RSP2,CS011LBA/RSP3]
-PIC.Core.IONProc.R00[51].inputs = [CS028LBA/RSP0,CS028LBA/RSP1,CS028LBA/RSP2,CS028LBA/RSP3]
-PIC.Core.IONProc.R00[52].inputs = [CS501LBA/RSP0,CS501LBA/RSP1,CS501LBA/RSP2,CS501LBA/RSP3]
-PIC.Core.IONProc.R00[53].inputs = [RS503LBA/RSP0,RS503LBA/RSP1,RS503LBA/RSP2,RS503LBA/RSP3]
-PIC.Core.IONProc.R00[54].inputs = [CS103LBA/RSP0,CS103LBA/RSP1,CS103LBA/RSP2,CS103LBA/RSP3]
-PIC.Core.IONProc.R00[55].inputs = [RS106LBA/RSP0,RS106LBA/RSP1,RS106LBA/RSP2,RS106LBA/RSP3]
-PIC.Core.IONProc.R00[56].inputs = []
-PIC.Core.IONProc.R00[57].inputs = []
-PIC.Core.IONProc.R00[58].inputs = [CS031LBA/RSP0,CS031LBA/RSP1,CS031LBA/RSP2,CS031LBA/RSP3]
-PIC.Core.IONProc.R00[59].inputs = []
-PIC.Core.IONProc.R00[5].inputs = []
-PIC.Core.IONProc.R00[60].inputs = [RS306LBA/RSP0,RS306LBA/RSP1,RS306LBA/RSP2,RS306LBA/RSP3]
-PIC.Core.IONProc.R00[61].inputs = []
-PIC.Core.IONProc.R00[62].inputs = [RS307LBA/RSP0,RS307LBA/RSP1,RS307LBA/RSP2,RS307LBA/RSP3]
-PIC.Core.IONProc.R00[63].inputs = [RS508LBA/RSP0,RS508LBA/RSP1,RS508LBA/RSP2,RS508LBA/RSP3]
-PIC.Core.IONProc.R00[6].inputs = []
-PIC.Core.IONProc.R00[7].inputs = []
-PIC.Core.IONProc.R00[8].inputs = []
-PIC.Core.IONProc.R00[9].inputs = []
-PIC.Core.RS106HBA.clockCorrectionTime = 0
-PIC.Core.RS106HBA.phaseCenter = [3829205.598,469142.533,5062181.002]
-PIC.Core.RS106LBA.clockCorrectionTime = 0
-PIC.Core.RS106LBA.phaseCenter = [3829261.425,469162.285,5062137.310]
-PIC.Core.RS106LBA.position = [3829261.425,469162.285,5062137.310]
-PIC.Core.RS205HBA.clockCorrectionTime = 0
-PIC.Core.RS205HBA.phaseCenter = [3831479.670,463487.529,5060989.903]
-PIC.Core.RS205LBA.clockCorrectionTime = 0
-PIC.Core.RS205LBA.phaseCenter = [3831438.563,463435.440,5061025.466]
-PIC.Core.RS205LBA.position = [3831438.563,463435.440,5061025.466]
-PIC.Core.RS208HBA.clockCorrectionTime = 0
-PIC.Core.RS208HBA.phaseCenter = [3847753.310,466962.809,5048397.244]
-PIC.Core.RS208LBA.clockCorrectionTime = 0
-PIC.Core.RS208LBA.phaseCenter = [3847810.051,466929.706,5048357.222]
-PIC.Core.RS208LBA.position = [3847810.051,466929.706,5048357.222]
-PIC.Core.RS306HBA.clockCorrectionTime = 0
-PIC.Core.RS306HBA.phaseCenter = [3829771.249,452761.702,5063243.181]
-PIC.Core.RS306LBA.clockCorrectionTime = 0
-PIC.Core.RS306LBA.phaseCenter = [3829791.808,452829.848,5063221.590]
-PIC.Core.RS306LBA.position = [3829791.808,452829.848,5063221.590]
-PIC.Core.RS307HBA.clockCorrectionTime = 0
-PIC.Core.RS307HBA.phaseCenter = [3837964.520,449627.261,5057357.585]
-PIC.Core.RS307LBA.clockCorrectionTime = 0
-PIC.Core.RS307LBA.phaseCenter = [3837940.949,449560.756,5057381.288]
-PIC.Core.RS307LBA.position = [3837940.949,449560.756,5057381.288]
-PIC.Core.RS406HBA.clockCorrectionTime = 0
-PIC.Core.RS406HBA.phaseCenter = [3818424.939,452020.269,5071817.644]
-PIC.Core.RS406LBA.clockCorrectionTime = 0
-PIC.Core.RS406LBA.phaseCenter = [3818467.634,451974.601,5071790.597]
-PIC.Core.RS406LBA.position = [3818467.634,451974.601,5071790.597]
-PIC.Core.RS503HBA.clockCorrectionTime = 0
-PIC.Core.RS503HBA.phaseCenter = [3824138.566,459476.972,5066858.578]
-PIC.Core.RS503LBA.clockCorrectionTime = 0
-PIC.Core.RS503LBA.phaseCenter = [3824090.452,459438.282,5066898.190]
-PIC.Core.RS503LBA.position = [3824090.452,459438.282,5066898.190]
-PIC.Core.RS508HBA.clockCorrectionTime = 0
-PIC.Core.RS508HBA.phaseCenter = [3797136.484,463114.447,5086651.286]
-PIC.Core.RS508LBA.clockCorrectionTime = 0
-PIC.Core.RS508LBA.phaseCenter = [3797202.116,463087.509,5086605.037]
-PIC.Core.RS508LBA.position = [3797202.116,463087.509,5086605.037]
-PIC.Core.RS509HBA.clockCorrectionTime = 0
-PIC.Core.RS509HBA.phaseCenter = [3783537.525,450130.064,5097866.146]
-PIC.Core.RS509LBA.clockCorrectionTime = 0
-PIC.Core.RS509LBA.phaseCenter = [3783579.131,450178.882,5097830.835]
-PIC.Core.RS509LBA.position = [3783579.131,450178.882,5097830.835]
-PIC.Core.S1.phaseCenter = [3826615.56096,460986.585898,5064718.84237]
-PIC.Core.S10.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S129.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S13.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S130.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S133.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S134.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S137.phaseCenter = [3826967.64713,460904.072585,5064612.8258]
-PIC.Core.S138.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S14.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S141.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S142.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S145.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S146.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S149.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S150.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S153.phaseCenter = [3826967.64713,460904.072585,5064612.8258]
-PIC.Core.S154.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S157.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S158.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S161.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S162.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S165.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S166.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S169.phaseCenter = [3826967.64713,460904.072585,5064612.8258]
-PIC.Core.S17.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S170.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S173.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S174.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S177.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S178.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S18.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S181.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S182.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S185.phaseCenter = [3826967.64713,460904.072585,5064612.8258]
-PIC.Core.S186.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S189.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S190.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S2.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S21.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S22.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S25.phaseCenter = [3826967.64713,460904.072585,5064612.8258]
-PIC.Core.S26.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S29.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S30.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S33.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S34.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S37.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S38.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S41.phaseCenter = [3826967.64713,460904.072585,5064612.8258]
-PIC.Core.S42.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S45.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S46.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S49.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S5.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S50.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S53.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S54.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S57.phaseCenter = [3826967.64713,460904.072585,5064612.8258]
-PIC.Core.S58.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S6.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S61.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S62.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.S9.phaseCenter = [3826967.64713,460904.072585,5064612.8258]
-PIC.Core.SE607HBA.clockCorrectionTime = 0
-PIC.Core.SE607HBA.phaseCenter = [3370271.657,712125.881,5349991.165]
-PIC.Core.SE607LBA.clockCorrectionTime = 0
-PIC.Core.SE607LBA.phaseCenter = [3370286.931,712053.871,5349991.459]
-PIC.Core.CS001LBA.RSP.ports = [0.0.0.0:4346,0.0.0.0:4347,0.0.0.0:4348,0.0.0.0:4349]
-PIC.Core.CS002LBA.RSP.ports = [0.0.0.0:4346,0.0.0.0:4347,0.0.0.0:4348,0.0.0.0:4349]
-PIC.Core.CS003LBA.RSP.ports = [0.0.0.0:4346,0.0.0.0:4347,0.0.0.0:4348,0.0.0.0:4349]
-PIC.Core.CS004LBA.RSP.ports = [0.0.0.0:4346,0.0.0.0:4347,0.0.0.0:4348,0.0.0.0:4349]
-PIC.Core.CS005LBA.RSP.ports = [0.0.0.0:4346,0.0.0.0:4347,0.0.0.0:4348,0.0.0.0:4349]
-PIC.Core.CS006LBA.RSP.ports = [0.0.0.0:4346,0.0.0.0:4347,0.0.0.0:4348,0.0.0.0:4349]
-PIC.Core.CS007LBA.RSP.ports = [0.0.0.0:4346,0.0.0.0:4347,0.0.0.0:4348,0.0.0.0:4349]
-PIC.Core.CS011LBA.RSP.ports = [0.0.0.0:4346,0.0.0.0:4347,0.0.0.0:4348,0.0.0.0:4349]
-PIC.Core.CS017LBA.RSP.ports = [0.0.0.0:4346,0.0.0.0:4347,0.0.0.0:4348,0.0.0.0:4349]
-PIC.Core.CS021LBA.RSP.ports = [0.0.0.0:4346,0.0.0.0:4347,0.0.0.0:4348,0.0.0.0:4349]
-PIC.Core.CS024LBA.RSP.ports = [0.0.0.0:4346,0.0.0.0:4347,0.0.0.0:4348,0.0.0.0:4349]
-PIC.Core.CS026LBA.RSP.ports = [0.0.0.0:4346,0.0.0.0:4347,0.0.0.0:4348,0.0.0.0:4349]
-PIC.Core.CS028LBA.RSP.ports = [0.0.0.0:4346,0.0.0.0:4347,0.0.0.0:4348,0.0.0.0:4349]
-PIC.Core.CS030LBA.RSP.ports = [0.0.0.0:4346,0.0.0.0:4347,0.0.0.0:4348,0.0.0.0:4349]
-PIC.Core.CS031LBA.RSP.ports = [0.0.0.0:4346,0.0.0.0:4347,0.0.0.0:4348,0.0.0.0:4349]
-PIC.Core.CS032LBA.RSP.ports = [0.0.0.0:4346,0.0.0.0:4347,0.0.0.0:4348,0.0.0.0:4349]
-PIC.Core.CS101LBA.RSP.ports = [0.0.0.0:4346,0.0.0.0:4347,0.0.0.0:4348,0.0.0.0:4349]
-PIC.Core.CS103LBA.RSP.ports = [0.0.0.0:4346,0.0.0.0:4347,0.0.0.0:4348,0.0.0.0:4349]
-PIC.Core.CS201LBA.RSP.ports = [0.0.0.0:4346,0.0.0.0:4347,0.0.0.0:4348,0.0.0.0:4349]
-PIC.Core.CS301LBA.RSP.ports = [0.0.0.0:4346,0.0.0.0:4347,0.0.0.0:4348,0.0.0.0:4349]
-PIC.Core.CS302LBA.RSP.ports = [0.0.0.0:4346,0.0.0.0:4347,0.0.0.0:4348,0.0.0.0:4349]
-PIC.Core.CS401LBA.RSP.ports = [0.0.0.0:4346,0.0.0.0:4347,0.0.0.0:4348,0.0.0.0:4349]
-PIC.Core.CS501LBA.RSP.ports = [0.0.0.0:4346,0.0.0.0:4347,0.0.0.0:4348,0.0.0.0:4349]
-PIC.Core.RS106LBA.RSP.ports = [0.0.0.0:4346,0.0.0.0:4347,0.0.0.0:4348,0.0.0.0:4349]
-PIC.Core.RS205LBA.RSP.ports = [0.0.0.0:4346,0.0.0.0:4347,0.0.0.0:4348,0.0.0.0:4349]
-PIC.Core.RS208LBA.RSP.ports = [0.0.0.0:4346,0.0.0.0:4347,0.0.0.0:4348,0.0.0.0:4349]
-PIC.Core.RS306LBA.RSP.ports = [0.0.0.0:4346,0.0.0.0:4347,0.0.0.0:4348,0.0.0.0:4349]
-PIC.Core.RS307LBA.RSP.ports = [0.0.0.0:4346,0.0.0.0:4347,0.0.0.0:4348,0.0.0.0:4349]
-PIC.Core.RS406LBA.RSP.ports = [0.0.0.0:4346,0.0.0.0:4347,0.0.0.0:4348,0.0.0.0:4349]
-PIC.Core.RS503LBA.RSP.ports = [0.0.0.0:4346,0.0.0.0:4347,0.0.0.0:4348,0.0.0.0:4349]
-PIC.Core.RS508LBA.RSP.ports = [0.0.0.0:4346,0.0.0.0:4347,0.0.0.0:4348,0.0.0.0:4349]
-PIC.Core.RS509LBA.RSP.ports = [0.0.0.0:4346,0.0.0.0:4347,0.0.0.0:4348,0.0.0.0:4349]
-PIC.Core.T1.phaseCenter = [3826615.56096,460986.585898,5064718.84237]
-PIC.Core.T10.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T129.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T13.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T130.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T133.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T134.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T137.phaseCenter = [3826967.64713,460904.072585,5064612.8258]
-PIC.Core.T138.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T14.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T141.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T142.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T145.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T146.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T149.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T150.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T153.phaseCenter = [3826967.64713,460904.072585,5064612.8258]
-PIC.Core.T154.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T157.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T158.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T161.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T162.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T165.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T166.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T169.phaseCenter = [3826967.64713,460904.072585,5064612.8258]
-PIC.Core.T17.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T170.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T173.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T174.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T177.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T178.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T18.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T181.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T182.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T185.phaseCenter = [3826967.64713,460904.072585,5064612.8258]
-PIC.Core.T186.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T189.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T190.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T2.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T21.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T22.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T25.phaseCenter = [3826967.64713,460904.072585,5064612.8258]
-PIC.Core.T26.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T29.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T30.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T33.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T34.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T37.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T38.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T41.phaseCenter = [3826967.64713,460904.072585,5064612.8258]
-PIC.Core.T42.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T45.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T46.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T49.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T5.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T50.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T53.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T54.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T57.phaseCenter = [3826967.64713,460904.072585,5064612.8258]
-PIC.Core.T58.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T6.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T61.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T62.phaseCenter = [3826815.56096,460986.585898,5064718.84237]
-PIC.Core.T9.phaseCenter = [3826967.64713,460904.072585,5064612.8258]
-PIC.Core.UK608HBA.clockCorrectionTime = 0
-PIC.Core.UK608HBA.phaseCenter = [4008461.941,-100376.609,4943716.874]
-PIC.Core.UK608LBA.clockCorrectionTime = 0
-PIC.Core.UK608LBA.phaseCenter = [4008438.457,-100309.725,4943735.828]
-_DPname = LOFAR_ObsSW_TempObs0054
-_parsetPrefix = CorrAppl.CorrProc.
-_processName = CorrProc
+Observation.DataProducts.Output_IncoherentStokes.filenames = [L121212_SAP000_B001_S0_P000_bf.h5, L121212_SAP000_B001_S1_P000_bf.h5, L121212_SAP000_B001_S2_P000_bf.h5, L121212_SAP000_B001_S3_P000_bf.h5, L121212_SAP001_B001_S0_P000_bf.h5, L121212_SAP001_B001_S1_P000_bf.h5, L121212_SAP001_B001_S2_P000_bf.h5, L121212_SAP001_B001_S3_P000_bf.h5]
+Observation.DataProducts.Output_IncoherentStokes.locations = [8*CEP4:cpu40.cep4:/data/projects/TT0_000/L121212/is]
+
+Observation.Campaign.name="TT0_000"
+Observation.Campaign.title="TEST: Terminally Extensive Settings for Testing"
+Observation.Campaign.PI="Testing, Dr. Random"
+Observation.Campaign.CO_I="Bias, Dr. Slanted"
+Observation.Campaign.contact="Testing, Dr. Random"
+
diff --git a/RTCP/Cobalt/OutputProc/test/tTBB_Writer-transient.run b/RTCP/Cobalt/OutputProc/test/tTBB_Writer-transient.run
new file mode 100755
index 0000000000000000000000000000000000000000..db1d9f46f90a19f7dd0fbdc857e2f1e074dfbf89
--- /dev/null
+++ b/RTCP/Cobalt/OutputProc/test/tTBB_Writer-transient.run
@@ -0,0 +1,38 @@
+#!/bin/bash
+# tTBB_Writer-transient.run
+
+rm -f L121212_CS011_D20110719T110541.036Z_tbb.h5 L121212_CS011_RSP001_RCU010_D20110719T110541.036Z_tbb.raw
+
+status=0
+
+TBB_Writer --parset=tTBB_Writer-transient.parset --staticmetadatadir=tTBB_Writer-transient.in_1 --outputdir=. --input=file:tTBB_Writer-transient.in_1/rw_20110719_110541_1110.dat --timeout=1 --keeprunning=0 || status=1
+
+# Check some .h5 attributes vs a reference output
+# Older HDF5 1.8 versions (e.g. 1.8.4) print e.g.: 'ATTRIBUTE "STATION_CS011/STATION_NAME" {' instead of: 'ATTRIBUTE "STATION_NAME" {' and different spacing.
+# Use sed magic to strip the HDF5 dirname and use diff with -b. (Better: use h5diff.)
+h5dump -a TELESCOPE \
+       -a OPERATING_MODE \
+       -a STATION_CS011/STATION_NAME \
+       -a STATION_CS011/STATION_POSITION \
+       -a STATION_CS011/DIPOLE_011001010/DATA_LENGTH \
+       -a STATION_CS011/DIPOLE_011001010/SAMPLE_NUMBER \
+       -a STATION_CS011/DIPOLE_011001010/TIME \
+       L121212_CS011_D20110719T110541.036Z_tbb.h5 | \
+  sed -r -e 's/^ATTRIBUTE "([[:alnum:]_]+\/)*([[:alnum:]_]+)"/ATTRIBUTE "\2"/' > \
+    L121212_CS011_D20110719T110541.036Z_tbb.h5.selected-attribs.txt || status=1
+
+diff -b L121212_CS011_D20110719T110541.036Z_tbb.h5.selected-attribs.txt tTBB_Writer-transient.in_1/L121212_CS011_D20110719T110541.036Z_tbb.h5.selected-attribs.txt || status=1
+
+# Check .raw file vs a reference output
+diff L121212_CS011_RSP001_RCU010_D20110719T110541.036Z_tbb.raw tTBB_Writer-transient.in_1/tTBB_Writer-transient-refout.raw || status=1
+
+
+if [ $status -eq 1 ]; then
+  echo
+  echo "Printing all (1000) TBB input frames to ease debugging / test fixing"
+  tbb-printframes tTBB_Writer-transient.in_1/rw_20110719_110541_1110.dat 1000
+else
+  rm -f L121212_CS011_D20110719T110541.036Z_tbb.h5 L121212_CS011_RSP001_RCU010_D20110719T110541.036Z_tbb.raw L121212_CS011_D20110719T110541.036Z_tbb.h5.selected-attribs.txt
+fi
+
+[ $status -eq 0 ]
diff --git a/RTCP/Cobalt/OutputProc/test/tTBB_Writer-transient.sh b/RTCP/Cobalt/OutputProc/test/tTBB_Writer-transient.sh
new file mode 100755
index 0000000000000000000000000000000000000000..aacdaf5fc76da35e00548a0405a68e68d14a5a1a
--- /dev/null
+++ b/RTCP/Cobalt/OutputProc/test/tTBB_Writer-transient.sh
@@ -0,0 +1,2 @@
+#!/bin/sh
+./runctest.sh tTBB_Writer-transient
diff --git a/RTCP/Cobalt/OutputProc/test/tTBB_Writer-verify.py b/RTCP/Cobalt/OutputProc/test/tTBB_Writer-verify.py
deleted file mode 100755
index fe154751e2b518d0503a774346ad547f8a40e4d3..0000000000000000000000000000000000000000
--- a/RTCP/Cobalt/OutputProc/test/tTBB_Writer-verify.py
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/usr/bin/env python
-
-# Placeholder Python script for a DAL TBB validation tool.
-
-import sys
-import DAL
-
-def main():
-  if len(sys.argv) != 2:
-    print 'Usage: ', sys.argv[0], 'L12345_xxx_tbb.h5'
-    return 1
-
-  filename = sys.argv[0]
-
-  f = DAL.TBB_File(filename)
-
-
-  print 'TBB file exists'
-  return 0
-
-if __name__ == '__main__':
-  sys.exit(main())
-
diff --git a/RTCP/Cobalt/OutputProc/test/tTBB_Writer.sh b/RTCP/Cobalt/OutputProc/test/tTBB_Writer.sh
deleted file mode 100755
index 8b8025588fade4b803f5bdced7b6b0a6dd7040ae..0000000000000000000000000000000000000000
--- a/RTCP/Cobalt/OutputProc/test/tTBB_Writer.sh
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/bin/bash
-
-# Test the TBB_Writer.
-# Use named pipes (FIFOs) to test multi-threaded writes (not possible with single stream stdin)
-# and to have automatic flow-control (unlike with udp-copy).
-#
-# The TBB validation tool from DAL does some checks on the HDF5 output file. (for the mo, done by a minimal script)
-#
-
-touch tTBB_Writer.log
-
-nstreams = 6    # the nr of RSPs in NL stations
-
-parsetfilename = "tTBB_Writer-transient.parset" # does not belong to the test data, but good enough to test
-declare -a rawinfilenames
-outfilename = "unk.h5"
-declare -a rawoutfilenames
-for (( i = 0 ; i < $nstreams ; i++ )) ;
-do
-  ${rawinfilenames[$i]}  = "unkin$i.dat"
-  ${rawoutfilenames[$i]} = "unk$i.raw"
-  mknod tTBB_Writer_stream$i.pipe p 2>&1 >> tTBB_Writer.log
-  cat ${rawinfilenames[$i]} > tTBB_Writer_stream$i.pipe &
-done
-
-./runctest.sh TBB_Writer --parsetfile=$parsetfilename --timeout=1 --keeprunning=0
-
-# Ideally, we use h5check first to verify that the file is a proper hdf5 file,
-# but h5check is a separate util and usually not installed, so check content straight away.
-
-#can use lofar_tbb_headerinfo.py for a first guess/test
-./tTBB_Writer-verify.py $outfilename 2>&1 >> tTBB_Writer.log
-STATUS = $?
-
-rm -f $outh5filename 2>&1 >> tTBB_Writer.log
-for (( i = 0 ; i < $nstreams ; i++ )) ;
-do
-  rm -f ${rawoutfilename[$i]} 2>&1 >> tTBB_Writer.log
-  rm tTBB_Writer_stream$i.pipe 2>&1 >> tTBB_Writer.log
-done
-
-exit $STATUS
-
diff --git a/SAS/DataManagement/CMakeLists.txt b/SAS/DataManagement/CMakeLists.txt
index fce112713ead179b910363ef4999ad448d884c16..8e9c9cef98fc0e5dc77d65858a4439182af646a5 100644
--- a/SAS/DataManagement/CMakeLists.txt
+++ b/SAS/DataManagement/CMakeLists.txt
@@ -3,3 +3,4 @@
 lofar_add_package(DataManagementCommon)
 lofar_add_package(StorageQueryService)
 lofar_add_package(Cleanup)
+lofar_add_package(ResourceTool)
diff --git a/SAS/DataManagement/Cleanup/CleanupClient/rpc.py b/SAS/DataManagement/Cleanup/CleanupClient/rpc.py
index a01a3c7c63ba73f42385269ae99933cfcda54081..fbb243848e6ee832b4c321174633c757cc70b250 100644
--- a/SAS/DataManagement/Cleanup/CleanupClient/rpc.py
+++ b/SAS/DataManagement/Cleanup/CleanupClient/rpc.py
@@ -19,8 +19,8 @@ class CleanupRPC(RPCWrapper):
     def removePath(self, path):
         return self.rpc('RemovePath', path=path)
 
-    def removeTaskData(self, otdb_id, delete_is=True, delete_cs=True, delete_uv=True, delete_im=True, delete_img=True, delete_pulp=True, delete_scratch=True):
-        return self.rpc('RemoveTaskData', otdb_id=otdb_id, delete_is=delete_is, delete_cs=delete_cs, delete_uv=delete_uv, delete_im=delete_im, delete_img=delete_img, delete_pulp=delete_pulp, delete_scratch=delete_scratch)
+    def removeTaskData(self, otdb_id, delete_is=True, delete_cs=True, delete_uv=True, delete_im=True, delete_img=True, delete_pulp=True, delete_scratch=True, force=False):
+        return self.rpc('RemoveTaskData', otdb_id=otdb_id, delete_is=delete_is, delete_cs=delete_cs, delete_uv=delete_uv, delete_im=delete_im, delete_img=delete_img, delete_pulp=delete_pulp, delete_scratch=delete_scratch, force=force)
 
     def setTaskDataPinned(self, otdb_id, pinned=True):
         return self.rpc('SetTaskDataPinned', otdb_id=otdb_id, pinned=pinned)
@@ -38,7 +38,8 @@ def main():
     # Check the invocation arguments
     parser = OptionParser('%prog [options] <otdb_id>',
                           description='do cleanup actions on cep4 from the commandline')
-    parser.add_option('-d', '--delete', dest='delete', action='store_true', help='delete the data for the given otdb_id')
+    parser.add_option('-d', '--delete', dest='delete', action='store_true', help='delete the data for the given otdb_id (see also --force option)')
+    parser.add_option('-f', '--force', dest='force', action='store_true', help='in combination with --delete, always delete the data even when safety checks block deletion. (But pinned data is still kept, even when this force flag is supplied.)')
     parser.add_option('-p', '--pin', dest='pin', action='store_true', help='pin the data for the given otdb_id')
     parser.add_option('-u', '--unpin', dest='unpin', action='store_true', help='unpin the data for the given otdb_id')
     parser.add_option('-q', '--broker', dest='broker', type='string', default=None, help='Address of the qpid broker, default: localhost')
@@ -74,7 +75,7 @@ def main():
                 paths = scratch_paths + [path]
                 print "This will delete everything in '%s'." % ', '.join(paths)
                 if raw_input("Are you sure? (y/n) ") == 'y':
-                    result = rpc.removeTaskData(otdb_id)
+                    result = rpc.removeTaskData(otdb_id, force=options.force)
                     print
                     if not result['deleted']:
                         print 'Could not delete data for task with otdb_id=%s' % otdb_id
diff --git a/SAS/DataManagement/Cleanup/CleanupService/service.py b/SAS/DataManagement/Cleanup/CleanupService/service.py
index 813765b0139f8d5465276f9c96f92dda55262ac6..d3db29de28ba281794f382109e4b15f4395b56c9 100644
--- a/SAS/DataManagement/Cleanup/CleanupService/service.py
+++ b/SAS/DataManagement/Cleanup/CleanupService/service.py
@@ -147,8 +147,8 @@ class CleanupHandler(MessageHandlerInterface):
         except Exception as e:
             logger.error(str(e))
 
-    def _removeTaskData(self, otdb_id, delete_is=True, delete_cs=True, delete_uv=True, delete_im=True, delete_img=True, delete_pulp=True, delete_scratch=True):
-        logger.info("Remove task data for otdb_id %s" % (otdb_id,))
+    def _removeTaskData(self, otdb_id, delete_is=True, delete_cs=True, delete_uv=True, delete_im=True, delete_img=True, delete_pulp=True, delete_scratch=True, force=False):
+        logger.info("Remove task data for otdb_id %s, force=%s" % (otdb_id, force))
 
         if not isinstance(otdb_id, int):
             message = "Provided otdb_id is not an int"
@@ -183,14 +183,15 @@ class CleanupHandler(MessageHandlerInterface):
             ingestable_dataproducts = [dp for dp in dataproducts if dp['status'] not in [None, 'has_data', 'no_data', 'populated'] ]
             ingested_dataproducts = [dp for dp in ingestable_dataproducts if dp['status'] == 'ingested']
 
-            if len(ingestable_dataproducts) > 0 and len(ingested_dataproducts) < len(ingestable_dataproducts) :
-                uningested_dataproducts = [dp for dp in ingestable_dataproducts if dp['status'] != 'ingested']
-                message = "Task otdb_id=%s has un-ingested dataproducts. Not deleting data." % (task['otdb_id'],)
-                logger.error(message)
-                self._sendNotification(subject='TaskDeleted', content={'deleted': False,
-                                                                       'otdb_id': otdb_id,
-                                                                       'message': message})
-                return {'deleted': False, 'message': message}
+            if not force:
+                if len(ingestable_dataproducts) > 0 and len(ingested_dataproducts) < len(ingestable_dataproducts):
+                    uningested_dataproducts = [dp for dp in ingestable_dataproducts if dp['status'] != 'ingested']
+                    message = "Task otdb_id=%s has un-ingested dataproducts. Not deleting data." % (task['otdb_id'],)
+                    logger.error(message)
+                    self._sendNotification(subject='TaskDeleted', content={'deleted': False,
+                                                                        'otdb_id': otdb_id,
+                                                                        'message': message})
+                    return {'deleted': False, 'message': message}
 
         path_result = self.path_resolver.getPathForOTDBId(otdb_id)
         if path_result['found']:
diff --git a/SAS/DataManagement/DataManagementCommon/path.py b/SAS/DataManagement/DataManagementCommon/path.py
index 79fad13232249dfd1ded423f364222e2dc0a86b4..a10309793c0ac8ab6a9457f0e07842ec85a12573 100644
--- a/SAS/DataManagement/DataManagementCommon/path.py
+++ b/SAS/DataManagement/DataManagementCommon/path.py
@@ -71,9 +71,10 @@ class PathResolver:
             project_path = result['path']
             task = result['task']
             task_data_path = os.path.join(project_path, 'L%s' % task['otdb_id'])
-            logger.info("found path '%s' for otdb_id=%s mom_id=%s radb_id=%s" % (task_data_path, task['otdb_id'], task['mom_id'], task['id']))
+            logger.info("constructed path '%s' for otdb_id=%s mom_id=%s radb_id=%s" % (task_data_path, task['otdb_id'], task['mom_id'], task['id']))
 
-            path_result = {'found': True, 'message': '', 'path': task_data_path}
+            path_result = {'found': True, 'message': '', 'path': task_data_path,
+                           'radb_id': task.get('id'), 'mom_id': task.get('mom_id'), 'otdb_id': task.get('otdb_id')}
 
             if include_scratch_paths and task['type'] == 'pipeline':
                 path_result['scratch_paths'] = []
@@ -91,6 +92,8 @@ class PathResolver:
             logger.info("result for getPathForTask(radb_id=%s, mom_id=%s, otdb_id=%s): %s", radb_id, mom_id, otdb_id, path_result)
             return path_result
 
+        result = {'found': False, 'message': result.get('message', ''), 'path': '',
+                  'radb_id': radb_id, 'mom_id': mom_id, 'otdb_id': otdb_id}
         logger.warn("result for getPathForTask(radb_id=%s, mom_id=%s, otdb_id=%s): %s", radb_id, mom_id, otdb_id, result)
         return result
 
diff --git a/SAS/DataManagement/ResourceTool/CMakeLists.txt b/SAS/DataManagement/ResourceTool/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..06741de4b7b05ca0990b38b077c4f25587892028
--- /dev/null
+++ b/SAS/DataManagement/ResourceTool/CMakeLists.txt
@@ -0,0 +1,16 @@
+# $Id$
+
+lofar_package(ResourceTool 1.0 DEPENDS ResourceAssignmentService PyCommon)
+
+lofar_find_package(Python 2.6 REQUIRED)
+include(PythonInstall)
+
+set(_py_files
+  resourcetool.py
+)
+
+python_install(${_py_files} DESTINATION lofar/sas/datamanagement/resourcetool)
+
+lofar_add_bin_scripts(resourcetool)
+
+add_subdirectory(test)
diff --git a/SAS/DataManagement/ResourceTool/resourcetool b/SAS/DataManagement/ResourceTool/resourcetool
new file mode 100755
index 0000000000000000000000000000000000000000..db60d0a3b1e7ecdd80a8bb044fa6eb413ad9d678
--- /dev/null
+++ b/SAS/DataManagement/ResourceTool/resourcetool
@@ -0,0 +1,13 @@
+#!/usr/bin/env python
+
+'''
+Simple utility to list or update RADB resource availability values.
+Essentially a tool around RADB getResources(), updateResourceAvailability(),
+  getResourceClaims() and (parts of) updateResourceClaims().
+See the resourcetool.py module for more info.
+'''
+
+if __name__ == '__main__':
+    from sys import argv, exit
+    from lofar.sas.datamanagement.resourcetool.resourcetool import main
+    exit(main(argv[1:]))
diff --git a/SAS/DataManagement/ResourceTool/resourcetool.py b/SAS/DataManagement/ResourceTool/resourcetool.py
new file mode 100755
index 0000000000000000000000000000000000000000..1a143897b2cd131b474a5c62830f65c5005a03b4
--- /dev/null
+++ b/SAS/DataManagement/ResourceTool/resourcetool.py
@@ -0,0 +1,463 @@
+#!/usr/bin/env python
+# Copyright (C) 2017
+# ASTRON (Netherlands Institute for Radio Astronomy)
+# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
+#
+# This file is part of the LOFAR software suite.
+# The LOFAR software suite 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 3 of the
+# License, or (at your option) any later version.
+#
+# The LOFAR software suite 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 the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
+#
+# $Id$
+
+"""
+resourcetool.py
+
+Simple utility to list or update RADB resource availability values.
+Essentially a tool around RADB getResources(), updateResourceAvailability(), getResourceClaims() and (parts of) updateResourceClaims().
+
+Can also figure out available capacity for a mounted storage resource and update it in the RADB (-U/--update-available-storage-capacity option).
+Can also update storage claim endtime to its task endtime (if ended) in the RADB (-E/--end-past-tasks-storage-claims option).
+Examples (source lofarinit.sh to set LOFARROOT, PYTHONPATH, ...):
+- Update available (local) storage capacity and set storage claim endtimes to task endtimes (if ended) for an observation storage node, e.g. via cron in operations:
+    source /opt/lofar/lofarinit.sh; LOFARENV=PRODUCTION /opt/lofar/bin/resourcetool --broker=scu001.control.lofar --end-past-tasks-storage-claims --update-available-storage-capacity
+- Show all DRAGNET resources on the test system RADB:
+    LOFARENV=TEST resourcetool --broker=scu199.control.lofar --resource-group-root=DRAGNET
+- Deactivate 2 storage resources in operations, because disks from both storage areas are found to be faulty (then still need to re-schedule tasks):
+    LOFARENV=PRODUCTION resourcetool --broker=scu001.control.lofar drg01_storage:/data1=False drg01_storage:/data2=False
+
+NOTES:
+! Be careful what system (operations or test) this command applies to! This can be set using the env vars LOFARENV=TEST or LOFARENV=PRODUCTION
+  Operations vs Test (vs Development) can be seen from the default RADB_BUSNAME in the usage info: lofar.* vs test.lofar.* vs devel.lofar.*
+! By default, listed or updateable resources are restricted to resources under the localhost's resource group.
+  This is on purpose to make -U work correctly. The -G/--resource-group-root option can be used to widen the resource group scope for listing
+  or explicit command-line updates, but non-default -G with -U is rejected: it is too easy to mass-update other resources with local filesystem info.
+"""
+
+import logging
+from datetime import datetime, timedelta
+
+from lofar.sas.resourceassignment.resourceassignmentservice.rpc import RARPC
+from lofar.sas.resourceassignment.resourceassignmentservice.config import DEFAULT_BUSNAME as RADB_BUSNAME  # depends on env (operations or test sys)
+from lofar.sas.resourceassignment.resourceassignmentservice.config import DEFAULT_SERVICENAME as RADB_SERVICENAME
+from lofar.common.util import humanreadablesize
+
+logging.basicConfig(format='%(asctime)s %(levelname)s %(message)s', level=logging.WARN)
+logger = logging.getLogger(__name__)
+
+def printResources(resources, scaled_units=True):
+    """ E.g.: resources = [{u'total_capacity': 3774873600, u'name': u'dragproc_bandwidth:/data', u'type_id': 3,
+                            u'available_capacity': 3774873600, u'type_name': u'bandwidth', u'unit_id': 3,
+                            u'active': True, u'used_capacity': 0, u'id': 118, u'unit': u'bits/second',
+                            'claimable_capacity': 3774873600}, ...]  # this key was added (not from RADB); it can be negative!
+    """
+    header = {'id': 'RId', 'name': 'Resource Name', 'active': 'Active',
+              'available_capacity': ' Avail. Capacity', 'claimable_capacity': '  Claimable Cap.',
+              'total_capacity': '  Total Capacity', 'unit': 'Unit'}
+    print('{id:4s} {name:24s} {active:6s} {available_capacity} {claimable_capacity} {total_capacity} {unit}'.format(**header))
+    print('===================================================================================================')
+    resources.sort(key=lambda r: r['id'])  # SQL could have done this better
+    for res in resources:
+        res['active'] = 'True' if res['active'] else 'False'  # to solve bool formatting issue
+
+        if scaled_units and (res['type_name'] == 'storage' or res['type_name'] == 'bandwidth'):
+            unit_base = 1024 if res['type_name'] == 'storage' else 1000  # check type_name instead of unit as in printClaims()
+            res['available_capacity'] = humanreadablesize(res['available_capacity'], '', unit_base)
+            res['claimable_capacity'] = humanreadablesize(res['claimable_capacity'], '', unit_base)
+            res['total_capacity']     = humanreadablesize(res['total_capacity']    , '', unit_base)
+            cap_conv = '>16s'
+        else:
+            cap_conv = '16d'
+
+        print(('{id:4d} {name:24s} {active:6s} {available_capacity:' + cap_conv +
+               '} {claimable_capacity:' + cap_conv + '} {total_capacity:' + cap_conv + '} {unit}').format(**res))
+    if not resources:
+        print('<no resources>')
+
+def printClaims(claims, scaled_units=True):
+    """ E.g.: claims = [{u'claim_size': 76441190400, u'endtime': datetime.datetime(2018, 6, 13, 17, 40),
+                         u'id': 67420, u'resource_id': 122, u'resource_name': u'drg01_storage:/data1',
+                         u'resource_type_id': 5, u'resource_type_name': u'storage',
+                         u'starttime': datetime.datetime(2017, 6, 13, 17, 30),
+                         u'status': u'claimed', u'status_id': 1, u'task_id': 75409, ...}, ...]
+    """
+    header = {'id': 'ClId', 'resource_name': 'Resource Name', 'starttime': 'Start Time', 'endtime': 'End Time',
+              'claim_size': 'Claim Size', 'status': 'Status'}
+    print('{id:7s} {resource_name:24s} {starttime:19s} {endtime:19s} {claim_size:16s} {status:8s}'.format(**header))
+    print('===================================================================================================')
+    claims.sort(key=lambda c: c['id'])         # secondary sorting key; SQL could have done this better
+    claims.sort(key=lambda c: c['starttime'])  # primary sorting key (stable sort)
+    for claim in claims:
+        if scaled_units and (claim['resource_type_name'] == 'storage' or claim['resource_type_name'] == 'bandwidth'):
+            unit_base = 1024 if claim['resource_type_name'] == 'storage' else 1000  # no unit name here, so check type_name
+            claim['claim_size'] = humanreadablesize(claim['claim_size'], '', unit_base)
+            size_conv = '>16s'
+        else:
+            size_conv = '16d'
+
+        print(('{id:7d} {resource_name:24s} {starttime} {endtime} {claim_size:' + size_conv +
+               '} {status:8s}').format(**claim))
+    if not claims:
+        print('<no claims on specified resources and time range>')
+
+def updateStorageClaimsEndTime(radb, resources, storage_resource_type_id):
+    """ Update storage claims on resources in the RADB that currently apply, but the task
+        they belong to has ended (+ a short while). Set end time of these claims to task endtime.
+
+        This is intended for user clusters (e.g. DRAGNET) that do not auto-terminate storage claims on
+        cleanup. If users manage clean up autonomously, then they manage all storage accounting themselves.
+    """
+    status = 0
+
+    resource_ids = [res['id'] for res in resources]
+    now = datetime.utcnow()
+    claims = radb.getResourceClaims(lower_bound=now, upper_bound=now,
+                                    resource_ids=resource_ids,
+                                    resource_type=storage_resource_type_id)
+
+    # Get associated tasks for their end times. Update claims for tasks that ended.
+    task_ids = list({claim['task_id'] for claim in claims})
+    tasks = radb.getTasks(task_ids=task_ids)
+    for task in tasks:
+        # Wait until task ended. Do not race with OTDBtoRATaskStatusPropagator that extends storage claim endtime.
+        # We effectively undo that extension here. Intended for clusters (e.g. DRAGNET) where end users manage storage.
+        new_endtime = task['endtime']
+        if now < new_endtime + timedelta(minutes=1):
+            continue
+
+        claim_ids = [claim['id'] for claim in claims if claim['task_id'] == task['id'] and \
+                                                        claim['endtime'] > new_endtime]
+        print("Updating RADB storage claims {} endtime to {}".format(claim_ids, new_endtime))
+        updated_dict = radb.updateResourceClaims(where_resource_claim_ids=claim_ids, endtime=new_endtime)
+        if not updated_dict['updated']:
+            logger.error('failed to update RADB storage claims')  # why is N/A here; check the RA logs
+            status = 1
+
+    return status
+
+def updateResource(radb, resource):
+    """ Update the RADB using the resource dict. """
+    print("Updating RADB with resource {}".format(resource))
+    updated_dict = radb.updateResourceAvailability(resource_id=resource['id'], active=resource['active'],
+                                                   available_capacity=resource['available_capacity'],
+                                                   total_capacity=resource['total_capacity'])
+    if not updated_dict['updated']:
+        logger.error('failed to update RADB resource')  # why is N/A here; check the RA logs
+        return 1
+    return 0
+
+def getMountPoint(resource_name):
+    """ E.g. with resource_name 'CEP4_storage:/data' or 'drg15_bandwidth:/data2' or 'CS002bw0',
+        this function returns: '/data' or '/data2' or None.
+    """
+    sep_idx = resource_name.find(':/')  # mount point must be an abs path
+    if sep_idx == -1:
+        return None
+    return resource_name[sep_idx + 1 : ]
+
+def updateAvailableStorageCapacities(radb, resources):
+    import os
+    status = 0
+
+    for res in resources:
+        # All storage resource names are supposedly mount points.
+        # But do not update with the wrong partition info (sys maintenance?).
+        # Log error and let admin figure it out. RADB resource defaults may need updating too.
+        mount_pt = getMountPoint(res['name'])
+        if mount_pt is None or not os.path.ismount(mount_pt):
+            logger.error("skipped updating available capacity of resource '{}': its path is not a mount point on this system".format(res['name']))
+            status = 1
+            continue
+
+        # Retrieve avail capacity from filesystem and do some checks.
+        try:
+            st = os.statvfs(mount_pt)
+        except OSError as e:
+            logger.error('statvfs: ' + str(e))
+            status = 1
+            continue
+        avail_cap = st.f_bavail * st.f_frsize
+        total_cap = st.f_blocks * st.f_frsize
+        if total_cap != res['total_capacity']:
+            hint_arg = res['name'] + '=' + str(avail_cap) + ',' + str(total_cap)
+            logger.warn("total capacity for resource '{}' is {}, which is not equal to {} as listed in the RADB. If the total capacity has changed permanently, please update the RADB, e.g. by running this program passing: {} (and by updating the software repo for RADB reinstalls).".format(res['name'], total_cap, res['total_capacity'], hint_arg))
+        if avail_cap > res['total_capacity']:
+            logger.error("the detected available capacity for resource '{}' cannot be written to the RADB, because it is greater than the total capacity listed in the RADB.")
+            status = 1
+            continue
+
+        # Only update available capacity in the RADB.
+        # Total and active indicate a config change (or maintenance in progress). Leave that for an admin.
+        res_update = {'id': res['id'], 'available_capacity': avail_cap,
+                      'total_capacity': None, 'active': None}
+        status |= updateResource(radb, res_update)
+
+    return status
+
+def updateSpecifiedCapacities(radb, resources, resource_updates):
+    status = 0
+
+    for res_update in resource_updates:
+        # Need resource id from name to apply the update. Also check avail <= total.
+        try:
+            res = next((res for res in resources if res['name'] == res_update['name']))
+        except StopIteration:
+            logger.error("skipped updating resource '{}': name unknown. Correct the name or (correct the) use (of) the -G/--resource-group-root option to widen the resource scope, e.g. -G CEP4|DRAGNET|LOFAR".format(res_update['name']))
+            status = 1
+            continue
+
+        if res_update['available_capacity'] is not None and \
+           res_update['total_capacity'] is None and \
+           res_update['available_capacity'] > res['total_capacity']:
+            logger.error("skipped updating resource '{}': specified available capacity cannot be greater than total capacity listed in the RADB. If the total capacity has changed permanently, please update the RADB using this program (and by updating the software repo for RADB reinstalls)".format(res_update['name']))
+            status = 1
+            continue
+
+        res_update['id'] = res['id']
+        status |= updateResource(radb, res_update)
+
+    return status
+
+def getResourceGroupIdByName(db_rgp2rgp, name):
+    """ Returns group id of resource group named name, or None if name was not found.
+        The search happens breadth-first.
+    """
+    # find root group(s): empty parent list
+    gids = [gid for gid, group in db_rgp2rgp.items() if not group['parent_ids']]
+
+    i = 0
+    while i < len(gids):  # careful iterating while modifying
+        res_group = db_rgp2rgp[gids[i]]
+        if res_group['resource_group_name'] == name:
+            return gids[i]
+        gids.extend(res_group['child_ids'])
+        i += 1
+
+    return None
+
+def getSubtreeResourceIdList(db_rgp2rgp, root_gid):
+    """ Returns list of resource ids in resource group root_gid and its (grand)children."""
+    # Search breadth-first starting at root_gid.
+    gids = [root_gid]
+    resource_id_list = []
+
+    i = 0
+    while i < len(gids):  # careful iterating while modifying
+        res_group = db_rgp2rgp[gids[i]]
+        resource_id_list.extend(res_group['resource_ids'])
+        gids.extend(res_group['child_ids'])
+        i += 1
+
+    return resource_id_list
+
+def parseResourceArg(arg):
+    """ Return dict parsed from arg str. Arg format: resource_name:/data=True,100,200
+        with any value optional after the '=' (but need at least one).
+        Any returned dict value but the resource name may be None.
+        On error ValueError is raised.
+    """
+    eq_idx = arg.find('=')
+    if eq_idx == -1:
+        raise ValueError("could not find '=' in argument; need e.g. res_name=100 or resource_name=True,100,200")
+
+    resource_name = arg[ : eq_idx]
+    if not resource_name:
+        raise ValueError("invalid resource name in argument before '='; need e.g. res_name=100 or resource_name=True,100,200")
+    resource_val = arg[eq_idx + 1 : ]
+    vals = resource_val.split(',')
+    if not vals or len(vals) > 3:
+        raise ValueError("need 1-3 argument value(s) after '=', e.g. res_name=100 or resource_name=True,100,200")
+
+    active = None
+    avail_cap = None
+    total_cap = None
+    for val in vals:
+        if val == 'True' or val == 'False':
+            if active is not None:
+                raise ValueError("accepting at most 1 bool as resource active value in argument")
+            active = True if val == 'True' else False
+            continue
+
+        if total_cap is not None:
+            raise ValueError("accepting at most 2 ints as resource available and total capacities in argument")
+        v = int(val)
+        if v < 0:
+            raise ValueError("capacity value must be positive")
+        if avail_cap is None:
+            avail_cap = v
+        else:
+            if v < avail_cap:
+                raise ValueError("specified available capacity cannot be greater than specified total capacity")
+            total_cap = v
+
+    return {'name': resource_name, 'active': active,
+            'available_capacity': avail_cap, 'total_capacity': total_cap}
+
+def parseTimestamps(datetime_fmt, timestamps):
+    """ Return list of None or datetime objects representing timestamps. Raise ValueError on parse error.
+        Use datetime_fmt as the strptime() format str. A timestamp value may also be 'now' (UTC) or 'None'.
+    """
+    # Parsing datetime strings could be done by extending optparse's Option class, but this works well enough
+    rv = []
+    now = None
+
+    for ts in timestamps:
+        if ts is None or ts == 'now':
+            if now is None:
+                now = datetime.utcnow()
+            ts = now
+        elif ts == 'None':
+            ts = None
+        else:
+            ts = datetime.strptime(ts, datetime_fmt)
+        rv.append(ts)
+
+    return rv
+
+def parseArgs(args):
+    from socket import gethostname 
+    hostname = gethostname()
+
+    from optparse import OptionParser
+    usage = 'Usage: %prog [OPTIONS] [resource_name=available_capacity]... or [resource_name=True|False[,avail_cap[,total_cap]]]...'
+    descr = 'List or update LOFAR RADB resource availability and/or available/total capacities'
+    parser = OptionParser(usage=usage, description=descr)
+    # already supported options: -h, --help, --
+    parser.add_option('-q', '--broker', dest='broker',
+                      help='qpid broker hostname (default: localhost).')
+    parser.add_option('--radb_busname', dest='radb_busname', default=RADB_BUSNAME,
+                      help='Name of the bus on which the RADB service listens (default: %default)')
+    parser.add_option('--radb_servicename', dest='radb_servicename', default=RADB_SERVICENAME,
+                      help='Name of the RADB service (default: %default)')
+    parser.add_option('-G', '--resource-group-root', dest='resource_group_root', default=hostname,
+                      help='Only consider resources under resource group root (default: this hostname: \'%default\' (all=LOFAR))')
+    parser.add_option('-t', '--resource-type', dest='resource_type', default=None,
+                      help='Only consider resources of this type (e.g. storage, bandwidth, rsp, rcu, ...)')
+    parser.add_option('-E', '--end-past-tasks-storage-claims', dest='end_storage_claims', action='store_true', default=False,
+                      help='Set end time to task stoptime for storage claims under --resource-group-root for completed tasks. Implies -t storage. Not affected by -T and -S.')
+    parser.add_option('-U', '--update-available-storage-capacity', dest='update_avail', action='store_true', default=False,
+                      help='Update the available capacity value in the RADB of storage resources under --resource-group-root. Implies -t storage. Not affected by -T and -S.')
+    datetime_fmt = '%Y-%m-%d %H:%M:%S'
+    parser.add_option('-T', '--timestart', dest='timestart',
+                      help='lower bound UTC timestamp \'{}\' or \'now\' or \'None\' for resource claims (default: now)'.format(datetime_fmt))
+    parser.add_option('-S', '--timestop', dest='timestop',
+                      help='upper bound UTC timestamp \'{}\' or \'now\' or \'None\' for resource claims (default: now)'.format(datetime_fmt))
+    parser.add_option('--no-scaled-units', dest='no_scaled_units', action='store_true', default=False,
+                      help='Print raw instead of scaled units for some sizes, e.g. 1048576 instead of 1M')
+    options, left_over_args = parser.parse_args(args)
+
+    if options.update_avail and options.resource_group_root != hostname:
+        parser.error("combining the option -U with a non-default -G is rejected: it is too easy to mass-update the wrong resources")
+
+    if options.end_storage_claims or options.update_avail:
+        if options.resource_type is None:
+            options.resource_type = 'storage'
+        elif options.resource_type != 'storage':
+            parser.error("the options -E or -U cannot be combined with -t {}, because -E and -U are about storage only".format(options.resource_type))
+
+    try:
+        timestamps = parseTimestamps(datetime_fmt, (options.timestart, options.timestop))
+    except ValueError as exc:
+        parser.error("timestamp arguments: " + exc.message)
+    options.timestart = timestamps[0]
+    options.timestop  = timestamps[1]
+    if options.timestart is not None and options.timestop is not None and options.timestart > options.timestop:
+        parser.error("-T/--timestart option value may not be after -S/--timestop option value")
+
+    resource_updates = []
+    for i, arg in enumerate(left_over_args):
+        try:
+            resource_updates.append(parseResourceArg(arg))
+        except ValueError as exc:
+            parser.error("failed to parse non-option argument '{}': {}".format(i, exc.message))
+
+    return options, resource_updates, parser.print_help
+
+def main(args):
+    import os
+    os.environ['TZ'] = 'UTC'  # LOFAR observatory software uses UTC
+
+    options, resource_updates, print_help_func = parseArgs(args)
+
+    status = 0
+    radb = None
+    try:
+        radb = RARPC(options.radb_busname, options.radb_servicename, options.broker)
+
+        db_resource_list = radb.getResources(resource_types=options.resource_type, include_availability=True)
+
+        # Filter resource list via resource root group option
+        db_resource_group_mships = radb.getResourceGroupMemberships()
+        db_rgp2rgp = db_resource_group_mships['groups']  # resource-group-to-resource-group relations
+        group_id = getResourceGroupIdByName(db_rgp2rgp, options.resource_group_root)
+        if group_id is None:
+            print_help_func()
+            print("")
+            logger.error("could not find resource group '{}'. You may want to (correct the) use (of) the -G/--resource-group-root option to widen the resource scope, e.g. -G CEP4|DRAGNET|LOFAR".format(options.resource_group_root))
+            return 1
+        resource_id_list = getSubtreeResourceIdList(db_rgp2rgp, group_id)
+        if not resource_id_list:
+            print_help_func()
+            print("")
+            logger.error("no resources found under resource group '{}' and its (grand)children".format(options.resource_group_root))
+            return 1
+        resources = [res for res in db_resource_list if res['id'] in resource_id_list]  # SQL could have done this better
+
+        if options.end_storage_claims:
+            try:
+                storage_resource_type_id = next((res['type_id'] for res in resources))
+            except StopIteration:
+                print_help_func()
+                print("")
+                logger.error("-E/--end-past-tasks-storage-claims used, but no storage resources found under resource group '{}' and its (grand)children".format(options.resource_group_root))
+                return 1
+
+            status |= updateStorageClaimsEndTime(radb, resources, storage_resource_type_id)
+
+        if options.update_avail:
+            status |= updateAvailableStorageCapacities(radb, resources)
+
+        if resource_updates:
+            status |= updateSpecifiedCapacities(radb, resources, resource_updates)
+
+        # If no specific action requested, print list of resources and claims
+        if not options.end_storage_claims and not options.update_avail and not resource_updates:
+            resource_ids = [res['id'] for res in resources]
+            claims = radb.getResourceClaims(lower_bound=options.timestart, upper_bound=options.timestop,
+                                            resource_ids=resource_ids, extended=True)
+
+            # A small downside of querying RADB again is that the claimable capacities might be inconsistent with claims just retrieved.
+            # We could derive it ourselves or stick it in a transaction, but this is good enough for the overview.
+            if options.timestart is None:  # not allowed by get_resource_claimable_capacity()
+                options.timestart = datetime.min
+            if options.timestop is None:  # not allowed by get_resource_claimable_capacity()
+                options.timestop = datetime(9999, 12, 31, 23, 59, 59)  # datetime.max is problematic wrt conversion to a qpid type
+            for res in resources:
+                result_dict = radb.get_resource_claimable_capacity(resource_id=res['id'],
+                                        lower_bound=options.timestart, upper_bound=options.timestop)
+                res['claimable_capacity'] = result_dict['claimable_capacity']
+
+            printResources(resources, not options.no_scaled_units)
+            print("")
+            printClaims(claims, not options.no_scaled_units)
+
+    #except Exception:  # disabled: prefer default stacktrace on bug here
+    finally:
+        if radb is not None:
+            radb.close()
+
+    return status
+
+if __name__ == '__main__':
+    from sys import argv, exit
+    exit(main(argv[1:]))
+
diff --git a/SAS/DataManagement/ResourceTool/test/CMakeLists.txt b/SAS/DataManagement/ResourceTool/test/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..414836c46fdddba2547e5c95e0dcf0ce193d8a6c
--- /dev/null
+++ b/SAS/DataManagement/ResourceTool/test/CMakeLists.txt
@@ -0,0 +1,5 @@
+# $Id$
+include(LofarCTest)
+
+lofar_add_test(tresourcetool)
+
diff --git a/SAS/DataManagement/ResourceTool/test/tresourcetool.py b/SAS/DataManagement/ResourceTool/test/tresourcetool.py
new file mode 100755
index 0000000000000000000000000000000000000000..11ecee163e681f97ec468c15c94e469cc40898a7
--- /dev/null
+++ b/SAS/DataManagement/ResourceTool/test/tresourcetool.py
@@ -0,0 +1,370 @@
+#!/usr/bin/env python
+# Copyright (C) 2017
+# ASTRON (Netherlands Institute for Radio Astronomy)
+# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
+#
+# This file is part of the LOFAR software suite.
+# The LOFAR software suite 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 3 of the
+# License, or (at your option) any later version.
+#
+# The LOFAR software suite 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 the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
+#
+# $Id$
+
+import datetime
+
+
+class RADB_mock:
+    def __init__(self):
+        now = datetime.datetime.utcnow()
+        now = datetime.datetime(now.year, now.month, now.day, now.hour, now.minute, now.second)  # strip milliseconds
+
+        # 2 nodes:
+        #   node1 has bandwidth and storage for mount points /d1-qzy, /d2-qzy
+        #   node2 has bandwidth and (inactive) storage for mount point /d-qzy
+        self.resources = [
+            {u'id': 0, u'name': u'node1_bandwidth:/d1-qzy',
+             u'active': True,
+             u'total_capacity': 1000,
+             u'available_capacity': 1000,
+             u'used_capacity': 0,
+             u'type_id': 3, u'type_name': u'bandwidth',
+             u'unit_id': 3, u'unit': u'bits/second'
+            },
+            {u'id': 1, u'name': u'node1_storage:/d1-qzy',
+             u'active': True,
+             u'total_capacity': 100,
+             u'available_capacity': 90,
+             u'used_capacity': 10,
+             u'type_id': 5, u'type_name': u'storage',
+             u'unit_id': 5, u'unit': u'bytes'
+            },
+            {u'id': 2, u'name': u'node1_bandwidth:/d2-qzy',
+             u'active': True,
+             u'total_capacity': 2000,
+             u'available_capacity': 2000,
+             u'used_capacity': 0,
+             u'type_id': 3, u'type_name': u'bandwidth',
+             u'unit_id': 3, u'unit': u'bits/second'
+            },
+            {u'id': 3, u'name': u'node1_storage:/d2-qzy',
+             u'active': True,
+             u'total_capacity': 200,
+             u'available_capacity': 180,
+             u'used_capacity': 20,
+             u'type_id': 5, u'type_name': u'storage',
+             u'unit_id': 5, u'unit': u'bytes'
+            },
+            {u'id': 4, u'name': u'node2_bandwidth:/d-qzy',
+             u'active': True,
+             u'total_capacity': 2000,
+             u'available_capacity': 2000,
+             u'used_capacity': 0,
+             u'type_id': 3, u'type_name': u'bandwidth',
+             u'unit_id': 3, u'unit': u'bits/second'
+            },
+            {u'id': 5, u'name': u'node2_storage:/d-qzy',
+             u'active': False,  # i.e. inactive by default
+             u'total_capacity': 5000,
+             u'available_capacity': 5000,
+             u'used_capacity': 0,
+             u'type_id': 5, u'type_name': u'storage',
+             u'unit_id': 5, u'unit': u'bytes'
+            },
+
+        ]
+
+        # The root node is INSTRUMENT. Under it 1 cluster named CLUSTER with 2 nodes and the 6 resources listed above.
+        # Note that node1 has 2 resource groups under it (group type 'virtual' but not annotated here) to have
+        # the data1 resources under another group than the data2 resources. This is similar to the real RADB.
+        self.memberships = {u'resources': {0: {u'resource_name': u'node1_bandwidth:/d1-qzy', u'parent_group_ids': [4], u'resource_id': 0},
+                                           1: {u'resource_name': u'node1_storage:/d1-qzy'  , u'parent_group_ids': [4], u'resource_id': 1},
+                                           2: {u'resource_name': u'node1_bandwidth:/d2-qzy', u'parent_group_ids': [5], u'resource_id': 2},
+                                           3: {u'resource_name': u'node1_storage:/d2-qzy'  , u'parent_group_ids': [5], u'resource_id': 3},
+                                           4: {u'resource_name': u'node2_bandwidth:/d-qzy' , u'parent_group_ids': [3], u'resource_id': 4},
+                                           5: {u'resource_name': u'node2_storage:/d-qzy'   , u'parent_group_ids': [3], u'resource_id': 5},
+                                          },
+                            u'groups':    {0: {u'resource_group_id': 0, u'parent_ids': [] , u'resource_ids': [],     u'child_ids': [1]   , u'resource_group_name': u'INSTRUMENT'},
+                                           1: {u'resource_group_id': 1, u'parent_ids': [0], u'resource_ids': [],     u'child_ids': [2, 3], u'resource_group_name': u'CLUSTER'},
+                                           2: {u'resource_group_id': 2, u'parent_ids': [1], u'resource_ids': [],     u'child_ids': [4, 5], u'resource_group_name': u'node1'},
+                                           3: {u'resource_group_id': 3, u'parent_ids': [1], u'resource_ids': [4, 5], u'child_ids': []    , u'resource_group_name': u'node2'},
+                                           4: {u'resource_group_id': 4, u'parent_ids': [2], u'resource_ids': [0, 1], u'child_ids': []    , u'resource_group_name': u'node1-1'},
+                                           5: {u'resource_group_id': 5, u'parent_ids': [2], u'resource_ids': [2, 3], u'child_ids': []    , u'resource_group_name': u'node1-2'},
+                                          }
+                           }
+
+        # 2 tasks
+        self.tasks = [
+            {u'id': 1,
+             u'mom_id': 10,
+             u'otdb_id': 100,
+             u'starttime': now - datetime.timedelta(minutes=15),
+             u'endtime':   now - datetime.timedelta(minutes=5),
+             u'duration': 600.0,
+             u'type': u'observation',
+             u'status_id': 1000,
+             u'status': u'finished',
+             # and more; irrelevant for test
+            },
+            {u'id': 2,
+             u'mom_id': 20,
+             u'otdb_id': 200,
+             u'starttime': now - datetime.timedelta(hours=2),
+             u'endtime':   now - datetime.timedelta(hours=1),
+             u'duration': 3600.0,
+             u'type': u'observation',
+             u'status_id': 1000,
+             u'status': u'finished',
+            },
+        ]
+ 
+        # 3 claims: 1 on the 1st task and 2 on the 2nd task
+        self.claims = [
+            {u'id': 1,
+             u'task_id': 1,
+             u'resource_id': 3, u'resource_name': u'node1_storage:/d2-qzy',
+             u'resource_type_id': 5, u'resource_type_name': u'storage',
+             u'starttime': self.tasks[0]['starttime'],
+             u'endtime':   self.tasks[0]['endtime'] + datetime.timedelta(days=365),  # storage claim end time typically set to task end + 1 yr by the system
+             u'claim_size': 80,
+             u'status_id': 1, u'status': u'claimed',
+            },
+            {u'id': 2,
+             u'task_id': 2,
+             u'resource_id': 4, u'resource_name': 'node2_bandwidth:/d-qzy',
+             u'resource_type_id': 3, u'resource_type_name': u'bandwidth',
+             u'starttime': self.tasks[1]['starttime'],
+             u'endtime':   self.tasks[1]['endtime'],
+             u'claim_size': 8,
+             u'status_id': 1, u'status': u'claimed',
+            },
+            {u'id': 3,
+             u'task_id': 2,
+             u'resource_id': 5, u'resource_name': 'node2_storage:/d-qzy',
+             u'resource_type_id': 5, u'resource_type_name': u'storage',
+             u'starttime': self.tasks[1]['starttime'],
+             u'endtime':   self.tasks[1]['endtime'] + datetime.timedelta(days=365),  # storage claim end time typically set to task end + 1 yr by the system
+             u'claim_size': 3600,
+             u'status_id': 1, u'status': u'claimed',
+            },
+        ]
+
+    def get_resources(self):
+        return self.resources
+
+    def get_memberships(self):
+        return self.memberships
+
+    def get_tasks(self):
+        return self.tasks
+
+    def get_claims(self):
+        return self.claims
+
+# RADB changes stay persistent on purpose after a test program run.
+# Different test program runs are not different tests, but make up a single test, e.g. 'show, modify, show' should display the change.
+# To make different tests, reinitialize this object before each new test sequence.
+radb_mock = RADB_mock()
+
+class RADBRPC_mock:
+    def __init__(self, busname=None, # don't care about any of these here
+                 servicename=None,
+                 broker=None,
+                 timeout=0):
+        global radb_mock
+        self.radb_mock = radb_mock
+        self.is_open = True
+
+    def open(self):
+        self.is_open = True
+
+    def close(self):
+        self.is_open = False
+
+    def __enter__(self):
+        self.open()
+        return self
+
+    def __exit__(self, exc_type, exc_val, exc_tb):
+        self.close()
+
+    # Do approx what the rpc service does. This is sub-optimal, because the code may go out of sync.
+    # Python mock can do autospec on patched functions (we could do similar with the inspect module),
+    # but that doesn't apply to this sort of implementation logic.
+
+    def updateResourceAvailability(self, resource_id, active=None, available_capacity=None,
+                                   total_capacity=None, commit=True):
+        # Only implement some of the function arguments that the system under test may use
+        for res in self.radb_mock.get_resources():
+            if res['id'] == resource_id:
+                if active is not None:
+                    res['active'] = active  # data type not checked here...
+                if available_capacity is not None:
+                    res['available_capacity'] = available_capacity  # idem
+                if total_capacity is not None:
+                    res['total_capacity'] = total_capacity  # idem
+
+                if available_capacity is not None or total_capacity is not None:
+                    res['used_capacity'] = res['total_capacity'] - res['available_capacity']  # idem
+
+                return {u'updated': True, u'resource_id': resource_id}
+
+        raise KeyError(resource_id)
+
+    def getResources(self, resource_ids=None, resource_types=None, include_availability=False,
+                     claimable_capacity_lower_bound=None, claimable_capacity_upper_bound=None):
+        # Only implement some of the function arguments that the system under test may use
+        resources = []
+        for res in self.radb_mock.get_resources():
+            if resource_ids is not None:
+                if isinstance(resource_ids, int):
+                    if res['id'] != resource_ids:
+                        continue
+                elif res['id'] not in resource_ids:
+                    continue
+
+            if resource_types is not None:
+                if isinstance(resource_types, basestring):
+                    if res['type_name'] != resource_types:
+                        continue
+                elif res['type_id'] not in resource_types:
+                    continue
+
+            res2 = dict(res)  # shallow copy is enough
+            if not include_availability:
+                del res2['active']
+                del res2['available_capacity']
+                del res2['total_capacity']
+                del res2['used_capacity']
+
+            resources.append(res2)
+
+        return resources
+
+    def getResourceGroupMemberships(self):
+        from copy import deepcopy
+        return deepcopy(self.radb_mock.get_memberships())
+
+    def getResourceClaims(self, claim_ids=None, lower_bound=None, upper_bound=None,
+                          resource_ids=None, task_ids=None, status=None, resource_type=None,
+                          extended=False, include_properties=False):
+        # Only implement some of the function arguments that the system under test may use
+        # shallow copy is enough
+        return [dict(claim) for claim in self.radb_mock.get_claims() if (claim_ids is None or claim['id'] in claim_ids) and \
+                                                                  (resource_ids is None or claim['resource_id'] in resource_ids) and \
+                                                                  (task_ids is None or claim['task_ids'] in task_ids) and \
+                                                                  (resource_type is None or claim['resource_type_id'] == resource_type) and \
+                                                                  (lower_bound is None or claim['endtime'] >= lower_bound) and \
+                                                                  (upper_bound is None or claim['starttime'] <= upper_bound)]
+
+    def updateResourceClaims(self, where_resource_claim_ids=None, where_task_ids=None, where_resource_types=None,
+                             resource_id=None, task_id=None, starttime=None, endtime=None,
+                             status=None, claim_size=None, username=None, used_rcus=None, user_id=None,
+                             commit=True):
+        # This implementation is greatly simplified vs the real radb updateResourceClaims()! Only what the system under test may use.
+        updated = False
+
+        claims = self.radb_mock.get_claims()
+        for claim in claims:
+            if (where_resource_claim_ids is None or claim['id']               in where_resource_claim_ids) and \
+               (where_task_ids           is None or claim['task_id']          in where_task_ids) and \
+               (where_resource_types     is None or claim['resource_type_id'] in where_resource_types):
+                # don't bother checking if it (still) fits, etc.
+                if starttime is not None:
+                    claim['starttime'] = starttime  # data type not checked here...
+                if endtime is not None:
+                    claim['endtime'] = endtime  # idem
+                if claim_size is not None:
+                    claim['claim_size'] = claim_size  # idem
+                # <more potentially updated values here>
+                updated = True
+
+        return {u'updated': updated}  # there's more in this dict (see ResourceAssignmentService/service.py), but don't bother
+
+    def getTasks(self, lower_bound=None, upper_bound=None, task_ids=None, task_status=None,
+                 task_type=None, mom_ids=None, otdb_ids=None, cluster=None):
+        # Only implement some of the function arguments that the system under test may use
+        if task_ids is not None:
+            # shallow copy is enough
+            return [dict(task) for task in self.radb_mock.get_tasks() if task['id'] in task_ids]
+        return []
+
+    def get_resource_claimable_capacity(self, resource_id, lower_bound, upper_bound):
+        if resource_id is None or lower_bound is None or upper_bound is None:
+            raise ValueError('resource_id and/or lower_bound and/or upper_bound cannot be None')
+
+        # This inefficient implementation is good enough for this mock; the RADB does it better
+        for res in self.radb_mock.get_resources():
+            if res['id'] == resource_id:
+                claimable_cap = res['available_capacity']
+                for claim in self.radb_mock.get_claims():
+                    if claim['resource_id'] == resource_id and \
+                       claim['endtime'] >= lower_bound and claim['starttime'] <= upper_bound:
+                        claimable_cap -= claim['claim_size']
+                return {'claimable_capacity': claimable_cap}
+        return {'claimable_capacity': 0}
+
+
+from sys import exit
+
+import logging
+logging.basicConfig(format='%(asctime)s %(levelname)s %(message)s', level=logging.INFO)
+logger = logging.getLogger(__name__)
+
+# Hook the mock class in place after import and before running the program
+import lofar.sas.datamanagement.resourcetool.resourcetool as rt
+rt.RARPC = RADBRPC_mock
+
+# List all resources and claims (no time range bounds)
+rv = rt.main(['-G', 'INSTRUMENT', '-T', 'None', '-S', 'None'])
+if rv != 0:
+    logger.error('1st listing failed with status {}'.format(rv))
+    exit(1)
+
+# Change a few resources
+rv = rt.main(['-G', 'CLUSTER', 'node1_bandwidth:/d2-qzy=1999', 'node2_storage:/d-qzy=True,9000,10000'])
+if rv != 0:
+    logger.error('changing 2 resources failed with status {}'.format(rv))
+    exit(1)
+
+# Reset end times beyond *now* (if task ended) of some storage claims.
+rv = rt.main(['-G', 'CLUSTER', '-E'])
+if rv != 0:
+    logger.error('adjusting storage claim end time(s) using -E failed with status {}'.format(rv))
+    exit(1)
+
+# List all CLUSTER resources (incl changes). Use timestamp bounds that include all claims.
+ts1 = datetime.datetime.utcnow() - datetime.timedelta(minutes=90)
+ts1_str = str(datetime.datetime(ts1.year, ts1.month, ts1.day, ts1.hour, ts1.minute, ts1.second))  # strip milliseconds
+ts2 = datetime.datetime.utcnow() - datetime.timedelta(minutes=10)
+ts2_str = str(datetime.datetime(ts2.year, ts2.month, ts2.day, ts2.hour, ts2.minute, ts2.second))  # strip milliseconds
+logger.info('test ts1_str = {}, ts2_str = {}'.format(ts1_str, ts2_str))
+rv = rt.main(['-G', 'CLUSTER', '-T', ts1_str, '-S', ts2_str])
+if rv != 0:
+    logger.error('2nd listing failed with status {}'.format(rv))
+    exit(1)
+
+# Try a few erroneous cases.
+# We can't try errors detected by cmd-line arg parsing here, since the opt parser calls exit().
+rv = 0
+rv |= rt.main(['-G', 'NON_EXISTENT_GROUP'])
+rv |= rt.main(['-G', 'node1', 'node2_bandwidth:/d-qzy=False'])  # resource N/A under group node1
+rv |= rt.main(['-G', 'CLUSTER', 'node1_storage:/d1-qzy=101'])  # avail > total not allowed
+if rv != 1:
+    logger.error('some tests for erroneous cases incorrectly returned success')
+    exit(1)
+
+# Another overview (error cases should not have changed anything), this time show storage only, and raw values
+rv = rt.main(['-G', 'INSTRUMENT', '-t', 'storage', '-T', 'None', '-S', 'None', '--no-scaled-units'])
+if rv != 0:
+    logger.error('final listing failed with status {}'.format(rv))
+    exit(1)
+
diff --git a/SAS/DataManagement/ResourceTool/test/tresourcetool.run b/SAS/DataManagement/ResourceTool/test/tresourcetool.run
new file mode 100755
index 0000000000000000000000000000000000000000..6898aefa7a3973008226bacc9adac086b11c2072
--- /dev/null
+++ b/SAS/DataManagement/ResourceTool/test/tresourcetool.run
@@ -0,0 +1,6 @@
+#!/bin/bash
+
+# Run the unit test
+source python-coverage.sh
+python_coverage_test "resourcetool" tresourcetool.py
+
diff --git a/SAS/DataManagement/ResourceTool/test/tresourcetool.sh b/SAS/DataManagement/ResourceTool/test/tresourcetool.sh
new file mode 100755
index 0000000000000000000000000000000000000000..46b2da2cf7e865f21888b7ab6709f70581196e92
--- /dev/null
+++ b/SAS/DataManagement/ResourceTool/test/tresourcetool.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+./runctest.sh tresourcetool
diff --git a/SAS/DataManagement/StorageQueryService/CMakeLists.txt b/SAS/DataManagement/StorageQueryService/CMakeLists.txt
index 74fd3e16f58174a892be7b3109d6f18f1615ac71..d48a43ec6a1c4c7ad3cb171cd5bb2eee6f22c969 100644
--- a/SAS/DataManagement/StorageQueryService/CMakeLists.txt
+++ b/SAS/DataManagement/StorageQueryService/CMakeLists.txt
@@ -12,12 +12,11 @@ set(_py_files
   service.py
   diskusage.py
   cache.py
-  simpleresourceupdater.py
 )
 
 python_install(${_py_files} DESTINATION lofar/sas/datamanagement/storagequery)
 
-lofar_add_bin_scripts(storagequery storagequeryservice simpleresourceupdater)
+lofar_add_bin_scripts(storagequery storagequeryservice)
 
 # supervisord config files
 install(FILES
diff --git a/SAS/DataManagement/StorageQueryService/cache.py b/SAS/DataManagement/StorageQueryService/cache.py
index f42179bfcafbf1f62ff9caea4bb047aa425ea7d2..87d15ee5102c881cb915059dde3298202e5a26ba 100644
--- a/SAS/DataManagement/StorageQueryService/cache.py
+++ b/SAS/DataManagement/StorageQueryService/cache.py
@@ -11,9 +11,11 @@ import ast
 from optparse import OptionParser
 from threading import Thread, RLock
 import os.path
+from pprint import pformat
 
 from lofar.messaging import EventMessage, ToBus
 from lofar.common.util import humanreadablesize
+from lofar.common.datetimeutils import format_timedelta
 from lofar.sas.datamanagement.storagequery.diskusage import getDiskUsageForPath as du_getDiskUsageForPath
 from lofar.sas.datamanagement.storagequery.diskusage import DiskUsage
 from lofar.sas.datamanagement.common.datamanagementbuslistener import DataManagementBusListener
@@ -28,10 +30,11 @@ from lofar.mom.momqueryservice.config import DEFAULT_MOMQUERY_BUSNAME, DEFAULT_M
 
 logger = logging.getLogger(__name__)
 
-MAX_CACHE_ENTRY_AGE = datetime.timedelta(days=1)
+MAX_CACHE_ENTRY_AGE = datetime.timedelta(hours=8)
 
 class CacheManager:
     def __init__(self,
+                 cache_path='.du_cache.py',
                  mountpoint=CEP4_DATA_MOUNTPOINT,
                  radb_busname=RADB_BUSNAME,
                  radb_servicename=RADB_SERVICENAME,
@@ -42,6 +45,9 @@ class CacheManager:
                  dm_notification_busname=DEFAULT_DM_NOTIFICATION_BUSNAME,
                  dm_notification_prefix=DEFAULT_DM_NOTIFICATION_PREFIX,
                  broker=None):
+
+        self._cache_path = cache_path
+
         self.otdb_listener = OTDBBusListener(busname=otdb_notification_busname,
                                              subject=otdb_notification_subject,
                                              broker=broker,
@@ -60,9 +66,10 @@ class CacheManager:
         self.notification_prefix = dm_notification_prefix
         self.event_bus = ToBus(dm_notification_busname, broker=broker)
 
+        self._scanProjectsTreeThread = None
         self._updateCacheThread = None
-        self._updateCacheThreadRunning = False
-        self._continueUpdateCacheThread = False
+        self._cacheThreadsRunning = False
+
         self._cacheLock = RLock()
 
         self._cache = {'path_du_results': {}, 'otdb_id2path': {} }
@@ -90,8 +97,8 @@ class CacheManager:
     def _readCacheFromDisk(self):
         # maybe this cache on disk is slow, if so, revert to proper db solution
         try:
-            if os.path.exists('.du_cache.py'):
-                with open('.du_cache.py', 'r') as file:
+            if os.path.exists(self._cache_path):
+                with open(self._cache_path, 'r') as file:
                     with self._cacheLock:
                         self._cache = eval(file.read().strip())
                         if not isinstance(self._cache, dict):
@@ -104,9 +111,11 @@ class CacheManager:
 
     def _writeCacheToDisk(self):
         try:
-            with open('.du_cache.py', 'w') as file:
+            tmp_path = '/tmp/tmp_storagequery_cache.py'
+            with open(tmp_path, 'w') as file:
                 with self._cacheLock:
-                    file.write(str(self._cache))
+                    file.write(pformat(self._cache) + '\n')
+            os.rename(tmp_path, self._cache_path)
         except Exception as e:
             logger.error("Error while writing du cache: %s", e)
 
@@ -114,41 +123,38 @@ class CacheManager:
         if not 'path' in du_result:
             return
 
+        path = du_result['path']
         otdb_id = du_result.get('otdb_id')
 
         with self._cacheLock:
-            path = du_result['path']
             path_cache = self._cache['path_du_results']
             otdb_id2path_cache = self._cache['otdb_id2path']
 
-            if du_result['found']:
-                if not path in path_cache or path_cache[path]['disk_usage'] != du_result['disk_usage']:
-                    logger.info('updating cache entry: %s', du_result)
-                    path_cache[path] = du_result
-                    self._sendDiskUsageChangedNotification(path, du_result['disk_usage'], otdb_id)
+            if otdb_id is None:
+                # try to look up the otdb in the path cache
+                if path in path_cache:
+                    otdb_id = du_result.get('otdb_id')
 
-                path_cache[path]['cache_timestamp'] = datetime.datetime.utcnow()
-                path_cache[path]['needs_update'] = False
+            if not du_result['found']:
+                #make sure disk_usage is set when not found
+                du_result['disk_usage'] = 0
+                du_result['disk_usage_readable'] = '0B'
 
-                if otdb_id != None:
-                    otdb_id2path_cache[otdb_id] = path
-            else:
-                if ('message' not in du_result or
-                    'no such file or directory' in du_result['message'].lower() or
-                    'could not resolve hostname' not in du_result['message'].lower()):
-                    if path in path_cache:
-                        logger.info('removing path \'%s\' from cache', path)
-                        del path_cache[path]
-                        self._sendDiskUsageChangedNotification(path, 0, otdb_id)
-
-                if otdb_id != None and otdb_id in otdb_id2path_cache:
-                    logger.info('removing otdb_id->path mapping %s:\'%s\' from cache', otdb_id, path)
-                    del otdb_id2path_cache[otdb_id]
+            if not path in path_cache or path_cache[path]['disk_usage'] != du_result['disk_usage']:
+                # update the cache entry, even when no du result found,
+                # cause that will save disk queries next time.
+                logger.info('updating cache entry: %s', du_result)
+                path_cache[path] = du_result
+
+            path_cache[path]['cache_timestamp'] = datetime.datetime.utcnow()
+            path_cache[path]['needs_update'] = False
+
+            if otdb_id != None:
+                otdb_id2path_cache[otdb_id] = path
 
             self._writeCacheToDisk()
 
-        if du_result.get('path') == self.disk_usage.path_resolver.projects_path:
-            self._updateProjectsDiskUsageInRADB()
+        self._sendDiskUsageChangedNotification(path, du_result['disk_usage'], otdb_id)
 
     def _invalidateCacheEntryForPath(self, path):
         with self._cacheLock:
@@ -164,7 +170,7 @@ class CacheManager:
 
         result = {}
         for otdb_id in otdb_ids:
-            result[otdb_id] = self.getDiskUsageForOTDBId(otdb_id, force_update)
+            result[otdb_id] = self.getDiskUsageForOTDBId(otdb_id, force_update=force_update)
 
         return result
 
@@ -186,7 +192,7 @@ class CacheManager:
                             # mark cache entry for directory to be updated
                             path_cache[directory]['needs_update'] = True
 
-                if not self._updateCacheThreadRunning:
+                if not self._cacheThreadsRunning:
                     return
 
                 if depth < 3:
@@ -208,7 +214,7 @@ class CacheManager:
 
     def _updateOldEntriesInCache(self):
         logger.info('starting updating old cache entries')
-        while self._updateCacheThreadRunning:
+        while self._cacheThreadsRunning:
             try:
                 now = datetime.datetime.utcnow()
                 with self._cacheLock:
@@ -247,20 +253,26 @@ class CacheManager:
                         try:
                             path = cache_entry.get('path')
                             if path:
-                                logger.info('examining entry %s/%s in cache. timestamp:%s age:%s needs_update:%s path: %s',
+                                logger.info('_updateOldEntriesInCache: examining entry %s/%s. timestamp:%s age:%s needs_update:%s path: \'%s\'',
                                             i,
                                             len(updateable_entries),
                                             cache_entry['cache_timestamp'],
-                                            now - cache_entry['cache_timestamp'],
+                                            format_timedelta(now - cache_entry['cache_timestamp']),
                                             cache_entry.get('needs_update', False),
                                             path)
+
+                                #do a quick update of the entry sy applying the sum of the subdirs to the path's du result...
+                                #this make a best guess immedeiately available...
+                                self._updatePathCacheEntryToSubDirTotal(path, False)
+
+                                #...and in the mean time, du a full update from disk, which might be (really) slow.
                                 result = du_getDiskUsageForPath(path)
                                 logger.debug('trying to update old entry in cache: %s', result)
                                 self._updateCache(result)
                         except Exception as e:
                             logger.error(str(e))
 
-                        if not self._updateCacheThreadRunning:
+                        if not self._cacheThreadsRunning:
                             return
 
                         if datetime.datetime.utcnow() - cacheUpdateStart > datetime.timedelta(minutes=10):
@@ -269,61 +281,84 @@ class CacheManager:
                             logger.info('skipping remaining %s old cache entries updates, they will be updated next time', len(updateable_entries)-i)
                             break
 
+                #update the CEP4 capacities in the RADB once in a while...
+                self._updateCEP4CapacitiesInRADB()
+
+                #sleep for a minute, (or stop if requested)
                 for i in range(60):
                     sleep(1)
-                    if not self._updateCacheThreadRunning:
+                    if not self._cacheThreadsRunning:
                         return
-                    if self._continueUpdateCacheThread:
-                        # break out of sleep loop and continue updating old cache entries
-                        self._continueUpdateCacheThread = False
-                        break
+
             except Exception as e:
                 logger.error(str(e))
 
-    def _scanProjectsTreeAndUpdateOldEntriesInCache(self):
-        self._scanProjectsTree()
-        self._updateOldEntriesInCache()
+    def _updatePathCacheEntryToSubDirTotal(self, path, force_update=False):
+        sd_result = self.disk_usage.path_resolver.getSubDirectories(path)
+
+        if sd_result['found']:
+            subdir_paths = [os.path.join(path, sd) for sd in sd_result['sub_directories']]
+
+            subdir_du_results = [self.getDiskUsageForPath(sd, force_update=force_update) for sd in subdir_paths]
+            sum_du = sum([du['disk_usage'] for du in subdir_du_results])
 
-    def _updateProjectsDiskUsageInRADB(self):
+            with self._cacheLock:
+                if path in self._cache['path_du_results']:
+                    path_result = self._cache['path_du_results'][path]
+                    path_result['disk_usage'] = sum_du
+                    path_result['disk_usage_readable'] = humanreadablesize(sum_du)
+                    path_result['needs_update'] = True
+                    self._updateCache(path_result)
+
+    def _updateCEP4CapacitiesInRADB(self):
         try:
-            projects_du_result = self.getDiskUsageForPath(self.disk_usage.path_resolver.projects_path)
-            if projects_du_result['found']:
+            df_result = self.disk_usage.getDiskFreeSpace()
+            if df_result['found']:
                 #get the total used space, and update the resource availability in the radb
                 radbrpc = self.disk_usage.path_resolver.radbrpc
                 storage_resources = radbrpc.getResources(resource_types='storage', include_availability=True)
                 cep4_storage_resource = next(x for x in storage_resources if 'CEP4' in x['name'])
 
-                total_capacity = cep4_storage_resource.get('total_capacity')
-                used_capacity = projects_du_result.get('disk_usage')
-                if total_capacity != None and used_capacity != None:
-                    available_capacity = total_capacity - used_capacity
+                total_capacity = df_result.get('disk_size')
+                used_capacity = df_result.get('disk_usage')
+                available_capacity = df_result.get('disk_free')
 
-                    logger.info('updating availability capacity for %s (id=%s) to %s in the RADB',
-                                cep4_storage_resource['name'],
-                                cep4_storage_resource['id'],
-                                humanreadablesize(available_capacity))
+                logger.info('updating capacities for resource \'%s\' (id=%s) in the RADB: total=%s, used=%s, available=%s',
+                            cep4_storage_resource['name'],
+                            cep4_storage_resource['id'],
+                            humanreadablesize(total_capacity),
+                            humanreadablesize(used_capacity),
+                            humanreadablesize(available_capacity))
 
-                    radbrpc.updateResourceAvailability(cep4_storage_resource['id'], available_capacity=available_capacity)
+                radbrpc.updateResourceAvailability(cep4_storage_resource['id'],
+                                                   available_capacity=available_capacity,
+                                                   total_capacity=total_capacity)
         except Exception as e:
-            logger.error(e)
+            logger.error('_updateCEP4CapacitiesInRADB: %s', e)
 
     def open(self):
         self.disk_usage.open()
         self.event_bus.open()
 
-        self._updateCacheThread = Thread(target=self._scanProjectsTreeAndUpdateOldEntriesInCache)
+        self._cacheThreadsRunning = True
+
+        self._updateCacheThread = Thread(target=self._updateOldEntriesInCache)
         self._updateCacheThread.daemon = True
-        self._updateCacheThreadRunning = True
         self._updateCacheThread.start()
 
+        self._scanProjectsTreeThread = Thread(target=self._scanProjectsTree)
+        self._scanProjectsTreeThread.daemon = True
+        self._scanProjectsTreeThread.start()
+
         self.otdb_listener.start_listening()
         self.dm_listener.start_listening()
 
     def close(self):
         self.otdb_listener.stop_listening()
         self.dm_listener.stop_listening()
-        self._updateCacheThreadRunning = False
+        self._cacheThreadsRunning = False
         self._updateCacheThread.join()
+        self._scanProjectsTreeThread.join()
 
         self.event_bus.close()
         self.disk_usage.close()
@@ -366,9 +401,6 @@ class CacheManager:
 
             path = parent_path
 
-        # trigger update cache thread
-        self._continueUpdateCacheThread = True
-
     def getDiskUsageForOTDBId(self, otdb_id, include_scratch_paths=True, force_update=False):
         return self.getDiskUsageForTask(otdb_id=otdb_id, include_scratch_paths=include_scratch_paths, force_update=force_update)
 
@@ -379,7 +411,8 @@ class CacheManager:
         return self.getDiskUsageForTask(radb_id=radb_id, include_scratch_paths=include_scratch_paths, force_update=force_update)
 
     def getDiskUsageForTask(self, radb_id=None, mom_id=None, otdb_id=None, include_scratch_paths=True, force_update=False):
-        logger.info("cache.getDiskUsageForTask(radb_id=%s, mom_id=%s, otdb_id=%s)" % (radb_id, mom_id, otdb_id))
+        logger.info("cache.getDiskUsageForTask(radb_id=%s, mom_id=%s, otdb_id=%s, include_scratch_paths=%s, force_update=%s)",
+                    radb_id, mom_id, otdb_id, include_scratch_paths, force_update)
 
         if otdb_id != None and not include_scratch_paths:
             with self._cacheLock:
@@ -389,26 +422,15 @@ class CacheManager:
                 logger.info('Using path from cache for otdb_id %s %s', otdb_id, path)
                 return self.getDiskUsageForPath(path, force_update=force_update)
 
-        path_result = self.disk_usage.path_resolver.getPathForTask(radb_id=radb_id, mom_id=mom_id, otdb_id=otdb_id, include_scratch_paths=include_scratch_paths)
-
-        if otdb_id != None and not path_result['found']:
-            logger.info('getDiskUsageForTask otdb_id=%s path_result:%s', otdb_id, path_result)
+        logger.info("cache.getDiskUsageForTask could not find path in cache, determining path...")
 
-            #update cache, entries for this otdb_id are wiped
-            #construct du_result dict with proper keys/values which can delete the entries in the cache
-            del_du_result = { 'found':False, 'otdb_id':otdb_id, 'message':'no such file or directory' }
-
-            with self._cacheLock:
-                otdb_id2path_cache = self._cache['otdb_id2path']
-                if otdb_id in otdb_id2path_cache:
-                    del_du_result['path'] = otdb_id2path_cache[otdb_id]
-
-            logger.info('del_du_result: %s', del_du_result)
-
-            self._updateCache(del_du_result)
+        path_result = self.disk_usage.path_resolver.getPathForTask(radb_id=radb_id, mom_id=mom_id, otdb_id=otdb_id, include_scratch_paths=include_scratch_paths)
 
         if path_result['found']:
             path_du_result = self.getDiskUsageForPath(path_result['path'], force_update=force_update)
+            path_du_result['radb_id'] = path_result.get('radb_id')
+            path_du_result['mom_id'] = path_result.get('mom_id')
+            path_du_result['otdb_id'] = path_result.get('otdb_id')
 
             if 'scratch_paths' in path_result:
                 path_du_result['scratch_paths'] = {}
@@ -417,8 +439,10 @@ class CacheManager:
                     scratch_path_du_result = self.getDiskUsageForPath(scratch_path, force_update=force_update)
                     path_du_result['scratch_paths'][scratch_path] = scratch_path_du_result
 
+            self._updateCache(path_du_result)
             return path_du_result
 
+        self._updateCache(path_result)
         return {'found': False, 'path': path_result['path']}
 
     def getDiskUsageForTasks(self, radb_ids=None, mom_ids=None, otdb_ids=None, include_scratch_paths=True, force_update=False):
@@ -440,7 +464,7 @@ class CacheManager:
         return result
 
     def getDiskUsageForPath(self, path, force_update=False):
-        logger.info("cache.getDiskUsageForPath(%s, force_update=%s)", path, force_update)
+        logger.info("cache.getDiskUsageForPath('%s', force_update=%s)", path, force_update)
         needs_cache_update = False
         with self._cacheLock:
             needs_cache_update |= path not in self._cache['path_du_results']
@@ -459,7 +483,7 @@ class CacheManager:
                     result['message'] = 'No such path: %s' % path
 
         result['disk_usage_readable'] = humanreadablesize(result.get('disk_usage', 0))
-        logger.info('cache.getDiskUsageForPath result: %s' % result)
+        logger.info('cache.getDiskUsageForPath(\'%s\') result: %s', path, result)
         return result
 
     def getDiskUsageForTaskAndSubDirectories(self, radb_id=None, mom_id=None, otdb_id=None, force_update=False):
@@ -517,5 +541,5 @@ class CacheManager:
 if __name__ == '__main__':
     logging.basicConfig(format='%(asctime)s %(levelname)s %(message)s', level=logging.INFO)
 
-    with CacheManager(broker='scu099.control.lofar') as cm:
+    with CacheManager() as cm:
         waitForInterrupt()
diff --git a/SAS/DataManagement/StorageQueryService/diskusage.py b/SAS/DataManagement/StorageQueryService/diskusage.py
index d5a0063f588dacfe73d7d6695a26b27d30581694..67a96da340ce7dc21ccf8ff24d68f5cbf7526e49 100644
--- a/SAS/DataManagement/StorageQueryService/diskusage.py
+++ b/SAS/DataManagement/StorageQueryService/diskusage.py
@@ -17,7 +17,10 @@ from lofar.mom.momqueryservice.config import DEFAULT_MOMQUERY_BUSNAME, DEFAULT_M
 logger = logging.getLogger(__name__)
 
 def getDiskUsageForPath(path):
-    logger.info('getDiskUsageForPath(%s)', path)
+    logger.info('getDiskUsageForPath(\'%s\')', path)
+
+    result = {'found': False, 'path': path, 'disk_usage': None, 'name': path.split('/')[-1] }
+
     cmd = ['rbh-du', '-bd', path]
     hostname = socket.gethostname()
     if not 'mgmt0' in hostname:
@@ -27,51 +30,91 @@ def getDiskUsageForPath(path):
     proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
     out, err = proc.communicate()
 
+    if proc.returncode == 0:
+        # example of out
+        # Using config file '/etc/robinhood.d/tmpfs/tmp_fs_mgr_basic.conf'.
+        # /data/projects/2016LOFAROBS/L522380
+        # dir count:3906, size:16048128, spc_used:16052224
+        # file count:17568, size:42274164368, spc_used:42327519232
+
+        #parse out
+        lines = [l.strip() for l in out.split('\n')]
+        file_lines = [l for l in lines if 'file count' in l]
+        if file_lines:
+            parts = [p.strip() for p in file_lines[0].split(',')]
+            partsDict = {p.split(':')[0].strip():p.split(':')[1].strip() for p in parts}
+
+            result['found'] = True
+
+            if 'size' in partsDict:
+                result['disk_usage'] = int(partsDict['size'])
+
+            if 'file count' in partsDict:
+                result['nr_of_files'] = int(partsDict['file count'])
+        else:
+            dir_lines = [l for l in lines if 'dir count' in l]
+            if dir_lines:
+                result['found'] = True
+                result['disk_usage'] = 0
+                result['nr_of_files'] = 0
+
+        try:
+            path_items = path.rstrip('/').split('/')
+            if len(path_items) >=3 and path_items[-1].startswith('L') and path_items[-1][1:].isdigit() and 'projects' in path_items[-3]:
+                logger.info('found path for otdb_id %s %s', path_items[-1][1:], path)
+                result['otdb_id'] = int(path_items[-1][1:])
+        except Exception as e:
+            logger.error('Could not parse otdb_id from path %s %s', path, e)
+    else:
+        logger.error(out + err)
+        result['message'] = out
+
+    result['disk_usage_readable'] = humanreadablesize(result['disk_usage'])
+
+    logger.info('getDiskUsageForPath(\'%s\') returning: %s', path, result)
+    return result
+
+def getDiskFreeSpaceForMountpoint(mountpoint=CEP4_DATA_MOUNTPOINT):
+    logger.info('getDiskFreeSpaceForMountpoint(\'%s\')', mountpoint)
+
+    result = {'found': False, 'mountpoint': mountpoint }
+
+    cmd = ['df', mountpoint]
+    hostname = socket.gethostname()
+    if not 'mgmt0' in hostname:
+        cmd = ['ssh', 'lofarsys@mgmt01.cep4.control.lofar'] + cmd
+    logger.info(' '.join(cmd) + ' ...waiting for result...')
+
+    proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+    out, err = proc.communicate()
+
     if proc.returncode != 0:
         logger.error(out + err)
-        return {'found': False, 'path': path, 'message': out}
+        result['message'] = out
+        return result
 
     # example of out
-    # Using config file '/etc/robinhood.d/tmpfs/tmp_fs_mgr_basic.conf'.
-    # /data/projects/2016LOFAROBS/L522380
-    # dir count:3906, size:16048128, spc_used:16052224
-    # file count:17568, size:42274164368, spc_used:42327519232
+    # Filesystem                                         1K-blocks          Used     Available Use% Mounted on
+    # 10.134.233.65@o2ib:10.134.233.66@o2ib:/cep4-fs 3369564904320 1460036416928 1737591103048  46% /data
 
     #parse out
     lines = [l.strip() for l in out.split('\n')]
-    file_lines = [l for l in lines if 'file count' in l]
-    if file_lines:
-        parts = [p.strip() for p in file_lines[0].split(',')]
-        partsDict = {p.split(':')[0].strip():p.split(':')[1].strip() for p in parts}
+    data_line = next(l for l in lines if mountpoint in l)
+    if data_line:
+        parts = [p.strip() for p in data_line.split(' ')]
 
-        result = {'found': True, 'disk_usage': None, 'path': path, 'name': path.split('/')[-1]}
-
-        if 'size' in partsDict:
-            result['disk_usage'] = int(partsDict['size'])
-
-        if 'file count' in partsDict:
-            result['nr_of_files'] = int(partsDict['file count'])
+        result['found'] = True
+        result['disk_size'] = 1024*int(parts[1])
+        result['disk_usage'] = 1024*int(parts[2])
+        result['disk_free'] = 1024*int(parts[3])
 
+        result['disk_size_readable'] = humanreadablesize(result['disk_size'])
         result['disk_usage_readable'] = humanreadablesize(result['disk_usage'])
-    else:
-        dir_lines = [l for l in lines if 'dir count' in l]
-        if dir_lines:
-            result = {'found': True, 'disk_usage': 0, 'nr_of_files': 0, 'path': path, 'name': path.split('/')[-1]}
-        else:
-            result = {'found': False, 'path': path }
+        result['disk_free_readable'] = humanreadablesize(result['disk_free'])
 
-    try:
-        path_items = path.rstrip('/').split('/')
-        if len(path_items) >=3 and path_items[-1].startswith('L') and path_items[-1][1:].isdigit() and 'projects' in path_items[-3]:
-            logger.info('found path for otdb_id %s %s', path_items[-1][1:], path)
-            result['otdb_id'] = int(path_items[-1][1:])
-    except Exception as e:
-        logger.error('Could not parse otdb_id from path %s %s', path, e)
-
-    logger.info('returning: %s' % result)
+    logger.info('getDiskFreeSpaceForMountpoint(\'%s\') returning: %s', mountpoint, result)
     return result
 
-
 class DiskUsage:
     def __init__(self,
                  mountpoint=CEP4_DATA_MOUNTPOINT,
@@ -149,6 +192,9 @@ class DiskUsage:
 
         return path_result
 
+    def getDiskFreeSpace(self):
+        return getDiskFreeSpaceForMountpoint(self.path_resolver.mountpoint)
+
 def main():
     # Check the invocation arguments
     parser = OptionParser("%prog [options] <path>",
diff --git a/SAS/DataManagement/StorageQueryService/service.py b/SAS/DataManagement/StorageQueryService/service.py
index 72cf369fa80e3a5f375cffd093861f6f5ef7b76b..e027fec29e2a9ac92b22c044a4824b66dad57ee3 100644
--- a/SAS/DataManagement/StorageQueryService/service.py
+++ b/SAS/DataManagement/StorageQueryService/service.py
@@ -85,6 +85,9 @@ def main():
     # Check the invocation arguments
     parser = OptionParser("%prog [options]",
                           description='runs the storagequery service')
+    parser.add_option('-c', '--cache_path', dest='cache_path', type='string',
+                      default=os.path.expandvars('$LOFARROOT/etc/storagequery_cache.py'),
+                      help='path of the cache file, default: %default')
     parser.add_option('-q', '--broker', dest='broker', type='string', default=None, help='Address of the qpid broker, default: localhost')
     parser.add_option("-b", "--busname", dest="busname", type="string", default=DEFAULT_BUSNAME, help="Name of the bus exchange on the qpid broker, default: %s" % DEFAULT_BUSNAME)
     parser.add_option("-s", "--servicename", dest="servicename", type="string", default=DEFAULT_SERVICENAME, help="Name for this service, default: %s" % DEFAULT_SERVICENAME)
@@ -99,7 +102,7 @@ def main():
                         level=logging.DEBUG if options.verbose else logging.INFO)
     setQpidLogLevel(logging.INFO)
 
-    with CacheManager(broker=options.broker) as cache_manager:
+    with CacheManager(broker=options.broker, cache_path=options.cache_path) as cache_manager:
         with createService(busname=options.busname,
                         servicename=options.servicename,
                         broker=options.broker,
diff --git a/SAS/DataManagement/StorageQueryService/simpleresourceupdater b/SAS/DataManagement/StorageQueryService/simpleresourceupdater
deleted file mode 100755
index 111e22a9344e81427b899fecaffcb0d969ff9a59..0000000000000000000000000000000000000000
--- a/SAS/DataManagement/StorageQueryService/simpleresourceupdater
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/usr/bin/python
-
-'''
-Simple utility to list or update RADB resource availability values.
-Essentially a tool around RADB getResources() and updateResourceAvailability().
-See the simpleresourceupdater.py module for more info.
-'''
-
-if __name__ == '__main__':
-    from sys import argv, exit
-    from lofar.sas.datamanagement.storagequery.simpleresourceupdater import main
-    exit(main(argv[1:]))
diff --git a/SAS/DataManagement/StorageQueryService/simpleresourceupdater.py b/SAS/DataManagement/StorageQueryService/simpleresourceupdater.py
deleted file mode 100755
index 74ffade84ef621e7e5f284f25e906680a5341975..0000000000000000000000000000000000000000
--- a/SAS/DataManagement/StorageQueryService/simpleresourceupdater.py
+++ /dev/null
@@ -1,305 +0,0 @@
-#!/usr/bin/env python
-# Copyright (C) 2017
-# ASTRON (Netherlands Institute for Radio Astronomy)
-# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
-#
-# This file is part of the LOFAR software suite.
-# The LOFAR software suite 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 3 of the
-# License, or (at your option) any later version.
-#
-# The LOFAR software suite 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 the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
-#
-# $Id$
-
-"""
-simpleresourceupdater.py
-
-Simple utility to list or update RADB resource availability values.
-Essentially a tool around RADB getResources() and updateResourceAvailability().
-
-Can also figure out available capacity for a mounted storage resource and update it in the RADB (-U/--update-available-storage-capacity option).
-Examples (source lofarinit.sh to set LOFARROOT, PYTHONPATH, ...):
-- Update available (local) storage capacity for an observation storage node, e.g. via cron in operations:
-    simpleresourceupdater.py --broker=scu001.control.lofar --update-available-storage-capacity
-- Show all DRAGNET resources on the test system RADB (LOFARENV should be exported in a test session to avoid affecting operations!):
-    LOFARENV=TEST simpleresourceupdater.py --broker=scu199.control.lofar --resource-group-root=DRAGNET
-- Deactivate 2 storage resources in operations, because the node is broken:
-    simpleresourceupdater.py --broker=scu001.control.lofar drg01_bandwidth:/data1=False drg01_bandwidth:/data2=False
-
-NOTES:
-! Be careful what system (operations or test) this command applies to!
-  Operations vs Test (vs Development) can be seen from the default RADB_BUSNAME in the usage info: lofar.* vs test.lofar.* vs devel.lofar.*
-! By default, listed or updateable resources are restricted to resources under the localhost's resource group.
-  This is on purpose to make -U work correctly only. The -G/--resource-group-root option can be used to widen the resource group scope for listing or explicit command-line updates, but non-default -G and -U together are rejected: it is too easy to mass-update the wrong resources.
-"""
-
-import logging
-
-from lofar.sas.resourceassignment.resourceassignmentservice.rpc import RARPC
-from lofar.sas.resourceassignment.resourceassignmentservice.config import DEFAULT_BUSNAME as RADB_BUSNAME  # depends on env (operations or test sys)
-from lofar.sas.resourceassignment.resourceassignmentservice.config import DEFAULT_SERVICENAME as RADB_SERVICENAME
-
-logging.basicConfig(format='%(asctime)s %(levelname)s %(message)s', level=logging.WARN)
-logger = logging.getLogger(__name__)
-
-def printResources(resources):
-    """ E.g.: resources = [{u'total_capacity': 3774873600, u'name': u'dragproc_bandwidth:/data', u'type_id': 3,
-                            u'available_capacity': 3774873600, u'type_name': u'bandwidth', u'unit_id': 3,
-                            u'active': True, u'used_capacity': 0, u'id': 118, u'unit': u'bits/second'}, ...]
-    """
-    header = {'id': 'Id', 'name': 'Resource Name', 'active': 'Active',
-              'available_capacity': '  Avail Capacity', 'total_capacity': '  Total Capacity', 'unit': 'Unit'}
-    print('{id:4s} {name:24s} {active:6s} {available_capacity} {total_capacity} {unit}'.format(**header))
-    print('===================================================================================================')
-    resources.sort(key=lambda r: r['id'])  # SQL could have done this better
-    for res in resources:
-        res['active'] = 'True' if res['active'] else 'False'  # to solve bool formatting issue
-        print('{id:4d} {name:24s} {active:6s} {available_capacity:16d} {total_capacity:16d} {unit}'.format(**res))
-
-def updateResource(radb, resource):
-    """ Update the radb using the resource dict. """
-    logger.info("Updating RADB with resource '{}'".format(resource))
-    radb.updateResourceAvailability(resource['id'], resource['active'],
-                                    resource['available_capacity'], resource['total_capacity'])
-
-def getMountPoint(resource_name):
-    """ E.g. with resource_name 'CEP4_storage:/data' or 'drg15_bandwidth:/data2' or 'CS002bw0',
-        this function returns: '/data' or '/data2' or None.
-    """
-    sep_idx = resource_name.find(':/')  # mount point must be an abs path
-    if sep_idx == -1:
-        return None
-    return resource_name[sep_idx + 1 : ]
-
-def updateAvailableStorageCapacities(radb, resources):
-    import os
-    status = 0
-
-    for res in resources:
-        # All storage resource names are supposedly mount points.
-        # But do not update with the wrong partition info (sys maintenance?).
-        # Log error and let admin figure it out. RADB resource defaults may need updating too.
-        mount_pt = getMountPoint(res['name'])
-        if mount_pt is None or not os.path.ismount(mount_pt):
-            logger.error("skipped updating available capacity of resource '{}': its path is not a mount point on this system".format(res['name']))
-            status = 1
-            continue
-
-        # Retrieve avail capacity from filesystem and do some checks.
-        try:
-            st = os.statvfs(mount_pt)
-        except OSError as e:
-            logger.error('statvfs: ' + str(e))
-            status = 1
-            continue
-        avail_cap = st.f_bavail * st.f_frsize
-        total_cap = st.f_blocks * st.f_frsize
-        if total_cap != res['total_capacity']:
-            hint_arg = res['name'] + '=' + str(avail_cap) + ',' + str(total_cap)
-            logger.warn("total capacity for resource '{}' is {}, which is not equal to {} as listed in the RADB. If the total capacity has changed permanently, please update the RADB, e.g. by running this program passing: {} (and by updating the software repo for RADB reinstalls).".format(res['name'], total_cap, res['total_capacity'], hint_arg))
-        if avail_cap > res['total_capacity']:
-            logger.error("the detected available capacity for resource '{}' cannot be written to the RADB, because it is greater than the total capacity listed in the RADB.")
-            status = 1
-            continue
-
-        # Only update available capacity in the RADB.
-        # Total and active indicate a config change (or maintenance in progress). Leave that for an admin.
-        res_update = {'id': res['id'], 'available_capacity': avail_cap,
-                      'total_capacity': None, 'active': None}
-        updateResource(radb, res_update)
-
-    return status
-
-def findResource(resources, name):
-    """ Return (first) resource with name in resources, or None if not found. """
-    for res in resources:
-        if res['name'] == name:
-            return res
-    return None
-
-def updateSpecifiedCapacities(radb, resources, resource_updates):
-    status = 0
-
-    for res_update in resource_updates:
-        # Need resource id from name to apply the update. Also check avail <= total.
-        res = findResource(resources, res_update['name'])
-        if res is None:
-            logger.error("skipped updating resource '{}': name unknown. Correct the name or (correct the) use (of) the -G/--resource-group-root option to widen the resource scope, e.g. -G CEP4|DRAGNET|LOFAR".format(res_update['name']))
-            status = 1
-            continue
-
-        if res_update['available_capacity'] is not None and \
-           res_update['total_capacity'] is None and \
-           res_update['available_capacity'] > res['total_capacity']:
-            logger.error("skipped updating resource '{}': specified available capacity cannot be greater than total capacity listed in the RADB. If the total capacity has changed permanently, please update the RADB using this program (and by updating the software repo for RADB reinstalls)".format(res_update['name']))
-            status = 1
-            continue
-
-        res_update['id'] = res['id']
-        updateResource(radb, res_update)
-
-    return status
-
-def getResourceGroupIdByName(db_rgp2rgp, name):
-    """ Returns group id of resource group named name, or None if name was not found.
-        The search happens breadth-first.
-    """
-    # find root group(s): empty parent list
-    gids = [gid for gid, group in db_rgp2rgp.items() if not group['parent_ids']]
-
-    i = 0
-    while i < len(gids):  # careful iterating while modifying
-        res_group = db_rgp2rgp[gids[i]]
-        if res_group['resource_group_name'] == name:
-            return gids[i]
-        gids.extend(res_group['child_ids'])
-        i += 1
-
-    return None
-
-def getSubtreeResourceIdList(db_rgp2rgp, root_gid):
-    """ Returns list of resource ids in resource group root_gid and its (grand)children."""
-    # Search breadth-first starting at root_gid.
-    gids = [root_gid]
-    resource_id_list = []
-
-    i = 0
-    while i < len(gids):  # careful iterating while modifying
-        res_group = db_rgp2rgp[gids[i]]
-        resource_id_list.extend(res_group['resource_ids'])
-        gids.extend(res_group['child_ids'])
-        i += 1
-
-    return resource_id_list
-
-def parseResourceArg(arg):
-    """ Return dict parsed from arg str. Arg format: resource_name:/data=True,100,200
-        with any value optional after the '=' (but need at least one).
-        Any returned dict value but the resource name may be None.
-        On error ValueError is raised.
-    """
-    eq_idx = arg.find('=')
-    if eq_idx == -1:
-        raise ValueError("could not find '=' in argument; need e.g. res_name=100 or resource_name=True,100,200")
-
-    resource_name = arg[ : eq_idx]
-    if not resource_name:
-        raise ValueError("invalid resource name in argument before '='; need e.g. res_name=100 or resource_name=True,100,200")
-    resource_val = arg[eq_idx + 1 : ]
-    vals = resource_val.split(',')
-    if not vals or len(vals) > 3:
-        raise ValueError("need 1-3 argument value(s) after '=', e.g. res_name=100 or resource_name=True,100,200")
-
-    active = None
-    avail_cap = None
-    total_cap = None
-    for val in vals:
-        if val == 'True' or val == 'False':
-            if active is not None:
-                raise ValueError("accepting at most 1 bool as resource active value in argument")
-            active = True if val == 'True' else False
-            continue
-
-        if total_cap is not None:
-            raise ValueError("accepting at most 2 ints as resource available and total capacities in argument")
-        v = int(val)
-        if v < 0:
-            raise ValueError("capacity value must be positive")
-        if avail_cap is None:
-            avail_cap = v
-        else:
-            if v < avail_cap:
-                raise ValueError("specified available capacity cannot be greater than specified total capacity")
-            total_cap = v
-
-    return {'name': resource_name, 'active': active,
-            'available_capacity': avail_cap, 'total_capacity': total_cap}
-
-def parseArgs(args):
-    from socket import gethostname 
-    hostname = gethostname()
-
-    from optparse import OptionParser
-    usage = 'Usage: %prog [OPTIONS] [resource_name=available_capacity]... or [resource_name=True|False[,avail_cap[,total_cap]]]...'
-    descr = 'List or update LOFAR RADB resource availabilities [active,]available[,total]'
-    parser = OptionParser(usage=usage, description=descr)
-    # already supported options: -h, --help, --
-    parser.add_option('-q', '--broker', dest='broker', default=None,
-                      help='qpid broker hostname (default: localhost).')
-    parser.add_option('--radb_busname', dest='radb_busname', default=RADB_BUSNAME,
-                      help='Name of the bus on which the RADB service listens (default: %default)')
-    parser.add_option('--radb_servicename', dest='radb_servicename', default=RADB_SERVICENAME,
-                      help='Name of the RADB service (default: %default)')
-    parser.add_option('-G', '--resource-group-root', dest='resource_group_root', default=hostname,
-                      help='Only consider resources under resource group root (default: %default (all=LOFAR))')
-    parser.add_option('-U', '--update-available-storage-capacity', dest='update_avail', action='store_true', default=False,
-                      help='Update the available capacity value in the RADB of storage resources under resource group root')
-    options, left_over_args = parser.parse_args(args)
-
-    if options.update_avail and options.resource_group_root != hostname:
-        parser.error("combining the options -U and a non-default -G is rejected: it is too easy to mass-update the wrong resources")
-
-    resource_updates = []
-    for i, arg in enumerate(left_over_args):
-        try:
-            resource_updates.append(parseResourceArg(arg))
-        except ValueError as exc:
-            parser.error("failed to parse non-option argument '{}': {}".format(i, exc.message))
-
-    return options, resource_updates
-
-def main(args):
-    import os
-    os.environ['TZ'] = 'UTC'  # LOFAR observatory software uses UTC
-
-    options, resource_updates = parseArgs(args)
-
-    status = 0
-    radb = None
-    try:
-        radb = RARPC(options.radb_busname, options.radb_servicename, options.broker)
-
-        resource_types = 'storage' if options.update_avail else None
-        db_resource_list = radb.getResources(resource_types=resource_types, include_availability=True)
-
-        # Filter resource list via resource root group option
-        db_resource_group_mships = radb.getResourceGroupMemberships()
-        db_rgp2rgp = db_resource_group_mships['groups']  # resource-group-to-resource-group relations
-        group_id = getResourceGroupIdByName(db_rgp2rgp, options.resource_group_root)
-        if group_id is None:
-            logger.error("could not find resource group '{}'. You may want to (correct the) use (of) the -G/--resource-group-root option to widen the resource scope, e.g. -G CEP4|DRAGNET|LOFAR".format(options.resource_group_root))
-            return 1
-        resource_id_list = getSubtreeResourceIdList(db_rgp2rgp, group_id)
-        if not resource_id_list:
-            logger.error("no resources found under resource group '{}' and its (grand)children".format(options.resource_group_root))
-            return 1
-        resources = [res for res in db_resource_list if res['id'] in resource_id_list]  # SQL could have done this better
-
-        if options.update_avail:
-            status = updateAvailableStorageCapacities(radb, resources)
-
-        if resource_updates:
-            status |= updateSpecifiedCapacities(radb, resources, resource_updates)
-
-        if not options.update_avail and not resource_updates:
-            printResources(resources)
-
-    #except Exception:  # disabled: prefer default stacktrace on bug here
-    finally:
-        if radb is not None:
-            radb.close()
-
-    return status
-
-if __name__ == '__main__':
-    from sys import argv, exit
-    exit(main(argv[1:]))
-
diff --git a/SAS/DataManagement/StorageQueryService/test/CMakeLists.txt b/SAS/DataManagement/StorageQueryService/test/CMakeLists.txt
index 5935da913231e97f9c78feb44395f6f119eb3715..2e74c54f0c7563424bb586fcdd913e113f0af0c6 100644
--- a/SAS/DataManagement/StorageQueryService/test/CMakeLists.txt
+++ b/SAS/DataManagement/StorageQueryService/test/CMakeLists.txt
@@ -2,5 +2,4 @@
 include(LofarCTest)
 
 lofar_add_test(test_storagequery_service_and_rpc)
-lofar_add_test(test_simpleresourceupdater)
 
diff --git a/SAS/DataManagement/StorageQueryService/test/test_simpleresourceupdater.py b/SAS/DataManagement/StorageQueryService/test/test_simpleresourceupdater.py
deleted file mode 100755
index 96f410ba58c3e215d3c89aa8e4b12adfad50c2f4..0000000000000000000000000000000000000000
--- a/SAS/DataManagement/StorageQueryService/test/test_simpleresourceupdater.py
+++ /dev/null
@@ -1,233 +0,0 @@
-#!/usr/bin/env python
-# Copyright (C) 2017
-# ASTRON (Netherlands Institute for Radio Astronomy)
-# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
-#
-# This file is part of the LOFAR software suite.
-# The LOFAR software suite 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 3 of the
-# License, or (at your option) any later version.
-#
-# The LOFAR software suite 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 the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
-#
-# $Id$
-
-class RADB_mock:
-    def __init__(self):
-        # 2 nodes:
-        #   node1 has bandwidth and storage for mount points /d1-qzy, /d2-qzy
-        #   node2 has bandwidth and (inactive) storage for mount point /d-qzy
-        self.resources = [
-            {u'id': 0, u'name': u'node1_bandwidth:/d1-qzy',
-             u'active': True,
-             u'total_capacity': 1000,
-             u'available_capacity': 1000,
-             u'used_capacity': 0,
-             u'type_id': 3, u'type_name': u'bandwidth',
-             u'unit_id': 3, u'unit': u'bits/second'
-            },
-            {u'id': 1, u'name': u'node1_storage:/d1-qzy',
-             u'active': True,
-             u'total_capacity': 100,
-             u'available_capacity': 90,
-             u'used_capacity': 10,
-             u'type_id': 5, u'type_name': u'storage',
-             u'unit_id': 5, u'unit': u'bytes'
-            },
-            {u'id': 2, u'name': u'node1_bandwidth:/d2-qzy',
-             u'active': True,
-             u'total_capacity': 2000,
-             u'available_capacity': 2000,
-             u'used_capacity': 0,
-             u'type_id': 3, u'type_name': u'bandwidth',
-             u'unit_id': 3, u'unit': u'bits/second'
-            },
-            {u'id': 3, u'name': u'node1_storage:/d2-qzy',
-             u'active': True,
-             u'total_capacity': 200,
-             u'available_capacity': 180,
-             u'used_capacity': 20,
-             u'type_id': 5, u'type_name': u'storage',
-             u'unit_id': 5, u'unit': u'bytes'
-            },
-            {u'id': 4, u'name': u'node2_bandwidth:/d-qzy',
-             u'active': True,
-             u'total_capacity': 2000,
-             u'available_capacity': 2000,
-             u'used_capacity': 0,
-             u'type_id': 3, u'type_name': u'bandwidth',
-             u'unit_id': 3, u'unit': u'bits/second'
-            },
-            {u'id': 5, u'name': u'node2_storage:/d-qzy',
-             u'active': False,  # i.e. inactive by default
-             u'total_capacity': 5000,
-             u'available_capacity': 5000,
-             u'used_capacity': 0,
-             u'type_id': 5, u'type_name': u'storage',
-             u'unit_id': 5, u'unit': u'bytes'
-            },
-
-        ]
-
-        # The root node is INSTRUMENT. Under it 1 cluster named CLUSTER with 2 nodes and the 6 resources listed above.
-        # Note that node1 has 2 resource groups under it (group type 'virtual' but not annotated here) to have
-        # the data1 resources under another group than the data2 resources. This is similar to the real RADB.
-        self.memberships = {u'resources': {0: {u'resource_name': u'node1_bandwidth:/d1-qzy', u'parent_group_ids': [4], u'resource_id': 0},
-                                           1: {u'resource_name': u'node1_storage:/d1-qzy'  , u'parent_group_ids': [4], u'resource_id': 1},
-                                           2: {u'resource_name': u'node1_bandwidth:/d2-qzy', u'parent_group_ids': [5], u'resource_id': 2},
-                                           3: {u'resource_name': u'node1_storage:/d2-qzy'  , u'parent_group_ids': [5], u'resource_id': 3},
-                                           4: {u'resource_name': u'node2_bandwidth:/d-qzy' , u'parent_group_ids': [3], u'resource_id': 4},
-                                           5: {u'resource_name': u'node2_storage:/d-qzy'   , u'parent_group_ids': [3], u'resource_id': 5},
-                                          },
-                            u'groups':    {0: {u'resource_group_id': 0, u'parent_ids': [] , u'resource_ids': [],     u'child_ids': [1]   , u'resource_group_name': u'INSTRUMENT'},
-                                           1: {u'resource_group_id': 1, u'parent_ids': [0], u'resource_ids': [],     u'child_ids': [2, 3], u'resource_group_name': u'CLUSTER'},
-                                           2: {u'resource_group_id': 2, u'parent_ids': [1], u'resource_ids': [],     u'child_ids': [4, 5], u'resource_group_name': u'node1'},
-                                           3: {u'resource_group_id': 3, u'parent_ids': [1], u'resource_ids': [4, 5], u'child_ids': []    , u'resource_group_name': u'node2'},
-                                           4: {u'resource_group_id': 4, u'parent_ids': [2], u'resource_ids': [0, 1], u'child_ids': []    , u'resource_group_name': u'node1-1'},
-                                           5: {u'resource_group_id': 5, u'parent_ids': [2], u'resource_ids': [2, 3], u'child_ids': []    , u'resource_group_name': u'node1-2'},
-                                          }
-                           }
-
-    def get_resources(self):
-        return self.resources
-
-    def get_memberships(self):
-        return self.memberships
-
-# RADB changes stay persistent on purpose after a test program run.
-# Different test program runs are not different tests, but make up a single test, e.g. 'show, modify, show' should display the change.
-# To make different tests, reinitialize this object before each new test sequence.
-radb_mock = RADB_mock()
-
-class RADBRPC_mock:
-    def __init__(self, busname=None, # don't care about any of these here
-                 servicename=None,
-                 broker=None,
-                 timeout=0):
-        global radb_mock
-        self.radb_mock = radb_mock
-        self.is_open = True
-
-    def open(self):
-        self.is_open = True
-
-    def close(self):
-        self.is_open = False
-
-    def __enter__(self):
-        self.open()
-        return self
-
-    def __exit__(self, exc_type, exc_val, exc_tb):
-        self.close()
-
-    def updateResourceAvailability(self, resource_id, is_active=None, avail_cap=None, total_cap=None):
-        if not self.is_open:
-            raise Exception('RADBRPC_mock: updateResourceAvailability(): not open')
-
-        for res in self.radb_mock.get_resources():
-            if res['id'] == resource_id:
-                if is_active is not None:
-                    res['active'] = is_active
-                if avail_cap is not None:
-                    res['available_capacity'] = avail_cap  # data type not checked here...
-                if total_cap is not None:
-                    res['total_capacity'] = total_cap  # idem
-
-                if avail_cap is not None or total_cap is not None:
-                    res['used_capacity'] = res['total_capacity'] - res['available_capacity']  # idem
-                return
-
-        raise KeyError(resource_id)
-
-    def getResources(self, resource_ids=None, resource_types=None, include_availability=False):
-        if not self.is_open:
-            raise Exception('RADBRPC_mock getResources(): not open')
-
-        # Do approx what the rpc service does. This is sub-optimal, because the code may go out of sync.
-        # Python mock can do autospec on patched functions (we could do similar with the inspect module),
-        # but that doesn't apply to this sort of implementation logic.
-        resources = []
-        for res in self.radb_mock.get_resources():
-            if resource_ids is not None:
-                if isinstance(resource_ids, int) and res['id'] != resource_ids:
-                    continue
-                if res['id'] not in resource_ids:
-                    continue
-
-            if resource_types is not None:
-                if isinstance(resource_types, basestring) and res['type_name'] != resource_types:
-                    continue
-                if res['type_id'] not in resource_types:
-                    continue
-
-            res2 = dict(res)  # shallow copy is enough
-            if not include_availability:
-                del res2['active']
-                del res2['available_capacity']
-                del res2['total_capacity']
-                del res2['used_capacity']
-
-            resources.append(res2)
-
-        return resources
-
-    def getResourceGroupMemberships(self):
-        if not self.is_open:
-            raise Exception('RADBRPC_mock: getResourceGroupMemberships(): not open')
-
-        from copy import deepcopy
-        return deepcopy(self.radb_mock.get_memberships())
-
-
-from sys import exit
-
-import logging
-logging.basicConfig(format='%(asctime)s %(levelname)s %(message)s', level=logging.INFO)
-logger = logging.getLogger(__name__)
-
-# Hook the mock class in place after import and before running the program
-import lofar.sas.datamanagement.storagequery.simpleresourceupdater as sru
-sru.RARPC = RADBRPC_mock
-
-# List all resources
-rv = sru.main(['-G', 'INSTRUMENT'])
-if rv != 0:
-    logger.error('1st listing failed with status {}'.format(rv))
-    exit(1)
-
-# Change a few resources
-rv = sru.main(['-G', 'CLUSTER', 'node1_bandwidth:/d2-qzy=1999', 'node2_storage:/d-qzy=True,9000,10000'])
-if rv != 0:
-    logger.error('changing 2 resources failed with status {}'.format(rv))
-    exit(1)
-
-# List all CLUSTER resources (incl changes)
-rv = sru.main(['-G', 'CLUSTER'])
-if rv != 0:
-    logger.error('2nd listing failed with status {}'.format(rv))
-    exit(1)
-
-# Try a few erroneous cases.
-# We can't try errors detected by cmd-line arg parsing here, since the opt parser calls exit().
-rv = 1
-rv &= sru.main(['-G', 'NON_EXISTENT_GROUP'])
-rv &= sru.main(['-G', 'node1', 'node2_bandwidth:/d-qzy=False'])  # resource N/A under group node1
-rv &= sru.main(['-G', 'CLUSTER', 'node1_storage:/d1-qzy=101'])  # avail > total not allowed
-if rv == 0:
-    logger.error('some tests for erroneous cases incorrectly returned success')
-    exit(1)
-
-# Another overview (error cases should not have changed anything)
-rv = sru.main(['-G', 'INSTRUMENT'])
-if rv != 0:
-    logger.error('final listing failed with status {}'.format(rv))
-    exit(1)
-
diff --git a/SAS/DataManagement/StorageQueryService/test/test_simpleresourceupdater.run b/SAS/DataManagement/StorageQueryService/test/test_simpleresourceupdater.run
deleted file mode 100755
index 1aff39659e905acac4cad62a4752335e55691c90..0000000000000000000000000000000000000000
--- a/SAS/DataManagement/StorageQueryService/test/test_simpleresourceupdater.run
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/bash
-
-# Run the unit test
-source python-coverage.sh
-python_coverage_test "simpleresourceupdater" test_simpleresourceupdater.py
-
diff --git a/SAS/DataManagement/StorageQueryService/test/test_simpleresourceupdater.sh b/SAS/DataManagement/StorageQueryService/test/test_simpleresourceupdater.sh
deleted file mode 100755
index 8d377ecab63c37d55c17f1f7277d928579b15de9..0000000000000000000000000000000000000000
--- a/SAS/DataManagement/StorageQueryService/test/test_simpleresourceupdater.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-./runctest.sh test_simpleresourceupdater
diff --git a/SAS/MoM/MoMQueryService/MoMQueryServiceClient/momqueryrpc.py b/SAS/MoM/MoMQueryService/MoMQueryServiceClient/momqueryrpc.py
index 01a59bcb525a19bbf07202092e6f7d5a8ac74356..c01dfb890ba151277bdc1f0f88957bd0a6cbbd2d 100644
--- a/SAS/MoM/MoMQueryService/MoMQueryServiceClient/momqueryrpc.py
+++ b/SAS/MoM/MoMQueryService/MoMQueryServiceClient/momqueryrpc.py
@@ -153,7 +153,7 @@ class MoMQueryRPC(RPCWrapper):
         ids = [str(x) for x in ids]
         ids_string = ', '.join(ids)
 
-        logger.info("Requesting details for mom objects: %s", (str(ids_string)))
+        logger.info("Requesting details for %s mom objects", len(ids))
         result = self.rpc('GetObjectDetails', mom_ids=ids_string)
         result = convertStringDigitKeysToInt(result)
         logger.info("Received details for %s mom objects" % (len(result)))
diff --git a/SAS/OTB/OTB-distribution/pom.xml b/SAS/OTB/OTB-distribution/pom.xml
index ebe9c064b94fbe55edae7f7d84a0555c45249e0a..5f0297eea5fb4e3765c9c82525e2ecfc29405e97 100644
--- a/SAS/OTB/OTB-distribution/pom.xml
+++ b/SAS/OTB/OTB-distribution/pom.xml
@@ -10,11 +10,11 @@
   <parent>
     <groupId>nl.astron.lofar.sas.otb</groupId>
     <artifactId>otb-parent</artifactId>
-    <version>2.16.3-SNAPSHOT</version>
+    <version>2.22.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>OTB-distribution</artifactId>
-  <version>2.16.3-SNAPSHOT</version>
+  <version>2.22.0-SNAPSHOT</version>
   <packaging>pom</packaging>
 
 
diff --git a/SAS/OTB/OTB/pom.xml b/SAS/OTB/OTB/pom.xml
index d91db1fbc704a15c3e785c58400b697d450c34a9..ced9f3cb27aa35f04922b2adbd6770ede9755b16 100644
--- a/SAS/OTB/OTB/pom.xml
+++ b/SAS/OTB/OTB/pom.xml
@@ -10,7 +10,7 @@
   <parent>
     <groupId>nl.astron.lofar.sas.otb</groupId>
     <artifactId>otb-parent</artifactId>
-    <version>2.16.3-SNAPSHOT</version>
+    <version>2.22.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>OTB</artifactId>
diff --git a/SAS/OTB/RSP/pom.xml b/SAS/OTB/RSP/pom.xml
index 70d3dca4946e8f0a15206b3def9e830a338a7eaf..0d06457b3cae6837277e169cfedccf6eccadcf8a 100644
--- a/SAS/OTB/RSP/pom.xml
+++ b/SAS/OTB/RSP/pom.xml
@@ -9,7 +9,7 @@
   <parent>
     <groupId>nl.astron.lofar.sas.otb</groupId>
     <artifactId>otb-parent</artifactId>
-    <version>2.16.3-SNAPSHOT</version>
+    <version>2.22.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>RSP</artifactId>
diff --git a/SAS/OTB/jOTDB3/pom.xml b/SAS/OTB/jOTDB3/pom.xml
index ca1161e555c0c75d50cde8ebba62582635000691..6c808b7e8ceb70cc524f29c26299c857faeafdce 100644
--- a/SAS/OTB/jOTDB3/pom.xml
+++ b/SAS/OTB/jOTDB3/pom.xml
@@ -10,7 +10,7 @@
   <parent>
     <groupId>nl.astron.lofar.sas.otb</groupId>
     <artifactId>otb-parent</artifactId>
-    <version>2.16.3-SNAPSHOT</version>
+    <version>2.22.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>jOTDB3</artifactId>
diff --git a/SAS/OTB/jParmFacade/pom.xml b/SAS/OTB/jParmFacade/pom.xml
index 4bb7b4529b43bd9956f8f0cd31f757a8f3b3254b..61e0f1059398cbd2d9449ef45dd773ca89309026 100644
--- a/SAS/OTB/jParmFacade/pom.xml
+++ b/SAS/OTB/jParmFacade/pom.xml
@@ -10,7 +10,7 @@
   <parent>
     <groupId>nl.astron.lofar.sas.otb</groupId>
     <artifactId>otb-parent</artifactId>
-    <version>2.16.3-SNAPSHOT</version>
+    <version>2.22.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>jParmFacade</artifactId>
diff --git a/SAS/OTB/jRSP/pom.xml b/SAS/OTB/jRSP/pom.xml
index 5ae33df0f9546cc8b5d2732b887b7abfd891c576..7c090ef551ca6475bb7ce2b88c9deddecb734140 100644
--- a/SAS/OTB/jRSP/pom.xml
+++ b/SAS/OTB/jRSP/pom.xml
@@ -9,7 +9,7 @@
   <parent>
     <groupId>nl.astron.lofar.sas.otb</groupId>
     <artifactId>otb-parent</artifactId>
-    <version>2.16.3-SNAPSHOT</version>
+    <version>2.22.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>jRSP</artifactId>
diff --git a/SAS/OTB/pom.xml b/SAS/OTB/pom.xml
index 7b9e5e7bedc8df8a23061731a35e078b8dff0141..f77df0c51a2c97d32cb5936d3d2a9df93fe49e79 100644
--- a/SAS/OTB/pom.xml
+++ b/SAS/OTB/pom.xml
@@ -15,7 +15,7 @@
 
   <groupId>nl.astron.lofar.sas.otb</groupId>
   <artifactId>otb-parent</artifactId>
-  <version>2.16.3-SNAPSHOT</version>
+  <version>2.22.0-SNAPSHOT</version>
   <packaging>pom</packaging>
 
 
@@ -145,7 +145,7 @@
       <dependency>
         <groupId>${project.groupId}</groupId>
         <artifactId>OTB-distribution</artifactId>
-        <version>2.16.3-SNAPSHOT</version>
+        <version>2.22.0-SNAPSHOT</version>
       </dependency>
 
       <!-- Import the group 'nl.astron.lofar.lib' -->
diff --git a/SAS/OTDB_Services/OTDBBusListener.py b/SAS/OTDB_Services/OTDBBusListener.py
index bd2bf4367a468105648cb41d3da2fd9723d43d7c..99ef88fcc33bca222acd0e20b00876ca37ab9e8d 100644
--- a/SAS/OTDB_Services/OTDBBusListener.py
+++ b/SAS/OTDB_Services/OTDBBusListener.py
@@ -100,6 +100,14 @@ class OTDBBusListener(AbstractBusListener):
         else:
             logger.info("OTDBBusListener.handleMessage - handled unknown state: %s", msg.content['state'])
 
+        # apart from calling the above methods for known predefined states,
+        # also always call plain onObservationStatusChanged
+        # so subclasses can act on any status in this generic method.
+        self.onObservationStatusChanged(treeId, msg.content['state'], modificationTime)
+
+    def onObservationStatusChanged(self, treeId, new_status, modificationTime):
+        pass
+
     def onObservationDescribed(self, treeId, modificationTime):
         pass
 
diff --git a/SAS/OTDB_Services/test/CMakeLists.txt b/SAS/OTDB_Services/test/CMakeLists.txt
index d520d61ca2a532fb0478e8466005be958498a0a7..513a09629072e60ae5465fda6babbf58318636b9 100644
--- a/SAS/OTDB_Services/test/CMakeLists.txt
+++ b/SAS/OTDB_Services/test/CMakeLists.txt
@@ -4,6 +4,16 @@ include(LofarCTest)
 
 lofar_find_package(Python REQUIRED)
 
-lofar_add_test(t_TreeService)
-lofar_add_test(t_TreeStatusEvents)
+set(_qpid_tests
+    t_TreeService
+    t_TreeStatusEvents)
 
+if(HAVE_QPID)
+ foreach(_test ${_qpid_tests})
+   lofar_add_test(${_test})
+ endforeach()
+else()
+  lofar_join_arguments(_qpid_tests)
+  message(WARNING "Qpid is not set."
+    "The following tests will not be run: ${_qpid_tests}")
+endif()
diff --git a/SAS/ResourceAssignment/OTDBtoRATaskStatusPropagator/propagator.py b/SAS/ResourceAssignment/OTDBtoRATaskStatusPropagator/propagator.py
index 3e6b8a1264687c6d46b39593b45abcc23fde180d..4f4da6ad427e11a3b6c974cf48b97edcc08343cc 100644
--- a/SAS/ResourceAssignment/OTDBtoRATaskStatusPropagator/propagator.py
+++ b/SAS/ResourceAssignment/OTDBtoRATaskStatusPropagator/propagator.py
@@ -8,6 +8,7 @@ import logging
 from datetime import datetime, timedelta
 from optparse import OptionParser
 from lofar.common.util import waitForInterrupt
+from lofar.common.datetimeutils import parseDatetime
 from lofar.sas.otdb.OTDBBusListener import OTDBBusListener
 from lofar.sas.otdb.otdbrpc import OTDBRPC
 from lofar.sas.otdb.config import DEFAULT_OTDB_SERVICE_BUSNAME, DEFAULT_OTDB_SERVICENAME
@@ -18,6 +19,8 @@ from lofar.sas.resourceassignment.resourceassignmentservice.rpc import RARPC
 
 logger = logging.getLogger(__name__)
 
+STORAGE_CLAIM_EXTENSION=timedelta(days=365)
+
 class OTDBtoRATaskStatusPropagator(OTDBBusListener):
     def __init__(self,
                  otdb_notification_busname=DEFAULT_OTDB_NOTIFICATION_BUSNAME,
@@ -83,8 +86,9 @@ class OTDBtoRATaskStatusPropagator(OTDBBusListener):
                     new_startime = spec['ObsSW.Observation.startTime']
                     new_endtime = spec['ObsSW.Observation.stopTime']
 
-                    new_startime = datetime.strptime(new_startime, ('%Y-%m-%d %H:%M:%S.%f' if '.' in new_startime else '%Y-%m-%d %H:%M:%S'))
-                    new_endtime = datetime.strptime(new_endtime, ('%Y-%m-%d %H:%M:%S.%f' if '.' in new_endtime else '%Y-%m-%d %H:%M:%S'))
+                    new_startime = parseDatetime(new_startime)
+                    new_endtime = parseDatetime(new_endtime)
+                    new_endtime = max(new_endtime, radb_task['starttime']+timedelta(seconds=1)) # make sure endtime is always > starttime
 
                     logger.info("Updating task (otdb_id=%s, radb_id=%s, status=%s) startime to \'%s\' and endtime to \'%s\'", treeId, radb_task['id'], radb_task['status'], new_startime, new_endtime)
                     self.radb.updateTaskAndResourceClaims(radb_task['id'], starttime=new_startime, endtime=new_endtime)
@@ -104,6 +108,9 @@ class OTDBtoRATaskStatusPropagator(OTDBBusListener):
     def onObservationConflict(self, treeId, modificationTime):
         self._update_radb_task_status(treeId, 'conflict')
 
+    def onObservationError(self, treeId, modificationTime):
+        self._update_radb_task_status(treeId, 'error')
+
     def onObservationObsolete(self, treeId, modificationTime):
         self._update_radb_task_status(treeId, 'obsolete')
 
@@ -144,8 +151,27 @@ class OTDBtoRATaskStatusPropagator(OTDBBusListener):
                     new_startime = max([max_pred_endtime, datetime.utcnow()])
                     new_endtime = new_startime + timedelta(seconds=task['duration'])
 
-                    logger.info("Updating task %s (otdb_id=%s, status=queued) startime to \'%s\' and endtime to \'%s\'", task['id'], treeId, new_startime, new_endtime)
-                    self.radb.updateTaskAndResourceClaims(task['id'], starttime=new_startime, endtime=new_endtime)
+                    logger.info("Updating task %s (otdb_id=%s, status=active) startime to \'%s\' and endtime to \'%s\' except for storage claims",
+                                task['id'], treeId, new_startime, new_endtime)
+
+                    #update task and all claim start/endtimes, except for storage claims.
+                    non_storage_resource_type_ids = [rt['id'] for rt in self.radb.getResourceTypes() if rt['name'] != 'storage']
+                    self.radb.updateTaskAndResourceClaims(task['id'],
+                                                        where_resource_types=non_storage_resource_type_ids,
+                                                        starttime=new_startime,
+                                                        endtime=new_endtime)
+
+                    #get remaining storage claims...
+                    #and update storage start/end times (including 1 year extra)
+                    logger.info("Updating storage claims for task %s (otdb_id=%s, status=active) startime to \'%s\' and endtime to \'%s\' (with extra storage claim time)",
+                                task['id'], treeId, new_startime, new_endtime+STORAGE_CLAIM_EXTENSION)
+
+                    storage_claims = self.radb.getResourceClaims(task_ids=task['id'], resource_type='storage')
+                    storage_claim_ids = [c['id'] for c in storage_claims]
+                    self.radb.updateResourceClaims(where_resource_claim_ids=storage_claim_ids,
+                                                starttime=new_startime,
+                                                endtime=new_endtime+STORAGE_CLAIM_EXTENSION)
+
         except Exception as e:
             logger.error(e)
 
@@ -161,8 +187,26 @@ class OTDBtoRATaskStatusPropagator(OTDBBusListener):
                 new_startime = otdb_task['starttime']
                 new_endtime = new_startime + timedelta(seconds=radb_task['duration'])
 
-                logger.info("Updating task %s (otdb_id=%s, status=active) startime to \'%s\' and endtime to \'%s\'", radb_task['id'], treeId, new_startime, new_endtime)
-                self.radb.updateTaskAndResourceClaims(radb_task['id'], starttime=new_startime, endtime=new_endtime)
+                logger.info("Updating task %s (otdb_id=%s, status=active) startime to \'%s\' and endtime to \'%s\' except for storage claims",
+                            radb_task['id'], treeId, new_startime, new_endtime)
+
+                #update task and all claim start/endtimes, except for storage claims.
+                non_storage_resource_type_ids = [rt['id'] for rt in self.radb.getResourceTypes() if rt['name'] != 'storage']
+                self.radb.updateTaskAndResourceClaims(radb_task['id'],
+                                                      where_resource_types=non_storage_resource_type_ids,
+                                                      starttime=new_startime,
+                                                      endtime=new_endtime)
+
+                #get remaining storage claims...
+                #and update storage start/end times (including 1 year extra)
+                logger.info("Updating storage claims for task %s (otdb_id=%s, status=active) startime to \'%s\' and endtime to \'%s\' with extra claim time",
+                            radb_task['id'], treeId, new_startime, new_endtime)
+
+                storage_claims = self.radb.getResourceClaims(task_ids=radb_task['id'], resource_type='storage')
+                storage_claim_ids = [c['id'] for c in storage_claims]
+                self.radb.updateResourceClaims(where_resource_claim_ids=storage_claim_ids,
+                                               starttime=new_startime,
+                                               endtime=new_endtime+STORAGE_CLAIM_EXTENSION)
 
     def onObservationCompleting(self, treeId, modificationTime):
         self._update_radb_task_status(treeId, 'completing')
@@ -177,11 +221,33 @@ class OTDBtoRATaskStatusPropagator(OTDBBusListener):
                 return
 
             otdb_task = self.otdb.taskGetTreeInfo(otdb_id=treeId)
-            if otdb_task and (otdb_task['starttime'] != radb_task['starttime'] or otdb_task['stoptime'] != radb_task['endtime']):
-                new_endtime = otdb_task['stoptime']
+            if otdb_task is None:
+                logger.warning('could not find todb task with id %s', treeId)
+                return
 
-                logger.info("Updating task %s (otdb_id=%s, status=%s) endtime to \'%s\'", radb_task['id'], treeId, radb_task['status'], new_endtime)
-                self.radb.updateTaskAndResourceClaims(radb_task['id'], endtime=new_endtime)
+            now = datetime.utcnow()
+            if (now < otdb_task['stoptime'] #early stop/abort
+                or otdb_task['starttime'] != radb_task['starttime'] or otdb_task['stoptime'] != radb_task['endtime']): #change in spec
+                new_endtime = min(now, otdb_task['stoptime'])
+                new_endtime = max(new_endtime, radb_task['starttime']+timedelta(seconds=1)) # make sure endtime is always > starttime
+
+                logger.info("Updating task %s (otdb_id=%s, status=%s) endtime to \'%s\' except for storage resource claims", radb_task['id'], treeId, radb_task['status'], new_endtime)
+
+                #update task and all claim endtimes, except for storage claims.
+                non_storage_resource_type_ids = [rt['id'] for rt in self.radb.getResourceTypes() if rt['name'] != 'storage']
+                self.radb.updateTaskAndResourceClaims(radb_task['id'],
+                                                      where_resource_types=non_storage_resource_type_ids,
+                                                      endtime=new_endtime)
+
+                #get remaining storage claims...
+                #and extend storage end time
+                logger.info("Updating storage claims for task %s (otdb_id=%s, status=%s) endtime to \'%s\' (with extra storage claim time)",
+                            radb_task['id'], treeId, radb_task['status'], new_endtime+STORAGE_CLAIM_EXTENSION)
+
+                storage_claims = self.radb.getResourceClaims(task_ids=radb_task['id'], resource_type='storage')
+                storage_claim_ids = [c['id'] for c in storage_claims]
+                self.radb.updateResourceClaims(where_resource_claim_ids=storage_claim_ids,
+                                               endtime=new_endtime+STORAGE_CLAIM_EXTENSION)
 
     def onObservationFinished(self, treeId, modificationTime):
         self._update_radb_task_status(treeId, 'finished')
diff --git a/SAS/ResourceAssignment/RATaskSpecifiedService/lib/RATaskSpecified.py b/SAS/ResourceAssignment/RATaskSpecifiedService/lib/RATaskSpecified.py
index 91a16fc1f5982a1c3543c7c84e28e6de4ea40a71..048b624d22b3fae9fad8e0b5e758b6c74a3c33dd 100755
--- a/SAS/ResourceAssignment/RATaskSpecifiedService/lib/RATaskSpecified.py
+++ b/SAS/ResourceAssignment/RATaskSpecifiedService/lib/RATaskSpecified.py
@@ -121,17 +121,21 @@ class RATaskSpecified(OTDBBusListener):
             add("Observation.startTime")
             add("Observation.stopTime")
 
+        # =====================================
+        # Task settings
+        # =====================================
+        add("Observation.momID")
+        add("Observation.startTime")
+        add("Observation.stopTime")
+
         # =====================================
         # Observation settings
         # =====================================
         if radb_type == "observation":
-            add("Observation.momID")
             add("Observation.sampleClock", as_int)
             add("Observation.nrBitsPerSample", as_int)
             add("Observation.antennaSet")
             add("Observation.VirtualInstrument.stationList", as_strvector)
-            add("Observation.startTime")
-            add("Observation.stopTime")
             add("Observation.nrBeams", as_int)
 
             nrSAPs = subset.get("Observation.nrBeams", 0)
diff --git a/SAS/ResourceAssignment/ResourceAssigner/lib/raservice.py b/SAS/ResourceAssignment/ResourceAssigner/lib/raservice.py
index effe07417c206a1a214e9b1dc76d88a8c1ab516b..1ad10ee3d00f702a4814acf1d2aa0792da5e386b 100755
--- a/SAS/ResourceAssignment/ResourceAssigner/lib/raservice.py
+++ b/SAS/ResourceAssignment/ResourceAssigner/lib/raservice.py
@@ -176,6 +176,8 @@ def main():
                                  mom_servicename=options.mom_query_servicename,
                                  cleanup_busname=options.cleanup_busname,
                                  cleanup_servicename=options.cleanup_servicename,
+                                 otdb_busname=options.otdb_busname,
+                                 otdb_servicename=options.otdb_servicename,
                                  broker=options.broker) as schedulechecker:
                 waitForInterrupt()
 
diff --git a/SAS/ResourceAssignment/ResourceAssigner/lib/schedulechecker.py b/SAS/ResourceAssignment/ResourceAssigner/lib/schedulechecker.py
index 5a0c815d428dfb08b86f6e893b62d76739feb5e7..0e36a752d39c0a7307df077150c4a6f9b7122baf 100644
--- a/SAS/ResourceAssignment/ResourceAssigner/lib/schedulechecker.py
+++ b/SAS/ResourceAssignment/ResourceAssigner/lib/schedulechecker.py
@@ -37,7 +37,11 @@ from lofar.sas.datamanagement.cleanup.rpc import CleanupRPC
 from lofar.sas.datamanagement.cleanup.config import DEFAULT_BUSNAME as DEFAULT_CLEANUP_BUSNAME
 from lofar.sas.datamanagement.cleanup.config import DEFAULT_SERVICENAME as DEFAULT_CLEANUP_SERVICENAME
 
+from lofar.sas.otdb.otdbrpc import OTDBRPC
+from lofar.sas.otdb.config import DEFAULT_OTDB_SERVICE_BUSNAME, DEFAULT_OTDB_SERVICENAME
+
 from lofar.sas.resourceassignment.resourceassigner.config import PIPELINE_CHECK_INTERVAL
+from lofar.common.datetimeutils import *
 
 logger = logging.getLogger(__name__)
 
@@ -45,7 +49,8 @@ def movePipelineAfterItsPredecessors(task, radbrpc, min_start_timestamp=None):
     try:
         #only reschedule pipelines which run on cep4
         if task and task['type'] == 'pipeline' and task.get('cluster') == 'CEP4':
-            logger.info("checking pipeline starttime radb_id=%s otdb_id=%s", task['id'], task['otdb_id'])
+            logger.info("checking pipeline starttime radb_id=%s otdb_id=%s starttime=%s",
+                        task['id'], task['otdb_id'], task['starttime'])
 
             predecessor_tasks = radbrpc.getTasks(task_ids=task['predecessor_ids'])
 
@@ -66,7 +71,7 @@ def movePipelineAfterItsPredecessors(task, radbrpc, min_start_timestamp=None):
                     #exclude self
                     overlapping_pipelines = [pl for pl in overlapping_pipelines if pl['id'] != task['id']]
 
-                    if len(overlapping_pipelines) >= 2:
+                    if len(overlapping_pipelines) >= 1:
                         max_overlapping_pipeline_endtime = max([t['endtime'] for t in overlapping_pipelines])
                         shift = max_overlapping_pipeline_endtime + timedelta(minutes=1) - task['starttime']
                         newStartTime = task['starttime']+shift
@@ -75,9 +80,13 @@ def movePipelineAfterItsPredecessors(task, radbrpc, min_start_timestamp=None):
                         break
 
                 if shift != timedelta(seconds=0):
-                    logger.info("Moving %s pipeline radb_id=%s otdb_id=%s by %s from \'%s\' to \'%s\'", task['status'], task['id'], task['otdb_id'], shift, task['starttime'], newStartTime)
-                    radbrpc.updateTaskAndResourceClaims(task['id'], starttime=newStartTime, endtime=newEndTime)
+                    logger.info("Moving %s pipeline radb_id=%s otdb_id=%s by %s from \'%s\' to \'%s\'", task['status'], task['id'], task['otdb_id'], format_timedelta(shift), task['starttime'], newStartTime)
+                    if not radbrpc.updateTaskAndResourceClaims(task['id'], starttime=newStartTime, endtime=newEndTime):
+                        logger.warn("Could not update start/endtime for pipeline radb_id=%s otdb_id=%s",
+                                    updated_task['id'], updated_task['otdb_id'])
+
                     updated_task = radbrpc.getTask(task['id'])
+
                     if updated_task['status'] != task['status']:
                         logger.warn("Moving of pipeline radb_id=%s otdb_id=%s caused the status to change from %s to %s", updated_task['id'], updated_task['otdb_id'], task['status'], updated_task['status'])
                         #TODO: automatically resolve conflict status by moved pipeline in first free time slot.
@@ -92,6 +101,8 @@ class ScheduleChecker():
                  mom_servicename=DEFAULT_MOMQUERY_SERVICENAME,
                  cleanup_busname=DEFAULT_CLEANUP_BUSNAME,
                  cleanup_servicename=DEFAULT_CLEANUP_SERVICENAME,
+                 otdb_busname=DEFAULT_OTDB_SERVICE_BUSNAME,
+                 otdb_servicename=DEFAULT_OTDB_SERVICENAME,
                  broker=None):
         """
         """
@@ -100,6 +111,7 @@ class ScheduleChecker():
         self._radbrpc = RARPC(servicename=radb_servicename, busname=radb_busname, broker=broker)
         self._momrpc = MoMQueryRPC(servicename=mom_servicename, busname=mom_busname, broker=broker)
         self._curpc = CleanupRPC(busname=cleanup_busname, servicename=cleanup_servicename, broker=broker)
+        self._otdbrpc = OTDBRPC(busname=otdb_busname, servicename=otdb_servicename, broker=broker, timeout=180)
 
     def __enter__(self):
         """Internal use only. (handles scope 'with')"""
@@ -115,6 +127,7 @@ class ScheduleChecker():
         self._radbrpc.open()
         self._momrpc.open()
         self._curpc.open()
+        self._otdbrpc.open()
         self._running = True
         self._thread = Thread(target=self._check_loop)
         self._thread.daemon = True
@@ -125,6 +138,7 @@ class ScheduleChecker():
         self._radbrpc.close()
         self._momrpc.close()
         self._curpc.close()
+        self._otdbrpc.close()
         self._running = False
         self._thread.join(60)
 
@@ -155,6 +169,12 @@ class ScheduleChecker():
         try:
             now = datetime.utcnow()
             min_start_timestamp = now + timedelta(seconds=PIPELINE_CHECK_INTERVAL)
+            #round to next minute
+            min_start_timestamp = datetime(min_start_timestamp.year,
+                                           min_start_timestamp.month ,
+                                           min_start_timestamp.day,
+                                           min_start_timestamp.hour,
+                                           min_start_timestamp.minute+1)
 
             pipelines = self._radbrpc.getTasks(task_status=['scheduled', 'queued'], task_type='pipeline', cluster='CEP4')
 
@@ -180,8 +200,8 @@ class ScheduleChecker():
           Here, we check for jobs that are yet to run, and are in "opened" in MoM. Such jobs are subsequently deleted from the RADB.
         """
         try:
-            logger.info('checking approved tasks for status in mom')
-            unrun_tasks = self._radbrpc.getTasks(task_status=['approved', 'scheduled', 'prescheduled', 'queued', 'error'], task_type=['observation', 'pipeline'])
+            logger.info('checking unfinished tasks for status in mom')
+            unrun_tasks = self._radbrpc.getTasks(task_status=['approved', 'scheduled', 'prescheduled', 'queued', 'error', 'aborted'], task_type=['observation', 'pipeline'])
             mom_ids = [t['mom_id'] for t in unrun_tasks]
             mom_details = self._momrpc.getObjectDetails(mom_ids)
 
@@ -220,11 +240,39 @@ class ScheduleChecker():
         except Exception as e:
             logger.error("Error while checking unrun tasks for  MoM opened/described/suspended status: %s", e)
 
+    def checkUnRunReservations(self):
+        """All non-mon tasks in otdb can be deleted in otdb without us knowing about it (there is no otdb-task-deleted event)
+          Here, we check for all non-mom tasks that are yet to run if they still exist in otdb. If not, such jobs are subsequently deleted from the RADB.
+        """
+        try:
+            logger.info('checking reservation in otdb')
+            reservations = self._radbrpc.getTasks(task_type=['reservation'], lower_bound=datetime.utcnow())
+
+            for reservation in reservations:
+                try:
+                    otdb_id = int(reservation['otdb_id'])
+                    status = self._otdbrpc.taskGetStatus(otdb_id)
+                    logger.info('reservation %s status = %s', otdb_id, status)
+
+                    if status != 'scheduled':
+                        logger.info('deleting reservation otdb_id=%s radb_id=%s otdb_status=%s from rabd',
+                                    otdb_id, reservation['id'], status)
+                        # delete the spec (and task/claims etc via cascading delete) from radb to get it in sync again with mom
+                        self._radbrpc.deleteSpecification(reservation['specification_id'])
+                except Exception as e:
+                    logger.error("Error while checking reservation otdb_id=%s radb_id=%s in otdb: %s",
+                                 reservation['otdb_id'],
+                                 reservation['id'],
+                                 e)
+        except Exception as e:
+            logger.error("Error while checking unrun tasks for  MoM opened/described/suspended status: %s", e)
+
     def _check_loop(self):
         while self._running:
             self.checkRunningPipelines()
             self.checkScheduledAndQueuedPipelines()
             self.checkUnRunTasksForMoMOpenedStatus()
+            self.checkUnRunReservations()
 
             for i in range(PIPELINE_CHECK_INTERVAL):
                 sleep(1)
diff --git a/SAS/ResourceAssignment/ResourceAssigner/test/t_schedulechecker.py b/SAS/ResourceAssignment/ResourceAssigner/test/t_schedulechecker.py
index 8ef2c28b74b984cf695425a5781b29524c80b7a3..fdb3f3c7f9992458c176e3523c0e608b933663e4 100755
--- a/SAS/ResourceAssignment/ResourceAssigner/test/t_schedulechecker.py
+++ b/SAS/ResourceAssignment/ResourceAssigner/test/t_schedulechecker.py
@@ -30,11 +30,12 @@ ra_notification_prefix = "ra_notification_prefix"
 
 
 class TestingScheduleChecker(ScheduleChecker):
-    def __init__(self, rarpc, momrpc, curpc):
+    def __init__(self, rarpc, momrpc, curpc, otdbrpc):
         # super gets not done to be able to insert mocks as early as possible otherwise the RPC block unittesting
         self._radbrpc = rarpc
         self._momrpc = momrpc
         self._curpc = curpc
+        self._otdbrpc = otdbrpc
 
 
 class ScheduleCheckerTest(unittest.TestCase):
@@ -55,6 +56,10 @@ class ScheduleCheckerTest(unittest.TestCase):
         self.addCleanup(curpc_patcher.stop)
         self.curpc_mock = curpc_patcher.start()
 
+        otdbrpc_patcher = mock.patch('lofar.sas.otdb.otdbrpc.OTDBRPC')
+        self.addCleanup(otdbrpc_patcher.stop)
+        self.otdbrpc_mock = otdbrpc_patcher.start()
+
         # Default return values
         self.rarpc_mock.getTasks.return_value = [ { 'id': 'id', 'mom_id': '1', 'otdb_id': 'otdb_id', 'status': 'approved', 'type': 'observation', 'specification_id': 'specification_id' } ]
         self.momrpc_mock.getObjectDetails.return_value = { 1: { 'object_status': 'approved' } }
@@ -74,7 +79,7 @@ class ScheduleCheckerTest(unittest.TestCase):
         self.assertTrue(self.curpc_mock.close.called, "CURPC.close was not called")
 
     def test_contextManager_opens_and_closes_all_services(self):
-        with TestingScheduleChecker(self.rarpc_mock, self.momrpc_mock, self.curpc_mock):
+        with TestingScheduleChecker(self.rarpc_mock, self.momrpc_mock, self.curpc_mock, self.otdbrpc_mock):
             self.assert_all_services_opened()
 
         self.assert_all_services_closed()
@@ -120,7 +125,7 @@ class ScheduleCheckerTest(unittest.TestCase):
         self.rarpc_mock.getTasks.return_value = [ { 'id': 'id', 'status': 'scheduled', 'type': 'pipeline', 'starttime': datetime.datetime.utcnow() } ]
         self.rarpc_mock.getTask.return_value =    { 'id': 'id', 'status': 'scheduled', 'type': 'pipeline', 'starttime': datetime.datetime.utcnow() }
 
-        with TestingScheduleChecker(self.rarpc_mock, self.momrpc_mock, self.curpc_mock) as schedulechecker:
+        with TestingScheduleChecker(self.rarpc_mock, self.momrpc_mock, self.curpc_mock, self.otdbrpc_mock) as schedulechecker:
             schedulechecker.checkScheduledAndQueuedPipelines()
 
             self.assertTrue(movePipeline_mock.called, "Pipeline was not moved.")
@@ -130,7 +135,7 @@ class ScheduleCheckerTest(unittest.TestCase):
 
         self.rarpc_mock.getTasks.return_value = [ { 'id': 'id', 'mom_id': '1', 'otdb_id': 'otdb_id', 'status': 'active', 'type': 'pipeline', 'specification_id': 'specification_id', 'endtime': datetime.datetime.utcnow() } ]
 
-        with TestingScheduleChecker(self.rarpc_mock, self.momrpc_mock, self.curpc_mock) as schedulechecker:
+        with TestingScheduleChecker(self.rarpc_mock, self.momrpc_mock, self.curpc_mock, self.otdbrpc_mock) as schedulechecker:
             schedulechecker.checkRunningPipelines()
 
             self.assertTrue(self.rarpc_mock.updateTaskAndResourceClaims.called, "Task was not updated.")
@@ -140,7 +145,7 @@ class ScheduleCheckerTest(unittest.TestCase):
         """ Test if a MoM task on 'opened' and in OTDB on 'approved' causes the task to be deleted. """
         self.momrpc_mock.getObjectDetails.return_value = { 1: { 'object_status': 'opened' } }
 
-        with TestingScheduleChecker(self.rarpc_mock, self.momrpc_mock, self.curpc_mock) as schedulechecker:
+        with TestingScheduleChecker(self.rarpc_mock, self.momrpc_mock, self.curpc_mock, self.otdbrpc_mock) as schedulechecker:
             schedulechecker.checkUnRunTasksForMoMOpenedStatus()
 
             self.assertTrue(self.curpc_mock.removeTaskData.called, "Task output was not deleted from disk")
@@ -150,7 +155,7 @@ class ScheduleCheckerTest(unittest.TestCase):
         """ Test if a MoM task on 'approved' and in OTDB on 'approved' causes the task NOT to be deleted. """
         self.momrpc_mock.getObjectDetails.return_value = { 1: { 'object_status': 'approved' } }
 
-        with TestingScheduleChecker(self.rarpc_mock, self.momrpc_mock, self.curpc_mock) as schedulechecker:
+        with TestingScheduleChecker(self.rarpc_mock, self.momrpc_mock, self.curpc_mock, self.otdbrpc_mock) as schedulechecker:
             schedulechecker.checkUnRunTasksForMoMOpenedStatus()
 
             self.assertFalse(self.curpc_mock.removeTaskData.called, "Task output was deleted from disk")
@@ -160,7 +165,7 @@ class ScheduleCheckerTest(unittest.TestCase):
         """ Test if a task is not in MoM, and 'approved' in OTDB. This causes the task to be deleted. """
         self.momrpc_mock.getObjectDetails.return_value = {}
 
-        with TestingScheduleChecker(self.rarpc_mock, self.momrpc_mock, self.curpc_mock) as schedulechecker:
+        with TestingScheduleChecker(self.rarpc_mock, self.momrpc_mock, self.curpc_mock, self.otdbrpc_mock) as schedulechecker:
             schedulechecker.checkUnRunTasksForMoMOpenedStatus()
 
             self.assertTrue(self.rarpc_mock.deleteSpecification.called, "Object was not removed from RADB")
@@ -168,7 +173,7 @@ class ScheduleCheckerTest(unittest.TestCase):
     def test_checkUnRunTasksForMoMOpenedStatus_only_observations_pipelines(self):
         """ Test if only observations and pipelines are compared against the MoMDB (and not maintenance or reservation tasks, for example). """
 
-        with TestingScheduleChecker(self.rarpc_mock, self.momrpc_mock, self.curpc_mock) as schedulechecker:
+        with TestingScheduleChecker(self.rarpc_mock, self.momrpc_mock, self.curpc_mock, self.otdbrpc_mock) as schedulechecker:
             schedulechecker.checkUnRunTasksForMoMOpenedStatus()
 
             self.assertEquals(self.rarpc_mock.getTasks.call_args[1]["task_type"], ['observation', 'pipeline'], "Only observations and pipelines must be matched against MoMDB")
diff --git a/SAS/ResourceAssignment/ResourceAssignmentDatabase/radb.py b/SAS/ResourceAssignment/ResourceAssignmentDatabase/radb.py
index 3ecac5df5d49c7e325b14ebdb10a3394cb4f71b0..c9b0edc668314aba3b7968db96ecbabb214808bf 100644
--- a/SAS/ResourceAssignment/ResourceAssignmentDatabase/radb.py
+++ b/SAS/ResourceAssignment/ResourceAssignmentDatabase/radb.py
@@ -45,8 +45,10 @@ class RADatabase:
         self.conn = None
         self.cursor = None
         self.log_queries = log_queries
-        self._taskStatusCache = {}
-        self._taskTypeCache = {}
+        self._taskStatusName2IdCache = {}
+        self._taskTypeName2IdCache = {}
+        self._claimStatusName2IdCache = {}
+        self._claimStatusId2NameCache = {}
 
     def _connect(self):
         self.conn = None
@@ -69,13 +71,18 @@ class RADatabase:
     def _executeQuery(self, query, qargs=None, fetch=_FETCH_NONE):
         ''' Execute the query and reconnect upon OperationalError '''
 
-        if self.log_queries:
-            logger.info('executing query: %s' % self._queryAsSingleLine(query, qargs))
-
         # Allow for 5 connection retries
         for i in range(5):
             try:
+                start = datetime.utcnow()
                 self.cursor.execute(query, qargs)
+                if self.log_queries:
+                    elapsed = datetime.utcnow() - start
+                    elapsed_ms = 1000.0 * totalSeconds(elapsed)
+                    logger.info('executed query in %.1fms%s yielding %s rows: %s', elapsed_ms,
+                                                                                   ' (SLOW!)' if elapsed_ms > 250 else '', # for easy log grep'ing
+                                                                                   self.cursor.rowcount,
+                                                                                   self._queryAsSingleLine(query, qargs))
                 break
             except (psycopg2.OperationalError, AttributeError) as e:
                 if isinstance(e, psycopg2.OperationalError):
@@ -87,14 +94,12 @@ class RADatabase:
                     logger.info("connected to radb")
                 time.sleep(i*i)
             except (psycopg2.IntegrityError, psycopg2.ProgrammingError, psycopg2.InternalError, psycopg2.DataError)as e:
+                self._log_database_notifications()
                 logger.error("Rolling back query=\'%s\' due to error: \'%s\'" % (self._queryAsSingleLine(query, qargs), e))
                 self.rollback()
                 return []
 
-        if self.conn.notices:
-            for notice in self.conn.notices:
-                logger.info('database log message %s', notice.strip())
-            del self.conn.notices[:]
+        self._log_database_notifications()
 
         if fetch == _FETCH_ONE:
             return self.cursor.fetchone()
@@ -102,6 +107,11 @@ class RADatabase:
         if fetch == _FETCH_ALL:
             return self.cursor.fetchall()
 
+    def _log_database_notifications(self):
+        if self.conn.notices:
+            for notice in self.conn.notices:
+                logger.info('database log message %s', notice.strip())
+            del self.conn.notices[:]
 
     def commit(self):
         logger.info('commit')
@@ -119,16 +129,16 @@ class RADatabase:
     def getTaskStatusNames(self):
         return [x['name'] for x in self.getTaskStatuses()]
 
-    def getTaskStatusId(self, status_name, from_cache=False):
-        if from_cache and status_name in self._taskStatusCache:
-            return self._taskStatusCache[status_name]
+    def getTaskStatusId(self, status_name, from_cache=True):
+        if from_cache and status_name in self._taskStatusName2IdCache:
+            return self._taskStatusName2IdCache[status_name]
 
         query = '''SELECT id from resource_allocation.task_status
                    WHERE name = %s;'''
         result = self._executeQuery(query, [status_name], fetch=_FETCH_ONE)
 
         if result:
-            self._taskStatusCache[status_name] = result['id']
+            self._taskStatusName2IdCache[status_name] = result['id']
             return result['id']
 
         raise KeyError('No such status: %s Valid values are: %s' % (status_name, ', '.join(self.getTaskStatusNames())))
@@ -141,16 +151,16 @@ class RADatabase:
     def getTaskTypeNames(self):
         return [x['name'] for x in self.getTaskTypes()]
 
-    def getTaskTypeId(self, type_name, from_cache=False):
-        if from_cache and type_name in self._taskStatusCache:
-            return self._taskTypeCache[type_name]
+    def getTaskTypeId(self, type_name, from_cache=True):
+        if from_cache and type_name in self._taskTypeName2IdCache:
+            return self._taskTypeName2IdCache[type_name]
 
         query = '''SELECT id from resource_allocation.task_type
                    WHERE name = %s;'''
         result = self._executeQuery(query, [type_name], fetch=_FETCH_ONE)
 
         if result:
-            self._taskTypeCache[type_name] = result['id']
+            self._taskTypeName2IdCache[type_name] = result['id']
             return result['id']
 
         raise KeyError('No such type: %s Valid values are: %s' % (type_name, ', '.join(self.getTaskTypeNames())))
@@ -163,22 +173,32 @@ class RADatabase:
     def getResourceClaimStatusNames(self):
         return [x['name'] for x in self.getResourceClaimStatuses()]
 
-    def getResourceClaimStatusId(self, status_name):
+    def getResourceClaimStatusId(self, status_name, from_cache=True):
+        if from_cache and status_name in self._claimStatusName2IdCache:
+            return self._claimStatusName2IdCache[status_name]
+
         query = '''SELECT id from resource_allocation.resource_claim_status
                    WHERE name = %s;'''
         result = self._executeQuery(query, [status_name], fetch=_FETCH_ONE)
 
         if result:
+            self._claimStatusName2IdCache[status_name] = result['id']
+            self._claimStatusId2NameCache[result['id']] = status_name
             return result['id']
 
         raise KeyError('No such status: %s. Valid values are: %s' % (status_name, ', '.join(self.getResourceClaimStatusNames())))
 
-    def getResourceClaimStatusName(self, status_id):
+    def getResourceClaimStatusName(self, status_id, from_cache=True):
+        if from_cache and status_id in self._claimStatusId2NameCache:
+            return self._claimStatusId2NameCache[status_id]
+
         query = '''SELECT name from resource_allocation.resource_claim_status
                    WHERE id = %s;'''
         result = self._executeQuery(query, [status_id], fetch=_FETCH_ONE)
 
         if result:
+            self._claimStatusId2NameCache[status_id] = result['name']
+            self._claimStatusName2IdCache[result['name']] = status_id
             return result['name']
 
         raise KeyError('No such status_id: %s. Valid values are: %s' % (status_id, ', '.join([x['id'] for x in self.getResourceClaimStatuses()])))
@@ -470,6 +490,36 @@ class RADatabase:
 
         return self.cursor.rowcount > 0
 
+    def updateTaskStartEndTimes(self, task_id, starttime=None, endtime=None, commit=True):
+        fields = []
+        values = []
+
+        if starttime:
+            fields.append('starttime')
+            values.append(starttime)
+
+        if endtime:
+            fields.append('endtime')
+            values.append(endtime)
+
+        if not fields:
+            return False
+
+        values.append(task_id)
+
+        query = '''UPDATE resource_allocation.specification
+        SET ({fields}) = ({value_placeholders})
+        WHERE resource_allocation.specification.id in 
+        (SELECT t.specification_id FROM resource_allocation.task
+         t WHERE t.id={id_placeholder});'''.format(fields=', '.join(fields),
+                                                   value_placeholders=', '.join('%s' for x in fields),
+                                                   id_placeholder='%s')
+        self._executeQuery(query, values)
+        if commit:
+            self.commit()
+
+        return self.cursor.rowcount > 0
+
     def getTaskPredecessorIds(self, id=None):
         query = '''SELECT * from resource_allocation.task_predecessor tp'''
 
@@ -564,7 +614,7 @@ class RADatabase:
         query = '''SELECT * from resource_allocation.specification spec
         WHERE spec.id = (%s);'''
 
-        return list(self._executeQuery(query, [specification_id], fetch=_FETCH_ALL))
+        return self._executeQuery(query, [specification_id], fetch=_FETCH_ONE)
 
     def insertSpecification(self, starttime, endtime, content, cluster, commit=True):
         logger.info('insertSpecification starttime=%s, endtime=%s cluster=%s' % (starttime, endtime, cluster))
@@ -680,7 +730,7 @@ class RADatabase:
         raise KeyError('No such unit: %s Valid values are: %s' % (unit_name, ', '.join(self.getUnitNames())))
 
     def getResources(self, resource_ids=None, resource_types=None, include_availability=False, claimable_capacity_lower_bound=None, claimable_capacity_upper_bound=None):
-        '''get list of resources for the requested resource_ids and/or resource_types (may be None). 
+        '''get list of resources for the requested resource_ids and/or resource_types (may be None).
         By default, for each resource, no availability and total-, used- and available capacity are returned. Specify include_availability=True to get those as well.
         By default, for each resource, no claimable_capacity is returned. Specify claimable_capacity_lower_bound and claimable_capacity_upper_bound to get the claimable_capacity as well.
         :param resource_ids: only get the resources for the given ids
@@ -751,6 +801,24 @@ class RADatabase:
 
         return resources
 
+    def get_current_resource_usage(self, resource_id, claim_status='claimed'):
+        if isinstance(claim_status, basestring):
+            claim_status_id = self.getResourceClaimStatusId(claim_status)
+        else:
+            claim_status_id = claim_status
+
+        query = '''SELECT * from resource_allocation.get_current_resource_usage(%s, %s)'''
+        return self._executeQuery(query, (resource_id, claim_status_id), fetch=_FETCH_ONE)
+
+    def get_resource_usage_at_or_before(self, resource_id, timestamp, claim_status='claimed', exactly_at=False, only_before=False):
+        if isinstance(claim_status, basestring):
+            claim_status_id = self.getResourceClaimStatusId(claim_status)
+        else:
+            claim_status_id = claim_status
+
+        query = '''SELECT * from resource_allocation.get_resource_usage_at_or_before(%s, %s, %s, %s, %s, %s)'''
+        return self._executeQuery(query, (resource_id, claim_status_id, timestamp, exactly_at, only_before, False), fetch=_FETCH_ONE)
+
     def updateResourceAvailability(self, resource_id, active=None, available_capacity=None, total_capacity=None, commit=True):
         if active is not None:
             query = '''UPDATE resource_monitoring.resource_availability
@@ -1149,7 +1217,7 @@ class RADatabase:
         '''
         insert one resource claim for the given task
         :param resource_id: id of the resource which is claimed
-        :param task_id: id of the task for which this claim is made 
+        :param task_id: id of the task for which this claim is made
         :param starttime: when should this claim start? (can be different than the task's starttime)
         :param endtime: when should this claim end? (can be different than the task's endtime)
         :param claim_size: how much do you want to claim?
@@ -1179,18 +1247,18 @@ class RADatabase:
     def insertResourceClaims(self, task_id, claims, username, user_id, commit=True):
         '''bulk insert of a list of resource claims for a task(_id). All claims are inserted with status tentative.
         :param task_id: the task(_id) for which these claims are inserted. Each claim always belongs to one task, and one task only.
-        :param claims: list of claims. each claim is defined by the following dict: {'resource_id': <int>, 
-                                                                                     'starttime': <datetime>, 
-                                                                                     'endtime': <datetime>, 
-                                                                                     'claim_size': <int>, 
+        :param claims: list of claims. each claim is defined by the following dict: {'resource_id': <int>,
+                                                                                     'starttime': <datetime>,
+                                                                                     'endtime': <datetime>,
+                                                                                     'claim_size': <int>,
                                                                                      'used_rcus': <??>,
-                                                                                     'properties': <list of tuples> #see insertResourceClaimProperties 
+                                                                                     'properties': <list of tuples> #see insertResourceClaimProperties
                                                                                      }
         :param username: the name of the user who inserts these claims (to link the this insert action to a user) (Not used yet, fill in any name)
         :param userid: the id of the user who inserts these claims (to link the this insert action to a user) (Not used yet, fill in any int)
-        :return: list of ints with the new claim id's 
-        
-        claims is a list of dicts. Each dict is a claim for one resource containing the fields: 
+        :return: list of ints with the new claim id's
+
+        claims is a list of dicts. Each dict is a claim for one resource containing the fields:
         starttime, endtime, status, claim_size
         '''
         logger.info('insertResourceClaims for task_id=%d with %d claim(s)' % (task_id, len(claims)))
@@ -1231,7 +1299,7 @@ class RADatabase:
         claimIds = [x['id'] for x in self._executeQuery(query, fetch=_FETCH_ALL)]
 
         if not claimIds or [x for x in claimIds if x < 0]:
-            logger.error("One or more claims cloud not be inserted. Rolling back.")
+            logger.error("One or more claims could not be inserted. Rolling back.")
             self.rollback()
             return []
 
@@ -1271,10 +1339,11 @@ class RADatabase:
     def updateResourceClaim(self, resource_claim_id, resource_id=None, task_id=None, starttime=None, endtime=None,
                             status=None, claim_size=None, username=None, used_rcus=None, user_id=None,
                             commit=True):
-        return self.updateResourceClaims([resource_claim_id], None, resource_id, task_id, starttime, endtime, status,
+        return self.updateResourceClaims([resource_claim_id], None, None, resource_id, task_id, starttime, endtime, status,
                                          claim_size, username, used_rcus, user_id, commit)
 
-    def updateResourceClaims(self, where_resource_claim_ids=None, where_task_ids=None, resource_id=None, task_id=None, starttime=None, endtime=None,
+    def updateResourceClaims(self, where_resource_claim_ids=None, where_task_ids=None, where_resource_types=None,
+                             resource_id=None, task_id=None, starttime=None, endtime=None,
                              status=None, claim_size=None, username=None, used_rcus=None, user_id=None,
                              commit=True):
         '''Update the given paramenters on all resource claims given/delimited by where_resource_claim_ids and/or where_task_ids.
@@ -1287,8 +1356,6 @@ class RADatabase:
         When one or more claims of a task are in conflict status, then its task is set to conflict as well, and hence cannot be scheduled.
         When all claims of a task are not in conflict status anymore, then the task is set to approved, and hence it is possible the schedule the task.
         '''
-        logger.info("updateResourceClaims")
-
         status_id = status
         if status is not None and isinstance(status, basestring):
             #convert status string to status.id
@@ -1358,8 +1425,27 @@ class RADatabase:
                 conditions.append('task_id in %s')
                 values.append(tuple(where_task_ids))
 
+        if where_resource_types is not None:
+            if isinstance(where_resource_types, basestring) or isinstance(where_resource_types, int):
+                where_resource_types = [where_resource_types]
+            elif not isinstance(where_resource_types, collections.Iterable):
+                where_resource_types = [where_resource_types]
+
+            # convert any resource_type name to id
+            resource_type_names = set([x for x in where_resource_types if isinstance(x, basestring)])
+            if resource_type_names:
+                resource_type_name_to_id = {x['name']:x['id'] for x in self.getResourceTypes()}
+                where_resource_type_ids = [resource_type_name_to_id[x] if isinstance(x, basestring) else x
+                                           for x in where_resource_types]
+            else:
+                where_resource_type_ids = [x for x in where_resource_types]
+
+            conditions.append('resource_id in (SELECT r.id FROM virtual_instrument.resource r WHERE r.type_id in %s)')
+            values.append(tuple(where_resource_type_ids))
+
         query += ' WHERE ' + ' AND '.join(conditions)
 
+
         self._executeQuery(query, values)
 
         if commit:
@@ -1368,7 +1454,7 @@ class RADatabase:
         return self.cursor.rowcount > 0
 
 
-    def updateTaskAndResourceClaims(self, task_id, starttime=None, endtime=None, task_status=None, claim_status=None, username=None, used_rcus=None, user_id=None, commit=True):
+    def updateTaskAndResourceClaims(self, task_id, starttime=None, endtime=None, task_status=None, claim_status=None, username=None, used_rcus=None, user_id=None, where_resource_types=None, commit=True):
         '''combination of updateResourceClaims and updateTask in one transaction'''
         updated = True
 
@@ -1376,6 +1462,7 @@ class RADatabase:
             username is not None or used_rcus is not None or user_id is not None):
             # update the claims as well
             updated &= self.updateResourceClaims(where_task_ids=task_id,
+                                                 where_resource_types=where_resource_types,
                                                  starttime=starttime,
                                                  endtime=endtime,
                                                  status=claim_status,
@@ -1384,28 +1471,30 @@ class RADatabase:
                                                  user_id=user_id,
                                                  commit=False)
 
+        if starttime or endtime:
+            updated &= self.updateTaskStartEndTimes(task_id, starttime=starttime, endtime=endtime, commit=False)
+
         if task_status is not None :
             updated &= self.updateTask(task_id, task_status=task_status, commit=False)
 
-        if starttime or endtime:
-            task = self.getTask(task_id)
-            if task is None:
-                return False
-            updated &= self.updateSpecification(task['specification_id'], starttime=starttime, endtime=endtime, commit=False)
-
         if commit:
             self.commit()
 
         return updated
 
-    def get_conflicting_overlapping_claims(self, claim_id):
+    def get_overlapping_claims(self, claim_id, claim_status='claimed'):
         '''returns a list of claimed claims which overlap with given claim and which prevent the given claim to be claimed (cause it to be in conflict)'''
-        query = '''SELECT * from resource_allocation.get_conflicting_overlapping_claims(%s)'''
-        return list(self._executeQuery(query, (claim_id,), fetch=_FETCH_ALL))
+        if isinstance(claim_status, basestring):
+            claim_status_id = self.getResourceClaimStatusId(claim_status)
+        else:
+            claim_status_id = claim_status
+
+        query = '''SELECT * from resource_allocation.get_overlapping_claims(%s, %s)'''
+        return list(self._executeQuery(query, (claim_id, claim_status_id), fetch=_FETCH_ALL))
 
-    def get_conflicting_overlapping_tasks(self, claim_id):
+    def get_overlapping_tasks(self, claim_id, claim_status='claimed'):
         '''returns a list of tasks which overlap with given claim(s) and which prevent the given claim(s) to be claimed (cause it to be in conflict)'''
-        conflicting_claims = self.get_conflicting_overlapping_claims(claim_id)
+        conflicting_claims = self.get_overlapping_claims(claim_id, claim_status)
         task_ids = set([c['task_id'] for c in conflicting_claims])
         return self.getTasks(task_ids=task_ids)
 
@@ -1415,26 +1504,45 @@ class RADatabase:
         else:
             claim_status_id = claim_status
 
+        result = {'usage': 0, 'status_id': claim_status_id, 'as_of_timestamp': lower_bound, 'resource_id': resource_id}
+
         query = '''SELECT * from resource_allocation.get_max_resource_usage_between(%s, %s, %s, %s)'''
-        result = self._executeQuery(query, (resource_id, claim_status_id, lower_bound, upper_bound), fetch=_FETCH_ONE)
+        qresult = self._executeQuery(query, (resource_id, claim_status_id, lower_bound, upper_bound), fetch=_FETCH_ONE)
 
-        if result and result.get('usage') is not None:
-            return result
-        return {'usage': 0, 'status_id': claim_status_id, 'as_of_timestamp': lower_bound, 'resource_id': resource_id}
+        if qresult and qresult.get('usage') is not None:
+            result['usage'] = qresult.get('usage')
+        return result
 
     def get_resource_claimable_capacity(self, resource_id, lower_bound, upper_bound):
         '''get the claimable capacity for the given resource within the timewindow given by lower_bound and upper_bound.
         this is the resource's available capacity (total-used) minus the maximum allocated usage in that timewindow.'''
+        if resource_id is None or lower_bound is None or upper_bound is None:
+            raise ValueError('resource_id and/or lower_bound and/or upper_bound cannot be None')
+
+        result = {'claimable_capacity': 0,
+                  'lower_bound': lower_bound,
+                  'upper_bound': upper_bound,
+                  'resource_id': resource_id}
+
         query = '''SELECT * from resource_allocation.get_resource_claimable_capacity_between(%s, %s, %s)'''
-        result = self._executeQuery(query, (resource_id, lower_bound, upper_bound), fetch=_FETCH_ONE)
-        if result:
-            return result.get('get_resource_claimable_capacity_between', 0)
-        return 0
+        qresult = self._executeQuery(query, (resource_id, lower_bound, upper_bound), fetch=_FETCH_ONE)
+        if qresult:
+            result['claimable_capacity'] = qresult.get('get_resource_claimable_capacity_between', 0)
+        return result
 
-    def rebuild_resource_usages_table_from_claims(self):
+    def rebuild_resource_usages_from_claims(self, resource_id=None, claim_status=None):
         '''(re)builds the resource_usages table from all currently known resource_claims'''
-        query = '''SELECT * from resource_allocation.rebuild_resource_usages_table_from_claims()'''
-        self._executeQuery(query, fetch=_FETCH_NONE)
+        if isinstance(claim_status, basestring):
+            claim_status_id = self.getResourceClaimStatusId(claim_status)
+        else:
+            claim_status_id = claim_status
+
+        if resource_id is None and claim_status_id is None:
+            self._executeQuery('SELECT * from resource_allocation.rebuild_resource_usages_from_claims()', fetch=_FETCH_NONE)
+        elif claim_status_id is None:
+            self._executeQuery('SELECT * from resource_allocation.rebuild_resource_usages_from_claims_for_resource(%s)', (resource_id,), fetch=_FETCH_NONE)
+        else:
+            self._executeQuery('SELECT * from resource_allocation.rebuild_resource_usages_from_claims_for_resource_of_status(%s, %s)', (resource_id, claim_status_id), fetch=_FETCH_NONE)
 
     def insertSpecificationAndTask(self, mom_id, otdb_id, task_status, task_type, starttime, endtime, content, cluster, commit=True):
         '''
@@ -1575,14 +1683,14 @@ class RADatabase:
             self.commit()
         return ids
 
-    def getResourceUsages(self, lower_bound=None, upper_bound=None, resource_ids=None, resource_types=None, claim_statuses=None):
-        """ Get the resource usages over time within the optionally given time window, resource_ids, resource_types, and/or claim_statuses.
-        :param lower_bound: filter for usages newer than lower_bound 
+    def getResourceUsages(self, lower_bound=None, upper_bound=None, resource_ids=None, claim_statuses=None):
+        """ Get the resource usages over time within the optionally given time window, resource_ids,
+and/or claim_statuses.
+        :param lower_bound: filter for usages newer than lower_bound
         :param upper_bound: filter for usages older than upper_bound
-        :param resource_ids: filter for usages for the given resource id(s) 
-        :param resource_types: filter for usages for the given resource type(s) 
+        :param resource_ids: filter for usages for the given resource id(s)
         :param claim_statuses: filter for usages for the given claim status(es)
-        :return: a nested dict with resource_id at the first level, then claim_status(name) at the second level, and then a list of time ordered usages. 
+        :return: a nested dict with resource_id at the first level, then claim_status(name) at the second level, and then a list of time ordered usages.
         """
         usages_per_resource = {}
         query = '''SELECT * from resource_allocation.resource_usage'''
@@ -1606,22 +1714,6 @@ class RADatabase:
                 conditions.append('resource_id in %s')
                 qargs.append(tuple(resource_ids))
 
-        if resource_types is not None:
-            if isinstance(resource_types, basestring):
-                resource_types = [resource_types]
-            elif not isinstance(resource_types, collections.Iterable):
-                resource_types = [resource_types]
-
-            # convert any resource_type name to id
-            resource_type_names = set([x for x in resource_types if isinstance(x, basestring)])
-            if resource_type_names:
-                resource_type_name_to_id = {x['name']:x['id'] for x in self.getResourceTypes()}
-                resource_type_ids = [resource_type_name_to_id[x] if isinstance(x, basestring) else x
-                                     for x in resource_types]
-
-            conditions.append('type_id in %s')
-            qargs.append(tuple(resource_type_ids))
-
         if claim_statuses is not None:
             if isinstance(claim_statuses, basestring):
                 claim_statuses = [claim_statuses]
diff --git a/SAS/ResourceAssignment/ResourceAssignmentDatabase/radb/sql/CMakeLists.txt b/SAS/ResourceAssignment/ResourceAssignmentDatabase/radb/sql/CMakeLists.txt
index def97c594aeb5b88dc0458387ca87b05ac01a067..d0443398bad2a8ca891f2d43956776ce0dcfcf8e 100644
--- a/SAS/ResourceAssignment/ResourceAssignmentDatabase/radb/sql/CMakeLists.txt
+++ b/SAS/ResourceAssignment/ResourceAssignmentDatabase/radb/sql/CMakeLists.txt
@@ -5,7 +5,8 @@ set(sql_files add_notifications.sql
               add_resource_allocation_statics.sql
               add_virtual_instrument.sql
               create_database.sql
-              create_and_populate_database.sql)
+              create_and_populate_database.sql
+              README)
 
 install_files(/share/radb/sql FILES ${sql_files})
 
diff --git a/SAS/ResourceAssignment/ResourceAssignmentDatabase/radb/sql/add_functions_and_triggers.sql b/SAS/ResourceAssignment/ResourceAssignmentDatabase/radb/sql/add_functions_and_triggers.sql
index eabae3893ccaafc09d95e67f17935f7eb27daa30..216dd650a067b56c6262885a08dd4b52314dde36 100644
--- a/SAS/ResourceAssignment/ResourceAssignmentDatabase/radb/sql/add_functions_and_triggers.sql
+++ b/SAS/ResourceAssignment/ResourceAssignmentDatabase/radb/sql/add_functions_and_triggers.sql
@@ -264,23 +264,9 @@ DECLARE
     usage_at_or_before_end RECORD;
     intermediate_usage RECORD;
 BEGIN
-    -- find last known resource_usage at or before claim starttime
-    SELECT * FROM resource_allocation.resource_usage ru
-    WHERE ru.resource_id = new_claim.resource_id
-    AND ru.status_id = new_claim.status_id
-    AND ru.as_of_timestamp <= new_claim.starttime
-    ORDER BY ru.as_of_timestamp DESC
-    LIMIT 1
-    INTO usage_at_or_before_start;
-
-    -- find last known resource_usage before claim endtime
-    SELECT * FROM resource_allocation.resource_usage ru
-    WHERE ru.resource_id = new_claim.resource_id
-    AND ru.status_id = new_claim.status_id
-    AND ru.as_of_timestamp <= new_claim.endtime
-    ORDER BY ru.as_of_timestamp DESC
-    LIMIT 1
-    INTO usage_at_or_before_end;
+    -- find resource_usage at claim starttime
+    SELECT * FROM resource_allocation.get_resource_usage_at_or_before(new_claim.resource_id, new_claim.status_id, new_claim.starttime, false, false, false) into usage_at_or_before_start;
+    SELECT * FROM resource_allocation.get_resource_usage_at_or_before(new_claim.resource_id, new_claim.status_id, new_claim.endtime, false, false, false) into usage_at_or_before_end;
 
     --add new_claim.claim_size at claim starttime to resource_usage depending on state of usage_at_or_before_start
     IF usage_at_or_before_start IS NOT NULL THEN
@@ -330,27 +316,244 @@ COMMENT ON FUNCTION resource_allocation.process_new_claim_into_resource_usages(n
 
 ---------------------------------------------------------------------------------------------------------------------
 
-CREATE OR REPLACE FUNCTION resource_allocation.rebuild_resource_usages_table_from_claims()
+CREATE OR REPLACE FUNCTION resource_allocation.rebuild_resource_usages_from_claims()
+  RETURNS void AS
+$$
+DECLARE
+    resource virtual_instrument.resource;
+BEGIN
+    FOR resource IN (SELECT * FROM virtual_instrument.resource ORDER BY id) LOOP
+        PERFORM resource_allocation.rebuild_resource_usages_from_claims_for_resource(resource.id);
+    END LOOP;
+END;
+$$ LANGUAGE plpgsql;
+ALTER FUNCTION resource_allocation.rebuild_resource_usages_from_claims() OWNER TO resourceassignment;
+COMMENT ON FUNCTION resource_allocation.rebuild_resource_usages_from_claims()
+  IS 'function which truncates the resource_usages table, and repopulates it by calling process_new_claim_into_resource_usages for each known claim.';
+
+---------------------------------------------------------------------------------------------------------------------
+
+CREATE OR REPLACE FUNCTION resource_allocation.rebuild_resource_usages_from_claims_for_resource(_resource_id int)
+  RETURNS void AS
+$$
+DECLARE
+    status resource_allocation.resource_claim_status;
+BEGIN
+    FOR status IN (SELECT * FROM resource_allocation.resource_claim_status ORDER BY id) LOOP
+        PERFORM resource_allocation.rebuild_resource_usages_from_claims_for_resource_of_status(_resource_id, status.id);
+    END LOOP;
+END;
+$$ LANGUAGE plpgsql;
+ALTER FUNCTION resource_allocation.rebuild_resource_usages_from_claims_for_resource(_resource_id int) OWNER TO resourceassignment;
+COMMENT ON FUNCTION resource_allocation.rebuild_resource_usages_from_claims_for_resource(_resource_id int)
+  IS 'function which rebuilds the resource_usages table for a specific resource.';
+
+---------------------------------------------------------------------------------------------------------------------
+
+CREATE OR REPLACE FUNCTION resource_allocation.rebuild_resource_usages_from_claims_for_resource_of_status(_resource_id int, _status_id int)
   RETURNS void AS
 $$
 DECLARE
     claim resource_allocation.resource_claim;
+    finished_claim resource_allocation.resource_claim;
+    tmp_usage resource_allocation.resource_usage;
+    new_usage_value bigint := 0;
+    new_usage_id integer;
 BEGIN
-    LOCK TABLE resource_allocation.resource_claim IN EXCLUSIVE MODE;
+    -- make sure nobody thouches the these tables while running this function
+    LOCK TABLE resource_allocation.resource_claim IN ACCESS SHARE MODE;
     LOCK TABLE resource_allocation.resource_usage IN EXCLUSIVE MODE;
-    TRUNCATE TABLE resource_allocation.resource_usage RESTART IDENTITY CASCADE;
+    LOCK TABLE resource_allocation._rebuild_usages_active_claims IN EXCLUSIVE MODE;
+
+    -- delete the relevant usages (so we can re-enter them in this method)
+    DELETE FROM resource_allocation.resource_usage WHERE resource_id = _resource_id AND status_id = _status_id;
+
+    -- make sure the helper tables are empty
+    TRUNCATE resource_allocation._rebuild_usages_active_claims; --tracks the 'open'/'active' claims (starttime < loop_timestamp < endtime)
+    TRUNCATE resource_allocation._rebuild_usages_active_usages; --will be filled with small subset of usages-table for faster lookups than in the big reource_usage table.
 
-    FOR claim IN SELECT * FROM resource_allocation.resource_claim LOOP
-        PERFORM resource_allocation.process_new_claim_into_resource_usages(claim);
+    -- process each claim for this _resource_id with _status_id
+    FOR claim IN (SELECT * FROM resource_allocation.resource_claim
+                  WHERE resource_id = _resource_id
+                  AND status_id = _status_id
+                  ORDER BY starttime, endtime)
+    LOOP
+        -- keep helper table _rebuild_usages_active_usages small and quick-to-search in each iteration.
+        -- delete all 'closed'/'obsolete' usages from
+        -- any usage before the first usage before min(endtime) of the active_claims is obsolete. (yes, that's twice before)
+        SELECT * FROM resource_allocation._rebuild_usages_active_usages ru
+                 WHERE ru.as_of_timestamp < (SELECT MIN(endtime) FROM resource_allocation._rebuild_usages_active_claims)
+                 ORDER BY ru.as_of_timestamp DESC
+                 LIMIT 1
+                 INTO tmp_usage;
+        IF tmp_usage IS NOT NULL THEN
+            -- remember from above? any usage before the first usage before min(starttime) of the active_claims is obsolete.
+            -- so, select the first usage before the usage we just found.
+            SELECT * FROM resource_allocation._rebuild_usages_active_usages ru
+                     WHERE ru.as_of_timestamp < tmp_usage.as_of_timestamp
+                     ORDER BY ru.as_of_timestamp DESC
+                     LIMIT 1
+                     INTO tmp_usage;
+
+            IF tmp_usage IS NOT NULL THEN
+                DELETE FROM resource_allocation._rebuild_usages_active_usages ru WHERE ru.as_of_timestamp < tmp_usage.as_of_timestamp;
+            END IF;
+        END IF;
+
+        --'close' all finished claims (if any)
+        FOR finished_claim IN (SELECT * FROM resource_allocation._rebuild_usages_active_claims ac
+                               WHERE ac.endtime <= claim.starttime
+                               ORDER BY endtime)
+        LOOP
+            --(quick) search in the (small) _rebuild_usages_active_usages which holds only relevant usages
+            --find last usage at or before finished_claim.endtime
+            SELECT * FROM resource_allocation._rebuild_usages_active_usages ru
+                     WHERE ru.as_of_timestamp <= finished_claim.endtime
+                     ORDER BY ru.as_of_timestamp DESC
+                     LIMIT 1
+                     INTO tmp_usage;
+
+            IF tmp_usage IS NULL THEN
+                RAISE EXCEPTION 'tmp_usage should not be NULL while finishing active claims for claim % in rebuild_resource_usages_from_claims_for_resource_of_status(%, %)', finished_claim, _resource_id, _status_id;
+            END IF;
+
+            -- integrate (add current value to previous value)
+            new_usage_value := tmp_usage.usage - finished_claim.claim_size;
+
+            --a finished claim is 'closed' by subtracting the claim_size from the last usage value
+            --this happens either at an already existing usage timestamp, or at a new usage timestamp.
+            IF finished_claim.endtime = tmp_usage.as_of_timestamp THEN
+                --claim's endtime coincides with existing usage timestamp
+                --update the existing usage into the table
+                UPDATE resource_allocation.resource_usage
+                SET usage = new_usage_value
+                WHERE id = tmp_usage.id;
+
+                --also update the usage in the the small _rebuild_usages_active_usages table.
+                UPDATE resource_allocation._rebuild_usages_active_usages
+                SET usage = new_usage_value
+                WHERE id = tmp_usage.id;
+            ELSE
+                --claim's endtime does not coincide with existing usage timestamp
+                --insert the new usage into the table
+                INSERT INTO resource_allocation.resource_usage (resource_id, status_id, as_of_timestamp, usage)
+                VALUES (_resource_id, _status_id, finished_claim.endtime, new_usage_value) RETURNING id INTO new_usage_id;
+
+                --also add the usage to the small _rebuild_usages_active_usages table, so it can be (quickly) searched.
+                INSERT INTO resource_allocation._rebuild_usages_active_usages (id, resource_id, status_id, as_of_timestamp, usage)
+                VALUES (new_usage_id, _resource_id, _status_id, finished_claim.endtime, new_usage_value);
+            END IF;
+
+            --now that the claim has been 'closed', remove it from the active claims
+            DELETE FROM resource_allocation._rebuild_usages_active_claims WHERE id = finished_claim.id;
+        END LOOP; -- end loop over finished claims
+
+        --all claims which finished at or before this claim's starttime are now closed.
+        --now, handle the new 'active' claim
+
+        --(quick) search in the (small) _rebuild_usages_active_usages which holds only relevant usages
+        --find last usage at or before claim.starttime
+        SELECT * FROM resource_allocation._rebuild_usages_active_usages ru
+                 WHERE ru.as_of_timestamp <= claim.starttime
+                 ORDER BY ru.as_of_timestamp DESC
+                 LIMIT 1
+                 INTO tmp_usage;
+
+        --this 'active' claim 'opens' also either at an already existing usage timestamp or at a new usage timestamp.
+        IF tmp_usage IS NOT NULL AND claim.starttime = tmp_usage.as_of_timestamp THEN
+            --claim's starttime coincides with existing usage timestamp
+            -- integrate (add current value to previous value)
+            new_usage_value := tmp_usage.usage + claim.claim_size;
+
+            --update the existing usage with the new_usage_value
+            UPDATE resource_allocation.resource_usage
+            SET usage = new_usage_value
+            WHERE id = tmp_usage.id;
+
+            --also update the small _rebuild_usages_active_usages table, so it can be (quickly) searched.
+            UPDATE resource_allocation._rebuild_usages_active_usages
+            SET usage = new_usage_value
+            WHERE id = tmp_usage.id;
+        ELSE
+            --claim's starttime does not coincide with existing usage timestamp
+            IF tmp_usage IS NULL THEN
+                -- integrate (no previous value, so start of integral)
+                new_usage_value := claim.claim_size;
+            ELSE
+                -- integrate (add current value to previous value)
+                new_usage_value := tmp_usage.usage + claim.claim_size;
+            END IF;
+
+            --and insert the new usage into the table
+            INSERT INTO resource_allocation.resource_usage (resource_id, status_id, as_of_timestamp, usage)
+            VALUES (_resource_id, _status_id, claim.starttime, new_usage_value) RETURNING id INTO new_usage_id;
+
+            --also add the usage to the small _rebuild_usages_active_usages table, so it can be (quickly) searched.
+            INSERT INTO resource_allocation._rebuild_usages_active_usages (id, resource_id, status_id, as_of_timestamp, usage)
+            VALUES (new_usage_id, _resource_id, _status_id, claim.starttime, new_usage_value);
+        END IF;
+
+        --now that the claim has been 'opened', add it to the active claims
+        INSERT INTO resource_allocation._rebuild_usages_active_claims (id, resource_id, task_id, starttime, endtime, status_id, claim_size)
+               VALUES (claim.id, claim.resource_id, claim.task_id, claim.starttime, claim.endtime, claim.status_id, claim.claim_size);
     END LOOP;
+
+    --all claims were processed and at least opened
+    --so, conclude with 'closing' all still active claims
+    FOR finished_claim IN (SELECT * FROM resource_allocation._rebuild_usages_active_claims ac
+                           ORDER BY endtime)
+    LOOP
+        -- (quick) search in the (small) _rebuild_usages_active_usages which holds only relevant usages
+        SELECT * FROM resource_allocation._rebuild_usages_active_usages ru
+                 WHERE ru.as_of_timestamp <= finished_claim.endtime
+                 ORDER BY ru.as_of_timestamp DESC
+                 LIMIT 1
+                 INTO tmp_usage;
+
+        IF tmp_usage IS NULL THEN
+            RAISE EXCEPTION 'tmp_usage should not be NULL while finishing processing opened claims for claim % in rebuild_resource_usages_from_claims_for_resource_of_status(%, %)', finished_claim, _resource_id, _status_id;
+        END IF;
+
+        -- integrate (add current value to previous value)
+        new_usage_value := tmp_usage.usage - finished_claim.claim_size;
+
+        --a finished claim is 'closed' by subtracting the claim_size from the last_usage_value
+        --this happens either at an already existing usage timestamp, or at a new usage timestamp.
+        IF finished_claim.endtime = tmp_usage.as_of_timestamp THEN
+            --claim's endtime coincides with existing usage timestamp
+            UPDATE resource_allocation.resource_usage
+            SET usage = new_usage_value
+            WHERE id = tmp_usage.id;
+
+            --also update the small _rebuild_usages_active_usages table, so it can be (quickly) searched.
+            UPDATE resource_allocation._rebuild_usages_active_usages
+            SET usage = new_usage_value
+            WHERE id = tmp_usage.id;
+        ELSE
+            --claim's endtime does not coincide with existing usage timestamp
+            --insert the new usage into the table
+            INSERT INTO resource_allocation.resource_usage (resource_id, status_id, as_of_timestamp, usage)
+            VALUES (_resource_id, _status_id, finished_claim.endtime, new_usage_value) RETURNING id INTO new_usage_id;
+
+            --also add the usage to the small _rebuild_usages_active_usages table, so it can be (quickly) searched.
+            INSERT INTO resource_allocation._rebuild_usages_active_usages (id, resource_id, status_id, as_of_timestamp, usage)
+            VALUES (new_usage_id, _resource_id, _status_id, finished_claim.endtime, new_usage_value);
+        END IF;
+
+        --now that the claim has been 'closed', remove it from the active claims
+        DELETE FROM resource_allocation._rebuild_usages_active_claims WHERE id = finished_claim.id;
+    END LOOP;
+
+    -- wipe the helper tables
+    TRUNCATE resource_allocation._rebuild_usages_active_claims;
+    TRUNCATE resource_allocation._rebuild_usages_active_usages;
 END;
 $$ LANGUAGE plpgsql;
-ALTER FUNCTION resource_allocation.rebuild_resource_usages_table_from_claims() OWNER TO resourceassignment;
-COMMENT ON FUNCTION resource_allocation.rebuild_resource_usages_table_from_claims()
-  IS 'function which truncates the resource_usages table, and repopulates it by calling process_new_claim_into_resource_usages for each known claim.';
+ALTER FUNCTION resource_allocation.rebuild_resource_usages_from_claims_for_resource_of_status(int, int) OWNER TO resourceassignment;
+COMMENT ON FUNCTION resource_allocation.rebuild_resource_usages_from_claims_for_resource_of_status(int, int)
+  IS 'function which rebuilds the resource_usages table for the claims with a specific status for a specific resource.';
 
 ---------------------------------------------------------------------------------------------------------------------
-
 CREATE OR REPLACE FUNCTION resource_allocation.process_old_claim_outof_resource_usages(old_claim resource_allocation.resource_claim)
   RETURNS void AS
 $$
@@ -361,39 +564,25 @@ DECLARE
     intermediate_usage RECORD;
 BEGIN
     -- find resource_usage at claim starttime
-    SELECT * FROM resource_allocation.resource_usage ru
-    WHERE ru.resource_id = old_claim.resource_id
-    AND ru.status_id = old_claim.status_id
-    AND ru.as_of_timestamp = old_claim.starttime
-    LIMIT 1
-    INTO usage_at_start;
+    SELECT * FROM resource_allocation.get_resource_usage_at_or_before(old_claim.resource_id, old_claim.status_id, old_claim.starttime, true, false, true) into usage_at_start;
 
-    -- find last known resource_usage at claim endtime
-    SELECT * FROM resource_allocation.resource_usage ru
-    WHERE ru.resource_id = old_claim.resource_id
-    AND ru.status_id = old_claim.status_id
-    AND ru.as_of_timestamp = old_claim.endtime
-    LIMIT 1
-    INTO usage_at_end;
-
-    -- both usage_at_start and usage_at_end should exist (NOT NULL)
     IF usage_at_start IS NULL THEN
-        RAISE EXCEPTION 'resource_allocation.on_delete_claim_update_resource_usages: usage_at_start should not be NULL.';
+        RAISE EXCEPTION 'process_old_claim_outof_resource_usages(%) cannot find usage_at_start', old_claim;
     END IF;
+
+
+    -- and find resource_usage at claim endtime
+    SELECT * FROM resource_allocation.get_resource_usage_at_or_before(old_claim.resource_id, old_claim.status_id, old_claim.endtime, true, false, true) into usage_at_end;
+
     IF usage_at_end IS NULL THEN
-        RAISE EXCEPTION 'resource_allocation.on_delete_claim_update_resource_usages: usage_at_end should not be NULL.';
+        RAISE EXCEPTION 'process_old_claim_outof_resource_usages(%) cannot find usage_at_end', old_claim;
     END IF;
 
+
     IF usage_at_start.usage = old_claim.claim_size THEN
         IF usage_at_end.usage = 0 THEN
             -- find resource_usage before claim starttime
-            SELECT * FROM resource_allocation.resource_usage ru
-            WHERE ru.resource_id = old_claim.resource_id
-            AND ru.status_id = old_claim.status_id
-            AND ru.as_of_timestamp < old_claim.starttime
-            ORDER BY ru.as_of_timestamp DESC
-            LIMIT 1
-            INTO usage_before_start;
+            SELECT * FROM resource_allocation.get_resource_usage_at_or_before(old_claim.resource_id, old_claim.status_id, old_claim.starttime, false, true, false) into usage_before_start;
 
             IF usage_before_start IS NULL OR (usage_before_start IS NOT NULL AND usage_before_start.usage = 0) THEN
                 --usage_at_start was 'caused' by this deleted claim only, so delete it
@@ -434,28 +623,90 @@ COMMENT ON FUNCTION resource_allocation.process_old_claim_outof_resource_usages(
 
 ---------------------------------------------------------------------------------------------------------------------
 
-CREATE OR REPLACE FUNCTION resource_allocation.get_resource_usage_at(_resource_id int, _claim_status_id int, _timestamp timestamp)
+CREATE OR REPLACE FUNCTION resource_allocation.get_resource_usage_at_or_before(_resource_id int, _claim_status_id int, _timestamp timestamp, exactly_at boolean default false, only_before boolean default false, rebuild_usage_when_not_found boolean default false)
   RETURNS resource_allocation.resource_usage AS
 $$
 DECLARE
-    result record;
+    result resource_allocation.resource_usage;
 BEGIN
     SELECT * FROM resource_allocation.resource_usage ru
     WHERE ru.resource_id = _resource_id
     AND ru.status_id = _claim_status_id
-    AND ru.as_of_timestamp < _timestamp
+    AND ru.as_of_timestamp <= _timestamp
     ORDER BY ru.as_of_timestamp DESC
     LIMIT 1 INTO result;
 
+    -- check if as_of_timestamp is exactly_at _timestamp
+    IF exactly_at AND result IS NOT NULL THEN
+        IF result.as_of_timestamp <> _timestamp THEN
+            result := NULL;
+        END IF;
+    END IF;
+
+    -- check if as_of_timestamp is before _timestamp
+    IF only_before AND result IS NOT NULL THEN
+        IF result.as_of_timestamp >= _timestamp THEN
+            result := NULL;
+        END IF;
+    END IF;
+
+    -- rebuild usage when not found
+    IF rebuild_usage_when_not_found AND result IS NULL THEN
+        RAISE NOTICE 'get_resource_usage_at_or_before(_resource_id=%, status_id=%, timestamp=%, exactly_at=%, only_before=%, rebuild_usage_when_not_found=%): result should not be NULL. Rebuilding usages table for resource %.', _resource_id, _claim_status_id, _timestamp, exactly_at, only_before, rebuild_usage_when_not_found, _resource_id;
+        PERFORM resource_allocation.rebuild_resource_usages_from_claims_for_resource_of_status(_resource_id, _claim_status_id);
+        RAISE NOTICE 'get_resource_usage_at_or_before(_resource_id=%, status_id=%, timestamp=%, exactly_at=%, only_before=%, rebuild_usage_when_not_found=%): Finished rebuilding usages table for resource %.', _resource_id, _claim_status_id, _timestamp, exactly_at, only_before, rebuild_usage_when_not_found, _resource_id;
+
+        -- try again, but now without the option to rebuild_usage_when_not_found (to prevent endless recursion)
+        SELECT * FROM resource_allocation.get_resource_usage_at_or_before(_resource_id, _claim_status_id, _timestamp, exactly_at, only_before, false) INTO result;
+        RAISE NOTICE 'get_resource_usage_at_or_before(_resource_id=%, status_id=%, timestamp=%, exactly_at=%, only_before=%, rebuild_usage_when_not_found=%): after rebuild, result=%.', _resource_id, _claim_status_id, _timestamp, exactly_at, only_before, rebuild_usage_when_not_found, result;
+    END IF;
+
+    IF result IS NULL THEN
+        -- if result is still null (after possible rebuild etc), then return a 'default' usage of 0
+        result.resource_id = _resource_id;
+        result.status_id = _claim_status_id;
+        result.as_of_timestamp = _timestamp;
+        result.usage = 0;
+    END IF;
+
     RETURN result;
 END;
 $$ LANGUAGE plpgsql;
-ALTER FUNCTION resource_allocation.get_resource_usage_at(_resource_id int, _claim_status_id int, _timestamp timestamp) OWNER TO resourceassignment;
-COMMENT ON FUNCTION resource_allocation.get_resource_usage_at(_resource_id int, _claim_status_id int, _timestamp timestamp)
+ALTER FUNCTION resource_allocation.get_resource_usage_at_or_before(int, int, timestamp, boolean, boolean, boolean) OWNER TO resourceassignment;
+COMMENT ON FUNCTION resource_allocation.get_resource_usage_at_or_before(int, int, timestamp, boolean, boolean, boolean)
   IS 'get the resource usage for the given _resource_id for claims with given _claim_status_id at the given _timestamp';
 
 ---------------------------------------------------------------------------------------------------------------------
 
+CREATE OR REPLACE FUNCTION utcnow()
+  RETURNS timestamp AS
+$$
+  SELECT NOW() AT TIME ZONE 'UTC';
+$$ LANGUAGE SQL;
+ALTER FUNCTION utcnow() OWNER TO resourceassignment;
+COMMENT ON FUNCTION utcnow()
+  IS 'get the current time in utc timezone as timestamp (without timezone)';
+
+---------------------------------------------------------------------------------------------------------------------
+
+CREATE OR REPLACE FUNCTION resource_allocation.get_current_resource_usage(_resource_id int, _claim_status_id int)
+  RETURNS resource_allocation.resource_usage AS
+$$
+DECLARE
+    result resource_allocation.resource_usage;
+    now timestamp;
+BEGIN
+    SELECT * FROM utcnow() INTO now;
+    SELECT * FROM resource_allocation.get_resource_usage_at_or_before(_resource_id, _claim_status_id, now, false, false, false) into result;
+    RETURN result;
+END;
+$$ LANGUAGE plpgsql;
+ALTER FUNCTION resource_allocation.get_current_resource_usage(_resource_id int, _claim_status_id int) OWNER TO resourceassignment;
+COMMENT ON FUNCTION resource_allocation.get_current_resource_usage(_resource_id int, _claim_status_id int)
+  IS 'get the current resource usage for the given _resource_id for claims with given _claim_status_id';
+
+---------------------------------------------------------------------------------------------------------------------
+
 CREATE OR REPLACE FUNCTION resource_allocation.get_max_resource_usage_between(_resource_id int, _claim_status_id int, _lower timestamp, _upper timestamp)
   RETURNS resource_allocation.resource_usage AS
 $$
@@ -466,10 +717,16 @@ BEGIN
     WHERE ru.resource_id = _resource_id
     AND ru.status_id = _claim_status_id
     AND ru.as_of_timestamp >= _lower
-    AND ru.as_of_timestamp <= _upper
+    AND ru.as_of_timestamp < _upper
     ORDER BY ru.usage DESC
     LIMIT 1 INTO result;
 
+    IF result IS NULL THEN
+        -- apparently there are no resource_usage rows between _lower and _upper
+        -- so, take the first before _lower, as that value is still valid between _lower and _upper in this case.
+        SELECT * FROM resource_allocation.get_resource_usage_at_or_before(_resource_id, _claim_status_id, _lower, false, false, false) into result;
+    END IF;
+
     RETURN result;
 END;
 $$ LANGUAGE plpgsql;
@@ -485,8 +742,9 @@ $$
 DECLARE
     claimed_status_id int := 1; --beware: hard coded instead of lookup for performance
     max_resource_usage resource_allocation.resource_usage;
-    max_resource_usage_value int;
+    max_resource_usage_value bigint;
     available_capacity bigint;
+    current_claimed_usage bigint;
 BEGIN
     SELECT * FROM resource_allocation.get_max_resource_usage_between(_resource_id, claimed_status_id, _lower, _upper) INTO max_resource_usage;
 
@@ -496,8 +754,20 @@ BEGIN
         max_resource_usage_value := max_resource_usage.usage;
     END IF;
 
+    -- determine the available_capacity for this resource
+    -- available_capacity is a truly measured metric (by tools like df (disk-free))
     SELECT available FROM resource_monitoring.resource_capacity WHERE resource_id = _resource_id LIMIT 1 INTO available_capacity;
-    RETURN available_capacity - max_resource_usage_value;
+
+    -- determine how much of the used_capacity is 'accounted for' by claims.
+    -- this is a best guess of the amount of data which we know that should be on the resource.
+    -- we can only 'measure' that at this moment,
+    -- so take the current resource usage
+    SELECT usage FROM resource_allocation.get_current_resource_usage(_resource_id, claimed_status_id) INTO current_claimed_usage;
+
+    -- the claimable_capacity is not just the free space (available_capacity) at this moment!
+    -- we have to take into account what we know about already claimed portions,
+    -- both at this moment (current_claimed_usage) and for the planned claim (max_resource_usage_value, between _lower and _upper)
+    RETURN available_capacity + current_claimed_usage - max_resource_usage_value;
 END;
 $$ LANGUAGE plpgsql;
 ALTER FUNCTION resource_allocation.get_resource_claimable_capacity_between(_resource_id int, _lower timestamp, _upper timestamp) OWNER TO resourceassignment;
@@ -510,33 +780,11 @@ CREATE OR REPLACE FUNCTION resource_allocation.has_conflict_with_overlapping_cla
   RETURNS boolean AS
 $$
 DECLARE
-    claim_claimed_status_id int := 1; --beware: hard coded instead of lookup for performance
     free_claimable_capacity bigint;
-    overlapping_claims_min_starttime timestamp;
-    overlapping_claims_max_endtime timestamp;
 BEGIN
-    -- this function is quite similar to resource_allocation.get_conflicting_overlapping_claims
-    -- for performance reasons we repeat the common code here instead of wrapping the common code in a function
-
-    --get all overlapping_claims, check whether they cause a conflict or not.
-    SET LOCAL client_min_messages=warning; --prevent "table overlapping_claims does not exist, skipping" message
-    DROP TABLE IF EXISTS overlapping_claims; -- TODO: use  CREATE TEMPORARY TABLE IF NOT EXISTS when we will use postgres 9.5+
-    CREATE TEMPORARY TABLE overlapping_claims
-    ON COMMIT DROP
-    AS SELECT * FROM resource_allocation.resource_claim rc
-    WHERE rc.resource_id = claim.resource_id
-    AND rc.status_id = claim_claimed_status_id
-    AND rc.id <> claim.id
-    AND rc.endtime >= claim.starttime
-    AND rc.starttime < claim.endtime;
-
-    --get the full time window of the overlapping claims
-    SELECT min(starttime) FROM overlapping_claims INTO overlapping_claims_min_starttime;
-    SELECT max(endtime) FROM overlapping_claims INTO overlapping_claims_max_endtime;
-
-    -- get the free free_claimable_capacity for this resource for the full overlapping claim time window
+    -- get the free free_claimable_capacity for this resource for the claim's time window
     -- this does not include the current claim which is (or at least should be) tentative.
-    SELECT * FROM resource_allocation.get_resource_claimable_capacity_between(claim.resource_id, overlapping_claims_min_starttime, overlapping_claims_max_endtime) INTO free_claimable_capacity;
+    SELECT * FROM resource_allocation.get_resource_claimable_capacity_between(claim.resource_id, claim.starttime, claim.endtime) INTO free_claimable_capacity;
 
     return claim.claim_size > free_claimable_capacity;
 END;
@@ -547,7 +795,7 @@ COMMENT ON FUNCTION resource_allocation.has_conflict_with_overlapping_claims(cla
 
 ---------------------------------------------------------------------------------------------------------------------
 
-CREATE OR REPLACE FUNCTION resource_allocation.get_conflicting_overlapping_claims(claim_id int)
+CREATE OR REPLACE FUNCTION resource_allocation.get_overlapping_claims(claim_id int, status int default 1) --beware: hard coded status=1 for claimed claims
   RETURNS SETOF resource_allocation.resource_claim AS
 $$
 DECLARE
@@ -558,44 +806,34 @@ BEGIN
     LIMIT 1
     INTO claim;
 
-    RETURN QUERY SELECT * FROM resource_allocation.get_conflicting_overlapping_claims(claim);
+    RETURN QUERY SELECT * FROM resource_allocation.get_overlapping_claims(claim, status);
 END;
 $$ LANGUAGE plpgsql;
-ALTER FUNCTION resource_allocation.get_conflicting_overlapping_claims(claim_id int) OWNER TO resourceassignment;
-COMMENT ON FUNCTION resource_allocation.get_conflicting_overlapping_claims(claim_id int)
+ALTER FUNCTION resource_allocation.get_overlapping_claims(int, int) OWNER TO resourceassignment;
+COMMENT ON FUNCTION resource_allocation.get_overlapping_claims(int, int)
   IS 'get set of (claimed) claims which cause the given claim to have conflict status.';
 
 ---------------------------------------------------------------------------------------------------------------------
 
-CREATE OR REPLACE FUNCTION resource_allocation.get_conflicting_overlapping_claims(claim resource_allocation.resource_claim)
+CREATE OR REPLACE FUNCTION resource_allocation.get_overlapping_claims(claim resource_allocation.resource_claim, status int default 1) --beware: hard coded status=1 for claimed claims
   RETURNS SETOF resource_allocation.resource_claim AS
 $$
-DECLARE
-    claim_claimed_status_id int := 1; --beware: hard coded instead of lookup for performance
 BEGIN
     -- this function is quite similar to resource_allocation.has_conflict_with_overlapping_claims
     -- for performance reasons we repeat the common code here instead of wrapping the common code in a function
 
     --get all overlapping_claims, check whether they cause a conflict or not.
-    SET LOCAL client_min_messages=warning; --prevent "table overlapping_claims does not exist, skipping" message
-    DROP TABLE IF EXISTS overlapping_claims; -- TODO: use  CREATE TEMPORARY TABLE IF NOT EXISTS when we will use postgres 9.5+
-    CREATE TEMPORARY TABLE overlapping_claims
-    ON COMMIT DROP
-    AS SELECT * FROM resource_allocation.resource_claim rc
+    RETURN QUERY SELECT * FROM resource_allocation.resource_claim rc
     WHERE rc.resource_id = claim.resource_id
-    AND rc.status_id = claim_claimed_status_id
+    AND rc.status_id = status
     AND rc.id <> claim.id
     AND rc.endtime >= claim.starttime
     AND rc.starttime < claim.endtime;
-
-    RETURN QUERY SELECT *
-    FROM overlapping_claims oc
-    WHERE (SELECT * FROM resource_allocation.get_resource_claimable_capacity_between(claim.resource_id, oc.starttime, oc.endtime)) < claim.claim_size;
 END;
 $$ LANGUAGE plpgsql;
-ALTER FUNCTION resource_allocation.get_conflicting_overlapping_claims(claim resource_allocation.resource_claim) OWNER TO resourceassignment;
-COMMENT ON FUNCTION resource_allocation.get_conflicting_overlapping_claims(claim resource_allocation.resource_claim)
-  IS 'get set of (claimed) claims which cause the given claim to have conflict status.';
+ALTER FUNCTION resource_allocation.get_overlapping_claims(resource_allocation.resource_claim, int) OWNER TO resourceassignment;
+COMMENT ON FUNCTION resource_allocation.get_overlapping_claims(resource_allocation.resource_claim, int)
+  IS 'get set of claims (with given status) which overlap with the given claim.';
 
 ---------------------------------------------------------------------------------------------------------------------
 
@@ -608,6 +846,9 @@ DECLARE
     claim_conflict_status_id int := 2; --beware: hard coded instead of lookup for performance
     task_approved_status_id int := 300; --beware: hard coded instead of lookup for performance
     task_conflict_status_id int := 335; --beware: hard coded instead of lookup for performance
+    task_prescheduled_status_id int := 350; --beware: hard coded instead of lookup for performance
+    task_scheduled_status_id int := 400; --beware: hard coded instead of lookup for performance
+    task_queued_status_id int := 500; --beware: hard coded instead of lookup for performance
     claim_has_conflicts boolean;
 BEGIN
     --order of following steps is important, do not reorder the steps
@@ -615,40 +856,64 @@ BEGIN
     -- bounce any inserted claim which is not tentative
     IF TG_OP = 'INSERT' THEN
         IF NEW.status_id <> claim_tentative_status_id THEN
-            RAISE EXCEPTION 'newly inserted claims should not have status other than tentative; claim: %', NEW;
+            RAISE EXCEPTION 'newly inserted claims should not have status other than tentative (%); new claim: % has status %', claim_tentative_status_id, NEW, NEW.status_id;
         END IF;
     END IF;
 
     IF TG_OP = 'UPDATE' THEN
         -- bounce any updated claim which has conflict state, but is tried to be updated to claimed
+        -- only this function can 'reset' the conflict state back to tentative!
         IF NEW.status_id = claim_claimed_status_id AND OLD.status_id = claim_conflict_status_id THEN
             RAISE EXCEPTION 'cannot update claim-in-conflict to status claimed; old:% new:%', OLD, NEW;
         END IF;
 
-        -- bounce any updated claim which has claimed state onto which other properties are changed
-        IF NEW.status_id = claim_claimed_status_id AND OLD.status_id = NEW.status_id THEN
-            RAISE EXCEPTION 'updates on properties of claimed claim are not allowed; old:% new:%', OLD, NEW;
+        -- bounce any claim_size updates on claimed claims
+        IF NEW.status_id = claim_claimed_status_id AND OLD.claim_size <> NEW.claim_size THEN
+            RAISE EXCEPTION 'cannot update claim size on claimed claim; old:% new:%', OLD, NEW;
+        END IF;
+
+        -- bounce any task_id updates
+        IF OLD.task_id <> NEW.task_id THEN
+            RAISE EXCEPTION 'cannot change the task to which a claim belongs; old:% new:%', OLD, NEW;
+        END IF;
+
+        -- bounce any resource_id updates
+        IF OLD.resource_id <> NEW.resource_id THEN
+            RAISE EXCEPTION 'cannot change the resource to which a claim belongs; old:% new:%', OLD, NEW;
         END IF;
     END IF;
 
-    IF TG_OP = 'INSERT' OR TG_OP = 'UPDATE' THEN
-        --only check claim if in tentative/conflict status, and status or claim_size or start/end time changed
-        IF NEW.status_id = claim_tentative_status_id OR NEW.status_id = claim_conflict_status_id THEN
-            IF TG_OP = 'INSERT' OR (TG_OP = 'UPDATE' AND (OLD.status_id <> NEW.status_id OR
-                                                          OLD.claim_size <> NEW.claim_size OR
-                                                          OLD.starttime <> NEW.starttime OR
-                                                          OLD.endtime <> NEW.endtime)) THEN
-                --check if claim fits or has conflicts
-                SELECT * FROM resource_allocation.has_conflict_with_overlapping_claims(NEW) INTO claim_has_conflicts;
-
-                IF claim_has_conflicts AND NEW.status_id <> claim_conflict_status_id THEN
+    IF TG_OP = 'UPDATE' OR TG_OP = 'DELETE' THEN
+        --update the resource usages affected by this claim
+        --do this before we check for conflicts, because this claim might be shifted for example
+        --which might influence the resource_usages which determine wheter a claim fits.
+        PERFORM resource_allocation.process_old_claim_outof_resource_usages(OLD);
+    END IF;
+
+    --only check claim if status and/or claim_size and/or start/end time changed
+    IF TG_OP = 'INSERT' OR (TG_OP = 'UPDATE' AND (OLD.status_id <> NEW.status_id OR
+                                                  OLD.claim_size <> NEW.claim_size OR
+                                                  OLD.starttime <> NEW.starttime OR
+                                                  OLD.endtime <> NEW.endtime)) THEN
+        --check if claim fits or has conflicts
+        SELECT * FROM resource_allocation.has_conflict_with_overlapping_claims(NEW) INTO claim_has_conflicts;
+
+        IF claim_has_conflicts THEN
+            IF NEW.status_id <> claim_conflict_status_id THEN
+                -- only set claims to conflict if task status <= queued
+                -- when a claim goes to conflict, then so does it's task, and we don't want that for running/finished/aborted tasks
+                IF EXISTS (SELECT 1 FROM resource_allocation.task
+                           WHERE id=NEW.task_id
+                           AND status_id = ANY(ARRAY[300, 335, 350, 400, 500])) THEN -- hardcoded tasks statuses <= queued
                     -- conflict with others, so set claim status to conflict
                     NEW.status_id := claim_conflict_status_id;
-                ELSIF NOT claim_has_conflicts AND NEW.status_id <> claim_tentative_status_id THEN
-                    -- no conflict (anymore) with others, so set claim status to tentative
-                    NEW.status_id := claim_tentative_status_id;
                 END IF;
             END IF;
+        ELSE
+            -- no conflict (anymore) with others, so set claim status to tentative if currently in conflict
+            IF NEW.status_id = claim_conflict_status_id THEN
+                NEW.status_id := claim_tentative_status_id;
+            END IF;
         END IF;
     END IF;
 
@@ -687,10 +952,8 @@ DECLARE
     affected_claim resource_allocation.resource_claim;
     claim_has_conflicts boolean;
 BEGIN
-    IF TG_OP = 'UPDATE' OR TG_OP = 'DELETE' THEN
-        --update the resource usages affected by this claim
-        PERFORM resource_allocation.process_old_claim_outof_resource_usages(OLD);
-    END IF;
+    --do not process_old_claim_outof_resource_usages(OLD)
+    --because that has been done already in before_claim_insertupdatedelete
 
     IF TG_OP = 'INSERT' OR TG_OP = 'UPDATE' THEN
         --update the resource usages affected by this claim
diff --git a/SAS/ResourceAssignment/ResourceAssignmentDatabase/radb/sql/add_resource_allocation_statics.sql b/SAS/ResourceAssignment/ResourceAssignmentDatabase/radb/sql/add_resource_allocation_statics.sql
index 9031269c24df3efc0884de2dd445e8e455ae63af..e56bd04d19edfee931c0222d488011d4c306fd92 100644
--- a/SAS/ResourceAssignment/ResourceAssignmentDatabase/radb/sql/add_resource_allocation_statics.sql
+++ b/SAS/ResourceAssignment/ResourceAssignmentDatabase/radb/sql/add_resource_allocation_statics.sql
@@ -7,7 +7,7 @@ INSERT INTO resource_allocation.task_status VALUES (200, 'prepared'), (300, 'app
 (1150, 'error'), (1200, 'obsolete'); -- This is the list from OTDB, we'll need to merge it with the list from MoM in the future, might use different indexes?
 INSERT INTO resource_allocation.task_type VALUES (0, 'observation'),(1, 'pipeline'),(2, 'reservation'); -- We'll need more types
 INSERT INTO resource_allocation.resource_claim_status VALUES (0, 'tentative'), (1, 'claimed'), (2, 'conflict');
-INSERT INTO resource_allocation.resource_claim_property_type VALUES (0, 'nr_of_is_files'),(1, 'nr_of_cs_files'),(2, 'nr_of_uv_files'),(3, 'nr_of_im_files'),(4, 'nr_of_img_files'),(5, 'nr_of_pulp_files'),(6, 'nr_of_cs_stokes'),(7, 'nr_of_is_stokes'),(8, 'is_file_size'),(9, 'cs_file_size'),(10, 'uv_file_size'),(11, 'im_file_size'),(12, 'img_file_size'),(13, 'nr_of_pulp_files'),(14, 'nr_of_cs_parts'),(15, 'start_sb_nr'),(16,'uv_otdb_id'),(17,'cs_otdb_id'),(18,'is_otdb_id'),(19,'im_otdb_id'),(20,'img_otdb_id'),(21,'pulp_otdb_id'),(22, 'is_tab_nr'),(23, 'start_sbg_nr'),(24, 'pulp_file_size');
+INSERT INTO resource_allocation.resource_claim_property_type VALUES (0, 'nr_of_is_files'),(1, 'nr_of_cs_files'),(2, 'nr_of_uv_files'),(3, 'nr_of_im_files'),(4, 'nr_of_img_files'),/*(5, 'nr_of_pulp_files'),unused duplicate #10869*/(6, 'nr_of_cs_stokes'),(7, 'nr_of_is_stokes'),(8, 'is_file_size'),(9, 'cs_file_size'),(10, 'uv_file_size'),(11, 'im_file_size'),(12, 'img_file_size'),(13, 'nr_of_pulp_files'),(14, 'nr_of_cs_parts'),(15, 'start_sb_nr'),(16,'uv_otdb_id'),(17,'cs_otdb_id'),(18,'is_otdb_id'),(19,'im_otdb_id'),(20,'img_otdb_id'),(21,'pulp_otdb_id'),(22, 'is_tab_nr'),(23, 'start_sbg_nr'),(24, 'pulp_file_size');
 INSERT INTO resource_allocation.resource_claim_property_io_type VALUES (0, 'output'),(1, 'input');
 INSERT INTO resource_allocation.config VALUES (0, 'max_fill_ratio_CEP4_storage', '0.85'), (1, 'claim_timeout', '172800'), (2, 'min_inter_task_delay', '60'), (3, 'max_fill_ratio_CEP4_bandwidth', '0.75'); -- Just some values 172800 is two days in seconds
 INSERT INTO resource_allocation.conflict_reason
diff --git a/SAS/ResourceAssignment/ResourceAssignmentDatabase/radb/sql/add_virtual_instrument.sql b/SAS/ResourceAssignment/ResourceAssignmentDatabase/radb/sql/add_virtual_instrument.sql
index c1b0bfb096e42445b827677321c92f2b04f01e4b..48bc6c8d29faa359ed79fd32e38cc4d9f0a0e509 100644
--- a/SAS/ResourceAssignment/ResourceAssignmentDatabase/radb/sql/add_virtual_instrument.sql
+++ b/SAS/ResourceAssignment/ResourceAssignmentDatabase/radb/sql/add_virtual_instrument.sql
@@ -21,7 +21,7 @@ INSERT INTO virtual_instrument.resource_group_type VALUES (0, 'instrument'), (1,
 INSERT INTO virtual_instrument.resource_group VALUES (0, 'LOFAR', 0), (1, 'CEP4', 1), (2, 'COBALT', 1), (3, 'computenodes', 4), (4, 'gpunodes', 4), (5, 'cpunode01', 5), (6, 'cpunode02', 5), (7, 'cpunode03', 5), (8, 'cpunode04', 5), (9, 'cpunode05', 5), (10, 'cpunode06', 5), (11, 'cpunode07', 5), (12, 'cpunode08', 5), (13, 'cpunode09', 5), (14, 'cpunode10', 5), (15, 'cpunode11', 5), (16, 'cpunode12', 5), (17, 'cpunode13', 5), (18, 'cpunode14', 5), (19, 'cpunode15', 5), (20, 'cpunode16', 5), (21, 'cpunode17', 5), (22, 'cpunode18', 5), (23, 'cpunode19', 5), (24, 'cpunode20', 5), (25, 'cpunode21', 5), (26, 'cpunode22', 5), (27, 'cpunode23', 5), (28, 'cpunode24', 5), (29, 'cpunode25', 5), (30, 'cpunode26', 5), (31, 'cpunode27', 5), (32, 'cpunode28', 5), (33, 'cpunode29', 5), (34, 'cpunode30', 5), (35, 'cpunode31', 5), (36, 'cpunode32', 5), (37, 'cpunode33', 5), (38, 'cpunode34', 5), (39, 'cpunode35', 5), (40, 'cpunode36', 5), (41, 'cpunode37', 5), (42, 'cpunode38', 5), (43, 'cpunode39', 5), (44, 'cpunode40', 5), (45, 'cpunode41', 5), (46, 'cpunode42', 5), (47, 'cpunode43', 5), (48, 'cpunode44', 5), (49, 'cpunode45', 5), (50, 'cpunode46', 5), (51, 'cpunode47', 5), (52, 'cpunode48', 5), (53, 'cpunode49', 5), (54, 'cpunode50', 5), (55, 'cbt001', 5), (56, 'cbt002', 5), (57, 'cbt003', 5), (58, 'cbt004', 5), (59, 'cbt005', 5), (60, 'cbt006', 5), (61, 'cbt007', 5), (62, 'cbt008', 5), (63, 'DRAGNET', 1), (64, 'drgnodes', 4), (65, 'dragproc', 5), (66, 'drg01', 5), (67, 'drg01-data1', 4), (68, 'drg01-data2', 4), (69, 'drg02', 5), (70, 'drg02-data1', 4), (71, 'drg02-data2', 4), (72, 'drg03', 5), (73, 'drg03-data1', 4), (74, 'drg03-data2', 4), (75, 'drg04', 5), (76, 'drg04-data1', 4), (77, 'drg04-data2', 4), (78, 'drg05', 5), (79, 'drg05-data1', 4), (80, 'drg05-data2', 4), (81, 'drg06', 5), (82, 'drg06-data1', 4), (83, 'drg06-data2', 4), (84, 'drg07', 5), (85, 'drg07-data1', 4), (86, 'drg07-data2', 4), (87, 'drg08', 5), (88, 'drg08-data1', 4), (89, 'drg08-data2', 4), (90, 'drg09', 5), (91, 'drg09-data1', 4), (92, 'drg09-data2', 4), (93, 'drg10', 5), (94, 'drg10-data1', 4), (95, 'drg10-data2', 4), (96, 'drg11', 5), (97, 'drg11-data1', 4), (98, 'drg11-data2', 4), (99, 'drg12', 5), (100, 'drg12-data1', 4), (101, 'drg12-data2', 4), (102, 'drg13', 5), (103, 'drg13-data1', 4), (104, 'drg13-data2', 4), (105, 'drg14', 5), (106, 'drg14-data1', 4), (107, 'drg14-data2', 4), (108, 'drg15', 5), (109, 'drg15-data1', 4), (110, 'drg15-data2', 4), (111, 'drg16', 5), (112, 'drg16-data1', 4), (113, 'drg16-data2', 4), (114, 'drg17', 5), (115, 'drg17-data1', 4), (116, 'drg17-data2', 4), (117, 'drg18', 5), (118, 'drg18-data1', 4), (119, 'drg18-data2', 4), (120, 'drg19', 5), (121, 'drg19-data1', 4), (122, 'drg19-data2', 4), (123, 'drg20', 5), (124, 'drg20-data1', 4), (125, 'drg20-data2', 4), (126, 'drg21', 5), (127, 'drg21-data1', 4), (128, 'drg21-data2', 4), (129, 'drg22', 5), (130, 'drg22-data1', 4), (131, 'drg22-data2', 4), (132, 'drg23', 5), (133, 'drg23-data1', 4), (134, 'drg23-data2', 4), (135, 'CORE', 2), (136, 'REMOTE', 2), (137, 'INTERNATIONAL', 2), (138, 'SUPERTERP', 4), (139, 'ALL', 4), (140, 'NL', 4), (141, 'CoreSansST', 4), (142, 'VLBI', 4), (143, 'AARTFAAC', 4), (144, 'CORE2KM', 4), (145, 'LORA', 4), (149, 'CS001', 3), (150, 'CS002', 3), (151, 'CS003', 3), (152, 'CS004', 3), (153, 'CS005', 3), (154, 'CS006', 3), (155, 'CS007', 3), (156, 'CS011', 3), (157, 'CS013', 3), (158, 'CS017', 3), (159, 'CS021', 3), (160, 'CS024', 3), (161, 'CS026', 3), (162, 'CS028', 3), (163, 'CS030', 3), (164, 'CS031', 3), (165, 'CS032', 3), (166, 'CS101', 3), (167, 'CS103', 3), (168, 'CS201', 3), (169, 'CS301', 3), (170, 'CS302', 3), (171, 'CS401', 3), (172, 'CS501', 3), (173, 'RS106', 3), (174, 'RS205', 3), (175, 'RS208', 3), (176, 'RS210', 3), (177, 'RS305', 3), (178, 'RS306', 3), (179, 'RS307', 3), (180, 'RS310', 3), (181, 'RS406', 3), (182, 'RS407', 3), (183, 'RS408', 3), (184, 'RS409', 3), (185, 'RS503', 3), (186, 'RS508', 3), (187, 'RS509', 3), (188, 'DE601', 3), (189, 'DE602', 3), (190, 'DE603', 3), (191, 'DE604', 3), (192, 'DE605', 3), (193, 'FR606', 3), (194, 'SE607', 3), (195, 'UK608', 3), (196, 'DE609', 3), (197, 'PL610', 3), (198, 'PL611', 3), (199, 'PL612', 3), (200, 'IE613', 3), (201, 'IS614', 3), (202, 'TEST1', 3), (206, 'CS001RSP0', 6), (207, 'CS001RSP1', 6), (208, 'CS002RSP0', 6), (209, 'CS002RSP1', 6), (210, 'CS003RSP0', 6), (211, 'CS003RSP1', 6), (212, 'CS004RSP0', 6), (213, 'CS004RSP1', 6), (214, 'CS005RSP0', 6), (215, 'CS005RSP1', 6), (216, 'CS006RSP0', 6), (217, 'CS006RSP1', 6), (218, 'CS007RSP0', 6), (219, 'CS007RSP1', 6), (220, 'CS011RSP0', 6), (221, 'CS011RSP1', 6), (222, 'CS013RSP0', 6), (223, 'CS013RSP1', 6), (224, 'CS017RSP0', 6), (225, 'CS017RSP1', 6), (226, 'CS021RSP0', 6), (227, 'CS021RSP1', 6), (228, 'CS024RSP0', 6), (229, 'CS024RSP1', 6), (230, 'CS026RSP0', 6), (231, 'CS026RSP1', 6), (232, 'CS028RSP0', 6), (233, 'CS028RSP1', 6), (234, 'CS030RSP0', 6), (235, 'CS030RSP1', 6), (236, 'CS031RSP0', 6), (237, 'CS031RSP1', 6), (238, 'CS032RSP0', 6), (239, 'CS032RSP1', 6), (240, 'CS101RSP0', 6), (241, 'CS101RSP1', 6), (242, 'CS103RSP0', 6), (243, 'CS103RSP1', 6), (244, 'CS201RSP0', 6), (245, 'CS201RSP1', 6), (246, 'CS301RSP0', 6), (247, 'CS301RSP1', 6), (248, 'CS302RSP0', 6), (249, 'CS302RSP1', 6), (250, 'CS401RSP0', 6), (251, 'CS401RSP1', 6), (252, 'CS501RSP0', 6), (253, 'CS501RSP1', 6), (254, 'RS106RSP', 6), (255, 'RS205RSP', 6), (256, 'RS208RSP', 6), (257, 'RS210RSP', 6), (258, 'RS305RSP', 6), (259, 'RS306RSP', 6), (260, 'RS307RSP', 6), (261, 'RS310RSP', 6), (262, 'RS406RSP', 6), (263, 'RS407RSP', 6), (264, 'RS408RSP', 6), (265, 'RS409RSP', 6), (266, 'RS503RSP', 6), (267, 'RS508RSP', 6), (268, 'RS509RSP', 6), (269, 'DE601RSP', 6), (270, 'DE602RSP', 6), (271, 'DE603RSP', 6), (272, 'DE604RSP', 6), (273, 'DE605RSP', 6), (274, 'FR606RSP', 6), (275, 'SE607RSP', 6), (276, 'UK608RSP', 6), (277, 'DE609RSP', 6), (278, 'PL610RSP', 6), (279, 'PL611RSP', 6), (280, 'PL612RSP', 6), (281, 'IE613RSP', 6), (282, 'IS614RSP', 6), (283, 'TEST1RSP', 6);
 INSERT INTO virtual_instrument.resource VALUES (0, 'cpunode01_bandwidth', 3), (1, 'cpunode01_processors', 4), (2, 'cpunode02_bandwidth', 3), (3, 'cpunode02_processors', 4), (4, 'cpunode03_bandwidth', 3), (5, 'cpunode03_processors', 4), (6, 'cpunode04_bandwidth', 3), (7, 'cpunode04_processors', 4), (8, 'cpunode05_bandwidth', 3), (9, 'cpunode05_processors', 4), (10, 'cpunode06_bandwidth', 3), (11, 'cpunode06_processors', 4), (12, 'cpunode07_bandwidth', 3), (13, 'cpunode07_processors', 4), (14, 'cpunode08_bandwidth', 3), (15, 'cpunode08_processors', 4), (16, 'cpunode09_bandwidth', 3), (17, 'cpunode09_processors', 4), (18, 'cpunode10_bandwidth', 3), (19, 'cpunode10_processors', 4), (20, 'cpunode11_bandwidth', 3), (21, 'cpunode11_processors', 4), (22, 'cpunode12_bandwidth', 3), (23, 'cpunode12_processors', 4), (24, 'cpunode13_bandwidth', 3), (25, 'cpunode13_processors', 4), (26, 'cpunode14_bandwidth', 3), (27, 'cpunode14_processors', 4), (28, 'cpunode15_bandwidth', 3), (29, 'cpunode15_processors', 4), (30, 'cpunode16_bandwidth', 3), (31, 'cpunode16_processors', 4), (32, 'cpunode17_bandwidth', 3), (33, 'cpunode17_processors', 4), (34, 'cpunode18_bandwidth', 3), (35, 'cpunode18_processors', 4), (36, 'cpunode19_bandwidth', 3), (37, 'cpunode19_processors', 4), (38, 'cpunode20_bandwidth', 3), (39, 'cpunode20_processors', 4), (40, 'cpunode21_bandwidth', 3), (41, 'cpunode21_processors', 4), (42, 'cpunode22_bandwidth', 3), (43, 'cpunode22_processors', 4), (44, 'cpunode23_bandwidth', 3), (45, 'cpunode23_processors', 4), (46, 'cpunode24_bandwidth', 3), (47, 'cpunode24_processors', 4), (48, 'cpunode25_bandwidth', 3), (49, 'cpunode25_processors', 4), (50, 'cpunode26_bandwidth', 3), (51, 'cpunode26_processors', 4), (52, 'cpunode27_bandwidth', 3), (53, 'cpunode27_processors', 4), (54, 'cpunode28_bandwidth', 3), (55, 'cpunode28_processors', 4), (56, 'cpunode29_bandwidth', 3), (57, 'cpunode29_processors', 4), (58, 'cpunode30_bandwidth', 3), (59, 'cpunode30_processors', 4), (60, 'cpunode31_bandwidth', 3), (61, 'cpunode31_processors', 4), (62, 'cpunode32_bandwidth', 3), (63, 'cpunode32_processors', 4), (64, 'cpunode33_bandwidth', 3), (65, 'cpunode33_processors', 4), (66, 'cpunode34_bandwidth', 3), (67, 'cpunode34_processors', 4), (68, 'cpunode35_bandwidth', 3), (69, 'cpunode35_processors', 4), (70, 'cpunode36_bandwidth', 3), (71, 'cpunode36_processors', 4), (72, 'cpunode37_bandwidth', 3), (73, 'cpunode37_processors', 4), (74, 'cpunode38_bandwidth', 3), (75, 'cpunode38_processors', 4), (76, 'cpunode39_bandwidth', 3), (77, 'cpunode39_processors', 4), (78, 'cpunode40_bandwidth', 3), (79, 'cpunode40_processors', 4), (80, 'cpunode41_bandwidth', 3), (81, 'cpunode41_processors', 4), (82, 'cpunode42_bandwidth', 3), (83, 'cpunode42_processors', 4), (84, 'cpunode43_bandwidth', 3), (85, 'cpunode43_processors', 4), (86, 'cpunode44_bandwidth', 3), (87, 'cpunode44_processors', 4), (88, 'cpunode45_bandwidth', 3), (89, 'cpunode45_processors', 4), (90, 'cpunode46_bandwidth', 3), (91, 'cpunode46_processors', 4), (92, 'cpunode47_bandwidth', 3), (93, 'cpunode47_processors', 4), (94, 'cpunode48_bandwidth', 3), (95, 'cpunode48_processors', 4), (96, 'cpunode49_bandwidth', 3), (97, 'cpunode49_processors', 4), (98, 'cpunode50_bandwidth', 3), (99, 'cpunode50_processors', 4), (100, 'cbt001_bandwidth', 3), (101, 'cbt001_processors', 4), (102, 'cbt002_bandwidth', 3), (103, 'cbt002_processors', 4), (104, 'cbt003_bandwidth', 3), (105, 'cbt003_processors', 4), (106, 'cbt004_bandwidth', 3), (107, 'cbt004_processors', 4), (108, 'cbt005_bandwidth', 3), (109, 'cbt005_processors', 4), (110, 'cbt006_bandwidth', 3), (111, 'cbt006_processors', 4), (112, 'cbt007_bandwidth', 3), (113, 'cbt007_processors', 4), (114, 'cbt008_bandwidth', 3), (115, 'cbt008_processors', 4), (116, 'CEP4_bandwidth:/data', 3), (117, 'CEP4_storage:/data', 5), (118, 'dragproc_bandwidth:/data', 3), (119, 'dragproc_storage:/data', 5), (120, 'drg01_bandwidth:/data1', 3), (121, 'drg01_bandwidth:/data2', 3), (122, 'drg01_storage:/data1', 5), (123, 'drg01_storage:/data2', 5), (124, 'drg02_bandwidth:/data1', 3), (125, 'drg02_bandwidth:/data2', 3), (126, 'drg02_storage:/data1', 5), (127, 'drg02_storage:/data2', 5), (128, 'drg03_bandwidth:/data1', 3), (129, 'drg03_bandwidth:/data2', 3), (130, 'drg03_storage:/data1', 5), (131, 'drg03_storage:/data2', 5), (132, 'drg04_bandwidth:/data1', 3), (133, 'drg04_bandwidth:/data2', 3), (134, 'drg04_storage:/data1', 5), (135, 'drg04_storage:/data2', 5), (136, 'drg05_bandwidth:/data1', 3), (137, 'drg05_bandwidth:/data2', 3), (138, 'drg05_storage:/data1', 5), (139, 'drg05_storage:/data2', 5), (140, 'drg06_bandwidth:/data1', 3), (141, 'drg06_bandwidth:/data2', 3), (142, 'drg06_storage:/data1', 5), (143, 'drg06_storage:/data2', 5), (144, 'drg07_bandwidth:/data1', 3), (145, 'drg07_bandwidth:/data2', 3), (146, 'drg07_storage:/data1', 5), (147, 'drg07_storage:/data2', 5), (148, 'drg08_bandwidth:/data1', 3), (149, 'drg08_bandwidth:/data2', 3), (150, 'drg08_storage:/data1', 5), (151, 'drg08_storage:/data2', 5), (152, 'drg09_bandwidth:/data1', 3), (153, 'drg09_bandwidth:/data2', 3), (154, 'drg09_storage:/data1', 5), (155, 'drg09_storage:/data2', 5), (156, 'drg10_bandwidth:/data1', 3), (157, 'drg10_bandwidth:/data2', 3), (158, 'drg10_storage:/data1', 5), (159, 'drg10_storage:/data2', 5), (160, 'drg11_bandwidth:/data1', 3), (161, 'drg11_bandwidth:/data2', 3), (162, 'drg11_storage:/data1', 5), (163, 'drg11_storage:/data2', 5), (164, 'drg12_bandwidth:/data1', 3), (165, 'drg12_bandwidth:/data2', 3), (166, 'drg12_storage:/data1', 5), (167, 'drg12_storage:/data2', 5), (168, 'drg13_bandwidth:/data1', 3), (169, 'drg13_bandwidth:/data2', 3), (170, 'drg13_storage:/data1', 5), (171, 'drg13_storage:/data2', 5), (172, 'drg14_bandwidth:/data1', 3), (173, 'drg14_bandwidth:/data2', 3), (174, 'drg14_storage:/data1', 5), (175, 'drg14_storage:/data2', 5), (176, 'drg15_bandwidth:/data1', 3), (177, 'drg15_bandwidth:/data2', 3), (178, 'drg15_storage:/data1', 5), (179, 'drg15_storage:/data2', 5), (180, 'drg16_bandwidth:/data1', 3), (181, 'drg16_bandwidth:/data2', 3), (182, 'drg16_storage:/data1', 5), (183, 'drg16_storage:/data2', 5), (184, 'drg17_bandwidth:/data1', 3), (185, 'drg17_bandwidth:/data2', 3), (186, 'drg17_storage:/data1', 5), (187, 'drg17_storage:/data2', 5), (188, 'drg18_bandwidth:/data1', 3), (189, 'drg18_bandwidth:/data2', 3), (190, 'drg18_storage:/data1', 5), (191, 'drg18_storage:/data2', 5), (192, 'drg19_bandwidth:/data1', 3), (193, 'drg19_bandwidth:/data2', 3), (194, 'drg19_storage:/data1', 5), (195, 'drg19_storage:/data2', 5), (196, 'drg20_bandwidth:/data1', 3), (197, 'drg20_bandwidth:/data2', 3), (198, 'drg20_storage:/data1', 5), (199, 'drg20_storage:/data2', 5), (200, 'drg21_bandwidth:/data1', 3), (201, 'drg21_bandwidth:/data2', 3), (202, 'drg21_storage:/data1', 5), (203, 'drg21_storage:/data2', 5), (204, 'drg22_bandwidth:/data1', 3), (205, 'drg22_bandwidth:/data2', 3), (206, 'drg22_storage:/data1', 5), (207, 'drg22_storage:/data2', 5), (208, 'drg23_bandwidth:/data1', 3), (209, 'drg23_bandwidth:/data2', 3), (210, 'drg23_storage:/data1', 5), (211, 'drg23_storage:/data2', 5), (212, 'CS001rcu', 2), (213, 'CS001tbb', 1), (214, 'CS002rcu', 2), (215, 'CS002tbb', 1), (216, 'CS003rcu', 2), (217, 'CS003tbb', 1), (218, 'CS004rcu', 2), (219, 'CS004tbb', 1), (220, 'CS005rcu', 2), (221, 'CS005tbb', 1), (222, 'CS006rcu', 2), (223, 'CS006tbb', 1), (224, 'CS007rcu', 2), (225, 'CS007tbb', 1), (226, 'CS011rcu', 2), (227, 'CS011tbb', 1), (228, 'CS013rcu', 2), (229, 'CS013tbb', 1), (230, 'CS017rcu', 2), (231, 'CS017tbb', 1), (232, 'CS021rcu', 2), (233, 'CS021tbb', 1), (234, 'CS024rcu', 2), (235, 'CS024tbb', 1), (236, 'CS026rcu', 2), (237, 'CS026tbb', 1), (238, 'CS028rcu', 2), (239, 'CS028tbb', 1), (240, 'CS030rcu', 2), (241, 'CS030tbb', 1), (242, 'CS031rcu', 2), (243, 'CS031tbb', 1), (244, 'CS032rcu', 2), (245, 'CS032tbb', 1), (246, 'CS101rcu', 2), (247, 'CS101tbb', 1), (248, 'CS103rcu', 2), (249, 'CS103tbb', 1), (250, 'CS201rcu', 2), (251, 'CS201tbb', 1), (252, 'CS301rcu', 2), (253, 'CS301tbb', 1), (254, 'CS302rcu', 2), (255, 'CS302tbb', 1), (256, 'CS401rcu', 2), (257, 'CS401tbb', 1), (258, 'CS501rcu', 2), (259, 'CS501tbb', 1), (260, 'RS106rcu', 2), (261, 'RS106tbb', 1), (262, 'RS205rcu', 2), (263, 'RS205tbb', 1), (264, 'RS208rcu', 2), (265, 'RS208tbb', 1), (266, 'RS210rcu', 2), (267, 'RS210tbb', 1), (268, 'RS305rcu', 2), (269, 'RS305tbb', 1), (270, 'RS306rcu', 2), (271, 'RS306tbb', 1), (272, 'RS307rcu', 2), (273, 'RS307tbb', 1), (274, 'RS310rcu', 2), (275, 'RS310tbb', 1), (276, 'RS406rcu', 2), (277, 'RS406tbb', 1), (278, 'RS407rcu', 2), (279, 'RS407tbb', 1), (280, 'RS408rcu', 2), (281, 'RS408tbb', 1), (282, 'RS409rcu', 2), (283, 'RS409tbb', 1), (284, 'RS503rcu', 2), (285, 'RS503tbb', 1), (286, 'RS508rcu', 2), (287, 'RS508tbb', 1), (288, 'RS509rcu', 2), (289, 'RS509tbb', 1), (290, 'DE601rcu', 2), (291, 'DE601tbb', 1), (292, 'DE602rcu', 2), (293, 'DE602tbb', 1), (294, 'DE603rcu', 2), (295, 'DE603tbb', 1), (296, 'DE604rcu', 2), (297, 'DE604tbb', 1), (298, 'DE605rcu', 2), (299, 'DE605tbb', 1), (300, 'FR606rcu', 2), (301, 'FR606tbb', 1), (302, 'SE607rcu', 2), (303, 'SE607tbb', 1), (304, 'UK608rcu', 2), (305, 'UK608tbb', 1), (306, 'DE609rcu', 2), (307, 'DE609tbb', 1), (308, 'PL610rcu', 2), (309, 'PL610tbb', 1), (310, 'PL611rcu', 2), (311, 'PL611tbb', 1), (312, 'PL612rcu', 2), (313, 'PL612tbb', 1), (314, 'IE613rcu', 2), (315, 'IE613tbb', 1), (316, 'IS614rcu', 2), (317, 'IS614tbb', 1), (318, 'TEST1rcu', 2), (319, 'TEST1tbb', 1), (320, 'CS001chan0', 0), (321, 'CS001bw0', 3), (322, 'CS001chan1', 0), (323, 'CS001bw1', 3), (324, 'CS002chan0', 0), (325, 'CS002bw0', 3), (326, 'CS002chan1', 0), (327, 'CS002bw1', 3), (328, 'CS003chan0', 0), (329, 'CS003bw0', 3), (330, 'CS003chan1', 0), (331, 'CS003bw1', 3), (332, 'CS004chan0', 0), (333, 'CS004bw0', 3), (334, 'CS004chan1', 0), (335, 'CS004bw1', 3), (336, 'CS005chan0', 0), (337, 'CS005bw0', 3), (338, 'CS005chan1', 0), (339, 'CS005bw1', 3), (340, 'CS006chan0', 0), (341, 'CS006bw0', 3), (342, 'CS006chan1', 0), (343, 'CS006bw1', 3), (344, 'CS007chan0', 0), (345, 'CS007bw0', 3), (346, 'CS007chan1', 0), (347, 'CS007bw1', 3), (348, 'CS011chan0', 0), (349, 'CS011bw0', 3), (350, 'CS011chan1', 0), (351, 'CS011bw1', 3), (352, 'CS013chan0', 0), (353, 'CS013bw0', 3), (354, 'CS013chan1', 0), (355, 'CS013bw1', 3), (356, 'CS017chan0', 0), (357, 'CS017bw0', 3), (358, 'CS017chan1', 0), (359, 'CS017bw1', 3), (360, 'CS021chan0', 0), (361, 'CS021bw0', 3), (362, 'CS021chan1', 0), (363, 'CS021bw1', 3), (364, 'CS024chan0', 0), (365, 'CS024bw0', 3), (366, 'CS024chan1', 0), (367, 'CS024bw1', 3), (368, 'CS026chan0', 0), (369, 'CS026bw0', 3), (370, 'CS026chan1', 0), (371, 'CS026bw1', 3), (372, 'CS028chan0', 0), (373, 'CS028bw0', 3), (374, 'CS028chan1', 0), (375, 'CS028bw1', 3), (376, 'CS030chan0', 0), (377, 'CS030bw0', 3), (378, 'CS030chan1', 0), (379, 'CS030bw1', 3), (380, 'CS031chan0', 0), (381, 'CS031bw0', 3), (382, 'CS031chan1', 0), (383, 'CS031bw1', 3), (384, 'CS032chan0', 0), (385, 'CS032bw0', 3), (386, 'CS032chan1', 0), (387, 'CS032bw1', 3), (388, 'CS101chan0', 0), (389, 'CS101bw0', 3), (390, 'CS101chan1', 0), (391, 'CS101bw1', 3), (392, 'CS103chan0', 0), (393, 'CS103bw0', 3), (394, 'CS103chan1', 0), (395, 'CS103bw1', 3), (396, 'CS201chan0', 0), (397, 'CS201bw0', 3), (398, 'CS201chan1', 0), (399, 'CS201bw1', 3), (400, 'CS301chan0', 0), (401, 'CS301bw0', 3), (402, 'CS301chan1', 0), (403, 'CS301bw1', 3), (404, 'CS302chan0', 0), (405, 'CS302bw0', 3), (406, 'CS302chan1', 0), (407, 'CS302bw1', 3), (408, 'CS401chan0', 0), (409, 'CS401bw0', 3), (410, 'CS401chan1', 0), (411, 'CS401bw1', 3), (412, 'CS501chan0', 0), (413, 'CS501bw0', 3), (414, 'CS501chan1', 0), (415, 'CS501bw1', 3), (416, 'RS106chan', 0), (417, 'RS106bw', 3), (418, 'RS205chan', 0), (419, 'RS205bw', 3), (420, 'RS208chan', 0), (421, 'RS208bw', 3), (422, 'RS210chan', 0), (423, 'RS210bw', 3), (424, 'RS305chan', 0), (425, 'RS305bw', 3), (426, 'RS306chan', 0), (427, 'RS306bw', 3), (428, 'RS307chan', 0), (429, 'RS307bw', 3), (430, 'RS310chan', 0), (431, 'RS310bw', 3), (432, 'RS406chan', 0), (433, 'RS406bw', 3), (434, 'RS407chan', 0), (435, 'RS407bw', 3), (436, 'RS408chan', 0), (437, 'RS408bw', 3), (438, 'RS409chan', 0), (439, 'RS409bw', 3), (440, 'RS503chan', 0), (441, 'RS503bw', 3), (442, 'RS508chan', 0), (443, 'RS508bw', 3), (444, 'RS509chan', 0), (445, 'RS509bw', 3), (446, 'DE601chan', 0), (447, 'DE601bw', 3), (448, 'DE602chan', 0), (449, 'DE602bw', 3), (450, 'DE603chan', 0), (451, 'DE603bw', 3), (452, 'DE604chan', 0), (453, 'DE604bw', 3), (454, 'DE605chan', 0), (455, 'DE605bw', 3), (456, 'FR606chan', 0), (457, 'FR606bw', 3), (458, 'SE607chan', 0), (459, 'SE607bw', 3), (460, 'UK608chan', 0), (461, 'UK608bw', 3), (462, 'DE609chan', 0), (463, 'DE609bw', 3), (464, 'PL610chan', 0), (465, 'PL610bw', 3), (466, 'PL611chan', 0), (467, 'PL611bw', 3), (468, 'PL612chan', 0), (469, 'PL612bw', 3), (470, 'IE613chan', 0), (471, 'IE613bw', 3), (472, 'IS614chan', 0), (473, 'IS614bw', 3), (474, 'TEST1chan', 0), (475, 'TEST1bw', 3);
 INSERT INTO virtual_instrument.resource_to_resource_group VALUES (DEFAULT, 0, 5), (DEFAULT, 1, 5), (DEFAULT, 2, 6), (DEFAULT, 3, 6), (DEFAULT, 4, 7), (DEFAULT, 5, 7), (DEFAULT, 6, 8), (DEFAULT, 7, 8), (DEFAULT, 8, 9), (DEFAULT, 9, 9), (DEFAULT, 10, 10), (DEFAULT, 11, 10), (DEFAULT, 12, 11), (DEFAULT, 13, 11), (DEFAULT, 14, 12), (DEFAULT, 15, 12), (DEFAULT, 16, 13), (DEFAULT, 17, 13), (DEFAULT, 18, 14), (DEFAULT, 19, 14), (DEFAULT, 20, 15), (DEFAULT, 21, 15), (DEFAULT, 22, 16), (DEFAULT, 23, 16), (DEFAULT, 24, 17), (DEFAULT, 25, 17), (DEFAULT, 26, 18), (DEFAULT, 27, 18), (DEFAULT, 28, 19), (DEFAULT, 29, 19), (DEFAULT, 30, 20), (DEFAULT, 31, 20), (DEFAULT, 32, 21), (DEFAULT, 33, 21), (DEFAULT, 34, 22), (DEFAULT, 35, 22), (DEFAULT, 36, 23), (DEFAULT, 37, 23), (DEFAULT, 38, 24), (DEFAULT, 39, 24), (DEFAULT, 40, 25), (DEFAULT, 41, 25), (DEFAULT, 42, 26), (DEFAULT, 43, 26), (DEFAULT, 44, 27), (DEFAULT, 45, 27), (DEFAULT, 46, 28), (DEFAULT, 47, 28), (DEFAULT, 48, 29), (DEFAULT, 49, 29), (DEFAULT, 50, 30), (DEFAULT, 51, 30), (DEFAULT, 52, 31), (DEFAULT, 53, 31), (DEFAULT, 54, 32), (DEFAULT, 55, 32), (DEFAULT, 56, 33), (DEFAULT, 57, 33), (DEFAULT, 58, 34), (DEFAULT, 59, 34), (DEFAULT, 60, 35), (DEFAULT, 61, 35), (DEFAULT, 62, 36), (DEFAULT, 63, 36), (DEFAULT, 64, 37), (DEFAULT, 65, 37), (DEFAULT, 66, 38), (DEFAULT, 67, 38), (DEFAULT, 68, 39), (DEFAULT, 69, 39), (DEFAULT, 70, 40), (DEFAULT, 71, 40), (DEFAULT, 72, 41), (DEFAULT, 73, 41), (DEFAULT, 74, 42), (DEFAULT, 75, 42), (DEFAULT, 76, 43), (DEFAULT, 77, 43), (DEFAULT, 78, 44), (DEFAULT, 79, 44), (DEFAULT, 80, 45), (DEFAULT, 81, 45), (DEFAULT, 82, 46), (DEFAULT, 83, 46), (DEFAULT, 84, 47), (DEFAULT, 85, 47), (DEFAULT, 86, 48), (DEFAULT, 87, 48), (DEFAULT, 88, 49), (DEFAULT, 89, 49), (DEFAULT, 90, 50), (DEFAULT, 91, 50), (DEFAULT, 92, 51), (DEFAULT, 93, 51), (DEFAULT, 94, 52), (DEFAULT, 95, 52), (DEFAULT, 96, 53), (DEFAULT, 97, 53), (DEFAULT, 98, 54), (DEFAULT, 99, 54), (DEFAULT, 100, 55), (DEFAULT, 101, 55), (DEFAULT, 102, 56), (DEFAULT, 103, 56), (DEFAULT, 104, 57), (DEFAULT, 105, 57), (DEFAULT, 106, 58), (DEFAULT, 107, 58), (DEFAULT, 108, 59), (DEFAULT, 109, 59), (DEFAULT, 110, 60), (DEFAULT, 111, 60), (DEFAULT, 112, 61), (DEFAULT, 113, 61), (DEFAULT, 114, 62), (DEFAULT, 115, 62), (DEFAULT, 116, 1), (DEFAULT, 117, 1), (DEFAULT, 118, 65), (DEFAULT, 119, 65), (DEFAULT, 120, 67), (DEFAULT, 121, 68), (DEFAULT, 122, 67), (DEFAULT, 123, 68), (DEFAULT, 124, 70), (DEFAULT, 125, 71), (DEFAULT, 126, 70), (DEFAULT, 127, 71), (DEFAULT, 128, 73), (DEFAULT, 129, 74), (DEFAULT, 130, 73), (DEFAULT, 131, 74), (DEFAULT, 132, 76), (DEFAULT, 133, 77), (DEFAULT, 134, 76), (DEFAULT, 135, 77), (DEFAULT, 136, 79), (DEFAULT, 137, 80), (DEFAULT, 138, 79), (DEFAULT, 139, 80), (DEFAULT, 140, 82), (DEFAULT, 141, 83), (DEFAULT, 142, 82), (DEFAULT, 143, 83), (DEFAULT, 144, 85), (DEFAULT, 145, 86), (DEFAULT, 146, 85), (DEFAULT, 147, 86), (DEFAULT, 148, 88), (DEFAULT, 149, 89), (DEFAULT, 150, 88), (DEFAULT, 151, 89), (DEFAULT, 152, 91), (DEFAULT, 153, 92), (DEFAULT, 154, 91), (DEFAULT, 155, 92), (DEFAULT, 156, 94), (DEFAULT, 157, 95), (DEFAULT, 158, 94), (DEFAULT, 159, 95), (DEFAULT, 160, 97), (DEFAULT, 161, 98), (DEFAULT, 162, 97), (DEFAULT, 163, 98), (DEFAULT, 164, 100), (DEFAULT, 165, 101), (DEFAULT, 166, 100), (DEFAULT, 167, 101), (DEFAULT, 168, 103), (DEFAULT, 169, 104), (DEFAULT, 170, 103), (DEFAULT, 171, 104), (DEFAULT, 172, 106), (DEFAULT, 173, 107), (DEFAULT, 174, 106), (DEFAULT, 175, 107), (DEFAULT, 176, 109), (DEFAULT, 177, 110), (DEFAULT, 178, 109), (DEFAULT, 179, 110), (DEFAULT, 180, 112), (DEFAULT, 181, 113), (DEFAULT, 182, 112), (DEFAULT, 183, 113), (DEFAULT, 184, 115), (DEFAULT, 185, 116), (DEFAULT, 186, 115), (DEFAULT, 187, 116), (DEFAULT, 188, 118), (DEFAULT, 189, 119), (DEFAULT, 190, 118), (DEFAULT, 191, 119), (DEFAULT, 192, 121), (DEFAULT, 193, 122), (DEFAULT, 194, 121), (DEFAULT, 195, 122), (DEFAULT, 196, 124), (DEFAULT, 197, 125), (DEFAULT, 198, 124), (DEFAULT, 199, 125), (DEFAULT, 200, 127), (DEFAULT, 201, 128), (DEFAULT, 202, 127), (DEFAULT, 203, 128), (DEFAULT, 204, 130), (DEFAULT, 205, 131), (DEFAULT, 206, 130), (DEFAULT, 207, 131), (DEFAULT, 208, 133), (DEFAULT, 209, 134), (DEFAULT, 210, 133), (DEFAULT, 211, 134), (DEFAULT, 212, 149), (DEFAULT, 213, 149), (DEFAULT, 214, 150), (DEFAULT, 215, 150), (DEFAULT, 216, 151), (DEFAULT, 217, 151), (DEFAULT, 218, 152), (DEFAULT, 219, 152), (DEFAULT, 220, 153), (DEFAULT, 221, 153), (DEFAULT, 222, 154), (DEFAULT, 223, 154), (DEFAULT, 224, 155), (DEFAULT, 225, 155), (DEFAULT, 226, 156), (DEFAULT, 227, 156), (DEFAULT, 228, 157), (DEFAULT, 229, 157), (DEFAULT, 230, 158), (DEFAULT, 231, 158), (DEFAULT, 232, 159), (DEFAULT, 233, 159), (DEFAULT, 234, 160), (DEFAULT, 235, 160), (DEFAULT, 236, 161), (DEFAULT, 237, 161), (DEFAULT, 238, 162), (DEFAULT, 239, 162), (DEFAULT, 240, 163), (DEFAULT, 241, 163), (DEFAULT, 242, 164), (DEFAULT, 243, 164), (DEFAULT, 244, 165), (DEFAULT, 245, 165), (DEFAULT, 246, 166), (DEFAULT, 247, 166), (DEFAULT, 248, 167), (DEFAULT, 249, 167), (DEFAULT, 250, 168), (DEFAULT, 251, 168), (DEFAULT, 252, 169), (DEFAULT, 253, 169), (DEFAULT, 254, 170), (DEFAULT, 255, 170), (DEFAULT, 256, 171), (DEFAULT, 257, 171), (DEFAULT, 258, 172), (DEFAULT, 259, 172), (DEFAULT, 260, 173), (DEFAULT, 261, 173), (DEFAULT, 262, 174), (DEFAULT, 263, 174), (DEFAULT, 264, 175), (DEFAULT, 265, 175), (DEFAULT, 266, 176), (DEFAULT, 267, 176), (DEFAULT, 268, 177), (DEFAULT, 269, 177), (DEFAULT, 270, 178), (DEFAULT, 271, 178), (DEFAULT, 272, 179), (DEFAULT, 273, 179), (DEFAULT, 274, 180), (DEFAULT, 275, 180), (DEFAULT, 276, 181), (DEFAULT, 277, 181), (DEFAULT, 278, 182), (DEFAULT, 279, 182), (DEFAULT, 280, 183), (DEFAULT, 281, 183), (DEFAULT, 282, 184), (DEFAULT, 283, 184), (DEFAULT, 284, 185), (DEFAULT, 285, 185), (DEFAULT, 286, 186), (DEFAULT, 287, 186), (DEFAULT, 288, 187), (DEFAULT, 289, 187), (DEFAULT, 290, 188), (DEFAULT, 291, 188), (DEFAULT, 292, 189), (DEFAULT, 293, 189), (DEFAULT, 294, 190), (DEFAULT, 295, 190), (DEFAULT, 296, 191), (DEFAULT, 297, 191), (DEFAULT, 298, 192), (DEFAULT, 299, 192), (DEFAULT, 300, 193), (DEFAULT, 301, 193), (DEFAULT, 302, 194), (DEFAULT, 303, 194), (DEFAULT, 304, 195), (DEFAULT, 305, 195), (DEFAULT, 306, 196), (DEFAULT, 307, 196), (DEFAULT, 308, 197), (DEFAULT, 309, 197), (DEFAULT, 310, 198), (DEFAULT, 311, 198), (DEFAULT, 312, 199), (DEFAULT, 313, 199), (DEFAULT, 314, 200), (DEFAULT, 315, 200), (DEFAULT, 316, 201), (DEFAULT, 317, 201), (DEFAULT, 318, 202), (DEFAULT, 319, 202), (DEFAULT, 320, 206), (DEFAULT, 321, 206), (DEFAULT, 322, 207), (DEFAULT, 323, 207), (DEFAULT, 324, 208), (DEFAULT, 325, 208), (DEFAULT, 326, 209), (DEFAULT, 327, 209), (DEFAULT, 328, 210), (DEFAULT, 329, 210), (DEFAULT, 330, 211), (DEFAULT, 331, 211), (DEFAULT, 332, 212), (DEFAULT, 333, 212), (DEFAULT, 334, 213), (DEFAULT, 335, 213), (DEFAULT, 336, 214), (DEFAULT, 337, 214), (DEFAULT, 338, 215), (DEFAULT, 339, 215), (DEFAULT, 340, 216), (DEFAULT, 341, 216), (DEFAULT, 342, 217), (DEFAULT, 343, 217), (DEFAULT, 344, 218), (DEFAULT, 345, 218), (DEFAULT, 346, 219), (DEFAULT, 347, 219), (DEFAULT, 348, 220), (DEFAULT, 349, 220), (DEFAULT, 350, 221), (DEFAULT, 351, 221), (DEFAULT, 352, 222), (DEFAULT, 353, 222), (DEFAULT, 354, 223), (DEFAULT, 355, 223), (DEFAULT, 356, 224), (DEFAULT, 357, 224), (DEFAULT, 358, 225), (DEFAULT, 359, 225), (DEFAULT, 360, 226), (DEFAULT, 361, 226), (DEFAULT, 362, 227), (DEFAULT, 363, 227), (DEFAULT, 364, 228), (DEFAULT, 365, 228), (DEFAULT, 366, 229), (DEFAULT, 367, 229), (DEFAULT, 368, 230), (DEFAULT, 369, 230), (DEFAULT, 370, 231), (DEFAULT, 371, 231), (DEFAULT, 372, 232), (DEFAULT, 373, 232), (DEFAULT, 374, 233), (DEFAULT, 375, 233), (DEFAULT, 376, 234), (DEFAULT, 377, 234), (DEFAULT, 378, 235), (DEFAULT, 379, 235), (DEFAULT, 380, 236), (DEFAULT, 381, 236), (DEFAULT, 382, 237), (DEFAULT, 383, 237), (DEFAULT, 384, 238), (DEFAULT, 385, 238), (DEFAULT, 386, 239), (DEFAULT, 387, 239), (DEFAULT, 388, 240), (DEFAULT, 389, 240), (DEFAULT, 390, 241), (DEFAULT, 391, 241), (DEFAULT, 392, 242), (DEFAULT, 393, 242), (DEFAULT, 394, 243), (DEFAULT, 395, 243), (DEFAULT, 396, 244), (DEFAULT, 397, 244), (DEFAULT, 398, 245), (DEFAULT, 399, 245), (DEFAULT, 400, 246), (DEFAULT, 401, 246), (DEFAULT, 402, 247), (DEFAULT, 403, 247), (DEFAULT, 404, 248), (DEFAULT, 405, 248), (DEFAULT, 406, 249), (DEFAULT, 407, 249), (DEFAULT, 408, 250), (DEFAULT, 409, 250), (DEFAULT, 410, 251), (DEFAULT, 411, 251), (DEFAULT, 412, 252), (DEFAULT, 413, 252), (DEFAULT, 414, 253), (DEFAULT, 415, 253), (DEFAULT, 416, 254), (DEFAULT, 417, 254), (DEFAULT, 418, 255), (DEFAULT, 419, 255), (DEFAULT, 420, 256), (DEFAULT, 421, 256), (DEFAULT, 422, 257), (DEFAULT, 423, 257), (DEFAULT, 424, 258), (DEFAULT, 425, 258), (DEFAULT, 426, 259), (DEFAULT, 427, 259), (DEFAULT, 428, 260), (DEFAULT, 429, 260), (DEFAULT, 430, 261), (DEFAULT, 431, 261), (DEFAULT, 432, 262), (DEFAULT, 433, 262), (DEFAULT, 434, 263), (DEFAULT, 435, 263), (DEFAULT, 436, 264), (DEFAULT, 437, 264), (DEFAULT, 438, 265), (DEFAULT, 439, 265), (DEFAULT, 440, 266), (DEFAULT, 441, 266), (DEFAULT, 442, 267), (DEFAULT, 443, 267), (DEFAULT, 444, 268), (DEFAULT, 445, 268), (DEFAULT, 446, 269), (DEFAULT, 447, 269), (DEFAULT, 448, 270), (DEFAULT, 449, 270), (DEFAULT, 450, 271), (DEFAULT, 451, 271), (DEFAULT, 452, 272), (DEFAULT, 453, 272), (DEFAULT, 454, 273), (DEFAULT, 455, 273), (DEFAULT, 456, 274), (DEFAULT, 457, 274), (DEFAULT, 458, 275), (DEFAULT, 459, 275), (DEFAULT, 460, 276), (DEFAULT, 461, 276), (DEFAULT, 462, 277), (DEFAULT, 463, 277), (DEFAULT, 464, 278), (DEFAULT, 465, 278), (DEFAULT, 466, 279), (DEFAULT, 467, 279), (DEFAULT, 468, 280), (DEFAULT, 469, 280), (DEFAULT, 470, 281), (DEFAULT, 471, 281), (DEFAULT, 472, 282), (DEFAULT, 473, 282), (DEFAULT, 474, 283), (DEFAULT, 475, 283);
-INSERT INTO resource_monitoring.resource_capacity VALUES (DEFAULT, 0, 26000000000, 26000000000), (DEFAULT, 1, 24, 24), (DEFAULT, 2, 26000000000, 26000000000), (DEFAULT, 3, 24, 24), (DEFAULT, 4, 26000000000, 26000000000), (DEFAULT, 5, 24, 24), (DEFAULT, 6, 26000000000, 26000000000), (DEFAULT, 7, 24, 24), (DEFAULT, 8, 26000000000, 26000000000), (DEFAULT, 9, 24, 24), (DEFAULT, 10, 26000000000, 26000000000), (DEFAULT, 11, 24, 24), (DEFAULT, 12, 26000000000, 26000000000), (DEFAULT, 13, 24, 24), (DEFAULT, 14, 26000000000, 26000000000), (DEFAULT, 15, 24, 24), (DEFAULT, 16, 26000000000, 26000000000), (DEFAULT, 17, 24, 24), (DEFAULT, 18, 26000000000, 26000000000), (DEFAULT, 19, 24, 24), (DEFAULT, 20, 26000000000, 26000000000), (DEFAULT, 21, 24, 24), (DEFAULT, 22, 26000000000, 26000000000), (DEFAULT, 23, 24, 24), (DEFAULT, 24, 26000000000, 26000000000), (DEFAULT, 25, 24, 24), (DEFAULT, 26, 26000000000, 26000000000), (DEFAULT, 27, 24, 24), (DEFAULT, 28, 26000000000, 26000000000), (DEFAULT, 29, 24, 24), (DEFAULT, 30, 26000000000, 26000000000), (DEFAULT, 31, 24, 24), (DEFAULT, 32, 26000000000, 26000000000), (DEFAULT, 33, 24, 24), (DEFAULT, 34, 26000000000, 26000000000), (DEFAULT, 35, 24, 24), (DEFAULT, 36, 26000000000, 26000000000), (DEFAULT, 37, 24, 24), (DEFAULT, 38, 26000000000, 26000000000), (DEFAULT, 39, 24, 24), (DEFAULT, 40, 26000000000, 26000000000), (DEFAULT, 41, 24, 24), (DEFAULT, 42, 26000000000, 26000000000), (DEFAULT, 43, 24, 24), (DEFAULT, 44, 26000000000, 26000000000), (DEFAULT, 45, 24, 24), (DEFAULT, 46, 26000000000, 26000000000), (DEFAULT, 47, 24, 24), (DEFAULT, 48, 26000000000, 26000000000), (DEFAULT, 49, 24, 24), (DEFAULT, 50, 26000000000, 26000000000), (DEFAULT, 51, 24, 24), (DEFAULT, 52, 26000000000, 26000000000), (DEFAULT, 53, 24, 24), (DEFAULT, 54, 26000000000, 26000000000), (DEFAULT, 55, 24, 24), (DEFAULT, 56, 26000000000, 26000000000), (DEFAULT, 57, 24, 24), (DEFAULT, 58, 26000000000, 26000000000), (DEFAULT, 59, 24, 24), (DEFAULT, 60, 26000000000, 26000000000), (DEFAULT, 61, 24, 24), (DEFAULT, 62, 26000000000, 26000000000), (DEFAULT, 63, 24, 24), (DEFAULT, 64, 26000000000, 26000000000), (DEFAULT, 65, 24, 24), (DEFAULT, 66, 26000000000, 26000000000), (DEFAULT, 67, 24, 24), (DEFAULT, 68, 26000000000, 26000000000), (DEFAULT, 69, 24, 24), (DEFAULT, 70, 26000000000, 26000000000), (DEFAULT, 71, 24, 24), (DEFAULT, 72, 26000000000, 26000000000), (DEFAULT, 73, 24, 24), (DEFAULT, 74, 26000000000, 26000000000), (DEFAULT, 75, 24, 24), (DEFAULT, 76, 26000000000, 26000000000), (DEFAULT, 77, 24, 24), (DEFAULT, 78, 26000000000, 26000000000), (DEFAULT, 79, 24, 24), (DEFAULT, 80, 26000000000, 26000000000), (DEFAULT, 81, 24, 24), (DEFAULT, 82, 26000000000, 26000000000), (DEFAULT, 83, 24, 24), (DEFAULT, 84, 26000000000, 26000000000), (DEFAULT, 85, 24, 24), (DEFAULT, 86, 26000000000, 26000000000), (DEFAULT, 87, 24, 24), (DEFAULT, 88, 26000000000, 26000000000), (DEFAULT, 89, 24, 24), (DEFAULT, 90, 26000000000, 26000000000), (DEFAULT, 91, 24, 24), (DEFAULT, 92, 26000000000, 26000000000), (DEFAULT, 93, 24, 24), (DEFAULT, 94, 26000000000, 26000000000), (DEFAULT, 95, 24, 24), (DEFAULT, 96, 26000000000, 26000000000), (DEFAULT, 97, 24, 24), (DEFAULT, 98, 26000000000, 26000000000), (DEFAULT, 99, 24, 24), (DEFAULT, 100, 52000000000, 52000000000), (DEFAULT, 101, 24, 24), (DEFAULT, 102, 52000000000, 52000000000), (DEFAULT, 103, 24, 24), (DEFAULT, 104, 52000000000, 52000000000), (DEFAULT, 105, 24, 24), (DEFAULT, 106, 52000000000, 52000000000), (DEFAULT, 107, 24, 24), (DEFAULT, 108, 52000000000, 52000000000), (DEFAULT, 109, 24, 24), (DEFAULT, 110, 52000000000, 52000000000), (DEFAULT, 111, 24, 24), (DEFAULT, 112, 52000000000, 52000000000), (DEFAULT, 113, 24, 24), (DEFAULT, 114, 52000000000, 52000000000), (DEFAULT, 115, 24, 24), (DEFAULT, 116, 687194767360, 687194767360), (DEFAULT, 117, 3450434462023680, 3450434462023680), (DEFAULT, 118, 3774873600, 3774873600), (DEFAULT, 119, 23669957984256, 23669957984256), (DEFAULT, 120, 2030043136, 2030043136), (DEFAULT, 121, 2030043136, 2030043136), (DEFAULT, 122, 7913168961536, 7913168961536), (DEFAULT, 123, 7913168961536, 7913168961536), (DEFAULT, 124, 2030043136, 2030043136), (DEFAULT, 125, 2030043136, 2030043136), (DEFAULT, 126, 7913168961536, 7913168961536), (DEFAULT, 127, 7913168961536, 7913168961536), (DEFAULT, 128, 2030043136, 2030043136), (DEFAULT, 129, 2030043136, 2030043136), (DEFAULT, 130, 7913168961536, 7913168961536), (DEFAULT, 131, 7913168961536, 7913168961536), (DEFAULT, 132, 2030043136, 2030043136), (DEFAULT, 133, 2030043136, 2030043136), (DEFAULT, 134, 7913168961536, 7913168961536), (DEFAULT, 135, 7913168961536, 7913168961536), (DEFAULT, 136, 2030043136, 2030043136), (DEFAULT, 137, 2030043136, 2030043136), (DEFAULT, 138, 7913168961536, 7913168961536), (DEFAULT, 139, 7913168961536, 7913168961536), (DEFAULT, 140, 2030043136, 2030043136), (DEFAULT, 141, 2030043136, 2030043136), (DEFAULT, 142, 7913168961536, 7913168961536), (DEFAULT, 143, 7913168961536, 7913168961536), (DEFAULT, 144, 2030043136, 2030043136), (DEFAULT, 145, 2030043136, 2030043136), (DEFAULT, 146, 7913168961536, 7913168961536), (DEFAULT, 147, 7913168961536, 7913168961536), (DEFAULT, 148, 2030043136, 2030043136), (DEFAULT, 149, 2030043136, 2030043136), (DEFAULT, 150, 7913168961536, 7913168961536), (DEFAULT, 151, 7913168961536, 7913168961536), (DEFAULT, 152, 2030043136, 2030043136), (DEFAULT, 153, 2030043136, 2030043136), (DEFAULT, 154, 7913168961536, 7913168961536), (DEFAULT, 155, 7913168961536, 7913168961536), (DEFAULT, 156, 2030043136, 2030043136), (DEFAULT, 157, 2030043136, 2030043136), (DEFAULT, 158, 7913168961536, 7913168961536), (DEFAULT, 159, 7913168961536, 7913168961536), (DEFAULT, 160, 2030043136, 2030043136), (DEFAULT, 161, 2030043136, 2030043136), (DEFAULT, 162, 7913168961536, 7913168961536), (DEFAULT, 163, 7913168961536, 7913168961536), (DEFAULT, 164, 2030043136, 2030043136), (DEFAULT, 165, 2030043136, 2030043136), (DEFAULT, 166, 7913168961536, 7913168961536), (DEFAULT, 167, 7913168961536, 7913168961536), (DEFAULT, 168, 2030043136, 2030043136), (DEFAULT, 169, 2030043136, 2030043136), (DEFAULT, 170, 7913168961536, 7913168961536), (DEFAULT, 171, 7913168961536, 7913168961536), (DEFAULT, 172, 2030043136, 2030043136), (DEFAULT, 173, 2030043136, 2030043136), (DEFAULT, 174, 7913168961536, 7913168961536), (DEFAULT, 175, 7913168961536, 7913168961536), (DEFAULT, 176, 2030043136, 2030043136), (DEFAULT, 177, 2030043136, 2030043136), (DEFAULT, 178, 7913168961536, 7913168961536), (DEFAULT, 179, 7913168961536, 7913168961536), (DEFAULT, 180, 2030043136, 2030043136), (DEFAULT, 181, 2030043136, 2030043136), (DEFAULT, 182, 7913168961536, 7913168961536), (DEFAULT, 183, 7913168961536, 7913168961536), (DEFAULT, 184, 2030043136, 2030043136), (DEFAULT, 185, 2030043136, 2030043136), (DEFAULT, 186, 7913168961536, 7913168961536), (DEFAULT, 187, 7913168961536, 7913168961536), (DEFAULT, 188, 2030043136, 2030043136), (DEFAULT, 189, 2030043136, 2030043136), (DEFAULT, 190, 7913168961536, 7913168961536), (DEFAULT, 191, 7913168961536, 7913168961536), (DEFAULT, 192, 2030043136, 2030043136), (DEFAULT, 193, 2030043136, 2030043136), (DEFAULT, 194, 7913168961536, 7913168961536), (DEFAULT, 195, 7913168961536, 7913168961536), (DEFAULT, 196, 2030043136, 2030043136), (DEFAULT, 197, 2030043136, 2030043136), (DEFAULT, 198, 7913168961536, 7913168961536), (DEFAULT, 199, 7913168961536, 7913168961536), (DEFAULT, 200, 2030043136, 2030043136), (DEFAULT, 201, 2030043136, 2030043136), (DEFAULT, 202, 7913168961536, 7913168961536), (DEFAULT, 203, 7913168961536, 7913168961536), (DEFAULT, 204, 2030043136, 2030043136), (DEFAULT, 205, 2030043136, 2030043136), (DEFAULT, 206, 7913168961536, 7913168961536), (DEFAULT, 207, 7913168961536, 7913168961536), (DEFAULT, 208, 2030043136, 2030043136), (DEFAULT, 209, 2030043136, 2030043136), (DEFAULT, 210, 7913168961536, 7913168961536), (DEFAULT, 211, 7913168961536, 7913168961536), (DEFAULT, 212, 96, 96), (DEFAULT, 213, 824633720832, 824633720832), (DEFAULT, 214, 96, 96), (DEFAULT, 215, 824633720832, 824633720832), (DEFAULT, 216, 96, 96), (DEFAULT, 217, 824633720832, 824633720832), (DEFAULT, 218, 96, 96), (DEFAULT, 219, 824633720832, 824633720832), (DEFAULT, 220, 96, 96), (DEFAULT, 221, 824633720832, 824633720832), (DEFAULT, 222, 96, 96), (DEFAULT, 223, 824633720832, 824633720832), (DEFAULT, 224, 96, 96), (DEFAULT, 225, 824633720832, 824633720832), (DEFAULT, 226, 96, 96), (DEFAULT, 227, 824633720832, 824633720832), (DEFAULT, 228, 96, 96), (DEFAULT, 229, 824633720832, 824633720832), (DEFAULT, 230, 96, 96), (DEFAULT, 231, 824633720832, 824633720832), (DEFAULT, 232, 96, 96), (DEFAULT, 233, 824633720832, 824633720832), (DEFAULT, 234, 96, 96), (DEFAULT, 235, 824633720832, 824633720832), (DEFAULT, 236, 96, 96), (DEFAULT, 237, 824633720832, 824633720832), (DEFAULT, 238, 96, 96), (DEFAULT, 239, 824633720832, 824633720832), (DEFAULT, 240, 96, 96), (DEFAULT, 241, 824633720832, 824633720832), (DEFAULT, 242, 96, 96), (DEFAULT, 243, 824633720832, 824633720832), (DEFAULT, 244, 96, 96), (DEFAULT, 245, 824633720832, 824633720832), (DEFAULT, 246, 96, 96), (DEFAULT, 247, 824633720832, 824633720832), (DEFAULT, 248, 96, 96), (DEFAULT, 249, 824633720832, 824633720832), (DEFAULT, 250, 96, 96), (DEFAULT, 251, 824633720832, 824633720832), (DEFAULT, 252, 96, 96), (DEFAULT, 253, 824633720832, 824633720832), (DEFAULT, 254, 96, 96), (DEFAULT, 255, 824633720832, 824633720832), (DEFAULT, 256, 96, 96), (DEFAULT, 257, 824633720832, 824633720832), (DEFAULT, 258, 96, 96), (DEFAULT, 259, 824633720832, 824633720832), (DEFAULT, 260, 96, 96), (DEFAULT, 261, 824633720832, 824633720832), (DEFAULT, 262, 96, 96), (DEFAULT, 263, 824633720832, 824633720832), (DEFAULT, 264, 96, 96), (DEFAULT, 265, 824633720832, 824633720832), (DEFAULT, 266, 96, 96), (DEFAULT, 267, 824633720832, 824633720832), (DEFAULT, 268, 96, 96), (DEFAULT, 269, 824633720832, 824633720832), (DEFAULT, 270, 96, 96), (DEFAULT, 271, 824633720832, 824633720832), (DEFAULT, 272, 96, 96), (DEFAULT, 273, 824633720832, 824633720832), (DEFAULT, 274, 96, 96), (DEFAULT, 275, 824633720832, 824633720832), (DEFAULT, 276, 96, 96), (DEFAULT, 277, 824633720832, 824633720832), (DEFAULT, 278, 96, 96), (DEFAULT, 279, 824633720832, 824633720832), (DEFAULT, 280, 96, 96), (DEFAULT, 281, 824633720832, 824633720832), (DEFAULT, 282, 96, 96), (DEFAULT, 283, 824633720832, 824633720832), (DEFAULT, 284, 96, 96), (DEFAULT, 285, 824633720832, 824633720832), (DEFAULT, 286, 96, 96), (DEFAULT, 287, 824633720832, 824633720832), (DEFAULT, 288, 96, 96), (DEFAULT, 289, 824633720832, 824633720832), (DEFAULT, 290, 192, 192), (DEFAULT, 291, 1649267441664, 1649267441664), (DEFAULT, 292, 192, 192), (DEFAULT, 293, 1649267441664, 1649267441664), (DEFAULT, 294, 192, 192), (DEFAULT, 295, 1649267441664, 1649267441664), (DEFAULT, 296, 192, 192), (DEFAULT, 297, 1649267441664, 1649267441664), (DEFAULT, 298, 192, 192), (DEFAULT, 299, 1649267441664, 1649267441664), (DEFAULT, 300, 192, 192), (DEFAULT, 301, 1649267441664, 1649267441664), (DEFAULT, 302, 192, 192), (DEFAULT, 303, 1649267441664, 1649267441664), (DEFAULT, 304, 192, 192), (DEFAULT, 305, 1649267441664, 1649267441664), (DEFAULT, 306, 192, 192), (DEFAULT, 307, 1649267441664, 1649267441664), (DEFAULT, 308, 192, 192), (DEFAULT, 309, 1649267441664, 1649267441664), (DEFAULT, 310, 192, 192), (DEFAULT, 311, 1649267441664, 1649267441664), (DEFAULT, 312, 192, 192), (DEFAULT, 313, 1649267441664, 1649267441664), (DEFAULT, 314, 192, 192), (DEFAULT, 315, 1649267441664, 1649267441664), (DEFAULT, 316, 192, 192), (DEFAULT, 317, 1649267441664, 1649267441664), (DEFAULT, 318, 192, 192), (DEFAULT, 319, 1649267441664, 1649267441664), (DEFAULT, 320, 976, 976), (DEFAULT, 321, 3000000000, 3000000000), (DEFAULT, 322, 976, 976), (DEFAULT, 323, 3000000000, 3000000000), (DEFAULT, 324, 976, 976), (DEFAULT, 325, 3000000000, 3000000000), (DEFAULT, 326, 976, 976), (DEFAULT, 327, 3000000000, 3000000000), (DEFAULT, 328, 976, 976), (DEFAULT, 329, 3000000000, 3000000000), (DEFAULT, 330, 976, 976), (DEFAULT, 331, 3000000000, 3000000000), (DEFAULT, 332, 976, 976), (DEFAULT, 333, 3000000000, 3000000000), (DEFAULT, 334, 976, 976), (DEFAULT, 335, 3000000000, 3000000000), (DEFAULT, 336, 976, 976), (DEFAULT, 337, 3000000000, 3000000000), (DEFAULT, 338, 976, 976), (DEFAULT, 339, 3000000000, 3000000000), (DEFAULT, 340, 976, 976), (DEFAULT, 341, 3000000000, 3000000000), (DEFAULT, 342, 976, 976), (DEFAULT, 343, 3000000000, 3000000000), (DEFAULT, 344, 976, 976), (DEFAULT, 345, 3000000000, 3000000000), (DEFAULT, 346, 976, 976), (DEFAULT, 347, 3000000000, 3000000000), (DEFAULT, 348, 976, 976), (DEFAULT, 349, 3000000000, 3000000000), (DEFAULT, 350, 976, 976), (DEFAULT, 351, 3000000000, 3000000000), (DEFAULT, 352, 976, 976), (DEFAULT, 353, 3000000000, 3000000000), (DEFAULT, 354, 976, 976), (DEFAULT, 355, 3000000000, 3000000000), (DEFAULT, 356, 976, 976), (DEFAULT, 357, 3000000000, 3000000000), (DEFAULT, 358, 976, 976), (DEFAULT, 359, 3000000000, 3000000000), (DEFAULT, 360, 976, 976), (DEFAULT, 361, 3000000000, 3000000000), (DEFAULT, 362, 976, 976), (DEFAULT, 363, 3000000000, 3000000000), (DEFAULT, 364, 976, 976), (DEFAULT, 365, 3000000000, 3000000000), (DEFAULT, 366, 976, 976), (DEFAULT, 367, 3000000000, 3000000000), (DEFAULT, 368, 976, 976), (DEFAULT, 369, 3000000000, 3000000000), (DEFAULT, 370, 976, 976), (DEFAULT, 371, 3000000000, 3000000000), (DEFAULT, 372, 976, 976), (DEFAULT, 373, 3000000000, 3000000000), (DEFAULT, 374, 976, 976), (DEFAULT, 375, 3000000000, 3000000000), (DEFAULT, 376, 976, 976), (DEFAULT, 377, 3000000000, 3000000000), (DEFAULT, 378, 976, 976), (DEFAULT, 379, 3000000000, 3000000000), (DEFAULT, 380, 976, 976), (DEFAULT, 381, 3000000000, 3000000000), (DEFAULT, 382, 976, 976), (DEFAULT, 383, 3000000000, 3000000000), (DEFAULT, 384, 976, 976), (DEFAULT, 385, 3000000000, 3000000000), (DEFAULT, 386, 976, 976), (DEFAULT, 387, 3000000000, 3000000000), (DEFAULT, 388, 976, 976), (DEFAULT, 389, 3000000000, 3000000000), (DEFAULT, 390, 976, 976), (DEFAULT, 391, 3000000000, 3000000000), (DEFAULT, 392, 976, 976), (DEFAULT, 393, 3000000000, 3000000000), (DEFAULT, 394, 976, 976), (DEFAULT, 395, 3000000000, 3000000000), (DEFAULT, 396, 976, 976), (DEFAULT, 397, 3000000000, 3000000000), (DEFAULT, 398, 976, 976), (DEFAULT, 399, 3000000000, 3000000000), (DEFAULT, 400, 976, 976), (DEFAULT, 401, 3000000000, 3000000000), (DEFAULT, 402, 976, 976), (DEFAULT, 403, 3000000000, 3000000000), (DEFAULT, 404, 976, 976), (DEFAULT, 405, 3000000000, 3000000000), (DEFAULT, 406, 976, 976), (DEFAULT, 407, 3000000000, 3000000000), (DEFAULT, 408, 976, 976), (DEFAULT, 409, 3000000000, 3000000000), (DEFAULT, 410, 976, 976), (DEFAULT, 411, 3000000000, 3000000000), (DEFAULT, 412, 976, 976), (DEFAULT, 413, 3000000000, 3000000000), (DEFAULT, 414, 976, 976), (DEFAULT, 415, 3000000000, 3000000000), (DEFAULT, 416, 976, 976), (DEFAULT, 417, 3000000000, 3000000000), (DEFAULT, 418, 976, 976), (DEFAULT, 419, 3000000000, 3000000000), (DEFAULT, 420, 976, 976), (DEFAULT, 421, 3000000000, 3000000000), (DEFAULT, 422, 976, 976), (DEFAULT, 423, 3000000000, 3000000000), (DEFAULT, 424, 976, 976), (DEFAULT, 425, 3000000000, 3000000000), (DEFAULT, 426, 976, 976), (DEFAULT, 427, 3000000000, 3000000000), (DEFAULT, 428, 976, 976), (DEFAULT, 429, 3000000000, 3000000000), (DEFAULT, 430, 976, 976), (DEFAULT, 431, 3000000000, 3000000000), (DEFAULT, 432, 976, 976), (DEFAULT, 433, 3000000000, 3000000000), (DEFAULT, 434, 976, 976), (DEFAULT, 435, 3000000000, 3000000000), (DEFAULT, 436, 976, 976), (DEFAULT, 437, 3000000000, 3000000000), (DEFAULT, 438, 976, 976), (DEFAULT, 439, 3000000000, 3000000000), (DEFAULT, 440, 976, 976), (DEFAULT, 441, 3000000000, 3000000000), (DEFAULT, 442, 976, 976), (DEFAULT, 443, 3000000000, 3000000000), (DEFAULT, 444, 976, 976), (DEFAULT, 445, 3000000000, 3000000000), (DEFAULT, 446, 976, 976), (DEFAULT, 447, 3000000000, 3000000000), (DEFAULT, 448, 976, 976), (DEFAULT, 449, 3000000000, 3000000000), (DEFAULT, 450, 976, 976), (DEFAULT, 451, 3000000000, 3000000000), (DEFAULT, 452, 976, 976), (DEFAULT, 453, 3000000000, 3000000000), (DEFAULT, 454, 976, 976), (DEFAULT, 455, 3000000000, 3000000000), (DEFAULT, 456, 976, 976), (DEFAULT, 457, 3000000000, 3000000000), (DEFAULT, 458, 976, 976), (DEFAULT, 459, 3000000000, 3000000000), (DEFAULT, 460, 976, 976), (DEFAULT, 461, 3000000000, 3000000000), (DEFAULT, 462, 976, 976), (DEFAULT, 463, 3000000000, 3000000000), (DEFAULT, 464, 976, 976), (DEFAULT, 465, 3000000000, 3000000000), (DEFAULT, 466, 976, 976), (DEFAULT, 467, 3000000000, 3000000000), (DEFAULT, 468, 976, 976), (DEFAULT, 469, 3000000000, 3000000000), (DEFAULT, 470, 976, 976), (DEFAULT, 471, 3000000000, 3000000000), (DEFAULT, 472, 976, 976), (DEFAULT, 473, 3000000000, 3000000000), (DEFAULT, 474, 976, 976), (DEFAULT, 475, 3000000000, 3000000000);
+INSERT INTO resource_monitoring.resource_capacity VALUES (DEFAULT, 0, 26000000000, 26000000000), (DEFAULT, 1, 24, 24), (DEFAULT, 2, 26000000000, 26000000000), (DEFAULT, 3, 24, 24), (DEFAULT, 4, 26000000000, 26000000000), (DEFAULT, 5, 24, 24), (DEFAULT, 6, 26000000000, 26000000000), (DEFAULT, 7, 24, 24), (DEFAULT, 8, 26000000000, 26000000000), (DEFAULT, 9, 24, 24), (DEFAULT, 10, 26000000000, 26000000000), (DEFAULT, 11, 24, 24), (DEFAULT, 12, 26000000000, 26000000000), (DEFAULT, 13, 24, 24), (DEFAULT, 14, 26000000000, 26000000000), (DEFAULT, 15, 24, 24), (DEFAULT, 16, 26000000000, 26000000000), (DEFAULT, 17, 24, 24), (DEFAULT, 18, 26000000000, 26000000000), (DEFAULT, 19, 24, 24), (DEFAULT, 20, 26000000000, 26000000000), (DEFAULT, 21, 24, 24), (DEFAULT, 22, 26000000000, 26000000000), (DEFAULT, 23, 24, 24), (DEFAULT, 24, 26000000000, 26000000000), (DEFAULT, 25, 24, 24), (DEFAULT, 26, 26000000000, 26000000000), (DEFAULT, 27, 24, 24), (DEFAULT, 28, 26000000000, 26000000000), (DEFAULT, 29, 24, 24), (DEFAULT, 30, 26000000000, 26000000000), (DEFAULT, 31, 24, 24), (DEFAULT, 32, 26000000000, 26000000000), (DEFAULT, 33, 24, 24), (DEFAULT, 34, 26000000000, 26000000000), (DEFAULT, 35, 24, 24), (DEFAULT, 36, 26000000000, 26000000000), (DEFAULT, 37, 24, 24), (DEFAULT, 38, 26000000000, 26000000000), (DEFAULT, 39, 24, 24), (DEFAULT, 40, 26000000000, 26000000000), (DEFAULT, 41, 24, 24), (DEFAULT, 42, 26000000000, 26000000000), (DEFAULT, 43, 24, 24), (DEFAULT, 44, 26000000000, 26000000000), (DEFAULT, 45, 24, 24), (DEFAULT, 46, 26000000000, 26000000000), (DEFAULT, 47, 24, 24), (DEFAULT, 48, 26000000000, 26000000000), (DEFAULT, 49, 24, 24), (DEFAULT, 50, 26000000000, 26000000000), (DEFAULT, 51, 24, 24), (DEFAULT, 52, 26000000000, 26000000000), (DEFAULT, 53, 24, 24), (DEFAULT, 54, 26000000000, 26000000000), (DEFAULT, 55, 24, 24), (DEFAULT, 56, 26000000000, 26000000000), (DEFAULT, 57, 24, 24), (DEFAULT, 58, 26000000000, 26000000000), (DEFAULT, 59, 24, 24), (DEFAULT, 60, 26000000000, 26000000000), (DEFAULT, 61, 24, 24), (DEFAULT, 62, 26000000000, 26000000000), (DEFAULT, 63, 24, 24), (DEFAULT, 64, 26000000000, 26000000000), (DEFAULT, 65, 24, 24), (DEFAULT, 66, 26000000000, 26000000000), (DEFAULT, 67, 24, 24), (DEFAULT, 68, 26000000000, 26000000000), (DEFAULT, 69, 24, 24), (DEFAULT, 70, 26000000000, 26000000000), (DEFAULT, 71, 24, 24), (DEFAULT, 72, 26000000000, 26000000000), (DEFAULT, 73, 24, 24), (DEFAULT, 74, 26000000000, 26000000000), (DEFAULT, 75, 24, 24), (DEFAULT, 76, 26000000000, 26000000000), (DEFAULT, 77, 24, 24), (DEFAULT, 78, 26000000000, 26000000000), (DEFAULT, 79, 24, 24), (DEFAULT, 80, 26000000000, 26000000000), (DEFAULT, 81, 24, 24), (DEFAULT, 82, 26000000000, 26000000000), (DEFAULT, 83, 24, 24), (DEFAULT, 84, 26000000000, 26000000000), (DEFAULT, 85, 24, 24), (DEFAULT, 86, 26000000000, 26000000000), (DEFAULT, 87, 24, 24), (DEFAULT, 88, 26000000000, 26000000000), (DEFAULT, 89, 24, 24), (DEFAULT, 90, 26000000000, 26000000000), (DEFAULT, 91, 24, 24), (DEFAULT, 92, 26000000000, 26000000000), (DEFAULT, 93, 24, 24), (DEFAULT, 94, 26000000000, 26000000000), (DEFAULT, 95, 24, 24), (DEFAULT, 96, 26000000000, 26000000000), (DEFAULT, 97, 24, 24), (DEFAULT, 98, 26000000000, 26000000000), (DEFAULT, 99, 24, 24), (DEFAULT, 100, 52000000000, 52000000000), (DEFAULT, 101, 24, 24), (DEFAULT, 102, 52000000000, 52000000000), (DEFAULT, 103, 24, 24), (DEFAULT, 104, 52000000000, 52000000000), (DEFAULT, 105, 24, 24), (DEFAULT, 106, 52000000000, 52000000000), (DEFAULT, 107, 24, 24), (DEFAULT, 108, 52000000000, 52000000000), (DEFAULT, 109, 24, 24), (DEFAULT, 110, 52000000000, 52000000000), (DEFAULT, 111, 24, 24), (DEFAULT, 112, 52000000000, 52000000000), (DEFAULT, 113, 24, 24), (DEFAULT, 114, 52000000000, 52000000000), (DEFAULT, 115, 24, 24), (DEFAULT, 116, 687194767360, 687194767360), (DEFAULT, 117, 3450434462023680, 3450434462023680), (DEFAULT, 118, 3774873600, 3774873600), (DEFAULT, 119, 23669957984256, 23669957984256), (DEFAULT, 120, 2030043136, 2030043136), (DEFAULT, 121, 2030043136, 2030043136), (DEFAULT, 122, 7913168961536, 7913168961536), (DEFAULT, 123, 7913168961536, 7913168961536), (DEFAULT, 124, 2030043136, 2030043136), (DEFAULT, 125, 2030043136, 2030043136), (DEFAULT, 126, 7913168961536, 7913168961536), (DEFAULT, 127, 7913168961536, 7913168961536), (DEFAULT, 128, 2030043136, 2030043136), (DEFAULT, 129, 2030043136, 2030043136), (DEFAULT, 130, 7913168961536, 7913168961536), (DEFAULT, 131, 7913168961536, 7913168961536), (DEFAULT, 132, 2030043136, 2030043136), (DEFAULT, 133, 2030043136, 2030043136), (DEFAULT, 134, 7913168961536, 7913168961536), (DEFAULT, 135, 7913168961536, 7913168961536), (DEFAULT, 136, 2030043136, 2030043136), (DEFAULT, 137, 2030043136, 2030043136), (DEFAULT, 138, 7913168961536, 7913168961536), (DEFAULT, 139, 7913168961536, 7913168961536), (DEFAULT, 140, 2030043136, 2030043136), (DEFAULT, 141, 2030043136, 2030043136), (DEFAULT, 142, 7913168961536, 7913168961536), (DEFAULT, 143, 7913168961536, 7913168961536), (DEFAULT, 144, 2030043136, 2030043136), (DEFAULT, 145, 2030043136, 2030043136), (DEFAULT, 146, 7913168961536, 7913168961536), (DEFAULT, 147, 7913168961536, 7913168961536), (DEFAULT, 148, 2030043136, 2030043136), (DEFAULT, 149, 2030043136, 2030043136), (DEFAULT, 150, 7913168961536, 7913168961536), (DEFAULT, 151, 7913168961536, 7913168961536), (DEFAULT, 152, 2030043136, 2030043136), (DEFAULT, 153, 2030043136, 2030043136), (DEFAULT, 154, 7913168961536, 7913168961536), (DEFAULT, 155, 7913168961536, 7913168961536), (DEFAULT, 156, 2030043136, 2030043136), (DEFAULT, 157, 2030043136, 2030043136), (DEFAULT, 158, 7913168961536, 7913168961536), (DEFAULT, 159, 7913168961536, 7913168961536), (DEFAULT, 160, 2030043136, 2030043136), (DEFAULT, 161, 2030043136, 2030043136), (DEFAULT, 162, 7913168961536, 7913168961536), (DEFAULT, 163, 7913168961536, 7913168961536), (DEFAULT, 164, 2030043136, 2030043136), (DEFAULT, 165, 2030043136, 2030043136), (DEFAULT, 166, 7913168961536, 7913168961536), (DEFAULT, 167, 7913168961536, 7913168961536), (DEFAULT, 168, 2030043136, 2030043136), (DEFAULT, 169, 2030043136, 2030043136), (DEFAULT, 170, 7913168961536, 7913168961536), (DEFAULT, 171, 7913168961536, 7913168961536), (DEFAULT, 172, 2030043136, 2030043136), (DEFAULT, 173, 2030043136, 2030043136), (DEFAULT, 174, 7913168961536, 7913168961536), (DEFAULT, 175, 7913168961536, 7913168961536), (DEFAULT, 176, 2030043136, 2030043136), (DEFAULT, 177, 2030043136, 2030043136), (DEFAULT, 178, 7913168961536, 7913168961536), (DEFAULT, 179, 7913168961536, 7913168961536), (DEFAULT, 180, 2030043136, 2030043136), (DEFAULT, 181, 2030043136, 2030043136), (DEFAULT, 182, 7913168961536, 7913168961536), (DEFAULT, 183, 7913168961536, 7913168961536), (DEFAULT, 184, 2030043136, 2030043136), (DEFAULT, 185, 2030043136, 2030043136), (DEFAULT, 186, 7913168961536, 7913168961536), (DEFAULT, 187, 7913168961536, 7913168961536), (DEFAULT, 188, 2030043136, 2030043136), (DEFAULT, 189, 2030043136, 2030043136), (DEFAULT, 190, 7913168961536, 7913168961536), (DEFAULT, 191, 7913168961536, 7913168961536), (DEFAULT, 192, 2030043136, 2030043136), (DEFAULT, 193, 2030043136, 2030043136), (DEFAULT, 194, 7913168961536, 7913168961536), (DEFAULT, 195, 7913168961536, 7913168961536), (DEFAULT, 196, 2030043136, 2030043136), (DEFAULT, 197, 2030043136, 2030043136), (DEFAULT, 198, 7913168961536, 7913168961536), (DEFAULT, 199, 7913168961536, 7913168961536), (DEFAULT, 200, 2030043136, 2030043136), (DEFAULT, 201, 2030043136, 2030043136), (DEFAULT, 202, 7913168961536, 7913168961536), (DEFAULT, 203, 7913168961536, 7913168961536), (DEFAULT, 204, 2030043136, 2030043136), (DEFAULT, 205, 2030043136, 2030043136), (DEFAULT, 206, 7913168961536, 7913168961536), (DEFAULT, 207, 7913168961536, 7913168961536), (DEFAULT, 208, 2030043136, 2030043136), (DEFAULT, 209, 2030043136, 2030043136), (DEFAULT, 210, 7913168961536, 7913168961536), (DEFAULT, 211, 7913168961536, 7913168961536), (DEFAULT, 212, 96, 96), (DEFAULT, 213, 824633720832, 824633720832), (DEFAULT, 214, 96, 96), (DEFAULT, 215, 824633720832, 824633720832), (DEFAULT, 216, 96, 96), (DEFAULT, 217, 824633720832, 824633720832), (DEFAULT, 218, 96, 96), (DEFAULT, 219, 824633720832, 824633720832), (DEFAULT, 220, 96, 96), (DEFAULT, 221, 824633720832, 824633720832), (DEFAULT, 222, 96, 96), (DEFAULT, 223, 824633720832, 824633720832), (DEFAULT, 224, 96, 96), (DEFAULT, 225, 824633720832, 824633720832), (DEFAULT, 226, 96, 96), (DEFAULT, 227, 824633720832, 824633720832), (DEFAULT, 228, 96, 96), (DEFAULT, 229, 824633720832, 824633720832), (DEFAULT, 230, 96, 96), (DEFAULT, 231, 824633720832, 824633720832), (DEFAULT, 232, 96, 96), (DEFAULT, 233, 824633720832, 824633720832), (DEFAULT, 234, 96, 96), (DEFAULT, 235, 824633720832, 824633720832), (DEFAULT, 236, 96, 96), (DEFAULT, 237, 824633720832, 824633720832), (DEFAULT, 238, 96, 96), (DEFAULT, 239, 824633720832, 824633720832), (DEFAULT, 240, 96, 96), (DEFAULT, 241, 824633720832, 824633720832), (DEFAULT, 242, 96, 96), (DEFAULT, 243, 824633720832, 824633720832), (DEFAULT, 244, 96, 96), (DEFAULT, 245, 824633720832, 824633720832), (DEFAULT, 246, 96, 96), (DEFAULT, 247, 824633720832, 824633720832), (DEFAULT, 248, 96, 96), (DEFAULT, 249, 824633720832, 824633720832), (DEFAULT, 250, 96, 96), (DEFAULT, 251, 824633720832, 824633720832), (DEFAULT, 252, 96, 96), (DEFAULT, 253, 824633720832, 824633720832), (DEFAULT, 254, 96, 96), (DEFAULT, 255, 824633720832, 824633720832), (DEFAULT, 256, 96, 96), (DEFAULT, 257, 824633720832, 824633720832), (DEFAULT, 258, 96, 96), (DEFAULT, 259, 824633720832, 824633720832), (DEFAULT, 260, 96, 96), (DEFAULT, 261, 824633720832, 824633720832), (DEFAULT, 262, 96, 96), (DEFAULT, 263, 824633720832, 824633720832), (DEFAULT, 264, 96, 96), (DEFAULT, 265, 824633720832, 824633720832), (DEFAULT, 266, 96, 96), (DEFAULT, 267, 824633720832, 824633720832), (DEFAULT, 268, 96, 96), (DEFAULT, 269, 824633720832, 824633720832), (DEFAULT, 270, 96, 96), (DEFAULT, 271, 824633720832, 824633720832), (DEFAULT, 272, 96, 96), (DEFAULT, 273, 824633720832, 824633720832), (DEFAULT, 274, 96, 96), (DEFAULT, 275, 824633720832, 824633720832), (DEFAULT, 276, 96, 96), (DEFAULT, 277, 824633720832, 824633720832), (DEFAULT, 278, 96, 96), (DEFAULT, 279, 824633720832, 824633720832), (DEFAULT, 280, 96, 96), (DEFAULT, 281, 824633720832, 824633720832), (DEFAULT, 282, 96, 96), (DEFAULT, 283, 824633720832, 824633720832), (DEFAULT, 284, 96, 96), (DEFAULT, 285, 824633720832, 824633720832), (DEFAULT, 286, 96, 96), (DEFAULT, 287, 824633720832, 824633720832), (DEFAULT, 288, 96, 96), (DEFAULT, 289, 824633720832, 824633720832), (DEFAULT, 290, 192, 192), (DEFAULT, 291, 1649267441664, 1649267441664), (DEFAULT, 292, 192, 192), (DEFAULT, 293, 1649267441664, 1649267441664), (DEFAULT, 294, 192, 192), (DEFAULT, 295, 1649267441664, 1649267441664), (DEFAULT, 296, 192, 192), (DEFAULT, 297, 1649267441664, 1649267441664), (DEFAULT, 298, 192, 192), (DEFAULT, 299, 1649267441664, 1649267441664), (DEFAULT, 300, 192, 192), (DEFAULT, 301, 1649267441664, 1649267441664), (DEFAULT, 302, 192, 192), (DEFAULT, 303, 1649267441664, 1649267441664), (DEFAULT, 304, 192, 192), (DEFAULT, 305, 1649267441664, 1649267441664), (DEFAULT, 306, 192, 192), (DEFAULT, 307, 1649267441664, 1649267441664), (DEFAULT, 308, 192, 192), (DEFAULT, 309, 1649267441664, 1649267441664), (DEFAULT, 310, 192, 192), (DEFAULT, 311, 1649267441664, 1649267441664), (DEFAULT, 312, 192, 192), (DEFAULT, 313, 1649267441664, 1649267441664), (DEFAULT, 314, 192, 192), (DEFAULT, 315, 1649267441664, 1649267441664), (DEFAULT, 316, 192, 192), (DEFAULT, 317, 1649267441664, 1649267441664), (DEFAULT, 318, 192, 192), (DEFAULT, 319, 1649267441664, 1649267441664), (DEFAULT, 320, 3094, 3094), (DEFAULT, 321, 3000000000, 3000000000), (DEFAULT, 322, 3094, 3094), (DEFAULT, 323, 3000000000, 3000000000), (DEFAULT, 324, 3094, 3094), (DEFAULT, 325, 3000000000, 3000000000), (DEFAULT, 326, 3094, 3094), (DEFAULT, 327, 3000000000, 3000000000), (DEFAULT, 328, 3094, 3094), (DEFAULT, 329, 3000000000, 3000000000), (DEFAULT, 330, 3094, 3094), (DEFAULT, 331, 3000000000, 3000000000), (DEFAULT, 332, 3094, 3094), (DEFAULT, 333, 3000000000, 3000000000), (DEFAULT, 334, 3094, 3094), (DEFAULT, 335, 3000000000, 3000000000), (DEFAULT, 336, 3094, 3094), (DEFAULT, 337, 3000000000, 3000000000), (DEFAULT, 338, 3094, 3094), (DEFAULT, 339, 3000000000, 3000000000), (DEFAULT, 340, 3094, 3094), (DEFAULT, 341, 3000000000, 3000000000), (DEFAULT, 342, 3094, 3094), (DEFAULT, 343, 3000000000, 3000000000), (DEFAULT, 344, 3094, 3094), (DEFAULT, 345, 3000000000, 3000000000), (DEFAULT, 346, 3094, 3094), (DEFAULT, 347, 3000000000, 3000000000), (DEFAULT, 348, 3094, 3094), (DEFAULT, 349, 3000000000, 3000000000), (DEFAULT, 350, 3094, 3094), (DEFAULT, 351, 3000000000, 3000000000), (DEFAULT, 352, 3094, 3094), (DEFAULT, 353, 3000000000, 3000000000), (DEFAULT, 354, 3094, 3094), (DEFAULT, 355, 3000000000, 3000000000), (DEFAULT, 356, 3094, 3094), (DEFAULT, 357, 3000000000, 3000000000), (DEFAULT, 358, 3094, 3094), (DEFAULT, 359, 3000000000, 3000000000), (DEFAULT, 360, 3094, 3094), (DEFAULT, 361, 3000000000, 3000000000), (DEFAULT, 362, 3094, 3094), (DEFAULT, 363, 3000000000, 3000000000), (DEFAULT, 364, 3094, 3094), (DEFAULT, 365, 3000000000, 3000000000), (DEFAULT, 366, 3094, 3094), (DEFAULT, 367, 3000000000, 3000000000), (DEFAULT, 368, 3094, 3094), (DEFAULT, 369, 3000000000, 3000000000), (DEFAULT, 370, 3094, 3094), (DEFAULT, 371, 3000000000, 3000000000), (DEFAULT, 372, 3094, 3094), (DEFAULT, 373, 3000000000, 3000000000), (DEFAULT, 374, 3094, 3094), (DEFAULT, 375, 3000000000, 3000000000), (DEFAULT, 376, 3094, 3094), (DEFAULT, 377, 3000000000, 3000000000), (DEFAULT, 378, 3094, 3094), (DEFAULT, 379, 3000000000, 3000000000), (DEFAULT, 380, 3094, 3094), (DEFAULT, 381, 3000000000, 3000000000), (DEFAULT, 382, 3094, 3094), (DEFAULT, 383, 3000000000, 3000000000), (DEFAULT, 384, 3094, 3094), (DEFAULT, 385, 3000000000, 3000000000), (DEFAULT, 386, 3094, 3094), (DEFAULT, 387, 3000000000, 3000000000), (DEFAULT, 388, 3094, 3094), (DEFAULT, 389, 3000000000, 3000000000), (DEFAULT, 390, 3094, 3094), (DEFAULT, 391, 3000000000, 3000000000), (DEFAULT, 392, 3094, 3094), (DEFAULT, 393, 3000000000, 3000000000), (DEFAULT, 394, 3094, 3094), (DEFAULT, 395, 3000000000, 3000000000), (DEFAULT, 396, 3094, 3094), (DEFAULT, 397, 3000000000, 3000000000), (DEFAULT, 398, 3094, 3094), (DEFAULT, 399, 3000000000, 3000000000), (DEFAULT, 400, 3094, 3094), (DEFAULT, 401, 3000000000, 3000000000), (DEFAULT, 402, 3094, 3094), (DEFAULT, 403, 3000000000, 3000000000), (DEFAULT, 404, 3094, 3094), (DEFAULT, 405, 3000000000, 3000000000), (DEFAULT, 406, 3094, 3094), (DEFAULT, 407, 3000000000, 3000000000), (DEFAULT, 408, 3094, 3094), (DEFAULT, 409, 3000000000, 3000000000), (DEFAULT, 410, 3094, 3094), (DEFAULT, 411, 3000000000, 3000000000), (DEFAULT, 412, 3094, 3094), (DEFAULT, 413, 3000000000, 3000000000), (DEFAULT, 414, 3094, 3094), (DEFAULT, 415, 3000000000, 3000000000), (DEFAULT, 416, 3094, 3094), (DEFAULT, 417, 3000000000, 3000000000), (DEFAULT, 418, 3094, 3094), (DEFAULT, 419, 3000000000, 3000000000), (DEFAULT, 420, 3094, 3094), (DEFAULT, 421, 3000000000, 3000000000), (DEFAULT, 422, 3094, 3094), (DEFAULT, 423, 3000000000, 3000000000), (DEFAULT, 424, 3094, 3094), (DEFAULT, 425, 3000000000, 3000000000), (DEFAULT, 426, 3094, 3094), (DEFAULT, 427, 3000000000, 3000000000), (DEFAULT, 428, 3094, 3094), (DEFAULT, 429, 3000000000, 3000000000), (DEFAULT, 430, 3094, 3094), (DEFAULT, 431, 3000000000, 3000000000), (DEFAULT, 432, 3094, 3094), (DEFAULT, 433, 3000000000, 3000000000), (DEFAULT, 434, 3094, 3094), (DEFAULT, 435, 3000000000, 3000000000), (DEFAULT, 436, 3094, 3094), (DEFAULT, 437, 3000000000, 3000000000), (DEFAULT, 438, 3094, 3094), (DEFAULT, 439, 3000000000, 3000000000), (DEFAULT, 440, 3094, 3094), (DEFAULT, 441, 3000000000, 3000000000), (DEFAULT, 442, 3094, 3094), (DEFAULT, 443, 3000000000, 3000000000), (DEFAULT, 444, 3094, 3094), (DEFAULT, 445, 3000000000, 3000000000), (DEFAULT, 446, 3094, 3094), (DEFAULT, 447, 3000000000, 3000000000), (DEFAULT, 448, 3094, 3094), (DEFAULT, 449, 3000000000, 3000000000), (DEFAULT, 450, 3094, 3094), (DEFAULT, 451, 3000000000, 3000000000), (DEFAULT, 452, 3094, 3094), (DEFAULT, 453, 3000000000, 3000000000), (DEFAULT, 454, 3094, 3094), (DEFAULT, 455, 3000000000, 3000000000), (DEFAULT, 456, 3094, 3094), (DEFAULT, 457, 3000000000, 3000000000), (DEFAULT, 458, 3094, 3094), (DEFAULT, 459, 3000000000, 3000000000), (DEFAULT, 460, 3094, 3094), (DEFAULT, 461, 3000000000, 3000000000), (DEFAULT, 462, 3094, 3094), (DEFAULT, 463, 3000000000, 3000000000), (DEFAULT, 464, 3094, 3094), (DEFAULT, 465, 3000000000, 3000000000), (DEFAULT, 466, 3094, 3094), (DEFAULT, 467, 3000000000, 3000000000), (DEFAULT, 468, 3094, 3094), (DEFAULT, 469, 3000000000, 3000000000), (DEFAULT, 470, 3094, 3094), (DEFAULT, 471, 3000000000, 3000000000), (DEFAULT, 472, 3094, 3094), (DEFAULT, 473, 3000000000, 3000000000), (DEFAULT, 474, 3094, 3094), (DEFAULT, 475, 3000000000, 3000000000);
 INSERT INTO resource_monitoring.resource_availability VALUES (DEFAULT, 0, TRUE), (DEFAULT, 1, TRUE), (DEFAULT, 2, TRUE), (DEFAULT, 3, TRUE), (DEFAULT, 4, TRUE), (DEFAULT, 5, TRUE), (DEFAULT, 6, TRUE), (DEFAULT, 7, TRUE), (DEFAULT, 8, TRUE), (DEFAULT, 9, TRUE), (DEFAULT, 10, TRUE), (DEFAULT, 11, TRUE), (DEFAULT, 12, TRUE), (DEFAULT, 13, TRUE), (DEFAULT, 14, TRUE), (DEFAULT, 15, TRUE), (DEFAULT, 16, TRUE), (DEFAULT, 17, TRUE), (DEFAULT, 18, TRUE), (DEFAULT, 19, TRUE), (DEFAULT, 20, TRUE), (DEFAULT, 21, TRUE), (DEFAULT, 22, TRUE), (DEFAULT, 23, TRUE), (DEFAULT, 24, TRUE), (DEFAULT, 25, TRUE), (DEFAULT, 26, TRUE), (DEFAULT, 27, TRUE), (DEFAULT, 28, TRUE), (DEFAULT, 29, TRUE), (DEFAULT, 30, TRUE), (DEFAULT, 31, TRUE), (DEFAULT, 32, TRUE), (DEFAULT, 33, TRUE), (DEFAULT, 34, TRUE), (DEFAULT, 35, TRUE), (DEFAULT, 36, TRUE), (DEFAULT, 37, TRUE), (DEFAULT, 38, TRUE), (DEFAULT, 39, TRUE), (DEFAULT, 40, TRUE), (DEFAULT, 41, TRUE), (DEFAULT, 42, TRUE), (DEFAULT, 43, TRUE), (DEFAULT, 44, TRUE), (DEFAULT, 45, TRUE), (DEFAULT, 46, TRUE), (DEFAULT, 47, TRUE), (DEFAULT, 48, TRUE), (DEFAULT, 49, TRUE), (DEFAULT, 50, TRUE), (DEFAULT, 51, TRUE), (DEFAULT, 52, TRUE), (DEFAULT, 53, TRUE), (DEFAULT, 54, TRUE), (DEFAULT, 55, TRUE), (DEFAULT, 56, TRUE), (DEFAULT, 57, TRUE), (DEFAULT, 58, TRUE), (DEFAULT, 59, TRUE), (DEFAULT, 60, TRUE), (DEFAULT, 61, TRUE), (DEFAULT, 62, TRUE), (DEFAULT, 63, TRUE), (DEFAULT, 64, TRUE), (DEFAULT, 65, TRUE), (DEFAULT, 66, TRUE), (DEFAULT, 67, TRUE), (DEFAULT, 68, TRUE), (DEFAULT, 69, TRUE), (DEFAULT, 70, TRUE), (DEFAULT, 71, TRUE), (DEFAULT, 72, TRUE), (DEFAULT, 73, TRUE), (DEFAULT, 74, TRUE), (DEFAULT, 75, TRUE), (DEFAULT, 76, TRUE), (DEFAULT, 77, TRUE), (DEFAULT, 78, TRUE), (DEFAULT, 79, TRUE), (DEFAULT, 80, TRUE), (DEFAULT, 81, TRUE), (DEFAULT, 82, TRUE), (DEFAULT, 83, TRUE), (DEFAULT, 84, TRUE), (DEFAULT, 85, TRUE), (DEFAULT, 86, TRUE), (DEFAULT, 87, TRUE), (DEFAULT, 88, TRUE), (DEFAULT, 89, TRUE), (DEFAULT, 90, TRUE), (DEFAULT, 91, TRUE), (DEFAULT, 92, TRUE), (DEFAULT, 93, TRUE), (DEFAULT, 94, TRUE), (DEFAULT, 95, TRUE), (DEFAULT, 96, TRUE), (DEFAULT, 97, TRUE), (DEFAULT, 98, TRUE), (DEFAULT, 99, TRUE), (DEFAULT, 100, TRUE), (DEFAULT, 101, TRUE), (DEFAULT, 102, TRUE), (DEFAULT, 103, TRUE), (DEFAULT, 104, TRUE), (DEFAULT, 105, TRUE), (DEFAULT, 106, TRUE), (DEFAULT, 107, TRUE), (DEFAULT, 108, TRUE), (DEFAULT, 109, TRUE), (DEFAULT, 110, TRUE), (DEFAULT, 111, TRUE), (DEFAULT, 112, TRUE), (DEFAULT, 113, TRUE), (DEFAULT, 114, TRUE), (DEFAULT, 115, TRUE), (DEFAULT, 116, TRUE), (DEFAULT, 117, TRUE), (DEFAULT, 118, TRUE), (DEFAULT, 119, FALSE), (DEFAULT, 120, TRUE), (DEFAULT, 121, TRUE), (DEFAULT, 122, TRUE), (DEFAULT, 123, TRUE), (DEFAULT, 124, TRUE), (DEFAULT, 125, TRUE), (DEFAULT, 126, TRUE), (DEFAULT, 127, TRUE), (DEFAULT, 128, TRUE), (DEFAULT, 129, TRUE), (DEFAULT, 130, TRUE), (DEFAULT, 131, TRUE), (DEFAULT, 132, TRUE), (DEFAULT, 133, TRUE), (DEFAULT, 134, TRUE), (DEFAULT, 135, TRUE), (DEFAULT, 136, TRUE), (DEFAULT, 137, TRUE), (DEFAULT, 138, TRUE), (DEFAULT, 139, TRUE), (DEFAULT, 140, TRUE), (DEFAULT, 141, TRUE), (DEFAULT, 142, TRUE), (DEFAULT, 143, TRUE), (DEFAULT, 144, TRUE), (DEFAULT, 145, TRUE), (DEFAULT, 146, TRUE), (DEFAULT, 147, TRUE), (DEFAULT, 148, TRUE), (DEFAULT, 149, TRUE), (DEFAULT, 150, TRUE), (DEFAULT, 151, TRUE), (DEFAULT, 152, TRUE), (DEFAULT, 153, TRUE), (DEFAULT, 154, TRUE), (DEFAULT, 155, TRUE), (DEFAULT, 156, TRUE), (DEFAULT, 157, TRUE), (DEFAULT, 158, TRUE), (DEFAULT, 159, TRUE), (DEFAULT, 160, TRUE), (DEFAULT, 161, TRUE), (DEFAULT, 162, TRUE), (DEFAULT, 163, TRUE), (DEFAULT, 164, TRUE), (DEFAULT, 165, TRUE), (DEFAULT, 166, TRUE), (DEFAULT, 167, TRUE), (DEFAULT, 168, TRUE), (DEFAULT, 169, TRUE), (DEFAULT, 170, TRUE), (DEFAULT, 171, TRUE), (DEFAULT, 172, TRUE), (DEFAULT, 173, TRUE), (DEFAULT, 174, TRUE), (DEFAULT, 175, TRUE), (DEFAULT, 176, TRUE), (DEFAULT, 177, TRUE), (DEFAULT, 178, TRUE), (DEFAULT, 179, TRUE), (DEFAULT, 180, TRUE), (DEFAULT, 181, TRUE), (DEFAULT, 182, TRUE), (DEFAULT, 183, TRUE), (DEFAULT, 184, TRUE), (DEFAULT, 185, TRUE), (DEFAULT, 186, TRUE), (DEFAULT, 187, TRUE), (DEFAULT, 188, TRUE), (DEFAULT, 189, TRUE), (DEFAULT, 190, TRUE), (DEFAULT, 191, TRUE), (DEFAULT, 192, TRUE), (DEFAULT, 193, TRUE), (DEFAULT, 194, TRUE), (DEFAULT, 195, TRUE), (DEFAULT, 196, TRUE), (DEFAULT, 197, TRUE), (DEFAULT, 198, TRUE), (DEFAULT, 199, TRUE), (DEFAULT, 200, TRUE), (DEFAULT, 201, TRUE), (DEFAULT, 202, FALSE), (DEFAULT, 203, FALSE), (DEFAULT, 204, TRUE), (DEFAULT, 205, TRUE), (DEFAULT, 206, FALSE), (DEFAULT, 207, FALSE), (DEFAULT, 208, TRUE), (DEFAULT, 209, TRUE), (DEFAULT, 210, FALSE), (DEFAULT, 211, FALSE), (DEFAULT, 212, TRUE), (DEFAULT, 213, TRUE), (DEFAULT, 214, TRUE), (DEFAULT, 215, TRUE), (DEFAULT, 216, TRUE), (DEFAULT, 217, TRUE), (DEFAULT, 218, TRUE), (DEFAULT, 219, TRUE), (DEFAULT, 220, TRUE), (DEFAULT, 221, TRUE), (DEFAULT, 222, TRUE), (DEFAULT, 223, TRUE), (DEFAULT, 224, TRUE), (DEFAULT, 225, TRUE), (DEFAULT, 226, TRUE), (DEFAULT, 227, TRUE), (DEFAULT, 228, TRUE), (DEFAULT, 229, TRUE), (DEFAULT, 230, TRUE), (DEFAULT, 231, TRUE), (DEFAULT, 232, TRUE), (DEFAULT, 233, TRUE), (DEFAULT, 234, TRUE), (DEFAULT, 235, TRUE), (DEFAULT, 236, TRUE), (DEFAULT, 237, TRUE), (DEFAULT, 238, TRUE), (DEFAULT, 239, TRUE), (DEFAULT, 240, TRUE), (DEFAULT, 241, TRUE), (DEFAULT, 242, TRUE), (DEFAULT, 243, TRUE), (DEFAULT, 244, TRUE), (DEFAULT, 245, TRUE), (DEFAULT, 246, TRUE), (DEFAULT, 247, TRUE), (DEFAULT, 248, TRUE), (DEFAULT, 249, TRUE), (DEFAULT, 250, TRUE), (DEFAULT, 251, TRUE), (DEFAULT, 252, TRUE), (DEFAULT, 253, TRUE), (DEFAULT, 254, TRUE), (DEFAULT, 255, TRUE), (DEFAULT, 256, TRUE), (DEFAULT, 257, TRUE), (DEFAULT, 258, TRUE), (DEFAULT, 259, TRUE), (DEFAULT, 260, TRUE), (DEFAULT, 261, TRUE), (DEFAULT, 262, TRUE), (DEFAULT, 263, TRUE), (DEFAULT, 264, TRUE), (DEFAULT, 265, TRUE), (DEFAULT, 266, TRUE), (DEFAULT, 267, TRUE), (DEFAULT, 268, TRUE), (DEFAULT, 269, TRUE), (DEFAULT, 270, TRUE), (DEFAULT, 271, TRUE), (DEFAULT, 272, TRUE), (DEFAULT, 273, TRUE), (DEFAULT, 274, TRUE), (DEFAULT, 275, TRUE), (DEFAULT, 276, TRUE), (DEFAULT, 277, TRUE), (DEFAULT, 278, TRUE), (DEFAULT, 279, TRUE), (DEFAULT, 280, TRUE), (DEFAULT, 281, TRUE), (DEFAULT, 282, TRUE), (DEFAULT, 283, TRUE), (DEFAULT, 284, TRUE), (DEFAULT, 285, TRUE), (DEFAULT, 286, TRUE), (DEFAULT, 287, TRUE), (DEFAULT, 288, TRUE), (DEFAULT, 289, TRUE), (DEFAULT, 290, TRUE), (DEFAULT, 291, TRUE), (DEFAULT, 292, TRUE), (DEFAULT, 293, TRUE), (DEFAULT, 294, TRUE), (DEFAULT, 295, TRUE), (DEFAULT, 296, TRUE), (DEFAULT, 297, TRUE), (DEFAULT, 298, TRUE), (DEFAULT, 299, TRUE), (DEFAULT, 300, TRUE), (DEFAULT, 301, TRUE), (DEFAULT, 302, TRUE), (DEFAULT, 303, TRUE), (DEFAULT, 304, TRUE), (DEFAULT, 305, TRUE), (DEFAULT, 306, TRUE), (DEFAULT, 307, TRUE), (DEFAULT, 308, TRUE), (DEFAULT, 309, TRUE), (DEFAULT, 310, TRUE), (DEFAULT, 311, TRUE), (DEFAULT, 312, TRUE), (DEFAULT, 313, TRUE), (DEFAULT, 314, TRUE), (DEFAULT, 315, TRUE), (DEFAULT, 316, TRUE), (DEFAULT, 317, TRUE), (DEFAULT, 318, TRUE), (DEFAULT, 319, TRUE), (DEFAULT, 320, TRUE), (DEFAULT, 321, TRUE), (DEFAULT, 322, TRUE), (DEFAULT, 323, TRUE), (DEFAULT, 324, TRUE), (DEFAULT, 325, TRUE), (DEFAULT, 326, TRUE), (DEFAULT, 327, TRUE), (DEFAULT, 328, TRUE), (DEFAULT, 329, TRUE), (DEFAULT, 330, TRUE), (DEFAULT, 331, TRUE), (DEFAULT, 332, TRUE), (DEFAULT, 333, TRUE), (DEFAULT, 334, TRUE), (DEFAULT, 335, TRUE), (DEFAULT, 336, TRUE), (DEFAULT, 337, TRUE), (DEFAULT, 338, TRUE), (DEFAULT, 339, TRUE), (DEFAULT, 340, TRUE), (DEFAULT, 341, TRUE), (DEFAULT, 342, TRUE), (DEFAULT, 343, TRUE), (DEFAULT, 344, TRUE), (DEFAULT, 345, TRUE), (DEFAULT, 346, TRUE), (DEFAULT, 347, TRUE), (DEFAULT, 348, TRUE), (DEFAULT, 349, TRUE), (DEFAULT, 350, TRUE), (DEFAULT, 351, TRUE), (DEFAULT, 352, TRUE), (DEFAULT, 353, TRUE), (DEFAULT, 354, TRUE), (DEFAULT, 355, TRUE), (DEFAULT, 356, TRUE), (DEFAULT, 357, TRUE), (DEFAULT, 358, TRUE), (DEFAULT, 359, TRUE), (DEFAULT, 360, TRUE), (DEFAULT, 361, TRUE), (DEFAULT, 362, TRUE), (DEFAULT, 363, TRUE), (DEFAULT, 364, TRUE), (DEFAULT, 365, TRUE), (DEFAULT, 366, TRUE), (DEFAULT, 367, TRUE), (DEFAULT, 368, TRUE), (DEFAULT, 369, TRUE), (DEFAULT, 370, TRUE), (DEFAULT, 371, TRUE), (DEFAULT, 372, TRUE), (DEFAULT, 373, TRUE), (DEFAULT, 374, TRUE), (DEFAULT, 375, TRUE), (DEFAULT, 376, TRUE), (DEFAULT, 377, TRUE), (DEFAULT, 378, TRUE), (DEFAULT, 379, TRUE), (DEFAULT, 380, TRUE), (DEFAULT, 381, TRUE), (DEFAULT, 382, TRUE), (DEFAULT, 383, TRUE), (DEFAULT, 384, TRUE), (DEFAULT, 385, TRUE), (DEFAULT, 386, TRUE), (DEFAULT, 387, TRUE), (DEFAULT, 388, TRUE), (DEFAULT, 389, TRUE), (DEFAULT, 390, TRUE), (DEFAULT, 391, TRUE), (DEFAULT, 392, TRUE), (DEFAULT, 393, TRUE), (DEFAULT, 394, TRUE), (DEFAULT, 395, TRUE), (DEFAULT, 396, TRUE), (DEFAULT, 397, TRUE), (DEFAULT, 398, TRUE), (DEFAULT, 399, TRUE), (DEFAULT, 400, TRUE), (DEFAULT, 401, TRUE), (DEFAULT, 402, TRUE), (DEFAULT, 403, TRUE), (DEFAULT, 404, TRUE), (DEFAULT, 405, TRUE), (DEFAULT, 406, TRUE), (DEFAULT, 407, TRUE), (DEFAULT, 408, TRUE), (DEFAULT, 409, TRUE), (DEFAULT, 410, TRUE), (DEFAULT, 411, TRUE), (DEFAULT, 412, TRUE), (DEFAULT, 413, TRUE), (DEFAULT, 414, TRUE), (DEFAULT, 415, TRUE), (DEFAULT, 416, TRUE), (DEFAULT, 417, TRUE), (DEFAULT, 418, TRUE), (DEFAULT, 419, TRUE), (DEFAULT, 420, TRUE), (DEFAULT, 421, TRUE), (DEFAULT, 422, TRUE), (DEFAULT, 423, TRUE), (DEFAULT, 424, TRUE), (DEFAULT, 425, TRUE), (DEFAULT, 426, TRUE), (DEFAULT, 427, TRUE), (DEFAULT, 428, TRUE), (DEFAULT, 429, TRUE), (DEFAULT, 430, TRUE), (DEFAULT, 431, TRUE), (DEFAULT, 432, TRUE), (DEFAULT, 433, TRUE), (DEFAULT, 434, TRUE), (DEFAULT, 435, TRUE), (DEFAULT, 436, TRUE), (DEFAULT, 437, TRUE), (DEFAULT, 438, TRUE), (DEFAULT, 439, TRUE), (DEFAULT, 440, TRUE), (DEFAULT, 441, TRUE), (DEFAULT, 442, TRUE), (DEFAULT, 443, TRUE), (DEFAULT, 444, TRUE), (DEFAULT, 445, TRUE), (DEFAULT, 446, TRUE), (DEFAULT, 447, TRUE), (DEFAULT, 448, TRUE), (DEFAULT, 449, TRUE), (DEFAULT, 450, TRUE), (DEFAULT, 451, TRUE), (DEFAULT, 452, TRUE), (DEFAULT, 453, TRUE), (DEFAULT, 454, TRUE), (DEFAULT, 455, TRUE), (DEFAULT, 456, TRUE), (DEFAULT, 457, TRUE), (DEFAULT, 458, TRUE), (DEFAULT, 459, TRUE), (DEFAULT, 460, TRUE), (DEFAULT, 461, TRUE), (DEFAULT, 462, TRUE), (DEFAULT, 463, TRUE), (DEFAULT, 464, TRUE), (DEFAULT, 465, TRUE), (DEFAULT, 466, TRUE), (DEFAULT, 467, TRUE), (DEFAULT, 468, TRUE), (DEFAULT, 469, TRUE), (DEFAULT, 470, TRUE), (DEFAULT, 471, TRUE), (DEFAULT, 472, TRUE), (DEFAULT, 473, TRUE), (DEFAULT, 474, TRUE), (DEFAULT, 475, TRUE);
 INSERT INTO virtual_instrument.resource_group_to_resource_group VALUES (DEFAULT, 156, 135), (DEFAULT, 157, 135), (DEFAULT, 158, 135), (DEFAULT, 159, 135), (DEFAULT, 160, 135), (DEFAULT, 161, 135), (DEFAULT, 162, 135), (DEFAULT, 163, 135), (DEFAULT, 164, 135), (DEFAULT, 165, 135), (DEFAULT, 166, 135), (DEFAULT, 167, 135), (DEFAULT, 168, 135), (DEFAULT, 169, 135), (DEFAULT, 170, 135), (DEFAULT, 171, 135), (DEFAULT, 172, 135), (DEFAULT, 173, 136), (DEFAULT, 174, 136), (DEFAULT, 175, 136), (DEFAULT, 176, 136), (DEFAULT, 177, 136), (DEFAULT, 178, 136), (DEFAULT, 179, 136), (DEFAULT, 180, 136), (DEFAULT, 181, 136), (DEFAULT, 182, 136), (DEFAULT, 183, 136), (DEFAULT, 184, 136), (DEFAULT, 185, 136), (DEFAULT, 186, 136), (DEFAULT, 187, 136), (DEFAULT, 188, 137), (DEFAULT, 189, 137), (DEFAULT, 190, 137), (DEFAULT, 191, 137), (DEFAULT, 192, 137), (DEFAULT, 193, 137), (DEFAULT, 194, 137), (DEFAULT, 195, 137), (DEFAULT, 196, 137), (DEFAULT, 197, 137), (DEFAULT, 198, 137), (DEFAULT, 199, 137), (DEFAULT, 200, 137), (DEFAULT, 201, 137), (DEFAULT, 202, 137), (DEFAULT, 206, 149), (DEFAULT, 207, 149), (DEFAULT, 208, 150), (DEFAULT, 209, 150), (DEFAULT, 210, 151), (DEFAULT, 211, 151), (DEFAULT, 212, 152), (DEFAULT, 213, 152), (DEFAULT, 214, 153), (DEFAULT, 215, 153), (DEFAULT, 216, 154), (DEFAULT, 217, 154), (DEFAULT, 218, 155), (DEFAULT, 219, 155), (DEFAULT, 220, 156), (DEFAULT, 221, 156), (DEFAULT, 222, 157), (DEFAULT, 223, 157), (DEFAULT, 224, 158), (DEFAULT, 225, 158), (DEFAULT, 226, 159), (DEFAULT, 227, 159), (DEFAULT, 228, 160), (DEFAULT, 229, 160), (DEFAULT, 230, 161), (DEFAULT, 231, 161), (DEFAULT, 232, 162), (DEFAULT, 233, 162), (DEFAULT, 234, 163), (DEFAULT, 235, 163), (DEFAULT, 236, 164), (DEFAULT, 237, 164), (DEFAULT, 238, 165), (DEFAULT, 239, 165), (DEFAULT, 240, 166), (DEFAULT, 241, 166), (DEFAULT, 242, 167), (DEFAULT, 243, 167), (DEFAULT, 244, 168), (DEFAULT, 245, 168), (DEFAULT, 246, 169), (DEFAULT, 247, 169), (DEFAULT, 248, 170), (DEFAULT, 249, 170), (DEFAULT, 250, 171), (DEFAULT, 251, 171), (DEFAULT, 252, 172), (DEFAULT, 253, 172), (DEFAULT, 254, 173), (DEFAULT, 255, 174), (DEFAULT, 256, 175), (DEFAULT, 257, 176), (DEFAULT, 258, 177), (DEFAULT, 259, 178), (DEFAULT, 260, 179), (DEFAULT, 261, 180), (DEFAULT, 262, 181), (DEFAULT, 263, 182), (DEFAULT, 264, 183), (DEFAULT, 265, 184), (DEFAULT, 266, 185), (DEFAULT, 267, 186), (DEFAULT, 268, 187), (DEFAULT, 269, 188), (DEFAULT, 270, 189), (DEFAULT, 271, 190), (DEFAULT, 272, 191), (DEFAULT, 273, 192), (DEFAULT, 274, 193), (DEFAULT, 275, 194), (DEFAULT, 276, 195), (DEFAULT, 277, 196), (DEFAULT, 278, 197), (DEFAULT, 279, 198), (DEFAULT, 280, 199), (DEFAULT, 281, 200), (DEFAULT, 282, 201), (DEFAULT, 283, 202), (DEFAULT, 149, 138), (DEFAULT, 150, 138), (DEFAULT, 151, 138), (DEFAULT, 152, 138), (DEFAULT, 153, 138), (DEFAULT, 154, 138), (DEFAULT, 155, 141), (DEFAULT, 156, 141), (DEFAULT, 157, 141), (DEFAULT, 158, 141), (DEFAULT, 159, 141), (DEFAULT, 160, 141), (DEFAULT, 161, 141), (DEFAULT, 162, 141), (DEFAULT, 163, 141), (DEFAULT, 164, 141), (DEFAULT, 165, 141), (DEFAULT, 166, 141), (DEFAULT, 167, 141), (DEFAULT, 168, 141), (DEFAULT, 169, 141), (DEFAULT, 170, 141), (DEFAULT, 171, 141), (DEFAULT, 172, 141), (DEFAULT, 149, 143), (DEFAULT, 150, 143), (DEFAULT, 151, 143), (DEFAULT, 152, 143), (DEFAULT, 153, 143), (DEFAULT, 154, 143), (DEFAULT, 156, 143), (DEFAULT, 157, 143), (DEFAULT, 158, 143), (DEFAULT, 159, 143), (DEFAULT, 165, 143), (DEFAULT, 149, 144), (DEFAULT, 150, 144), (DEFAULT, 151, 144), (DEFAULT, 152, 144), (DEFAULT, 153, 144), (DEFAULT, 154, 144), (DEFAULT, 155, 144), (DEFAULT, 156, 144), (DEFAULT, 157, 144), (DEFAULT, 158, 144), (DEFAULT, 159, 144), (DEFAULT, 160, 144), (DEFAULT, 161, 144), (DEFAULT, 162, 144), (DEFAULT, 163, 144), (DEFAULT, 164, 144), (DEFAULT, 165, 144), (DEFAULT, 166, 144), (DEFAULT, 168, 144), (DEFAULT, 169, 144), (DEFAULT, 171, 144), (DEFAULT, 172, 144), (DEFAULT, 172, 139), (DEFAULT, 149, 140), (DEFAULT, 149, 139), (DEFAULT, 150, 140), (DEFAULT, 150, 139), (DEFAULT, 151, 140), (DEFAULT, 151, 139), (DEFAULT, 152, 140), (DEFAULT, 152, 139), (DEFAULT, 153, 140), (DEFAULT, 153, 139), (DEFAULT, 154, 140), (DEFAULT, 154, 139), (DEFAULT, 155, 140), (DEFAULT, 155, 139), (DEFAULT, 156, 140), (DEFAULT, 156, 139), (DEFAULT, 157, 140), (DEFAULT, 157, 139), (DEFAULT, 158, 140), (DEFAULT, 158, 139), (DEFAULT, 159, 140), (DEFAULT, 159, 139), (DEFAULT, 160, 140), (DEFAULT, 160, 139), (DEFAULT, 161, 140), (DEFAULT, 161, 139), (DEFAULT, 162, 140), (DEFAULT, 162, 139), (DEFAULT, 163, 140), (DEFAULT, 163, 139), (DEFAULT, 164, 140), (DEFAULT, 164, 139), (DEFAULT, 165, 140), (DEFAULT, 165, 139), (DEFAULT, 166, 140), (DEFAULT, 166, 139), (DEFAULT, 167, 140), (DEFAULT, 167, 139), (DEFAULT, 168, 140), (DEFAULT, 168, 139), (DEFAULT, 169, 140), (DEFAULT, 169, 139), (DEFAULT, 170, 140), (DEFAULT, 170, 139), (DEFAULT, 171, 140), (DEFAULT, 171, 139), (DEFAULT, 172, 140), (DEFAULT, 172, 139), (DEFAULT, 173, 140), (DEFAULT, 173, 139), (DEFAULT, 174, 140), (DEFAULT, 174, 139), (DEFAULT, 175, 140), (DEFAULT, 175, 139), (DEFAULT, 176, 140), (DEFAULT, 176, 139), (DEFAULT, 177, 140), (DEFAULT, 177, 139), (DEFAULT, 178, 140), (DEFAULT, 178, 139), (DEFAULT, 179, 140), (DEFAULT, 179, 139), (DEFAULT, 180, 140), (DEFAULT, 180, 139), (DEFAULT, 181, 140), (DEFAULT, 181, 139), (DEFAULT, 182, 140), (DEFAULT, 182, 139), (DEFAULT, 183, 140), (DEFAULT, 183, 139), (DEFAULT, 184, 140), (DEFAULT, 184, 139), (DEFAULT, 185, 140), (DEFAULT, 185, 139), (DEFAULT, 186, 140), (DEFAULT, 186, 139), (DEFAULT, 187, 140), (DEFAULT, 187, 139), (DEFAULT, 188, 137), (DEFAULT, 188, 139), (DEFAULT, 189, 137), (DEFAULT, 189, 139), (DEFAULT, 190, 137), (DEFAULT, 190, 139), (DEFAULT, 191, 137), (DEFAULT, 191, 139), (DEFAULT, 192, 137), (DEFAULT, 192, 139), (DEFAULT, 193, 137), (DEFAULT, 193, 139), (DEFAULT, 194, 137), (DEFAULT, 194, 139), (DEFAULT, 195, 137), (DEFAULT, 195, 139), (DEFAULT, 196, 137), (DEFAULT, 196, 139), (DEFAULT, 197, 137), (DEFAULT, 197, 139), (DEFAULT, 198, 137), (DEFAULT, 198, 139), (DEFAULT, 199, 137), (DEFAULT, 199, 139), (DEFAULT, 200, 137), (DEFAULT, 200, 139), (DEFAULT, 201, 137), (DEFAULT, 201, 139), (DEFAULT, 202, 137), (DEFAULT, 0, NULL), (DEFAULT, 1, 0), (DEFAULT, 2, 0), (DEFAULT, 63, 0), (DEFAULT, 3, 1), (DEFAULT, 4, 1), (DEFAULT, 64, 63), (DEFAULT, 65, 63), (DEFAULT, 135, 0), (DEFAULT, 136, 0), (DEFAULT, 137, 0), (DEFAULT, 138, 0), (DEFAULT, 139, 0), (DEFAULT, 140, 0), (DEFAULT, 141, 0), (DEFAULT, 142, 0), (DEFAULT, 143, 0), (DEFAULT, 144, 0), (DEFAULT, 145, 0), (DEFAULT, 5, 3), (DEFAULT, 6, 3), (DEFAULT, 7, 3), (DEFAULT, 8, 3), (DEFAULT, 9, 3), (DEFAULT, 10, 3), (DEFAULT, 11, 3), (DEFAULT, 12, 3), (DEFAULT, 13, 3), (DEFAULT, 14, 3), (DEFAULT, 15, 3), (DEFAULT, 16, 3), (DEFAULT, 17, 3), (DEFAULT, 18, 3), (DEFAULT, 19, 3), (DEFAULT, 20, 3), (DEFAULT, 21, 3), (DEFAULT, 22, 3), (DEFAULT, 23, 3), (DEFAULT, 24, 3), (DEFAULT, 25, 3), (DEFAULT, 26, 3), (DEFAULT, 27, 3), (DEFAULT, 28, 3), (DEFAULT, 29, 3), (DEFAULT, 30, 3), (DEFAULT, 31, 3), (DEFAULT, 32, 3), (DEFAULT, 33, 3), (DEFAULT, 34, 3), (DEFAULT, 35, 3), (DEFAULT, 36, 3), (DEFAULT, 37, 3), (DEFAULT, 38, 3), (DEFAULT, 39, 3), (DEFAULT, 40, 3), (DEFAULT, 41, 3), (DEFAULT, 42, 3), (DEFAULT, 43, 3), (DEFAULT, 44, 3), (DEFAULT, 45, 3), (DEFAULT, 46, 3), (DEFAULT, 47, 3), (DEFAULT, 48, 3), (DEFAULT, 49, 3), (DEFAULT, 50, 3), (DEFAULT, 51, 3), (DEFAULT, 52, 3), (DEFAULT, 53, 3), (DEFAULT, 54, 3), (DEFAULT, 55, 2), (DEFAULT, 56, 2), (DEFAULT, 57, 2), (DEFAULT, 58, 2), (DEFAULT, 59, 2), (DEFAULT, 60, 2), (DEFAULT, 61, 2), (DEFAULT, 62, 2), (DEFAULT, 66, 64), (DEFAULT, 67, 66), (DEFAULT, 68, 66), (DEFAULT, 69, 64), (DEFAULT, 70, 69), (DEFAULT, 71, 69), (DEFAULT, 72, 64), (DEFAULT, 73, 72), (DEFAULT, 74, 72), (DEFAULT, 75, 64), (DEFAULT, 76, 75), (DEFAULT, 77, 75), (DEFAULT, 78, 64), (DEFAULT, 79, 78), (DEFAULT, 80, 78), (DEFAULT, 81, 64), (DEFAULT, 82, 81), (DEFAULT, 83, 81), (DEFAULT, 84, 64), (DEFAULT, 85, 84), (DEFAULT, 86, 84), (DEFAULT, 87, 64), (DEFAULT, 88, 87), (DEFAULT, 89, 87), (DEFAULT, 90, 64), (DEFAULT, 91, 90), (DEFAULT, 92, 90), (DEFAULT, 93, 64), (DEFAULT, 94, 93), (DEFAULT, 95, 93), (DEFAULT, 96, 64), (DEFAULT, 97, 96), (DEFAULT, 98, 96), (DEFAULT, 99, 64), (DEFAULT, 100, 99), (DEFAULT, 101, 99), (DEFAULT, 102, 64), (DEFAULT, 103, 102), (DEFAULT, 104, 102), (DEFAULT, 105, 64), (DEFAULT, 106, 105), (DEFAULT, 107, 105), (DEFAULT, 108, 64), (DEFAULT, 109, 108), (DEFAULT, 110, 108), (DEFAULT, 111, 64), (DEFAULT, 112, 111), (DEFAULT, 113, 111), (DEFAULT, 114, 64), (DEFAULT, 115, 114), (DEFAULT, 116, 114), (DEFAULT, 117, 64), (DEFAULT, 118, 117), (DEFAULT, 119, 117), (DEFAULT, 120, 64), (DEFAULT, 121, 120), (DEFAULT, 122, 120), (DEFAULT, 123, 64), (DEFAULT, 124, 123), (DEFAULT, 125, 123), (DEFAULT, 126, 64), (DEFAULT, 127, 126), (DEFAULT, 128, 126), (DEFAULT, 129, 64), (DEFAULT, 130, 129), (DEFAULT, 131, 129), (DEFAULT, 132, 64), (DEFAULT, 133, 132), (DEFAULT, 134, 132), (DEFAULT, 149, 135), (DEFAULT, 150, 135), (DEFAULT, 151, 135), (DEFAULT, 152, 135), (DEFAULT, 153, 135), (DEFAULT, 154, 135), (DEFAULT, 155, 135);
 COMMIT;
diff --git a/SAS/ResourceAssignment/ResourceAssignmentDatabase/radb/sql/create_database.sql b/SAS/ResourceAssignment/ResourceAssignmentDatabase/radb/sql/create_database.sql
index 13332c92d7f9fea9875a44ff0288b81d223d082e..40337a9dc5f0bebe742f0ca55cda5d47dd44d6c9 100644
--- a/SAS/ResourceAssignment/ResourceAssignmentDatabase/radb/sql/create_database.sql
+++ b/SAS/ResourceAssignment/ResourceAssignmentDatabase/radb/sql/create_database.sql
@@ -251,6 +251,15 @@ CREATE INDEX resource_claim_resource_id_idx
 CREATE INDEX resource_claim_status_id_idx
   ON resource_allocation.resource_claim (status_id);
 
+CREATE TABLE resource_allocation._rebuild_usages_active_claims ( LIKE resource_allocation.resource_claim INCLUDING INDEXES INCLUDING CONSTRAINTS );
+DROP INDEX resource_allocation._rebuild_usages_active_claims_resource_id_idx; --remove unnecessary index
+DROP INDEX resource_allocation._rebuild_usages_active_claims_status_id_idx; --remove unnecessary index
+DROP INDEX resource_allocation._rebuild_usages_active_claims_task_id_idx; --remove unnecessary index
+ALTER TABLE resource_allocation._rebuild_usages_active_claims
+  OWNER TO resourceassignment;
+COMMENT ON TABLE resource_allocation._rebuild_usages_active_claims
+  IS 'helper table for the rebuild_resource_usages_from_claims_for_resource_of_status method.';
+
 CREATE TABLE resource_allocation.conflict_reason (
   id serial NOT NULL,
   reason text NOT NULL,
@@ -350,6 +359,14 @@ CREATE INDEX resource_usage_resource_id_idx
 CREATE INDEX resource_usage_status_id_idx
   ON resource_allocation.resource_usage (status_id);
 
+CREATE TABLE resource_allocation._rebuild_usages_active_usages ( LIKE resource_allocation.resource_usage INCLUDING INDEXES INCLUDING CONSTRAINTS );
+DROP INDEX resource_allocation._rebuild_usages_active_usages_status_id_idx; --remove unnecessary index
+DROP INDEX resource_allocation._rebuild_usages_active_usages_resource_id_idx;  --remove unnecessary index
+ALTER TABLE resource_allocation._rebuild_usages_active_usages
+  OWNER TO resourceassignment;
+COMMENT ON TABLE resource_allocation._rebuild_usages_active_usages
+  IS 'helper table for the rebuild_resource_usages_from_claims_for_resource_of_status method.';
+
 CREATE TABLE resource_monitoring.resource_availability (
   id serial NOT NULL,
   resource_id integer NOT NULL REFERENCES virtual_instrument.resource ON DELETE CASCADE DEFERRABLE INITIALLY IMMEDIATE,
diff --git a/SAS/ResourceAssignment/ResourceAssignmentDatabase/tests/radb_performance_test.py b/SAS/ResourceAssignment/ResourceAssignmentDatabase/tests/radb_performance_test.py
new file mode 100755
index 0000000000000000000000000000000000000000..300e97077358c0d3824f45b153b4a922a2e22a9c
--- /dev/null
+++ b/SAS/ResourceAssignment/ResourceAssignmentDatabase/tests/radb_performance_test.py
@@ -0,0 +1,113 @@
+#!/usr/bin/python
+
+# Copyright (C) 2012-2015    ASTRON (Netherlands Institute for Radio Astronomy)
+# P.O. Box 2, 7990 AA Dwingeloo, The Netherlands
+#
+# This file is part of the LOFAR software suite.
+# The LOFAR software suite 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 3 of the License, or
+# (at your option) any later version.
+#
+# The LOFAR software suite 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 the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
+
+# $Id:  $
+from optparse import OptionParser
+import os
+from datetime import datetime, timedelta
+import logging
+from random import randint
+
+logger = logging.getLogger(__name__)
+
+from lofar.common import dbcredentials
+from lofar.sas.resourceassignment.database.radb import RADatabase
+from lofar.common.datetimeutils import totalSeconds
+
+def test_resource_usages_performance(radb):
+    radb.updateResourceAvailability(117, available_capacity=10000000, total_capacity=10000000)
+
+    now = datetime.utcnow()
+    now -= timedelta(minutes=now.minute, seconds=now.second, microseconds=now.microsecond)  # round to full hour
+    spec_ids = []
+    filename = 'resource_usages_performance%s.csv' % (datetime.utcnow().strftime('%Y%m%dT%H%M%S'),)
+    with open(filename, 'w') as file:
+        file.write('#claims, elapsed_insert, elapsed_rebuild\n')
+        counter = 0
+        for k in range(20):
+            num_claims_to_insert = 20
+            num_insert_repeats = 10
+            elapsed_insert = 0
+            for i in range(num_insert_repeats):
+                counter += 1
+                result = radb.insertSpecificationAndTask(counter, counter, 'approved', 'observation',
+                                                         now+timedelta(hours=3*counter),
+                                                         now + timedelta(hours=1 + 3*counter),
+                                                         'content', 'CEP4')
+                task_id = result['task_id']
+                task = radb.getTask(task_id)
+                spec_ids.append(task['specification_id'])
+
+                claims = [{'resource_id': 117,
+                           'starttime': task['starttime']-timedelta(minutes=randint(0, 1800)),
+                           'endtime': task['starttime']+timedelta(seconds=randint(1801, 3600)),
+                           'status': 'tentative',
+                           'claim_size': q}
+                          for q in range(num_claims_to_insert)]
+
+                start = datetime.utcnow()
+                radb.insertResourceClaims(task_id, claims, 'foo', 1, 1)
+                elapsed_insert += totalSeconds(datetime.utcnow() - start)
+            elapsed_insert /= 10
+
+            start = datetime.utcnow()
+            # make sure the usage table is wiped, so asserts fail when rebuild_resource_usages_from_claims is erroneously roll'ed back.
+            radb.rebuild_resource_usages_from_claims(117, 'tentative')
+            elapsed_rebuild = totalSeconds(datetime.utcnow() - start)
+
+            logger.info('TEST RESULT: radb now contains %d claims, insert of %d claims takes on average %.3fsec and a rebuild of the whole usage table takes %.3fsec',
+                        len(radb.getResourceClaims()), num_claims_to_insert, elapsed_insert, elapsed_rebuild)
+            file.write('%d, %.3f, %.3f\n' % (len(radb.getResourceClaims()), elapsed_insert, elapsed_rebuild))
+            file.flush()
+
+    logger.info('removing all test specs/tasks/claims from db')
+
+    for spec_id in spec_ids:
+        radb.deleteSpecification(spec_id)
+
+    logger.info('Done. Results can be found in file: %s', filename)
+
+if __name__ == '__main__':
+    logging.basicConfig(format='%(asctime)s %(levelname)s %(message)s',level=logging.INFO)
+
+    # Check the invocation arguments
+    parser = OptionParser("%prog [options]", description='runs some test queries on the radb')
+    parser.add_option('-V', '--verbose', dest='verbose', action='store_true', help='verbose logging')
+    parser.add_option_group(dbcredentials.options_group(parser))
+    parser.set_defaults(dbcredentials="RADB")
+    (options, args) = parser.parse_args()
+
+    dbcreds = dbcredentials.parse_options(options)
+
+    print
+    print 'Using dbcreds: %s' % dbcreds.stringWithHiddenPassword()
+    print 'Are you sure you want to run the performance tests on this database? Tables will be modified! Precious data might be lost!'
+    print 'This test gives the most reproducable results when run on a clean database.'
+    print
+    answer = raw_input('CONTINUE? y/<n>: ')
+    if 'y' not in answer.lower():
+        print 'Exiting without running the test...'
+        exit(1)
+
+    print 'Starting test....'
+    radb = RADatabase(dbcreds=dbcreds, log_queries=options.verbose)
+
+    test_resource_usages_performance(radb)
+
+
diff --git a/SAS/ResourceAssignment/ResourceAssignmentDatabase/tests/t_radb.py b/SAS/ResourceAssignment/ResourceAssignmentDatabase/tests/t_radb.py
index 9c04e2b22654de6f1137a9e6d606a6165e0f48e0..8d3da661a76438e2bfee8f494bbb9d7d967363fb 100755
--- a/SAS/ResourceAssignment/ResourceAssignmentDatabase/tests/t_radb.py
+++ b/SAS/ResourceAssignment/ResourceAssignmentDatabase/tests/t_radb.py
@@ -25,6 +25,7 @@ import os
 from datetime import datetime, timedelta
 from dateutil import parser
 import logging
+from pprint import pformat
 
 logger = logging.getLogger(__name__)
 
@@ -159,7 +160,7 @@ class ResourceAssignmentDatabaseTest(unittest.TestCase):
 
     # --- tests start here
 
-    #
+
     # integrity tests of postgres database itself
     #
     # Note: These are meant to make sure the setup generally works and all sql scripts were applied.
@@ -998,22 +999,24 @@ class ResourceAssignmentDatabaseTest(unittest.TestCase):
         self.assertEqual(len(specifications), 2)
 
     def test_getSpecification_normal_use_select_one_succeeds(self):
-        """ Verify if radb.getSpecification() returns a list containing a single specification """
+        """ Verify if radb.getSpecification() returns a single single specification """
 
         spec_ids = [self._insert_test_spec(), self._insert_test_spec(), self._insert_test_spec()]
 
-        specifications = self.radb.getSpecification(spec_ids[1])
+        specification = self.radb.getSpecification(spec_ids[1])
 
-        self.assertEqual(len(specifications), 1)
+        self.assertTrue(specification)
+        self.assertEqual(spec_ids[1], specification['id'])
 
     def test_task_and_claim_conflicts(self):
         # TODO: split up once the test setup is faster (not creating a new db for each test method)
         # for testing purposous let's give CEP4 storage a total size of 100
-        self.assertTrue(self.radb.updateResourceAvailability(117, available_capacity=100, total_capacity=100))
-        self.assertEqual(100, self.radb.getResources(117, include_availability=True)[0]['total_capacity'])
+        cep4_id = 117
+        self.assertTrue(self.radb.updateResourceAvailability(cep4_id, available_capacity=100, total_capacity=100))
+        self.assertEqual(100, self.radb.getResources(cep4_id, include_availability=True)[0]['total_capacity'])
 
         now = datetime.utcnow()
-        now -= timedelta(seconds=now.second, microseconds=now.microsecond)
+        now -= timedelta(minutes=now.minute, seconds=now.second, microseconds=now.microsecond) # round to full hour
 
         result = self.radb.insertSpecificationAndTask(0, 0, 'approved', 'observation', now, now+timedelta(hours=1), 'foo', 'CEP4')
         self.assertTrue(result['inserted'])
@@ -1024,7 +1027,7 @@ class ResourceAssignmentDatabaseTest(unittest.TestCase):
         self.assertTrue(task1)
         self.assertEqual(task_id1, task1['id'])
 
-        t1_claim1 = { 'resource_id': 117,
+        t1_claim1 = { 'resource_id': cep4_id,
                       'starttime': task1['starttime'],
                       'endtime': task1['endtime'],
                       'status': 'tentative',
@@ -1049,22 +1052,23 @@ class ResourceAssignmentDatabaseTest(unittest.TestCase):
                 self.assertEqual(value, t1_claims[0][key])
 
         # try to insert a claim with the wrong (already 'claimed') status. Should rollback, and return no ids.
-        t1_claim2 = { 'resource_id': 117,
+        t1_claim2 = { 'resource_id': cep4_id,
                       'starttime': task1['starttime'],
                       'endtime': task1['endtime'],
                       'status': 'claimed',
                       'claim_size': 10 }
         t1_faulty_claim_ids = self.radb.insertResourceClaims(task_id1, [t1_claim2], 'foo', 1, 1)
-        self.assertEqual(0, len(t1_faulty_claim_ids))
+        self.assertEqual(1, len(self.radb.getResourceClaims(task_ids=task_id1))) #there should still be one (proper/non-faulty) claim for this task
 
         # try to insert a claim with the wrong (already 'conflict') status. Should rollback, and return no ids.
-        t1_claim3 = { 'resource_id': 117,
+        t1_claim3 = { 'resource_id': cep4_id,
                       'starttime': task1['starttime'],
                       'endtime': task1['endtime'],
                       'status': 'conflict',
                       'claim_size': 10 }
         t1_faulty_claim_ids = self.radb.insertResourceClaims(task_id1, [t1_claim3], 'foo', 1, 1)
-        self.assertEqual(0, len(t1_faulty_claim_ids))
+        t1_faulty_claim_ids = self.radb.insertResourceClaims(task_id1, [t1_claim2], 'foo', 1, 1)
+        self.assertEqual(1, len(self.radb.getResourceClaims(task_ids=task_id1))) #there should still be one (proper/non-faulty) claim for this task
 
         # try to update the task status to scheduled, should not succeed, since it's claims are not 'claimed' yet.
         self.assertFalse(self.radb.updateTask(task_id1, task_status='scheduled'))
@@ -1078,12 +1082,11 @@ class ResourceAssignmentDatabaseTest(unittest.TestCase):
         self.assertTrue(self.radb.updateTask(task_id1, task_status='scheduled'))
         self.assertEqual('scheduled', self.radb.getTask(task_id1)['status'])
 
-        self.assertEqual(0, len(self.radb.get_conflicting_overlapping_claims(t1_claim_ids[0])))
-        self.assertEqual(0, len(self.radb.get_conflicting_overlapping_tasks(t1_claim_ids[0])))
+        self.assertEqual(0, len(self.radb.get_overlapping_claims(t1_claim_ids[0])))
+        self.assertEqual(0, len(self.radb.get_overlapping_tasks(t1_claim_ids[0])))
 
-        self.assertEqual(40, self.radb.get_max_resource_usage_between(117, task1['starttime'], task1['starttime'], 'claimed')['usage'])
-
-        self.assertEqual(0, self.radb.get_max_resource_usage_between(117, task1['starttime']-timedelta(hours=2), task1['starttime']-timedelta(hours=1), 'claimed')['usage'])
+        self.assertEqual(40, self.radb.get_max_resource_usage_between(cep4_id, task1['starttime'], task1['starttime'], 'claimed')['usage'])
+        self.assertEqual(0, self.radb.get_max_resource_usage_between(cep4_id, task1['starttime']-timedelta(hours=2), task1['starttime']-timedelta(hours=1), 'claimed')['usage'])
 
         logger.info('------------------------------ concludes task 1 ------------------------------')
         logger.info('-- now test with a 2nd task, and test resource availability, conflicts etc. --')
@@ -1098,7 +1101,7 @@ class ResourceAssignmentDatabaseTest(unittest.TestCase):
         self.assertTrue(task2)
 
         # insert a claim which won't fit, claim status after insert should be 'conflict' instead of 'tentative'
-        t2_claim1 = { 'resource_id': 117,
+        t2_claim1 = { 'resource_id': cep4_id,
                       'starttime': task2['starttime'],
                       'endtime': task2['endtime'],
                       'status': 'tentative',
@@ -1114,10 +1117,17 @@ class ResourceAssignmentDatabaseTest(unittest.TestCase):
         self.assertEqual('conflict', self.radb.getTask(task_id2)['status'])
 
         self.assertEqual(set([t1_claim_ids[0]]), set(c['id'] for c in
-                                                     self.radb.get_conflicting_overlapping_claims(t2_claim_ids[0])))
+                                                     self.radb.get_overlapping_claims(t2_claim_ids[0])))
         self.assertEqual(set([task_id1]), set(t['id'] for t in
-                                              self.radb.get_conflicting_overlapping_tasks(t2_claim_ids[0])))
+                                              self.radb.get_overlapping_tasks(t2_claim_ids[0])))
+
+        #try to connect this claim to task1, should fail
+        self.assertFalse(self.radb.updateResourceClaims(t2_claim_ids, task_id=task_id1))
+        self.assertEqual(task_id2, t2_claims[0]['task_id'])
 
+        #try to connect this claim to other resource, should fail
+        self.assertFalse(self.radb.updateResourceClaims(t2_claim_ids, resource_id=118))
+        self.assertEqual(cep4_id, t2_claims[0]['resource_id'])
 
         # try to update the task status to scheduled, should not succeed, since it's claims are not 'claimed' yet.
         self.assertFalse(self.radb.updateTask(task_id2, task_status='scheduled'))
@@ -1133,8 +1143,8 @@ class ResourceAssignmentDatabaseTest(unittest.TestCase):
         self.assertEqual('tentative', self.radb.getResourceClaim(t2_claim_ids[0])['status'])
         self.assertEqual('approved', self.radb.getTask(task_id2)['status'])
 
-        self.assertEqual(0, len(self.radb.get_conflicting_overlapping_claims(t2_claim_ids[0])))
-        self.assertEqual(0, len(self.radb.get_conflicting_overlapping_tasks(t2_claim_ids[0])))
+        self.assertEqual(0, len(self.radb.get_overlapping_claims(t2_claim_ids[0])))
+        self.assertEqual(0, len(self.radb.get_overlapping_tasks(t2_claim_ids[0])))
 
         # try to update the claim status to claimed, should succeed now
         self.assertTrue(self.radb.updateResourceClaims(t2_claim_ids, status='claimed'))
@@ -1144,8 +1154,50 @@ class ResourceAssignmentDatabaseTest(unittest.TestCase):
         self.assertTrue(self.radb.updateTask(task_id2, task_status='scheduled'))
         self.assertEqual('scheduled', self.radb.getTask(task_id2)['status'])
 
-        self.assertEqual(0, len(self.radb.get_conflicting_overlapping_claims(t2_claim_ids[0])))
-        self.assertEqual(0, len(self.radb.get_conflicting_overlapping_tasks(t2_claim_ids[0])))
+        self.assertEqual(0, len(self.radb.get_overlapping_claims(t2_claim_ids[0])))
+        self.assertEqual(0, len(self.radb.get_overlapping_tasks(t2_claim_ids[0])))
+
+        # updating task/claim start/endtime should work, even for scheduled tasks with claimed claims
+        # effect might be that a scheduled tasks goes to conflict
+        # force conflict by moving back to original start/endtimes
+        self.assertTrue(self.radb.updateTaskAndResourceClaims(task_id2, starttime=task2['starttime'], endtime=task2['endtime']))
+        self.assertEqual('conflict', self.radb.getResourceClaim(t2_claim_ids[0])['status'])
+        self.assertEqual('conflict', self.radb.getTask(task_id2)['status'])
+
+        # again do conflict resolution, shift task and claims
+        self.assertTrue(self.radb.updateTaskAndResourceClaims(task_id2, starttime=now+timedelta(hours=2), endtime=now+timedelta(hours=3)))
+        self.assertTrue(self.radb.updateTaskAndResourceClaims(task_id2, claim_status='claimed', task_status='scheduled'))
+        # now the task and claim status should be scheduled/claimed
+        self.assertEqual('scheduled', self.radb.getTask(task_id2)['status'])
+        self.assertEqual('claimed', self.radb.getResourceClaim(t2_claim_ids[0])['status'])
+
+        # updating task/claim start/endtime should work, even for scheduled tasks with claimed claims
+        # effect might be that a scheduled tasks goes to conflict
+        # now, make simple endtime adjustment, task should stay scheduled
+
+        logger.info("resource usages:\n%s", pformat(self.radb.getResourceUsages(now-timedelta(days=1.0), now+timedelta(days=2.0), cep4_id)))
+        self.assertTrue(self.radb.updateTaskAndResourceClaims(task_id2, endtime=now+timedelta(hours=2.75)))
+        logger.info("resource usages:\n%s", pformat(self.radb.getResourceUsages(now-timedelta(days=1.0), now+timedelta(days=2.0), cep4_id)))
+
+        # now the task and claim status should still be scheduled/claimed
+        self.assertEqual('scheduled', self.radb.getTask(task_id2)['status'])
+        self.assertEqual('claimed', self.radb.getResourceClaim(t2_claim_ids[0])['status'])
+
+        # now some weird corner case...
+        # when a task is > queued (for example, finished)
+        # then we don't want conflict statuses anymore if we update start/endtimes
+        # test here with weird starttime shift back to overlap with task1
+        self.assertTrue(self.radb.updateTask(task_id2, task_status='finished'))
+        self.assertEqual('finished', self.radb.getTask(task_id2)['status'])
+        self.assertTrue(self.radb.updateTaskAndResourceClaims(task_id2, starttime=task1['starttime']))
+        self.assertEqual('finished', self.radb.getTask(task_id2)['status'])
+        self.assertEqual('claimed', self.radb.getResourceClaim(t2_claim_ids[0])['status'])
+
+        #ok, that works, now set the start/end time back to 'normal' for some later test cases
+        self.assertTrue(self.radb.updateTaskAndResourceClaims(task_id2, starttime=now+timedelta(hours=2), endtime=now+timedelta(hours=3)))
+        self.assertEqual('finished', self.radb.getTask(task_id2)['status'])
+        self.assertEqual('claimed', self.radb.getResourceClaim(t2_claim_ids[0])['status'])
+
 
         logger.info('------------------------------ concludes task 2 ------------------------------')
         logger.info('-- now test with a 3rd task, and test resource availability, conflicts etc. --')
@@ -1167,7 +1219,7 @@ class ResourceAssignmentDatabaseTest(unittest.TestCase):
         self.assertTrue(task3)
 
         # insert a claim which won't fit, claim status after insert should be 'conflict' instead of 'tentative'
-        t3_claim1 = { 'resource_id': 117,
+        t3_claim1 = { 'resource_id': cep4_id,
                       'starttime': task3['starttime'],
                       'endtime': task3['endtime'],
                       'status': 'tentative',
@@ -1182,9 +1234,9 @@ class ResourceAssignmentDatabaseTest(unittest.TestCase):
         # and the task's status should be conflict as well
         self.assertEqual('conflict', self.radb.getTask(task_id3)['status'])
         self.assertEqual(set([t1_claim_ids[0], t2_claim_ids[0]]), set(c['id'] for c in
-                                                                      self.radb.get_conflicting_overlapping_claims(t3_claim_ids[0])))
+                                                                      self.radb.get_overlapping_claims(t3_claim_ids[0])))
         self.assertEqual(set([task_id1, task_id2]), set(t['id'] for t in
-                                                                      self.radb.get_conflicting_overlapping_tasks(t3_claim_ids[0])))
+                                                                      self.radb.get_overlapping_tasks(t3_claim_ids[0])))
 
         # try to update the task status to scheduled, should not succeed, since it's claims are not 'claimed' yet.
         self.assertFalse(self.radb.updateTask(task_id3, task_status='scheduled'))
@@ -1202,9 +1254,9 @@ class ResourceAssignmentDatabaseTest(unittest.TestCase):
         self.assertEqual('conflict', self.radb.getTask(task_id3)['status'])
 
         self.assertEqual(set([t2_claim_ids[0]]), set(c['id'] for c in
-                                                     self.radb.get_conflicting_overlapping_claims(t3_claim_ids[0])))
+                                                     self.radb.get_overlapping_claims(t3_claim_ids[0])))
         self.assertEqual(set([task_id2]), set(t['id'] for t in
-                                              self.radb.get_conflicting_overlapping_tasks(t3_claim_ids[0])))
+                                              self.radb.get_overlapping_tasks(t3_claim_ids[0])))
 
         # do conflict resolution, reduce claim size (but keep overlapping with task2)
         self.assertTrue(self.radb.updateResourceClaim(t3_claim_ids[0], claim_size=5))
@@ -1213,8 +1265,9 @@ class ResourceAssignmentDatabaseTest(unittest.TestCase):
         self.assertEqual('tentative', self.radb.getResourceClaim(t3_claim_ids[0])['status'])
         self.assertEqual('approved', self.radb.getTask(task_id3)['status'])
 
-        self.assertEqual(0, len(self.radb.get_conflicting_overlapping_claims(t3_claim_ids[0])))
-        self.assertEqual(0, len(self.radb.get_conflicting_overlapping_tasks(t3_claim_ids[0])))
+        self.assertEqual(1, len(self.radb.get_overlapping_claims(t3_claim_ids[0])))
+        self.assertEqual(1, len(self.radb.get_overlapping_tasks(t3_claim_ids[0])))
+        self.assertEqual(task2['id'], self.radb.get_overlapping_tasks(t3_claim_ids[0])[0]['id'])
 
         # try to update the claim status to claimed, should succeed now
         self.assertTrue(self.radb.updateResourceClaims(t3_claim_ids, status='claimed'))
@@ -1232,17 +1285,596 @@ class ResourceAssignmentDatabaseTest(unittest.TestCase):
         self.assertEqual('claimed', self.radb.getResourceClaim(t3_claim_ids[0])['status'])
         self.assertEqual('scheduled', self.radb.getTask(task_id3)['status'])
 
+
         # suppose the resource_usages table is broken for some reason, fix it....
         # break it first...
         self._execute_query('TRUNCATE TABLE resource_allocation.resource_usage;')
         #check that it's broken
-        self.assertNotEqual(40, self.radb.get_max_resource_usage_between(117, task1['starttime'], task1['starttime'], 'claimed')['usage'])
+        self.assertNotEqual(40, self.radb.get_max_resource_usage_between(cep4_id, task1['starttime'], task1['starttime'], 'claimed')['usage'])
         #fix it
-        self.radb.rebuild_resource_usages_table_from_claims()
+        self.radb.rebuild_resource_usages_from_claims()
         #and test again that it's ok
-        self.assertEqual(40, self.radb.get_max_resource_usage_between(117, task1['starttime'], task1['starttime'], 'claimed')['usage'])
-        self.assertEqual(0, self.radb.get_max_resource_usage_between(117, task1['starttime']-timedelta(hours=2), task1['starttime']-timedelta(hours=1), 'claimed')['usage'])
+        self.assertEqual(40, self.radb.get_max_resource_usage_between(cep4_id, task1['starttime'], task1['starttime'], 'claimed')['usage'])
+        self.assertEqual(0, self.radb.get_max_resource_usage_between(cep4_id, task1['starttime']-timedelta(hours=2), task1['starttime']-timedelta(hours=1), 'claimed')['usage'])
+
+    def test_resource_usages(self):
+        # for testing purposous let's give CEP4 storage a total size of 100
+        cep4_id = 117
+        self.assertTrue(self.radb.updateResourceAvailability(cep4_id, available_capacity=100, total_capacity=100))
+        self.assertEqual(100, self.radb.getResources(cep4_id, include_availability=True)[0]['total_capacity'])
+
+        now = datetime.utcnow()
+        now -= timedelta(minutes=now.minute, seconds=now.second, microseconds=now.microsecond)  # round to full hour
+
+        # insert one task, and reuse that for multiple  claims
+        result = self.radb.insertSpecificationAndTask(0, 0, 'approved', 'observation', now, now + timedelta(hours=1),
+                                                      'content', 'CEP4')
+        self.assertTrue(result['inserted'])
+        task_id = result['task_id']
+        task = self.radb.getTask(task_id)
+        self.assertTrue(task)
+
+        # insert a few claims one after the other, and check everything again and again in each intermediate step
+        # because there are various special cases coded below where claims overlap/touch/etc which all need to be checked.
+
+        # insert a claim, and check the usages for various timestamps
+        claim1 = {'resource_id': cep4_id, 'starttime': now+timedelta(minutes=0), 'endtime': now+timedelta(minutes=10), 'status': 'tentative', 'claim_size': 1}
+        self.radb.insertResourceClaims(task_id, [claim1], 'foo', 1, 1)
+        # test usages twice, once to check the usages generated by insert-triggers, and then to check usages generated by rebuild_resource_usages_from_claims
+        for i in range(2):
+            if i == 1:
+                # make sure the usage table is wiped, so asserts fail when rebuild_resource_usages_from_claims is erroneously roll'ed back.
+                self.radb._executeQuery('TRUNCATE resource_allocation.resource_usage;')
+                self.radb.rebuild_resource_usages_from_claims(cep4_id, 'tentative')
+            self.assertEqual( 0, self.radb.get_resource_usage_at_or_before(cep4_id, now-timedelta(minutes=10), 'tentative')['usage'])
+            self.assertEqual( 1, self.radb.get_resource_usage_at_or_before(cep4_id, claim1['starttime'], 'tentative')['usage'])
+            self.assertEqual( 0, self.radb.get_resource_usage_at_or_before(cep4_id, claim1['endtime'], 'tentative')['usage'])
+            self.assertEqual( 0, self.radb.get_resource_usage_at_or_before(cep4_id, now+timedelta(minutes=1000), 'tentative')['usage'])
+
+        # insert another non-overlapping claim, and check the usages for various timestamps
+        claim2 = {'resource_id': cep4_id, 'starttime': now+timedelta(minutes=20), 'endtime': now+timedelta(minutes=30), 'status': 'tentative', 'claim_size': 1}
+        self.radb.insertResourceClaims(task_id, [claim2], 'foo', 1, 1)
+        # test usages twice, once to check the usages generated by insert-triggers, and then to check usages generated by rebuild_resource_usages_from_claims
+        for i in range(2):
+            if i == 1:
+                # make sure the usage table is wiped, so asserts fail when rebuild_resource_usages_from_claims is erroneously roll'ed back.
+                self.radb._executeQuery('TRUNCATE resource_allocation.resource_usage;')
+                self.radb.rebuild_resource_usages_from_claims(cep4_id, 'tentative')
+            self.assertEqual( 0, self.radb.get_resource_usage_at_or_before(cep4_id, now-timedelta(minutes=10), 'tentative')['usage'])
+            self.assertEqual( 1, self.radb.get_resource_usage_at_or_before(cep4_id, claim1['starttime'], 'tentative')['usage'])
+            self.assertEqual( 0, self.radb.get_resource_usage_at_or_before(cep4_id, claim1['endtime'], 'tentative')['usage'])
+            self.assertEqual( 1, self.radb.get_resource_usage_at_or_before(cep4_id, claim2['starttime'], 'tentative')['usage'])
+            self.assertEqual( 0, self.radb.get_resource_usage_at_or_before(cep4_id, claim2['endtime'], 'tentative')['usage'])
+            self.assertEqual( 0, self.radb.get_resource_usage_at_or_before(cep4_id, now+timedelta(minutes=1000), 'tentative')['usage'])
+
+        # insert another claim which overlaps with both claim1 and claim2, and check the usages for various timestamps
+        claim3 = {'resource_id': cep4_id, 'starttime': now+timedelta(minutes=5), 'endtime': now+timedelta(minutes=25), 'status': 'tentative', 'claim_size': 1}
+        self.radb.insertResourceClaims(task_id, [claim3], 'foo', 1, 1)
+        # test usages twice, once to check the usages generated by insert-triggers, and then to check usages generated by rebuild_resource_usages_from_claims
+        for i in range(2):
+            if i == 1:
+                # make sure the usage table is wiped, so asserts fail when rebuild_resource_usages_from_claims is erroneously roll'ed back.
+                self.radb._executeQuery('TRUNCATE resource_allocation.resource_usage;')
+                self.radb.rebuild_resource_usages_from_claims(cep4_id, 'tentative')
+            self.assertEqual( 0, self.radb.get_resource_usage_at_or_before(cep4_id, now-timedelta(minutes=10), 'tentative')['usage'])
+            self.assertEqual( 1, self.radb.get_resource_usage_at_or_before(cep4_id, claim1['starttime'], 'tentative')['usage'])
+            self.assertEqual( 2, self.radb.get_resource_usage_at_or_before(cep4_id, claim3['starttime'], 'tentative')['usage'])
+            self.assertEqual( 1, self.radb.get_resource_usage_at_or_before(cep4_id, claim1['endtime'], 'tentative')['usage'])
+            self.assertEqual( 2, self.radb.get_resource_usage_at_or_before(cep4_id, claim2['starttime'], 'tentative')['usage'])
+            self.assertEqual( 1, self.radb.get_resource_usage_at_or_before(cep4_id, claim3['endtime'], 'tentative')['usage'])
+            self.assertEqual( 0, self.radb.get_resource_usage_at_or_before(cep4_id, claim2['endtime'], 'tentative')['usage'])
+            self.assertEqual( 0, self.radb.get_resource_usage_at_or_before(cep4_id, now+timedelta(minutes=1000), 'tentative')['usage'])
+
+
+        # insert another claim which overlaps with claim1 and ends at the same endtime as claim3, and check the usages for various timestamps
+        claim4 = {'resource_id': cep4_id, 'starttime': now+timedelta(minutes=7.5), 'endtime': claim3['endtime'], 'status': 'tentative', 'claim_size': 1}
+        self.radb.insertResourceClaims(task_id, [claim4], 'foo', 1, 1)
+        # test usages twice, once to check the usages generated by insert-triggers, and then to check usages generated by rebuild_resource_usages_from_claims
+        for i in range(2):
+            if i == 1:
+                # make sure the usage table is wiped, so asserts fail when rebuild_resource_usages_from_claims is erroneously roll'ed back.
+                self.radb._executeQuery('TRUNCATE resource_allocation.resource_usage;')
+                self.radb.rebuild_resource_usages_from_claims(cep4_id, 'tentative')
+            self.assertEqual( 0, self.radb.get_resource_usage_at_or_before(cep4_id, now-timedelta(minutes=10), 'tentative')['usage'])
+            self.assertEqual( 1, self.radb.get_resource_usage_at_or_before(cep4_id, claim1['starttime'], 'tentative')['usage'])
+            self.assertEqual( 2, self.radb.get_resource_usage_at_or_before(cep4_id, claim3['starttime'], 'tentative')['usage'])
+            self.assertEqual( 3, self.radb.get_resource_usage_at_or_before(cep4_id, claim4['starttime'], 'tentative')['usage'])
+            self.assertEqual( 2, self.radb.get_resource_usage_at_or_before(cep4_id, claim1['endtime'], 'tentative')['usage'])
+            self.assertEqual( 3, self.radb.get_resource_usage_at_or_before(cep4_id, claim2['starttime'], 'tentative')['usage'])
+            self.assertEqual( 1, self.radb.get_resource_usage_at_or_before(cep4_id, claim3['endtime'], 'tentative')['usage']) #c4_endtime should be equal to c3_endtime
+            self.assertEqual( 1, self.radb.get_resource_usage_at_or_before(cep4_id, claim4['endtime'], 'tentative')['usage']) #so usage should drop by 2*1 at this timestamp
+            self.assertEqual( 0, self.radb.get_resource_usage_at_or_before(cep4_id, claim2['endtime'], 'tentative')['usage'])
+            self.assertEqual( 0, self.radb.get_resource_usage_at_or_before(cep4_id, now+timedelta(minutes=1000), 'tentative')['usage'])
+
+        # insert another claim which starts when claim1 ends and last 1 minute, and check the usages for various timestamps
+        claim5 = {'resource_id': cep4_id, 'starttime': claim1['endtime'], 'endtime': claim1['endtime']+timedelta(minutes=1), 'status': 'tentative', 'claim_size': 1}
+        self.radb.insertResourceClaims(task_id, [claim5], 'foo', 1, 1)
+        # test usages twice, once to check the usages generated by insert-triggers, and then to check usages generated by rebuild_resource_usages_from_claims
+        for i in range(2):
+            if i == 1:
+                # make sure the usage table is wiped, so asserts fail when rebuild_resource_usages_from_claims is erroneously roll'ed back.
+                self.radb._executeQuery('TRUNCATE resource_allocation.resource_usage;')
+                self.radb.rebuild_resource_usages_from_claims(cep4_id, 'tentative')
+            self.assertEqual( 0, self.radb.get_resource_usage_at_or_before(cep4_id, now-timedelta(minutes=10), 'tentative')['usage'])
+            self.assertEqual( 1, self.radb.get_resource_usage_at_or_before(cep4_id, claim1['starttime'], 'tentative')['usage'])
+            self.assertEqual( 2, self.radb.get_resource_usage_at_or_before(cep4_id, claim3['starttime'], 'tentative')['usage'])
+            self.assertEqual( 3, self.radb.get_resource_usage_at_or_before(cep4_id, claim4['starttime'], 'tentative')['usage'])
+            self.assertEqual( 3, self.radb.get_resource_usage_at_or_before(cep4_id, claim1['endtime'], 'tentative')['usage']) #drops by 1 because c1 ends, but climbs by 1 because c5 starts
+            self.assertEqual( 3, self.radb.get_resource_usage_at_or_before(cep4_id, claim5['starttime'], 'tentative')['usage']) #drops by 1 because c1 ends, but climbs by 1 because c5 starts
+            self.assertEqual( 2, self.radb.get_resource_usage_at_or_before(cep4_id, claim5['endtime'], 'tentative')['usage']) #drops by 1 because c5 ends
+            self.assertEqual( 3, self.radb.get_resource_usage_at_or_before(cep4_id, claim2['starttime'], 'tentative')['usage'])
+            self.assertEqual( 1, self.radb.get_resource_usage_at_or_before(cep4_id, claim3['endtime'], 'tentative')['usage'])
+            self.assertEqual( 1, self.radb.get_resource_usage_at_or_before(cep4_id, claim4['endtime'], 'tentative')['usage'])
+            self.assertEqual( 0, self.radb.get_resource_usage_at_or_before(cep4_id, claim2['endtime'], 'tentative')['usage'])
+            self.assertEqual( 0, self.radb.get_resource_usage_at_or_before(cep4_id, now+timedelta(minutes=1000), 'tentative')['usage'])
+
+        # last edge case, insert another claim which starts when first claim starts, and end when last claim ends. Should lift all usages by 1 (except outer ones).
+        claim6 = {'resource_id': cep4_id, 'starttime': claim1['starttime'], 'endtime': claim2['endtime'], 'status': 'tentative', 'claim_size': 1}
+        self.radb.insertResourceClaims(task_id, [claim6], 'foo', 1, 1)
+        # test usages twice, once to check the usages generated by insert-triggers, and then to check usages generated by rebuild_resource_usages_from_claims
+        for i in range(2):
+            if i == 1:
+                # make sure the usage table is wiped, so asserts fail when rebuild_resource_usages_from_claims is erroneously roll'ed back.
+                self.radb._executeQuery('TRUNCATE resource_allocation.resource_usage;')
+                self.radb.rebuild_resource_usages_from_claims(cep4_id, 'tentative')
+            self.assertEqual( 0, self.radb.get_resource_usage_at_or_before(cep4_id, now-timedelta(minutes=10), 'tentative')['usage'])
+            self.assertEqual( 2, self.radb.get_resource_usage_at_or_before(cep4_id, claim1['starttime'], 'tentative')['usage'])
+            self.assertEqual( 3, self.radb.get_resource_usage_at_or_before(cep4_id, claim3['starttime'], 'tentative')['usage'])
+            self.assertEqual( 4, self.radb.get_resource_usage_at_or_before(cep4_id, claim4['starttime'], 'tentative')['usage'])
+            self.assertEqual( 4, self.radb.get_resource_usage_at_or_before(cep4_id, claim1['endtime'], 'tentative')['usage'])
+            self.assertEqual( 4, self.radb.get_resource_usage_at_or_before(cep4_id, claim5['starttime'], 'tentative')['usage'])
+            self.assertEqual( 3, self.radb.get_resource_usage_at_or_before(cep4_id, claim5['endtime'], 'tentative')['usage'])
+            self.assertEqual( 4, self.radb.get_resource_usage_at_or_before(cep4_id, claim2['starttime'], 'tentative')['usage'])
+            self.assertEqual( 2, self.radb.get_resource_usage_at_or_before(cep4_id, claim3['endtime'], 'tentative')['usage']) #c4_endtime should be equal to c3_endtime
+            self.assertEqual( 2, self.radb.get_resource_usage_at_or_before(cep4_id, claim4['endtime'], 'tentative')['usage']) #so usage should drop by 2*1 at this timestamp
+            self.assertEqual( 0, self.radb.get_resource_usage_at_or_before(cep4_id, claim2['endtime'], 'tentative')['usage'])
+            self.assertEqual( 0, self.radb.get_resource_usage_at_or_before(cep4_id, now+timedelta(minutes=1000), 'tentative')['usage'])
+
+        # conclude with two simple cases,
+        # first final simple case: insert another claim follows (non overlapping/non-touching) all others
+        claim7 = {'resource_id': cep4_id, 'starttime': claim2['endtime']+timedelta(minutes=10), 'endtime': claim2['endtime']+timedelta(minutes=20), 'status': 'tentative', 'claim_size': 1}
+        self.radb.insertResourceClaims(task_id, [claim7], 'foo', 1, 1)
+        # test usages twice, once to check the usages generated by insert-triggers, and then to check usages generated by rebuild_resource_usages_from_claims
+        for i in range(2):
+            if i == 1:
+                # make sure the usage table is wiped, so asserts fail when rebuild_resource_usages_from_claims is erroneously roll'ed back.
+                logger.info('')
+                self.radb._executeQuery('TRUNCATE resource_allocation.resource_usage;')
+                self.radb.rebuild_resource_usages_from_claims(cep4_id, 'tentative')
+            self.assertEqual( 0, self.radb.get_resource_usage_at_or_before(cep4_id, now-timedelta(minutes=10), 'tentative')['usage'])
+            self.assertEqual( 2, self.radb.get_resource_usage_at_or_before(cep4_id, claim1['starttime'], 'tentative')['usage'])
+            self.assertEqual( 3, self.radb.get_resource_usage_at_or_before(cep4_id, claim3['starttime'], 'tentative')['usage'])
+            self.assertEqual( 4, self.radb.get_resource_usage_at_or_before(cep4_id, claim4['starttime'], 'tentative')['usage'])
+            self.assertEqual( 4, self.radb.get_resource_usage_at_or_before(cep4_id, claim1['endtime'], 'tentative')['usage'])
+            self.assertEqual( 4, self.radb.get_resource_usage_at_or_before(cep4_id, claim5['starttime'], 'tentative')['usage'])
+            self.assertEqual( 3, self.radb.get_resource_usage_at_or_before(cep4_id, claim5['endtime'], 'tentative')['usage'])
+            self.assertEqual( 4, self.radb.get_resource_usage_at_or_before(cep4_id, claim2['starttime'], 'tentative')['usage'])
+            self.assertEqual( 2, self.radb.get_resource_usage_at_or_before(cep4_id, claim3['endtime'], 'tentative')['usage'])
+            self.assertEqual( 2, self.radb.get_resource_usage_at_or_before(cep4_id, claim4['endtime'], 'tentative')['usage'])
+            self.assertEqual( 0, self.radb.get_resource_usage_at_or_before(cep4_id, claim2['endtime'], 'tentative')['usage'])
+            self.assertEqual( 1, self.radb.get_resource_usage_at_or_before(cep4_id, claim7['starttime'], 'tentative')['usage'])
+            self.assertEqual( 0, self.radb.get_resource_usage_at_or_before(cep4_id, claim7['endtime'], 'tentative')['usage'])
+            self.assertEqual( 0, self.radb.get_resource_usage_at_or_before(cep4_id, now+timedelta(minutes=1000), 'tentative')['usage'])
+
+        # second final simple case: insert another claim which precedes (non overlapping/non-touching) all the others
+        claim8 = {'resource_id': cep4_id, 'starttime': claim1['starttime']-timedelta(minutes=20), 'endtime': claim1['starttime']-timedelta(minutes=10), 'status': 'tentative', 'claim_size': 1}
+        self.radb.insertResourceClaims(task_id, [claim8], 'foo', 1, 1)
+        # test usages twice, once to check the usages generated by insert-triggers, and then to check usages generated by rebuild_resource_usages_from_claims
+        for i in range(2):
+            if i == 1:
+                # make sure the usage table is wiped, so asserts fail when rebuild_resource_usages_from_claims is erroneously roll'ed back.
+                self.radb._executeQuery('TRUNCATE resource_allocation.resource_usage;')
+                self.radb.rebuild_resource_usages_from_claims(cep4_id, 'tentative')
+            self.assertEqual( 0, self.radb.get_resource_usage_at_or_before(cep4_id, now-timedelta(minutes=100), 'tentative')['usage'])
+            self.assertEqual( 1, self.radb.get_resource_usage_at_or_before(cep4_id, claim8['starttime'], 'tentative')['usage'])
+            self.assertEqual( 0, self.radb.get_resource_usage_at_or_before(cep4_id, claim8['endtime'], 'tentative')['usage'])
+            self.assertEqual( 0, self.radb.get_resource_usage_at_or_before(cep4_id, claim1['starttime']-timedelta(minutes=1), 'tentative')['usage'])
+            self.assertEqual( 2, self.radb.get_resource_usage_at_or_before(cep4_id, claim1['starttime'], 'tentative')['usage'])
+            self.assertEqual( 3, self.radb.get_resource_usage_at_or_before(cep4_id, claim3['starttime'], 'tentative')['usage'])
+            self.assertEqual( 4, self.radb.get_resource_usage_at_or_before(cep4_id, claim4['starttime'], 'tentative')['usage'])
+            self.assertEqual( 4, self.radb.get_resource_usage_at_or_before(cep4_id, claim1['endtime'], 'tentative')['usage'])
+            self.assertEqual( 4, self.radb.get_resource_usage_at_or_before(cep4_id, claim5['starttime'], 'tentative')['usage'])
+            self.assertEqual( 3, self.radb.get_resource_usage_at_or_before(cep4_id, claim5['endtime'], 'tentative')['usage'])
+            self.assertEqual( 4, self.radb.get_resource_usage_at_or_before(cep4_id, claim2['starttime'], 'tentative')['usage'])
+            self.assertEqual( 2, self.radb.get_resource_usage_at_or_before(cep4_id, claim3['endtime'], 'tentative')['usage'])
+            self.assertEqual( 2, self.radb.get_resource_usage_at_or_before(cep4_id, claim4['endtime'], 'tentative')['usage'])
+            self.assertEqual( 0, self.radb.get_resource_usage_at_or_before(cep4_id, claim2['endtime'], 'tentative')['usage'])
+            self.assertEqual( 1, self.radb.get_resource_usage_at_or_before(cep4_id, claim7['starttime'], 'tentative')['usage'])
+            self.assertEqual( 0, self.radb.get_resource_usage_at_or_before(cep4_id, claim7['endtime'], 'tentative')['usage'])
+            self.assertEqual( 0, self.radb.get_resource_usage_at_or_before(cep4_id, now+timedelta(minutes=1000), 'tentative')['usage'])
+
+    def test_overlapping_claims(self):
+        # this is a special testcase to prove a bug found at 2017-08-16
+        # the bug was that a claim that should fit, does not fit according to the radb claim-methods.
+        # first, we'll prove that the bug exists (and that this test fails),
+        # and then, we'll fix the code, (so this test succeeds)
 
+        # for testing purposous let's give CEP4 storage a total size of 100
+        cep4_id = 117
+        self.assertTrue(self.radb.updateResourceAvailability(cep4_id, available_capacity=100, total_capacity=100))
+        self.assertEqual(100, self.radb.getResources(cep4_id, include_availability=True)[0]['total_capacity'])
+
+        now = datetime.utcnow()
+        now -= timedelta(minutes=now.minute, seconds=now.second, microseconds=now.microsecond) # round to full hour
+
+        #insert one task, and reuse that for multiple overlapping claims
+        result = self.radb.insertSpecificationAndTask(0, 0, 'approved', 'observation', now, now+timedelta(hours=1), 'foo', 'CEP4')
+        self.assertTrue(result['inserted'])
+        task_id = result['task_id']
+
+        task = self.radb.getTask(task_id)
+        self.assertTrue(task)
+        self.assertEqual(task_id, task['id'])
+
+        #create two overlapping claims
+        claims = [ { 'resource_id': cep4_id,
+                      'starttime': now,
+                      'endtime': now+timedelta(hours=0.75),
+                      'status': 'tentative',
+                      'claim_size': 40 },
+                   {'resource_id': cep4_id,
+                    'starttime': now+timedelta(hours=0.25),
+                    'endtime': now + timedelta(hours=1),
+                    'status': 'tentative',
+                    'claim_size': 40} ]
+
+        # insert the claims
+        claim_ids = self.radb.insertResourceClaims(task_id, claims, 'foo', 1, 1)
+        self.assertEqual(2, len(claim_ids))
+        claims_org = claims
+
+        #get claim using t1_claim_ids, and check if db version is equal to original
+        claims = self.radb.getResourceClaims(claim_ids=claim_ids)
+        self.assertEqual(2, len(claims))
+        for claim, claim_org in zip(claims, claims_org):
+            for key, value in claim_org.items():
+                if key != 'status':
+                    self.assertEqual(value, claim_org[key])
+
+        # try to update the claim status to claimed, should succeed.
+        self.assertTrue(self.radb.updateResourceClaims(claim_ids, status='claimed'))
+        for claim in self.radb.getResourceClaims(claim_ids=claim_ids):
+            self.assertEqual('claimed', claim['status'])
+
+        # check the resource usage trend
+        logger.info("resource usages:\n%s", pformat(self.radb.getResourceUsages(now-timedelta(hours=1.0), now+timedelta(hours=2.0), cep4_id)))
+        self.assertEqual(0, self.radb.get_max_resource_usage_between(cep4_id, now-timedelta(hours=1.0), now-timedelta(hours=0.01), 'claimed')['usage'])
+        self.assertEqual(40, self.radb.get_max_resource_usage_between(cep4_id, now+timedelta(hours=0.0), now+timedelta(hours=0.2), 'claimed')['usage'])
+        self.assertEqual(80, self.radb.get_max_resource_usage_between(cep4_id, now+timedelta(hours=0.3), now+timedelta(hours=0.6), 'claimed')['usage'])
+        self.assertEqual(40, self.radb.get_max_resource_usage_between(cep4_id, now+timedelta(hours=0.80), now+timedelta(hours=1.0), 'claimed')['usage'])
+
+        #check for a time range encapsulating the full task
+        self.assertEqual(80, self.radb.get_max_resource_usage_between(cep4_id, now+timedelta(hours=-0.1), now+timedelta(hours=1.1), 'claimed')['usage'])
+
+        #check for a time range not including the task
+        self.assertEqual(0, self.radb.get_max_resource_usage_between(cep4_id, now+timedelta(hours=1.1), now+timedelta(hours=2.0), 'claimed')['usage'])
+        self.assertEqual(0, self.radb.get_max_resource_usage_between(cep4_id, now-timedelta(hours=1.1), now-timedelta(hours=1.0), 'claimed')['usage'])
+
+        # check that there are no overlapping conflicting claims/tasks
+        for claim in claims:
+            #both claims should overlap with one (the other) claim
+            self.assertEqual(1, len(self.radb.get_overlapping_claims(claim['id'], 'claimed')))
+            self.assertEqual(1, len(self.radb.get_overlapping_tasks(claim['id'], 'claimed')))
+
+            #and there should be no overlapping claims of other status
+            self.assertEqual(0, len(self.radb.get_overlapping_claims(claim['id'], 'tentative')))
+            self.assertEqual(0, len(self.radb.get_overlapping_tasks(claim['id'], 'tentative')))
+
+        #check claimable_capacity for various timestamps
+        self.assertEqual(100, self.radb.get_resource_claimable_capacity(cep4_id, now-timedelta(hours=1.0), now-timedelta(hours=1.0))['claimable_capacity'])
+        self.assertEqual(60, self.radb.get_resource_claimable_capacity(cep4_id, now+timedelta(hours=0.0), now+timedelta(hours=0.0))['claimable_capacity'])
+        self.assertEqual(60, self.radb.get_resource_claimable_capacity(cep4_id, now+timedelta(hours=0.2), now+timedelta(hours=0.2))['claimable_capacity'])
+        self.assertEqual(20, self.radb.get_resource_claimable_capacity(cep4_id, now+timedelta(hours=0.3), now+timedelta(hours=0.3))['claimable_capacity'])
+        self.assertEqual(20, self.radb.get_resource_claimable_capacity(cep4_id, now+timedelta(hours=0.5), now+timedelta(hours=0.5))['claimable_capacity'])
+        self.assertEqual(60, self.radb.get_resource_claimable_capacity(cep4_id, now+timedelta(hours=0.75), now+timedelta(hours=0.75))['claimable_capacity'])
+        self.assertEqual(60, self.radb.get_resource_claimable_capacity(cep4_id, now+timedelta(hours=0.8), now+timedelta(hours=0.8))['claimable_capacity'])
+        self.assertEqual(100, self.radb.get_resource_claimable_capacity(cep4_id, now+timedelta(hours=1.0), now+timedelta(hours=1.0))['claimable_capacity'])
+        self.assertEqual(100, self.radb.get_resource_claimable_capacity(cep4_id, now+timedelta(hours=10.0), now+timedelta(hours=10.0))['claimable_capacity'])
+
+        #check claimable_capacity for full task's timewindow (+extra)
+        self.assertEqual(20, self.radb.get_resource_claimable_capacity(cep4_id, now-timedelta(hours=10.0), now+timedelta(hours=10.0))['claimable_capacity'])
+
+
+        #add an extra claim, overlapping with only the last claim of size 40. So it should fit (100-40=60 and 60>30).
+        extra_claim = { 'resource_id': cep4_id,
+                        'starttime': now+timedelta(hours=0.8),
+                        'endtime': now+timedelta(hours=0.9),
+                        'status': 'tentative',
+                        'claim_size': 30 }
+        extra_claim_ids = self.radb.insertResourceClaims(task_id, [extra_claim], 'foo', 1, 1)
+        self.assertEqual(1, len(extra_claim_ids))
+
+        #check the extra_claim's status, should be tentative. (used to be conflict before bug of 2017-08-16)
+        for claim in self.radb.getResourceClaims(claim_ids=extra_claim_ids):
+            self.assertEqual('tentative', claim['status'])
+
+        # update the extra_claim status to 'claimed'. Should succeed.
+        self.assertTrue(self.radb.updateResourceClaims(extra_claim_ids, status='claimed'))  #(used to fail before bug of 2017-08-16)
+        for claim in self.radb.getResourceClaims(claim_ids=extra_claim_ids):
+            self.assertEqual('claimed', claim['status']) #(used to be conflict before bug of 2017-08-16)
+
+        #and finally, the task should be able to be scheduled as well.
+        self.assertTrue(self.radb.updateTask(task_id, task_status='scheduled'))
+        self.assertEqual('scheduled', self.radb.getTask(task_id)['status'])
+
+    def test_reinsert_task(self):
+        # this is a special testcase to prove a bug found at 2017-08-28
+        # the bug was that a specification is re-inserted, which causes the original spec to be deleted...
+        # ... wich cascades, and deletes the task, and its claims, and it's usages, but that failed on the usages.
+        # I've tried to reproduce the above bug which we see in production,
+        # but unfortunately, I cannot reproduce it. The code just works as intended.
+        # So, after consulting with JDM and AR, we decided to keep this test, and develop a consistency-check-method on the usage table.
+        # We'll keep this new test anyway, just to prove that these cases work as expected.
+
+        # for testing purposous let's give CEP4 storage a total size of 100
+        cep4_id = 117
+        self.assertTrue(self.radb.updateResourceAvailability(cep4_id, available_capacity=100, total_capacity=100))
+        self.assertEqual(100, self.radb.getResources(cep4_id, include_availability=True)[0]['total_capacity'])
+
+        now = datetime.utcnow()
+        now -= timedelta(minutes=now.minute, seconds=now.second, microseconds=now.microsecond)  # round to full hour
+
+        # insert one task, and reuse that for multiple overlapping claims
+        result = self.radb.insertSpecificationAndTask(0, 0, 'approved', 'observation', now, now + timedelta(hours=1), 'first content',
+                                                      'CEP4')
+        self.assertTrue(result['inserted'])
+        task_id = result['task_id']
+
+        task = self.radb.getTask(task_id)
+        self.assertTrue(task)
+        self.assertEqual(task_id, task['id'])
+        self.assertEqual('first content', self.radb.getSpecification(task['specification_id'])['content'])
+
+        # prove that we can re-insert the spec/task, and that the new task is indeed inserted and new
+        result = self.radb.insertSpecificationAndTask(0, 0, 'approved', 'observation', now, now + timedelta(hours=1), 'second content',
+                                                      'CEP4')
+        self.assertTrue(result['inserted'])
+        self.assertNotEqual(task_id, result['task_id']) # we should have a new id because it was re-inserted
+        task_id = result['task_id']
+
+        task = self.radb.getTask(task_id)
+        self.assertTrue(task)
+        self.assertEqual(task_id, task['id'])
+        self.assertEqual('second content', self.radb.getSpecification(task['specification_id'])['content']) #spec content should have been renewed
+
+        # create and insert a claim
+        claim = {'resource_id': cep4_id,
+                 'starttime': task['starttime'],
+                 'endtime': task['endtime'],
+                 'status': 'tentative',
+                 'claim_size': 40}
+        claim_ids = self.radb.insertResourceClaims(task_id, [claim], 'foo', 1, 1)
+        self.assertEqual(1, len(claim_ids))
+        self.assertEqual(1, len(self.radb.getResourceClaims(claim_ids=claim_ids)))
+
+        #check the extra_claim's status, should be tentative.
+        for claim in self.radb.getResourceClaims(claim_ids=claim_ids):
+            self.assertEqual('tentative', claim['status'])
+
+        # update the extra_claim status to 'claimed'. Should succeed.
+        self.assertTrue(self.radb.updateResourceClaims(claim_ids, status='claimed'))
+        self.assertEqual(1, len(self.radb.getResourceClaims(claim_ids=claim_ids)))
+        for claim in self.radb.getResourceClaims(claim_ids=claim_ids):
+            self.assertEqual('claimed', claim['status'])
+
+        self.assertEqual( 0, self.radb.get_resource_usage_at_or_before(cep4_id, now-timedelta(hours=0.5), 'claimed')['usage'])
+        self.assertEqual(40, self.radb.get_resource_usage_at_or_before(cep4_id, now+timedelta(hours=0.5), 'claimed')['usage'])
+        self.assertEqual( 0, self.radb.get_resource_usage_at_or_before(cep4_id, now+timedelta(hours=1.5), 'claimed')['usage'])
+
+        # prove again that we can re-insert the spec/task (now with claims), and that the new task is indeed inserted and new,
+        # and that the claim(s) and usage(s) were actually deleted (via cascading deletes)
+        result = self.radb.insertSpecificationAndTask(0, 0, 'approved', 'observation', now, now + timedelta(hours=1), 'third content',
+                                                      'CEP4')
+        self.assertTrue(result['inserted'])
+        self.assertNotEqual(task_id, result['task_id']) # we should have a new id because it was re-inserted
+        task_id = result['task_id']
+
+        task = self.radb.getTask(task_id)
+        self.assertTrue(task)
+        self.assertEqual(task_id, task['id'])
+        self.assertEqual('third content', self.radb.getSpecification(task['specification_id'])['content']) #spec content should have been renewed
+
+        # this newly inserted spec/task should have no claims anymore
+        self.assertEqual( 0, len(self.radb.getResourceClaims()))
+        # and all usages should now be 0
+        self.assertEqual( 0, self.radb.get_resource_usage_at_or_before(cep4_id, now-timedelta(hours=0.5), 'claimed')['usage'])
+        self.assertEqual( 0, self.radb.get_resource_usage_at_or_before(cep4_id, now+timedelta(hours=0.5), 'claimed')['usage'])
+        self.assertEqual( 0, self.radb.get_resource_usage_at_or_before(cep4_id, now+timedelta(hours=1.5), 'claimed')['usage'])
+
+        # 2017-08-29: ok, we could not reproduce the bug found on production,
+        # so it seems there is a strange corner case which caused the usages table to become inconsistent.
+        # after consulting with JDM and AR, we decided to mimic this inconsistency by 'corrupting' the table manually in this test,
+        # and then act on the inconsistent table by detecting the inconsistency, and automatically repairing the usages table.
+        # so, let's do that in the remainder of this test.
+
+        #insert a claim again (cause we don't have a claim anymore since we inserted the spec/taks above)
+        claim = {'resource_id': cep4_id,
+                 'starttime': task['starttime'],
+                 'endtime': task['endtime'],
+                 'status': 'tentative',
+                 'claim_size': 40}
+        claim_ids = self.radb.insertResourceClaims(task_id, [claim], 'foo', 1, 1)
+        self.assertEqual(1, len(claim_ids))
+        self.assertEqual(1, len(self.radb.getResourceClaims(claim_ids=claim_ids)))
+
+        # usages should be ok
+        self.assertEqual( 0, self.radb.get_resource_usage_at_or_before(cep4_id, now-timedelta(hours=0.5), 'tentative')['usage'])
+        self.assertEqual(40, self.radb.get_resource_usage_at_or_before(cep4_id, now+timedelta(hours=0.5), 'tentative')['usage'])
+        self.assertEqual( 0, self.radb.get_resource_usage_at_or_before(cep4_id, now+timedelta(hours=1.5), 'tentative')['usage'])
+
+        # now let's break the usages table (intentionally, to mimic the production inconsistenty)
+        # we shift one entry (where the claim starts) by one minute
+        # result should be that when we change the claim (or delete the claim cause it's task/spec was deleted),
+        # that the associated usage at the claim's starttime cannot be found anymore (which is the bug on production).
+        self.radb._executeQuery("UPDATE resource_allocation.resource_usage SET as_of_timestamp = %s WHERE  as_of_timestamp = %s;", (now+timedelta(minutes=1), now))
+
+        # check that the usages were indeed changed (the first one shifted in time)
+        usages = self.radb.getResourceUsages()[cep4_id]['tentative']
+        self.assertEqual({'usage': 40, 'as_of_timestamp': now+timedelta(minutes=1)}, usages[0])
+        self.assertEqual({'usage':  0, 'as_of_timestamp': task['endtime']}, usages[1])
+
+        # and prove again that we can re-insert the spec/task (now with claims and a corrupted usage table), and that the new task is indeed inserted and new,
+        # and that the claim(s) and usage(s) were actually deleted (via cascading deletes)
+        # 2017-08-29: YEAH! the insert fails just like on production. Now we can start making a fix!
+        result = self.radb.insertSpecificationAndTask(0, 0, 'approved', 'observation', now, now + timedelta(hours=1), 'fourth content',
+                                                      'CEP4')
+        self.assertTrue(result['inserted'])
+        self.assertNotEqual(task_id, result['task_id']) # we should have a new id because it was re-inserted
+        task_id = result['task_id']
+
+        task = self.radb.getTask(task_id)
+        self.assertTrue(task)
+        self.assertEqual(task_id, task['id'])
+        self.assertEqual('fourth content', self.radb.getSpecification(task['specification_id'])['content']) #spec content should have been renewed
+
+        # this newly inserted spec/task should have no claims anymore
+        self.assertEqual( 0, len(self.radb.getResourceClaims()))
+        # and all usages should now be 0
+        self.assertEqual( 0, self.radb.get_resource_usage_at_or_before(cep4_id, now-timedelta(hours=0.5), 'tentative')['usage'])
+        self.assertEqual( 0, self.radb.get_resource_usage_at_or_before(cep4_id, now+timedelta(hours=0.5), 'tentative')['usage'])
+        self.assertEqual( 0, self.radb.get_resource_usage_at_or_before(cep4_id, now+timedelta(hours=1.5), 'tentative')['usage'])
+
+    def test_claims_on_partially_misc_filled_resource(self):
+        # this is a special testcase to prove a bug found at 2017-08-24
+        # the bug was that a claim that should fit, does not fit according to the radb claim-methods.
+        # the reason that it (erroneously) does not fit is an error in the get_resource_claimable_capacity_between method in sql.
+        # first, we'll prove that the bug exists (and that this test fails),
+        # and then, we'll fix the code, (so this test succeeds)
+
+        #first make sure that there are no specs/tasks/claims lingering around
+        for spec in self.radb.getSpecifications():
+            self.radb.deleteSpecification(spec['id']) # cascades into tasks and claims
+
+        # for testing purposous let's give CEP4 storage a total size of 100
+        cep4_id = 117
+        self.assertTrue(self.radb.updateResourceAvailability(cep4_id, available_capacity=100, total_capacity=100))
+        self.assertEqual(100, self.radb.getResources(cep4_id, include_availability=True)[0]['total_capacity'])
+        self.assertEqual(100, self.radb.getResources(cep4_id, include_availability=True)[0]['available_capacity'])
+        self.assertEqual(  0, self.radb.getResources(cep4_id, include_availability=True)[0]['used_capacity'])
+        self.assertEqual(  0, self.radb.getResources(cep4_id, include_availability=True)[0]['misc_used_capacity'])
+
+        now = datetime.utcnow()
+        start = now - timedelta(minutes=now.minute, seconds=now.second, microseconds=now.microsecond) # round to current full hour
+
+        #insert a task
+        result = self.radb.insertSpecificationAndTask(0, 0, 'approved', 'observation', start, start+timedelta(hours=2), 'foo', 'CEP4')
+        self.assertTrue(result['inserted'])
+        task_id = result['task_id']
+
+        task = self.radb.getTask(task_id)
+        self.assertTrue(task)
+        self.assertEqual(task_id, task['id'])
+
+        #check if there is indeed still 100 claimable_capacity, and that there is no resource_usage
+        #because there are no claims yet.
+        self.assertEqual(100, self.radb.get_resource_claimable_capacity(cep4_id, task['starttime'], task['endtime'])['claimable_capacity'])
+        self.assertEqual(0, self.radb.get_max_resource_usage_between(cep4_id, task['starttime'], task['endtime'], 'claimed')['usage'])
+        self.assertEqual(0, self.radb.get_current_resource_usage(cep4_id, 'claimed')['usage'])
+
+        #add a claim for the task which should fit.
+        #there is 100 available
+        claim = { 'resource_id': cep4_id,
+                  'starttime': task['starttime'],
+                  'endtime': task['endtime'],
+                  'status': 'tentative',
+                  'claim_size': 60 }
+        claim_id = self.radb.insertResourceClaims(task_id, [claim], 'foo', 1, 1)[0]
+        claim = self.radb.getResourceClaims(claim_ids=[claim_id])[0]
+        self.assertEqual('tentative', claim['status'])
+
+        # because the claim is still tentative, there should be 100 claimable_capacity left
+        self.assertEqual(100, self.radb.get_resource_claimable_capacity(cep4_id, task['starttime'], task['endtime'])['claimable_capacity'])
+
+        # and the capacities of the resource should still be the same as in the beginning
+        self.assertEqual(100, self.radb.getResources(cep4_id, include_availability=True)[0]['total_capacity'])
+        self.assertEqual(100, self.radb.getResources(cep4_id, include_availability=True)[0]['available_capacity'])
+        self.assertEqual(  0, self.radb.getResources(cep4_id, include_availability=True)[0]['used_capacity'])
+        self.assertEqual(  0, self.radb.getResources(cep4_id, include_availability=True)[0]['misc_used_capacity'])
+
+        # set the status to 'claimed', and check it.
+        self.assertTrue(self.radb.updateResourceClaims(claim_id, status='claimed'))
+        claim = self.radb.getResourceClaims(claim_ids=[claim_id])[0]
+        self.assertEqual('claimed', claim['status'])
+
+        #now the resource_usage should be 60
+        self.assertEqual(60, self.radb.get_max_resource_usage_between(cep4_id, task['starttime'], task['endtime'], 'claimed')['usage'])
+        self.assertEqual(60, self.radb.get_current_resource_usage(cep4_id, 'claimed')['usage'])
+        self.assertEqual( 0, self.radb.get_resource_usage_at_or_before(cep4_id, start-timedelta(hours=1), 'claimed')['usage'])
+        self.assertEqual(60, self.radb.get_resource_usage_at_or_before(cep4_id, claim['starttime'], 'claimed')['usage'])
+        self.assertEqual(60, self.radb.get_resource_usage_at_or_before(cep4_id, start+timedelta(hours=0.25), 'claimed')['usage'])
+        self.assertEqual( 0, self.radb.get_resource_usage_at_or_before(cep4_id, claim['endtime'], 'claimed')['usage'])
+        self.assertEqual( 0, self.radb.get_resource_usage_at_or_before(cep4_id, task['endtime'], 'claimed')['usage'])
+        self.assertEqual( 0, self.radb.get_resource_usage_at_or_before(cep4_id, task['endtime']+timedelta(hours=1), 'claimed')['usage'])
+
+        # assume the data has NOT been written YET, and that the claim of size 60 does NOT occupy 60 YET on the resource
+        # this happens the during of the observation. Data is being written, but the system does not know it yet.
+        # then there should be still be 100-nothing=100 claimable_capacity left
+        self.assertEqual(100, self.radb.get_resource_claimable_capacity(cep4_id, task['starttime'], task['endtime'])['claimable_capacity'])
+
+        # assume the observation finished, and data has been written
+        # so, the claim of size 60 now occupies 60 on the resource
+        # that would be detected (by the storagequeryservice) and propagated into the radb
+        # so, let's update the available_capacity
+        self.assertTrue(self.radb.updateResourceAvailability(cep4_id, available_capacity=100-60))
+        # and there should be 100-60=40 claimable_capacity left
+        self.assertEqual(40, self.radb.get_resource_claimable_capacity(cep4_id, task['starttime'], task['endtime'])['claimable_capacity'])
+
+        # check the capacities of the resource
+        # please note that the misc_used_capacity=0 because we used exactly the same amount of diskspace as was claimed (as it should be)
+        self.assertEqual(100, self.radb.getResources(cep4_id, include_availability=True)[0]['total_capacity'])
+        self.assertEqual( 40, self.radb.getResources(cep4_id, include_availability=True)[0]['available_capacity'])
+        self.assertEqual( 60, self.radb.getResources(cep4_id, include_availability=True)[0]['used_capacity'])
+        self.assertEqual(  0, self.radb.getResources(cep4_id, include_availability=True)[0]['misc_used_capacity'])
+
+        # so far, so good...
+        # now onto the situation in practice....
+        # suppose there is some additional (20) miscelaneous data on cep4, which is not known in claims (like backups/logs/other_data)
+        # this should be reflected in the available_capacity and  misc_used_capacity
+        # available_capacity = 100-60-20 : 60 is claimed and in use, and 20 is other unaccounted for data.
+        self.assertTrue(self.radb.updateResourceAvailability(cep4_id, available_capacity=100-60-20))
+        self.assertEqual(100, self.radb.getResources(cep4_id, include_availability=True)[0]['total_capacity'])
+        self.assertEqual( 20, self.radb.getResources(cep4_id, include_availability=True)[0]['available_capacity'])
+        self.assertEqual( 80, self.radb.getResources(cep4_id, include_availability=True)[0]['used_capacity'])
+        # and the used_capacity of 70 should be build up of the parts: resource_usage=50 and misc_used_capacity=20
+        self.assertEqual( 60, self.radb.get_resource_usage_at_or_before(cep4_id, start+timedelta(hours=0.5), 'claimed')['usage'])
+        self.assertEqual( 20, self.radb.getResources(cep4_id, include_availability=True)[0]['misc_used_capacity'])
+        # and the resource_usage should still be 50 (cause no claims were added/changed)
+        self.assertEqual(60, self.radb.get_max_resource_usage_between(cep4_id, task['starttime'], task['endtime'], 'claimed')['usage'])
+        self.assertEqual(60, self.radb.get_current_resource_usage(cep4_id, 'claimed')['usage'])
+        # but, there should be less claimable capacity left: 100 -60 (claim) -20 (misc_data) = 20 claimable_capacity left
+        self.assertEqual(20, self.radb.get_resource_claimable_capacity(cep4_id, task['starttime'], task['endtime'])['claimable_capacity'])
+        # and for a new task (where there are no claims yet), there should be less claimable capacity left: 100-20 (misc_data) = 80 claimable_capacity left
+        self.assertEqual(80, self.radb.get_resource_claimable_capacity(cep4_id, task['endtime'] + timedelta(hours=1), task['endtime'] + timedelta(hours=2))['claimable_capacity'])
+
+        #so, it should be possible to add an extra claim of 15 during this task (which should fit!)
+        claim2 = { 'resource_id': cep4_id,
+                   'starttime': task['starttime'],
+                   'endtime': task['endtime'],
+                   'status': 'tentative',
+                   'claim_size': 15 }
+        claim2_id = self.radb.insertResourceClaims(task_id, [claim2], 'foo', 1, 1)[0]
+        claim2 = self.radb.getResourceClaims(claim_ids=[claim2_id])[0]
+        self.assertEqual('tentative', claim2['status'])
+
+        # and the claim should be able to have the status set to 'claimed'. check it.
+        self.assertTrue(self.radb.updateResourceClaims(claim2_id, status='claimed'))
+        claim2 = self.radb.getResourceClaims(claim_ids=[claim2_id])[0]
+        self.assertEqual('claimed', claim2['status'])
+
+        #and, it should also be possible to add an extra claim of 75 after this task (where there is no claim yet) (which should fit!)
+        claim3 = { 'resource_id': cep4_id,
+                   'starttime': task['endtime'] + timedelta(hours=1),
+                   'endtime': task['endtime'] + timedelta(hours=2),
+                   'status': 'tentative',
+                   'claim_size': 75 }
+        claim3_id = self.radb.insertResourceClaims(task_id, [claim3], 'foo', 1, 1)[0]
+        claim3 = self.radb.getResourceClaims(claim_ids=[claim3_id])[0]
+        self.assertEqual('tentative', claim3['status'])
+
+        # and the claim should be able to have the status set to 'claimed'. check it.
+        self.assertTrue(self.radb.updateResourceClaims(claim3_id, status='claimed'))
+        claim3 = self.radb.getResourceClaims(claim_ids=[claim3_id])[0]
+        self.assertEqual('claimed', claim3['status'])
 
 if __name__ == "__main__":
     os.environ['TZ'] = 'UTC'
diff --git a/SAS/ResourceAssignment/ResourceAssignmentEditor/bin/raewebservice.ini b/SAS/ResourceAssignment/ResourceAssignmentEditor/bin/raewebservice.ini
index a4bb85e8ea9ddd771739132be83ed5157fe51264..0095ddcd2b3a0db93aec6a0763a1778e7722f060 100644
--- a/SAS/ResourceAssignment/ResourceAssignmentEditor/bin/raewebservice.ini
+++ b/SAS/ResourceAssignment/ResourceAssignmentEditor/bin/raewebservice.ini
@@ -1,5 +1,5 @@
 [program:raewebservice]
-command=/bin/bash -c 'source $LOFARROOT/lofarinit.sh;exec raewebservice -p 7412'
+command=/bin/bash -c 'source $LOFARROOT/lofarinit.sh;exec raewebservice'
 user=lofarsys
 stopsignal=INT ; KeyboardInterrupt
 stopasgroup=true ; bash does not propagate signals
diff --git a/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/changeshandler.py b/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/changeshandler.py
index 5fbe368f15787ffa196a0586e04f400ae61a78ca..cbeca9a749b1278b110e9f1f5d9fcff164756623 100644
--- a/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/changeshandler.py
+++ b/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/changeshandler.py
@@ -127,7 +127,7 @@ class ChangesHandler:
         '''_handleChange appends a change in the changes list and calls the onChangedCallback.
         :param change: dictionary with the change'''
         with self._lock:
-            change['timestamp'] = datetime.utcnow().isoformat()
+            change['timestamp'] = datetime.utcnow()
             self._changeNumber += 1
             change['changeNumber'] = self._changeNumber
             self._changes.append(change)
@@ -254,9 +254,6 @@ class ChangesHandler:
         self._handleChange(change)
 
     def getEventsSince(self, since_timestamp):
-        if isinstance(since_timestamp, datetime):
-            since_timestamp = since_timestamp.isoformat()
-
         with self._lock:
             return [x for x in self._changes if x['changeType'] == CHANGE_EVENT_TYPE and x['timestamp'] >= since_timestamp]
 
@@ -267,12 +264,6 @@ class ChangesHandler:
         return -1L
 
     def clearChangesBefore(self, min_timestamp_for_changes, min_timestamp_for_logevents):
-        if isinstance(min_timestamp_for_changes, datetime):
-            min_timestamp_for_changes = min_timestamp_for_changes.isoformat()
-
-        if isinstance(min_timestamp_for_logevents, datetime):
-            min_timestamp_for_logevents = min_timestamp_for_logevents.isoformat()
-
         with self._lock:
             self._changes = [x for x in self._changes
                              if ((x['changeType'] == CHANGE_EVENT_TYPE and x['timestamp'] >= min_timestamp_for_logevents) or
diff --git a/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/mom.py b/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/mom.py
index 6134a9152f2a6663b2f494b2115d2aa21b9615a7..b59b5ef705b9a1e75d4373880153fe9bfcb3606a 100644
--- a/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/mom.py
+++ b/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/mom.py
@@ -71,6 +71,9 @@ def updateTaskMomDetails(task, momrpc):
                 t['mom_object_group_mom2object_id'] = m.get('object_group_mom2objectid')
                 t['mom_object_parent_group_id'] = m['parent_group_mom2id']
                 t['mom_object_parent_group_name'] = m['parent_group_name']
+            elif t['type'] == 'reservation':
+                t['project_name'] = 'Reservations'
+                t['project_mom_id'] = -97
             else:
                 t['project_name'] = 'OTDB Only'
                 t['project_mom_id'] = -98
diff --git a/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/static/app/controllers/chartresourceusagecontroller.js b/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/static/app/controllers/chartresourceusagecontroller.js
index de53c8935453539e956a1c2ae562ee44f877b138..443eca9eaa32ca8425c95577a4c1b35e90d815e7 100644
--- a/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/static/app/controllers/chartresourceusagecontroller.js
+++ b/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/static/app/controllers/chartresourceusagecontroller.js
@@ -86,6 +86,17 @@ chartResourceUsageControllerMod.controller('ChartResourceUsageController', ['$sc
         }
 
         var selected_resource_id = $scope.dataService.selected_resource_id;
+        if(selected_resource_id === undefined) {
+            //try to select first storage resource as default selected_resource_id
+            var storageResources = $scope.dataService.resources.filter(function(r) { return r.type_name == 'storage'; });
+            if(storageResources.length > 0) {
+                $scope.dataService.selected_resource_id = storageResources[0].id;
+            } else {
+                //else, just the first resource
+                $scope.dataService.selected_resource_id = self.resources[0].id;
+            }
+        }
+
         if(selected_resource_id === undefined)
             return;
 
@@ -168,7 +179,16 @@ chartResourceUsageControllerMod.controller('ChartResourceUsageController', ['$sc
                             value = usage.usage;
                         }
                     }
-                    usage_data.push([timestamp.getTime(), value]);
+                    if(usage_data.length > 0) {
+                        //overwrite last value if timestamps are equal, otherwise append
+                        if(usage_data[usage_data.length-1][0] == timestamp.getTime()) {
+                            usage_data[usage_data.length-1][1] = value;
+                        } else {
+                            usage_data.push([timestamp.getTime(), value]);
+                        }
+                    } else {
+                        usage_data.push([timestamp.getTime(), value]);
+                    }
                     t_idx += 1;
                 }
 
@@ -246,7 +266,6 @@ chartResourceUsageControllerMod.controller('ChartResourceUsageController', ['$sc
         }
     };
 
-    $scope.$watch('dataService.selected_resource_id', updateChartDataAsync);
     $scope.$watch('dataService.resourceUsagesForSelectedResource', updateChartDataAsync);
     $scope.$watch('dataService.viewTimeSpan', updateChartDataAsync, true);
     $scope.$watch('$parent.enabled', function() { setTimeout(updateChartDataAsync, 500); } );
diff --git a/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/static/app/controllers/cleanupcontroller.js b/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/static/app/controllers/cleanupcontroller.js
index 10baa4d077e98382f155673f5494d8a295ab949f..e973db2bd649e778de1b06d5b526ebe0ad28e213 100644
--- a/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/static/app/controllers/cleanupcontroller.js
+++ b/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/static/app/controllers/cleanupcontroller.js
@@ -135,8 +135,8 @@ cleanupControllerMod.controller('CleanupController', ['$scope', '$uibModal', '$m
         });
     };
 
-    function deleteTaskData(task, delete_is, delete_cs, delete_uv, delete_im, delete_img, delete_pulp, delete_scratch) {
-        var params = {delete_is:delete_is, delete_cs:delete_cs, delete_uv:delete_uv, delete_im:delete_im, delete_img:delete_img, delete_pulp:delete_pulp, delete_scratch:delete_scratch};
+    function deleteTaskData(task, delete_is, delete_cs, delete_uv, delete_im, delete_img, delete_pulp, delete_scratch, force_delete=false) {
+        var params = {delete_is:delete_is, delete_cs:delete_cs, delete_uv:delete_uv, delete_im:delete_im, delete_img:delete_img, delete_pulp:delete_pulp, delete_scratch:delete_scratch, force_delete:force_delete};
         $http.delete('/rest/tasks/' + task.id + '/cleanup', {data: params}).error(function(result) {
             console.log("Error. Could cleanup data for task " + task.id + ", " + result);
         }).success(function(result) {
@@ -163,6 +163,8 @@ cleanupControllerMod.controller('CleanupController', ['$scope', '$uibModal', '$m
                             <label ng-if="has_scratch" style="margin-left:24px">scratch: {{amount_scratch}}<input style="margin-left:8px" type="checkbox" ng-model="$parent.delete_scratch"></label>\
                         </div>\
                         <div class="modal-footer">\
+                            <label style="margin-right:24px" title="force delete action, even if data is (partially) un-ingested or needed by successor pipeline(s)">force\
+                            <input style="margin-right:2px; margin-top:2px; float: left" type="checkbox" ng-model="$parent.force_delete"></label>\
                             <button class="btn btn-primary" type="button" ng-click="ok()">OK</button>\
                             <button class="btn btn-warning" type="button" autofocus ng-click="cancel()">Cancel</button>\
                         </div>',
@@ -239,7 +241,7 @@ cleanupControllerMod.controller('CleanupController', ['$scope', '$uibModal', '$m
                     $uibModalInstance.close();
                     for(var du_result of du_results) {
                         var task = du_result.task;
-                        deleteTaskData(task, $scope.delete_is, $scope.delete_cs, $scope.delete_uv, $scope.delete_im, $scope.delete_img, $scope.delete_pulp, $scope.delete_scratch);
+                        deleteTaskData(task, $scope.delete_is, $scope.delete_cs, $scope.delete_uv, $scope.delete_im, $scope.delete_img, $scope.delete_pulp, $scope.delete_scratch, $scope.force_delete);
                     }
                 };
 
@@ -380,14 +382,6 @@ cleanupControllerMod.controller('CleanupController', ['$scope', '$uibModal', '$m
                     loading: false
                 }
 
-                $scope.totalDiskUsageChartSeries = [];
-
-                var cep4storage_resource = dataService.resources.find(function(r) { return r.name == 'cep4storage'; });
-                if(cep4storage_resource) {
-                    $scope.totalDiskUsageChartSeries = [{name:'Free', data:[100.0*cep4storage_resource.available_capacity/cep4storage_resource.total_capacity], color:'#a3f75c'},
-                                                        {name:'Used', data:[100.0*cep4storage_resource.used_capacity/cep4storage_resource.total_capacity], color:'#f45b5b'}];
-                }
-
                 $scope.totalDiskUsageChartConfig = {
                     options: {
                         chart: {
@@ -435,7 +429,7 @@ cleanupControllerMod.controller('CleanupController', ['$scope', '$uibModal', '$m
                             pointFormat: '{point.name}: <b>{point.percentage:.1f}%</b>'
                         },
                     },
-                    series: $scope.totalDiskUsageChartSeries,
+                    series: [],
                     title: {
                         text: 'CEP4 total disk usage'
                     },
@@ -445,6 +439,27 @@ cleanupControllerMod.controller('CleanupController', ['$scope', '$uibModal', '$m
                     loading: false
                 }
 
+                var cep4storage_resource = dataService.resources.find(function(r) { return r.name == 'CEP4_storage:/data'; });
+                if(cep4storage_resource) {
+                    dataService.getProjectsDiskUsage().then(function(result) {
+                        if(result.found) {
+                            var projects_du = result.projectdir.disk_usage;
+                            var misc_du = cep4storage_resource.used_capacity - projects_du;
+                            var total_cap = cep4storage_resource.total_capacity;
+
+                            $scope.totalDiskUsageChartConfig.series = [{name:'Free ' + dataService.humanreadablesize(cep4storage_resource.available_capacity, 1) + 'B',
+                                                                        data:[100.0*cep4storage_resource.available_capacity/total_cap],
+                                                                        color:'#66ff66'},
+                                                                       {name:'Misc ' + dataService.humanreadablesize(misc_du, 1) + 'B',
+                                                                        data:[100.0*misc_du/total_cap],
+                                                                        color:'#aaaaff'},
+                                                                       {name:'Projects ' + dataService.humanreadablesize(projects_du, 1) + 'B',
+                                                                        data:[100.0*projects_du/total_cap],
+                                                                        color:'#ff6666'}];
+                        }
+                    });
+                }
+
                 var loadTaskDiskUsage = function(otdb_id, force) {
                     $scope.current_otdb_id = otdb_id;
                     $scope.current_project_name = undefined;
diff --git a/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/static/app/controllers/datacontroller.js b/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/static/app/controllers/datacontroller.js
index c4f6bbc54d0f4ae2e9c2870a568edc805254c9a3..88fee8beb924f412664c11aff40efb4e27068ae6 100644
--- a/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/static/app/controllers/datacontroller.js
+++ b/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/static/app/controllers/datacontroller.js
@@ -25,6 +25,7 @@ angular.module('raeApp').factory("dataService", ['$http', '$q', function($http,
     self.resourcesWithClaims = [];
 
     self.filteredTasks = [];
+    self.filteredTasksDict = {};
 
     self.taskTimes = {};
     self.resourceClaimTimes = {};
@@ -60,15 +61,15 @@ angular.module('raeApp').factory("dataService", ['$http', '$q', function($http,
     //loadResourceClaims is enabled when any controller using resourceclaims is enabled
     self.loadResourceClaims = false;
 
-    self.humanreadablesize = function(num) {
+    self.humanreadablesize = function(num, num_digits=3) {
         var units = ['', 'K', 'M', 'G', 'T', 'P', 'E', 'Z'];
         for(unit of units) {
             if(Math.abs(num) < 1000.0) {
-                return num.toPrecision(4).toString() + unit;
+                return num.toFixed(num_digits).toString() + unit;
             }
             num /= 1000.0;
         }
-        return num.toPrecision(5).toString() + 'Y';
+        return num.toFixed(num_digits).toString() + 'Y';
     }
 
     self.isTaskIdSelected = function(task_id) {
@@ -222,28 +223,31 @@ angular.module('raeApp').factory("dataService", ['$http', '$q', function($http,
         //only keep the currently loading chunks
         self.loadingChunksQueue = self.loadingChunksQueue.filter(function(c) { return c.loading; });
 
-        var chunkFactor = self.projectMode ? 7 : 1;
+        var chunkFactor = self.projectMode ? 4 : 1;
         var hourInmsec = 3600000;
-        var dayInmsec = 24*hourInmsec;
+        var quartDayInmsec = 6*hourInmsec;
 
         for (var timestamp = lowerTS; timestamp < upperTS; ) {
             if(self.loadedHours.hasOwnProperty(timestamp)) {
                 timestamp += hourInmsec;
             }
             else {
-                var chuckUpperLimit = Math.min(upperTS, timestamp + chunkFactor*dayInmsec);
+                var chuckUpperLimit = Math.min(upperTS, timestamp + chunkFactor*quartDayInmsec);
                 for (var chunkTimestamp = timestamp; chunkTimestamp < chuckUpperLimit; chunkTimestamp += hourInmsec) {
                     if(self.loadedHours.hasOwnProperty(chunkTimestamp))
                         break;
-
-                    self.loadedHours[chunkTimestamp] = true;
                 }
 
                 var hourLower = new Date(timestamp);
                 var hourUpper = new Date(chunkTimestamp);
                 if(hourUpper > hourLower) {
                     var chunk = { lower: hourLower, upper: hourUpper, loaded: false, loading: false };
-                    self.loadingChunksQueue.push(chunk);
+                    if(hourLower < self.lofarTime) {
+                        //prepend at beginning of queue, so we load most recent data first
+                        self.loadingChunksQueue.unshift(chunk);
+                    } else {
+                        self.loadingChunksQueue.push(chunk);
+                    }
                 }
                 timestamp = chunkTimestamp;
             }
@@ -255,6 +259,11 @@ angular.module('raeApp').factory("dataService", ['$http', '$q', function($http,
         for(var i = 0; i < Math.min(3, self.loadingChunksQueue.length); i++) {
             setTimeout(self.loadNextChunk, i*250);
         }
+
+        //load the usages as well, if needed.
+        if (self.loadResourceClaims) {
+            self.getUsagesForSelectedResource();
+        }
     };
 
     self.loadNextChunk = function() {
@@ -282,6 +291,10 @@ angular.module('raeApp').factory("dataService", ['$http', '$q', function($http,
                 self.nrOfLoadingChunks -= 1;
                 self.nrOfLoadedChunks += 1;
 
+                for (var timestamp = chunk.lower.getTime(); timestamp < chunk.upper.getTime(); timestamp += 3600000) {
+                    self.loadedHours[timestamp] = true;
+                }
+
                 self.loadNextChunk();
             });
         } else {
@@ -629,18 +642,12 @@ angular.module('raeApp').factory("dataService", ['$http', '$q', function($http,
     self.getResources = function() {
         var defer = $q.defer();
         $http.get('/rest/resources').success(function(result) {
-            self.resources = result.resources;
+            //at this moment, we have way too many resources to show in a gantt-tree.
+            //this make the webscheduler way too slow.
+            //so, only show the relevant resources, 116 and 117 which are CEP4 bandwith and storage.
+            self.resources = result.resources.filter(function(r) { return r.id==116 ||  r.id==117;});
             self.resourceDict = self.toIdBasedDict(self.resources);
 
-            //try to select first storage resource as default selected_resource_id
-            var storageResources = self.resources.filter(function(r) { return r.type_name == 'storage'; });
-            if(storageResources.length > 0) {
-                self.selected_resource_id = storageResources[0].id;
-            } else {
-                //else, just the first resource
-                self.selected_resource_id = self.resources[0].id;
-            }
-
             defer.resolve();
         });
 
@@ -759,7 +766,10 @@ angular.module('raeApp').factory("dataService", ['$http', '$q', function($http,
     self.getResourceGroups = function() {
         var defer = $q.defer();
         $http.get('/rest/resourcegroups').success(function(result) {
-            self.resourceGroups = result.resourcegroups;
+            //at this moment, we have way too many resources to show in a gantt-tree.
+            //this make the webscheduler way too slow.
+            //so, only show the relevant resource groups, 1, which is the CEP4 group.
+            self.resourceGroups = result.resourcegroups.filter(function(r) { return r.id==1;});
             self.resourceGroupsDict = self.toIdBasedDict(self.resourceGroups);
 
             defer.resolve();
@@ -1331,7 +1341,10 @@ dataControllerMod.controller('DataController',
         });
     }, true);
 
-    $scope.$watch('dataService.filteredTaskChangeCntr', dataService.computeMinMaxTaskTimes);
+    $scope.$watch('dataService.filteredTaskChangeCntr', function() {
+        dataService.computeMinMaxTaskTimes();
+        dataService.filteredTasksDict = dataService.toIdBasedDict(dataService.filteredTasks);
+    });
 
     $scope.$watch('dataService.lofarTime', function() {
         if(dataService.autoFollowNow && (Math.round(dataService.lofarTime.getTime()/1000))%5==0) {
@@ -1377,13 +1390,6 @@ dataControllerMod.controller('DataController',
         }
     });
 
-    $scope.$watch('dataService.claimChangeCntr', function() {
-        $scope.$evalAsync(function() {
-            $scope.dataService.getUsagesForSelectedResource();
-            $scope.dataService.getResource($scope.dataService.selected_resource_id);
-        });
-    });
-
     $scope.$watch('dataService.selected_resource_id', function() {
         $scope.$evalAsync(function() {
             $scope.dataService.getUsagesForSelectedResource();
diff --git a/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/static/app/controllers/ganttprojectcontroller.js b/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/static/app/controllers/ganttprojectcontroller.js
index 4ebca480cf38a38e819ff72e7901e846d9dde4c5..debb2c8afb8ef9d67c572f1c3183a45b1aaeacdf 100644
--- a/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/static/app/controllers/ganttprojectcontroller.js
+++ b/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/static/app/controllers/ganttprojectcontroller.js
@@ -161,7 +161,7 @@ ganttProjectControllerMod.controller('GanttProjectController', ['$scope', 'dataS
             //start with aggregating all tasks per type,
             //and plot these in the upper rows,
             //so we can see the observartion and pipeline scheduling usage/efficiency
-            for(var type of ['observation', 'pipeline']) {
+            for(var type of ['observation', 'pipeline', 'reservation']) {
                 var typeTasks = tasks.filter(function(t) { return t.type == type;}).sort(function(a, b) { return a.starttime.getTime() -  b.starttime.getTime(); });;
                 var numTypeTasks = typeTasks.length;
 
@@ -265,6 +265,10 @@ ganttProjectControllerMod.controller('GanttProjectController', ['$scope', 'dataS
                         tasks: []
                     };
 
+                    if(task.type == 'reservation' && project.name.toLowerCase().includes('reservation')) {
+                        availableRow.name = project.name;
+                    }
+
                     ganttProjectTypeRows.push(availableRow);
                     ganttRows.push(availableRow);
                 }
diff --git a/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/static/app/controllers/ganttresourcecontroller.js b/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/static/app/controllers/ganttresourcecontroller.js
index 6df74997511eed35e938da801069f054ce7281fe..37006404dcb1c7441c09ff1df3eb99d629afd3de 100644
--- a/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/static/app/controllers/ganttresourcecontroller.js
+++ b/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/static/app/controllers/ganttresourcecontroller.js
@@ -153,7 +153,7 @@ ganttResourceControllerMod.controller('GanttResourceController', ['$scope', 'dat
 
         var resourceGroupMemberships = $scope.dataService.resourceGroupMemberships;
 
-        var taskDict = $scope.dataService.taskDict;
+        var tasksDict = $scope.dataService.filteredTasksDict;
         var numTasks = $scope.dataService.filteredTasks.length;
 
         var resourceClaimDict = $scope.dataService.resourceClaimDict;
@@ -316,7 +316,7 @@ ganttResourceControllerMod.controller('GanttResourceController', ['$scope', 'dat
             //and finally assign each resourceclaim to its resource in each group
             for(var claim of resourceClaims) {
                 var resourceId = claim.resource_id;
-                var task = taskDict[claim.task_id];
+                var task = tasksDict[claim.task_id];
 
                 if(!task) {
                     continue;
@@ -368,24 +368,26 @@ ganttResourceControllerMod.controller('GanttResourceController', ['$scope', 'dat
                     if(claims) {
                         for(var claim of claims) {
                             var taskId = claim.task_id;
-                            var task = taskDict[taskId];
-                            if(taskId in aggregatedClaims) {
-                                if(claim.starttime < aggregatedClaims[taskId].starttime) {
-                                    aggregatedClaims[taskId].starttime = claim.starttime.getTime() > task.starttime.getTime() ? claim.starttime : task.starttime;
-                                }
-                                if(claim.endtime > aggregatedClaims[taskId].endtime) {
-                                    aggregatedClaims[taskId].endtime = claim.endtime.getTime() < task.endtime.getTime() ? claim.endtime: task.endtime;
-                                }
-                                if(claim.status == 'conflict') {
-                                    aggregatedClaims[taskId].status = 'conflict';
-                                } else if(claim.status != aggregatedClaims[taskId].status && aggregatedClaims[taskId].status != 'conflict') {
-                                    aggregatedClaims[taskId].status = 'mixed';
+                            var task = tasksDict[taskId];
+                            if(task) {
+                                if(taskId in aggregatedClaims) {
+                                    if(claim.starttime < aggregatedClaims[taskId].starttime) {
+                                        aggregatedClaims[taskId].starttime = claim.starttime.getTime() > task.starttime.getTime() ? claim.starttime : task.starttime;
+                                    }
+                                    if(claim.endtime > aggregatedClaims[taskId].endtime) {
+                                        aggregatedClaims[taskId].endtime = claim.endtime.getTime() < task.endtime.getTime() ? claim.endtime: task.endtime;
+                                    }
+                                    if(claim.status == 'conflict') {
+                                        aggregatedClaims[taskId].status = 'conflict';
+                                    } else if(claim.status != aggregatedClaims[taskId].status && aggregatedClaims[taskId].status != 'conflict') {
+                                        aggregatedClaims[taskId].status = 'mixed';
+                                    }
+                                } else {
+                                    aggregatedClaims[taskId] = { starttime: claim.starttime,
+                                                                endtime: claim.endtime,
+                                                                status: claim.status
+                                    };
                                 }
-                            } else {
-                                aggregatedClaims[taskId] = { starttime: claim.starttime,
-                                                             endtime: claim.endtime,
-                                                             status: claim.status
-                                };
                             }
                         }
                     }
@@ -424,7 +426,7 @@ ganttResourceControllerMod.controller('GanttResourceController', ['$scope', 'dat
                     for(var ganttRow of ganttRows) {
                         for(var taskId in aggregatedClaims) {
                             var aggClaimForTask = aggregatedClaims[taskId];
-                            var task = taskDict[taskId];
+                            var task = tasksDict[taskId];
                             if(task) {
                                 var claimTask = {
                                     id: 'aggregatedClaimForTask_' + taskId + '_' + ganttRow.id,
diff --git a/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/static/app/controllers/gridcontroller.js b/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/static/app/controllers/gridcontroller.js
index 22ef3636b5adbb06827ee1f62cb8f76ee5877410..e0c916cbdfd29ee745e1e7295950f20e40c567e5 100644
--- a/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/static/app/controllers/gridcontroller.js
+++ b/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/static/app/controllers/gridcontroller.js
@@ -230,7 +230,7 @@ gridControllerMod.controller('GridController', ['$scope', '$window', 'dataServic
     { field: 'cluster',
         displayName: 'Cluster',
         enableCellEdit: false,
-        width: '65',
+        width: '75',
         filter: {
             condition: uiGridConstants.filter.EXACT,
             type: uiGridConstants.filter.SELECT,
@@ -495,7 +495,7 @@ gridControllerMod.controller('GridController', ['$scope', '$window', 'dataServic
             fillTypeColumFilterSelectOptions();
             fillProjectsColumFilterSelectOptions();
             fillGroupsColumFilterSelectOptions();
-            fillColumFilterSelectOptions(['CEP2', 'CEP4'], $scope.columns.find(function(c) {return c.field == 'cluster'; }));
+            fillColumFilterSelectOptions(['CEP2', 'CEP4', 'DRAGNET'], $scope.columns.find(function(c) {return c.field == 'cluster'; }));
         }
     };
 
@@ -765,6 +765,27 @@ gridControllerMod.directive('contextMenu', ['$document', '$window', function($do
                 });
             }
 
+            var selected_post_approved_observations = selected_tasks.filter(function(t) { return t.type ==
+'observation' && t.status != 'approved'; });
+
+            if(selected_post_approved_observations.length > 0 && dataService.config.sky_view_base_url) {
+                var liElement = angular.element('<li><a href="#">Sky view</a></li>');
+                ulElement.append(liElement);
+                liElement.on('click', function() {
+                    closeContextMenu();
+
+                    var window_cntr = 0;
+                    for(var obs of selected_post_approved_observations) {
+                        var url = dataService.config.sky_view_base_url + '/' + obs.otdb_id;
+                        url = row.grid.appScope.sanitize_url(url);
+                        setTimeout(function(url_arg) {
+                            $window.open(url_arg, '_blank');
+                        }, window_cntr*750, url);
+                        window_cntr += 1;
+                    }
+                });
+            }
+
             var ingest_tasks = selected_tasks.filter(function(t) { return t.ingest_status != undefined; });
 
             if(ingest_tasks.length > 0 && dataService.config.lta_base_url) {
@@ -851,36 +872,36 @@ gridControllerMod.directive('contextMenu', ['$document', '$window', function($do
                 });
             }
 
-            var approved_selected_cep4_tasks = selected_cep4_tasks.filter(function(t) { return t.status == 'approved'; });
+            var schedulable_tasks = selected_tasks.filter(function(t) { return t.status == 'approved' || t.status == 'conflict' || t.status == 'error'; });
 
-            if(approved_selected_cep4_tasks.length > 0) {
-                var liContent = '<li><a href="#">Schedule approved CEP4 task(s)</a></li>'
+            if(schedulable_tasks.length > 0) {
+                var liContent = '<li><a href="#">(Re)schedule CEP4 task(s)</a></li>'
                 var liElement = angular.element(liContent);
                 ulElement.append(liElement);
                 liElement.on('click', function() {
                     closeContextMenu();
-                    for(var pl of approved_selected_cep4_tasks) {
+                    for(var pl of schedulable_tasks) {
                         var newTask = { id: pl.id, status: 'prescheduled' };
                         dataService.putTask(newTask);
                     }
                 });
             }
 
-            var scheduled_selected_cep4_tasks = selected_cep4_tasks.filter(function(t) { return (t.status == 'prescheduled' || t.status == 'scheduled' || t.status == 'queued') });
+            var unschedulable_selected_tasks = selected_tasks.filter(function(t) { return t.status == 'prescheduled' || t.status == 'scheduled' || t.status == 'queued' || t.status == 'error' || t.status == 'conflict'; });
 
-            if(scheduled_selected_cep4_tasks.length > 0) {
-                var liContent = '<li><a href="#">Unschedule (pre)scheduled/queued CEP4 tasks</a></li>'
+            if(unschedulable_selected_tasks.length > 0) {
+                var liContent = '<li><a href="#">Unschedule (pre)scheduled/queued/error/conflict tasks</a></li>'
                 var liElement = angular.element(liContent);
                 ulElement.append(liElement);
                 liElement.on('click', function() {
                     closeContextMenu();
-                    for(var t of scheduled_selected_cep4_tasks) {
-                        if(t.status == 'queued') {
-                            var newTask = { id: t.id, status: 'aborted' };
+                    for(var pl of unschedulable_selected_tasks) {
+                        if(pl.status == 'queued') {
+                            var newTask = { id: pl.id, status: 'aborted' };
                             dataService.putTask(newTask);
                         }
 
-                        var newTask = { id: t.id, status: 'approved' };
+                        var newTask = { id: pl.id, status: 'approved' };
                         dataService.putTask(newTask);
                     }
                 });
diff --git a/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/static/css/main.css b/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/static/css/main.css
index 5d3d7dd21d56feeef41530ff4569622a4edff7f0..93140b295decac918922f81e71ff77e969c5f3b9 100644
--- a/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/static/css/main.css
+++ b/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/static/css/main.css
@@ -227,6 +227,10 @@ div.gantt-task.task-status-blocked div{
   background-color: #ccffcc !important;
 }
 
+.grid-cluster-DRAGNET {
+  background-color: #ffffcc !important;
+}
+
 
 
 
diff --git a/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/templates/index.html b/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/templates/index.html
index a49f06ea37fd4b0fa4af736512a54aa6c35248f9..e984e7f3e4fbe60cad50edfdc16d8d5cc1013877 100644
--- a/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/templates/index.html
+++ b/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/templates/index.html
@@ -116,7 +116,7 @@
         </uib-progress>
 
         <div style="float:left; width:100%; top:70px ;" ui-layout options="{flow: 'column'}">
-            <div ng-controller="GridController as gridCtrl" style="margin-right: 4px;" ui-layout-init-min-width="1160px">
+            <div ng-controller="GridController as gridCtrl" style="margin-right: 4px;" ui-layout-init-min-width="1175px">
                 <div id="grid"
                 ui-grid="gridOptions"
                 ui-grid-edit ui-grid-selection ui-grid-cellNav ui-grid-resize-columns ui-grid-auto-resize
diff --git a/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/webservice.py b/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/webservice.py
index 4060cf13096b16d0b1ca5378a395e3267718ab39..461f8860c5130c9854abff54e09ac904a6dd4bf0 100755
--- a/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/webservice.py
+++ b/SAS/ResourceAssignment/ResourceAssignmentEditor/lib/webservice.py
@@ -189,7 +189,8 @@ def projects():
 def config():
     config = {'mom_base_url':'',
               'lta_base_url':'',
-              'inspection_plots_base_url':'https://proxy.lofar.eu/inspect/HTML/'}
+              'inspection_plots_base_url':'https://proxy.lofar.eu/inspect/HTML/',
+              'sky_view_base_url':'http://dop344.astron.nl:5000/uvis/id'}
 
     if isProductionEnvironment():
         config['mom_base_url'] = 'https://lofar.astron.nl/mom3'
@@ -214,6 +215,32 @@ def resource(resource_id):
         return jsonify(result[0])
     return jsonify({})
 
+@app.route('/rest/resources/<int:resource_id>/resourceclaims')
+@gzipped
+def resourceclaimsForResource(resource_id):
+    return resourceclaimsForResourceFromUntil(resource_id, None, None)
+
+@app.route('/rest/resources/<int:resource_id>/resourceclaims/<string:fromTimestamp>')
+@gzipped
+def resourceclaimsForResourceFrom(resource_id, fromTimestamp=None):
+    return resourceclaimsForResourceFromUntil(resource_id, fromTimestamp, None)
+
+@app.route('/rest/resources/<int:resource_id>/resourceclaims/<string:fromTimestamp>/<string:untilTimestamp>')
+@gzipped
+def resourceclaimsForResourceFromUntil(resource_id, fromTimestamp=None, untilTimestamp=None):
+    if fromTimestamp and isinstance(fromTimestamp, basestring):
+        fromTimestamp = asDatetime(fromTimestamp)
+
+    if untilTimestamp and isinstance(untilTimestamp, basestring):
+        untilTimestamp = asDatetime(untilTimestamp)
+
+    claims = radb().getResourceClaims(lower_bound=fromTimestamp,
+                                      upper_bound=untilTimestamp,
+                                      resource_ids=[resource_id],
+                                      extended=False,
+                                      include_properties=True)
+    return jsonify({'resourceclaims': claims})
+
 @app.route('/rest/resourcegroups')
 @gzipped
 def resourcegroups():
@@ -312,12 +339,41 @@ def getTasksFromUntil(fromTimestamp=None, untilTimestamp=None):
         untilTimestamp = asDatetime(untilTimestamp)
 
     tasks = radb().getTasks(fromTimestamp, untilTimestamp)
-
-    updateTaskMomDetails(tasks, momqueryrpc)
-    updateTaskStorageDetails(tasks, sqrpc, curpc)
+    updateTaskDetails(tasks)
 
     return jsonify({'tasks': tasks})
 
+def updateTaskDetails(tasks):
+    #update the mom details and the storage details in parallel
+    t1 = Thread(target=updateTaskMomDetails, args=(tasks, momqueryrpc))
+    t2 = Thread(target=updateTaskStorageDetails, args=(tasks, sqrpc, curpc))
+    t1.daemon = True
+    t2.daemon = True
+    t1.start()
+    t2.start()
+
+    #wait for mom details thread to finish
+    t1.join()
+
+    #task details (such as name/description) from MoM are done
+    #get extra details on reserved resources for reservations (while the storage details still run in t2)
+    reservationTasks = [t for t in tasks if t['type'] == 'reservation']
+    if reservationTasks:
+        reservationClaims = radb().getResourceClaims(task_ids=[t['id'] for t in reservationTasks], extended=True, include_properties=False)
+        task2claims = {}
+        for claim in reservationClaims:
+            if claim['task_id'] not in task2claims:
+                task2claims[claim['task_id']] = []
+            task2claims[claim['task_id']].append(claim)
+        for task in reservationTasks:
+            claims = task2claims.get(task['id'], [])
+            task['name'] = ', '.join(c['resource_name'] for c in claims)
+            task['description'] = 'Reservation on ' + task['name']
+
+    #wait for storage details thread to finish
+    t2.join()
+
+
 @app.route('/rest/tasks/<int:task_id>', methods=['GET'])
 @gzipped
 def getTask(task_id):
@@ -328,8 +384,7 @@ def getTask(task_id):
             abort(404)
 
         task['name'] = 'Task %d' % task['id']
-        updateTaskMomDetails(task, momqueryrpc)
-        updateTaskStorageDetails(task, sqrpc, curpc)
+        updateTaskDetails([task])
         return jsonify({'task': task})
     except Exception as e:
         abort(404)
@@ -346,8 +401,7 @@ def getTaskByOTDBId(otdb_id):
             abort(404)
 
         task['name'] = 'Task %d' % task['id']
-        updateTaskMomDetails(task, momqueryrpc)
-        updateTaskStorageDetails(task, sqrpc, curpc)
+        updateTaskDetails([task])
         return jsonify({'task': task})
     except Exception as e:
         abort(404)
@@ -364,8 +418,7 @@ def getTaskByMoMId(mom_id):
             abort(404)
 
         task['name'] = 'Task %d' % task['id']
-        updateTaskMomDetails(task, momqueryrpc)
-        updateTaskStorageDetails(task, sqrpc, curpc)
+        updateTaskDetails([task])
         return jsonify({'task': task})
     except Exception as e:
         abort(404)
@@ -378,10 +431,7 @@ def getTasksByMoMGroupId(mom_group_id):
     try:
         mom_ids = momqueryrpc.getTaskIdsInGroup(mom_group_id)[str(mom_group_id)]
         tasks = radb().getTasks(mom_ids=mom_ids)
-
-        updateTaskMomDetails(tasks, momqueryrpc)
-        updateTaskStorageDetails(tasks, sqrpc, curpc)
-
+        updateTaskDetails(tasks)
         return jsonify({'tasks': tasks})
     except Exception as e:
         abort(404)
@@ -392,10 +442,7 @@ def getTasksByMoMParentGroupId(mom_parent_group_id):
     try:
         mom_ids = momqueryrpc.getTaskIdsInParentGroup(mom_parent_group_id)[str(mom_parent_group_id)]
         tasks = radb().getTasks(mom_ids=mom_ids)
-
-        updateTaskMomDetails(tasks, momqueryrpc)
-        updateTaskStorageDetails(tasks, sqrpc, curpc)
-
+        updateTaskDetails(tasks)
         return jsonify({'tasks': tasks})
     except Exception as e:
         abort(404)
@@ -406,49 +453,72 @@ def putTask(task_id):
             request.headers['Content-Type'].startswith('application/json'):
         try:
             updatedTask = json_loads(request.data)
-            logger.info('putTask: updatedTask: %s', updatedTask)
 
             if task_id != int(updatedTask['id']):
                 abort(404, 'task_id in url is not equal to id in request.data')
 
-            org_task = radb().getTask(task_id)
-
-            if not org_task:
-                abort(404, "unknown task %s" % updatedTask)
-
-            for timeprop in ['starttime', 'endtime']:
-                if timeprop in updatedTask:
-                    try:
-                        updatedTask[timeprop] = asDatetime(updatedTask[timeprop])
-                    except ValueError:
-                        abort(400, 'timestamp not in iso format: ' + updatedTask[timeprop])
+            #check if task is known
+            task = radb().getTask(task_id)
+            if not task:
+                abort(404, "unknown task %s" % str(updatedTask))
 
+            # first handle start- endtimes...
             if 'starttime' in updatedTask or 'endtime' in updatedTask:
-                # block time edits in productin for now until we've replaced the old scheduler.
+                logger.info('starttime or endtime in updatedTask: %s', updatedTask)
                 if isProductionEnvironment():
-                    abort(403, 'Editing of startime/endtime of tasks by users is not yet approved')
+                    abort(403, 'Editing of %s of tasks by users is not yet approved' % (time,))
+
+                #update dict for otdb spec
+                spec_update = {}
+
+                for timeprop in ['starttime', 'endtime']:
+                    if timeprop in updatedTask:
+                        try:
+                            updatedTask[timeprop] = asDatetime(updatedTask[timeprop])
+                        except ValueError:
+                            abort(400, 'timestamp not in iso format: ' + updatedTask[timeprop])
+                        otdb_key = 'LOFAR.ObsSW.Observation.' + ('startTime' if timeprop == 'starttime' else 'stopTime')
+                        spec_update[otdb_key] = updatedTask[timeprop].strftime('%Y-%m-%d %H:%M:%S')
+
+                #update timestamps in both otdb and radb
+                otdbrpc.taskSetSpecification(task['otdb_id'], spec_update)
 
                 # update the task's (and its claims) start/endtime
                 # do not update the tasks status directly via the radb. See few lines below. task status is routed via otdb (and then ends up in radb automatically)
                 # it might be that editing the start/end time results in a (rabd)task status update (for example to 'conflict' due to conflicting claims)
                 # that's ok, since we'll update the status to the requested status later via otdb (see few lines below)
-                radb().updateTaskAndResourceClaims(task_id, starttime=updatedTask.get('starttime'), endtime=updatedTask.get('endtime'))
+                radb().updateTaskAndResourceClaims(task_id,
+                                                   starttime=updatedTask.get('starttime'),
+                                                   endtime=updatedTask.get('endtime'))
 
+            # ...then, handle status update which might trigger resource assignment,
+            # for which the above updated times are needed
             if 'status' in updatedTask:
-                if isProductionEnvironment() and org_task['type'] == 'observation':
-                    abort(403, 'Editing of observation status by users is not yet approved')
-
                 try:
-                    otdbrpc.taskSetStatus(org_task['otdb_id'], updatedTask['status'])
+                    #update status in otdb only
+                    #the status change will propagate automatically into radb via other services (by design)
+                    otdbrpc.taskSetStatus(task['otdb_id'], updatedTask['status'])
+
+                    #we expect the status in otdb/radb to eventually become what we asked for...
+                    expected_statuses = set([updatedTask['status']])
 
-                    #block until radb and mom task status are equal to otdb task status (with timeout)
+                    #except for the prescheduled status, because then the resource assigner tries
+                    #to schedule the task, and it will end up in either 'scheduled', 'conflict', 'error' state.
+                    if updatedTask['status'] == 'prescheduled':
+                        expected_statuses = set(['scheduled', 'conflict', 'error'])
+
+                    #block until radb and mom task status are equal to the expected_statuses (with timeout)
                     start_wait = datetime.utcnow()
 
                     while True:
-                        org_task = radb().getTask(task_id)
-                        details = momqueryrpc.getObjectDetails(org_task['mom_id']).get(org_task['mom_id'])
+                        task = radb().getTask(otdb_id=task['otdb_id'])
+                        otdb_status = otdbrpc.taskGetStatus(task['otdb_id'])
+
+                        logger.info('waiting for otdb/radb task status to be in [%s].... otdb:%s radb:%s',
+                                    ', '.join(expected_statuses), otdb_status, task['status'])
 
-                        if org_task['status'] == updatedTask['status'] and details['object_status'] == updatedTask['status']:
+                        if (task['status'] in expected_statuses and
+                            otdb_status in expected_statuses):
                             break
 
                         if datetime.utcnow() - start_wait > timedelta(seconds=10):
@@ -459,12 +529,16 @@ def putTask(task_id):
                     if 'does not exist' in e.message:
                         # task does not exist (anymore) in otdb
                         #so remove it from radb as well (with cascading deletes on specification)
-                        logger.warn('task with otdb_id %s does not exist anymore in OTDB. removing task radb_id %s from radb', org_task['otdb_id'], org_task['id'])
-                        radb().deleteSpecification(org_task['specification_id'])
+                        logger.warn('task with otdb_id %s does not exist anymore in OTDB. removing task radb_id %s from radb', task['otdb_id'], task['id'])
+                        radb().deleteSpecification(task['specification_id'])
 
             if 'data_pinned' in updatedTask:
-                if not curpc.setTaskDataPinned(org_task['otdb_id'], updatedTask['data_pinned']):
-                    abort(500, 'Could not (un)pin task')
+                task = radb().getTask(task_id)
+
+                if not task:
+                    abort(404, "unknown task %s" % str(updatedTask))
+
+                curpc.setTaskDataPinned(task['otdb_id'], updatedTask['data_pinned'])
 
             return "", 204
         except Exception as e:
@@ -494,7 +568,8 @@ def cleanupTaskData(task_id):
                                       delete_im=delete_params.get('delete_im', True),
                                       delete_img=delete_params.get('delete_img', True),
                                       delete_pulp=delete_params.get('delete_pulp', True),
-                                      delete_scratch=delete_params.get('delete_scratch', True))
+                                      delete_scratch=delete_params.get('delete_scratch', True),
+                                      force=delete_params.get('force_delete', False))
         logger.info(result)
         return jsonify(result)
     except Exception as e:
@@ -590,7 +665,7 @@ def getParsetByOTDBId(otdb_id):
 @app.route('/rest/tasks/<int:task_id>/resourceclaims')
 @gzipped
 def taskResourceClaims(task_id):
-    return jsonify({'taskResourceClaims': radb().getResourceClaims(task_id=task_id, include_properties=True)})
+    return jsonify({'taskResourceClaims': radb().getResourceClaims(task_ids=[task_id], include_properties=True)})
 
 @app.route('/rest/tasktypes')
 @gzipped
@@ -634,6 +709,7 @@ def getProjects():
         projects.append({'name':'<unknown>', 'mom_id':-99, 'description': 'Container project for tasks for which we could not find a MoM project'})
 
     projects.append({'name':'OTDB Only', 'mom_id':-98, 'description': 'Container project for tasks which exists only in OTDB'})
+    projects.append({'name':'Reservations', 'mom_id':-97, 'description': 'Container project for reservation tasks'})
     return jsonify({'momprojects': projects})
 
 @app.route('/rest/projects/<int:project_mom2id>')
@@ -668,10 +744,7 @@ def getProjectTasksFromUntil(project_mom2id, fromTimestamp=None, untilTimestamp=
         task_mom2ids = momqueryrpc.getProjectTaskIds(project_mom2id)['task_mom2ids']
 
         tasks = radb().getTasks(mom_ids=task_mom2ids, lower_bound=fromTimestamp, upper_bound=untilTimestamp)
-
-        updateTaskMomDetails(tasks, momqueryrpc)
-        updateTaskStorageDetails(tasks, sqrpc, curpc)
-
+        updateTaskDetails(tasks)
         return jsonify({'tasks': tasks})
     except Exception as e:
         logger.error(e)
@@ -777,8 +850,7 @@ def getTasksHtml():
     if not tasks:
         abort(404)
 
-    updateTaskMomDetails(tasks, momqueryrpc)
-    updateTaskStorageDetails(tasks, sqrpc, curpc)
+    updateTaskDetails(tasks)
 
     html = '<!DOCTYPE html><html><head><title>Tasks</title><style>table, th, td {border: 1px solid black; border-collapse: collapse; padding: 4px;}</style></head><body><table style="width:100%">\n'
 
@@ -809,8 +881,7 @@ def getTaskHtml(task_id):
         abort(404, 'No such task %s' % task_id)
 
     task['name'] = 'Task %d' % task['id']
-    updateTaskMomDetails(task, momqueryrpc)
-    updateTaskStorageDetails(task, sqrpc, curpc)
+    updateTaskDetails([task])
 
     html = '<!DOCTYPE html><html><head><title>Tasks</title><style>table, th, td {border: 1px solid black; border-collapse: collapse; padding: 4px;}</style></head><body><table style="">\n'
 
diff --git a/SAS/ResourceAssignment/ResourceAssignmentService/rpc.py b/SAS/ResourceAssignment/ResourceAssignmentService/rpc.py
index 1b5d5449ba5fff8eddf2a89c3db3d98a3d521b35..0143214ecc67d02dd4ead72fb250a0355f88a785 100644
--- a/SAS/ResourceAssignment/ResourceAssignmentService/rpc.py
+++ b/SAS/ResourceAssignment/ResourceAssignmentService/rpc.py
@@ -86,67 +86,82 @@ class RARPC(RPCWrapper):
         return resource_claim
 
 
-    def insertResourceClaim(self, resource_id, task_id, starttime, endtime, status, session_id, claim_size, username,
+    def insertResourceClaim(self, resource_id, task_id, starttime, endtime, status, claim_size, username,
                             user_id, used_rcus=None, properties=None):
         return self.rpc('InsertResourceClaim', resource_id=resource_id,
                                                     task_id=task_id,
                                                     starttime=starttime,
                                                     endtime=endtime,
                                                     status=status,
-                                                    session_id=session_id,
                                                     claim_size=claim_size,
                                                     username=username,
                                                     used_rcus=used_rcus,
                                                     user_id=user_id,
                                                     properties=properties)
 
-    def insertResourceClaims(self, task_id, claims, session_id, username, user_id):
+    def insertResourceClaims(self, task_id, claims, username, user_id):
         return self.rpc('InsertResourceClaims', task_id=task_id,
                                                 claims=claims,
-                                                session_id=session_id,
                                                 username=username,
                                                 user_id=user_id)
 
     def deleteResourceClaim(self, id):
         return self.rpc('DeleteResourceClaim', id=id)
 
-    def updateResourceClaim(self, id, resource_id=None, task_id=None, starttime=None, endtime=None, status=None, session_id=None, claim_size=None, username=None, used_rcus=None, user_id=None):
+    def updateResourceClaim(self, id, resource_id=None, task_id=None, starttime=None, endtime=None, status=None, claim_size=None, username=None, used_rcus=None, user_id=None):
         return self.rpc('UpdateResourceClaim', id=id,
                                                     resource_id=resource_id,
                                                     task_id=task_id,
                                                     starttime=starttime,
                                                     endtime=endtime,
                                                     status=status,
-                                                    session_id=session_id,
                                                     claim_size=claim_size,
                                                     username=username,
                                                     used_rcus=used_rcus,
                                                     user_id=user_id)
 
-    def updateTaskAndResourceClaims(self, task_id, starttime=None, endtime=None, task_status=None, claim_status=None, session_id=None, username=None, used_rcus=None, user_id=None):
+    def updateResourceClaims(self, where_resource_claim_ids=None, where_task_ids=None, where_resource_types=None,
+                             resource_id=None, task_id=None, starttime=None, endtime=None,
+                             status=None, claim_size=None, username=None, used_rcus=None, user_id=None,
+                             commit=True):
+        return self.rpc('UpdateResourceClaims', where_resource_claim_ids=where_resource_claim_ids,
+                                                where_task_ids=where_task_ids,
+                                                where_resource_types=where_resource_types,
+                                                resource_id=resource_id,
+                                                task_id=task_id,
+                                                starttime=starttime,
+                                                endtime=endtime,
+                                                status=status,
+                                                claim_size=claim_size,
+                                                username=username,
+                                                used_rcus=used_rcus,
+                                                user_id=user_id)
+
+    def updateTaskAndResourceClaims(self, task_id, starttime=None, endtime=None, task_status=None, claim_status=None, username=None, used_rcus=None, user_id=None, where_resource_types=None):
         return self.rpc('UpdateTaskAndResourceClaims', task_id=task_id,
-                                                        starttime=starttime,
-                                                        endtime=endtime,
-                                                        task_status=task_status,
-                                                        claim_status=claim_status,
-                                                        session_id=session_id,
-                                                        username=username,
-                                                        used_rcus=used_rcus,
-                                                        user_id=user_id)
-
-    def getResourceUsages(self, claim_ids=None, lower_bound=None, upper_bound=None, resource_ids=None, task_ids=None, status=None, resource_type=None):
+                                                       starttime=starttime,
+                                                       endtime=endtime,
+                                                       task_status=task_status,
+                                                       claim_status=claim_status,
+                                                       username=username,
+                                                       used_rcus=used_rcus,
+                                                       user_id=user_id,
+                                                       where_resource_types=where_resource_types)
+
+
+    def getResourceUsages(self, lower_bound=None, upper_bound=None, resource_ids=None, status=None):
         all_usages = self.rpc('GetResourceUsages',
                               lower_bound=lower_bound,
                               upper_bound=upper_bound,
                               resource_ids=resource_ids,
-                              task_ids=task_ids,
-                              status=status,
-                              resource_type=resource_type)
+                              status=status)
 
-        for resource_usages in all_usages:
-            for status, usages in resource_usages['usages'].items():
+        all_usages = convertStringDigitKeysToInt(all_usages)
+
+        for resource_id, resource_usages_per_status in all_usages.items():
+            for status, usages in resource_usages_per_status.items():
                 for usage in usages:
-                    usage['timestamp'] = usage['timestamp'].datetime()
+                    usage['as_of_timestamp'] = usage['as_of_timestamp'].datetime()
 
         return all_usages
 
@@ -304,20 +319,22 @@ class RARPC(RPCWrapper):
 
     def get_conflicting_overlapping_claims(self, claim_id):
         '''returns a list of claimed claims which overlap with given claim(s) and which prevent the given claim(s) to be claimed (cause it to be in conflict)'''
-        return self.rpc('get_conflicting_overlapping_claims',
+        return self.rpc('get_overlapping_claims',
                         claim_id=claim_id)
 
-    def get_conflicting_overlapping_tasks(self, claim_ids):
+    def get_conflicting_overlapping_tasks(self, claim_id):
         '''returns a list of tasks which overlap with given claim(s) and which prevent the given claim(s) to be claimed (cause it to be in conflict)'''
-        return self.rpc('get_conflicting_overlapping_tasks',
-                        claim_ids=claim_ids)
+        return self.rpc('get_overlapping_tasks',
+                        claim_id=claim_id)
 
     def get_max_resource_usage_between(self, resource_id, lower_bound, upper_bound, claim_status='claimed'):
-        return self.rpc('get_max_resource_usage_between',
-                        resource_id=resource_id,
-                        lower_bound=lower_bound,
-                        upper_bound=upper_bound,
-                        claim_status=claim_status)
+        result = self.rpc('get_max_resource_usage_between',
+                          resource_id=resource_id,
+                          lower_bound=lower_bound,
+                          upper_bound=upper_bound,
+                          claim_status=claim_status)
+        result['as_of_timestamp'] = result['as_of_timestamp'].datetime()
+        return result
 
     def get_resource_claimable_capacity(self, resource_id, lower_bound, upper_bound):
         '''get the claimable capacity for the given resource within the timewindow given by lower_bound and upper_bound.
diff --git a/SAS/ResourceAssignment/ResourceAssignmentService/service.py b/SAS/ResourceAssignment/ResourceAssignmentService/service.py
index 8350d74398170ed453a47a57977877aa6ffb40ae..dd7e6a47a86fde3fe29a5a8b041eafd91aa7ec8e 100644
--- a/SAS/ResourceAssignment/ResourceAssignmentService/service.py
+++ b/SAS/ResourceAssignment/ResourceAssignmentService/service.py
@@ -52,6 +52,7 @@ class RADBHandler(MessageHandlerInterface):
             'InsertResourceClaim': self._insertResourceClaim,
             'DeleteResourceClaim': self._deleteResourceClaim,
             'UpdateResourceClaim': self._updateResourceClaim,
+            'UpdateResourceClaims': self._updateResourceClaims,
             'UpdateTaskAndResourceClaims': self._updateTaskAndResourceClaims,
             'GetResourceUsages': self._getResourceUsages,
             'GetResourceGroupTypes': self._getResourceGroupTypes,
@@ -82,8 +83,8 @@ class RADBHandler(MessageHandlerInterface):
             'UpdateSpecification': self._updateSpecification,
             'GetUnits': self._getUnits,
             'GetResourceAllocationConfig': self._getResourceAllocationConfig,
-            'get_conflicting_overlapping_claims': self._get_conflicting_overlapping_claims,
-            'get_conflicting_overlapping_tasks': self._get_conflicting_overlapping_tasks,
+            'get_overlapping_claims': self._get_overlapping_claims,
+            'get_overlapping_tasks': self._get_overlapping_tasks,
             'get_max_resource_usage_between': self._get_max_resource_usage_between,
             'get_resource_claimable_capacity': self._get_resource_claimable_capacity }
 
@@ -185,6 +186,28 @@ class RADBHandler(MessageHandlerInterface):
                                                 user_id=kwargs.get('user_id'))
         return {'id': id, 'updated': updated}
 
+    def _updateResourceClaims(self, **kwargs):
+        logger.info('UpdateResourceClaims: %s' % dict({k:v for k,v in kwargs.items() if v != None}))
+        task_id = kwargs['task_id']
+
+        updated = self.radb.updateResourceClaims(where_resource_claim_ids=kwargs.get('where_resource_claim_ids'),
+                                                 where_task_ids=kwargs.get('where_task_ids'),
+                                                 where_resource_types=kwargs.get('where_resource_types'),
+                                                 resource_id=kwargs.get('resource_id'),
+                                                 task_id=kwargs.get('task_id'),
+                                                 starttime=kwargs.get('starttime').datetime() if kwargs.get('starttime') else None,
+                                                 endtime=kwargs.get('endtime').datetime() if kwargs.get('endtime') else None,
+                                                 status=kwargs.get('status_id', kwargs.get('status')),
+                                                 claim_size=kwargs.get('status'),
+                                                 username=kwargs.get('username'),
+                                                 user_id=kwargs.get('user_id'),
+                                                 used_rcus=None)
+
+        return {'where_resource_claim_ids': kwargs.get('where_resource_claim_ids'),
+                'where_task_ids': kwargs.get('where_task_ids'),
+                'where_resource_types': kwargs.get('where_resource_types'),
+                'updated': updated}
+
     def _updateTaskAndResourceClaims(self, **kwargs):
         logger.info('UpdateTaskAndResourceClaims: %s' % dict({k:v for k,v in kwargs.items() if v != None}))
         task_id = kwargs['task_id']
@@ -195,18 +218,20 @@ class RADBHandler(MessageHandlerInterface):
                                                         task_status=kwargs.get('task_status_id', kwargs.get('task_status')),
                                                         claim_status=kwargs.get('claim_status_id', kwargs.get('claim_status')),
                                                         username=kwargs.get('username'),
-                                                        user_id=kwargs.get('user_id'))
-        return {'task_id': task_id, 'updated': updated}
+                                                        user_id=kwargs.get('user_id'),
+                                                        where_resource_types=kwargs.get('where_resource_types'),
+                                                        commit=kwargs.get('commit', True))
+
+        return {'task_id': task_id,
+                'where_resource_types': kwargs.get('where_resource_types'),
+                'updated': updated}
 
     def _getResourceUsages(self, **kwargs):
-        usages = self.radb.getResourceUsages(claim_ids=kwargs.get('claim_ids'),
-                                             lower_bound=kwargs.get('lower_bound').datetime() if kwargs.get('lower_bound') else None,
+        usages = self.radb.getResourceUsages(lower_bound=kwargs.get('lower_bound').datetime() if kwargs.get('lower_bound') else None,
                                              upper_bound=kwargs.get('upper_bound').datetime() if kwargs.get('upper_bound') else None,
                                              resource_ids=kwargs.get('resource_ids'),
-                                             task_ids=kwargs.get('task_ids'),
-                                             status=kwargs.get('status'),
-                                             resource_type=kwargs.get('resource_type'))
-        return usages
+                                             claim_statuses=kwargs.get('status'))
+        return convertIntKeysToString(usages)
 
     def _getResourceGroupTypes(self):
         return self.radb.getResourceGroupTypes()
@@ -231,10 +256,11 @@ class RADBHandler(MessageHandlerInterface):
                                       include_availability=kwargs.get('include_availability', False))
 
     def _updateResourceAvailability(self, **kwargs):
-        return self.radb.updateResourceAvailability(resource_id=kwargs['resource_id'],
-                                                    active=kwargs.get('active'),
-                                                    available_capacity=kwargs.get('available_capacity'),
-                                                    total_capacity=kwargs.get('total_capacity'))
+        updated = self.radb.updateResourceAvailability(resource_id=kwargs['resource_id'],
+                                                       active=kwargs.get('active'),
+                                                       available_capacity=kwargs.get('available_capacity'),
+                                                       total_capacity=kwargs.get('total_capacity'))
+        return {'resource_id': kwargs['resource_id'], 'updated': updated }
 
     def _getTasksTimeWindow(self, **kwargs):
         logger.info('GetTasksTimeWindow: %s' % dict({k:v for k,v in kwargs.items() if v != None}))
@@ -358,18 +384,24 @@ class RADBHandler(MessageHandlerInterface):
     def _getResourceAllocationConfig(self, **kwargs):
         return self.radb.getResourceAllocationConfig(sql_like_name_pattern=kwargs.get('sql_like_name_pattern'))
 
-    def _get_conflicting_overlapping_claims(self, **kwargs):
-        return self.radb.get_conflicting_overlapping_claims(**kwargs)
+    def _get_overlapping_claims(self, **kwargs):
+        return self.radb.get_overlapping_claims(claim_id=kwargs.get('claim_id'))
 
-    def _get_conflicting_overlapping_tasks(self, **kwargs):
-        return self.radb.get_conflicting_overlapping_tasks(**kwargs)
+    def _get_overlapping_tasks(self, **kwargs):
+        return self.radb.get_overlapping_tasks(claim_id=kwargs.get('claim_id'))
 
     def _get_max_resource_usage_between(self, **kwargs):
-        return self.radb.get_max_resource_usage_between(**kwargs)
+        logger.info('get_max_resource_usage_between: %s' % kwargs)
+        return self.radb.get_max_resource_usage_between(resource_id=kwargs.get('resource_id'),
+                                                        lower_bound=kwargs['lower_bound'].datetime() if kwargs.get('lower_bound') else None,
+                                                        upper_bound=kwargs['upper_bound'].datetime() if kwargs.get('upper_bound') else None,
+                                                        claim_status=kwargs.get('claim_status', 'claimed'))
 
     def _get_resource_claimable_capacity(self, **kwargs):
-        return self.radb.get_resource_claimable_capacity(**kwargs)
-
+        logger.info('get_resource_claimable_capacity: %s' % kwargs)
+        return self.radb.get_resource_claimable_capacity(resource_id=kwargs.get('resource_id'),
+                                                         lower_bound=kwargs['lower_bound'].datetime() if kwargs.get('lower_bound') else None,
+                                                         upper_bound=kwargs['upper_bound'].datetime() if kwargs.get('upper_bound') else None)
 
 
 def createService(busname=DEFAULT_BUSNAME, servicename=DEFAULT_SERVICENAME, broker=None, dbcreds=None, log_queries=False, verbose=False):
diff --git a/SAS/Scheduler/src/GraphicResourceScene.cpp b/SAS/Scheduler/src/GraphicResourceScene.cpp
index be65553f2c9c84bd9a010ca93202ad02e79a3b26..1757c9e8644ff03f9f2076bffa37df0d7a5ec189 100644
--- a/SAS/Scheduler/src/GraphicResourceScene.cpp
+++ b/SAS/Scheduler/src/GraphicResourceScene.cpp
@@ -393,7 +393,7 @@ void GraphicResourceScene::updateTasks(const scheduledTasksMap &scheduledTasks,
 		}
 	}
 	for (reservationsMap::const_iterator it = reservations.begin(); it != reservations.end(); ++it) {
-		if (it->second->getStatus() == Task::PRESCHEDULED) {
+		if (it->second->getStatus() == Task::PRESCHEDULED || it->second->getStatus() == Task::SCHEDULED) {
 			taskID = it->second->getID();
 			const std::map<std::string, unsigned> &stations = it->second->getStations();
 			for (std::map<std::string, unsigned>::const_iterator sit = stations.begin(); sit != stations.end(); ++sit) {
diff --git a/SAS/TriggerEmailService/Server/lib/TriggerEmailService.py b/SAS/TriggerEmailService/Server/lib/TriggerEmailService.py
index fc682c44a389ef2de64614336d175af2b2a4f377..bc47dfd8c34033a85eae2de9123c095a781545c3 100644
--- a/SAS/TriggerEmailService/Server/lib/TriggerEmailService.py
+++ b/SAS/TriggerEmailService/Server/lib/TriggerEmailService.py
@@ -31,6 +31,7 @@ from email.mime.text import MIMEText
 from email.mime.multipart import MIMEMultipart
 
 from datetime import timedelta, datetime
+import time
 from lofar.sas.otdb.OTDBBusListener import OTDBBusListener
 from lofar.common.util import waitForInterrupt
 from lofar.messaging.messagebus import AbstractBusListener
@@ -75,6 +76,10 @@ def email(recipients, subject, body, attachment, attachment_name):
     s.quit()
 
 
+class MoMIdError(Exception):
+    pass
+
+
 class OTDBTriggerListener(OTDBBusListener):
     def __init__(self, momquery_rpc=MoMQueryRPC(), busname=DEFAULT_OTDB_NOTIFICATION_BUSNAME,
                  subject=DEFAULT_OTDB_NOTIFICATION_SUBJECT, broker=None, **kwargs):
@@ -106,19 +111,39 @@ class OTDBTriggerListener(OTDBBusListener):
         self.when_trigger_send_email(otdb_id, REJECTED_TEMPLATE_SUBJECT, REJECTED_TEMPLATE_BODY)
 
     def when_trigger_send_email(self, otdb_id, template_subject, template_body):
-        mom_id = None
+        try:
+            mom_id, trigger_id = self._get_mom_and_trigger_id(otdb_id)
 
-        while not mom_id:  # we are sometimes to fast for MOM
-            mom_id = self.mom_rpc_client.getMoMIdsForOTDBIds(otdb_id)[otdb_id]
+            if trigger_id:
+                self._send_email(otdb_id, mom_id, trigger_id, template_subject, template_body)
+
+        except MoMIdError:
+            logger.error("Could not retrieve a mom_id for otdb_id: %s", otdb_id)
+
+    def _get_mom_and_trigger_id(self, otdb_id):
+        mom_id = self._try_get_mom_id(otdb_id)
+
+        if not mom_id:
+            raise MoMIdError
 
         trigger_id = self.mom_rpc_client.get_trigger_id(mom_id)['trigger_id']
 
-        if trigger_id:
-            logger.info("Emailing otdb_id: %s, mom_id: %s, trigger_id: %s, template_subject: %s, template_body: %s",
-                        otdb_id, mom_id, trigger_id, template_subject, template_body)
-            self._send_email(otdb_id, mom_id, trigger_id, template_subject, template_body)
+        return mom_id, trigger_id
+
+    def _try_get_mom_id(self, otdb_id):
+        # sometimes we are too fast for MoM so we need to retry
+        mom_id = None
+        for _ in xrange(10):
+            mom_id = self.mom_rpc_client.getMoMIdsForOTDBIds(otdb_id)[otdb_id]
+            if mom_id:
+                break
+            time.sleep(3)
+        return mom_id
 
     def _send_email(self, otdb_id, mom_id, trigger_id, template_subject, template_body):
+        logger.info("Emailing otdb_id: %s, mom_id: %s, trigger_id: %s, template_subject: %s, template_body: %s",
+                    otdb_id, mom_id, trigger_id, template_subject, template_body)
+
         subject, body = self._fill_template(otdb_id, mom_id, trigger_id, template_subject, template_body)
         recipients = self._get_recipients(mom_id)
 
diff --git a/SAS/TriggerEmailService/Server/test/t_TriggerEmailService.py b/SAS/TriggerEmailService/Server/test/t_TriggerEmailService.py
index d8461cc6b405a3e580aec6a8a246d7d68e4e6e65..1d6b6a452046c0dfb1aa4b95c21773dcd8d1e680 100755
--- a/SAS/TriggerEmailService/Server/test/t_TriggerEmailService.py
+++ b/SAS/TriggerEmailService/Server/test/t_TriggerEmailService.py
@@ -73,6 +73,10 @@ class TestOTDBTriggerListener(unittest.TestCase):
         self.addCleanup(email_patcher.stop)
         self.email_mock = email_patcher.start()
 
+        logger_patcher = mock.patch('lofar.sas.TriggerEmailService.TriggerEmailService.logger')
+        self.addCleanup(logger_patcher.stop)
+        self.logger_mock = logger_patcher.start()
+
     @mock.patch('lofar.sas.otdb.OTDBBusListener.OTDBBusListener.start_listening')
     def test_start_listening_should_open_momquery_rpc(self, super_mock):
         listener = OTDBTriggerListener(self.momqueryrpc_mock)
@@ -236,6 +240,48 @@ class TestOTDBTriggerListener(unittest.TestCase):
         self.assertIn(str(self.trigger_id), self.email_mock.call_args[0][2])
         self.assertIn(self.project_name, self.email_mock.call_args[0][2])
 
+    # when_trigger_send_email tests
+
+    @mock.patch('time.sleep', return_value=None)
+    def test_when_trigger_send_email_should_limit_the_amount_of_requests(self, _):
+        self.momqueryrpc_mock.getMoMIdsForOTDBIds.return_value = {self.obs_sas_id: None}
+
+        listener = OTDBTriggerListener(self.momqueryrpc_mock)
+
+        listener.onObservationAborted(self.obs_sas_id, None)
+
+        self.assertEqual(10, self.momqueryrpc_mock.getMoMIdsForOTDBIds.call_count)
+
+    @mock.patch('time.sleep', return_value=None)
+    def test_when_trigger_send_email_should_log_when_no_mom_id_can_be_found(self, _):
+        self.momqueryrpc_mock.getMoMIdsForOTDBIds.return_value = {self.obs_sas_id: None}
+
+        listener = OTDBTriggerListener(self.momqueryrpc_mock)
+
+        listener.onObservationAborted(self.obs_sas_id, None)
+
+        self.logger_mock.error.assert_any_call("Could not retrieve a mom_id for otdb_id: %s", self.obs_sas_id)
+
+    @mock.patch('time.sleep', return_value=None)
+    def test_when_trigger_send_email_should_wait_three_seconds_between_retries(self, sleep_mock):
+        self.momqueryrpc_mock.getMoMIdsForOTDBIds.return_value = {self.obs_sas_id: None}
+
+        listener = OTDBTriggerListener(self.momqueryrpc_mock)
+
+        listener.onObservationAborted(self.obs_sas_id, None)
+
+        sleep_mock.assert_called_with(3)
+        self.assertEqual(10, sleep_mock.call_count)
+
+    def test_when_trigger_send_email_should_log_when_sending_email(self):
+        listener = OTDBTriggerListener(self.momqueryrpc_mock)
+
+        listener.when_trigger_send_email(self.obs_sas_id, "", "")
+
+        self.logger_mock.info.assert_any_call(
+            "Emailing otdb_id: %s, mom_id: %s, trigger_id: %s, template_subject: %s, template_body: %s",
+            self.obs_sas_id, self.obs_mom_id, self.trigger_id, "", "")
+
 
 class TestTriggerNotificationListener(unittest.TestCase):
     project_name = "test_lofar"
diff --git a/SAS/XML_generator/src/xmlgen.py b/SAS/XML_generator/src/xmlgen.py
index eed2804ebda128b4222d5311273a61bed9f82608..8cbe759ec786ed13edb487223af7df12e7369d33 100755
--- a/SAS/XML_generator/src/xmlgen.py
+++ b/SAS/XML_generator/src/xmlgen.py
@@ -26,7 +26,7 @@
 # Last change by : $Author: renting $
 # Change date	   : $Date: 2016-05-18 11:47:57 +0200 (wo, 18 mei 2016) $
 
-VERSION = "2.21.0"
+VERSION = "2.22.0"
     
 import sys, getopt, time
 from xml.sax.saxutils import escape as XMLescape
@@ -48,12 +48,14 @@ IMAGING_PIPELINE_TYPES = ['MSSS','standard','none']
 #MODES = ['Calobs','Calbeam','MultiObs']
 PROCESSING = ['Preprocessing','Calibration','Pulsar','Imaging','LongBaseline','none']
 CALIBRATION_MODE = ['internal','external','none']
-ALL_STATIONS = 'CS001,CS002,CS003,CS004,CS005,CS006,CS007,CS011,CS013,CS017,CS021,CS024,CS026,CS028,CS030,CS031,CS032,CS101,CS103,CS201,CS301,CS302,CS401,CS501,RS106,RS205,RS208,RS210,RS305,RS306,RS307,RS310,RS406,RS407,RS409,RS503,RS508,RS509,DE601,DE602,DE603,DE604,DE605,FR606,SE607,UK608,DE609,PL610,PL611,PL612'
+ALL_STATIONS = 'CS001,CS002,CS003,CS004,CS005,CS006,CS007,CS011,CS013,CS017,CS021,CS024,CS026,CS028,CS030,CS031,CS032,CS101,CS103,CS201,CS301,CS302,CS401,CS501,RS106,RS205,RS208,RS210,RS305,RS306,RS307,RS310,RS406,RS407,RS409,RS503,RS508,RS509,DE601,DE602,DE603,DE604,DE605,FR606,SE607,UK608,DE609,PL610,PL611,PL612,IE613'
 CORE_STATIONS = 'CS001,CS002,CS003,CS004,CS005,CS006,CS007,CS011,CS013,CS017,CS021,CS024,CS026,CS028,CS030,CS031,CS032,CS101,CS103,CS201,CS301,CS302,CS401,CS501'
 SUPERTERP_STATIONS = 'CS002,CS003,CS004,CS005,CS006,CS007'
 REMOTE_STATIONS = 'RS106,RS205,RS208,RS210,RS305,RS306,RS307,RS310,RS406,RS407,RS409,RS503,RS508,RS509'
-INTERNATIONAL_STATIONS = 'DE601,DE602,DE603,DE604,DE605,FR606,SE607,UK608,DE609,PL610,PL611,PL612'
+INTERNATIONAL_STATIONS = 'DE601,DE602,DE603,DE604,DE605,FR606,SE607,UK608,DE609,PL610,PL611,PL612,IE613'
 NL_STATIONS = 'CS001,CS002,CS003,CS004,CS005,CS006,CS007,CS011,CS013,CS017,CS021,CS024,CS026,CS028,CS030,CS031,CS032,CS101,CS103,CS201,CS301,CS302,CS401,CS501,RS106,RS205,RS208,RS210,RS305,RS306,RS307,RS310,RS406,RS407,RS409,RS503,RS508,RS509'
+DEFAULT_TASKS_PER_NODE = 11
+DEFAULT_CORES_PER_TASK = 2
 
 RED_COLOR    = '\033[91m'
 NO_COLOR     = '\033[0m'
@@ -269,22 +271,20 @@ def hasCoherentTab(TAB):
   return False
 
 ##FIXME we will need to fill in actual values. Might need to depend on variables
-def processingCluster(cluster, number_of_tasks):
-  if not number_of_tasks:
-      number_of_tasks = 24
+def processingCluster(cluster, number_of_tasks, number_of_cores_per_task):
   CEP4 = r"""  <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
                     <numberOfTasks>%i</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>%i</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>"""
 
   if cluster in ["", "CEP4"]:
-    result = CEP4 % (number_of_tasks,)
+    result = CEP4 % (number_of_tasks, number_of_cores_per_task)
   else:
     raise GenException("Unknown processing cluster specified: %s" % cluster)
   return result
@@ -451,9 +451,9 @@ def writeDemixParameters(ofile, demixParameters):
 
 def writeXMLTargetPipeline(ofile, topo, pred_topo, name, descr, defaulttemplate, flagging,
                            duration, demixParameters, bbsParameters, uvintopo, uvinname,
-                           instrintopo, instrinname, uvoutname, uvouttopo, storageCluster, status, nr_nodes):
+                           instrintopo, instrinname, uvoutname, uvouttopo, storageCluster, status, nr_tasks, nr_cores_per_task):
   stor_cluster = dataProductCluster(storageCluster)
-  proc_cluster = processingCluster(storageCluster, nr_nodes)
+  proc_cluster = processingCluster(storageCluster, nr_tasks, nr_cores_per_task)
   print >> ofile, r"""<item index="0">
                   <lofar:pipeline xsi:type="lofar:CalibrationPipelineType">
                     <topology>%s</topology>
@@ -499,9 +499,9 @@ def writeXMLTargetPipeline(ofile, topo, pred_topo, name, descr, defaulttemplate,
                   </item>""" % (uvintopo, uvinname, instrintopo, instrinname, uvoutname, uvouttopo, stor_cluster)                
 
 def writeXMLCalPipe(ofile, topo, pred_topo, name, descr, defaulttemplate, flagging, duration, skymodel, demixParameters, 
-                    bbsParameters, uvintopo, instroutname, instrouttopo, uvouttopo, storageCluster, status, nr_nodes):
+                    bbsParameters, uvintopo, instroutname, instrouttopo, uvouttopo, storageCluster, status, nr_tasks, nr_cores_per_task):
   stor_cluster = dataProductCluster(storageCluster)
-  proc_cluster = processingCluster(storageCluster, nr_nodes)
+  proc_cluster = processingCluster(storageCluster, nr_tasks, nr_cores_per_task)
   print >> ofile, r"""        <item index="0">
               <lofar:pipeline xsi:type="lofar:CalibrationPipelineType">
                 <topology>%s</topology>
@@ -550,9 +550,9 @@ def writeXMLCalPipe(ofile, topo, pred_topo, name, descr, defaulttemplate, flaggi
             </item>""" % (uvintopo, instroutname, instrouttopo, stor_cluster, uvouttopo, uvouttopo, stor_cluster)
 
 def writeXMLAvgPipeline(ofile, topo, pred_topo, name, descr, defaulttemplate, flagging, duration, 
-                        demixParameters, uvintopo, uvouttopo, storageCluster, status, nr_nodes):
+                        demixParameters, uvintopo, uvouttopo, storageCluster, status, nr_tasks, nr_cores_per_task):
   stor_cluster = dataProductCluster(storageCluster)
-  proc_cluster = processingCluster(storageCluster, nr_nodes)
+  proc_cluster = processingCluster(storageCluster, nr_tasks, nr_cores_per_task)
   print >> ofile, r"""        <item index="0">
               <lofar:pipeline xsi:type="lofar:AveragingPipelineType">
                 <topology>%s</topology>
@@ -590,12 +590,12 @@ def writeXMLAvgPipeline(ofile, topo, pred_topo, name, descr, defaulttemplate, fl
             </item>""" % (uvintopo, uvouttopo, uvouttopo, stor_cluster)
                    
 def writeXMLPulsarPipe(ofile, topo, pred_topo, name, descr, defaulttemplate, duration, bfintopo, pouttopo,
-            storageCluster, status, nr_nodes, _2bf2fitsExtraOpts, _8bitConversionSigma, 
+            storageCluster, status, nr_tasks, nr_cores_per_task, _2bf2fitsExtraOpts, _8bitConversionSigma, 
             decodeNblocks, decodeSigma, digifilExtraOpts, dspsrExtraOpts, dynamicSpectrumTimeAverage, nofold, nopdmp, norfi, 
             prepdataExtraOpts, prepfoldExtraOpts, prepsubbandExtraOpts, pulsar, rawTo8bit, rfifindExtraOpts, rrats, singlePulse, 
             skipDsps, skipDynamicSpectrum, skipPrepfold, tsubint):
   stor_cluster = dataProductCluster(storageCluster)
-  proc_cluster = processingCluster(storageCluster, nr_nodes)
+  proc_cluster = processingCluster(storageCluster, nr_tasks, nr_cores_per_task)
   print >> ofile, r"""        <item index="0">
               <lofar:pipeline xsi:type="lofar:PulsarPipelineType">
                 <topology>%s</topology>
@@ -660,9 +660,9 @@ def writeXMLPulsarPipe(ofile, topo, pred_topo, name, descr, defaulttemplate, dur
 
 #nv 13okt2014: #6716 - Implement Long Baseline Pipeline     
 def writeXMLLongBaselinePipe(ofile, topo, pred_topo, name, descr, defaulttemplate, duration,
-  subbands_per_subbandgroup, subbandgroups_per_ms, uvintopo, uvouttopo, storageCluster, status, nr_nodes):
+  subbands_per_subbandgroup, subbandgroups_per_ms, uvintopo, uvouttopo, storageCluster, status, nr_tasks, nr_cores_per_task):
   stor_cluster = dataProductCluster(storageCluster)
-  proc_cluster = processingCluster(storageCluster, nr_nodes)
+  proc_cluster = processingCluster(storageCluster, nr_tasks, nr_cores_per_task)
   print >> ofile, r"""        <item index="0">
               <lofar:pipeline xsi:type="lofar:LongBaselinePipelineType">
                 <topology>%s</topology>
@@ -816,8 +816,8 @@ def writeMainFolderEnd(ofile):
   </lofar:folder>
   </item>"""
 
-def writeImagingPipelineXML(ofile, input_list, bbsParameters, storageCluster, status, nr_nodes):
-  proc_cluster = processingCluster(storageCluster, nr_nodes)
+def writeImagingPipelineXML(ofile, input_list, bbsParameters, storageCluster, status, nr_tasks, nr_cores_per_task):
+  proc_cluster = processingCluster(storageCluster, nr_tasks, nr_cores_per_task)
   print >> ofile, r"""<item index="0">
         <lofar:pipeline xsi:type="lofar:%(imaging_pipe_type)s">
           <topology>%(imaging_pipe_topology)s</topology>
@@ -855,21 +855,20 @@ def parseOptions(argv):
   inputfile  = ''
   outputfile = ''
   status     = "opened"
-  nr_nodes   = None
   
   try:
-    opts, args = getopt.getopt(argv,"hi:o:an:",["ifile=","ofile=", "nr_nodes="])
+    opts, args = getopt.getopt(argv,"hi:o:a:",["ifile=","ofile="])
   except getopt.GetoptError:
-    print 'xmlgen.py -i <inputfile> [-o <outputfile>] [-a] [-n nr_nodes]'
+    print 'xmlgen.py -i <inputfile> [-o <outputfile>] [-a]'
     sys.exit(2)
     
   if len(opts) == 0:
-    print 'usage: xmlgen.py -i <inputfile> [-o <outputfile>] [-a] [-n nr_nodes]'
+    print 'usage: xmlgen.py -i <inputfile> [-o <outputfile>] [-a]'
     sys.exit(2)    
 
   for opt, arg in opts:
     if opt == '-h':
-      print 'usage: xmlgen.py -i <inputfile> [-o <outputfile.xml>] [-a] [-n nr_nodes]'
+      print 'usage: xmlgen.py -i <inputfile> [-o <outputfile.xml>] [-a]'
       sys.exit()
     elif opt in ("-i", "--ifile"):
       inputfile = arg
@@ -877,8 +876,6 @@ def parseOptions(argv):
       outputfile = arg
     elif opt in ("-a"):
       status="approved"
-    elif opt in ("-n", "--nr_nodes"):
-      nr_nodes = int(arg)
 
   if (outputfile == inputfile):
     raise GenException("Output file'" + outputfile + "' has the same name as inputfile")
@@ -887,7 +884,7 @@ def parseOptions(argv):
   else:
     outputfile = splitext(inputfile)[0] + '.xml'
     print "Output file not specified, writing output xml file:'" + outputfile + "'"
-  return (inputfile, outputfile, status, nr_nodes)
+  return (inputfile, outputfile, status)
 
 def processInput(inputfile):
   ifile = open(inputfile, 'r')
@@ -976,7 +973,7 @@ def readIntKey(keyname, value):
     key = int(value) #TODO try: ?
     print "%s = %s" % (keyname, key)
   else:
-    raise GenException("the calibratorDuration_s has not been specified")
+    raise GenException("the %s has not been specified" % keyname)
   return key
 
 def readFloatKey(keyname, value):
@@ -984,7 +981,7 @@ def readFloatKey(keyname, value):
     key = float(value) #TODO try: ?
     print "%s = %s" % (keyname, key)
   else:
-    raise GenException("the calibratorDuration_s has not been specified")
+    raise GenException("the %s has not been specified" % keyname)
   return key
 
 def readListKey(keyname, value):
@@ -1624,10 +1621,23 @@ def readBlock(lines, projectName, blockNr):
           raise GenException("the repeat parameter is not valid for BLOCK: %i" % blockNr)
       elif key == "cluster":
         s["cluster"] = readStringKey("cluster", value)
+      elif key == "nr_tasks":
+        try:
+          s["nr_tasks"] = int(value)
+          print "number of tasks = %i" % s["nr_tasks"]
+        except:
+          raise GenException("the number of tasks parameter is not valid for BLOCK: %i" % blockNr)
+      elif key == "nr_cores_per_task":
+        try:
+          s["nr_cores_per_task"] = int(value)
+          print "number of cores per task = %i" % s["nr_cores_per_task"]
+        except:
+          raise GenException("the number of cores per task parameter is not valid for BLOCK: %i" % blockNr)
       elif key == "nr_nodes":
         try:
-          s["nr_nodes"] = int(value)
-          print "number of nodes = %s" % s["nr_nodes"]
+          s["nr_tasks"] = int(value) * DEFAULT_TASKS_PER_NODE
+          s["nr_cores_per_task"] = DEFAULT_CORES_PER_TASK
+          print "number of nodes found, converted to number of tasks = %i, number of cores per task = %i" % (s["nr_tasks"], s["nr_cores_per_task"])
         except:
           raise GenException("the number of nodes parameter is not valid for BLOCK: %i" % blockNr)
       else:
@@ -1726,11 +1736,16 @@ def checkSettings(settings, blockNr):
   checkAntennaModeInstrumentFilterAndClockCombination(settings["antennaMode"], settings["instrumentFilter"], settings["clock"])
 
   settings["writePackageTag"] = "packageTag" in settings and settings["packageTag"]
+  
+  if "nr_tasks" in settings:
+    if "nr_of_cores_per_task" not in settings:
+      printInfo("number of tasks found, but no number of cores, taking default number of cores per task = %i" % (DEFAULT_CORES_PER_TASK,))
+  
   return settings
 
 def  writeImagingPipeline(ofile, nr_beams, targetBeams, blockTopo, nrRepeats,
        imaging_pipe_inputs, imaging_pipe_predecessors, writePackageTag, packageTag,
-       nrImages, imagingPipelineSettings, imagingBBS, cluster, status, nr_nodes):
+       nrImages, imagingPipelineSettings, imagingBBS, cluster, status, nr_tasks, nr_cores_per_task):
   for key,val in imagingPipelineSettings.items(): #TODO somewhat dirty hack, to be solved better later.
     exec(key + '=val')
   for beamNr in range (0, nr_beams):
@@ -1753,7 +1768,7 @@ def  writeImagingPipeline(ofile, nr_beams, targetBeams, blockTopo, nrRepeats,
         "imaging_pipe_name":imaging_pipe_name, "beamNr":beamNr,
         "nrImages":nrImages[beamNr], "nrRepeats":nrRepeats, "initial_status": status}
         
-      writeImagingPipelineXML(ofile, merge_dicts(temp, imagingPipelineSettings), imagingBBS, cluster, status, nr_nodes)          
+      writeImagingPipelineXML(ofile, merge_dicts(temp, imagingPipelineSettings), imagingBBS, cluster, status, nr_tasks, nr_cores_per_task)          
       writeImagingPipelineInputDataproducts(ofile, imaging_pipe_inputs[beamNr])
       writeSkyImageOutputDataproduct(ofile, imaging_pipe_output_topology, cluster)
 
@@ -1769,7 +1784,7 @@ def determineBfDataExtension(coherentStokesData, incoherentStokesData):
   return bfDataExtension
 
 def writeRepeat(ofile, projectName, blockTopo, repeatNr, settings, imaging_pipe_inputs,
-                imaging_pipe_predecessors, status, nr_nodes):
+                imaging_pipe_predecessors, status, nr_tasks, nr_cores_per_task):
   for key,val in settings.items(): #TODO somewhat dirty hack, to be solved better later.
     exec(key + '=val')
   repeatTopo = blockTopo + str(repeatNr)
@@ -1935,7 +1950,7 @@ def writeRepeat(ofile, projectName, blockTopo, repeatNr, settings, imaging_pipe_
         cal_pipe_calibrator_description, cal_obs_pipe_default_template,
         flaggingStrategy, calibratorBeam[8], calibratorBBS[0][0], calibratorDemix[0], calibratorBBS[0][1:],
         cal_obs_beam0_topology + '.uv.dps', cal_pipe_calibrator_topology + '.inst.dps',
-        cal_pipe_calibrator_topology + '.inst.dps', cal_pipe_calibrator_topology + '.uv.dps', cluster, status, nr_nodes)
+        cal_pipe_calibrator_topology + '.inst.dps', cal_pipe_calibrator_topology + '.uv.dps', cluster, status, nr_tasks, nr_cores_per_task)
 
     elif processing == 'Preprocessing':
       for i in range(0,len(calibratorDemix)):
@@ -1949,7 +1964,7 @@ def writeRepeat(ofile, projectName, blockTopo, repeatNr, settings, imaging_pipe_
           cal_pipe_name_tmp, cal_pipe_calibrator_description, cal_obs_pipe_default_template,
           flaggingStrategy, calibratorBeam[8], calibratorDemix[i],
           cal_obs_beam0_topology + '.uv.dps', cal_pipe_calibrator_topology_tmp + '.uv.dps',
-          cluster, status, nr_nodes)
+          cluster, status, nr_tasks, nr_cores_per_task)
 
     elif processing == 'Calibration':
       
@@ -1962,7 +1977,7 @@ def writeRepeat(ofile, projectName, blockTopo, repeatNr, settings, imaging_pipe_
         calibratorBeam[8], calibratorBBS[0][0], calibratorDemix[0], ['', '', '', '', '', '', ''],
         cal_obs_beam0_topology + '.uv.dps', cal_pipe_calibrator_topology + '.inst.dps', 
         cal_pipe_calibrator_topology + '.inst.dps', cal_pipe_calibrator_topology + '.uv.dps',
-        cluster, status, nr_nodes)
+        cluster, status, nr_tasks, nr_cores_per_task)
    
   if not split_targets:  
     if writePackageTag:
@@ -2032,7 +2047,7 @@ def writeRepeat(ofile, projectName, blockTopo, repeatNr, settings, imaging_pipe_
             calibratorBeam[8], calibratorBBS[0][0], calibratorDemix[0], calibratorBBS[0][1:],
             tar_obs_uv_data_topologies[nr_beams], cal_pipe_target_topology + '.inst.dps',
             cal_pipe_target_topology + '.inst.dps', cal_pipe_target_topology + '.uv.dps',
-            cluster, status, nr_nodes)
+            cluster, status, nr_tasks, nr_cores_per_task)
         
         elif processing == 'Preprocessing':
           for i in range(0, len(calibratorDemix)):
@@ -2046,7 +2061,7 @@ def writeRepeat(ofile, projectName, blockTopo, repeatNr, settings, imaging_pipe_
               cal_pipe_target_name_tmp, cal_pipe_target_description,
               cal_tar_pipe_default_template, flaggingStrategy, calibratorBeam[8],
               calibratorDemix[i], tar_obs_uv_data_topologies[nr_beams],
-              cal_pipe_target_topology_tmp + '.uv.dps', cluster, status, nr_nodes)
+              cal_pipe_target_topology_tmp + '.uv.dps', cluster, status, nr_tasks, nr_cores_per_task)
         
         elif processing == 'Calibration':
           
@@ -2058,7 +2073,7 @@ def writeRepeat(ofile, projectName, blockTopo, repeatNr, settings, imaging_pipe_
             flaggingStrategy, calibratorBeam[8], calibratorBBS[0][0], calibratorDemix[0],
             calibratorBBS[0][1:], tar_obs_uv_data_topologies[nr_beams],
             cal_pipe_target_topology + '.inst.dps', cal_pipe_target_topology + '.inst.dps',
-            cal_pipe_target_topology + '.uv.dps', cluster, status, nr_nodes)
+            cal_pipe_target_topology + '.uv.dps', cluster, status, nr_tasks, nr_cores_per_task)
     else:    
       writeXMLObsEnd(ofile)
       
@@ -2127,7 +2142,7 @@ def writeRepeat(ofile, projectName, blockTopo, repeatNr, settings, imaging_pipe_
           tar_obs_uv_data_topologies[beamNr], tar_obs_uv_data_topologies[beamNr],
           tar_pipe_input_INST_topo, tar_pipe_input_INST_topo, 
           tar_pipe_topologies[beamNr] + ".uv.dps", tar_pipe_topologies[beamNr] + ".uv.dps",
-          cluster, status, nr_nodes)
+          cluster, status, nr_tasks, nr_cores_per_task)
             
       elif processing == 'Preprocessing':
         for i in range(0,len(targetDemix[beamNr])):
@@ -2143,7 +2158,7 @@ def writeRepeat(ofile, projectName, blockTopo, repeatNr, settings, imaging_pipe_
             tar_pipe_name_tmp, tar_pipe_description, tar_pipe_default_template,
             flaggingStrategy, targetBeams[beamNr][8], targetDemix[beamNr][i],
             tar_obs_uv_data_topologies[beamNr], tar_pipe_topology_output_MS_tmp,
-            cluster, status, nr_nodes) 
+            cluster, status, nr_tasks, nr_cores_per_task) 
             
       elif processing == 'Calibration': #TODO currently doesn't work according to Alwin's wiki, why?
         if targetBBS[beamNr][0][0] == '':
@@ -2154,7 +2169,7 @@ def writeRepeat(ofile, projectName, blockTopo, repeatNr, settings, imaging_pipe_
           targetBeams[beamNr][8], targetBBS[beamNr][0][0], targetDemix[beamNr][0],
           targetBBS[beamNr][0][1:], tar_obs_uv_data_topologies[beamNr], 
           tar_pipe_topologies[beamNr] + ".inst.dps", tar_pipe_topologies[beamNr] + ".inst.dps",
-          tar_pipe_topologies[beamNr] + ".uv.dps", cluster, status, nr_nodes)
+          tar_pipe_topologies[beamNr] + ".uv.dps", cluster, status, nr_tasks, nr_cores_per_task)
 
       elif processing == 'Pulsar':
         #tar_obs_topology_MultiObs = tar_obs_topology + '.' + str(beamNr)
@@ -2163,7 +2178,7 @@ def writeRepeat(ofile, projectName, blockTopo, repeatNr, settings, imaging_pipe_
         writeXMLPulsarPipe(ofile, tar_pipe_topologies[beamNr], tar_obs_topology,
           tar_pipe_name, tar_pipe_description, tar_pipe_default_template,
           targetBeams[beamNr][8], tar_obs_bf_data_topologies[beamNr],
-          tar_pipe_topologies[beamNr] + ".pu.dps", cluster, status, nr_nodes,
+          tar_pipe_topologies[beamNr] + ".pu.dps", cluster, status, nr_tasks, nr_cores_per_task,
           pulsar                  = targetPulsar[beamNr][0][0],
           singlePulse             = targetPulsar[beamNr][0][1], 
           rawTo8bit               = targetPulsar[beamNr][0][2], 
@@ -2209,18 +2224,18 @@ def writeRepeat(ofile, projectName, blockTopo, repeatNr, settings, imaging_pipe_
           LB_preproc_pipe_description, LB_preproc_pipe_template, flaggingStrategy,
           targetBeams[beamNr][8], targetDemix[beamNr][0],
           tar_pipe_topologies[beamNr] + ".uv.dps", LB_preproc_pipe_output_MS_topologies[beamNr],
-          cluster, status, nr_nodes)
+          cluster, status, nr_tasks, nr_cores_per_task)
 
         #nv 13okt2014: #6716 - Implement Long Baseline Pipeline     
         writeXMLLongBaselinePipe(ofile, LB_pipeline_topologies[beamNr],
           LB_pipeline_predecessor[beamNr], LB_pipeline_name, LB_pipeline_description,
           LB_pipeline_default_template, targetBeams[beamNr][8], subbandsPerSubbandGroup,
           subbandGroupsPerMS, LB_pipeline_input_uv_topologies[beamNr],
-          LB_pipeline_output_uv_topologies[beamNr], cluster, status, nr_nodes)
+          LB_pipeline_output_uv_topologies[beamNr], cluster, status, nr_tasks, nr_cores_per_task)
   
   return imaging_pipe_inputs, imaging_pipe_predecessors, startTimeObs
 
-def writeBlock(ofile, settings, projectName, blockNr, status, nr_nodes):
+def writeBlock(ofile, settings, projectName, blockNr, status):
   defaults = {
   "subbandsPerFileCS": '',
   "numberCollapsedChannelsCS": '',
@@ -2236,8 +2251,12 @@ def writeBlock(ofile, settings, projectName, blockNr, status, nr_nodes):
   "cluster":'CEP4'}
   defaults.update(settings) #FIXME somewhat dirty hack, to be solved better later.
   settings = defaults
-  if 'nr_nodes' in settings:  # We can set a (different) number per BLOCK
-    nr_nodes = settings['nr_nodes']
+  if 'nr_tasks' in settings:  # We can set a (different) number per BLOCK
+    nr_tasks          = settings['nr_tasks']
+    nr_cores_per_task = settings['nr_cores_per_task']
+  else:
+    nr_tasks           = 10 * DEFAULT_TASKS_PER_NODE
+    nr_cores_per_task = DEFAULT_CORES_PER_TASK
   
   #There's a lot of stuff in settings that's only relevant to the imaging pipelines
   #otherSettings = { key: settings[key] for key not in imagingPipelineKeys }
@@ -2255,7 +2274,7 @@ def writeBlock(ofile, settings, projectName, blockNr, status, nr_nodes):
   blockTopo = "B%i." % (blockNr-1,)
   for repeatNr in range (1, settings["nrRepeats"]+1):
      imaging_pipe_inputs, imaging_pipe_predecessors, settings["startTimeObs"] = writeRepeat(ofile,
-       projectName, blockTopo, repeatNr, settings, imaging_pipe_inputs, imaging_pipe_predecessors, status, nr_nodes)
+       projectName, blockTopo, repeatNr, settings, imaging_pipe_inputs, imaging_pipe_predecessors, status, nr_tasks, nr_cores_per_task)
 
   if settings["do_imaging"]:
     imagingPipelineKeys = ["imaging_pipe_type", "imaging_pipe_default_template", "imaging_pipe_duration",
@@ -2272,13 +2291,13 @@ def writeBlock(ofile, settings, projectName, blockNr, status, nr_nodes):
     writeImagingPipeline(ofile, settings["nr_beams"], settings["targetBeams"], blockTopo,
       settings["nrRepeats"], imaging_pipe_inputs, imaging_pipe_predecessors,
       settings["writePackageTag"], settings["packageTag"], settings["nrImages"],
-      imagingPipelineSettings, settings["imagingBBS"], settings["cluster"], status, nr_nodes)
+      imagingPipelineSettings, settings["imagingBBS"], settings["cluster"], status, nr_tasks, nr_cores_per_task)
 
   writeFolderEnd(ofile)
                 
 def main(argv):
   try:
-    inputfile, outputfile, status, nr_nodes = parseOptions(argv)
+    inputfile, outputfile, status = parseOptions(argv)
     ofile = open(outputfile, 'w')
   
     header, blocks = processInput(inputfile)
@@ -2291,7 +2310,7 @@ def main(argv):
       printMessage("\nProcessing BLOCK %i" % (index+1))
       settings = readBlock(block, projectName, index+1)
       settings = checkSettings(settings, index+1)
-      writeBlock(ofile, settings, projectName, index+1, status, nr_nodes)
+      writeBlock(ofile, settings, projectName, index+1, status)
     if mainFolderName:
       writeMainFolderEnd(ofile)
     writeProjectEnd(ofile)
diff --git a/SAS/XML_generator/test/test_regression.in_data/xml/20150713_4C17.31.xml b/SAS/XML_generator/test/test_regression.in_data/xml/20150713_4C17.31.xml
index 617d219be870445198f6abe503fcd8de1277db88..fb10b81a7aacae26681cd305d5d5f60c00532f1f 100644
--- a/SAS/XML_generator/test/test_regression.in_data/xml/20150713_4C17.31.xml
+++ b/SAS/XML_generator/test/test_regression.in_data/xml/20150713_4C17.31.xml
@@ -60,7 +60,7 @@
                         <whichIS></whichIS>
                       </stokes>
                       <stationSet>Custom</stationSet>
-                      <stations>CS001,CS002,CS003,CS004,CS005,CS006,CS007,CS011,CS013,CS017,CS021,CS024,CS026,CS028,CS030,CS031,CS032,CS101,CS103,CS201,CS301,CS302,CS401,CS501,DE601,DE602,DE603,DE604,DE605,DE609,FR606,PL610,PL611,PL612,RS106,RS205,RS208,RS210,RS305,RS306,RS307,RS310,RS406,RS407,RS409,RS503,RS508,RS509,SE607,UK608</stations>
+                      <stations>CS001,CS002,CS003,CS004,CS005,CS006,CS007,CS011,CS013,CS017,CS021,CS024,CS026,CS028,CS030,CS031,CS032,CS101,CS103,CS201,CS301,CS302,CS401,CS501,DE601,DE602,DE603,DE604,DE605,DE609,FR606,IE613,PL610,PL611,PL612,RS106,RS205,RS208,RS210,RS305,RS306,RS307,RS310,RS406,RS407,RS409,RS503,RS508,RS509,SE607,UK608</stations>
                       <timeFrame>UT</timeFrame>
                       <startTime>2015-07-13T06:10:00</startTime>
                       <endTime>2015-07-13T09:10:00</endTime>
@@ -218,11 +218,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -272,11 +272,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -326,11 +326,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
diff --git a/SAS/XML_generator/test/test_regression.in_data/xml/20150731_G46_run1_HBA.xml b/SAS/XML_generator/test/test_regression.in_data/xml/20150731_G46_run1_HBA.xml
index e22f8a789c25004e2e7c6811ca7b465c9595bb53..6d3b41d26a09b1f2aa41d2369293d84dd330cd8e 100644
--- a/SAS/XML_generator/test/test_regression.in_data/xml/20150731_G46_run1_HBA.xml
+++ b/SAS/XML_generator/test/test_regression.in_data/xml/20150731_G46_run1_HBA.xml
@@ -174,11 +174,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -228,11 +228,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -480,11 +480,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -534,11 +534,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -588,11 +588,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -796,11 +796,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -850,11 +850,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
diff --git a/SAS/XML_generator/test/test_regression.in_data/xml/20150810_P247P244.xml b/SAS/XML_generator/test/test_regression.in_data/xml/20150810_P247P244.xml
index d20df7175bf39ca73ed1eaf8c602f64890a887da..03c03f0b40ad7c4ee585384415e5c45494b889b6 100644
--- a/SAS/XML_generator/test/test_regression.in_data/xml/20150810_P247P244.xml
+++ b/SAS/XML_generator/test/test_regression.in_data/xml/20150810_P247P244.xml
@@ -60,7 +60,7 @@
                         <whichIS></whichIS>
                       </stokes>
                       <stationSet>Custom</stationSet>
-                      <stations>CS001,CS002,CS003,CS004,CS005,CS006,CS007,CS011,CS013,CS017,CS021,CS024,CS026,CS028,CS030,CS031,CS032,CS101,CS103,CS201,CS301,CS302,CS401,CS501,DE601,DE602,DE603,DE604,DE605,DE609,FR606,PL610,PL611,PL612,RS106,RS205,RS208,RS210,RS305,RS306,RS307,RS310,RS406,RS407,RS409,RS503,RS508,RS509,SE607,UK608</stations>
+                      <stations>CS001,CS002,CS003,CS004,CS005,CS006,CS007,CS011,CS013,CS017,CS021,CS024,CS026,CS028,CS030,CS031,CS032,CS101,CS103,CS201,CS301,CS302,CS401,CS501,DE601,DE602,DE603,DE604,DE605,DE609,FR606,IE613,PL610,PL611,PL612,RS106,RS205,RS208,RS210,RS305,RS306,RS307,RS310,RS406,RS407,RS409,RS503,RS508,RS509,SE607,UK608</stations>
                       <timeFrame>UT</timeFrame>
                       <startTime>2015-08-10T15:49:00</startTime>
                       <endTime>2015-08-10T15:59:00</endTime>
@@ -130,11 +130,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -224,7 +224,7 @@
                         <whichIS></whichIS>
                       </stokes>
                       <stationSet>Custom</stationSet>
-                      <stations>CS001,CS002,CS003,CS004,CS005,CS006,CS007,CS011,CS013,CS017,CS021,CS024,CS026,CS028,CS030,CS031,CS032,CS101,CS103,CS201,CS301,CS302,CS401,CS501,DE601,DE602,DE603,DE604,DE605,DE609,FR606,PL610,PL611,PL612,RS106,RS205,RS208,RS210,RS305,RS306,RS307,RS310,RS406,RS407,RS409,RS503,RS508,RS509,SE607,UK608</stations>
+                      <stations>CS001,CS002,CS003,CS004,CS005,CS006,CS007,CS011,CS013,CS017,CS021,CS024,CS026,CS028,CS030,CS031,CS032,CS101,CS103,CS201,CS301,CS302,CS401,CS501,DE601,DE602,DE603,DE604,DE605,DE609,FR606,IE613,PL610,PL611,PL612,RS106,RS205,RS208,RS210,RS305,RS306,RS307,RS310,RS406,RS407,RS409,RS503,RS508,RS509,SE607,UK608</stations>
                       <timeFrame>UT</timeFrame>
                       <startTime>2015-08-10T16:00:00</startTime>
                       <endTime>2015-08-11T00:00:00</endTime>
@@ -338,11 +338,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -392,11 +392,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -486,7 +486,7 @@
                         <whichIS></whichIS>
                       </stokes>
                       <stationSet>Custom</stationSet>
-                      <stations>CS001,CS002,CS003,CS004,CS005,CS006,CS007,CS011,CS013,CS017,CS021,CS024,CS026,CS028,CS030,CS031,CS032,CS101,CS103,CS201,CS301,CS302,CS401,CS501,DE601,DE602,DE603,DE604,DE605,DE609,FR606,PL610,PL611,PL612,RS106,RS205,RS208,RS210,RS305,RS306,RS307,RS310,RS406,RS407,RS409,RS503,RS508,RS509,SE607,UK608</stations>
+                      <stations>CS001,CS002,CS003,CS004,CS005,CS006,CS007,CS011,CS013,CS017,CS021,CS024,CS026,CS028,CS030,CS031,CS032,CS101,CS103,CS201,CS301,CS302,CS401,CS501,DE601,DE602,DE603,DE604,DE605,DE609,FR606,IE613,PL610,PL611,PL612,RS106,RS205,RS208,RS210,RS305,RS306,RS307,RS310,RS406,RS407,RS409,RS503,RS508,RS509,SE607,UK608</stations>
                       <timeFrame>UT</timeFrame>
                       <startTime>2015-08-11T00:01:00</startTime>
                       <endTime>2015-08-11T00:11:00</endTime>
@@ -556,11 +556,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
diff --git a/SAS/XML_generator/test/test_regression.in_data/xml/2MASS_1.xml b/SAS/XML_generator/test/test_regression.in_data/xml/2MASS_1.xml
index ea863903712119cb75d6929c773b659bbe0095b2..4cedd99e1d8cdef9e16542361987d863d4e3c0b1 100644
--- a/SAS/XML_generator/test/test_regression.in_data/xml/2MASS_1.xml
+++ b/SAS/XML_generator/test/test_regression.in_data/xml/2MASS_1.xml
@@ -130,11 +130,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -285,11 +285,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -449,11 +449,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
diff --git a/SAS/XML_generator/test/test_regression.in_data/xml/B1834620_HBA_LB_20150817.xml b/SAS/XML_generator/test/test_regression.in_data/xml/B1834620_HBA_LB_20150817.xml
index 49b211cb01b27aa9841af34573e035a2f35f5df1..ed08ef0f6d97eae9086c3a7732ef7cd88e4f7b8f 100644
--- a/SAS/XML_generator/test/test_regression.in_data/xml/B1834620_HBA_LB_20150817.xml
+++ b/SAS/XML_generator/test/test_regression.in_data/xml/B1834620_HBA_LB_20150817.xml
@@ -60,7 +60,7 @@
                         <whichIS></whichIS>
                       </stokes>
                       <stationSet>Custom</stationSet>
-                      <stations>CS001,CS002,CS003,CS004,CS005,CS006,CS007,CS011,CS013,CS017,CS021,CS024,CS026,CS028,CS030,CS031,CS032,CS101,CS103,CS201,CS301,CS302,CS401,CS501,DE601,DE602,DE603,DE604,DE605,DE609,FR606,PL610,PL611,PL612,RS106,RS205,RS208,RS210,RS305,RS306,RS307,RS310,RS406,RS407,RS409,RS503,RS508,RS509,SE607,UK608</stations>
+                      <stations>CS001,CS002,CS003,CS004,CS005,CS006,CS007,CS011,CS013,CS017,CS021,CS024,CS026,CS028,CS030,CS031,CS032,CS101,CS103,CS201,CS301,CS302,CS401,CS501,DE601,DE602,DE603,DE604,DE605,DE609,FR606,IE613,PL610,PL611,PL612,RS106,RS205,RS208,RS210,RS305,RS306,RS307,RS310,RS406,RS407,RS409,RS503,RS508,RS509,SE607,UK608</stations>
                       <timeFrame>UT</timeFrame>
                       <startTime>2015-09-07T18:45:00</startTime>
                       <endTime>2015-09-07T18:55:00</endTime>
@@ -130,11 +130,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -236,7 +236,7 @@
                         <whichIS></whichIS>
                       </stokes>
                       <stationSet>Custom</stationSet>
-                      <stations>CS001,CS002,CS003,CS004,CS005,CS006,CS007,CS011,CS013,CS017,CS021,CS024,CS026,CS028,CS030,CS031,CS032,CS101,CS103,CS201,CS301,CS302,CS401,CS501,DE601,DE602,DE603,DE604,DE605,DE609,FR606,PL610,PL611,PL612,RS106,RS205,RS208,RS210,RS305,RS306,RS307,RS310,RS406,RS407,RS409,RS503,RS508,RS509,SE607,UK608</stations>
+                      <stations>CS001,CS002,CS003,CS004,CS005,CS006,CS007,CS011,CS013,CS017,CS021,CS024,CS026,CS028,CS030,CS031,CS032,CS101,CS103,CS201,CS301,CS302,CS401,CS501,DE601,DE602,DE603,DE604,DE605,DE609,FR606,IE613,PL610,PL611,PL612,RS106,RS205,RS208,RS210,RS305,RS306,RS307,RS310,RS406,RS407,RS409,RS503,RS508,RS509,SE607,UK608</stations>
                       <timeFrame>UT</timeFrame>
                       <startTime>2015-09-07T18:56:00</startTime>
                       <endTime>2015-09-07T19:56:00</endTime>
@@ -350,11 +350,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                     <pipelineAttributes>
@@ -419,11 +419,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                     <pipelineAttributes>
@@ -488,11 +488,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -542,11 +542,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -588,11 +588,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -642,11 +642,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -719,7 +719,7 @@
                         <whichIS></whichIS>
                       </stokes>
                       <stationSet>Custom</stationSet>
-                      <stations>CS001,CS002,CS003,CS004,CS005,CS006,CS007,CS011,CS013,CS017,CS021,CS024,CS026,CS028,CS030,CS031,CS032,CS101,CS103,CS201,CS301,CS302,CS401,CS501,DE601,DE602,DE603,DE604,DE605,DE609,FR606,PL610,PL611,PL612,RS106,RS205,RS208,RS210,RS305,RS306,RS307,RS310,RS406,RS407,RS409,RS503,RS508,RS509,SE607,UK608</stations>
+                      <stations>CS001,CS002,CS003,CS004,CS005,CS006,CS007,CS011,CS013,CS017,CS021,CS024,CS026,CS028,CS030,CS031,CS032,CS101,CS103,CS201,CS301,CS302,CS401,CS501,DE601,DE602,DE603,DE604,DE605,DE609,FR606,IE613,PL610,PL611,PL612,RS106,RS205,RS208,RS210,RS305,RS306,RS307,RS310,RS406,RS407,RS409,RS503,RS508,RS509,SE607,UK608</stations>
                       <timeFrame>UT</timeFrame>
                       <startTime>2015-09-07T19:57:00</startTime>
                       <endTime>2015-09-07T20:07:00</endTime>
@@ -789,11 +789,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -895,7 +895,7 @@
                         <whichIS></whichIS>
                       </stokes>
                       <stationSet>Custom</stationSet>
-                      <stations>CS001,CS002,CS003,CS004,CS005,CS006,CS007,CS011,CS013,CS017,CS021,CS024,CS026,CS028,CS030,CS031,CS032,CS101,CS103,CS201,CS301,CS302,CS401,CS501,DE601,DE602,DE603,DE604,DE605,DE609,FR606,PL610,PL611,PL612,RS106,RS205,RS208,RS210,RS305,RS306,RS307,RS310,RS406,RS407,RS409,RS503,RS508,RS509,SE607,UK608</stations>
+                      <stations>CS001,CS002,CS003,CS004,CS005,CS006,CS007,CS011,CS013,CS017,CS021,CS024,CS026,CS028,CS030,CS031,CS032,CS101,CS103,CS201,CS301,CS302,CS401,CS501,DE601,DE602,DE603,DE604,DE605,DE609,FR606,IE613,PL610,PL611,PL612,RS106,RS205,RS208,RS210,RS305,RS306,RS307,RS310,RS406,RS407,RS409,RS503,RS508,RS509,SE607,UK608</stations>
                       <timeFrame>UT</timeFrame>
                       <startTime>2015-09-07T20:08:00</startTime>
                       <endTime>2015-09-07T21:08:00</endTime>
@@ -1009,11 +1009,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                     <pipelineAttributes>
@@ -1078,11 +1078,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                     <pipelineAttributes>
@@ -1147,11 +1147,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -1201,11 +1201,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -1247,11 +1247,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -1301,11 +1301,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
diff --git a/SAS/XML_generator/test/test_regression.in_data/xml/LC4_020_20150813.xml b/SAS/XML_generator/test/test_regression.in_data/xml/LC4_020_20150813.xml
index 0f0581df78659a73844c03dd179c699df442a532..ab0125cf361245b9348a2f65f9a2c7f3613c5d9c 100644
--- a/SAS/XML_generator/test/test_regression.in_data/xml/LC4_020_20150813.xml
+++ b/SAS/XML_generator/test/test_regression.in_data/xml/LC4_020_20150813.xml
@@ -174,11 +174,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -228,11 +228,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
diff --git a/SAS/XML_generator/test/test_regression.in_data/xml/LC4_022_3C58_HBA_parameters.xml b/SAS/XML_generator/test/test_regression.in_data/xml/LC4_022_3C58_HBA_parameters.xml
index 15492c3866d1077feb0c79d1b19d6d22322c3798..f54d2db6c2683cd6b42bfc3ef9c4f2f468344f49 100644
--- a/SAS/XML_generator/test/test_regression.in_data/xml/LC4_022_3C58_HBA_parameters.xml
+++ b/SAS/XML_generator/test/test_regression.in_data/xml/LC4_022_3C58_HBA_parameters.xml
@@ -130,11 +130,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -306,11 +306,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                     <pipelineAttributes>
@@ -375,11 +375,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <imagingPipelineAttributes>
@@ -545,11 +545,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
diff --git a/SAS/XML_generator/test/test_regression.in_data/xml/LT5_006_4C43_HBA_calSearch_parameters.xml b/SAS/XML_generator/test/test_regression.in_data/xml/LT5_006_4C43_HBA_calSearch_parameters.xml
index c8e1bc3b9f46f38d843922115de90f5b2cb97f02..feae5d0c82876d762be89b32e32c5fc84c56f4f0 100644
--- a/SAS/XML_generator/test/test_regression.in_data/xml/LT5_006_4C43_HBA_calSearch_parameters.xml
+++ b/SAS/XML_generator/test/test_regression.in_data/xml/LT5_006_4C43_HBA_calSearch_parameters.xml
@@ -60,7 +60,7 @@
                         <whichIS></whichIS>
                       </stokes>
                       <stationSet>Custom</stationSet>
-                      <stations>CS001,CS002,CS003,CS004,CS005,CS006,CS007,CS011,CS013,CS017,CS021,CS024,CS026,CS028,CS030,CS031,CS032,CS101,CS103,CS201,CS301,CS302,CS401,CS501,DE601,DE602,DE603,DE604,DE605,DE609,FR606,PL610,PL611,PL612,RS106,RS205,RS208,RS210,RS305,RS306,RS307,RS310,RS406,RS407,RS409,RS503,RS508,RS509,SE607,UK608</stations>
+                      <stations>CS001,CS002,CS003,CS004,CS005,CS006,CS007,CS011,CS013,CS017,CS021,CS024,CS026,CS028,CS030,CS031,CS032,CS101,CS103,CS201,CS301,CS302,CS401,CS501,DE601,DE602,DE603,DE604,DE605,DE609,FR606,IE613,PL610,PL611,PL612,RS106,RS205,RS208,RS210,RS305,RS306,RS307,RS310,RS406,RS407,RS409,RS503,RS508,RS509,SE607,UK608</stations>
                       <timeFrame>UT</timeFrame>
                       <startTime>2016-01-05T23:00:00</startTime>
                       <endTime>2016-01-05T23:05:00</endTime>
@@ -130,11 +130,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -236,7 +236,7 @@
                         <whichIS></whichIS>
                       </stokes>
                       <stationSet>Custom</stationSet>
-                      <stations>CS001,CS002,CS003,CS004,CS005,CS006,CS007,CS011,CS013,CS017,CS021,CS024,CS026,CS028,CS030,CS031,CS032,CS101,CS103,CS201,CS301,CS302,CS401,CS501,DE601,DE602,DE603,DE604,DE605,DE609,FR606,PL610,PL611,PL612,RS106,RS205,RS208,RS210,RS305,RS306,RS307,RS310,RS406,RS407,RS409,RS503,RS508,RS509,SE607,UK608</stations>
+                      <stations>CS001,CS002,CS003,CS004,CS005,CS006,CS007,CS011,CS013,CS017,CS021,CS024,CS026,CS028,CS030,CS031,CS032,CS101,CS103,CS201,CS301,CS302,CS401,CS501,DE601,DE602,DE603,DE604,DE605,DE609,FR606,IE613,PL610,PL611,PL612,RS106,RS205,RS208,RS210,RS305,RS306,RS307,RS310,RS406,RS407,RS409,RS503,RS508,RS509,SE607,UK608</stations>
                       <timeFrame>UT</timeFrame>
                       <startTime>2016-01-05T23:06:00</startTime>
                       <endTime>2016-01-05T23:31:00</endTime>
@@ -2946,11 +2946,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                     <pipelineAttributes>
@@ -3015,11 +3015,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                     <pipelineAttributes>
@@ -3084,11 +3084,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                     <pipelineAttributes>
@@ -3153,11 +3153,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                     <pipelineAttributes>
@@ -3222,11 +3222,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                     <pipelineAttributes>
@@ -3291,11 +3291,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                     <pipelineAttributes>
@@ -3360,11 +3360,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                     <pipelineAttributes>
@@ -3429,11 +3429,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                     <pipelineAttributes>
@@ -3498,11 +3498,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                     <pipelineAttributes>
@@ -3567,11 +3567,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                     <pipelineAttributes>
@@ -3636,11 +3636,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                     <pipelineAttributes>
@@ -3705,11 +3705,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                     <pipelineAttributes>
@@ -3774,11 +3774,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                     <pipelineAttributes>
@@ -3843,11 +3843,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                     <pipelineAttributes>
@@ -3912,11 +3912,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                     <pipelineAttributes>
@@ -3981,11 +3981,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                     <pipelineAttributes>
@@ -4050,11 +4050,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                     <pipelineAttributes>
@@ -4119,11 +4119,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                     <pipelineAttributes>
@@ -4188,11 +4188,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                     <pipelineAttributes>
@@ -4257,11 +4257,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                     <pipelineAttributes>
@@ -4326,11 +4326,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                     <pipelineAttributes>
@@ -4395,11 +4395,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                     <pipelineAttributes>
@@ -4464,11 +4464,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                     <pipelineAttributes>
@@ -4533,11 +4533,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                     <pipelineAttributes>
@@ -4602,11 +4602,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                     <pipelineAttributes>
@@ -4671,11 +4671,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                     <pipelineAttributes>
@@ -4740,11 +4740,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                     <pipelineAttributes>
@@ -4809,11 +4809,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                     <pipelineAttributes>
@@ -4878,11 +4878,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                     <pipelineAttributes>
@@ -4947,11 +4947,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                     <pipelineAttributes>
@@ -5016,11 +5016,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                     <pipelineAttributes>
@@ -5085,11 +5085,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                     <pipelineAttributes>
@@ -5154,11 +5154,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                     <pipelineAttributes>
@@ -5223,11 +5223,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                     <pipelineAttributes>
@@ -5292,11 +5292,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                     <pipelineAttributes>
@@ -5361,11 +5361,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                     <pipelineAttributes>
@@ -5430,11 +5430,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                     <pipelineAttributes>
@@ -5499,11 +5499,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                     <pipelineAttributes>
@@ -5568,11 +5568,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                     <pipelineAttributes>
@@ -5637,11 +5637,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                     <pipelineAttributes>
@@ -5706,11 +5706,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                     <pipelineAttributes>
@@ -5775,11 +5775,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                     <pipelineAttributes>
@@ -5844,11 +5844,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                     <pipelineAttributes>
@@ -5913,11 +5913,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                     <pipelineAttributes>
@@ -5982,11 +5982,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                     <pipelineAttributes>
@@ -6051,11 +6051,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                     <pipelineAttributes>
@@ -6120,11 +6120,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                     <pipelineAttributes>
@@ -6189,11 +6189,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                     <pipelineAttributes>
@@ -6258,11 +6258,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                     <pipelineAttributes>
@@ -6327,11 +6327,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                     <pipelineAttributes>
@@ -6396,11 +6396,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                     <pipelineAttributes>
@@ -6465,11 +6465,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                     <pipelineAttributes>
@@ -6534,11 +6534,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                     <pipelineAttributes>
@@ -6603,11 +6603,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                     <pipelineAttributes>
@@ -6672,11 +6672,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                     <pipelineAttributes>
@@ -6741,11 +6741,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                     <pipelineAttributes>
@@ -6810,11 +6810,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                     <pipelineAttributes>
@@ -6879,11 +6879,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                     <pipelineAttributes>
@@ -6948,11 +6948,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                     <pipelineAttributes>
@@ -7017,11 +7017,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                     <pipelineAttributes>
@@ -7086,11 +7086,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -7140,11 +7140,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -7186,11 +7186,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -7240,11 +7240,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -7286,11 +7286,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -7340,11 +7340,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -7386,11 +7386,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -7440,11 +7440,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -7486,11 +7486,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -7540,11 +7540,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -7586,11 +7586,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -7640,11 +7640,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -7686,11 +7686,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -7740,11 +7740,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -7786,11 +7786,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -7840,11 +7840,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -7886,11 +7886,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -7940,11 +7940,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -7986,11 +7986,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -8040,11 +8040,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -8086,11 +8086,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -8140,11 +8140,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -8186,11 +8186,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -8240,11 +8240,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -8286,11 +8286,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -8340,11 +8340,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -8386,11 +8386,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -8440,11 +8440,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -8486,11 +8486,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -8540,11 +8540,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -8586,11 +8586,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -8640,11 +8640,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -8686,11 +8686,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -8740,11 +8740,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -8786,11 +8786,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -8840,11 +8840,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -8886,11 +8886,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -8940,11 +8940,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -8986,11 +8986,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -9040,11 +9040,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -9086,11 +9086,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -9140,11 +9140,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -9186,11 +9186,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -9240,11 +9240,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -9286,11 +9286,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -9340,11 +9340,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -9386,11 +9386,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -9440,11 +9440,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -9486,11 +9486,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -9540,11 +9540,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -9586,11 +9586,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -9640,11 +9640,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -9686,11 +9686,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -9740,11 +9740,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -9786,11 +9786,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -9840,11 +9840,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -9886,11 +9886,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -9940,11 +9940,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -9986,11 +9986,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -10040,11 +10040,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -10086,11 +10086,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -10140,11 +10140,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -10186,11 +10186,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -10240,11 +10240,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -10286,11 +10286,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -10340,11 +10340,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -10386,11 +10386,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -10440,11 +10440,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -10486,11 +10486,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -10540,11 +10540,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -10586,11 +10586,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -10640,11 +10640,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -10686,11 +10686,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -10740,11 +10740,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -10786,11 +10786,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -10840,11 +10840,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -10886,11 +10886,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -10940,11 +10940,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -10986,11 +10986,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -11040,11 +11040,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -11086,11 +11086,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -11140,11 +11140,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -11186,11 +11186,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -11240,11 +11240,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -11286,11 +11286,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -11340,11 +11340,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -11386,11 +11386,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -11440,11 +11440,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -11486,11 +11486,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -11540,11 +11540,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -11586,11 +11586,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -11640,11 +11640,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -11686,11 +11686,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -11740,11 +11740,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -11786,11 +11786,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -11840,11 +11840,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -11886,11 +11886,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -11940,11 +11940,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -11986,11 +11986,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -12040,11 +12040,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -12086,11 +12086,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -12140,11 +12140,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -12186,11 +12186,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -12240,11 +12240,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -12286,11 +12286,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -12340,11 +12340,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -12386,11 +12386,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -12440,11 +12440,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -12486,11 +12486,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -12540,11 +12540,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -12586,11 +12586,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -12640,11 +12640,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -12686,11 +12686,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -12740,11 +12740,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -12786,11 +12786,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -12840,11 +12840,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -12886,11 +12886,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -12940,11 +12940,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -12986,11 +12986,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -13040,11 +13040,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
diff --git a/SAS/XML_generator/test/test_regression.in_data/xml/MSSS_20151207_testmultipipe.xml b/SAS/XML_generator/test/test_regression.in_data/xml/MSSS_20151207_testmultipipe.xml
index 6035b42c157e023de38a331d11ec333084840526..aa93772eac3f9ed01234788a7be9b6dd4a38bda0 100644
--- a/SAS/XML_generator/test/test_regression.in_data/xml/MSSS_20151207_testmultipipe.xml
+++ b/SAS/XML_generator/test/test_regression.in_data/xml/MSSS_20151207_testmultipipe.xml
@@ -438,11 +438,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -492,11 +492,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -546,11 +546,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -600,11 +600,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -654,11 +654,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -708,11 +708,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -762,11 +762,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -816,11 +816,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -870,11 +870,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -924,11 +924,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -978,11 +978,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -1032,11 +1032,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -1086,11 +1086,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -1140,11 +1140,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -1194,11 +1194,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -1248,11 +1248,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
diff --git a/SAS/XML_generator/test/test_regression.in_data/xml/hd156279b_reference.xml b/SAS/XML_generator/test/test_regression.in_data/xml/hd156279b_reference.xml
index 0b823dbcb3a76e00e6ab95b35dfd5f0676dc53ac..5a8ddd8875a4e03eb1fcc75b043a6bc5db36a4d4 100644
--- a/SAS/XML_generator/test/test_regression.in_data/xml/hd156279b_reference.xml
+++ b/SAS/XML_generator/test/test_regression.in_data/xml/hd156279b_reference.xml
@@ -174,11 +174,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -249,11 +249,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                     <pipelineAttributes>
diff --git a/SAS/XML_generator/test/test_regression.in_data/xml/lc4_019_1.xml b/SAS/XML_generator/test/test_regression.in_data/xml/lc4_019_1.xml
index f5cc0fdb69e77722cd899e21e91849db032cb6bb..881e4dd8561f716970e07d9ee874c2ff84058a27 100644
--- a/SAS/XML_generator/test/test_regression.in_data/xml/lc4_019_1.xml
+++ b/SAS/XML_generator/test/test_regression.in_data/xml/lc4_019_1.xml
@@ -134,11 +134,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
diff --git a/SAS/XML_generator/test/test_regression.in_data/xml/test_LB.xml b/SAS/XML_generator/test/test_regression.in_data/xml/test_LB.xml
index b72b8d4d93235e271a6aa471b42aca83cbb92ddc..fcc3c8fa79e389053cbeb6352a450cb4bd1cb039 100644
--- a/SAS/XML_generator/test/test_regression.in_data/xml/test_LB.xml
+++ b/SAS/XML_generator/test/test_regression.in_data/xml/test_LB.xml
@@ -130,11 +130,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -306,11 +306,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                     <pipelineAttributes>
@@ -375,11 +375,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -429,11 +429,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -576,11 +576,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -752,11 +752,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                     <pipelineAttributes>
@@ -821,11 +821,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -875,11 +875,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
diff --git a/SAS/XML_generator/test/test_regression.in_data/xml/test_input.xml b/SAS/XML_generator/test/test_regression.in_data/xml/test_input.xml
index bb11425814a430b394bb21fa522cb34777915071..555b18f784c8e3f3f927e12de6bf788315b1d52d 100644
--- a/SAS/XML_generator/test/test_regression.in_data/xml/test_input.xml
+++ b/SAS/XML_generator/test/test_regression.in_data/xml/test_input.xml
@@ -136,11 +136,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -314,11 +314,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
diff --git a/SAS/XML_generator/test/test_regression.in_data/xml/test_input_cep4.xml b/SAS/XML_generator/test/test_regression.in_data/xml/test_input_cep4.xml
index bb11425814a430b394bb21fa522cb34777915071..555b18f784c8e3f3f927e12de6bf788315b1d52d 100644
--- a/SAS/XML_generator/test/test_regression.in_data/xml/test_input_cep4.xml
+++ b/SAS/XML_generator/test/test_regression.in_data/xml/test_input_cep4.xml
@@ -136,11 +136,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -314,11 +314,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
diff --git a/SAS/XML_generator/test/test_regression.in_data/xml/test_input_long_baseline_pipeline.xml b/SAS/XML_generator/test/test_regression.in_data/xml/test_input_long_baseline_pipeline.xml
index dc4f371d0c49f1d1c7586de32b8d7230fa458a0f..b87acee6c5a42e511aac4474f60e35d1a0f1d916 100644
--- a/SAS/XML_generator/test/test_regression.in_data/xml/test_input_long_baseline_pipeline.xml
+++ b/SAS/XML_generator/test/test_regression.in_data/xml/test_input_long_baseline_pipeline.xml
@@ -140,11 +140,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -386,11 +386,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -461,11 +461,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                     <pipelineAttributes>
@@ -530,11 +530,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
@@ -584,11 +584,11 @@
   <processingCluster>
                     <name>CEP4</name>
                     <partition>cpu</partition>
-                    <numberOfTasks>24</numberOfTasks>
+                    <numberOfTasks>110</numberOfTasks>
                     <minRAMPerTask unit="byte">1000000000</minRAMPerTask>
                     <minScratchPerTask unit="byte">100000000</minScratchPerTask>    
-                    <maxDurationPerTask>PT600S</maxDurationPerTask>
-                    <numberOfCoresPerTask>20</numberOfCoresPerTask>
+                    <maxDurationPerTask>P7DT0S</maxDurationPerTask>
+                    <numberOfCoresPerTask>2</numberOfCoresPerTask>
                     <runSimultaneous>true</runSimultaneous>
                   </processingCluster>
                 <pipelineAttributes>
diff --git a/SubSystems/CMakeLists.txt b/SubSystems/CMakeLists.txt
index 1856e7ed83992c2a191f1ad87f9590efdc2b54dd..5624ba9bf4c198dc7f739aeccbef1f4b8fbe208c 100644
--- a/SubSystems/CMakeLists.txt
+++ b/SubSystems/CMakeLists.txt
@@ -10,7 +10,7 @@ lofar_add_package(ST_MAC)
 lofar_add_package(Offline)
 lofar_add_package(SAS_OTDB)
 lofar_add_package(SAS_Tools)
-lofar_add_package(PVSS_DB)
+lofar_add_package(WinCC_DB)
 lofar_add_package(RAServices)
 lofar_add_package(DataManagement)
 lofar_add_package(Dragnet)
diff --git a/SubSystems/Dragnet/CMakeLists.txt b/SubSystems/Dragnet/CMakeLists.txt
index 4b51682149b92f3f6f65d9d2538cde7a1de95554..7474a81ce7db49631c328623560c76e8a2b541b1 100644
--- a/SubSystems/Dragnet/CMakeLists.txt
+++ b/SubSystems/Dragnet/CMakeLists.txt
@@ -1,6 +1,6 @@
 # $Id$
 
 # Dragnet: LOFAR software install for the LOFAR DRAGNET cluster
-# - StorageQueryService + deps are needed for the simpleresourceupdater.py program
-lofar_package(Dragnet DEPENDS Online_Cobalt Offline StorageQueryService)
+# - ResourceTool + deps are needed for the resourcetool program to auto-update RADB periodically from DRAGNET nodes
+lofar_package(Dragnet DEPENDS Online_Cobalt Offline ResourceTool XML_generator)
 
diff --git a/SubSystems/Dragnet/scripts/LOFAR-Dragnet-deploy.sh b/SubSystems/Dragnet/scripts/LOFAR-Dragnet-deploy.sh
index e9b1e6b634ebea0e2124c89ce1cfe45d788eba9d..428bac1725c68266fc638d812145435ed19394b5 100755
--- a/SubSystems/Dragnet/scripts/LOFAR-Dragnet-deploy.sh
+++ b/SubSystems/Dragnet/scripts/LOFAR-Dragnet-deploy.sh
@@ -46,9 +46,12 @@ echo $lofar_version
 lofar_svn_root=https://svn.astron.nl/LOFAR
 lofar_versions_root=/opt/lofar_versions
 prefix=$lofar_versions_root/$lofar_release
-nodelist="dragnet dragproc $(seq -s ' ' -f drg%02g 1 23)"
+#
+# AS: Removed drg10 from nodelist as it is (temporarily) broken!!
+#
+nodelist="dragnet dragproc $(seq -s ' ' -f drg%02g 1 23 | sed s/drg10//g)"
 tmpdir=`mktemp -d 2>/dev/null || mktemp -d -t tempdir`  # GNU/Linux and Mac OS X compat mktemp usage
-buildtype=gnu_optarch  # optarch enables -O3 -march=native
+buildtype=gnucxx11_optarch  # optarch enables -O3 -march=native
 
 pushd "$tmpdir"
 
diff --git a/SubSystems/Online_Cobalt/test/CMakeLists.txt b/SubSystems/Online_Cobalt/test/CMakeLists.txt
index 46d04d507ade38d8548070e5b0b51867f0e467ac..324fcc49e00bc9887aac3b6e20ae91063f7cc821 100644
--- a/SubSystems/Online_Cobalt/test/CMakeLists.txt
+++ b/SubSystems/Online_Cobalt/test/CMakeLists.txt
@@ -30,3 +30,4 @@ endif(BUILD_TESTING)
 add_subdirectory(Correlator)
 add_subdirectory(Beamformer)
 add_subdirectory(Commensal)
+add_subdirectory(RSPRaw)
diff --git a/SubSystems/Online_Cobalt/test/RSPRaw/CMakeLists.txt b/SubSystems/Online_Cobalt/test/RSPRaw/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..3b55259b67e51b252d8e24b2f49dae94ae0d2b5a
--- /dev/null
+++ b/SubSystems/Online_Cobalt/test/RSPRaw/CMakeLists.txt
@@ -0,0 +1,14 @@
+# $Id$
+
+include(LofarCTest)
+
+set(_tests
+  tRSPRaw
+)
+
+foreach(_test ${_tests})
+  lofar_add_test(${_test} DEPENDS printRSP)  # printRSP is used in *-check-output.sh script
+  if(BUILD_TESTING)
+    set_tests_properties(${_test} PROPERTIES RUN_SERIAL ON)
+  endif(BUILD_TESTING)
+endforeach(_test ${_tests})
diff --git a/SubSystems/Online_Cobalt/test/RSPRaw/tRSPRaw-check-output.sh b/SubSystems/Online_Cobalt/test/RSPRaw/tRSPRaw-check-output.sh
new file mode 100755
index 0000000000000000000000000000000000000000..30d903a91a42947e2e898deb746135aee15ad13c
--- /dev/null
+++ b/SubSystems/Online_Cobalt/test/RSPRaw/tRSPRaw-check-output.sh
@@ -0,0 +1,33 @@
+#!/bin/bash
+#
+# tRSPRaw output is quite big, so instead of diff-ing to a reference output,
+# check some properties in this script.
+#
+# $Id$
+
+if [ $# -ne 1 ]; then
+  echo 'Syntax: tRSPRaw-check-output.sh <test-output-dir>' >&2
+  exit 1
+fi
+
+OUTDIR="$1"
+
+# from the .parset:
+IN_FILENAME1=/localhome/lofar/test_sets/3sec/raw-b1919-hba-CS002HBA0-0.udp
+IN_FILENAME2=/localhome/lofar/test_sets/3sec/raw-b1919-hba-CS501HBA0-0.udp
+OUT_FILENAME1="$OUTDIR/L102030_CS002HBA0_0_rsp.raw"
+OUT_FILENAME2="$OUTDIR/L102030_CS501HBA0_0_rsp.raw"
+TIMESTAMP_PATTERN="14:15:"  # to exclude the first N packets in IN_FILENAME* with timestamps before RSP raw start time
+
+# Check input vs output on number of RSP packets and their sample number written between parset RSPRaw start/stop time.
+# Echo files to compared, since the diff cmd below compares /dev/fd/N filedescriptors, which gives a useless error message.
+echo 'tRSPRaw-check-output.sh: doing rough check using diff(1) and printRSP (source under InputProc/src/Station/) on generated RSP raw input and output files'
+echo "tRSPRaw-check-output.sh: diff 1: $IN_FILENAME1 (filtered) vs $OUT_FILENAME1"
+echo "tRSPRaw-check-output.sh: diff 2: $IN_FILENAME2 (filtered) vs $OUT_FILENAME2"
+printRSP < /dev/null || exit $?  # exit 127 if printRSP not found (the next cmds do not)
+diff -q <(printRSP < "$IN_FILENAME1"  | grep "Time stamp:   Thu Dec  5 $TIMESTAMP_PATTERN") \
+        <(printRSP < "$OUT_FILENAME1" | grep "Time stamp:   Thu Dec  5 $TIMESTAMP_PATTERN") \
+&& \
+diff -q <(printRSP < "$IN_FILENAME2"  | grep "Time stamp:   Thu Dec  5 $TIMESTAMP_PATTERN") \
+        <(printRSP < "$OUT_FILENAME2" | grep "Time stamp:   Thu Dec  5 $TIMESTAMP_PATTERN")
+
diff --git a/SubSystems/Online_Cobalt/test/RSPRaw/tRSPRaw.parset b/SubSystems/Online_Cobalt/test/RSPRaw/tRSPRaw.parset
new file mode 100644
index 0000000000000000000000000000000000000000..6ecd367c4be562bfbe8a8177a1a711ac1ccf93c6
--- /dev/null
+++ b/SubSystems/Online_Cobalt/test/RSPRaw/tRSPRaw.parset
@@ -0,0 +1,137 @@
+Cobalt.realTime = false
+Observation.ObsID = 102030
+Observation.momID = 88
+Cobalt.commandStream = null:
+Observation.startTime = '2013-12-05 14:15:00'
+Observation.stopTime = '2013-12-05 14:15:04'
+Observation.sampleClock = 200
+Observation.nrBitsPerSample = 16
+Cobalt.correctBandPass = true
+Cobalt.correctClocks = true
+Cobalt.BeamFormer.coherentDedisperseChannels = false
+Cobalt.delayCompensation = true
+Observation.referencePhaseCenter = [3826577.066, 461022.948, 5064892.786]
+Observation.antennaArray = HBA
+Observation.antennaSet = HBA_ZERO
+Observation.bandFilter = HBA_110_190
+Observation.nrPolarisations = 2
+Observation.nrBeams = 2
+
+Observation.Beam[0].TiedArrayBeam[0].angle1 = 0.0
+Observation.Beam[0].TiedArrayBeam[0].angle2 = 0.0
+Observation.Beam[0].TiedArrayBeam[0].coherent = true
+Observation.Beam[0].TiedArrayBeam[0].directionType = J2000
+Observation.Beam[0].TiedArrayBeam[0].dispersionMeasure = 0
+Observation.Beam[0].TiedArrayBeam[0].specificationType = manual
+Observation.Beam[0].TiedArrayBeam[0].stationList = []
+Observation.Beam[0].TiedArrayBeam[1].angle1 = 0.9293449206762021
+Observation.Beam[0].TiedArrayBeam[1].angle2 = 0.9525764650544495
+Observation.Beam[0].TiedArrayBeam[1].coherent = false
+Observation.Beam[0].TiedArrayBeam[1].directionType = J2000
+Observation.Beam[0].TiedArrayBeam[1].dispersionMeasure = 0
+Observation.Beam[0].TiedArrayBeam[1].specificationType = manual
+Observation.Beam[0].TiedArrayBeam[1].stationList = []
+Observation.Beam[0].angle1 = 0.9293449206762021
+Observation.Beam[0].angle2 = 0.9525764650544495
+Observation.Beam[0].beamletList = []
+Observation.Beam[0].directionType = J2000
+Observation.Beam[0].duration = 900
+Observation.Beam[0].maximizeDuration = false
+Observation.Beam[0].momID = 88
+Observation.Beam[0].nrTabRings = 0
+Observation.Beam[0].nrTiedArrayBeams = 2
+Observation.Beam[0].startTime =
+Observation.Beam[0].subbandList = [100..101]
+Observation.Beam[0].tabRingSize = 0.0
+Observation.Beam[0].target = B0329+54
+
+Observation.Beam[1].TiedArrayBeam[0].angle1 = 0.0
+Observation.Beam[1].TiedArrayBeam[0].angle2 = 0.0
+Observation.Beam[1].TiedArrayBeam[0].coherent = true
+Observation.Beam[1].TiedArrayBeam[0].directionType = J2000
+Observation.Beam[1].TiedArrayBeam[0].dispersionMeasure = 0
+Observation.Beam[1].TiedArrayBeam[0].specificationType = manual
+Observation.Beam[1].TiedArrayBeam[0].stationList = []
+Observation.Beam[1].TiedArrayBeam[1].angle1 = 0.8293449206762021
+Observation.Beam[1].TiedArrayBeam[1].angle2 = 0.8525764650544495
+Observation.Beam[1].TiedArrayBeam[1].coherent = false
+Observation.Beam[1].TiedArrayBeam[1].directionType = J2000
+Observation.Beam[1].TiedArrayBeam[1].dispersionMeasure = 0
+Observation.Beam[1].TiedArrayBeam[1].specificationType = manual
+Observation.Beam[1].TiedArrayBeam[1].stationList = []
+Observation.Beam[1].angle1 = 0.8293449206762021
+Observation.Beam[1].angle2 = 0.8525764650544495
+Observation.Beam[1].beamletList = []
+Observation.Beam[1].directionType = J2000
+Observation.Beam[1].duration = 900
+Observation.Beam[1].maximizeDuration = false
+Observation.Beam[1].momID = 88
+Observation.Beam[1].nrTabRings = 0
+Observation.Beam[1].nrTiedArrayBeams = 2
+Observation.Beam[1].startTime =
+Observation.Beam[1].subbandList = [200..201]
+Observation.Beam[1].tabRingSize = 0.0
+Observation.Beam[1].target = "-0.1 test offset from Beam0 (B0329+54)"
+
+Observation.AnaBeam.angle1 = 0.9293449206762021
+Observation.AnaBeam.angle2 = 0.9525764650544495
+Observation.AnaBeam.directionType = J2000
+Observation.AnaBeam.duration = 900
+Observation.AnaBeam.maximizeDuration = false
+Observation.AnaBeam.rank = 1
+Observation.AnaBeam.startTime =
+Observation.AnaBeam.target = B0329+54
+
+Cobalt.blockSize=196608
+Observation.VirtualInstrument.stationList = [CS002, CS501]
+
+PIC.Core.CS002HBA0.HBA_ZERO.HBA_110_190.phase0.X =   0.000000e+00
+PIC.Core.CS002HBA0.HBA_ZERO.HBA_110_190.phase0.Y =   0.000000e+00
+PIC.Core.CS002HBA0.HBA_ZERO.HBA_110_190.delay.X  =   6.875965e-06
+PIC.Core.CS002HBA0.HBA_ZERO.HBA_110_190.delay.Y  =   6.876319e-06
+PIC.Core.CS002HBA0.RSP.ports=[file:/localhome/lofar/test_sets/3sec/raw-b1919-hba-CS002HBA0-0.udp]
+PIC.Core.CS002HBA0.phaseCenter=[3826600.961, 460953.402, 5064881.136]
+
+PIC.Core.CS501HBA0.HBA_ZERO.HBA_110_190.phase0.X =   0.000000e+00
+PIC.Core.CS501HBA0.HBA_ZERO.HBA_110_190.phase0.Y =   0.000000e+00
+PIC.Core.CS501HBA0.HBA_ZERO.HBA_110_190.delay.X  =   1.649378e-05
+PIC.Core.CS501HBA0.HBA_ZERO.HBA_110_190.delay.Y  =   1.649378e-05
+PIC.Core.CS501HBA0.RSP.ports=[file:/localhome/lofar/test_sets/3sec/raw-b1919-hba-CS501HBA0-0.udp]
+PIC.Core.CS501HBA0.phaseCenter=[3825568.820, 460647.620, 5065683.028]
+
+Observation.Dataslots.CS002HBA0.DataslotList=[0..19]
+Observation.Dataslots.CS002HBA0.RSPBoardList=[20*0]
+Observation.Dataslots.CS501HBA0.DataslotList=[0..19]
+Observation.Dataslots.CS501HBA0.RSPBoardList=[20*0]
+
+Cobalt.Correlator.nrChannelsPerSubband = 64
+Cobalt.Correlator.nrBlocksPerIntegration = 1
+Cobalt.Correlator.nrIntegrationsPerBlock = 1
+
+Cobalt.BeamFormer.flysEye = false
+Cobalt.BeamFormer.nrDelayCompensationChannels = 256
+Cobalt.BeamFormer.nrHighResolutionChannels = 256
+
+Cobalt.BeamFormer.CoherentStokes.nrChannelsPerSubband = 1
+Cobalt.BeamFormer.CoherentStokes.subbandsPerFile = 20
+Cobalt.BeamFormer.CoherentStokes.timeIntegrationFactor = 2
+Cobalt.BeamFormer.CoherentStokes.which = I
+Cobalt.BeamFormer.IncoherentStokes.nrChannelsPerSubband = 16
+Cobalt.BeamFormer.IncoherentStokes.subbandsPerFile = 512
+Cobalt.BeamFormer.IncoherentStokes.timeIntegrationFactor = 4
+Cobalt.BeamFormer.IncoherentStokes.which = IQUV
+
+Observation.DataProducts.Output_Correlated.enabled = false
+Observation.DataProducts.Output_CoherentStokes.enabled = false
+Observation.DataProducts.Output_IncoherentStokes.enabled = false
+
+Observation.DataProducts.Output_RSPRaw.enabled = true
+Observation.DataProducts.Output_RSPRaw.filenames = [L102030_CS002HBA0_0_rsp.raw, L102030_CS501HBA0_0_rsp.raw]
+Observation.DataProducts.Output_RSPRaw.locations = [2*localhost:.]  # NOTE: .run file from test program overrides this value
+
+Observation.Campaign.name="BLA_000"
+Observation.Campaign.title="BLA: the unsearch for Binary Large Asteroids"
+Observation.Campaign.PI="Maze, Dr. Twisted"
+Observation.Campaign.CO_I="Mace, Dr. Peninsula"
+Observation.Campaign.contact="Maze, Dr. Twisted"
+
diff --git a/SubSystems/Online_Cobalt/test/RSPRaw/tRSPRaw.run b/SubSystems/Online_Cobalt/test/RSPRaw/tRSPRaw.run
new file mode 100755
index 0000000000000000000000000000000000000000..a7bd4043c0711ab3af7128d2f8a781484c4c5d5a
--- /dev/null
+++ b/SubSystems/Online_Cobalt/test/RSPRaw/tRSPRaw.run
@@ -0,0 +1,8 @@
+#!/bin/bash
+TESTNAME=`basename "${0%%.run}"`
+
+# Replace output keys in parset (for now append; TODO: replace)
+echo "Observation.DataProducts.Output_RSPRaw.locations="\
+     "[2*localhost:${PWD}/${TESTNAME}.output]" >> ${TESTNAME}.parset
+
+../runtest.sh "$TESTNAME"
diff --git a/SubSystems/Online_Cobalt/test/RSPRaw/tRSPRaw.sh b/SubSystems/Online_Cobalt/test/RSPRaw/tRSPRaw.sh
new file mode 100755
index 0000000000000000000000000000000000000000..77618c6ec665142df5f97632d1b7d2424b5a3070
--- /dev/null
+++ b/SubSystems/Online_Cobalt/test/RSPRaw/tRSPRaw.sh
@@ -0,0 +1,2 @@
+#!/bin/sh
+./runctest.sh $(basename "${0%%.sh}")
diff --git a/SubSystems/Online_Cobalt/test/runtest.sh.in b/SubSystems/Online_Cobalt/test/runtest.sh.in
index 04e5845e1ae4447d6dc566597ae5dedfda074c17..bd8240e750ac37b788afba28cc0fb3d6cd279570 100755
--- a/SubSystems/Online_Cobalt/test/runtest.sh.in
+++ b/SubSystems/Online_Cobalt/test/runtest.sh.in
@@ -60,6 +60,13 @@ echo "  in directory $(pwd)"
     done
   done
 
+  # Run custom output validation script if any
+  CUSTOM_CHECK_SCRIPT="${srcdir}/${TESTNAME}-check-output.sh"
+  if [ -x "$CUSTOM_CHECK_SCRIPT" ]; then
+    echo "running custom output validation script: $CUSTOM_CHECK_SCRIPT $PWD"
+    "$CUSTOM_CHECK_SCRIPT" "$PWD" || error "custom output validation script failed!"
+  fi
+
   if have_qpid; then
     # validate the contents of the queues
     mkdir "queues" || error "Failed to create temporary directory ${OUTDIR}/queues"
diff --git a/SubSystems/Online_Cobalt/test/testFuncs.sh.in b/SubSystems/Online_Cobalt/test/testFuncs.sh.in
index 1c03e9c0ad0c6b1e485a720effa8c550ff7abbe8..93413e709f6b341e2470165d52da7c1bdcb2221a 100755
--- a/SubSystems/Online_Cobalt/test/testFuncs.sh.in
+++ b/SubSystems/Online_Cobalt/test/testFuncs.sh.in
@@ -6,7 +6,8 @@
 
 error()
 {
-  echo "ERROR: $@" >&2
+  ts=`date '+%F %T.%N'`  # e.g. 2015-10-16 16:00:46.186
+  echo "$ts ERROR - $@" >&2
   exit 1
 }
 
diff --git a/SubSystems/Online_Cobalt/test/tstartBGL.run b/SubSystems/Online_Cobalt/test/tstartBGL.run
index 9f38eb2fc70bf47b092fd0cea5389af9131838ee..800d5ddf1ce40e3ef64363c4cca5fea5357d2ff4 100755
--- a/SubSystems/Online_Cobalt/test/tstartBGL.run
+++ b/SubSystems/Online_Cobalt/test/tstartBGL.run
@@ -63,10 +63,11 @@ echo "Cobalt.FinalMetaDataGatherer.host=localhost" >> tstartBGL.in_parset
 for cluster in CEP4 DRAGNET; do  # all in cobalt_functions.sh as used by runObservation.sh
   echo "Testing with storageClusterName $cluster"
   echo "Observation.DataProducts.Output_Correlated.storageClusterName=$cluster" >> tstartBGL.in_parset
-  startBGL.sh 1 2 3 tstartBGL.in_parset 1000 || error "startBGL.sh failed"
+  nice -n 5 startBGL.sh 1 2 3 tstartBGL.in_parset 1000 || error "startBGL.sh failed"
 
   # PID file is created by runObservation.sh, which is started in the background. Although the PID file
   # is created almost immediately, we may be too fast if we check without waiting.
+  # Used 'nice -n 5' to dramatically increase the chance that we check before the pid file is removed again.
   sleep 1
   [ -e $LOFARROOT/var/run/rtcp-1000.pid ] || error "Found no $LOFARROOT/var/run/rtcp-1000.pid"
 
diff --git a/SubSystems/Online_Cobalt/validation/system/network/routes.cbt001 b/SubSystems/Online_Cobalt/validation/system/network/routes.cbt001
index 8277c6b62b235c6f4f22f09e6ae2b9d74c997efd..c4ec29697bfdd76bcb8c130bceef436d61cbef81 100644
--- a/SubSystems/Online_Cobalt/validation/system/network/routes.cbt001
+++ b/SubSystems/Online_Cobalt/validation/system/network/routes.cbt001
@@ -1,12 +1,13 @@
-default via 10.151.255.254 dev eth0  metric 100 
 10.134.224.0/19 dev ib0  proto kernel  scope link  src 10.134.246.1 
 10.134.224.0/19 dev ib1  proto kernel  scope link  src 10.134.246.2 
 10.144.0.0/13 dev eth0  proto kernel  scope link  src 10.149.128.1 
-10.168.0.0/13 dev eth4  proto kernel  scope link  src 10.168.96.3 
+10.168.0.0/13 dev eth2  proto kernel  scope link  src 10.168.96.1 
 10.168.0.0/13 dev eth3  proto kernel  scope link  src 10.168.96.2 
+10.168.0.0/13 dev eth4  proto kernel  scope link  src 10.168.96.3 
 10.168.0.0/13 dev eth5  proto kernel  scope link  src 10.168.96.4 
-10.168.0.0/13 dev eth2  proto kernel  scope link  src 10.168.96.1 
 10.175.1.0/24 dev eth2  scope link 
 10.175.2.0/24 dev eth3  scope link 
 10.175.3.0/24 dev eth4  scope link 
 10.175.4.0/24 dev eth5  scope link 
+10.220.81.0/24 dev vlan2281  proto kernel  scope link  src 10.220.81.101 
+default via 10.151.255.254 dev eth0  metric 100 
diff --git a/SubSystems/Online_Cobalt/validation/system/network/routes.cbt002 b/SubSystems/Online_Cobalt/validation/system/network/routes.cbt002
index 43d71ef891f9e78af2659eb857f48d0c56190610..fd8559c5f4688d8e268eb76cdefaf34961918a1e 100644
--- a/SubSystems/Online_Cobalt/validation/system/network/routes.cbt002
+++ b/SubSystems/Online_Cobalt/validation/system/network/routes.cbt002
@@ -1,12 +1,13 @@
-default via 10.151.255.254 dev eth0  metric 100 
 10.134.224.0/19 dev ib0  proto kernel  scope link  src 10.134.246.3 
 10.134.224.0/19 dev ib1  proto kernel  scope link  src 10.134.246.4 
 10.144.0.0/13 dev eth0  proto kernel  scope link  src 10.149.128.2 
-10.168.0.0/13 dev eth3  proto kernel  scope link  src 10.168.97.2 
-10.168.0.0/13 dev eth5  proto kernel  scope link  src 10.168.97.4 
 10.168.0.0/13 dev eth2  proto kernel  scope link  src 10.168.97.1 
+10.168.0.0/13 dev eth3  proto kernel  scope link  src 10.168.97.2 
 10.168.0.0/13 dev eth4  proto kernel  scope link  src 10.168.97.3 
+10.168.0.0/13 dev eth5  proto kernel  scope link  src 10.168.97.4 
 10.175.1.0/24 dev eth2  scope link 
 10.175.2.0/24 dev eth3  scope link 
 10.175.3.0/24 dev eth4  scope link 
 10.175.4.0/24 dev eth5  scope link 
+10.220.81.0/24 dev vlan2281  proto kernel  scope link  src 10.220.81.102 
+default via 10.151.255.254 dev eth0  metric 100 
diff --git a/SubSystems/Online_Cobalt/validation/system/network/routes.cbt003 b/SubSystems/Online_Cobalt/validation/system/network/routes.cbt003
index 7016a6ed22708b3346ca6e1df1dce57fafaae029..c6d0c9b836fdffbdbae26eb55492297d1a83e14d 100644
--- a/SubSystems/Online_Cobalt/validation/system/network/routes.cbt003
+++ b/SubSystems/Online_Cobalt/validation/system/network/routes.cbt003
@@ -1,11 +1,10 @@
-default via 10.151.255.254 dev eth0  metric 100 
 10.134.224.0/19 dev ib0  proto kernel  scope link  src 10.134.246.5 
 10.134.224.0/19 dev ib1  proto kernel  scope link  src 10.134.246.6 
 10.144.0.0/13 dev eth0  proto kernel  scope link  src 10.149.128.3 
-10.168.0.0/13 dev eth5  proto kernel  scope link  src 10.168.98.4 
-10.168.0.0/13 dev eth3  proto kernel  scope link  src 10.168.98.2 
 10.168.0.0/13 dev eth2  proto kernel  scope link  src 10.168.98.1 
+10.168.0.0/13 dev eth3  proto kernel  scope link  src 10.168.98.2 
 10.168.0.0/13 dev eth4  proto kernel  scope link  src 10.168.98.3 
+10.168.0.0/13 dev eth5  proto kernel  scope link  src 10.168.98.4 
 10.175.1.0/24 dev eth2  scope link 
 10.175.2.0/24 dev eth3  scope link 
 10.175.3.0/24 dev eth4  scope link 
@@ -21,3 +20,4 @@ default via 10.151.255.254 dev eth0  metric 100
 10.220.11.0/24 dev vlan2211  proto kernel  scope link  src 10.220.11.103 
 10.220.41.0/24 dev vlan2241  proto kernel  scope link  src 10.220.41.103 
 10.220.61.0/24 dev vlan2261  proto kernel  scope link  src 10.220.61.103 
+default via 10.151.255.254 dev eth0  metric 100 
diff --git a/SubSystems/Online_Cobalt/validation/system/network/routes.cbt004 b/SubSystems/Online_Cobalt/validation/system/network/routes.cbt004
index c50bc8bff7fc62c0cdf89ca632700b19c6cfce1d..d9c783b8c993951bec4566b2ccf09618b9d2b069 100644
--- a/SubSystems/Online_Cobalt/validation/system/network/routes.cbt004
+++ b/SubSystems/Online_Cobalt/validation/system/network/routes.cbt004
@@ -1,11 +1,10 @@
-default via 10.151.255.254 dev eth0  metric 100 
-10.134.224.0/19 dev ib1  proto kernel  scope link  src 10.134.246.8 
 10.134.224.0/19 dev ib0  proto kernel  scope link  src 10.134.246.7 
+10.134.224.0/19 dev ib1  proto kernel  scope link  src 10.134.246.8 
 10.144.0.0/13 dev eth0  proto kernel  scope link  src 10.149.128.4 
-10.168.0.0/13 dev eth5  proto kernel  scope link  src 10.168.99.4 
 10.168.0.0/13 dev eth2  proto kernel  scope link  src 10.168.99.1 
 10.168.0.0/13 dev eth3  proto kernel  scope link  src 10.168.99.2 
 10.168.0.0/13 dev eth4  proto kernel  scope link  src 10.168.99.3 
+10.168.0.0/13 dev eth5  proto kernel  scope link  src 10.168.99.4 
 10.175.1.0/24 dev eth2  scope link 
 10.175.2.0/24 dev eth3  scope link 
 10.175.3.0/24 dev eth4  scope link 
@@ -21,3 +20,4 @@ default via 10.151.255.254 dev eth0  metric 100
 10.220.11.0/24 dev vlan2211  proto kernel  scope link  src 10.220.11.104 
 10.220.41.0/24 dev vlan2241  proto kernel  scope link  src 10.220.41.104 
 10.220.61.0/24 dev vlan2261  proto kernel  scope link  src 10.220.61.104 
+default via 10.151.255.254 dev eth0  metric 100 
diff --git a/SubSystems/Online_Cobalt/validation/system/network/routes.cbt005 b/SubSystems/Online_Cobalt/validation/system/network/routes.cbt005
index dc50a726f53ac32e8d83e816f60db007f0a4f7d2..8543687f41104deb381f7aa8c0b2f1e69395aae6 100644
--- a/SubSystems/Online_Cobalt/validation/system/network/routes.cbt005
+++ b/SubSystems/Online_Cobalt/validation/system/network/routes.cbt005
@@ -1,11 +1,10 @@
-default via 10.151.255.254 dev eth0  metric 100 
 10.134.224.0/19 dev ib0  proto kernel  scope link  src 10.134.246.9 
 10.134.224.0/19 dev ib1  proto kernel  scope link  src 10.134.246.10 
 10.144.0.0/13 dev eth0  proto kernel  scope link  src 10.149.128.5 
-10.168.0.0/13 dev eth5  proto kernel  scope link  src 10.168.100.4 
+10.168.0.0/13 dev eth2  proto kernel  scope link  src 10.168.100.1 
 10.168.0.0/13 dev eth3  proto kernel  scope link  src 10.168.100.2 
 10.168.0.0/13 dev eth4  proto kernel  scope link  src 10.168.100.3 
-10.168.0.0/13 dev eth2  proto kernel  scope link  src 10.168.100.1 
+10.168.0.0/13 dev eth5  proto kernel  scope link  src 10.168.100.4 
 10.175.1.0/24 dev eth2  scope link 
 10.175.2.0/24 dev eth3  scope link 
 10.175.3.0/24 dev eth4  scope link 
@@ -21,3 +20,4 @@ default via 10.151.255.254 dev eth0  metric 100
 10.220.11.0/24 dev vlan2211  proto kernel  scope link  src 10.220.11.105 
 10.220.41.0/24 dev vlan2241  proto kernel  scope link  src 10.220.41.105 
 10.220.61.0/24 dev vlan2261  proto kernel  scope link  src 10.220.61.105 
+default via 10.151.255.254 dev eth0  metric 100 
diff --git a/SubSystems/Online_Cobalt/validation/system/network/routes.cbt006 b/SubSystems/Online_Cobalt/validation/system/network/routes.cbt006
index 15ceb252a48efcef5f22f51af4c82eb6c8496ad3..b06cf74c8b7bc8ef7f896c238865c60d86a3e766 100644
--- a/SubSystems/Online_Cobalt/validation/system/network/routes.cbt006
+++ b/SubSystems/Online_Cobalt/validation/system/network/routes.cbt006
@@ -1,12 +1,13 @@
-default via 10.151.255.254 dev eth0  metric 100 
 10.134.224.0/19 dev ib0  proto kernel  scope link  src 10.134.246.11 
 10.134.224.0/19 dev ib1  proto kernel  scope link  src 10.134.246.12 
 10.144.0.0/13 dev eth0  proto kernel  scope link  src 10.149.128.6 
-10.168.0.0/13 dev eth3  proto kernel  scope link  src 10.168.101.2 
 10.168.0.0/13 dev eth2  proto kernel  scope link  src 10.168.101.1 
-10.168.0.0/13 dev eth5  proto kernel  scope link  src 10.168.101.4 
+10.168.0.0/13 dev eth3  proto kernel  scope link  src 10.168.101.2 
 10.168.0.0/13 dev eth4  proto kernel  scope link  src 10.168.101.3 
+10.168.0.0/13 dev eth5  proto kernel  scope link  src 10.168.101.4 
 10.175.1.0/24 dev eth2  scope link 
 10.175.2.0/24 dev eth3  scope link 
 10.175.3.0/24 dev eth4  scope link 
 10.175.4.0/24 dev eth5  scope link 
+10.220.81.0/24 dev vlan2281  proto kernel  scope link  src 10.220.81.106 
+default via 10.151.255.254 dev eth0  metric 100 
diff --git a/SubSystems/Online_Cobalt/validation/system/network/routes.cbt007 b/SubSystems/Online_Cobalt/validation/system/network/routes.cbt007
index c07ef884c445840e86337c6c7b1b52b8e584c948..48145697aab9d1c73d3f64d257c2e732c7a438b1 100644
--- a/SubSystems/Online_Cobalt/validation/system/network/routes.cbt007
+++ b/SubSystems/Online_Cobalt/validation/system/network/routes.cbt007
@@ -1,12 +1,13 @@
-default via 10.151.255.254 dev eth0  metric 100 
-10.134.224.0/19 dev ib1  proto kernel  scope link  src 10.134.246.14 
 10.134.224.0/19 dev ib0  proto kernel  scope link  src 10.134.246.13 
+10.134.224.0/19 dev ib1  proto kernel  scope link  src 10.134.246.14 
 10.144.0.0/13 dev eth0  proto kernel  scope link  src 10.149.128.7 
+10.168.0.0/13 dev eth2  proto kernel  scope link  src 10.168.102.1 
 10.168.0.0/13 dev eth3  proto kernel  scope link  src 10.168.102.2 
 10.168.0.0/13 dev eth4  proto kernel  scope link  src 10.168.102.3 
-10.168.0.0/13 dev eth2  proto kernel  scope link  src 10.168.102.1 
 10.168.0.0/13 dev eth5  proto kernel  scope link  src 10.168.102.4 
 10.175.1.0/24 dev eth2  scope link 
 10.175.2.0/24 dev eth3  scope link 
 10.175.3.0/24 dev eth4  scope link 
 10.175.4.0/24 dev eth5  scope link 
+10.220.81.0/24 dev vlan2281  proto kernel  scope link  src 10.220.81.107 
+default via 10.151.255.254 dev eth0  metric 100 
diff --git a/SubSystems/Online_Cobalt/validation/system/network/routes.cbt008 b/SubSystems/Online_Cobalt/validation/system/network/routes.cbt008
index 327cd3fe3c08001d2c68c44ea45667b77c5eee3c..fc0bce9a3d532ae4e9d6fb54c05c7f4608df4f31 100644
--- a/SubSystems/Online_Cobalt/validation/system/network/routes.cbt008
+++ b/SubSystems/Online_Cobalt/validation/system/network/routes.cbt008
@@ -1,11 +1,10 @@
-default via 10.151.255.254 dev eth0  metric 100 
 10.134.224.0/19 dev ib0  proto kernel  scope link  src 10.134.246.15 
 10.134.224.0/19 dev ib1  proto kernel  scope link  src 10.134.246.16 
 10.144.0.0/13 dev eth0  proto kernel  scope link  src 10.149.128.8 
-10.168.0.0/13 dev eth5  proto kernel  scope link  src 10.168.103.4 
-10.168.0.0/13 dev eth4  proto kernel  scope link  src 10.168.103.3 
-10.168.0.0/13 dev eth3  proto kernel  scope link  src 10.168.103.2 
 10.168.0.0/13 dev eth2  proto kernel  scope link  src 10.168.103.1 
+10.168.0.0/13 dev eth3  proto kernel  scope link  src 10.168.103.2 
+10.168.0.0/13 dev eth4  proto kernel  scope link  src 10.168.103.3 
+10.168.0.0/13 dev eth5  proto kernel  scope link  src 10.168.103.4 
 10.175.1.0/24 dev eth2  scope link 
 10.175.2.0/24 dev eth3  scope link 
 10.175.3.0/24 dev eth4  scope link 
@@ -21,3 +20,4 @@ default via 10.151.255.254 dev eth0  metric 100
 10.220.11.0/24 dev vlan2211  proto kernel  scope link  src 10.220.11.108 
 10.220.41.0/24 dev vlan2241  proto kernel  scope link  src 10.220.41.108 
 10.220.61.0/24 dev vlan2261  proto kernel  scope link  src 10.220.61.108 
+default via 10.151.255.254 dev eth0  metric 100 
diff --git a/SubSystems/Online_Cobalt/validation/system/network/routes.cbt009 b/SubSystems/Online_Cobalt/validation/system/network/routes.cbt009
index f0ccc49aaaab79f16ec5f010bc7a9e584ec00cb8..f2353d786c5c811e459c20204d6d3ec4753d54c9 100644
--- a/SubSystems/Online_Cobalt/validation/system/network/routes.cbt009
+++ b/SubSystems/Online_Cobalt/validation/system/network/routes.cbt009
@@ -1,11 +1,10 @@
-default via 10.151.255.254 dev eth0  metric 100 
 10.134.224.0/19 dev ib0  proto kernel  scope link  src 10.134.246.17 
 10.134.224.0/19 dev ib1  proto kernel  scope link  src 10.134.246.18 
 10.144.0.0/13 dev eth0  proto kernel  scope link  src 10.149.128.9 
-10.168.0.0/13 dev eth5  proto kernel  scope link  src 10.168.104.4 
+10.168.0.0/13 dev eth2  proto kernel  scope link  src 10.168.104.1 
 10.168.0.0/13 dev eth3  proto kernel  scope link  src 10.168.104.2 
 10.168.0.0/13 dev eth4  proto kernel  scope link  src 10.168.104.3 
-10.168.0.0/13 dev eth2  proto kernel  scope link  src 10.168.104.1 
+10.168.0.0/13 dev eth5  proto kernel  scope link  src 10.168.104.4 
 10.175.1.0/24 dev eth2  scope link 
 10.175.2.0/24 dev eth3  scope link 
 10.175.3.0/24 dev eth4  scope link 
@@ -21,3 +20,4 @@ default via 10.151.255.254 dev eth0  metric 100
 10.220.11.0/24 dev vlan2211  proto kernel  scope link  src 10.220.11.109 
 10.220.41.0/24 dev vlan2241  proto kernel  scope link  src 10.220.41.109 
 10.220.61.0/24 dev vlan2261  proto kernel  scope link  src 10.220.61.109 
+default via 10.151.255.254 dev eth0  metric 100 
diff --git a/SubSystems/Online_Cobalt/validation/system/network/routes.cbt010 b/SubSystems/Online_Cobalt/validation/system/network/routes.cbt010
index 2ff0585df4b397e5b332f0db0e33581cac35c322..941d7c947dde6020f03e2154a9226ee4585c1f25 100644
--- a/SubSystems/Online_Cobalt/validation/system/network/routes.cbt010
+++ b/SubSystems/Online_Cobalt/validation/system/network/routes.cbt010
@@ -1,13 +1,14 @@
-default via 10.151.255.254 dev eth0  metric 100 
-10.134.224.0/19 dev ib1  proto kernel  scope link  src 10.134.246.20 
 10.134.224.0/19 dev ib0  proto kernel  scope link  src 10.134.246.19 
+10.134.224.0/19 dev ib1  proto kernel  scope link  src 10.134.246.20 
 10.144.0.0/13 dev eth0  proto kernel  scope link  src 10.149.128.10 
+10.168.0.0/13 dev eth2  proto kernel  scope link  src 10.168.105.1 
 10.168.0.0/13 dev eth3  proto kernel  scope link  src 10.168.105.2 
 10.168.0.0/13 dev eth4  proto kernel  scope link  src 10.168.105.3 
 10.168.0.0/13 dev eth5  proto kernel  scope link  src 10.168.105.4 
-10.168.0.0/13 dev eth2  proto kernel  scope link  src 10.168.105.1 
 10.175.1.0/24 dev eth2  scope link 
 10.175.2.0/24 dev eth3  scope link 
 10.175.3.0/24 dev eth4  scope link 
 10.175.4.0/24 dev eth5  scope link 
+10.220.81.0/24 dev vlan2281  proto kernel  scope link  src 10.220.81.110 
 192.168.122.0/24 dev virbr0  proto kernel  scope link  src 192.168.122.1 
+default via 10.151.255.254 dev eth0  metric 100 
diff --git a/SubSystems/Online_Cobalt/validation/validate b/SubSystems/Online_Cobalt/validation/validate
index 98a2ced25eed7416eb0376eed08c75e79ce184cb..42756cf710c5613839c308cc4501fa6008f4bc78 100755
--- a/SubSystems/Online_Cobalt/validation/validate
+++ b/SubSystems/Online_Cobalt/validation/validate
@@ -24,8 +24,8 @@ function runTest() {
   echo "        Time:  `date +"%F %T"`"
   echo "----------------------------------------------------------------"
 
-  if [ "${TEST%%.root.test}" == "${TEST}" ]; then
-    bash -v $TEST
+  if [ "${TEST%%.root.test}" == "${TEST}" -o `id -u` == 0 ]; then
+    ssh -tt localhost "cd $PWD && bash -v $TEST" # need an interactive shell for sudo inside the test scripts
     RESULT=$?
   else
     if [ $CAN_SUDO -eq 0 ]; then
diff --git a/SubSystems/PVSS_DB/CMakeLists.txt b/SubSystems/PVSS_DB/CMakeLists.txt
deleted file mode 100644
index 4bfccc2f5c43bec8a40aaae5662adac150f502fc..0000000000000000000000000000000000000000
--- a/SubSystems/PVSS_DB/CMakeLists.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-# $Id$
-
-lofar_package(PVSS_DB 
-  DEPENDS PVSS_Datapoints Navigator2)
-
diff --git a/SubSystems/RAServices/CMakeLists.txt b/SubSystems/RAServices/CMakeLists.txt
index 2010af21aef64a63becd466ef1a04f0cbbdbc90e..7c3995e9c214865902c9ff97b1d6c1ef51369d4d 100644
--- a/SubSystems/RAServices/CMakeLists.txt
+++ b/SubSystems/RAServices/CMakeLists.txt
@@ -18,6 +18,7 @@ lofar_package(RAServices
                         TriggerEmailService
                         TaskPrescheduler
                         DataManagement
+                        QPIDInfrastructure
                         RAScripts
                         StaticMetaData)
 
diff --git a/SubSystems/SAS_OTDB/CMakeLists.txt b/SubSystems/SAS_OTDB/CMakeLists.txt
index a28eb766c6f49932b466d44bfdc4e5c7feccae4b..4a7756ce69b62d257a03e30114319e55c0a48856 100644
--- a/SubSystems/SAS_OTDB/CMakeLists.txt
+++ b/SubSystems/SAS_OTDB/CMakeLists.txt
@@ -1,4 +1,4 @@
 # $Id$
 
 lofar_package(SAS_OTDB 
-  DEPENDS Deployment OTDB_Comps OTDB_SQL StaticMetaData PVSS_Datapoints)
+  DEPENDS Deployment OTDB_Comps OTDB_SQL StaticMetaData WinCC_Datapoints)
diff --git a/SubSystems/WinCC_DB/CMakeLists.txt b/SubSystems/WinCC_DB/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..1c0ede97be40b9318e428edbb136425105f5d01d
--- /dev/null
+++ b/SubSystems/WinCC_DB/CMakeLists.txt
@@ -0,0 +1,5 @@
+# $Id$
+
+lofar_package(WinCC_DB 
+  DEPENDS WinCC_Datapoints Navigator2)
+