Blame view

src/idl/dustem_plugin_continuum.pro 1.69 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

6baf9f1f   Jean-Philippe Bernard   fixed a few issue...
47
48
49
50
51
52
53
54
55
56
57
58
IF keyword_set(scope) THEN BEGIN
    scope='ADD_SED'
    output=0
    goto, the_end
ENDIF 

IF keyword_set(paramtag) THEN BEGIN
    paramtag=[textoidl('T_{BB}')+' [K]','Amp']
    output=0
    goto, the_end 
ENDIF

4750086c   Ilyes Choubani   nouvelle philosph...
59

b5ccb706   Jean-Philippe Bernard   improved to fit p...
60
61
62
;default values of input parameters
temp=1000.
ampl=1.d-2
616ed857   Annie Hughes   added paramdefaul...
63
paramdefault=[temp,ampl]
452c334e   Ilyes Choubani   Implementation Of...
64

b5ccb706   Jean-Philippe Bernard   improved to fit p...
65
66
67
IF keyword_set(key) THEN BEGIN 
  a=where(key EQ 1,count1)
  b=where(key EQ 2,count2)
452c334e   Ilyes Choubani   Implementation Of...
68
  
b5ccb706   Jean-Philippe Bernard   improved to fit p...
69
70
  IF count1 NE 0 then temp=(val(a))(0)
  IF count2 NE 0 then ampl=(val(b))(0)
452c334e   Ilyes Choubani   Implementation Of...
71
   
b5ccb706   Jean-Philippe Bernard   improved to fit p...
72
ENDIF
427f1205   Jean-Michel Glorian   version 4.2 merged
73
  
cbf75ef0   Ilyes Choubani   dustem_init_plugi...
74
lambir=dustem_get_wavelengths()
b5ccb706   Jean-Philippe Bernard   improved to fit p...
75
76
77
78

;=== 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
79

b5ccb706   Jean-Philippe Bernard   improved to fit p...
80
81
the_end:
RETURN,output
427f1205   Jean-Michel Glorian   version 4.2 merged
82
83
  
END