diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/rfi/strategy/action.h b/CEP/DP3/AOFlagger/include/AOFlagger/rfi/strategy/action.h index 08b0c1d3fc16389e23fa575009041c0f2213b49e..1f2bc547ccae35d2cd210eac9c6e3157748c8df8 100644 --- a/CEP/DP3/AOFlagger/include/AOFlagger/rfi/strategy/action.h +++ b/CEP/DP3/AOFlagger/include/AOFlagger/rfi/strategy/action.h @@ -35,6 +35,7 @@ namespace rfiStrategy { CombineFlagResultsType, CutAreaActionType, ForEachBaselineActionType, + ForEachComplexComponentActionType, ForEachMSActionType, ForEachPolarisationBlockType, FrequencySelectionActionType, @@ -51,6 +52,7 @@ namespace rfiStrategy { StrategyType, SVDActionType, ThresholdActionType, + TimeConvolutionActionType, TimeSelectionActionType, WriteFlagsActionType }; diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/rfi/strategy/foreachcomplexcomponentaction.h b/CEP/DP3/AOFlagger/include/AOFlagger/rfi/strategy/foreachcomplexcomponentaction.h index 7b98905c25a8d09ef62171aae2568ac975c8c2f9..27e7793fdae4d14e5f0759558472b112a937e4b1 100644 --- a/CEP/DP3/AOFlagger/include/AOFlagger/rfi/strategy/foreachcomplexcomponentaction.h +++ b/CEP/DP3/AOFlagger/include/AOFlagger/rfi/strategy/foreachcomplexcomponentaction.h @@ -23,6 +23,8 @@ #include "artifactset.h" #include "actionblock.h" +#include <AOFlagger/rfi/strategy/action.h> + namespace rfiStrategy { class ForEachComplexComponentAction : public ActionBlock @@ -35,7 +37,7 @@ namespace rfiStrategy { { return "For each complex component"; } - virtual ActionType Type() const { return AdapterType; } + virtual ActionType Type() const { return ForEachComplexComponentActionType; } virtual void Perform(ArtifactSet &artifacts, class ProgressListener &listener) { size_t taskCount = 0; diff --git a/CEP/DP3/AOFlagger/include/AOFlagger/rfi/strategy/timeconvolutionaction.h b/CEP/DP3/AOFlagger/include/AOFlagger/rfi/strategy/timeconvolutionaction.h index 4190894a3830e6ebed6a2d9c3b6a2ee542b08564..214457a8efd256a265f9f3e7c5e20117020a2cf7 100644 --- a/CEP/DP3/AOFlagger/include/AOFlagger/rfi/strategy/timeconvolutionaction.h +++ b/CEP/DP3/AOFlagger/include/AOFlagger/rfi/strategy/timeconvolutionaction.h @@ -23,6 +23,8 @@ #include "artifactset.h" #include "actionblock.h" +#include <AOFlagger/rfi/strategy/action.h> + #include <AOFlagger/rfi/thresholdtools.h> namespace rfiStrategy { @@ -37,20 +39,31 @@ namespace rfiStrategy { { return "Time convolution"; } - virtual ActionType Type() const { return AdapterType; } + virtual ActionType Type() const { return TimeConvolutionActionType; } virtual void Perform(ArtifactSet &artifacts, class ProgressListener &) { TimeFrequencyData data = artifacts.ContaminatedData(); Image2DCPtr image = data.GetSingleImage(); - num_t *row = new num_t[image->Width()]; + num_t *row = new num_t[image->Width()*3]; Image2DPtr newImage = Image2D::CreateEmptyImagePtr(image->Width(), image->Height()); + unsigned width = image->Width(); + num_t sign; + if(data.PhaseRepresentation() == TimeFrequencyData::RealPart) + sign = 1.0; + else if(data.PhaseRepresentation() == TimeFrequencyData::ImaginaryPart) + sign = -1.0; + else + throw BadUsageException("Data is not real or imaginary"); for(unsigned y=0;y<image->Height();++y) { - for(unsigned x=0;x<image->Width();++x) - row[x] = image->Value(x, y); - ThresholdTools::OneDimensionalSincConvolution(row, image->Width(), _sincSize); - for(unsigned x=0;x<image->Width();++x) - newImage->SetValue(x, y, row[x]); + 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); + } + ThresholdTools::OneDimensionalSincConvolution(row, width*3, _sincSize); + for(unsigned x=0;x<width;++x) + newImage->SetValue(x, y, row[x+width]); } delete[] row; diff --git a/CEP/DP3/AOFlagger/src/gui/mswindow.cpp b/CEP/DP3/AOFlagger/src/gui/mswindow.cpp index 9a32ffd69e0d41e8adf42c0a42240fa1b5d599c2..f9be35000005d0774dfbe46c094fa703b9910069 100644 --- a/CEP/DP3/AOFlagger/src/gui/mswindow.cpp +++ b/CEP/DP3/AOFlagger/src/gui/mswindow.cpp @@ -1382,7 +1382,7 @@ void MSWindow::onSimulateCorrelation() void MSWindow::onSimulateDoubledBaselineCorrelation() { Model model; - model.loadUrsaMajor(); + //model.loadUrsaMajor(); model.loadUrsaMajorDistortingSource(); WSRTObservatorium wsrtObservatorium(0,5);