Blame view

src/idl/dustem_read_tls.pro 2.15 KB
eafc1f8f   Annie Hughes   updated help info
1
FUNCTION dustem_read_tls,dir_in,file,silent=silent,help=help
427f1205   Jean-Michel Glorian   version 4.2 merged
2

eafc1f8f   Annie Hughes   updated help info
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

;+
; NAME:
;   dustem_read_tls
;
; PURPOSE:
;   read information relating to TLS model parameters from the .DAT
;   files into a structure.
;
; CATEGORY:
;    DustEMWrap, Distributed, LowLevel, Initialization
;
; CALLING SEQUENCE:
;   st=dustem_read_tls(dir,file)
;
; INPUTS:
;    file : TLS .dat file name to be read
;    dir  : input directory to find TLS .dat file
;
; OPTIONAL INPUT PARAMETERS:
;    None
;
; OUTPUTS:
;    st : dustem data structure
;
; OPTIONAL OUTPUT PARAMETERS:
;    None
;
; ACCEPTED KEY-WORDS:
;    silent     : quiet mode
;    help     : writes this help
;
; COMMON BLOCKS:
;    None
;
; SIDE EFFECTS:
;
; RESTRICTIONS:
;    The DustEM fortran code must be installed
;    The DustEMWrap IDL code must be installed
;
; PROCEDURES AND SUBROUTINES USED:  
;
; EXAMPLES:
;
; MODIFICATION HISTORY:
;    Written DP (?)
;    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_tls' 
  full_st=0
  goto,the_end
ENDIF

  
427f1205   Jean-Michel Glorian   version 4.2 merged
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
st=''
Nmax=10000L
sts=strarr(Nmax)
openr,unit,dir_in+'data/'+file,/get_lun

;==read comments
str1='' & first_char='#'
str2=''
str3=''
WHILE first_char EQ '#' DO BEGIN
  readf,unit,str1
  readf,unit,str2
  readf,unit,str3
  first_char=strmid(str1,0,1)
ENDWHILE

ef1e3d9d   Annie Hughes   corrections for TLS
77
; row 1 of DTLS_XX.DAT FILE
427f1205   Jean-Michel Glorian   version 4.2 merged
78
stv1=str_sep(strtrim(strcompress(str1),2),' ')
ef1e3d9d   Annie Hughes   corrections for TLS
79
80
81
82
83
a_dtls=float(stv1[0])
lc=float(stv1[1])
c_delta=float(stv1[2])

; row 2 of DTLS_XX.DAT FILE
427f1205   Jean-Michel Glorian   version 4.2 merged
84
stv2=str_sep(strtrim(strcompress(str2),2),' ')
ef1e3d9d   Annie Hughes   corrections for TLS
85
86
87
88
89
vt=float(stv2[0])
Pmu=float(stv2[1])
gamma_e=float(stv2[2])

; row 3 of DTLS_XX.DAT FILE
427f1205   Jean-Michel Glorian   version 4.2 merged
90
stv3=str_sep(strtrim(strcompress(str3),2),' ')
ef1e3d9d   Annie Hughes   corrections for TLS
91
92
93
94
95
96
97
omega_m=float(stv3[0])
tau_0=float(stv3[1])
V0=float(stv3[2])
Vmin=float(stv3[3])
Vm=float(stv3[4])

; row 4 of DTLS_XX.DAT FILE
427f1205   Jean-Michel Glorian   version 4.2 merged
98
99
readf,unit,ldtresh

ef1e3d9d   Annie Hughes   corrections for TLS
100
101
102
103
104
; structure must have same order of tags as in dustem_read_all_release.pro
full_st={file:file,vt:vt,lc:lc,a_dtls:a_dtls $
         ,Pmu:Pmu,gamma_e:gamma_e, omega_m:omega_m $
         ,c_delta:c_delta,tau_0:tau_0 $
         ,V0:V0,Vmin:Vmin,Vm:Vm,ldtresh:ldtresh}
427f1205   Jean-Michel Glorian   version 4.2 merged
105
106
107

close,unit
free_lun,unit
ef1e3d9d   Annie Hughes   corrections for TLS
108

eafc1f8f   Annie Hughes   updated help info
109
the_end:
427f1205   Jean-Michel Glorian   version 4.2 merged
110
111
112
return,full_st

END