;---------------------------------------------------------------------------- ; ; read spectrum only (free format) ; ;---------------------------------------------------------------------------- PRO readspec, file, specnw, specwav, specflx ; Data array definitions specwav = FltArr(50000) specflx = FltArr(50000) ; --- ; open the data file OPENR, luspec, file, /get_lun ; skip over header header = '' FOR i = 1,3 DO BEGIN READF, luspec, 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 specwav(i) = wl specflx(i) = fl 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) END