Ejemplo n.º 1
0
def uniform(halodict, NH=NH, d2g=0.009, verbose=False):
    """
    Performs numerical integration with uniform dust distribution
        calculation with each halo in halodict
    ----------------------------------------------------
    FUNCTION uniform( halodict, NH=NH, d2g=0.009, verbose=False )
    RETURNS  : empty 
    ----------------------------------------------------
    halodict : halodict.HaloDict object
    NH       : float [cm^-2] : Hydrogen column
    d2g      : float : Dust-to-gas mass ratio
    verbose  : boolean : If true, print halo energy at each calculation step
    """
    print "Numerically integrating halo model for uniform ISM"
    AH.set_htype(halodict, NH=NH, d2g=d2g)
    for i in range(halodict.len):
        if verbose:
            print "Calculating halo energy:", halodict.energy[i], " keV"
        halo_temp = GH.Halo(halodict.energy[i], alpha=halodict.alpha, scatm=halodict.scatm, rad=halodict.rad)
        GH.UniformISM(halo_temp, NH=NH, d2g=d2g)
        halodict.intensity[i, :] = halo_temp.intensity
    return
Ejemplo n.º 2
0
def screen(halodict, xg=0.5, NH=NH, d2g=0.009, verbose=False):
    """
    Performs numerical integration dust screen calculation with each halo in halodict
    ----------------------------------------------------
    FUNCTION screen( halodict, xg=0.5, NH=NH, d2g=0.009, verbose=False )
    RETURNS  : empty 
    ----------------------------------------------------
    halodict : halodict.HaloDict object
    xg       : float [0-1] : position of screen where 0 = point source, 1 = observer
    NH       : float [cm^-2] : Hydrogen column
    d2g      : float : Dust-to-gas mass ratio
    verbose  : boolean : If true, print halo energy at each calculation step
    """
    print "Numerically integrating halo model for a dust screen at x =", xg
    AH.set_htype(halodict, xg=xg, NH=NH, d2g=d2g)
    for i in range(halodict.len):
        if verbose:
            print "Calculating halo energy :", halodict.energy[i], " keV"
        halo_temp = GH.Halo(halodict.energy[i], alpha=halodict.alpha, scatm=halodict.scatm, rad=halodict.rad)
        GH.DiscreteISM(halo_temp, xg=xg, NH=NH, d2g=d2g)
        halodict.intensity[i, :] = halo_temp.intensity
    return
Ejemplo n.º 3
0
def uniform( halodict, NH=NH, d2g=0.009, verbose=False ):
    """
    Performs numerical integration with uniform dust distribution
        calculation with each halo in halodict
    
    | **MODIFIES**
    | halodict.intensity, halodict.htype
    
    | **INPUTS**
    | halodict : halodict.HaloDict object
    | NH       : float [cm^-2] : Hydrogen column
    | d2g      : float : Dust-to-gas mass ratio
    | verbose  : boolean : If true, print halo energy at each calculation step
    """
    print('Numerically integrating halo model for uniform ISM')
    AH.set_htype( halodict, NH=NH, d2g=d2g )
    for i in range( halodict.len ):
        if verbose: print('Calculating halo energy:', halodict.energy[i], 'keV')
        halo_temp = GH.Halo( halodict.energy[i], alpha=halodict.alpha, \
            scatm=halodict.scatm, rad=halodict.rad )
        GH.UniformISM( halo_temp, NH=NH, d2g=d2g )
        halodict.intensity[i,:] = halo_temp.intensity
    return
Ejemplo n.º 4
0
def screen( halodict, xg=0.5, NH=NH, d2g=0.009, verbose=False ):
    """
    Performs numerical integration dust screen calculation with each halo in halodict

    | **MODIFIES**
    | halodict.intensity, halodict.htype
    
    | **INPUTS**
    | halodict : halodict.HaloDict object
    | xg       : float [0-1] : position of screen where 0 = point source, 1 = observer
    | NH       : float [cm^-2] : Hydrogen column
    | d2g      : float : Dust-to-gas mass ratio
    | verbose  : boolean : If true, print halo energy at each calculation step
    """
    print('Numerically integrating halo model for a dust screen at x =', xg)
    AH.set_htype( halodict, xg=xg, NH=NH, d2g=d2g )
    for i in range( halodict.len ):
        if verbose: print('Calculating halo energy :', halodict.energy[i], 'keV')
        halo_temp = GH.Halo( halodict.energy[i], alpha=halodict.alpha, \
            scatm=halodict.scatm, rad=halodict.rad )
        GH.DiscreteISM( halo_temp, xg=xg, NH=NH, d2g=d2g )
        halodict.intensity[i,:] = halo_temp.intensity
    return