From 4ed5967fd2d739b2b376859c979b0362ef81a126 Mon Sep 17 00:00:00 2001 From: ILBERT Olivier Date: Fri, 10 Jan 2025 12:17:35 +0100 Subject: [PATCH 1/2] Allow extrapolation of the templates also at higher redshift if the filter is redder than the reddest lambda limit of the template. --- src/lib/SED.cpp | 5 ++--- src/lib/mag.cpp | 4 ---- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/lib/SED.cpp b/src/lib/SED.cpp index d202eed..f3dbf3e 100644 --- a/src/lib/SED.cpp +++ b/src/lib/SED.cpp @@ -221,9 +221,8 @@ void SED::warning_integrateSED(const vector &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 " << filter.lmax(); diff --git a/src/lib/mag.cpp b/src/lib/mag.cpp index 7e5cc24..cb80333 100644 --- a/src/lib/mag.cpp +++ b/src/lib/mag.cpp @@ -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 seds = make_maglib(oneSED); // write the result in file @@ -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 seds = make_maglib(oneSED); // write the result in file From 7931430988e944d0f4cbff675389b2180eccd28e Mon Sep 17 00:00:00 2001 From: ILBERT Olivier Date: Fri, 10 Jan 2025 13:47:55 +0100 Subject: [PATCH 2/2] Small change in warning_integrateSED --- src/lib/SED.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/SED.cpp b/src/lib/SED.cpp index f3dbf3e..8e14daf 100644 --- a/src/lib/SED.cpp +++ b/src/lib/SED.cpp @@ -224,7 +224,7 @@ void SED::warning_integrateSED(const vector &filters, bool 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 << "."; @@ -236,7 +236,7 @@ void SED::warning_integrateSED(const vector &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); } } }