diff --git a/csst_ifs_gehong/spec1d.py b/csst_ifs_gehong/spec1d.py index 83f42985c5dcecb518a8af35b53575e1d7411fc7..dbcea4f3b10722212ab953a89a981628fb2228ab 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