Skip to content

Commit 615a6c1

Browse files
committed
Added warning when zphot falls out of confidence interval
1 parent d8b52ba commit 615a6c1

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/fast++-fitter.cpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,17 @@ fitter_t::fitter_t(const options_t& opt, const input_state_t& inp, const gridder
6969
idzu.safe[is] = idz.safe[is];
7070
} else if (is_finite(input.zphot.safe(is,ilow)) && is_finite(input.zphot.safe(is,iup))) {
7171
// Get range from zlow and zup
72-
idzl.safe[is] = min_id(abs(output_z - input.zphot.safe(is,ilow)));
73-
idzu.safe[is] = min_id(abs(output_z - input.zphot.safe(is,iup)));
72+
idzl.safe[is] = min_id(abs(output.z - input.zphot.safe(is,ilow)));
73+
idzu.safe[is] = min_id(abs(output.z - input.zphot.safe(is,iup)));
74+
75+
// Check that zphot falls inside confidence interval
76+
if (opts.best_at_zphot && idzp.safe[is] != npos &&
77+
(idzp.safe[is] < idzl.safe[is] || idzp.safe[is] > idzu.safe[is])) {
78+
warning("for galaxy ", input.id.safe[is], " the photo-z (",
79+
input.zphot.safe(is,0), ") falls outside of the chosen confidence "
80+
"interval (", input.zphot.safe(is,ilow), " to ", input.zphot.safe(is,iup),
81+
")");
82+
}
7483
}
7584
}
7685
}

0 commit comments

Comments
 (0)