Blame view

src/idl/dustem_read_tls.pro 1.93 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
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

stv1=str_sep(strtrim(strcompress(str1),2),' ')
a_dtls=float(stv1(0))
lc=float(stv1(1))
c_delta=float(stv1(2))
stv2=str_sep(strtrim(strcompress(str2),2),' ')
vt=float(stv2(0))
Pmu=float(stv2(1))
gamma_e=float(stv2(2))
stv3=str_sep(strtrim(strcompress(str3),2),' ')
omega_m=float(stv3(0))
tau_0=float(stv3(1))
V0=float(stv3(2))
Vmin=float(stv3(3))
Vm=float(stv3(4))
readf,unit,ldtresh

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}

close,unit
free_lun,unit
eafc1f8f   Annie Hughes   updated help info
97
98
;cd 
the_end:
427f1205   Jean-Michel Glorian   version 4.2 merged
99
100
101
return,full_st

END