Esempio n. 1
0
def getrMagBinary(L1, T1, g1, r1, L2, T2, g2, r2, M_H, dist, AV, extVal):

    SED1 = SED()
    SED1.filters = ['r_']
    SED1.filterFilesRoot = filterFilesRoot
    SED1.T = T1 * units.K
    SED1.R = r1 * units.solRad
    SED1.L = L1 * units.solLum
    SED1.logg = g1
    SED1.M_H = M_H
    SED1.EBV = AV / RV  #could use this to account for reddening in SED
    SED1.initialize()

    SED2 = SED()
    SED2.filters = ['r_']
    SED2.filterFilesRoot = filterFilesRoot
    SED2.T = T2 * units.K
    SED2.R = r2 * units.solRad
    SED2.L = L2 * units.solLum
    SED2.logg = g2
    SED2.M_H = M_H
    SED2.EBV = AV / RV  #could use this to account for reddening in SED
    SED2.initialize()

    Lconst1 = SED1.getLconst()
    Lconst2 = SED2.getLconst()

    Ared = extVal * AV

    Fv1 = SED1.getFvAB(dist * units.kpc, 'r_', Lconst=Lconst1)
    Fv2 = SED2.getFvAB(dist * units.kpc, 'r_', Lconst=Lconst2)
    Fv = Fv1 + Fv2
    return -2.5 * np.log10(Fv) + Ared  #AB magnitude
Esempio n. 2
0
def getrMagSingle(L1, T1, g1, r1, M_H, dist, AV, extVal):

    SED1 = SED()
    SED1.filters = ['r_']
    SED1.filterFilesRoot = filterFilesRoot
    SED1.T = T1 * units.K
    SED1.R = r1 * units.solRad
    SED1.L = L1 * units.solLum
    SED1.logg = g1
    SED1.M_H = M_H
    SED1.EBV = AV / RV  #could use this to account for reddening in SED
    SED1.initialize()

    Lconst1 = SED1.getLconst()

    Ared = extVal * AV
    Fv = SED1.getFvAB(dist * units.kpc, 'r_', Lconst=Lconst1)

    return -2.5 * np.log10(Fv) + Ared  #AB magnitude