diff --git a/.gitattributes b/.gitattributes index ae0674f517054b7b7419e6892db34767d39afece..130b536db4561dd057e68ffa49e3be942b5598c9 100644 --- a/.gitattributes +++ b/.gitattributes @@ -221,6 +221,7 @@ CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/foreachpolarisationframe. CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/fringestoppingframe.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 @@ -296,6 +297,7 @@ 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/plotaction.h -text CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/quickcalibrateaction.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 @@ -325,6 +327,7 @@ 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/rfiplots.h -text @@ -362,6 +365,7 @@ CEP/DP3/AOFlagger/include/AOFlagger/strategy/imagesets/spatialmsimageset.h -text CEP/DP3/AOFlagger/include/AOFlagger/strategy/imagesets/timefrequencystatimageset.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/noisestatisticscollectortest.h -text CEP/DP3/AOFlagger/include/AOFlagger/test/strategy/algorithms/noisestatisticstest.h -text CEP/DP3/AOFlagger/include/AOFlagger/test/strategy/algorithms/statisticalflaggertest.h -text CEP/DP3/AOFlagger/include/AOFlagger/test/testingtools/asserter.h -text diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/resamplingframe.h b/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/resamplingframe.h new file mode 100644 index 0000000000000000000000000000000000000000..527530ac0bec1e43b42ae51297b43847634eabb1 --- /dev/null +++ b/CEP/DP3/AOFlagger/include/AOFlagger/gui/strategyframes/resamplingframe.h @@ -0,0 +1,81 @@ +/*************************************************************************** + * Copyright (C) 2008 by A.R. Offringa * + * offringa@astro.rug.nl * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * 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), + _sizeXLabel("Size x:"), + _sizeYLabel("Size y"), + _sizeXScale(1, 1024, 1), + _sizeYScale(1, 1024, 1), + _applyButton(Gtk::Stock::APPLY) + { + _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::Label _sizeXLabel, _sizeYLabel; + Gtk::HScale _sizeXScale, _sizeYScale; + Gtk::Button _applyButton; + + void onApplyClicked() + { + _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/strategy/actions/action.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/action.h index a30ad8e44cbc4e73b4c7e396274200cebaeae2a7..9adcf1b1fef8020066b26c296607cbee4bd924fd 100644 --- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/action.h +++ b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/action.h @@ -51,6 +51,7 @@ namespace rfiStrategy { IterationBlockType, PlotActionType, QuickCalibrateActionType, + ResamplingActionType, SetFlaggingActionType, SetImageActionType, SlidingWindowFitActionType, diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/collectnoisestatisticsaction.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/collectnoisestatisticsaction.h index 930fe6e48ef7ee91c425d8cd81284a5327d705c8..d79bd1e2bdb6412eb99fd3dcde76cf8d1e456dd1 100644 --- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/collectnoisestatisticsaction.h +++ b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/collectnoisestatisticsaction.h @@ -29,7 +29,7 @@ #include <AOFlagger/util/progresslistener.h> -#include <AOFlagger/strategy/algorithms/noisestatistics.h> +#include <AOFlagger/strategy/algorithms/noisestatisticscollector.h> namespace rfiStrategy { diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/resamplingaction.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/resamplingaction.h new file mode 100644 index 0000000000000000000000000000000000000000..ea71a3c01b80f30c600a872ff8e392a09fbae489 --- /dev/null +++ b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/resamplingaction.h @@ -0,0 +1,103 @@ +/*************************************************************************** + * Copyright (C) 2008 by A.R. Offringa * + * offringa@astro.rug.nl * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * 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 }; + + ResamplingAction() : Action(), _operation(Average), _sizeX(4), _sizeY(4) + { + } + virtual std::string Description() + { + switch(_operation) + { + case Average: + return "Resample by averaging"; + 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; + 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()); + for(unsigned y=0;y<input->Height();++y) + { + unsigned destY = (y/_sizeY)*_sizeY; + for(unsigned x=0;x<input->Width();++x) + { + unsigned destX = (x/_sizeX)*_sizeX; + output->SetValue(destX, destY, output->Value(destX, destY) + input->Value(destX, destY)); + } + } + return output; + } + }; + +} // namespace + +#endif // RFI_TIME_CONVOLUTION_ACTION diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/timeconvolutionaction.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/timeconvolutionaction.h index 14637725ed1c84fed91d6c91ec5112a7d4bda475..0bc6d65cbcbe60bb1f16c527ff7f18efe998c41c 100644 --- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/timeconvolutionaction.h +++ b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/actions/timeconvolutionaction.h @@ -222,7 +222,9 @@ private: { const num_t sincScale = ActualSincScaleInSamples(artifacts, band.channels[y].frequencyHz); if(y == image->Height()/2) - AOLogger::Debug << "Horizontal sinc scale: " << sincScale << '\n'; + { + AOLogger::Debug << "Horizontal sinc scale: " << sincScale << " (filter scale: " << ActualSincScaleAsRaDecDist() * ((180.0/M_PI)*(60*60)) << " arcsec)\n"; + } if(sincScale > 1.0) { for(unsigned x=0;x<width;++x) { diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/noisestatistics.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/noisestatistics.h index 973a02a67154769f79da22855a6eae94fd188078..032fcecc20c3d6b63fedb354065deac7b4538f82 100644 --- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/noisestatistics.h +++ b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/noisestatistics.h @@ -20,18 +20,10 @@ #ifndef NOISESTATISTICS_H #define NOISESTATISTICS_H -#include <cstring> -#include <map> -#include <set> -#include <complex> -#include <fstream> -#include <iomanip> +#include <string> +#include <iostream> +#include <vector> -#include <AOFlagger/msio/image2d.h> -#include <AOFlagger/msio/timefrequencymetadata.h> -#include <AOFlagger/msio/mask2d.h> - -struct stat; class NoiseStatistics { public: @@ -243,338 +235,4 @@ class CNoiseStatistics NoiseStatistics imaginary; }; -/** - @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); - - const TBIndex tbIndex = TBIndex(centralTime, std::pair<unsigned, unsigned>(metaData->Antenna1().id, metaData->Antenna2().id)); - 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::CreateEmptyImagePtr(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/noisestatisticscollector.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/noisestatisticscollector.h new file mode 100644 index 0000000000000000000000000000000000000000..9d2fa34faf67e6478e61a7d3adc1035ce0fec40c --- /dev/null +++ b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/algorithms/noisestatisticscollector.h @@ -0,0 +1,370 @@ +/*************************************************************************** + * Copyright (C) 2008 by A.R. Offringa * + * offringa@astro.rug.nl * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * 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/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); + + const TBIndex tbIndex = TBIndex(centralTime, std::pair<unsigned, unsigned>(metaData->Antenna1().id, metaData->Antenna2().id)); + 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::CreateEmptyImagePtr(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/imagesets/noisestatimageset.h b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/imagesets/noisestatimageset.h index 4e56699311dc5bc3bb78d43a62567e8e3a4e4177..37005c7376533589c9513ad900608b4c5c045d9f 100644 --- a/CEP/DP3/AOFlagger/include/AOFlagger/strategy/imagesets/noisestatimageset.h +++ b/CEP/DP3/AOFlagger/include/AOFlagger/strategy/imagesets/noisestatimageset.h @@ -30,6 +30,7 @@ #include <AOFlagger/msio/types.h> #include <AOFlagger/strategy/algorithms/noisestatistics.h> +#include <AOFlagger/strategy/algorithms/noisestatisticscollector.h> #include <AOFlagger/strategy/imagesets/singleimageset.h> diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/test/strategy/algorithms/algorithmstestgroup.h b/CEP/DP3/AOFlagger/include/AOFlagger/test/strategy/algorithms/algorithmstestgroup.h index a7036ed8f1077e4771646947cc079dea7b181825..171ab0d880dd9f1c3af634b2f37880c8d5b0ce3f 100644 --- a/CEP/DP3/AOFlagger/include/AOFlagger/test/strategy/algorithms/algorithmstestgroup.h +++ b/CEP/DP3/AOFlagger/include/AOFlagger/test/strategy/algorithms/algorithmstestgroup.h @@ -24,6 +24,7 @@ #include <AOFlagger/test/strategy/algorithms/convolutionstest.h> #include <AOFlagger/test/strategy/algorithms/noisestatisticstest.h> +#include <AOFlagger/test/strategy/algorithms/noisestatisticscollectortest.h> #include <AOFlagger/test/strategy/algorithms/statisticalflaggertest.h> class AlgorithmsTestGroup : public TestGroup { @@ -34,6 +35,7 @@ class AlgorithmsTestGroup : public TestGroup { { Add(new ConvolutionsTest()); Add(new NoiseStatisticsTest()); + Add(new NoiseStatisticsCollectorTest()); Add(new StatisticalFlaggerTest()); } }; diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/test/strategy/algorithms/noisestatisticscollectortest.h b/CEP/DP3/AOFlagger/include/AOFlagger/test/strategy/algorithms/noisestatisticscollectortest.h new file mode 100644 index 0000000000000000000000000000000000000000..5a9a413210e863e9538eb4c17cceceae570ea7fa --- /dev/null +++ b/CEP/DP3/AOFlagger/include/AOFlagger/test/strategy/algorithms/noisestatisticscollectortest.h @@ -0,0 +1,53 @@ +/*************************************************************************** + * Copyright (C) 2008 by A.R. Offringa * + * offringa@astro.rug.nl * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * 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/testingtools/equalsasserter.h b/CEP/DP3/AOFlagger/include/AOFlagger/test/testingtools/equalsasserter.h index fe74ea4d52e16d5738a206243cf3071564da1749..36bdd6ac27bd430d695011d3bd10cf5a2c988522 100644 --- a/CEP/DP3/AOFlagger/include/AOFlagger/test/testingtools/equalsasserter.h +++ b/CEP/DP3/AOFlagger/include/AOFlagger/test/testingtools/equalsasserter.h @@ -187,6 +187,18 @@ class EqualsAsserter { void AssertAlmostEqual(long double actual, double expected, const std::string &description) const { AssertAlmostEqual((double) actual, (double) expected, description); } + + void AssertTrue(bool actual) const + { AssertEquals(actual, true); } + + void AssertTrue(bool actual, const std::string &description) const + { AssertEquals(actual, true, description); } + + void AssertFalse(bool actual) const + { AssertEquals(actual, false); } + + void AssertFalse(bool actual, const std::string &description) const + { AssertEquals(actual, false, description); } private: template <typename T> void throwComparisonError(T actual, T expected, const std::type_info &type) const diff --git a/CEP/DP3/AOFlagger/src/gui/editstrategywindow.cpp b/CEP/DP3/AOFlagger/src/gui/editstrategywindow.cpp index c9a528a428d290a53758fd31b4b1ad98d340b3c9..57011a3963dc6e66c9199cf618ac3d55bfc5280e 100644 --- a/CEP/DP3/AOFlagger/src/gui/editstrategywindow.cpp +++ b/CEP/DP3/AOFlagger/src/gui/editstrategywindow.cpp @@ -41,6 +41,7 @@ #include <AOFlagger/gui/strategyframes/fringestoppingframe.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> @@ -302,6 +303,9 @@ void EditStrategyWindow::onSelectionChanged() 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; diff --git a/CEP/DP3/AOFlagger/src/gui/imageplanewindow.cpp b/CEP/DP3/AOFlagger/src/gui/imageplanewindow.cpp index 179fc85b0e02ecb9cc84d03d990bfbc18c219365..46360cdff49e1f7f66bc8789bffa12bb0c7ee08a 100644 --- a/CEP/DP3/AOFlagger/src/gui/imageplanewindow.cpp +++ b/CEP/DP3/AOFlagger/src/gui/imageplanewindow.cpp @@ -427,10 +427,14 @@ bool ImagePlaneWindow::onButtonReleased(GdkEventButton *event) delayRa = _lastMetaData->Field().delayDirectionRA, delayDec = _lastMetaData->Field().delayDirectionDec; std::cout << "Clicked at: " << xRel << "," << yRel << '\n'; + double + distanceRad = _imager.ImageDistanceToDecRaDistance(dist), + distanceArcSec = distanceRad * ((180.0 / M_PI) * 60.0 * 60.0); std::cout << "RMS=" << rms << ", max=" << max << ", angle=" << (SinusFitter::Phase(xRel, -yRel)*180.0/M_PI) << ", dist=" << dist << "\n" << "Distance ~ " - << _imager.ImageDistanceToDecRaDistance(dist) << " rad = " + << distanceRad << " rad = " + << distanceArcSec << " arcsec = " << (1.0/_imager.ImageDistanceToFringeSpeedInSamples(dist, frequencyHz, _lastMetaData)) << " samples/fringe.\n"; numl_t centerX = cosn(delayRa) * delayDec, diff --git a/CEP/DP3/AOFlagger/src/rfistatcollect.cpp b/CEP/DP3/AOFlagger/src/rfistatcollect.cpp index 630008c0a383b91b1cc0737242d65f8098268908..70d8d9dc74bb9506a5126bcf62a903f3c6845366 100644 --- a/CEP/DP3/AOFlagger/src/rfistatcollect.cpp +++ b/CEP/DP3/AOFlagger/src/rfistatcollect.cpp @@ -29,6 +29,7 @@ #include <AOFlagger/strategy/algorithms/rfistatistics.h> #include <AOFlagger/strategy/algorithms/noisestatistics.h> +#include <AOFlagger/strategy/algorithms/noisestatisticscollector.h> #include <AOFlagger/util/rng.h> diff --git a/CEP/DP3/AOFlagger/src/strategy/control/actionfactory.cpp b/CEP/DP3/AOFlagger/src/strategy/control/actionfactory.cpp index 455fdd6501023c0568353fe6803e11e82bd79e89..58a7761e3baec9ee4666cd47605933b95427f614 100644 --- a/CEP/DP3/AOFlagger/src/strategy/control/actionfactory.cpp +++ b/CEP/DP3/AOFlagger/src/strategy/control/actionfactory.cpp @@ -41,6 +41,7 @@ #include <AOFlagger/strategy/actions/iterationaction.h> #include <AOFlagger/strategy/actions/plotaction.h> #include <AOFlagger/strategy/actions/quickcalibrateaction.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> @@ -80,6 +81,7 @@ const std::vector<std::string> ActionFactory::GetActionList() list.push_back("Phase adapter"); list.push_back("Plot"); list.push_back("Quickly calibrate"); + list.push_back("Resample"); list.push_back("Set flagging"); list.push_back("Set image"); list.push_back("Singular value decomposition"); @@ -139,6 +141,8 @@ Action *ActionFactory::CreateAction(const std::string &action) return new PlotAction(); else if(action == "Quickly calibrate") return new QuickCalibrateAction(); + else if(action == "Resample") + return new ResamplingAction(); else if(action == "Set flagging") return new SetFlaggingAction(); else if(action == "Set image")