Magnitude calculation in python
Question: i'm trying to calculate magnitudes of some stars based on their flux but I
keep getting the wrong values and I don't know why. For example:

The first star has a flux in the V-band of 39,984. Its V-magnitude is equal to
10.1 - 2.5log(39,984/1,220,000) = 13,8 (the 10.1 and 1,220,000 are from a
reference star). But my program calculates a magnitude of 18.65. Here's my
code:

    
    
    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]
    


Answer: I'm assuming you want to use `numpy.log10` (log base 10) instead of
`numpy.log` (base 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
    

