Skip to content

Commit 5499068

Browse files
authored
Merge pull request #586 from astrorama/fix/no_detect_aperture
Allow AperturePhotometry without a detection image
2 parents 847f752 + 7099652 commit 5499068

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

SEImplementation/src/lib/Plugin/AperturePhotometry/AperturePhotometryTask.cpp

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,17 @@ void AperturePhotometryTask::computeProperties(SourceInterface &source) const {
9797
additional_flags |= Flags::SATURATED * source.getProperty<SaturateFlag>(m_instance).getSaturateFlag();
9898
additional_flags |= Flags::BLENDED * source.getProperty<BlendedFlag>().getBlendedFlag();
9999

100-
auto aperture_flags = source.getProperty<ApertureFlag>().getFlags();
101-
for (size_t i = 0; i < m_apertures.size(); ++i) {
102-
auto det_flag = aperture_flags.at(m_apertures[i]);
103-
flags[i] |= additional_flags | det_flag;
100+
try {
101+
auto aperture_flags = source.getProperty<ApertureFlag>().getFlags();
102+
for (size_t i = 0; i < m_apertures.size(); ++i) {
103+
auto det_flag = aperture_flags.at(m_apertures[i]);
104+
flags[i] |= additional_flags | det_flag;
105+
}
106+
} catch (PropertyNotFoundException& e) {
107+
// In no detection image mode we can't get flags from the detection image
108+
for (size_t i = 0; i < m_apertures.size(); ++i) {
109+
flags[i] |= additional_flags;
110+
}
104111
}
105112

106113
// set the source properties

0 commit comments

Comments
 (0)