Blame view

src/idl/dustem_plugin_modify_isrf.pro 1.65 KB
ad369def   Ilyes Choubani   uploading modify_...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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
ad369def   Ilyes Choubani   uploading modify_...
17
18
19
20
21
22
23
24
25
26
27
28
29
30
; 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 dustem idl wrapper must be installed
;    The path of the ISRF must be assigned to one of the dustemwrap free pointers.
ad369def   Ilyes Choubani   uploading modify_...
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
;    The user-defined ISRF needs to be on the same dustem ISRF grid.
; PROCEDURE:
;    This is a dustem plugin
;-
;- 

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 ...
53
amp=1.
ad369def   Ilyes Choubani   uploading modify_...
54
55
IF keyword_set(key) THEN BEGIN 
         
f9089dc2   Ilyes Choubani   implementing the ...
56
    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_...
57
58
59
         
    IF count1 NE 0 then begin
    
f9089dc2   Ilyes Choubani   implementing the ...
60
       amp=val[ind1[0]]
ad369def   Ilyes Choubani   uploading modify_...
61
62
       
    ENDIF
ad369def   Ilyes Choubani   uploading modify_...
63
64
65
   
ENDIF
       
f9089dc2   Ilyes Choubani   implementing the ...
66
if isa(!dustem_isrf_file) then user_ISRF = dustem_read_isrf(*!dustem_isrf_file)
ad369def   Ilyes Choubani   uploading modify_...
67

f9089dc2   Ilyes Choubani   implementing the ...
68
out=amp*User_ISRF     
ad369def   Ilyes Choubani   uploading modify_...
69
70
71
72
73
   
the_end:
scope='USER_ISRF'

;paramtag will only matter if G0 is fitted through the plugin. 
f9089dc2   Ilyes Choubani   implementing the ...
74
paramtag=['Ampitude']
ad369def   Ilyes Choubani   uploading modify_...
75
76
77

return, out
end