Blame view

src/idl/dustem_habing_field.pro 765 Bytes
a38807fc   Annie Hughes   first commit of f...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
FUNCTION DUSTEM_HABING_FIELD, x, unit=unit
; computes the Habing interstellar radiation field SED (ISRF)
; in W/m2 (4*!pi*nu*I_nu)
; (from Draine & Bertoldi 1996)
; X	(I): X-grid for the ISRF
; UNIT	(I): unit of the ISRF. Choices are 
;	     'W': wave in um [Default]
;	     'F': frequency in cm-1
;	     'E': energy in eV 

 if n_elements( UNIT ) EQ 0 then unit = 'W' $
 else unit = strupcase( strcompress( unit,/rem) )

 x = double( x )

 CASE unit of 

   'W': x3 = 1.d1 * x 

   'F': x3 = 1.d5 / x

   'E': x3 = 12.4 / x

 ENDCASE

 field = - x3^3*4.1667 + x3^2*12.5 - x3*4.3333 
 field = 1.d-1 * 3.d8 * 1.d-14 * field 

 i_neg = where( field LT 0.d0, c_neg )
 field( i_neg ) = 0.d0

 RETURN, field
END                             ;FUNCTION DUSTEM_HABING_FIELD