dustem_plugin_modify_isrf.pro
1.82 KB
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
FUNCTION dustem_plugin_modify_isrf, key=key, val=val, scope=scope, paramtag=paramtag,help=help
;+
; NAME:
; dustem_plugin_modify_isrf
;
; PURPOSE:
; REPLACES THE DEFAULT DUSTEM ISRF with a user-defined one
;
; CATEGORY:
; DUSTEM Wrapper
;
; CALLING SEQUENCE:
; dustem_plugin_modify_isrf(key=key,val=val)
;
; INPUTS:
; None
;
; OPTIONAL INPUT PARAMETERS:
; key = input parameter number
; val = input parameter value
;
; OUTPUTS:
; None
;
; OPTIONAL OUTPUT PARAMETERS:
; None
;
; ACCEPTED KEY-WORDS:
; help = if set, print this help
;
; COMMON BLOCKS:
; None
;
; SIDE EFFECTS:
; None
;
; RESTRICTIONS:
; The DustEM fortran code must be installed
; The DustEMWrap IDL code must be installed
; The path of the ISRF must be assigned to one of the DustEMWrap free pointers.
; The user-defined ISRF needs to be on the same dustem ISRF grid.
;
; PROCEDURE:
;
; EXAMPLES
; dustem_plugin_modify_isrf
;
; MODIFICATION HISTORY:
; Evolution details on the DustEMWrap gitlab.
; See http://dustemwrap.irap.omp.eu/ for FAQ and help.
;-
IF keyword_set(help) THEN BEGIN
doc_library,'dustem_plugin_modify_isrf'
goto,the_end
ENDIF
IF keyword_set(scope) THEN BEGIN
out=0
goto, the_end
ENDIF
IF keyword_set(paramtag) THEN BEGIN
out=0
goto, the_end
ENDIF
out=0;?
amp=1.
IF keyword_set(key) THEN BEGIN
ind1=where(key EQ 1,count1) ;amplitude of the chosen spectrum (if the user has the shape but lacks the amplitude)
IF count1 NE 0 then begin
amp=val[ind1[0]]
ENDIF
ENDIF
if isa(!dustem_isrf_file) then user_ISRF = dustem_read_isrf(*!dustem_isrf_file)
out=amp*User_ISRF.isrf
the_end:
scope='USER_ISRF'
;paramtag will only matter if G0 is fitted through the plugin.
paramtag=['Ampitude']
return, out
end