PRO sp2wr, file, x, y, header ; Write a 1d function into a spectrum format 2 file ndat = n_elements(x) openw,lun,file,/get_lun PrintF, lun, header PrintF, lun PrintF, lun, ndat FOR i = 0L,ndat-1 DO BEGIN xx = x(i) & yy = y(i) PrintF, lun, xx,yy, format='(f10.4,2x,e12.5)' ENDFOR close,lun free_lun, lun END