Blame view

src/idl/dustem_read_all_res.pro 3.14 KB
427f1205   Jean-Michel Glorian   version 4.2 merged
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
FUNCTION dustem_read_all_res,dir_out,silent=silent,help=help

;+
; NAME:
;    dustem_read_all_res
; PURPOSE:
;    Reads all Dustem outputs
; CATEGORY:
;    Dustem
; CALLING SEQUENCE:
;    st=dustem_read_all_res(dir_out[,/silent][,/help])
; INPUTS:
;    dir_out: Dustem output directory
; OPTIONAL INPUT PARAMETERS:
;    None
; OUTPUTS:
;    st: Dustem output structure
;      structure:
;      DUSTEM          STRUCT    -> <Anonymous> Array[800]
;        WAV             FLOAT         0.0400000
;        EM_GRAIN_1      FLOAT           0.00000
;        EM_GRAIN_2      FLOAT           0.00000
;        EM_GRAIN_3      FLOAT           0.00000
;        EM_GRAIN_4      FLOAT           0.00000
;        EM_GRAIN_5      FLOAT           0.00000
;        EM_TOT          FLOAT           0.00000
;      EXT             STRUCT    -> <Anonymous> Array[799]
;        WAV             FLOAT         0.0406570
;        ABS_GRAIN       FLOAT     Array[5]
;        SCA_GRAIN       FLOAT     Array[5]
; OPTIONAL OUTPUT PARAMETERS:
;    None
; ACCEPTED KEY-WORDS:
;    help      = If set, print this help
;    silent    = If set, function is silent
; COMMON BLOCKS:
;    None
; SIDE EFFECTS:
;    None
; RESTRICTIONS:
;    The dustem idl wrapper must be installed
; PROCEDURE:
;    None
; EXAMPLES
;    dustem_init,/wrap
;    dir=getenv('DUSTEM_RES')
;    st=dustem_read_all_res(dir)
;    help,st,/str
; MODIFICATION HISTORY:
;    Written by J.-Ph. Bernard
;    see evolution details on the dustem cvs maintained at CESR
;    Contact J.-Ph. Bernard (Jean-Philippe.Bernard@cesr.fr) in case of problems.
;-

IF keyword_set(help) THEN BEGIN
  doc_library,'dustem_read_all_res'
  st=0.
  goto,the_end
ENDIF

;CASE getenv('DUSTEM_WHICH') OF
CASE !dustem_which OF
  'VERSTRAETE':BEGIN
    file=dir_out+'les_RES/'+'SED.RES'
    st_sed=dustem_read_dustem_lv(file,silent=silent)
    file=dir_out+'les_RES/'+'EXT_M.RES'
    st_ext=dustem_read_ext_lv(file,silent=silent)
    st={sed:st_sed,ext:st_ext}
  END
3c479f24   Ilyes Choubani   Allowing to fix p...
70
  'RELEASE': BEGIN
427f1205   Jean-Michel Glorian   version 4.2 merged
71
72
73
74
75
    file=dir_out+'out/'+'SED.RES'
    st_sed=dustem_read_dustem_lv(file,silent=silent)
    file=dir_out+'out/'+'EXT.RES'
    st_ext=dustem_read_ext_lv(file,silent=silent)
;VGb : add polarization
36e8b879   Jean-Michel Glorian   update from deborah
76
    
a2e70a54   Jean-Philippe Bernard   improved
77
78
79
80
81
82
    IF !run_pol THEN BEGIN
      file=dir_out+'out/'+'SED_POL.RES'
      st_polsed=dustem_read_dustem_lv(file,silent=silent)
      file=dir_out+'out/'+'EXT_POL.RES'
      st_polext=dustem_read_ext_lv(file,silent=silent)
    	IF !run_circ THEN BEGIN
427f1205   Jean-Michel Glorian   version 4.2 merged
83
84
85
        	file=dir_out+'out/'+'EXT_CIRC.RES'
        	st_circext=dustem_read_circ_vg(file,silent=silent)
        	st={sed:st_sed,ext:st_ext,polext:st_polext,polsed:st_polsed,circext:st_circext}
a2e70a54   Jean-Philippe Bernard   improved
86
	    ENDIF ELSE BEGIN
427f1205   Jean-Michel Glorian   version 4.2 merged
87
        	st={sed:st_sed,ext:st_ext,polext:st_polext,polsed:st_polsed}
a2e70a54   Jean-Philippe Bernard   improved
88
89
	    ENDELSE
    ENDIF ELSE BEGIN
427f1205   Jean-Michel Glorian   version 4.2 merged
90
        st={sed:st_sed,ext:st_ext}
a2e70a54   Jean-Philippe Bernard   improved
91
    ENDELSE
427f1205   Jean-Michel Glorian   version 4.2 merged
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
;VGe
  END
  ELSE: BEGIN
    file=dir_out+'DUSTEM.RES'
    st_sed=dustem_read_dustem(file,silent=silent)
    file=dir_out+'SECTEFFIR.RES'
    st_secteffir=dustem_read_secteffir(file,silent=silent)

    file=dir_out+'SECTEFFUV.RES'
    st_secteffuv=dustem_read_secteffuv(file,silent=silent)
    st={sed:st_sed,secteffir:st_secteffir,secteffuv:st_secteffuv}
  END
ENDCASE

;stop
the_end:

RETURN,st

END