Blame view

src/idl/dustem_read_mix.pro 747 Bytes
427f1205   Jean-Michel Glorian   version 4.2 merged
1
FUNCTION dustem_read_mix,file,silent=silent
37b5d8a7   Jean-Philippe Bernard   fixed to adapt gr...
2
3
4
5
6

;st=''
;Nmax=10000L
;sts=strarr(Nmax)
openr,unit,file,/get_lun
427f1205   Jean-Michel Glorian   version 4.2 merged
7
8
  
;==read comments
37b5d8a7   Jean-Philippe Bernard   fixed to adapt gr...
9
10
11
12
13
14
15
16
17
18
19
20
str=''
first_char='#'
comments=['# File written by Dustem_wrapper on '+systime()]
Ncomments=1L
REPEAT BEGIN
  readf,unit,str
  ;print,str
  first_char=strmid(str,0,1)
  comments=[comments,str]
  IF first_char EQ '#' THEN Ncomments=Ncomments+1
ENDREP UNTIL first_char NE '#'
comments=comments[0:Ncomments-1]
427f1205   Jean-Michel Glorian   version 4.2 merged
21
22
;==read FMIX
;last line in previous WHILE loop is first FMIX
37b5d8a7   Jean-Philippe Bernard   fixed to adapt gr...
23
24
25
26
27
28
tmp = [double(str)]
WHILE NOT EOF(unit) DO BEGIN
  readf, unit, newline
  tmp = [tmp, newline]
ENDWHILE
fmix = tmp
427f1205   Jean-Michel Glorian   version 4.2 merged
29
30

;==save and return structure
37b5d8a7   Jean-Philippe Bernard   fixed to adapt gr...
31
full_st={file:file,fmix:fmix,comments:comments}
427f1205   Jean-Michel Glorian   version 4.2 merged
32
  
37b5d8a7   Jean-Philippe Bernard   fixed to adapt gr...
33
34
35
36
37
38
close,unit
free_lun,unit

;stop

RETURN,full_st
427f1205   Jean-Michel Glorian   version 4.2 merged
39
40
  
END