From c472649ff2bb046f5ee24f688b7312f442b4a5dc Mon Sep 17 00:00:00 2001 From: Shuai Feng <451424498@qq.com> Date: Fri, 11 Oct 2024 18:01:00 +0800 Subject: [PATCH] add justification of input pars range --- csst_ifs_gehong/spec1d.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/csst_ifs_gehong/spec1d.py b/csst_ifs_gehong/spec1d.py index 83f4298..dbcea4f 100644 --- a/csst_ifs_gehong/spec1d.py +++ b/csst_ifs_gehong/spec1d.py @@ -1120,10 +1120,15 @@ class SingleStar(): print("Notice: Your input magnitude (mag) is > 26 mag or < 8 mag.") if (teff < 2820) or (teff > 20129): print("Notice: Your input effective tempreture (teff) is beyond the range of stellar template [2820, 20129], which will be automatically adjusted to the upper/lower limit.") - if (feh > 0.81) or (feh < -2.69): + if (teff < 2820): + teff = 2820 + if (teff > 20129): + teff = 20129 + if (feh > 0.81): print("Notice: Your input metallicity (feh) is beyond the range of stellar template [-2.69, 0.81], which will be automatically adjusted to the upper limit.") - #if (feh < -2.69): - # raise Exception('Your input metallicity (feh) is beyond the range of stellar template [-2.69, 0.81]') + feh = 0.81 + if (feh < -2.69): + raise Exception('Your input metallicity (feh) is beyond the range of stellar template [-2.69, 0.81]') StarTemp = template.templates -- GitLab