Example #1
0
def spec_disk2(f1, f2, m, mdot, rmin, rmax):
    tref = tdisk(m, mdot, rmin)
    nfreq = 10
    f1a = 10**float(int(np.log10(f1)))
    f2a = 10**float(int(np.log10(f2)) + 1)
    nrange = int(np.log10((f2a / f1a)))
    freq = []
    dfreq = []
    ftemp = f1a
    df = f1a / nfreq
    for i in range(nrange):
        for j in range(nfreq * 9):
            ftemp = ftemp + df
            if ftemp > f2:
                break
            if ftemp >= f1:
                freq.append(ftemp)
        df = df * 10.0

    #print freq[0],freq[len(freq)-1]

    spec = np.zeros(len(freq))
    rtemp = np.logspace(np.log10(rmin), np.log10(rmax), num=100)
    rdisk = []
    for j in range(len(rtemp) - 1):
        rdisk.append((rtemp[j] + rtemp[j + 1]) / 2.0)
        r = rdisk[j] / rmin
        area = PI * (rtemp[j + 1] * rtemp[j + 1] - rtemp[j] * rtemp[j])
        t = (disk.teff(tref, r))
        for i in range(len(freq) - 1):
            spec[i] = spec[i] + (ah.planck_nu(t, freq[i]) * area * PI * 2)
    return (freq, spec)
Example #2
0
def spec_disk2(f1, f2, m, mdot, rmin, rmax):
    tref = tdisk(m, mdot, rmin)
    nfreq = 10
    f1a = 10 ** float(int(np.log10(f1)))
    f2a = 10 ** float(int(np.log10(f2)) + 1)
    nrange = int(np.log10((f2a / f1a)))
    freq = []
    dfreq = []
    ftemp = f1a
    df = f1a / nfreq
    for i in range(nrange):
        for j in range(nfreq * 9):
            ftemp = ftemp + df
            if ftemp > f2:
                break
            if ftemp >= f1:
                freq.append(ftemp)
        df = df * 10.0

        # print freq[0],freq[len(freq)-1]

    spec = np.zeros(len(freq))
    rtemp = np.logspace(np.log10(rmin), np.log10(rmax), num=100)
    rdisk = []
    for j in range(len(rtemp) - 1):
        rdisk.append((rtemp[j] + rtemp[j + 1]) / 2.0)
        r = rdisk[j] / rmin
        area = PI * (rtemp[j + 1] * rtemp[j + 1] - rtemp[j] * rtemp[j])
        t = disk.teff(tref, r)
        for i in range(len(freq) - 1):
            spec[i] = spec[i] + (ah.planck_nu(t, freq[i]) * area * PI * 2)
    return (freq, spec)
Example #3
0
def lnu_disk(f, m, mdot, rmin, rmax):
    tref = tdisk(m, mdot, rmin)
    rtemp = np.logspace(np.log10(rmin), np.log10(rmax), num=100)
    rdisk = []
    lnu = 0.0
    for j in range(len(rtemp) - 1):
        rdisk.append((rtemp[j] + rtemp[j + 1]) / 2.0)
        r = rdisk[j] / rmin
        area = PI * (rtemp[j + 1] * rtemp[j + 1] - rtemp[j] * rtemp[j])
        t = (disk.teff(tref, r))
        lnu = lnu + (ah.planck_nu(t, f) * area * PI * 2.0)
    return (lnu)
Example #4
0
def lnu_disk(f, m, mdot, rmin, rmax):
    tref = tdisk(m, mdot, rmin)
    rtemp = np.logspace(np.log10(rmin), np.log10(rmax), num=100)
    rdisk = []
    lnu = 0.0
    for j in range(len(rtemp) - 1):
        rdisk.append((rtemp[j] + rtemp[j + 1]) / 2.0)
        r = rdisk[j] / rmin
        area = PI * (rtemp[j + 1] * rtemp[j + 1] - rtemp[j] * rtemp[j])
        t = disk.teff(tref, r)
        lnu = lnu + (ah.planck_nu(t, f) * area * PI * 2.0)
    return lnu
Example #5
0
def spec_disk(f1, f2, m, mdot, rmin, rmax):
    tref = tdisk(m, mdot, rmin)
    nfreq = (f2 / f1) * 100
    freq = np.linspace(f1, f2, nfreq)
    spec = np.empty(nfreq)
    dfreq = freq[1] - freq[0]
    rtemp = np.logspace(np.log10(rmin), np.log10(rmax), num=100)
    rdisk = []
    for j in range(len(rtemp) - 1):
        rdisk.append((rtemp[j] + rtemp[j + 1]) / 2.0)
        r = rdisk[j] / rmin
        area = PI * (rtemp[j + 1] * rtemp[j + 1] - rtemp[j] * rtemp[j])
        t = (disk.teff(tref, r))
        for i in range(len(freq)):
            spec[i] = spec[i] + (ah.planck_nu(t, freq[i]) * area * PI * 2)
    return (freq, spec)
Example #6
0
def spec_disk(f1, f2, m, mdot, rmin, rmax):
    tref = tdisk(m, mdot, rmin)
    nfreq = (f2 / f1) * 100
    freq = np.linspace(f1, f2, nfreq)
    spec = np.empty(nfreq)
    dfreq = freq[1] - freq[0]
    rtemp = np.logspace(np.log10(rmin), np.log10(rmax), num=100)
    rdisk = []
    for j in range(len(rtemp) - 1):
        rdisk.append((rtemp[j] + rtemp[j + 1]) / 2.0)
        r = rdisk[j] / rmin
        area = PI * (rtemp[j + 1] * rtemp[j + 1] - rtemp[j] * rtemp[j])
        t = disk.teff(tref, r)
        for i in range(len(freq)):
            spec[i] = spec[i] + (ah.planck_nu(t, freq[i]) * area * PI * 2)
    return (freq, spec)
Example #7
0
for j in range(len(rtemp) - 1):
    rdisk.append((rtemp[j] + rtemp[j + 1]) / 2.0)
    r = rdisk[j] / geo.rstar
    area = PI * (rtemp[j + 1] * rtemp[j + 1] - rtemp[j] * rtemp[j])
    t = disk.teff(tref, r)
    tdisk.append(t)
    fmax.append(t * WIEN)
    temp_ioniz = 0.0
    temp_uv = 0.0
    temp_nioniz = 0.0
    tempc4 = 0.0
    i = 0
    bnu = 1e-98
    while bnu > 1e-99:
        freq = 1e15 + i * df
        bnu = ah.planck_nu(t, freq)
        if freq > fev:
            temp_ioniz = temp_ioniz + bnu
            temp_nioniz = temp_nioniz + (bnu / (H * freq))
        if freq > f1 and freq < f2:
            temp_uv = temp_uv + bnu
        i = i + 1
    L_2500 = L_2500 + 2 * PI * ah.planck_nu(t, f2500) * area
    temp_ioniz = PI * temp_ioniz * df * area * 2
    temp_uv = PI * temp_uv * df * area * 2
    temp_nioniz = PI * temp_nioniz * df * area * 2
    tot_ioniz = tot_ioniz + temp_ioniz
    tot_nioniz = tot_nioniz + temp_nioniz
    if j > 0:
        cum_ioniz.append(cum_ioniz[j - 1] + temp_ioniz)
    else:
Example #8
0
for j in range(len(rtemp) - 1):
    rdisk.append((rtemp[j] + rtemp[j + 1]) / 2.0)
    r = rdisk[j] / geo.rstar
    area = PI * (rtemp[j + 1] * rtemp[j + 1] - rtemp[j] * rtemp[j])
    t = (disk.teff(tref, r))
    tdisk.append(t)
    fmax.append(t * WIEN)
    temp_ioniz = 0.0
    temp_uv = 0.0
    temp_nioniz = 0.0
    tempc4 = 0.0
    i = 0
    bnu = 1e-98
    while (bnu > 1e-99):
        freq = 1e15 + i * df
        bnu = ah.planck_nu(t, freq)
        if (freq > fev):
            temp_ioniz = temp_ioniz + bnu
            temp_nioniz = temp_nioniz + (bnu / (H * freq))
        if (freq > f1 and freq < f2):
            temp_uv = temp_uv + bnu
        i = i + 1
    L_2500 = L_2500 + 2 * PI * ah.planck_nu(t, f2500) * area
    temp_ioniz = PI * temp_ioniz * df * area * 2
    temp_uv = PI * temp_uv * df * area * 2
    temp_nioniz = PI * temp_nioniz * df * area * 2
    tot_ioniz = tot_ioniz + temp_ioniz
    tot_nioniz = tot_nioniz + temp_nioniz
    if j > 0:
        cum_ioniz.append(cum_ioniz[j - 1] + temp_ioniz)
    else: