Blame view

src/idl/dustem_read_all_lv.pro 2.25 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
FUNCTION dustem_read_all_lv,dir_in,silent=silent

dir_in_dat=dir_in+'/les_DAT/'
dir_in_qabs=dir_in+'/les_QABS/'
dir_in_capa=dir_in+'/les_CAPA/'

;stop

;== note: the output keywords are set only for LV version
file=dir_in_dat+'GRAIN.DAT'
st_temp=dustem_read_grain(file,silent=silent,key_str=key_str,G0=G0)
Ngrains=n_elements(st_temp)
st_grains={keywords:key_str,G0:G0,Ngrains:fix(Ngrains),grains:st_temp}

file=dir_in_dat+'ISRF.DAT'
st_isrf=dustem_read_isrf(file,silent=silent,Nisrf=Nisrf)

;=== Read Qabs
;st_qabs=ptrarr(st_grains.ngrains)
st_qabs=ptrarr(Ngrains)
FOR i=0,Ngrains-1 DO BEGIN
a5d1ca4f   Annie Hughes   updated doc help
22
  Qabs_file=dir_in_qabs+'Q_'+st_grains.grains[i].type+'.DAT'
427f1205   Jean-Michel Glorian   version 4.2 merged
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
  st=dustem_read_qabs_lv(Qabs_file,silent=silent)
  st_qabs(i)=ptr_new(st)
ENDFOR

;=== Read heat capacities
;st_calor=ptrarr(st_grains.ngrains)
st_calor=ptrarr(Ngrains)
FOR i=0,Ngrains-1 DO BEGIN
  Calor_file=dir_in_capa+'C_'+st_grains(i).type+'.DAT'
  st=dustem_read_calor_lv(Calor_file,silent=silent)
  st_calor(i)=ptr_new(st)
ENDFOR

;=== Read lambda
file=dir_in_qabs+'LAMBDA.DAT'
st_lambda=dustem_read_lambda(file,silent=silent)

;stop

;=== Read size distribution files
;st_size=ptrarr(st_grains.ngrains)
;mod by NF on October 2009: KEY_STR has to be tested for SIZE_XXX.DAT, not the indiviual flags !
st_size=ptrarr(Ngrains)
IF stregex(key_str, 'SIZE', /bool) THEN BEGIN
   FOR i=0,Ngrains-1 DO BEGIN
      Size_file=dir_in_dat+'SIZE_'+st_grains(i).type+'.DAT'
      st=dustem_read_size(Size_file,silent=silent)
      st_size(i)=ptr_new(st)
   ENDFOR
ENDIF ELSE BEGIN
   st_size = ptr_new()
ENDELSE
;mod by NF on October 2009: KEY_STR has to be tested for SIZE_XXX.DAT, not the indiviual flags !

;stop

;add by NF on October 2009
;=== Read MIX files
st_mix = ptrarr(Ngrains)
FOR i=0,Ngrains-1 DO BEGIN
   IF stregex(st_grains(i).flag, 'MIX', /bool) THEN BEGIN
      Mix_file=dir_in_dat+'MIX_'+st_grains(i).type+'.DAT'
      st=dustem_read_mix(Mix_file,silent=silent)
      st_mix(i)=ptr_new(st)
   ENDIF ELSE BEGIN
      st_mix(i)=ptr_new()
   ENDELSE
ENDFOR
;add by NF on October 2009



;mod by NF on October 2009: add MIX structure
st={Ngrains:Ngrains,G0:G0,Keywords:key_str,grains:st_grains, $
    isrf:st_isrf,qabs:st_qabs,calor:st_calor,lambda:st_lambda,size:st_size,mix:st_mix}
;mod by NF on October 2009: add MIX structure

RETURN,st

END