Skip to content

Commit

Permalink
Merge pull request #267 from lephare-photoz/266-fix-bug-which-was-not…
Browse files Browse the repository at this point in the history
…-allowing-extrapolation-of-sed-and-breaking-magnitudes-at-long-wavelengths

Allow extrapolation of the templates also at higher redshift if the f…
  • Loading branch information
olivierilbert authored Jan 10, 2025
2 parents 4867074 + 7931430 commit 8ae9a4b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
9 changes: 4 additions & 5 deletions src/lib/SED.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,11 +221,10 @@ void SED::warning_integrateSED(const vector<flt> &filters, bool verbose) {
lamb_flux.emplace(lamb_flux.begin(), 0, 0, 1);
}

if ((((lamb_flux.end() - 1)->lamb) * (1. + red) < filter.lmax()) &&
(red == 0)) {
if (verbose) {
if (((lamb_flux.end() - 1)->lamb) * (1. + red) < filter.lmax()) {
if (verbose && (red == 0)) {
cout << "A problem could occur since maximum of SED "
<< (lamb_flux.end() - 1)->lamb << " below max of the filter "
<< lamb_flux.back().lamb << " below max of the filter "
<< filter.lmax();
cout << " with filters redder than " << filter.name << " and SED "
<< name << " and z " << red << ".";
Expand All @@ -237,7 +236,7 @@ void SED::warning_integrateSED(const vector<flt> &filters, bool verbose) {
// SED in the red part This is a linear extrapolation from the last point
// defined in the SED. The extrapolation should be done in the template
// itself, with a physical meaning. Need to avoid such situation.
lamb_flux.emplace_back(1.e8, 0, 1);
lamb_flux.emplace_back(1.e8 * (1. + red), 0, 1);
}
}
}
Expand Down
4 changes: 0 additions & 4 deletions src/lib/mag.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -463,8 +463,6 @@ void GalMag::read_SED() {
GalSED oneSED("");
// read one SED in the binary file
oneSED.readSEDBin(ssedIn);
//// Check that the lambda coverage is correct
// oneSED.warning_integrateSED(allFlt, verbose);
// build the library of SEDs that modify the initial template SED
vector<GalSED> seds = make_maglib(oneSED);
// write the result in file
Expand Down Expand Up @@ -748,8 +746,6 @@ void QSOMag::read_SED() {
QSOSED oneSED("");
oneSED.clean();
oneSED.readSEDBin(ssedIn);
//// Check that the lambda coverage is correct
// oneSED.warning_integrateSED(allFlt, verbose);
// build the library of SEDs that modify the initial template SED
vector<QSOSED> seds = make_maglib(oneSED);
// write the result in file
Expand Down

0 comments on commit 8ae9a4b

Please sign in to comment.