Skip to content
Snippets Groups Projects
Commit ea28078c authored by Andre Offringa's avatar Andre Offringa
Browse files

Fix crash when simulating multipol

parent 88f23b3e
No related branches found
No related tags found
No related merge requests found
......@@ -254,9 +254,8 @@ void TestSetGenerator::MakeBackground(BackgroundTestSet testSet,
bandwidth);
data = pair.first;
} else {
for (size_t i = 0; i != data.PolarizationCount(); ++i) {
aocommon::PolarizationEnum pol = data.GetPolarization(i);
TimeFrequencyData polData = data.MakeFromPolarizationIndex(i);
for (size_t polIndex = 0; polIndex != data.PolarizationCount(); ++polIndex) {
TimeFrequencyData polData = data.MakeFromPolarizationIndex(polIndex);
for (size_t imageIndex = 0; imageIndex != polData.ImageCount();
++imageIndex) {
const bool isImaginary = imageIndex == 1;
......@@ -315,18 +314,17 @@ void TestSetGenerator::MakeBackground(BackgroundTestSet testSet,
break;
}
polData.SetImage(imageIndex, image);
}
}
data.SetPolarizationData(pol, polData);
}
} // if is imaginary
} // for over image index
data.SetPolarizationData(polIndex, polData);
} // for over polarizations
}
}
void TestSetGenerator::MakeTestSet(RFITestSet testSet,
TimeFrequencyData& data) {
for (size_t i = 0; i != data.PolarizationCount(); ++i) {
aocommon::PolarizationEnum pol = data.GetPolarization(i);
TimeFrequencyData polData = data.MakeFromPolarizationIndex(i);
for (size_t polIndex = 0; polIndex != data.PolarizationCount(); ++polIndex) {
TimeFrequencyData polData = data.MakeFromPolarizationIndex(polIndex);
Mask2DPtr rfi(Mask2D::MakePtr(*polData.GetSingleMask()));
for (size_t imageIndex = 0; imageIndex != polData.ImageCount();
++imageIndex) {
......@@ -334,7 +332,7 @@ void TestSetGenerator::MakeTestSet(RFITestSet testSet,
Image2DPtr image = Image2D::MakePtr(*polData.GetImage(imageIndex));
const size_t width = image->Width();
const size_t height = image->Height();
if (pol == 2 && isImaginary && testSet == RFITestSet::PolarizedSpike) {
if (polIndex == 2 && isImaginary && testSet == RFITestSet::PolarizedSpike) {
// Set one absurdly high value which all strategies should detect
size_t rfiX = width / 2, rfiY = height / 2;
image->SetValue(rfiX, rfiY, 1000.0);
......@@ -391,7 +389,7 @@ void TestSetGenerator::MakeTestSet(RFITestSet testSet,
polData.SetImage(imageIndex, image);
}
polData.SetGlobalMask(rfi);
data.SetPolarizationData(pol, polData);
data.SetPolarizationData(polIndex, polData);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment