第一颗恒星的V波段通量为39,984。它的V值等于10.1 - 2.5log(39,984 / 1,220,000)= 13,8(10.1和1,220,000来自参考星)。但我的计划计算的幅度为18.65。这是我的代码:
import numpy as np
import asciidata
fv = []
fb = []
data = asciidata.open('Flux.txt')
for i in data[1]:
fv.append(float(i))
for i in data[2]:
fb.append(float(i))
mv = []
mb = []
mbv = []
for i in range (0,25):
mv.append(10.1 - 2.5 * np.log(fv[i]/1220000))
mb.append(11.0 - 2.5 * np.log(fb[i]/339368))
print i+1, mv[i], mb[i]
答案 0 :(得分:3)
我假设您要使用numpy.log10
(日志基数10)而不是numpy.log
(基数为2)。
>>> import numpy as np
>>> 10.1 - 2.5*np.log(39984./1220000)
18.645316909086766
>>> 10.1 - 2.5*np.log10(39984./1220000)
13.811183979730934
答案 1 :(得分:1)
您需要使用正确的日志功能:
In [467]: 10.1 - 2.5 * np.log(39984/1220000)
Out[467]: 18.645316909086766
In [468]: 10.1 - 2.5 * np.log10(39984/1220000)
Out[468]: 13.811183979730934
注意:Python 3