pro DIG_2,jmeno,spectr ; ; Reading routine for spectra in the .dig format. ; INPUT: JMENO - name of file to read ; OUTPUT: SPECTR - 2D array with the spectrum ; ; Copyright M. Klvana and M. Sobotka, ASU AVCR Ondrejov, Czech Rep., 2007 openr, 102, jmeno hlavicka = bytarr(88) readu, 102, hlavicka ;****************************** array size ********************************* xpx=long(hlavicka[52:55]) xpix=((xpx[3]*256+xpx[2])*256+xpx[1])*256+xpx[0] ;print, xpix ;width of spectrum in pixels ypx=long(hlavicka[56:59]) ypix=((ypx[3]*256+ypx[2])*256+ypx[1])*256+ypx[0] ;height of spectrum in pixels ;print, ypix ;************************** reading of DIG format *************************** pole=bytarr(2*xpix,ypix) readu, 102, pole close, 102 x=findgen(2*xpix) x1=x(where(x mod 2)) x2=x1-1 pole1=pole(x1,*) ;licha pole2=pole(x2,*) ;suda pole1=fix(pole1) pole2=ishft(pole2,-4) pole2=fix(pole2) pole1=pole1*16 spectr = pole1 + pole2 END