Blame view

src/idl/dustem_plugin_modify_isrf.pro 1.82 KB
8dbb9ca6   Annie Hughes   fix bug with free...
1
FUNCTION dustem_plugin_modify_isrf, key=key, val=val, scope=scope, paramtag=paramtag,help=help 
ad369def   Ilyes Choubani   uploading modify_...
2
3
4
5

;+
; NAME:
;    dustem_plugin_modify_isrf
8dbb9ca6   Annie Hughes   fix bug with free...
6
;
ad369def   Ilyes Choubani   uploading modify_...
7
8
; PURPOSE:
;    REPLACES THE DEFAULT DUSTEM ISRF with a user-defined one  
8dbb9ca6   Annie Hughes   fix bug with free...
9
;
ad369def   Ilyes Choubani   uploading modify_...
10
11
; CATEGORY:
;    DUSTEM Wrapper
8dbb9ca6   Annie Hughes   fix bug with free...
12
;
ad369def   Ilyes Choubani   uploading modify_...
13
14
; CALLING SEQUENCE:
;    dustem_plugin_modify_isrf(key=key,val=val)
8dbb9ca6   Annie Hughes   fix bug with free...
15
;
ad369def   Ilyes Choubani   uploading modify_...
16
17
; INPUTS:
;    None
8dbb9ca6   Annie Hughes   fix bug with free...
18
;
ad369def   Ilyes Choubani   uploading modify_...
19
20
21
; OPTIONAL INPUT PARAMETERS:
;    key = input parameter number 
;    val = input parameter value
8dbb9ca6   Annie Hughes   fix bug with free...
22
;
ad369def   Ilyes Choubani   uploading modify_...
23
24
; OUTPUTS:
;    None
8dbb9ca6   Annie Hughes   fix bug with free...
25
;
ad369def   Ilyes Choubani   uploading modify_...
26
27
; OPTIONAL OUTPUT PARAMETERS:
;    None
8dbb9ca6   Annie Hughes   fix bug with free...
28
;
ad369def   Ilyes Choubani   uploading modify_...
29
30
; ACCEPTED KEY-WORDS:
;    help                  = if set, print this help
8dbb9ca6   Annie Hughes   fix bug with free...
31
;
ad369def   Ilyes Choubani   uploading modify_...
32
33
; COMMON BLOCKS:
;    None
8dbb9ca6   Annie Hughes   fix bug with free...
34
;
ad369def   Ilyes Choubani   uploading modify_...
35
36
; SIDE EFFECTS:
;    None
8dbb9ca6   Annie Hughes   fix bug with free...
37
;
ad369def   Ilyes Choubani   uploading modify_...
38
; RESTRICTIONS:
8dbb9ca6   Annie Hughes   fix bug with free...
39
40
41
;    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.
ad369def   Ilyes Choubani   uploading modify_...
42
;    The user-defined ISRF needs to be on the same dustem ISRF grid.
8dbb9ca6   Annie Hughes   fix bug with free...
43
;
ad369def   Ilyes Choubani   uploading modify_...
44
; PROCEDURE:
8dbb9ca6   Annie Hughes   fix bug with free...
45
46
47
48
49
50
51
;    
; EXAMPLES
;    dustem_plugin_modify_isrf
;
; MODIFICATION HISTORY:
;    Evolution details on the DustEMWrap gitlab.
;    See http://dustemwrap.irap.omp.eu/ for FAQ and help.  
ad369def   Ilyes Choubani   uploading modify_...
52
;-
ad369def   Ilyes Choubani   uploading modify_...
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69

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;?
f9089dc2   Ilyes Choubani   implementing the ...
70
amp=1.
ad369def   Ilyes Choubani   uploading modify_...
71
72
IF keyword_set(key) THEN BEGIN 
         
f9089dc2   Ilyes Choubani   implementing the ...
73
    ind1=where(key EQ 1,count1) ;amplitude of the chosen spectrum (if the user has the shape but lacks the amplitude)
ad369def   Ilyes Choubani   uploading modify_...
74
75
76
         
    IF count1 NE 0 then begin
    
f9089dc2   Ilyes Choubani   implementing the ...
77
       amp=val[ind1[0]]
ad369def   Ilyes Choubani   uploading modify_...
78
79
       
    ENDIF
ad369def   Ilyes Choubani   uploading modify_...
80
81
82
   
ENDIF
       
f9089dc2   Ilyes Choubani   implementing the ...
83
if isa(!dustem_isrf_file) then user_ISRF = dustem_read_isrf(*!dustem_isrf_file)
ad369def   Ilyes Choubani   uploading modify_...
84

c9abf9b4   Ilyes Choubani   Uploading stellar...
85
out=amp*User_ISRF.isrf     
ad369def   Ilyes Choubani   uploading modify_...
86
87
88
89
90
   
the_end:
scope='USER_ISRF'

;paramtag will only matter if G0 is fitted through the plugin. 
f9089dc2   Ilyes Choubani   implementing the ...
91
paramtag=['Ampitude']
ad369def   Ilyes Choubani   uploading modify_...
92
93

return, out
8dbb9ca6   Annie Hughes   fix bug with free...
94
end