Blame view

src/idl/dustem_create_freefree.pro 2.72 KB
b5ccb706   Jean-Philippe Bernard   improved to fit p...
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
FUNCTION dustem_create_freefree,key=key,val=val,help=help

;+
; NAME:
;    dustem_create_freefree
; PURPOSE:
;    DUSTEM pluggin to compute free-free emission
; CATEGORY:
;    DUSTEM Wrapper
; CALLING SEQUENCE:
;    freefree=dustem_create_freefree([,key=][,val=])
; INPUTS:
;    None
; OPTIONAL INPUT PARAMETERS:
;    key  = input parameter number
;    val  = input parameter value
; OUTPUTS:
;    freefree = free-free spectrum (on dustem wavelengths)
; OPTIONAL OUTPUT PARAMETERS:
;    None
; ACCEPTED KEY-WORDS:
;    help                  = if set, print this help
; COMMON BLOCKS:
;    None
; SIDE EFFECTS:
;    None
; RESTRICTIONS:
;    None
; PROCEDURE:
;    This is a dustem pluggin
; EXAMPLES
;
; MODIFICATION HISTORY:
;    Written by JPB 
;-

IF keyword_set(help) THEN BEGIN
  doc_library,'dustem_create_freefree'
  output=0.
  goto,the_end
ENDIF

;default values of input parameters
Tgas=10000.                 ;default gas temperature
Amplitude=1.          ;Amplitude

IF keyword_set(key) THEN BEGIN 
  a=where(key EQ 1,count1)
  b=where(key EQ 2,count2)
  IF count1 NE 0 then Tgas=(val(a))(0)
  IF count2 NE 0 then Amplitude=(val(b))(0)
ENDIF
  
IF !dustem_which EQ 'DESERT' THEN BEGIN
  lambir=((*!dustem_params).gemissiv.lambir)
ENDIF ELSE BEGIN
  lambir=((*!dustem_params).lambda.lambda)
ENDELSE

cmic=3.e14
nu=cmic/lambir   ;Hz
mjy=1           ;output is in MJy/sr
lambir_ref=10000.

;stop
;use_method='Deschenes2008'
;use_method='WallsGabaud1998'
;use_method='Halpha_scaled'
use_method='Dickinson2003_norm'

CASE use_method OF
    'WallsGabaud1998':BEGIN
		em=1.   ;This is a stupid value for the Emission measure. Result will be rescaled based on I_halpha_R anyway
		output=intensity_free_free(nu,Tgas,em,I_halpha_R=I_halpha_R,nHe=nHe,ergs=ergs,mjy=mjy)
		fact=Amplitude/I_halpha_R
        ;=== normalize to the requested Halpha value.
		output=output*fact
	END
    'WallsGabaud1998_scaled':BEGIN
		em=1.   ;This is a stupid value for the Emission measure. Result will be rescaled based on I_halpha_R anyway
		output=intensity_free_free(nu,Tgas,em,I_halpha_R=I_halpha_R,nHe=nHe,ergs=ergs,mjy=mjy)
		norm=interpol(output,lambir,lambir_ref)
		output=output/norm*Amplitude
	END
	'Deschenes2008':BEGIN
		beta_freefree=2.+1./(10.48+1.5*alog(Tgas/8.e3)-alog(nu/1.e9))
		output=nu^(-1.*beta_freefree)
		norm=interpol(output,lambir,lambir_ref)
		output=output/norm*Amplitude
	END
	'Dickinson2003_norm':BEGIN
		;stop
		em=1.
		T4=Tgas/1.e4
		nu_ghz=nu/1.e9
		a=0.366*(nu_ghz/1.e9)^(-0.15)*(alog(4.995*1e-2*(nu_ghz)^(-1.))+1.5*alog(Tgas))
		Tb=8.369e3*a*(nu_ghz)^(-2.)*T4^0.667*10^(0.029*T4)*(1.+0.08)  ;in mK for 1 Rayleigh
		convert_mk_mjy, lambir, Tb, I_Mjy, /RJ
		norm=interpol(I_Mjy,lambir,lambir_ref)
		output=I_Mjy/norm*Amplitude
	END
ENDCASE

the_end:
RETURN,output
  
END