dustem_read_all_res.pro
3.22 KB
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
FUNCTION dustem_read_all_res,dir_out,silent=silent,help=help
;+
; NAME:
; dustem_read_all_res
;
; PURPOSE:
; Reads all Dustem fortran outputs
;
; CATEGORY:
; Dustem, Low-level, Distributed, Fortran
;
; 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 fortran code must be installed
; The DustEMWrap idl code 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 2008
; Evolution details on the DustEMWrap gitlab.
; See http://dustemwrap.irap.omp.eu/ for FAQ and help.
;-
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
'RELEASE': BEGIN
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
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
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}
ENDIF ELSE BEGIN
st={sed:st_sed,ext:st_ext,polext:st_polext,polsed:st_polsed}
ENDELSE
ENDIF ELSE BEGIN
st={sed:st_sed,ext:st_ext}
ENDELSE
;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