Документ взят из кэша поисковой машины. Адрес оригинального документа : http://star.arm.ac.uk/~csj/idl/IDLINES/readspecfit.pro
Дата изменения: Sun Apr 26 18:45:33 2009
Дата индексирования: Tue Oct 2 08:16:49 2012
Кодировка:

Поисковые слова: m 8
;----------------------------------------------------------------------------
;
; read spectrum and fit (sfit_synth output)
;
;----------------------------------------------------------------------------

PRO readspecfit, file, specnw, specwav, specflx, specfit


; Data array definitions

smax = 50000
specwav = FltArr(smax)
specflx = FltArr(smax)
specfit = FltArr(smax)

; ---


; open the data file

OPENR, luspec, file, /get_lun


; skip over header

header = ''
FOR i = 1,3 DO BEGIN
READF, luspec, header
print, header
ENDFOR

; read individual lines in list

i = 0 & valid = 0
WHILE valid EQ 0 DO BEGIN
ON_IOERROR, end_of_data
READF, luspec, wl, fl, fs, ff
specwav(i) = wl
specflx(i) = fl
specfit(i) = ff
i = i + 1
ENDWHILE

; end of data, close file

end_of_data:
CLOSE, luspec
FREE_LUN, luspec


; tidy up output arrays

specnw = i
specwav = specwav(0:i-1)
specflx = specflx(0:i-1)
specfit = specfit(0:i-1)

END