Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
Aoflagger
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Marcel Loose
Aoflagger
Commits
ea28078c
Commit
ea28078c
authored
3 years ago
by
Andre Offringa
Browse files
Options
Downloads
Patches
Plain Diff
Fix crash when simulating multipol
parent
88f23b3e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
algorithms/testsetgenerator.cpp
+10
-12
10 additions, 12 deletions
algorithms/testsetgenerator.cpp
with
10 additions
and
12 deletions
algorithms/testsetgenerator.cpp
+
10
−
12
View file @
ea28078c
...
...
@@ -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
(
pol
Index
,
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
(
pol
Index
==
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
(
pol
Index
,
polData
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment