Blame view

src/idl/dustem_plugin_continuum.pro 1.7 KB
616ed857   Annie Hughes   added paramdefaul...
1
FUNCTION dustem_plugin_continuum,key=key,val=val,scope=scope,paramtag=paramtag,paramdefault=paramdefault,help=help
b5ccb706   Jean-Philippe Bernard   improved to fit p...
2
3
4

;+
; NAME:
cbf75ef0   Ilyes Choubani   dustem_init_plugi...
5
;    dustem_plugin_continuum
b5ccb706   Jean-Philippe Bernard   improved to fit p...
6
; PURPOSE:
616ed857   Annie Hughes   added paramdefaul...
7
;    DUSTEM plugin to compute a blackbody continuum
b5ccb706   Jean-Philippe Bernard   improved to fit p...
8
9
10
; CATEGORY:
;    DUSTEM Wrapper
; CALLING SEQUENCE:
cbf75ef0   Ilyes Choubani   dustem_init_plugi...
11
;    cont=dustem_plugin_continuum([,key=][,val=])
b5ccb706   Jean-Philippe Bernard   improved to fit p...
12
13
14
15
16
17
18
19
; INPUTS:
;    
; OPTIONAL INPUT PARAMETERS:
;    key  = input parameter number
;    val  = input parameter value
; OUTPUTS:
;    cont = continuum spectrum (on dustem wavelengths)
; OPTIONAL OUTPUT PARAMETERS:
616ed857   Annie Hughes   added paramdefaul...
20
21
22
;    scope = scope of the plugin
;    paramdefault = default values of parameters
;    paramtag = plugin parameter names as strings
b5ccb706   Jean-Philippe Bernard   improved to fit p...
23
24
25
26
27
28
29
30
31
; ACCEPTED KEY-WORDS:
;    help                  = if set, print this help
; COMMON BLOCKS:
;    None
; SIDE EFFECTS:
;    None
; RESTRICTIONS:
;    None
; PROCEDURE:
cbf75ef0   Ilyes Choubani   dustem_init_plugi...
32
;    This is a dustem plugin
b5ccb706   Jean-Philippe Bernard   improved to fit p...
33
34
; EXAMPLES
;
4750086c   Ilyes Choubani   nouvelle philosph...
35
;
b5ccb706   Jean-Philippe Bernard   improved to fit p...
36
37
38
39
; MODIFICATION HISTORY:
;    Written by JPB 
;-

452c334e   Ilyes Choubani   Implementation Of...
40

b5ccb706   Jean-Philippe Bernard   improved to fit p...
41
IF keyword_set(help) THEN BEGIN
cbf75ef0   Ilyes Choubani   dustem_init_plugi...
42
  doc_library,'dustem_plugin_continuum'
9e6a6a33   Ilyes Choubani   a JP /BUT HAS FAU...
43
  output=0.
b5ccb706   Jean-Philippe Bernard   improved to fit p...
44
45
46
  goto,the_end
ENDIF

4750086c   Ilyes Choubani   nouvelle philosph...
47

b5ccb706   Jean-Philippe Bernard   improved to fit p...
48
49
50
;default values of input parameters
temp=1000.
ampl=1.d-2
cbf75ef0   Ilyes Choubani   dustem_init_plugi...
51
scope='ADD_SED'
b1818a4d   Jean-Philippe Bernard   updated names and...
52
paramtag=[textoidl('T_{BB}')+' [K]','Amp']
616ed857   Annie Hughes   added paramdefaul...
53
paramdefault=[temp,ampl]
452c334e   Ilyes Choubani   Implementation Of...
54

b5ccb706   Jean-Philippe Bernard   improved to fit p...
55
56
57
IF keyword_set(key) THEN BEGIN 
  a=where(key EQ 1,count1)
  b=where(key EQ 2,count2)
452c334e   Ilyes Choubani   Implementation Of...
58
  
b5ccb706   Jean-Philippe Bernard   improved to fit p...
59
60
  IF count1 NE 0 then temp=(val(a))(0)
  IF count2 NE 0 then ampl=(val(b))(0)
452c334e   Ilyes Choubani   Implementation Of...
61
   
b5ccb706   Jean-Philippe Bernard   improved to fit p...
62
ENDIF
427f1205   Jean-Michel Glorian   version 4.2 merged
63
  
cbf75ef0   Ilyes Choubani   dustem_init_plugi...
64
65
66
67
68
69
70
; IF !dustem_which EQ 'DESERT' THEN BEGIN
;   lambir=((*!dustem_params).gemissiv.lambir)
; ENDIF ELSE BEGIN
;   lambir=((*!dustem_params).lambda.lambda)
; ENDELSE

lambir=dustem_get_wavelengths()
b5ccb706   Jean-Philippe Bernard   improved to fit p...
71
72
73
74

;=== normalize spectrum to the requested amplitude.
norm = max(dustem_planck_function(temp,lambir))
output = ampl*dustem_planck_function(temp,lambir)/norm
427f1205   Jean-Michel Glorian   version 4.2 merged
75

b5ccb706   Jean-Philippe Bernard   improved to fit p...
76
77
the_end:
RETURN,output
427f1205   Jean-Michel Glorian   version 4.2 merged
78
79
  
END