Blame view

src/idl/dustem_read_all_res.pro 3.22 KB
427f1205   Jean-Michel Glorian   version 4.2 merged
1
2
3
4
5
FUNCTION dustem_read_all_res,dir_out,silent=silent,help=help

;+
; NAME:
;    dustem_read_all_res
f09e876c   Annie Hughes   updated doc help
6
;
427f1205   Jean-Michel Glorian   version 4.2 merged
7
; PURPOSE:
f09e876c   Annie Hughes   updated doc help
8
9
;    Reads all Dustem fortran outputs
;
427f1205   Jean-Michel Glorian   version 4.2 merged
10
; CATEGORY:
f09e876c   Annie Hughes   updated doc help
11
12
;    Dustem, Low-level, Distributed, Fortran
;
427f1205   Jean-Michel Glorian   version 4.2 merged
13
14
; CALLING SEQUENCE:
;    st=dustem_read_all_res(dir_out[,/silent][,/help])
f09e876c   Annie Hughes   updated doc help
15
;
427f1205   Jean-Michel Glorian   version 4.2 merged
16
17
; INPUTS:
;    dir_out: Dustem output directory
f09e876c   Annie Hughes   updated doc help
18
;
427f1205   Jean-Michel Glorian   version 4.2 merged
19
20
; OPTIONAL INPUT PARAMETERS:
;    None
f09e876c   Annie Hughes   updated doc help
21
;
427f1205   Jean-Michel Glorian   version 4.2 merged
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
; 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]
f09e876c   Annie Hughes   updated doc help
37
;
427f1205   Jean-Michel Glorian   version 4.2 merged
38
39
; OPTIONAL OUTPUT PARAMETERS:
;    None
f09e876c   Annie Hughes   updated doc help
40
;
427f1205   Jean-Michel Glorian   version 4.2 merged
41
42
43
; ACCEPTED KEY-WORDS:
;    help      = If set, print this help
;    silent    = If set, function is silent
f09e876c   Annie Hughes   updated doc help
44
;
427f1205   Jean-Michel Glorian   version 4.2 merged
45
46
; COMMON BLOCKS:
;    None
f09e876c   Annie Hughes   updated doc help
47
;
427f1205   Jean-Michel Glorian   version 4.2 merged
48
49
; SIDE EFFECTS:
;    None
f09e876c   Annie Hughes   updated doc help
50
;
427f1205   Jean-Michel Glorian   version 4.2 merged
51
; RESTRICTIONS:
f09e876c   Annie Hughes   updated doc help
52
53
54
;    The DustEM fortran code must be installed
;    The DustEMWrap idl code must be installed
;
427f1205   Jean-Michel Glorian   version 4.2 merged
55
56
; PROCEDURE:
;    None
f09e876c   Annie Hughes   updated doc help
57
;
427f1205   Jean-Michel Glorian   version 4.2 merged
58
59
60
61
62
; EXAMPLES
;    dustem_init,/wrap
;    dir=getenv('DUSTEM_RES')
;    st=dustem_read_all_res(dir)
;    help,st,/str
f09e876c   Annie Hughes   updated doc help
63
;
427f1205   Jean-Michel Glorian   version 4.2 merged
64
; MODIFICATION HISTORY:
f09e876c   Annie Hughes   updated doc help
65
66
67
;    Written by J.-Ph. Bernard 2008
;    Evolution details on the DustEMWrap gitlab.
;    See http://dustemwrap.irap.omp.eu/ for FAQ and help.  
427f1205   Jean-Michel Glorian   version 4.2 merged
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
;-

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...
85
  'RELEASE': BEGIN
427f1205   Jean-Michel Glorian   version 4.2 merged
86
87
88
89
90
    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
91
    
a2e70a54   Jean-Philippe Bernard   improved
92
93
94
95
96
97
    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
98
99
100
        	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
101
	    ENDIF ELSE BEGIN
427f1205   Jean-Michel Glorian   version 4.2 merged
102
        	st={sed:st_sed,ext:st_ext,polext:st_polext,polsed:st_polsed}
a2e70a54   Jean-Philippe Bernard   improved
103
104
	    ENDELSE
    ENDIF ELSE BEGIN
427f1205   Jean-Michel Glorian   version 4.2 merged
105
        st={sed:st_sed,ext:st_ext}
a2e70a54   Jean-Philippe Bernard   improved
106
    ENDELSE
427f1205   Jean-Michel Glorian   version 4.2 merged
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
;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