コード例 #1
0
ファイル: extinction.py プロジェクト: nhmc/H2
**References**

- 'Astrophysics of Dust in Cold Clouds' by B.T. Draine:
  http://arxiv.org/abs/astro-ph/0304488
- 'Interstellar Dust Grains' by B.T. Draine:
  http://arxiv.org/abs/astro-ph/0304489

Note that much of the code in this module is adapted from Erik
Tollerud's `Astropysics <https://github.com/eteq/astropysics>`_, which
has an Apache licence.
"""

from utilities import get_data_path
import numpy as np

datapath = get_data_path()
PATH_EXTINCT = datapath + '/dust_extinction/'

def starburst_Calzetti00(wa, EBmV, Rv=4.05):
    """ Dust extinction in starburst galaxies using the Calzetti
    relation.

    Find the extinction as a function of wavelength for the given
    E(B-V) using the relation from Calzetti et al.  R_v' = 4.05 is
    assumed (see equation (5) of Calzetti et al. 2000 ApJ, 533, 682)
    E(B-V) is the extinction in the stellar continuum.

    The wavelength array wa must be in Angstroms and sorted from
    low to high values.

    Parameters
コード例 #2
0
ファイル: absorb.py プロジェクト: nhmc/H2
""" This module has routines for analysing the absorption profiles
from ions and molecules.
"""
import math
from math import pi, sqrt

import numpy as np
import voigt
from convolve import convolve_psf
from utilities import between, adict, get_data_path, indexnear
from constants import Ar, me, mp, kboltz, c, e, sqrt_ln2, c_kms
from spec import find_wa_edges

DATAPATH = get_data_path()

def calctau(v, wav0, osc, gam, logN, T=None, btemp=20, bturb=0,
            debug=False, verbose=True):
    """ Returns the optical depth (Voigt profile) for a transition.

    Given an transition with rest wavelength wav0, osc strength,
    natural linewidth gam; b parameter (doppler and turbulent); and
    log10 (column density), returns the optical depth in velocity
    space. v is an array of velocity values in km/s. The absorption
    line must be centred at v=0.

    Parameters
    ----------
    v : array of floats, shape (N,)
      Velocities in km/s.
    wav0 : float
      Rest wavelength op transition in Angstroms.