Blame view

src/idl/dustem_compute_polext.pro 1.84 KB
e7938fa3   Ilyes Choubani   Corrected02: Impl...
1
2
3
4
5
6
7
8
FUNCTION dustem_compute_polext ,p_dim,sti,_extra=extra,out_st=out_st,dustem_qext,dustem_uext,Q_ext,U_ext 

;CREATED AS A CONSEQUENCE OF THE INCLUSION OF THE PLUGINS


;written to homogonize DustEM

IF not keyword_set(sti) THEN BEGIN
dc72d0b6   Ilyes Choubani   initial procedure...
9
  dustem_activate_plugins,p_dim/(*(*!dustem_fit).param_init_values)
e7938fa3   Ilyes Choubani   Corrected02: Impl...
10
  sti=dustem_run(p_dim)
e7938fa3   Ilyes Choubani   Corrected02: Impl...
11
12
ENDIF

759a527d   Ilyes Choubani   general update
13
If ptr_valid(*!dustem_plugin) THEN BEGIN
e7938fa3   Ilyes Choubani   Corrected02: Impl...
14
15
16
 ;ADDING PLUGIN TO SPECTRUM----------------
 ;if n_tags(!dustem_data.polext) gt 1 then begin
 for i=0L,n_tags(*!dustem_scope)-1 do begin
4750086c   Ilyes Choubani   nouvelle philosph...
17
 if total(strsplit((*(*!dustem_scope).(i)),'+',/extract) eq 'ADD_POLEXT') then sti.polext.ext_tot+=(*(*!dustem_plugin).(i))
e7938fa3   Ilyes Choubani   Corrected02: Impl...
18
19
20
21
 endfor
 ;endif
 ;------------------------------------------
 
dc72d0b6   Ilyes Choubani   initial procedure...
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
; ;=============================THIS BLOCK IS WRONG YOU HAVE TO CHANGE IT=============================
;  
;  
;  ;MODIFYING SPECTRUM VIA PLUGIN-------------- THIS BLOCK NEEDS TO BE UNDER THE DUSTEM_POLSED LINE 
; 
;  for i=0L,n_tags(*!dustem_scope)-1 do begin
; 
;  if total(strsplit((*(*!dustem_scope).(i)),'+',/extract) eq 'MODIFY_POLEXT') then begin
; 
;  ;making sure it's the stokes plugin that gets used here
; 
;  iidx=where(tag_names(*!dustem_scope) eq 'STEXT')
; 
; 
;  IF iidx eq i THEN BEGIN ;not sure about this condition but you get the spirit
; 
;  Q_ext=(*(*!dustem_plugin).(i))(0:n_elements((*(*!dustem_plugin).(i)))/2-1)
;  U_ext=(*(*!dustem_plugin).(i))(n_elements((*(*!dustem_plugin).(i)))/2:*)
;  dustem_qext=interpol(Q_ext,sti.polext.wav,(*!dustem_data.polext).wav)
;  dustem_uext=interpol(U_ext,sti.polext.wav,(*!dustem_data.polext).wav)
;  
;  endif 
;  endif
;  endfor
;  ;endif
;  ;-------------------------------------------
; ;=======================================================================================================
e7938fa3   Ilyes Choubani   Corrected02: Impl...
49

dc72d0b6   Ilyes Choubani   initial procedure...
50
ENDIF
e7938fa3   Ilyes Choubani   Corrected02: Impl...
51

e7938fa3   Ilyes Choubani   Corrected02: Impl...
52
53
54
55
56
57
dustem_polext = interpol(sti.polext.ext_tot,sti.polext.wav,(*!dustem_data.polext).wav) 


return, dustem_polext


759a527d   Ilyes Choubani   general update
58

e7938fa3   Ilyes Choubani   Corrected02: Impl...
59
END