def bolcor(teff):
"""
The bolometric correction
Input
-----
teff : int
Effective temperature in K
Output
------
bcflow : float
The bolometric correction
"""
lteff = np.log10(teff)
if lteff < 3.7:
p = [-0.190537291496456e+05, 0.155144866764412e+05, -0.421278819301717e+04, 0.381476328422343e+03]
elif (3.7 <= lteff) and (lteff < 3.9):
p = [-0.370510203809015e+05, 0.385672629965804e+05, -0.150651486316025e+05, 0.261724637119416e+04, -0.170623810323864e+03]
else:
p = [-0.118115450538963e+06, 0.137145973583929e+06, -0.636233812100225e+05, 0.147412923562646e+05, -0.170587278406872e+04, 0.788731721804990e+02]
# The arrays are in form of:
# p[0] + p[1]*x + p[2]*x**2 + ...
# But np.poly1d expects it inversed
bcflow = np.poly1d(p[::-1])(lteff)
return bcflow
评论列表
文章目录