Commit 8bab7d4bc978f8e107f462367b9fb8ed4d3328a0

Authored by Ilyes Choubani
1 parent 3c479f24
Exists in master

small corrections + cleaning. Runs with pol (multiple datasets)

src/idl/dustem_activate_plugins.pro
... ... @@ -41,7 +41,6 @@ ENDIF
41 41 p_dim = p_min * (*(*!dustem_fit).param_init_values)
42 42 st=dustem_run(p_dim)
43 43  
44   -
45 44 if isa((*!dustem_fit).fixed_param_descs) then begin
46 45  
47 46 ;concatenating the parameter vectors
... ...
src/idl/dustem_fit_sed_orion.pro
... ... @@ -9,7 +9,7 @@ use_mode='G17_MODELC';'DBP90';'G17_MODELA';'THEMIS';;'USER_MODEL';'THEMIS';;'THE
9 9 dustem_init,mode=use_mode,kwords=['logn-chrg-spin','plaw-pol','plaw-pol'],/pol;,kwords=['plaw-ed','logn','logn'];,/pol;kwords=['plaw-ed-chrg-spin'],/pol;,kwords=['plaw-ed'];kwords=['plaw-ed-chrg-spin'];,/pol;
10 10 ;
11 11 ;stop
12   -!dustem_verbose=0
  12 +!dustem_verbose=1
13 13 !dustem_show_plot=1
14 14 !dustem_nocatch=1
15 15  
... ... @@ -228,7 +228,9 @@ llims[6]=1.00E+04
228 228 llims[7]=1.00E-04
229 229  
230 230 dustem_init_parinfo,pd,iv,up_limited=ulimed,lo_limited=llimed,up_limits=ulims,lo_limits=llims;,tied=tied
  231 +;stop
231 232 dustem_init_plugins,pd
  233 +stop
232 234  
233 235 ; fpd = [ $
234 236 ; '(*!dustem_params).grains(1).mdust_o_mh'$
... ...
src/idl/dustem_init.pro
... ... @@ -79,17 +79,6 @@ PRO dustem_init,model=model $
79 79 ;-
80 80  
81 81  
82   -
83   -
84   -;; ***COMMENT IC***
85   -;I think this procedure should be throughly revised. (and also the rest of the code corrected)
86   -;Pointers are used when the need does not present itself.
87   -;ie: defsysv, '!dustem_fit', ptr_new(dustem_fit_st), defsysv,'!dustem_inputs',ptr_new() or defsysv,'!dustem_params',ptr_new() which don't require initialization for instance
88   -;; ***END COMMENT IC***
89   -
90   -
91   -
92   -
93 82 IF keyword_set(help) THEN BEGIN
94 83 doc_library,'dustem_init'
95 84 goto,the_end
... ... @@ -124,12 +113,6 @@ dustem_init_plugins,pd_bidon
124 113 defsysv,'!dustem_nocatch',0 ;set to catch errors in SED fitting.
125 114  
126 115  
127   -;; ***COMMENT AH***
128   -;; do we still need this ? -->
129   -;==== define a stellar modifier to the ISRF
130   -;toto=dustem_define_isrf_stellar_modifyer_variable()
131   -;; ***END COMMENT AH***
132   -
133 116 ;=== read info about instrument
134 117 file=!dustem_wrap_soft_dir+'instrument_description.xcat'
135 118 st=read_xcat(file,/silent)
... ... @@ -218,22 +201,6 @@ defsysv, '!dustemcgwin_id', { $ ;IDs of windows to plot
218 201 prms: la_undef(), $
219 202 plgns: la_undef() $
220 203 }
221   -;I am doing this to save time instead of filtering the _extra structure
222   -; ;This part is not used so I will comment it
223   -; defsysv, '!dustemcgwin_extra', { $ ;Data to fit
224   -; sed: ptr_new(), $ ;
225   -; ext: ptr_new(), $ ;
226   -; qsed: ptr_new(), $ ;
227   -; used: ptr_new(), $ ;
228   -; polsed: ptr_new(), $ ;
229   -; polfrac: ptr_new(), $ ;
230   -; psi_em: ptr_new(), $ ;
231   -; qext: ptr_new(), $ ;
232   -; uext: ptr_new(), $ ;
233   -; polext: ptr_new(), $ ;
234   -; psi_ext: ptr_new() $ ;
235   -;
236   -; }
237 204  
238 205 defsysv, '!dustemcgwin_ncmds', { $ ;Data to fit
239 206 sed: {pl:0, nrm:0}, $ ;
... ... @@ -378,12 +345,12 @@ defsysv, '!dustem_model', model
378 345 (*!dustem_inputs).grain='GRAIN_THEMIS.DAT'
379 346 (*!dustem_inputs).align='ALIGN_THEMIS.DAT'
380 347 END
381   - 'NY_MODELA':BEGIN
  348 + 'NY_MODELA':BEGIN ;TB removed?
382 349 (*!dustem_inputs).grain='GRAIN_NY_MODELA.DAT'
383 350 (*!dustem_inputs).align='ALIGN_G17_MODELA.DAT'
384 351 END
385 352 ;This is a user-defined model ;This will probably need to be modified.
386   - 'USER_MODEL':BEGIN
  353 + 'USER_MODEL':BEGIN ;TB removed?
387 354 (*!dustem_inputs).grain='GRAIN_USER.DAT'
388 355 END
389 356 ELSE:BEGIN
... ... @@ -416,7 +383,6 @@ if keyword_set(kwords) then defsysv, '!dustem_kwords', ptr_new(kwords) else defs
416 383 st_model=dustem_read_all(dir_in,/silent)
417 384 !dustem_params=ptr_new(st_model)
418 385  
419   -
420 386 ;=== create dynamical storage if needed
421 387 IF not file_test(!dustem_dat,/dir) THEN BEGIN
422 388 spawn,'mkdir '+!dustem_dat
... ... @@ -483,7 +449,6 @@ endif ; /noerase
483 449 IF keyword_set(wraptest) THEN BEGIN
484 450 dir_out=!dustem_dat
485 451 dustem_write_all,st_model,dir_out
486   - ; stop
487 452 st=dustem_run()
488 453 IF keyword_set(plot_it) THEN BEGIN
489 454 loadct,13
... ... @@ -491,8 +456,6 @@ IF keyword_set(wraptest) THEN BEGIN
491 456 ENDIF
492 457 ENDIF
493 458  
494   -;stop
495   -
496 459 ;Initialize filters
497 460 dustem_filter_init
498 461  
... ...
src/idl/dustem_read_isrf.pro
... ... @@ -28,7 +28,7 @@ IF !dustem_which EQ 'VERSTRAETE' THEN BEGIN
28 28 Nisrf=n_elements(st)
29 29 ENDIF
30 30 ;IF getenv('DUSTEM_WHICH') EQ 'WEB3p8' THEN BEGIN
31   -IF !dustem_which EQ 'WEB3p8' THEN BEGIN
  31 +IF !dustem_which EQ 'RELEASE' THEN BEGIN
32 32 st=st(1:*)
33 33 Nisrf=n_elements(st)
34 34 ENDIF
... ...
src/idl/dustem_run.pro
... ... @@ -45,7 +45,6 @@ CASE n_params() OF
45 45 0: BEGIN
46 46 END
47 47 1: BEGIN
48   - ;stop
49 48 dustem_set_params,params
50 49 END
51 50 ELSE: BEGIN
... ... @@ -55,15 +54,9 @@ CASE n_params() OF
55 54 END
56 55 ENDCASE
57 56  
58   -;spawn,'dustem'
59   -;st=dustem_read_all_res(getenv('DUSTEM_RES'),/silent)
60   -;print,'params',params
61   -;stop
62   -
63 57 spawn,!dustem_f90_exec
64   -
65 58 st=dustem_read_all_res(!dustem_res,/silent)
66   -
  59 +
67 60 the_end:
68 61  
69 62 RETURN,st
... ...
src/idl/dustem_write_isrf_lv.pro
... ... @@ -38,15 +38,14 @@ ENDIF
38 38  
39 39  
40 40 IF tag_exist(*!dustem_plugin,'STELLAR_POPULATION') THEN BEGIN
41   - IF isa((*!dustem_plugin).stellar_population) THEN goto, the_end
  41 + IF isa((*!dustem_plugin).stellar_population.spec) THEN goto, the_end
42 42 ENDIF
43 43  
44   -;NOW YOU HAVE TO LOOP ON THE COMMENTS TO SEE IF IT IS THE COMPOSITE ISRF FILE OR THE MATHIS ONE.
45 44  
  45 +;MODIFY THIS TO DISPLAY THE ACTUAL VALUES BECAUSE IT IS JUST DISPLAYING EMPTY STRINGS AT THE MOMENT
46 46 Ncomments=6
47 47 c=strarr(Ncomments)
48 48  
49   -;MODIFY THIS TO DISPLAY THE ACTUAL VALUES BECAUSE IT IS JUST DISPLAYING EMPTY STRINGS AT THE MOMENT
50 49  
51 50 ;First lines of the ISRF.DAT file
52 51 c(0)='# DUSTEM: exciting radiation field featuring'
... ...